2005-07-29 11:41:58 +04:00
|
|
|
/*
|
* 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
2006-06-06 12:16:46 +04:00
|
|
|
* Copyright 2003-2006, Michael Phipps. All rights reserved.
|
2005-07-29 11:41:58 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2006-06-07 16:43:31 +04:00
|
|
|
#ifndef SCREEN_SAVER_SETTINGS_H
|
|
|
|
#define SCREEN_SAVER_SETTINGS_H
|
* 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
2006-06-06 12:16:46 +04:00
|
|
|
|
|
|
|
|
2005-07-29 11:41:58 +04:00
|
|
|
#include <Message.h>
|
|
|
|
#include <Path.h>
|
|
|
|
#include <String.h>
|
2004-06-13 02:46:11 +04:00
|
|
|
|
* 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
2006-06-06 12:16:46 +04:00
|
|
|
|
|
|
|
enum screen_corner {
|
2006-06-09 20:03:16 +04:00
|
|
|
NO_CORNER = -1,
|
|
|
|
UP_LEFT_CORNER,
|
|
|
|
UP_RIGHT_CORNER,
|
|
|
|
DOWN_RIGHT_CORNER,
|
|
|
|
DOWN_LEFT_CORNER,
|
|
|
|
CENTER_CORNER
|
2005-07-29 11:41:58 +04:00
|
|
|
};
|
2004-06-13 02:46:11 +04:00
|
|
|
|
* 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
2006-06-06 12:16:46 +04:00
|
|
|
// time flags
|
|
|
|
enum {
|
|
|
|
ENABLE_SAVER = 0x01,
|
|
|
|
ENABLE_DPMS_STAND_BY = 0x02,
|
|
|
|
ENABLE_DPMS_SUSPEND = 0x04,
|
|
|
|
ENABLE_DPMS_OFF = 0x08,
|
|
|
|
|
2009-07-20 18:03:30 +04:00
|
|
|
ENABLE_DPMS_MASK
|
|
|
|
= ENABLE_DPMS_STAND_BY | ENABLE_DPMS_SUSPEND | ENABLE_DPMS_OFF
|
* 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
2006-06-06 12:16:46 +04:00
|
|
|
};
|
|
|
|
|
2005-08-18 19:31:06 +04:00
|
|
|
#define SCREEN_BLANKER_SIG "application/x-vnd.Haiku.screenblanker"
|
2005-08-01 16:53:23 +04:00
|
|
|
|
2009-07-20 18:03:30 +04:00
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
class ScreenSaverSettings {
|
2009-07-20 18:03:30 +04:00
|
|
|
public:
|
|
|
|
ScreenSaverSettings();
|
|
|
|
|
|
|
|
bool Load();
|
|
|
|
void Save();
|
|
|
|
void Defaults();
|
|
|
|
BPath& Path() { return fSettingsPath; }
|
|
|
|
|
|
|
|
// General screen saver settings
|
2010-02-09 01:50:38 +03:00
|
|
|
int32 TimeFlags() const { return fTimeFlags; }
|
|
|
|
bigtime_t BlankTime() const { return fBlankTime; }
|
|
|
|
bigtime_t StandByTime() const { return fStandByTime; }
|
|
|
|
bigtime_t SuspendTime() const { return fSuspendTime; }
|
|
|
|
bigtime_t OffTime() const { return fOffTime; }
|
|
|
|
|
|
|
|
screen_corner BlankCorner() const { return fBlankCorner; }
|
|
|
|
screen_corner NeverBlankCorner() const { return fNeverBlankCorner; }
|
|
|
|
bool LockEnable() const { return fLockEnabled; }
|
|
|
|
bigtime_t PasswordTime() const { return fPasswordTime; }
|
2009-07-20 18:03:30 +04:00
|
|
|
const char* Password() { return fPassword.String(); }
|
|
|
|
const char* LockMethod() { return fLockMethod.String(); }
|
|
|
|
bool IsNetworkPassword()
|
|
|
|
{ return strcmp(fLockMethod.String(), "custom")
|
|
|
|
!= 0; }
|
|
|
|
|
|
|
|
const char* ModuleName() { return fModuleName.String(); }
|
|
|
|
status_t GetModuleState(const char* name,
|
|
|
|
BMessage* stateMessage);
|
|
|
|
|
|
|
|
void SetTimeFlags(uint32 flags)
|
|
|
|
{ fTimeFlags = flags; }
|
|
|
|
void SetBlankTime(bigtime_t time)
|
|
|
|
{ fBlankTime = time; }
|
|
|
|
void SetStandByTime(bigtime_t time)
|
|
|
|
{ fStandByTime = time; }
|
|
|
|
void SetSuspendTime(bigtime_t time)
|
|
|
|
{ fSuspendTime = time; }
|
|
|
|
void SetOffTime(bigtime_t intime)
|
|
|
|
{ fOffTime = intime; }
|
|
|
|
void SetBlankCorner(screen_corner in)
|
|
|
|
{ fBlankCorner = in; }
|
|
|
|
void SetNeverBlankCorner(screen_corner in)
|
|
|
|
{ fNeverBlankCorner = in; }
|
|
|
|
void SetLockEnable(bool enable)
|
|
|
|
{ fLockEnabled = enable; }
|
|
|
|
void SetPasswordTime(bigtime_t time)
|
|
|
|
{ fPasswordTime = time; }
|
|
|
|
void SetPassword(const char* password)
|
|
|
|
{ fPassword = password; }
|
|
|
|
// Cannot set network password from here.
|
|
|
|
void SetLockMethod(const char* method)
|
|
|
|
{ fLockMethod = method; }
|
|
|
|
void SetModuleName(const char* name)
|
|
|
|
{ fModuleName = name; }
|
|
|
|
void SetModuleState(const char* name,
|
|
|
|
BMessage* stateMessage);
|
|
|
|
|
|
|
|
// ScreenSaver preferences settings
|
2010-02-09 01:50:38 +03:00
|
|
|
BRect WindowFrame() const { return fWindowFrame; }
|
|
|
|
int32 WindowTab() const { return fWindowTab; }
|
2009-07-20 18:03:30 +04:00
|
|
|
|
|
|
|
void SetWindowFrame(const BRect& frame)
|
|
|
|
{ fWindowFrame = frame; }
|
|
|
|
void SetWindowTab(int32 tab)
|
|
|
|
{ fWindowTab = tab; }
|
|
|
|
|
|
|
|
BMessage& Message();
|
|
|
|
|
|
|
|
private:
|
|
|
|
int32 fTimeFlags;
|
|
|
|
bigtime_t fBlankTime;
|
|
|
|
bigtime_t fStandByTime;
|
|
|
|
bigtime_t fSuspendTime;
|
|
|
|
bigtime_t fOffTime;
|
|
|
|
screen_corner fBlankCorner;
|
|
|
|
screen_corner fNeverBlankCorner;
|
|
|
|
bool fLockEnabled;
|
|
|
|
bigtime_t fPasswordTime;
|
|
|
|
BString fPassword;
|
|
|
|
BString fModuleName;
|
|
|
|
BString fLockMethod;
|
|
|
|
|
|
|
|
BRect fWindowFrame;
|
|
|
|
int32 fWindowTab;
|
|
|
|
|
|
|
|
BMessage fSettings;
|
|
|
|
BPath fSettingsPath;
|
* 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
2006-06-06 12:16:46 +04:00
|
|
|
};
|
2004-06-13 02:46:11 +04:00
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
#endif // SCREEN_SAVER_SETTINGS_H
|