* Big time cleanup of the screen saver stuff, not yet finished yet, though.
Renamed lots of things, like ScreenSaverThread to ScreenSaverRunner, refactored code, etc. Much cleaner interfaces and code. * Fixed a couple of bugs and in the add-on handling, especially some settings related bugs (ie. testing a screen saver will now use its latest settings, etc.). * Correctly implemented DPMS support in ScreenSaverPrefs and the ScreenSaver preferences application - screen_blanker still ignores them, though. * It's not yet font sensitive either. * Changed the input_server add-on to not switch to the screen blanker immediately when it's in the "blank corner" - doesn't seem to work yet, though (only tested under Qemu). * Correctly implemented the "preview" function (before, a screen saver would never know it rendered a preview). * Evaluates the return value of BScreenSaver::StartSaver(). * The screen saver thread is no longer killed without notice - it's now always shut down properly. * Made the code more robust against failure. * Introduced some new bugs as well (the screen saver list view doesn't jump to the selection anymore, for some reason), those will be fixed later (as the remaining issues). * Probably some more I forgot about. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17731 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2003-2006, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Michael Phipps
|
||||
* Jérôme Duval, [email protected]
|
||||
* Axel Dörfler, [email protected]
|
||||
*/
|
||||
#ifndef SCREEN_SAVER_RUNNER_H
|
||||
#define SCREEN_SAVER_RUNNER_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include <DirectWindow.h>
|
||||
|
||||
class BScreenSaver;
|
||||
class BView;
|
||||
class ScreenSaverPrefs;
|
||||
|
||||
|
||||
class ScreenSaverRunner {
|
||||
public:
|
||||
ScreenSaverRunner(BWindow* window, BView* view,
|
||||
bool preview, ScreenSaverPrefs& prefs);
|
||||
~ScreenSaverRunner();
|
||||
|
||||
BScreenSaver* ScreenSaver() const;
|
||||
bool HasStarted() const;
|
||||
|
||||
status_t Run();
|
||||
void Quit();
|
||||
|
||||
void Suspend();
|
||||
void Resume();
|
||||
|
||||
private:
|
||||
void _LoadAddOn();
|
||||
void _CleanUp();
|
||||
static status_t _ThreadFunc(void* data);
|
||||
void _Run();
|
||||
|
||||
BScreenSaver* fSaver;
|
||||
BWindow* fWindow;
|
||||
BDirectWindow* fDirectWindow;
|
||||
BView* fView;
|
||||
ScreenSaverPrefs& fPrefs;
|
||||
bool fPreview;
|
||||
bool fHasStarted;
|
||||
|
||||
image_id fAddonImage;
|
||||
thread_id fThread;
|
||||
volatile bool fQuitting;
|
||||
};
|
||||
|
||||
#endif //SCREEN_SAVER_THREAD_H
|
||||
Reference in New Issue
Block a user