From de194c4aa2d865266ee46f92b9ef3a38280cb76f Mon Sep 17 00:00:00 2001
From: 23rd <23rd@vivaldi.net>
Date: Wed, 23 Mar 2022 18:59:53 +0300
Subject: [PATCH] Initialized empty files for tray implementations.

---
 Telegram/CMakeLists.txt                       |  9 +++++++
 Telegram/SourceFiles/core/application.cpp     |  7 ++++++
 Telegram/SourceFiles/core/application.h       |  4 ++++
 .../SourceFiles/platform/linux/tray_linux.cpp | 15 ++++++++++++
 .../SourceFiles/platform/linux/tray_linux.h   | 22 +++++++++++++++++
 Telegram/SourceFiles/platform/mac/tray_mac.h  | 22 +++++++++++++++++
 Telegram/SourceFiles/platform/mac/tray_mac.mm | 15 ++++++++++++
 Telegram/SourceFiles/platform/platform_tray.h | 24 +++++++++++++++++++
 .../SourceFiles/platform/win/tray_win.cpp     | 15 ++++++++++++
 Telegram/SourceFiles/platform/win/tray_win.h  | 22 +++++++++++++++++
 Telegram/SourceFiles/tray.cpp                 | 15 ++++++++++++
 Telegram/SourceFiles/tray.h                   | 23 ++++++++++++++++++
 12 files changed, 193 insertions(+)
 create mode 100644 Telegram/SourceFiles/platform/linux/tray_linux.cpp
 create mode 100644 Telegram/SourceFiles/platform/linux/tray_linux.h
 create mode 100644 Telegram/SourceFiles/platform/mac/tray_mac.h
 create mode 100644 Telegram/SourceFiles/platform/mac/tray_mac.mm
 create mode 100644 Telegram/SourceFiles/platform/platform_tray.h
 create mode 100644 Telegram/SourceFiles/platform/win/tray_win.cpp
 create mode 100644 Telegram/SourceFiles/platform/win/tray_win.h
 create mode 100644 Telegram/SourceFiles/tray.cpp
 create mode 100644 Telegram/SourceFiles/tray.h

diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
index 0050add99..c2a6e1b95 100644
--- a/Telegram/CMakeLists.txt
+++ b/Telegram/CMakeLists.txt
@@ -990,6 +990,8 @@ PRIVATE
     platform/linux/notifications_manager_linux.h
     platform/linux/specific_linux.cpp
     platform/linux/specific_linux.h
+    platform/linux/tray_linux.cpp
+    platform/linux/tray_linux.h
     platform/mac/file_utilities_mac.mm
     platform/mac/file_utilities_mac.h
     platform/mac/launcher_mac.mm
@@ -1005,6 +1007,8 @@ PRIVATE
     platform/mac/specific_mac.h
     platform/mac/specific_mac_p.mm
     platform/mac/specific_mac_p.h
+    platform/mac/tray_mac.mm
+    platform/mac/tray_mac.h
     platform/mac/window_title_mac.mm
     platform/mac/touchbar/items/mac_formatter_item.h
     platform/mac/touchbar/items/mac_formatter_item.mm
@@ -1038,6 +1042,8 @@ PRIVATE
     platform/win/notifications_manager_win.h
     platform/win/specific_win.cpp
     platform/win/specific_win.h
+    platform/win/tray_win.cpp
+    platform/win/tray_win.h
     platform/win/windows_app_user_model_id.cpp
     platform/win/windows_app_user_model_id.h
     platform/win/windows_dlls.cpp
@@ -1054,6 +1060,7 @@ PRIVATE
     platform/platform_main_window.h
     platform/platform_notifications_manager.h
     platform/platform_specific.h
+    platform/platform_tray.h
     platform/platform_window_title.h
     profile/profile_back_button.cpp
     profile/profile_back_button.h
@@ -1260,6 +1267,8 @@ PRIVATE
     settings.cpp
     settings.h
     stdafx.h
+    tray.cpp
+    tray.h
 )
 
 if (NOT build_winstore)
diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp
index 2cb67dd26..fc8177ccc 100644
--- a/Telegram/SourceFiles/core/application.cpp
+++ b/Telegram/SourceFiles/core/application.cpp
@@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 #include "lang/lang_instance.h"
 #include "inline_bots/bot_attach_web_view.h"
 #include "mainwidget.h"
+#include "tray.h"
 #include "core/file_utilities.h"
 #include "core/click_handler_types.h" // ClickHandlerContext.
 #include "core/crash_reports.h"
@@ -149,6 +150,7 @@ Application::Application(not_null<Launcher*> launcher)
 , _langpack(std::make_unique<Lang::Instance>())
 , _langCloudManager(std::make_unique<Lang::CloudManager>(langpack()))
 , _emojiKeywords(std::make_unique<ChatHelpers::EmojiKeywords>())
+, _tray(std::make_unique<Tray>())
 , _autoLockTimer([=] { checkAutoLock(); }) {
 	Ui::Integration::Set(&_private->uiIntegration);
 
@@ -300,6 +302,8 @@ void Application::run() {
 	startShortcuts();
 	startDomain();
 
+	startTray();
+
 	_primaryWindow->widget()->show();
 
 	const auto currentGeometry = _primaryWindow->widget()->geometry();
@@ -409,6 +413,9 @@ void Application::startSystemDarkModeViewer() {
 	}, _lifetime);
 }
 
