1 /* 2 * Copyright 2003-2013 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Jérôme Duval, jerome.duval@free.fr 7 * Michael Phipps 8 * John Scipione, jscipione@gmail.com 9 */ 10 #ifndef SCREEN_SAVER_APP_H 11 #define SCREEN_SAVER_APP_H 12 13 14 #include "PasswordWindow.h" 15 #include "ScreenSaverSettings.h" 16 #include "ScreenSaverRunner.h" 17 #include "ScreenSaverWindow.h" 18 19 #include <Application.h> 20 #include <MessageRunner.h> 21 22 23 const static uint32 kMsgResumeSaver = 'RSSV'; 24 25 26 class ScreenBlanker : public BApplication { 27 public: 28 ScreenBlanker(); 29 ~ScreenBlanker(); 30 31 virtual void ReadyToRun(); 32 33 virtual bool QuitRequested(); 34 virtual void MessageReceived(BMessage* message); 35 36 bool IsPasswordWindowShown() const; 37 38 private: 39 bool _LoadAddOn(); 40 void _ShowPasswordWindow(); 41 void _QueueResumeScreenSaver(); 42 void _TurnOnScreen(); 43 void _SetDPMSMode(uint32 mode); 44 void _QueueTurnOffScreen(); 45 void _Shutdown(); 46 47 ScreenSaverSettings fSettings; 48 ScreenSaverWindow* fWindow; 49 ScreenSaverRunner* fSaverRunner; 50 PasswordWindow* fPasswordWindow; 51 52 bigtime_t fBlankTime; 53 BMessageRunner* fResumeRunner; 54 55 BMessageRunner* fStandByScreenRunner; 56 BMessageRunner* fSuspendScreenRunner; 57 BMessageRunner* fTurnOffScreenRunner; 58 }; 59 60 #endif // SCREEN_SAVER_APP_H 61