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