+void Application::startTray() {
+}
+
 auto Application::prepareEmojiSourceImages()
 -> std::shared_ptr<Ui::Emoji::UniversalImages> {
 	const auto &images = Ui::Emoji::SourceImages();
diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h
index cff4bea88..ae3240cd9 100644
--- a/Telegram/SourceFiles/core/application.h
+++ b/Telegram/SourceFiles/core/application.h
@@ -103,6 +103,7 @@ namespace Core {
 
 class Launcher;
 struct LocalUrlHandler;
+class Tray;
 
 enum class LaunchState {
 	Running,
@@ -317,6 +318,7 @@ private:
 	void startDomain();
 	void startEmojiImageLoader();
 	void startSystemDarkModeViewer();
+	void startTray();
 
 	friend void QuitAttempt();
 	void quitDelayed();
@@ -377,6 +379,8 @@ private:
 	std::unique_ptr<Lang::Translator> _translator;
 	QPointer<Ui::BoxContent> _badProxyDisableBox;
 
+	const std::unique_ptr<Tray> _tray;
+
 	std::unique_ptr<Media::Player::FloatController> _floatPlayers;
 	Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr;
 	Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr;
diff --git a/Telegram/SourceFiles/platform/linux/tray_linux.cpp b/Telegram/SourceFiles/platform/linux/tray_linux.cpp
new file mode 100644
index 000000000..216cbcf6d
--- /dev/null
+++ b/Telegram/SourceFiles/platform/linux/tray_linux.cpp
@@ -0,0 +1,15 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#include "platform/linux/tray_linux.h"
+
+namespace Platform {
+
+Tray::Tray() {
+}
+
+} // namespace Platform
diff --git a/Telegram/SourceFiles/platform/linux/tray_linux.h b/Telegram/SourceFiles/platform/linux/tray_linux.h
new file mode 100644
index 000000000..d0a89b285
--- /dev/null
+++ b/Telegram/SourceFiles/platform/linux/tray_linux.h
@@ -0,0 +1,22 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+#include "platform/platform_tray.h"
+
+namespace Platform {
+
+class Tray final {
+public:
+	Tray();
+
+private:
+
+};
+
+} // namespace Platform
diff --git a/Telegram/SourceFiles/platform/mac/tray_mac.h b/Telegram/SourceFiles/platform/mac/tray_mac.h
new file mode 100644
index 000000000..d0a89b285
--- /dev/null
+++ b/Telegram/SourceFiles/platform/mac/tray_mac.h
@@ -0,0 +1,22 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+#include "platform/platform_tray.h"
+
+namespace Platform {
+
+class Tray final {
+public:
+	Tray();
+
+private:
+
+};
+
+} // namespace Platform
diff --git a/Telegram/SourceFiles/platform/mac/tray_mac.mm b/Telegram/SourceFiles/platform/mac/tray_mac.mm
new file mode 100644
index 000000000..4f800239d
--- /dev/null
+++ b/Telegram/SourceFiles/platform/mac/tray_mac.mm
@@ -0,0 +1,15 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#include "platform/mac/tray_mac.h"
+
+namespace Platform {
+
+Tray::Tray() {
+}
+
+} // namespace Platform
diff --git a/Telegram/SourceFiles/platform/platform_tray.h b/Telegram/SourceFiles/platform/platform_tray.h
new file mode 100644
index 000000000..3d6b90724
--- /dev/null
+++ b/Telegram/SourceFiles/platform/platform_tray.h
@@ -0,0 +1,24 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+namespace Platform {
+
+class Tray;
+
+} // namespace Platform
+
+// Platform dependent implementations.
+
+#ifdef Q_OS_MAC
+#include "platform/mac/tray_mac.h"
+#elif defined Q_OS_UNIX // Q_OS_MAC
+#include "platform/linux/tray_linux.h"
+#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
+#include "platform/win/tray_win.h"
+#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
diff --git a/Telegram/SourceFiles/platform/win/tray_win.cpp b/Telegram/SourceFiles/platform/win/tray_win.cpp
new file mode 100644
index 000000000..b487846b1
--- /dev/null
+++ b/Telegram/SourceFiles/platform/win/tray_win.cpp
@@ -0,0 +1,15 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#include "platform/win/tray_win.h"
+
+namespace Platform {
+
+Tray::Tray() {
+}
+
+} // namespace Platform
diff --git a/Telegram/SourceFiles/platform/win/tray_win.h b/Telegram/SourceFiles/platform/win/tray_win.h
new file mode 100644
index 000000000..d0a89b285
--- /dev/null
+++ b/Telegram/SourceFiles/platform/win/tray_win.h
@@ -0,0 +1,22 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+#include "platform/platform_tray.h"
+
+namespace Platform {
+
+class Tray final {
+public:
+	Tray();
+
+private:
+
+};
+
+} // namespace Platform
diff --git a/Telegram/SourceFiles/tray.cpp b/Telegram/SourceFiles/tray.cpp
new file mode 100644
index 000000000..f608a9ab4
--- /dev/null
+++ b/Telegram/SourceFiles/tray.cpp
@@ -0,0 +1,15 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#include "tray.h"
+
+namespace Core {
+
+Tray::Tray() {
+}
+
+} // namespace Core
diff --git a/Telegram/SourceFiles/tray.h b/Telegram/SourceFiles/tray.h
new file mode 100644
index 000000000..3e5a0c9d6
--- /dev/null
+++ b/Telegram/SourceFiles/tray.h
@@ -0,0 +1,23 @@
+/*
+This file is part of Telegram Desktop,
+the official desktop application for the Telegram messaging service.
+
+For license and copyright information please follow this link:
+https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+*/
+#pragma once
+
+#include "platform/platform_tray.h"
+
+namespace Core {
+
+class Tray final {
+public:
+	Tray();
+
+private:
+	Platform::Tray _tray;
+
+};
+
+} // namespace Core