1 /* 2 * Copyright 2003-2014 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 * Puck Meerburg, puck@puckipedia.nl 10 */ 11 #ifndef SCREEN_SAVER_APP_H 12 #define SCREEN_SAVER_APP_H 13 14 15 #include "PasswordWindow.h" 16 #include "ScreenSaverSettings.h" 17 #include "ScreenSaverRunner.h" 18 #include "ScreenSaverWindow.h" 19 20 #include <Application.h> 21 #include <MessageRunner.h> 22 23 24 const static uint32 kMsgResumeSaver = 'RSSV'; 25 26 27 class ScreenBlanker : public BApplication { 28 public: 29 ScreenBlanker(); 30 ~ScreenBlanker(); 31 32 virtual void ReadyToRun(); 33 34 virtual bool QuitRequested(); 35 virtual void MessageReceived(BMessage* message); 36 37 bool IsPasswordWindowShown() const; 38 39 private: 40 bool _LoadAddOn(); 41 void _ShowPasswordWindow(); 42 void _QueueResumeScreenSaver(); 43 void _TurnOnScreen(); 44 void _SetDPMSMode(uint32 mode); 45 void _QueueTurnOffScreen(); 46 void _Shutdown(); 47 48 ScreenSaverSettings fSettings; 49 ScreenSaverWindow* fWindow; 50 ScreenSaverRunner* fSaverRunner; 51 PasswordWindow* fPasswordWindow; 52 53 bigtime_t fBlankTime; 54 bool fTestSaver; 55 BMessageRunner* fResumeRunner; 56 57 BMessageRunner* fStandByScreenRunner; 58 BMessageRunner* fSuspendScreenRunner; 59 BMessageRunner* fTurnOffScreenRunner; 60 }; 61 62 #endif // SCREEN_SAVER_APP_H 63