summaryrefslogtreecommitdiffstats
path: root/xbmc/interfaces/legacy/WindowDialog.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /xbmc/interfaces/legacy/WindowDialog.cpp
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/interfaces/legacy/WindowDialog.cpp')
-rw-r--r--xbmc/interfaces/legacy/WindowDialog.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/xbmc/interfaces/legacy/WindowDialog.cpp b/xbmc/interfaces/legacy/WindowDialog.cpp
new file mode 100644
index 0000000..13ea4fd
--- /dev/null
+++ b/xbmc/interfaces/legacy/WindowDialog.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "WindowDialog.h"
+
+#include "ServiceBroker.h"
+#include "WindowInterceptor.h"
+#include "guilib/GUIComponent.h"
+#include "guilib/GUIWindow.h"
+#include "guilib/GUIWindowManager.h"
+
+#include <mutex>
+
+namespace XBMCAddon
+{
+ namespace xbmcgui
+ {
+ WindowDialog::WindowDialog() :
+ Window(true), WindowDialogMixin(this)
+ {
+ std::unique_lock<CCriticalSection> lock(CServiceBroker::GetWinSystem()->GetGfxContext());
+ InterceptorBase* interceptor = new Interceptor<CGUIWindow>("CGUIWindow", this, getNextAvailableWindowId());
+ // set the render order to the dialog's default because this dialog is mapped to CGUIWindow instead of CGUIDialog
+ interceptor->SetRenderOrder(RENDER_ORDER_DIALOG);
+ setWindow(interceptor);
+ }
+
+ WindowDialog::~WindowDialog() { deallocating(); }
+
+ bool WindowDialog::OnMessage(CGUIMessage& message)
+ {
+#ifdef ENABLE_XBMC_TRACE_API
+ XBMC_TRACE;
+ CLog::Log(LOGDEBUG, "{}NEWADDON WindowDialog::OnMessage Message {}", _tg.getSpaces(),
+ message.GetMessage());
+#endif
+
+ switch(message.GetMessage())
+ {
+ case GUI_MSG_WINDOW_INIT:
+ {
+ ref(window)->OnMessage(message);
+ return true;
+ }
+ break;
+
+ case GUI_MSG_CLICKED:
+ {
+ return Window::OnMessage(message);
+ }
+ break;
+ }
+
+ // we do not message CGUIPythonWindow here..
+ return ref(window)->OnMessage(message);
+ }
+
+ bool WindowDialog::OnAction(const CAction &action)
+ {
+ XBMC_TRACE;
+ return WindowDialogMixin::OnAction(action) ? true : Window::OnAction(action);
+ }
+
+ void WindowDialog::OnDeinitWindow(int nextWindowID)
+ {
+ CServiceBroker::GetGUI()->GetWindowManager().RemoveDialog(iWindowId);
+ Window::OnDeinitWindow(nextWindowID);
+ }
+
+ }
+}