Skip to content

Commit

Permalink
adds GUI_MSG_ADD_CONTROL and GUI_MSG_REMOVE_CONTROL handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Marshall committed Mar 17, 2012
1 parent 48749de commit 50dd38d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xbmc/guilib/GUIMessage.h
Expand Up @@ -115,6 +115,16 @@
*/
#define GUI_MSG_GESTURE_NOTIFY 38

/*!
\brief A request to add a control
*/
#define GUI_MSG_ADD_CONTROL 39

/*!
\brief A request to remove a control
*/
#define GUI_MSG_REMOVE_CONTROL 40

#define GUI_MSG_USER 1000

/*!
Expand Down
21 changes: 21 additions & 0 deletions xbmc/guilib/GUIWindow.cpp
Expand Up @@ -602,6 +602,27 @@ bool CGUIWindow::OnMessage(CGUIMessage& message)
message.SetParam1(result);
return result != EVENT_RESULT_UNHANDLED;
}
case GUI_MSG_ADD_CONTROL:
{
if (message.GetPointer())
{
CGUIControl *control = (CGUIControl *)message.GetPointer();
control->AllocResources();
AddControl(control);
}
return true;
}
case GUI_MSG_REMOVE_CONTROL:
{
if (message.GetPointer())
{
CGUIControl *control = (CGUIControl *)message.GetPointer();
RemoveControl(control);
control->FreeResources(true);
delete control;
}
return true;
}
case GUI_MSG_NOTIFY_ALL:
{
// only process those notifications that come from this window, or those intended for every window
Expand Down

0 comments on commit 50dd38d

Please sign in to comment.