Skip to content

Commit

Permalink
Merge pull request #8985 from xhaggi/gui-infobool-window-is
Browse files Browse the repository at this point in the history
[gui] new infobool Window.Is()
  • Loading branch information
razzeee committed Feb 15, 2016
2 parents fb7ff23 + f757ab1 commit 0871790
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ const infomap skin_labels[] = {{ "currenttheme", SKIN_THEME },
{"aspectratio", SKIN_ASPECT_RATIO}};

const infomap window_bools[] = {{ "ismedia", WINDOW_IS_MEDIA },
{ "is", WINDOW_IS },
{ "isactive", WINDOW_IS_ACTIVE },
{ "istopmost", WINDOW_IS_TOPMOST },
{ "isvisible", WINDOW_IS_VISIBLE },
Expand Down Expand Up @@ -3178,6 +3179,15 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
bReturn = true;
}
break;
case WINDOW_IS:
if (info.GetData1())
{
CGUIWindow *window = g_windowManager.GetWindow(contextWindow);
bReturn = (window && window->GetID() == static_cast<int>(info.GetData1()));
}
else
CLog::Log(LOGERROR, "The window id is required.");
break;
case WINDOW_IS_VISIBLE:
if (info.GetData1())
bReturn = g_windowManager.IsWindowVisible(info.GetData1());
Expand Down
1 change: 1 addition & 0 deletions xbmc/guiinfo/GUIInfoLabels.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@
#define WINDOW_PREVIOUS 9997
#define WINDOW_IS_MEDIA 9998
#define WINDOW_IS_ACTIVE 9999
#define WINDOW_IS 10000

#define CONTROL_GET_LABEL 29996
#define CONTROL_IS_ENABLED 29997
Expand Down

0 comments on commit 0871790

Please sign in to comment.