Skip to content

Commit

Permalink
Merge pull request #2638 from fataki/builtinscreensaver
Browse files Browse the repository at this point in the history
ADD: ActivateScreensaver to builtin functions
  • Loading branch information
Arne Morten Kvarving committed Jun 8, 2013
2 parents 9d9c2ed + 5de8c46 commit c78ba0e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions xbmc/ApplicationMessenger.cpp
Expand Up @@ -306,6 +306,12 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg)
}
break;

case TMSG_ACTIVATESCREENSAVER:
{
g_application.ActivateScreenSaver();
}
break;

case TMSG_MEDIA_PLAY:
{
// first check if we were called from the PlayFile() function
Expand Down Expand Up @@ -1153,6 +1159,12 @@ void CApplicationMessenger::InhibitIdleShutdown(bool inhibit)
SendMessage(tMsg);
}

void CApplicationMessenger::ActivateScreensaver()
{
ThreadMessage tMsg = {TMSG_ACTIVATESCREENSAVER};
SendMessage(tMsg);
}

void CApplicationMessenger::NetworkMessage(unsigned int dwMessage, unsigned int dwParam)
{
ThreadMessage tMsg = {TMSG_NETWORKMESSAGE, dwMessage, dwParam};
Expand Down
2 changes: 2 additions & 0 deletions xbmc/ApplicationMessenger.h
Expand Up @@ -89,6 +89,7 @@ namespace MUSIC_INFO
#define TMSG_RENDERER_FLUSH 312
#define TMSG_INHIBITIDLESHUTDOWN 313
#define TMSG_LOADPROFILE 314
#define TMSG_ACTIVATESCREENSAVER 315

#define TMSG_NETWORKMESSAGE 500

Expand Down Expand Up @@ -202,6 +203,7 @@ class CApplicationMessenger
void RestartApp();
void Reset();
void InhibitIdleShutdown(bool inhibit);
void ActivateScreensaver();
void SwitchToFullscreen(); //
void Minimize(bool wait = false);
void ExecOS(const CStdString command, bool waitExit = false);
Expand Down
5 changes: 5 additions & 0 deletions xbmc/interfaces/Builtins.cpp
Expand Up @@ -123,6 +123,7 @@ const BUILT_IN commands[] = {
{ "Suspend", false, "Suspends the system" },
{ "InhibitIdleShutdown", false, "Inhibit idle shutdown" },
{ "AllowIdleShutdown", false, "Allow idle shutdown" },
{ "ActivateScreensaver", false, "Activate Screensaver" },
{ "RestartApp", false, "Restart XBMC" },
{ "Minimize", false, "Minimize XBMC" },
{ "Reset", false, "Reset the system (same as reboot)" },
Expand Down Expand Up @@ -292,6 +293,10 @@ int CBuiltins::Execute(const CStdString& execString)
bool inhibit = (params.size() == 1 && params[0].Equals("true"));
CApplicationMessenger::Get().InhibitIdleShutdown(inhibit);
}
else if (execute.Equals("activatescreensaver"))
{
CApplicationMessenger::Get().ActivateScreensaver();
}
else if (execute.Equals("minimize"))
{
CApplicationMessenger::Get().Minimize();
Expand Down

0 comments on commit c78ba0e

Please sign in to comment.