2 * Copyright 2003, Michael Phipps. All rights reserved.
3 * Copyright 2014, Puck Meerburg.
4 * Distributed under the terms of the MIT License.
6 #ifndef SCREEN_SAVER_WINDOW_H
7 #define SCREEN_SAVER_WINDOW_H
10 #include "ScreenSaver.h"
12 #include <DirectWindow.h>
13 #include <MessageFilter.h>
15 #include "ScreenSaverRunner.h"
18 const static uint32 kMsgEnableFilter
= 'eflt';
21 class ScreenSaverFilter
: public BMessageFilter
{
23 ScreenSaverFilter(bool test
)
25 BMessageFilter(B_ANY_DELIVERY
, B_ANY_SOURCE
),
29 virtual filter_result
Filter(BMessage
* message
, BHandler
** target
);
31 void SetEnabled(bool enabled
)
32 { fEnabled
= enabled
; };
40 class ScreenSaverWindow
: public BDirectWindow
{
42 ScreenSaverWindow(BRect frame
, bool test
);
45 virtual void MessageReceived(BMessage
* message
);
46 virtual bool QuitRequested();
47 virtual void DirectConnected(direct_buffer_info
* info
);
49 void SetSaverRunner(ScreenSaverRunner
* runner
);
50 BScreenSaver
* _ScreenSaver();
54 ScreenSaverRunner
* fSaverRunner
;
55 ScreenSaverFilter
* fFilter
;
59 #endif // SCREEN_SAVER_WINDOW_H