aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2009-10-07 01:27:50 +0000
committerjmarshallnz <jmarshallnz@svn>2009-10-07 01:27:50 +0000
commit363c74fafa695c1bfb23c0bf34f35ba69c1212ec (patch)
tree1a2b21d1dd66db30ba57520ec093f1f7f0ce48df
parenta53a6e0fd407e28a4b5b34fcd3ea67bbd4e0df8a (diff)
changed: Get rid of the use of g_graphicsContext to send messages (all it did was passed them on to the window manager.)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23492 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--guilib/GUIBaseContainer.cpp3
-rw-r--r--guilib/GUIButtonControl.cpp2
-rw-r--r--guilib/GUIButtonScroller.cpp2
-rw-r--r--guilib/GUIControl.cpp4
-rw-r--r--guilib/GUIEditControl.cpp3
-rw-r--r--guilib/GUIFontManager.cpp3
-rw-r--r--guilib/GUIMultiSelectText.cpp3
-rw-r--r--guilib/GUIVideoControl.cpp2
-rw-r--r--guilib/GUIVisualisationControl.cpp5
-rw-r--r--guilib/GUIWindow.cpp2
-rw-r--r--guilib/GUIWindowManager.cpp7
-rw-r--r--guilib/GUIWindowManager.h4
-rw-r--r--guilib/GraphicContext.cpp21
-rw-r--r--guilib/GraphicContext.h8
-rw-r--r--guilib/IMsgSenderCallback.h45
-rw-r--r--project/VS2008Express/guilib.vcproj6
-rw-r--r--xbmc/Application.cpp6
-rw-r--r--xbmc/GUIDialogContentSettings.cpp12
-rw-r--r--xbmc/GUIDialogFavourites.cpp2
-rw-r--r--xbmc/GUIDialogKeyboard.cpp2
-rw-r--r--xbmc/GUIDialogMusicOSD.cpp2
-rw-r--r--xbmc/GUIDialogSelect.cpp9
-rw-r--r--xbmc/GUIDialogSongInfo.cpp4
-rw-r--r--xbmc/GUIDialogVisualisationPresetList.cpp3
-rw-r--r--xbmc/GUIDialogVisualisationSettings.cpp3
-rw-r--r--xbmc/GUIMediaWindow.cpp4
-rw-r--r--xbmc/GUIViewControl.cpp21
-rw-r--r--xbmc/GUIWindowFileManager.cpp10
-rw-r--r--xbmc/GUIWindowMusicBase.cpp8
-rw-r--r--xbmc/GUIWindowMusicInfo.cpp7
-rw-r--r--xbmc/GUIWindowMusicNav.cpp2
-rw-r--r--xbmc/GUIWindowMusicOverlay.cpp4
-rw-r--r--xbmc/GUIWindowPictures.cpp4
-rw-r--r--xbmc/GUIWindowSettingsCategory.cpp14
-rw-r--r--xbmc/GUIWindowSettingsProfile.cpp12
-rw-r--r--xbmc/GUIWindowVideoBase.cpp8
-rw-r--r--xbmc/GUIWindowVideoInfo.cpp2
-rw-r--r--xbmc/GUIWindowVideoNav.cpp2
-rw-r--r--xbmc/GUIWindowVisualisation.cpp2
-rw-r--r--xbmc/GUIWindowWeather.cpp6
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayer.cpp3
-rw-r--r--xbmc/lib/libPython/XBPython.cpp5
-rw-r--r--xbmc/lib/libPython/XBPython.h4
-rw-r--r--xbmc/utils/Builtins.cpp42
-rw-r--r--xbmc/utils/GUIInfoManager.cpp4
45 files changed, 129 insertions, 198 deletions
diff --git a/guilib/GUIBaseContainer.cpp b/guilib/GUIBaseContainer.cpp
index 3bfe8c6c51..f453bc9d97 100644
--- a/guilib/GUIBaseContainer.cpp
+++ b/guilib/GUIBaseContainer.cpp
@@ -21,6 +21,7 @@
#include "GUIBaseContainer.h"
#include "GUIControlFactory.h"
+#include "GUIWindowManager.h"
#include "utils/CharsetConverter.h"
#include "utils/GUIInfoManager.h"
#include "utils/TimeUtils.h"
@@ -622,7 +623,7 @@ bool CGUIBaseContainer::OnClick(int actionID)
action.Replace(",,", ",");
CGUIMessage message(GUI_MSG_EXECUTE, GetID(), GetParentID());
message.SetStringParam(action);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
}
return true;
diff --git a/guilib/GUIButtonControl.cpp b/guilib/GUIButtonControl.cpp
index 5a85984bd7..b36f099d00 100644
--- a/guilib/GUIButtonControl.cpp
+++ b/guilib/GUIButtonControl.cpp
@@ -296,7 +296,7 @@ void CGUIButtonControl::OnClick()
{
CGUIMessage message(GUI_MSG_EXECUTE, controlID, parentID);
message.SetAction(clickActions[i]);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
}
diff --git a/guilib/GUIButtonScroller.cpp b/guilib/GUIButtonScroller.cpp
index 1bfc096c5b..74ff4b82e5 100644
--- a/guilib/GUIButtonScroller.cpp
+++ b/guilib/GUIButtonScroller.cpp
@@ -124,7 +124,7 @@ bool CGUIButtonScroller::OnAction(const CAction &action)
CGUIMessage message(GUI_MSG_EXECUTE, GetID(), GetParentID());
// find our currently highlighted item
message.SetAction(actions[i]);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
return true;
}
diff --git a/guilib/GUIControl.cpp b/guilib/GUIControl.cpp
index afd2a89a83..9fb2b58e8e 100644
--- a/guilib/GUIControl.cpp
+++ b/guilib/GUIControl.cpp
@@ -287,7 +287,7 @@ bool CGUIControl::SendWindowMessage(CGUIMessage &message)
CGUIWindow *pWindow = m_gWindowManager.GetWindow(GetParentID());
if (pWindow)
return pWindow->OnMessage(message);
- return g_graphicsContext.SendMessage(message);
+ return m_gWindowManager.SendMessage(message);
}
int CGUIControl::GetID(void) const
@@ -872,7 +872,7 @@ void CGUIControl::ExecuteActions(const vector<CGUIActionDescriptor> &actions)
{
CGUIMessage message(GUI_MSG_EXECUTE, savedID, savedParent);
message.SetAction(savedActions[i]);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
}
diff --git a/guilib/GUIEditControl.cpp b/guilib/GUIEditControl.cpp
index ed339a92f0..a711e456a6 100644
--- a/guilib/GUIEditControl.cpp
+++ b/guilib/GUIEditControl.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIEditControl.h"
+#include "GUIWindowManager.h"
#include "utils/CharsetConverter.h"
#include "GUIDialogKeyboard.h"
#include "GUIDialogNumeric.h"
@@ -440,7 +441,7 @@ void CGUIEditControl::OnTextChanged()
{
CGUIMessage message(GUI_MSG_EXECUTE, GetID(), GetParentID());
message.SetAction(textChangeActions[i]);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
SetInvalid();
diff --git a/guilib/GUIFontManager.cpp b/guilib/GUIFontManager.cpp
index 71c68791c4..c035d01def 100644
--- a/guilib/GUIFontManager.cpp
+++ b/guilib/GUIFontManager.cpp
@@ -21,6 +21,7 @@
#include "GUIFontManager.h"
#include "GraphicContext.h"
+#include "GUIWindowManager.h"
#include "SkinInfo.h"
#include "GUIFontTTF.h"
#include "GUIFont.h"
@@ -191,7 +192,7 @@ void GUIFontManager::ReloadTTFFonts(void)
m_bFontsNeedReloading = false;
// send a message to our controls telling them they need to refresh.
- g_graphicsContext.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_INVALIDATE);
+ m_gWindowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_INVALIDATE);
}
void GUIFontManager::Unload(const CStdString& strFontName)
diff --git a/guilib/GUIMultiSelectText.cpp b/guilib/GUIMultiSelectText.cpp
index 25e7ae62df..b75e31f80d 100644
--- a/guilib/GUIMultiSelectText.cpp
+++ b/guilib/GUIMultiSelectText.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIMultiSelectText.h"
+#include "GUIWindowManager.h"
#include "Key.h"
#include "MouseStat.h"
#include "utils/log.h"
@@ -174,7 +175,7 @@ bool CGUIMultiSelectTextControl::OnAction(const CAction &action)
{ // have a click action -> perform it
CGUIMessage message(GUI_MSG_EXECUTE, m_controlID, m_parentID);
message.SetStringParam(clickAction);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else
{ // no click action, just send a message to the window
diff --git a/guilib/GUIVideoControl.cpp b/guilib/GUIVideoControl.cpp
index 3a0f9cccac..e669a8359f 100644
--- a/guilib/GUIVideoControl.cpp
+++ b/guilib/GUIVideoControl.cpp
@@ -74,7 +74,7 @@ bool CGUIVideoControl::OnMouseClick(int button, const CPoint &point)
if (button == MOUSE_LEFT_BUTTON)
{
CGUIMessage message(GUI_MSG_FULLSCREEN, GetID(), GetParentID());
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
return true;
}
if (button == MOUSE_RIGHT_BUTTON)
diff --git a/guilib/GUIVisualisationControl.cpp b/guilib/GUIVisualisationControl.cpp
index acd7554147..2ee9037808 100644
--- a/guilib/GUIVisualisationControl.cpp
+++ b/guilib/GUIVisualisationControl.cpp
@@ -1,4 +1,5 @@
#include "GUIVisualisationControl.h"
+#include "GUIWindowManager.h"
#include "GUIUserMessages.h"
#include "Application.h"
#include "visualizations/Visualisation.h"
@@ -101,7 +102,7 @@ void CGUIVisualisationControl::FreeVisualisation()
m_bInitialized = false;
// tell our app that we're going
CGUIMessage msg(GUI_MSG_VISUALISATION_UNLOADING, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
CSingleLock lock (m_critSection);
@@ -186,7 +187,7 @@ void CGUIVisualisationControl::LoadVisualisation()
// tell our app that we're back
CGUIMessage msg(GUI_MSG_VISUALISATION_LOADED, 0, 0, 0, 0, m_pVisualisation);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
void CGUIVisualisationControl::UpdateVisibility(const CGUIListItem *item)
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp
index 8a76688113..8637bfbe1d 100644
--- a/guilib/GUIWindow.cpp
+++ b/guilib/GUIWindow.cpp
@@ -1003,7 +1003,7 @@ void CGUIWindow::RunActions(std::vector<CGUIActionDescriptor>& actions)
{
CGUIMessage message(GUI_MSG_EXECUTE, 0, GetID());
message.SetAction(tempActions[i]);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
}
diff --git a/guilib/GUIWindowManager.cpp b/guilib/GUIWindowManager.cpp
index e2ec0761d8..8779280dc7 100644
--- a/guilib/GUIWindowManager.cpp
+++ b/guilib/GUIWindowManager.cpp
@@ -48,10 +48,15 @@ CGUIWindowManager::~CGUIWindowManager(void)
void CGUIWindowManager::Initialize()
{
- g_graphicsContext.setMessageSender(this);
LoadNotOnDemandWindows();
}
+bool CGUIWindowManager::SendMessage(int message, int senderID, int destID, int param1, int param2)
+{
+ CGUIMessage msg(message, senderID, destID, param1, param2);
+ return SendMessage(msg);
+}
+
bool CGUIWindowManager::SendMessage(CGUIMessage& message)
{
bool handled = false;
diff --git a/guilib/GUIWindowManager.h b/guilib/GUIWindowManager.h
index 8120e89562..7d5f7962e4 100644
--- a/guilib/GUIWindowManager.h
+++ b/guilib/GUIWindowManager.h
@@ -30,7 +30,6 @@
*/
#include "GUIWindow.h"
-#include "IMsgSenderCallback.h"
#include "IWindowManagerCallback.h"
#include "IMsgTargetCallback.h"
@@ -42,12 +41,13 @@ class CGUIDialog;
\ingroup winman
\brief
*/
-class CGUIWindowManager: public IMsgSenderCallback
+class CGUIWindowManager
{
public:
CGUIWindowManager(void);
virtual ~CGUIWindowManager(void);
bool SendMessage(CGUIMessage& message);
+ bool SendMessage(int message, int senderID, int destID, int param1 = 0, int param2 = 0);
bool SendMessage(CGUIMessage& message, int window);
void Initialize();
void Add(CGUIWindow* pWindow);
diff --git a/guilib/GraphicContext.cpp b/guilib/GraphicContext.cpp
index a3a4032dc1..a56ccb9b40 100644
--- a/guilib/GraphicContext.cpp
+++ b/guilib/GraphicContext.cpp
@@ -22,8 +22,6 @@
#include "system.h"
#include "GraphicContext.h"
#include "GUIFontManager.h"
-#include "GUIMessage.h"
-#include "IMsgSenderCallback.h"
#include "utils/SingleLock.h"
#include "Application.h"
#include "GUISettings.h"
@@ -51,7 +49,6 @@ CGraphicContext::CGraphicContext(void)
m_strMediaDir = "";
m_bCalibrating = false;
m_Resolution = RES_INVALID;
- m_pCallback = NULL;
m_guiScaleX = m_guiScaleY = 1.0f;
m_windowResolution = RES_INVALID;
m_bFullScreenRoot = false;
@@ -61,24 +58,6 @@ CGraphicContext::~CGraphicContext(void)
{
}
-bool CGraphicContext::SendMessage(int message, int senderID, int destID, int param1, int param2)
-{
- if (!m_pCallback) return false;
- CGUIMessage msg(message, senderID, destID, param1, param2);
- return m_pCallback->SendMessage(msg);
-}
-
-bool CGraphicContext::SendMessage(CGUIMessage& message)
-{
- if (!m_pCallback) return false;
- return m_pCallback->SendMessage(message);
-}
-
-void CGraphicContext::setMessageSender(IMsgSenderCallback* pCallback)
-{
- m_pCallback = pCallback;
-}
-
void CGraphicContext::SetOrigin(float x, float y)
{
if (m_origins.size())
diff --git a/guilib/GraphicContext.h b/guilib/GraphicContext.h
index 19c1989488..7c4babf338 100644
--- a/guilib/GraphicContext.h
+++ b/guilib/GraphicContext.h
@@ -47,10 +47,6 @@
#include "StdString.h"
#include "Resolution.h"
-// forward definitions
-class IMsgSenderCallback;
-class CGUIMessage;
-
enum VIEW_TYPE { VIEW_TYPE_NONE = 0,
VIEW_TYPE_LIST,
VIEW_TYPE_ICON,
@@ -78,9 +74,6 @@ public:
int GetWidth() const { return m_iScreenWidth; }
int GetHeight() const { return m_iScreenHeight; }
float GetFPS() const;
- bool SendMessage(CGUIMessage& message);
- bool SendMessage(int message, int senderID, int destID, int param1 = 0, int param2 = 0);
- void setMessageSender(IMsgSenderCallback* pCallback);
const CStdString& GetMediaDir() const { return m_strMediaDir; }
void SetMediaDir(const CStdString& strMediaDir);
bool IsWidescreen() const { return m_bWidescreen; }
@@ -169,7 +162,6 @@ public:
protected:
void SetFullScreenViewWindow(RESOLUTION &res);
- IMsgSenderCallback* m_pCallback;
std::stack<CRect> m_viewStack;
int m_iScreenHeight;
diff --git a/guilib/IMsgSenderCallback.h b/guilib/IMsgSenderCallback.h
deleted file mode 100644
index 3f825d4469..0000000000
--- a/guilib/IMsgSenderCallback.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*!
-\file IMsgSenderCallback.h
-\brief
-*/
-
-#ifndef GUILIB_IMSGSENDERCALLBACK
-#define GUILIB_IMSGSENDERCALLBACK
-
-#pragma once
-
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "GUIMessage.h"
-
-/*!
- \ingroup winman
- \brief
- */
-class IMsgSenderCallback
-{
-public:
- virtual bool SendMessage(CGUIMessage& message) = 0;
- virtual ~IMsgSenderCallback() {}
-};
-
-#endif
diff --git a/project/VS2008Express/guilib.vcproj b/project/VS2008Express/guilib.vcproj
index 40a0b6d08b..e86ce46d87 100644
--- a/project/VS2008Express/guilib.vcproj
+++ b/project/VS2008Express/guilib.vcproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="guilib"
ProjectGUID="{510441AC-B9E1-4B31-9C0C-EB3AD39D90C4}"
RootNamespace="guilib"
@@ -948,10 +948,6 @@
>
</File>
<File
- RelativePath="..\..\guilib\IMsgSenderCallback.h"
- >
- </File>
- <File
RelativePath="..\..\guilib\IMsgTargetCallback.h"
>
</File>
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 06fa8b150d..21c6a68a85 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -1744,7 +1744,7 @@ void CApplication::CancelDelayLoadSkin()
void CApplication::ReloadSkin()
{
CGUIMessage msg(GUI_MSG_LOAD_SKIN, -1, m_gWindowManager.GetActiveWindow());
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// Reload the skin, restoring the previously focused control. We need this as
// the window unload will reset all control states.
CGUIWindow* pWindow = m_gWindowManager.GetWindow(m_gWindowManager.GetActiveWindow());
@@ -2609,7 +2609,7 @@ bool CApplication::OnAction(CAction &action)
}
// send a message to all windows to tell them to update the fileitem (eg playlistplayer, media windows)
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_ITEM, 0, m_itemCurrentFile);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
}
return true;
@@ -4104,7 +4104,7 @@ void CApplication::SaveFileState()
videodatabase.MarkAsWatched(*m_progressTrackingItem);
CUtil::DeleteVideoDatabaseDirectoryCache();
CGUIMessage message(GUI_MSG_NOTIFY_ALL, m_gWindowManager.GetActiveWindow(), 0, GUI_MSG_UPDATE, 0);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
if (g_stSettings.m_currentVideoSettings != g_stSettings.m_defaultVideoSettings)
diff --git a/xbmc/GUIDialogContentSettings.cpp b/xbmc/GUIDialogContentSettings.cpp
index 19c3d1cbc3..3e74bd2093 100644
--- a/xbmc/GUIDialogContentSettings.cpp
+++ b/xbmc/GUIDialogContentSettings.cpp
@@ -228,21 +228,21 @@ void CGUIDialogContentSettings::SetupPage()
CGUIDialogSettings::SetupPage();
CGUIMessage msg(GUI_MSG_LABEL_RESET,GetID(),CONTROL_CONTENT_TYPE);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
CGUIMessage msg2(GUI_MSG_LABEL_ADD,GetID(),CONTROL_CONTENT_TYPE);
if (!m_info.strContent.Equals("albums")) // none does not apply to music
{
msg2.SetLabel("<"+g_localizeStrings.Get(231)+">");
msg2.SetParam1(0);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
if (m_scrapers.find("movies") != m_scrapers.end())
{
msg2.SetLabel(g_localizeStrings.Get(20342));
msg2.SetParam1(1);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
if (m_info.strContent.Equals("movies"))
{
SET_CONTROL_LABEL(CONTROL_CONTENT_TYPE,g_localizeStrings.Get(20342));
@@ -254,7 +254,7 @@ void CGUIDialogContentSettings::SetupPage()
{
msg2.SetLabel(g_localizeStrings.Get(20343));
msg2.SetParam1(2);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
if (m_info.strContent.Equals("tvshows"))
{
CONTROL_SELECT_ITEM(CONTROL_CONTENT_TYPE, 2);
@@ -264,7 +264,7 @@ void CGUIDialogContentSettings::SetupPage()
{
msg2.SetLabel(g_localizeStrings.Get(20389));
msg2.SetParam1(3);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
if (m_info.strContent.Equals("musicvideos"))
{
SET_CONTROL_LABEL(CONTROL_CONTENT_TYPE,g_localizeStrings.Get(20389));
@@ -275,7 +275,7 @@ void CGUIDialogContentSettings::SetupPage()
{
msg2.SetLabel(m_strContentType);
msg2.SetParam1(4);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
if (m_info.strContent.Equals("albums"))
{
SET_CONTROL_LABEL(CONTROL_CONTENT_TYPE,m_strContentType);
diff --git a/xbmc/GUIDialogFavourites.cpp b/xbmc/GUIDialogFavourites.cpp
index 47371d9c75..075c34df1c 100644
--- a/xbmc/GUIDialogFavourites.cpp
+++ b/xbmc/GUIDialogFavourites.cpp
@@ -102,7 +102,7 @@ void CGUIDialogFavourites::OnClick(int item)
CGUIMessage message(GUI_MSG_EXECUTE, 0, GetID());
message.SetStringParam(execute);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
void CGUIDialogFavourites::OnPopupMenu(int item)
diff --git a/xbmc/GUIDialogKeyboard.cpp b/xbmc/GUIDialogKeyboard.cpp
index f015e842f6..bacf8dfa8f 100644
--- a/xbmc/GUIDialogKeyboard.cpp
+++ b/xbmc/GUIDialogKeyboard.cpp
@@ -352,7 +352,7 @@ void CGUIDialogKeyboard::UpdateLabel() // FIXME seems to be called twice for one
{ // send our filter message
CGUIMessage message(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_FILTER_ITEMS);
message.SetStringParam(utf8Edit);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
if (m_filtering == FILTERING_SEARCH)
diff --git a/xbmc/GUIDialogMusicOSD.cpp b/xbmc/GUIDialogMusicOSD.cpp
index 28eb21d204..d1b89ae023 100644
--- a/xbmc/GUIDialogMusicOSD.cpp
+++ b/xbmc/GUIDialogMusicOSD.cpp
@@ -75,7 +75,7 @@ bool CGUIDialogMusicOSD::OnMessage(CGUIMessage &message)
else if (iControl == CONTROL_LOCK_BUTTON)
{
CGUIMessage msg(GUI_MSG_VISUALISATION_ACTION, 0, 0, ACTION_VIS_PRESET_LOCK);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
return true;
}
diff --git a/xbmc/GUIDialogSelect.cpp b/xbmc/GUIDialogSelect.cpp
index cad84aa40f..82396b5992 100644
--- a/xbmc/GUIDialogSelect.cpp
+++ b/xbmc/GUIDialogSelect.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIDialogSelect.h"
+#include "GUIWindowManager.h"
#include "FileItem.h"
#include "LocalizeStrings.h"
@@ -61,7 +62,7 @@ bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
CGUIDialog::OnMessage(message);
m_iSelected = -1;
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_vecList);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
CStdString items;
items.Format("%i %s", m_vecList->Size(), g_localizeStrings.Get(127).c_str());
@@ -70,12 +71,12 @@ bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
if (m_bButtonEnabled)
{
CGUIMessage msg2(GUI_MSG_VISIBLE, GetID(), CONTROL_BUTTON);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
else
{
CGUIMessage msg2(GUI_MSG_HIDDEN, GetID(), CONTROL_BUTTON);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
return true;
}
@@ -91,7 +92,7 @@ bool CGUIDialogSelect::OnMessage(CGUIMessage& message)
if (ACTION_SELECT_ITEM == iAction || ACTION_MOUSE_LEFT_CLICK == iAction)
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControl);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
m_iSelected = msg.GetParam1();
if(m_iSelected >= 0 && m_iSelected < (int)m_vecList->Size())
{
diff --git a/xbmc/GUIDialogSongInfo.cpp b/xbmc/GUIDialogSongInfo.cpp
index 5cd6bf47e5..d381485299 100644
--- a/xbmc/GUIDialogSongInfo.cpp
+++ b/xbmc/GUIDialogSongInfo.cpp
@@ -160,7 +160,7 @@ void CGUIDialogSongInfo::SetRating(char rating)
m_song->GetMusicInfoTag()->SetRating(rating);
// send a message to all windows to tell them to update the fileitem (eg playlistplayer, media windows)
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE_ITEM, 0, m_song);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
void CGUIDialogSongInfo::SetSong(CFileItem *item)
@@ -287,7 +287,7 @@ void CGUIDialogSongInfo::OnGetThumb()
// tell our GUI to completely reload all controls (as some of them
// are likely to have had this image in use so will need refreshing)
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// m_hasUpdatedThumb = true;
}
diff --git a/xbmc/GUIDialogVisualisationPresetList.cpp b/xbmc/GUIDialogVisualisationPresetList.cpp
index 32de02b25d..4c616acdd8 100644
--- a/xbmc/GUIDialogVisualisationPresetList.cpp
+++ b/xbmc/GUIDialogVisualisationPresetList.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIDialogVisualisationPresetList.h"
+#include "GUIWindowManager.h"
#include "GUIListContainer.h"
#include "GUISettings.h"
#include "GUIUserMessages.h"
@@ -69,7 +70,7 @@ bool CGUIDialogVisualisationPresetList::OnMessage(CGUIMessage &message)
CGUIDialog::OnMessage(message);
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
SetVisualisation((CVisualisation *)msg.GetPointer());
return true;
}
diff --git a/xbmc/GUIDialogVisualisationSettings.cpp b/xbmc/GUIDialogVisualisationSettings.cpp
index 62c787aa9d..3b166b7b3d 100644
--- a/xbmc/GUIDialogVisualisationSettings.cpp
+++ b/xbmc/GUIDialogVisualisationSettings.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIDialogVisualisationSettings.h"
+#include "GUIWindowManager.h"
#include "GUIWindowSettingsCategory.h"
#include "GUISpinControlEx.h"
#include "GUIRadioButtonControl.h"
@@ -213,7 +214,7 @@ void CGUIDialogVisualisationSettings::OnInitWindow()
{
// set our visualisation
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
SetVisualisation((CVisualisation *)msg.GetPointer());
SetupPage();
diff --git a/xbmc/GUIMediaWindow.cpp b/xbmc/GUIMediaWindow.cpp
index 45da122b59..5baa53a0b9 100644
--- a/xbmc/GUIMediaWindow.cpp
+++ b/xbmc/GUIMediaWindow.cpp
@@ -422,12 +422,12 @@ void CGUIMediaWindow::UpdateButtons()
if (m_guiState->GetDisplaySortOrder()==SORT_ORDER_ASC)
{
CGUIMessage msg(GUI_MSG_DESELECTED, GetID(), CONTROL_BTNSORTASC);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
else
{
CGUIMessage msg(GUI_MSG_SELECTED, GetID(), CONTROL_BTNSORTASC);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
}
diff --git a/xbmc/GUIViewControl.cpp b/xbmc/GUIViewControl.cpp
index f8093951e1..7e9583e7d2 100644
--- a/xbmc/GUIViewControl.cpp
+++ b/xbmc/GUIViewControl.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIViewControl.h"
+#include "GUIWindowManager.h"
#include "Util.h"
#include "FileItem.h"
#include "LocalizeStrings.h"
@@ -115,7 +116,7 @@ void CGUIViewControl::SetCurrentView(int viewMode)
if (hasFocus)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, m_parentWindow, pNewView->GetID(), 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
// Update it with the contents
@@ -137,7 +138,7 @@ void CGUIViewControl::UpdateContents(const CGUIControl *control, int currentItem
{
if (!control || !m_fileItems) return;
CGUIMessage msg(GUI_MSG_LABEL_BIND, m_parentWindow, control->GetID(), currentItem, 0, m_fileItems);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
void CGUIViewControl::UpdateView()
@@ -156,7 +157,7 @@ int CGUIViewControl::GetSelectedItem(const CGUIControl *control) const
{
if (!control || !m_fileItems) return -1;
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, m_parentWindow, control->GetID());
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
int iItem = msg.GetParam1();
if (iItem >= m_fileItems->Size())
@@ -181,7 +182,7 @@ void CGUIViewControl::SetSelectedItem(int item)
return; // no valid current view!
CGUIMessage msg(GUI_MSG_ITEM_SELECT, m_parentWindow, m_visibleViews[m_currentView]->GetID(), item);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
void CGUIViewControl::SetSelectedItem(const CStdString &itemPath)
@@ -212,7 +213,7 @@ void CGUIViewControl::SetFocused()
return; // no valid current view!
CGUIMessage msg(GUI_MSG_SETFOCUS, m_parentWindow, m_visibleViews[m_currentView]->GetID(), 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
bool CGUIViewControl::HasControl(int viewControlID) const
@@ -276,7 +277,7 @@ void CGUIViewControl::Clear()
return; // no valid current view!
CGUIMessage msg(GUI_MSG_LABEL_RESET, m_parentWindow, m_visibleViews[m_currentView]->GetID(), 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
int CGUIViewControl::GetView(VIEW_TYPE type, int id) const
@@ -294,7 +295,7 @@ void CGUIViewControl::UpdateViewAsControl(const CStdString &viewLabel)
{
// the view as control could be a select/spin/dropdown button
CGUIMessage msg(GUI_MSG_LABEL_RESET, m_parentWindow, m_viewAsControl);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
for (unsigned int i = 0; i < m_visibleViews.size(); i++)
{
CGUIBaseContainer *view = (CGUIBaseContainer *)m_visibleViews[i];
@@ -302,17 +303,17 @@ void CGUIViewControl::UpdateViewAsControl(const CStdString &viewLabel)
CStdString label;
label.Format(g_localizeStrings.Get(534).c_str(), view->GetLabel().c_str()); // View: %s
msg.SetLabel(label);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
CGUIMessage msgSelect(GUI_MSG_ITEM_SELECT, m_parentWindow, m_viewAsControl, m_currentView);
- g_graphicsContext.SendMessage(msgSelect);
+ m_gWindowManager.SendMessage(msgSelect);
// otherwise it's just a normal button
CStdString label;
label.Format(g_localizeStrings.Get(534).c_str(), viewLabel.c_str()); // View: %s
CGUIMessage msgSet(GUI_MSG_LABEL_SET, m_parentWindow, m_viewAsControl);
msgSet.SetLabel(label);
- g_graphicsContext.SendMessage(msgSet);
+ m_gWindowManager.SendMessage(msgSet);
}
void CGUIViewControl::UpdateViewVisibility()
diff --git a/xbmc/GUIWindowFileManager.cpp b/xbmc/GUIWindowFileManager.cpp
index 16f1e5706e..658691a621 100644
--- a/xbmc/GUIWindowFileManager.cpp
+++ b/xbmc/GUIWindowFileManager.cpp
@@ -273,7 +273,7 @@ bool CGUIWindowFileManager::OnMessage(CGUIMessage& message)
{
//move to next item
CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), iControl, iItem + 1);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
}
else if (iAction == ACTION_SELECT_ITEM || iAction == ACTION_MOUSE_LEFT_DOUBLE_CLICK)
@@ -333,7 +333,7 @@ void CGUIWindowFileManager::OnSort(int iList)
void CGUIWindowFileManager::ClearFileItems(int iList)
{
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), iList + CONTROL_LEFT_LIST);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
m_vecItems[iList]->Clear(); // will clean up everything
}
@@ -362,12 +362,12 @@ void CGUIWindowFileManager::UpdateButtons()
if (bSortOrder)
{
CGUIMessage msg(GUI_MSG_DESELECTED,GetID(), CONTROL_BTNSORTASC);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
else
{
CGUIMessage msg(GUI_MSG_SELECTED,GetID(), CONTROL_BTNSORTASC);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
*/
@@ -648,7 +648,7 @@ bool CGUIWindowFileManager::HaveDiscOrConnection( CStdString& strPath, int iDriv
void CGUIWindowFileManager::UpdateControl(int iList, int item)
{
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), iList + CONTROL_LEFT_LIST, item, 0, m_vecItems[iList]);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
void CGUIWindowFileManager::OnMark(int iList, int iItem)
diff --git a/xbmc/GUIWindowMusicBase.cpp b/xbmc/GUIWindowMusicBase.cpp
index 2f51b9cd47..82e61a99ea 100644
--- a/xbmc/GUIWindowMusicBase.cpp
+++ b/xbmc/GUIWindowMusicBase.cpp
@@ -186,7 +186,7 @@ bool CGUIWindowMusicBase::OnMessage(CGUIMessage& message)
m_gWindowManager.ChangeActiveWindow(nWindow);
CGUIMessage msg2(GUI_MSG_SETFOCUS, g_stSettings.m_iMyMusicStartWindow, CONTROL_BTNTYPE);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
return true;
}
@@ -759,15 +759,15 @@ void CGUIWindowMusicBase::UpdateButtons()
// Remove labels from the window selection
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_BTNTYPE);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// Add labels to the window selection
CGUIMessage msg2(GUI_MSG_LABEL_ADD, GetID(), CONTROL_BTNTYPE);
msg2.SetLabel(g_localizeStrings.Get(744)); // Files
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
msg2.SetLabel(g_localizeStrings.Get(15100)); // Library
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
// Select the current window as default item
CONTROL_SELECT_ITEM(CONTROL_BTNTYPE, g_stSettings.m_iMyMusicStartWindow - WINDOW_MUSIC_FILES);
diff --git a/xbmc/GUIWindowMusicInfo.cpp b/xbmc/GUIWindowMusicInfo.cpp
index 8785f728b0..56b44b0ee0 100644
--- a/xbmc/GUIWindowMusicInfo.cpp
+++ b/xbmc/GUIWindowMusicInfo.cpp
@@ -20,6 +20,7 @@
*/
#include "GUIWindowMusicInfo.h"
+#include "GUIWindowManager.h"
#include "Util.h"
#include "GUIImage.h"
#include "Picture.h"
@@ -126,7 +127,7 @@ bool CGUIWindowMusicInfo::OnMessage(CGUIMessage& message)
if (m_bArtistInfo && (ACTION_SELECT_ITEM == iAction || ACTION_MOUSE_LEFT_CLICK == iAction))
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControl);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
int iItem = msg.GetParam1();
if (iItem < 0 || iItem >= (int)m_albumSongs->Size())
break;
@@ -560,7 +561,7 @@ void CGUIWindowMusicInfo::OnGetThumb()
// tell our GUI to completely reload all controls (as some of them
// are likely to have had this image in use so will need refreshing)
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// Update our screen
Update();
}
@@ -666,7 +667,7 @@ void CGUIWindowMusicInfo::OnGetFanart()
// tell our GUI to completely reload all controls (as some of them
// are likely to have had this image in use so will need refreshing)
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// Update our screen
Update();
}
diff --git a/xbmc/GUIWindowMusicNav.cpp b/xbmc/GUIWindowMusicNav.cpp
index 435cd9d295..6325a71bea 100644
--- a/xbmc/GUIWindowMusicNav.cpp
+++ b/xbmc/GUIWindowMusicNav.cpp
@@ -912,7 +912,7 @@ void CGUIWindowMusicNav::SetThumb(int iItem, CONTEXT_BUTTON button)
CMusicDatabaseDirectory dir;
dir.ClearDirectoryCache(m_vecItems->m_strPath);
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
Update(m_vecItems->m_strPath);
}
else
diff --git a/xbmc/GUIWindowMusicOverlay.cpp b/xbmc/GUIWindowMusicOverlay.cpp
index 0e55a29063..9b77f43790 100644
--- a/xbmc/GUIWindowMusicOverlay.cpp
+++ b/xbmc/GUIWindowMusicOverlay.cpp
@@ -46,7 +46,7 @@ bool CGUIWindowMusicOverlay::OnMessage(CGUIMessage& message)
if (message.GetParam1() == ACTION_SELECT_ITEM)
{ // switch to fullscreen visualisation mode...
CGUIMessage msg(GUI_MSG_FULLSCREEN, 0, GetID());
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
}
}
@@ -63,7 +63,7 @@ bool CGUIWindowMusicOverlay::OnMouse(const CPoint &point)
if (g_Mouse.bClick[MOUSE_LEFT_BUTTON])
{ // send mouse message
CGUIMessage message(GUI_MSG_FULLSCREEN, CONTROL_LOGO_PIC, GetID());
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
// reset the mouse button
g_Mouse.bClick[MOUSE_LEFT_BUTTON] = false;
}
diff --git a/xbmc/GUIWindowPictures.cpp b/xbmc/GUIWindowPictures.cpp
index b0864a6193..682124ff25 100644
--- a/xbmc/GUIWindowPictures.cpp
+++ b/xbmc/GUIWindowPictures.cpp
@@ -222,12 +222,12 @@ void CGUIWindowPictures::UpdateButtons()
if (g_guiSettings.GetBool("slideshow.shuffle"))
{
CGUIMessage msg2(GUI_MSG_SELECTED, GetID(), CONTROL_SHUFFLE);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
else
{
CGUIMessage msg2(GUI_MSG_DESELECTED, GetID(), CONTROL_SHUFFLE);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
// check we can slideshow or recursive slideshow
diff --git a/xbmc/GUIWindowSettingsCategory.cpp b/xbmc/GUIWindowSettingsCategory.cpp
index 0b1bc0db6a..67f7028243 100644
--- a/xbmc/GUIWindowSettingsCategory.cpp
+++ b/xbmc/GUIWindowSettingsCategory.cpp
@@ -2110,7 +2110,7 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
{ // new resolution choosen... - update if necessary
int iControlID = pSettingControl->GetID();
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControlID);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
m_NewResolution = (RESOLUTION)msg.GetParam1();
// reset our skin if necessary
// delay change of resolution
@@ -2123,7 +2123,7 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
{
int iControlID = pSettingControl->GetID();
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControlID);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// DXMERGE: This may be useful
// g_videoConfig.SetVSyncMode((VSYNC)msg.GetParam1());
}
@@ -2194,7 +2194,7 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
CSettingInt *pSettingInt = (CSettingInt *)pSettingControl->GetSetting();
int iControlID = pSettingControl->GetID();
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControlID);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
pSettingInt->SetData(msg.GetParam1());
}
else if (strSetting.Equals("videoscreen.flickerfilter") || strSetting.Equals("videoscreen.soften"))
@@ -3012,7 +3012,7 @@ void CGUIWindowSettingsCategory::FillInVisualisations(CSetting *pSetting, int iC
int iWinID = m_gWindowManager.GetActiveWindow();
{
CGUIMessage msg(GUI_MSG_LABEL_RESET, iWinID, iControlID);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
vector<CStdString> vecVis;
//find visz....
@@ -3081,7 +3081,7 @@ void CGUIWindowSettingsCategory::FillInVisualisations(CSetting *pSetting, int iC
{
CGUIMessage msg(GUI_MSG_LABEL_ADD, iWinID, iControlID, iVis++);
msg.SetLabel(231);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
for (int i = 0; i < (int) vecVis.size(); ++i)
{
@@ -3093,12 +3093,12 @@ void CGUIWindowSettingsCategory::FillInVisualisations(CSetting *pSetting, int iC
{
CGUIMessage msg(GUI_MSG_LABEL_ADD, iWinID, iControlID, iVis++);
msg.SetLabel(strVis);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
}
{
CGUIMessage msg(GUI_MSG_ITEM_SELECT, iWinID, iControlID, iCurrentVis);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
}
diff --git a/xbmc/GUIWindowSettingsProfile.cpp b/xbmc/GUIWindowSettingsProfile.cpp
index fe65630132..6f3aeb4a90 100644
--- a/xbmc/GUIWindowSettingsProfile.cpp
+++ b/xbmc/GUIWindowSettingsProfile.cpp
@@ -63,7 +63,7 @@ bool CGUIWindowSettingsProfile::OnAction(const CAction &action)
int CGUIWindowSettingsProfile::GetSelectedItem()
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_PROFILES);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
return msg.GetParam1();
}
@@ -102,7 +102,7 @@ void CGUIWindowSettingsProfile::OnPopupMenu(int iItem)
unsigned iCtrlID = GetFocusedControlID();
g_application.StopPlaying();
CGUIMessage msg2(GUI_MSG_ITEM_SELECTED, m_gWindowManager.GetActiveWindow(), iCtrlID);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
g_application.getNetwork().NetworkMessage(CNetwork::SERVICES_DOWN,1);
bool bOldMaster = g_passwordManager.bMasterUser;
g_passwordManager.bMasterUser = true;
@@ -157,7 +157,7 @@ bool CGUIWindowSettingsProfile::OnMessage(CGUIMessage& message)
)
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_PROFILES);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
int iItem = msg.GetParam1();
if (iAction == ACTION_CONTEXT_MENU || iAction == ACTION_MOUSE_RIGHT_CLICK)
{
@@ -222,13 +222,13 @@ void CGUIWindowSettingsProfile::LoadList()
item->SetThumbnailImage(profile.getThumb());
item->SetOverlayImage(profile.getLockMode() == LOCK_MODE_EVERYONE ? CGUIListItem::ICON_OVERLAY_NONE : CGUIListItem::ICON_OVERLAY_LOCKED);
CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_PROFILES, 0, 0, item);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
m_vecListItems.push_back(item);
}
{
CFileItemPtr item(new CFileItem(g_localizeStrings.Get(20058)));
CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_PROFILES, 0, 0, item);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
item->m_strPath.Empty();
m_vecListItems.push_back(item);
}
@@ -246,7 +246,7 @@ void CGUIWindowSettingsProfile::LoadList()
void CGUIWindowSettingsProfile::ClearListItems()
{
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_PROFILES);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
m_vecListItems.erase(m_vecListItems.begin(), m_vecListItems.end());
}
diff --git a/xbmc/GUIWindowVideoBase.cpp b/xbmc/GUIWindowVideoBase.cpp
index b05d55a128..68a3b8b5b9 100644
--- a/xbmc/GUIWindowVideoBase.cpp
+++ b/xbmc/GUIWindowVideoBase.cpp
@@ -162,7 +162,7 @@ bool CGUIWindowVideoBase::OnMessage(CGUIMessage& message)
g_settings.Save();
m_gWindowManager.ChangeActiveWindow(nNewWindow);
CGUIMessage msg2(GUI_MSG_SETFOCUS, nNewWindow, CONTROL_BTNTYPE);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
return true;
@@ -273,17 +273,17 @@ void CGUIWindowVideoBase::UpdateButtons()
{
// Remove labels from the window selection
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_BTNTYPE);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
// Add labels to the window selection
CStdString strItem = g_localizeStrings.Get(744); // Files
CGUIMessage msg2(GUI_MSG_LABEL_ADD, GetID(), CONTROL_BTNTYPE);
msg2.SetLabel(strItem);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
strItem = g_localizeStrings.Get(14022); // Library
msg2.SetLabel(strItem);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
// Select the current window as default item
int nWindow = g_stSettings.m_iVideoStartWindow-WINDOW_VIDEO_FILES;
diff --git a/xbmc/GUIWindowVideoInfo.cpp b/xbmc/GUIWindowVideoInfo.cpp
index 187d3cab32..56a5a13de6 100644
--- a/xbmc/GUIWindowVideoInfo.cpp
+++ b/xbmc/GUIWindowVideoInfo.cpp
@@ -454,7 +454,7 @@ void CGUIWindowVideoInfo::Update()
if (m_hasUpdatedThumb)
{
CGUIMessage reload(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
- g_graphicsContext.SendMessage(reload);
+ m_gWindowManager.SendMessage(reload);
}
}
diff --git a/xbmc/GUIWindowVideoNav.cpp b/xbmc/GUIWindowVideoNav.cpp
index 7d7fe897fd..4ad7fbdfbe 100644
--- a/xbmc/GUIWindowVideoNav.cpp
+++ b/xbmc/GUIWindowVideoNav.cpp
@@ -1536,7 +1536,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
CUtil::DeleteVideoDatabaseDirectoryCache();
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_REFRESH_THUMBS);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
Update(m_vecItems->m_strPath);
return true;
diff --git a/xbmc/GUIWindowVisualisation.cpp b/xbmc/GUIWindowVisualisation.cpp
index c548672a96..87a7faf70f 100644
--- a/xbmc/GUIWindowVisualisation.cpp
+++ b/xbmc/GUIWindowVisualisation.cpp
@@ -75,7 +75,7 @@ bool CGUIWindowVisualisation::OnAction(const CAction &action)
case ACTION_VIS_PRESET_LOCK:
{ // show the locked icon + fall through so that the vis handles the locking
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
if (msg.GetPointer())
{
CVisualisation *pVis = (CVisualisation *)msg.GetPointer();
diff --git a/xbmc/GUIWindowWeather.cpp b/xbmc/GUIWindowWeather.cpp
index c28a5db88f..da6cec9887 100644
--- a/xbmc/GUIWindowWeather.cpp
+++ b/xbmc/GUIWindowWeather.cpp
@@ -157,7 +157,7 @@ void CGUIWindowWeather::UpdateLocations()
if (!IsActive()) return;
CGUIMessage msg(GUI_MSG_LABEL_RESET,GetID(),CONTROL_SELECTLOCATION);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
CGUIMessage msg2(GUI_MSG_LABEL_ADD,GetID(),CONTROL_SELECTLOCATION);
for (unsigned int i = 0; i < MAX_LOCATION; i++)
@@ -175,7 +175,7 @@ void CGUIWindowWeather::UpdateLocations()
}
msg2.SetParam1(i);
msg2.SetLabel(strLabel);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
else
{
@@ -183,7 +183,7 @@ void CGUIWindowWeather::UpdateLocations()
msg2.SetLabel(strLabel);
msg2.SetParam1(i);
- g_graphicsContext.SendMessage(msg2);
+ m_gWindowManager.SendMessage(msg2);
}
if (i==m_iCurWeather)
SET_CONTROL_LABEL(CONTROL_SELECTLOCATION,strLabel);
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index 84ec054cbb..3d187ac9a9 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -40,6 +40,7 @@
#include "Util.h"
#include "utils/GUIInfoManager.h"
+#include "GUIWindowManager.h"
#include "Application.h"
#include "DVDPerformanceCounter.h"
#include "FileSystem/cdioSupport.h"
@@ -2930,7 +2931,7 @@ bool CDVDPlayer::OnAction(const CAction &action)
pStream->OnMenu();
// send a message to everyone that we've gone to the menu
CGUIMessage msg(GUI_MSG_VIDEO_MENU_STARTED, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
return true;
}
break;
diff --git a/xbmc/lib/libPython/XBPython.cpp b/xbmc/lib/libPython/XBPython.cpp
index ac6b2aef1a..e3117f229c 100644
--- a/xbmc/lib/libPython/XBPython.cpp
+++ b/xbmc/lib/libPython/XBPython.cpp
@@ -120,11 +120,6 @@ XBPython::~XBPython()
CloseHandle(m_globalEvent);
}
-bool XBPython::SendMessage(CGUIMessage& message)
-{
- return (evalFile(message.GetStringParam().c_str()) != -1);
-}
-
// message all registered callbacks that xbmc stopped playing
void XBPython::OnPlayBackEnded()
{
diff --git a/xbmc/lib/libPython/XBPython.h b/xbmc/lib/libPython/XBPython.h
index ec1d397426..e0a71f8a59 100644
--- a/xbmc/lib/libPython/XBPython.h
+++ b/xbmc/lib/libPython/XBPython.h
@@ -22,7 +22,6 @@
*/
#include "XBPyThread.h"
-#include "IMsgSenderCallback.h"
#include "cores/IPlayer.h"
#include "utils/CriticalSection.h"
@@ -41,12 +40,11 @@ typedef std::vector<PyElem> PyList;
typedef std::vector<PVOID> PlayerCallbackList;
typedef std::vector<LibraryLoader*> PythonExtensionLibraries;
-class XBPython : public IMsgSenderCallback, public IPlayerCallback
+class XBPython : public IPlayerCallback
{
public:
XBPython();
virtual ~XBPython();
- virtual bool SendMessage(CGUIMessage& message);
virtual void OnPlayBackEnded();
virtual void OnPlayBackStarted();
virtual void OnPlayBackStopped();
diff --git a/xbmc/utils/Builtins.cpp b/xbmc/utils/Builtins.cpp
index cf9508eb86..f545a909a0 100644
--- a/xbmc/utils/Builtins.cpp
+++ b/xbmc/utils/Builtins.cpp
@@ -260,7 +260,7 @@ int CBuiltins::Execute(const CStdString& execString)
CUtil::DeleteVideoDatabaseDirectoryCache();
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UPDATE);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
else if (execute.Equals("takescreenshot"))
{
@@ -306,7 +306,7 @@ int CBuiltins::Execute(const CStdString& execString)
int controlID = atol(params[0].c_str());
int subItem = (params.size() > 1) ? atol(params[1].c_str())+1 : 0;
CGUIMessage msg(GUI_MSG_SETFOCUS, m_gWindowManager.GetActiveWindow(), controlID, subItem);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
}
#ifdef HAS_PYTHON
else if (execute.Equals("runscript") && params.size())
@@ -947,13 +947,13 @@ int CBuiltins::Execute(const CStdString& execString)
{
int id = atoi(parameter.c_str());
CGUIMessage message(GUI_MSG_PAGE_DOWN, m_gWindowManager.GetFocusedWindow(), id);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("pageup"))
{
int id = atoi(parameter.c_str());
CGUIMessage message(GUI_MSG_PAGE_UP, m_gWindowManager.GetFocusedWindow(), id);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("updatelibrary") && params.size())
{
@@ -993,14 +993,14 @@ int CBuiltins::Execute(const CStdString& execString)
else if (execute.Equals("control.move") && params.size() > 1)
{
CGUIMessage message(GUI_MSG_MOVE_OFFSET, m_gWindowManager.GetFocusedWindow(), atoi(params[0].c_str()), atoi(params[1].c_str()));
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.refresh"))
{ // NOTE: These messages require a media window, thus they're sent to the current activewindow.
// This shouldn't stop a dialog intercepting it though.
CGUIMessage message(GUI_MSG_NOTIFY_ALL, m_gWindowManager.GetActiveWindow(), 0, GUI_MSG_UPDATE, 1); // 1 to reset the history
message.SetStringParam(parameter);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.update") && params.size())
{
@@ -1008,57 +1008,57 @@ int CBuiltins::Execute(const CStdString& execString)
message.SetStringParam(params[0]);
if (params.size() > 1 && params[1].CompareNoCase("replace") == 0)
message.SetParam2(1); // reset the history
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.nextviewmode"))
{
CGUIMessage message(GUI_MSG_CHANGE_VIEW_MODE, m_gWindowManager.GetActiveWindow(), 0, 0, 1);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.previousviewmode"))
{
CGUIMessage message(GUI_MSG_CHANGE_VIEW_MODE, m_gWindowManager.GetActiveWindow(), 0, 0, -1);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.setviewmode"))
{
CGUIMessage message(GUI_MSG_CHANGE_VIEW_MODE, m_gWindowManager.GetActiveWindow(), 0, atoi(parameter.c_str()));
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.nextsortmethod"))
{
CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_gWindowManager.GetActiveWindow(), 0, 0, 1);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.previoussortmethod"))
{
CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_gWindowManager.GetActiveWindow(), 0, 0, -1);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.setsortmethod"))
{
CGUIMessage message(GUI_MSG_CHANGE_SORT_METHOD, m_gWindowManager.GetActiveWindow(), 0, atoi(parameter.c_str()));
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("container.sortdirection"))
{
CGUIMessage message(GUI_MSG_CHANGE_SORT_DIRECTION, m_gWindowManager.GetActiveWindow(), 0, 0);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else if (execute.Equals("control.message") && params.size() >= 2)
{
int controlID = atoi(params[0].c_str());
int windowID = (params.size() == 3) ? CButtonTranslator::TranslateWindowString(params[2].c_str()) : m_gWindowManager.GetActiveWindow();
if (params[1] == "moveup")
- g_graphicsContext.SendMessage(GUI_MSG_MOVE_OFFSET, windowID, controlID, 1);
+ m_gWindowManager.SendMessage(GUI_MSG_MOVE_OFFSET, windowID, controlID, 1);
else if (params[1] == "movedown")
- g_graphicsContext.SendMessage(GUI_MSG_MOVE_OFFSET, windowID, controlID, -1);
+ m_gWindowManager.SendMessage(GUI_MSG_MOVE_OFFSET, windowID, controlID, -1);
else if (params[1] == "pageup")
- g_graphicsContext.SendMessage(GUI_MSG_PAGE_UP, windowID, controlID);
+ m_gWindowManager.SendMessage(GUI_MSG_PAGE_UP, windowID, controlID);
else if (params[1] == "pagedown")
- g_graphicsContext.SendMessage(GUI_MSG_PAGE_DOWN, windowID, controlID);
+ m_gWindowManager.SendMessage(GUI_MSG_PAGE_DOWN, windowID, controlID);
else if (params[1] == "click")
- g_graphicsContext.SendMessage(GUI_MSG_CLICKED, controlID, windowID);
+ m_gWindowManager.SendMessage(GUI_MSG_CLICKED, controlID, windowID);
}
else if (execute.Equals("sendclick") && params.size())
{
@@ -1067,12 +1067,12 @@ int CBuiltins::Execute(const CStdString& execString)
// have a window - convert it
int windowID = CButtonTranslator::TranslateWindowString(params[0].c_str());
CGUIMessage message(GUI_MSG_CLICKED, atoi(params[1].c_str()), windowID);
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
else
{ // single param - assume you meant the active window
CGUIMessage message(GUI_MSG_CLICKED, atoi(params[0].c_str()), m_gWindowManager.GetActiveWindow());
- g_graphicsContext.SendMessage(message);
+ m_gWindowManager.SendMessage(message);
}
}
else if (execute.Equals("action") && params.size())
diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp
index 0875448f1e..c297f991f9 100644
--- a/xbmc/utils/GUIInfoManager.cpp
+++ b/xbmc/utils/GUIInfoManager.cpp
@@ -1466,7 +1466,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
case VISUALISATION_PRESET:
{
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
if (msg.GetPointer())
{
CVisualisation *pVis = (CVisualisation *)msg.GetPointer();
@@ -1946,7 +1946,7 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
case VISUALISATION_LOCKED:
{
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
- g_graphicsContext.SendMessage(msg);
+ m_gWindowManager.SendMessage(msg);
if (msg.GetPointer())
{
CVisualisation *pVis = (CVisualisation *)msg.GetPointer();