2005-07-26 20:12:05 +04:00
|
|
|
/*
|
2010-03-02 21:44:28 +03:00
|
|
|
* Copyright 2003-2010, Haiku.
|
2005-07-26 20:12:05 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
2005-08-24 19:13:52 +04:00
|
|
|
*
|
|
|
|
* Authors:
|
* 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
|
|
|
* Michael Phipps
|
|
|
|
* Jérôme Duval, jerome.duval@free.fr
|
|
|
|
* Axel Dörfler, axeld@pinc-software.de
|
2005-07-26 20:12:05 +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
|
|
|
|
|
|
|
#include "ScreenSaverWindow.h"
|
|
|
|
|
2009-10-02 00:22:30 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2004-03-31 04:35:20 +04:00
|
|
|
#include <Application.h>
|
|
|
|
#include <Box.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
|
|
|
#include <Button.h>
|
2010-12-24 12:42:38 +03:00
|
|
|
#include <Catalog.h>
|
2004-03-31 04:35:20 +04:00
|
|
|
#include <Directory.h>
|
2010-12-24 12:42:38 +03:00
|
|
|
#include <DurationFormat.h>
|
2004-03-31 04:35:20 +04:00
|
|
|
#include <Entry.h>
|
|
|
|
#include <File.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
|
|
|
#include <FindDirectory.h>
|
|
|
|
#include <Font.h>
|
|
|
|
#include <ListView.h>
|
2004-03-31 04:35:20 +04:00
|
|
|
#include <Path.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
|
|
|
#include <Roster.h>
|
|
|
|
#include <Screen.h>
|
|
|
|
#include <ScreenSaver.h>
|
2004-03-31 04:35:20 +04:00
|
|
|
#include <ScrollView.h>
|
|
|
|
#include <Slider.h>
|
|
|
|
#include <StringView.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
|
|
|
#include <TabView.h>
|
2011-02-16 18:36:05 +03:00
|
|
|
#include <TextView.h>
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2009-10-02 00:22:30 +04:00
|
|
|
#include <BuildScreenSaverDefaultSettingsView.h>
|
|
|
|
|
|
|
|
#include "PreviewView.h"
|
|
|
|
#include "ScreenCornerSelector.h"
|
|
|
|
#include "ScreenSaverItem.h"
|
2005-07-26 20:12:05 +04:00
|
|
|
|
2010-12-24 12:42:38 +03:00
|
|
|
#undef B_TRANSLATE_CONTEXT
|
|
|
|
#define B_TRANSLATE_CONTEXT "ScreenSaver"
|
* 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
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
const uint32 kPreviewMonitorGap = 16;
|
|
|
|
const uint32 kMinSettingsWidth = 230;
|
|
|
|
const uint32 kMinSettingsHeight = 120;
|
|
|
|
|
* 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
|
|
|
const int32 kMsgSaverSelected = 'SSEL';
|
|
|
|
const int32 kMsgTestSaver = 'TEST';
|
|
|
|
const int32 kMsgAddSaver = 'ADD ';
|
|
|
|
const int32 kMsgPasswordCheckBox = 'PWCB';
|
2007-01-04 18:36:22 +03:00
|
|
|
const int32 kMsgRunSliderChanged = 'RSch';
|
2007-01-04 17:27:05 +03:00
|
|
|
const int32 kMsgRunSliderUpdate = 'RSup';
|
2007-01-04 18:36:22 +03:00
|
|
|
const int32 kMsgPasswordSliderChanged = 'PWch';
|
2007-01-04 17:27:05 +03:00
|
|
|
const int32 kMsgPasswordSliderUpdate = 'PWup';
|
* 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
|
|
|
const int32 kMsgChangePassword = 'PWBT';
|
|
|
|
const int32 kMsgEnableScreenSaverBox = 'ESCH';
|
|
|
|
|
|
|
|
const int32 kMsgTurnOffCheckBox = 'TUOF';
|
2007-01-04 18:36:22 +03:00
|
|
|
const int32 kMsgTurnOffSliderChanged = 'TUch';
|
2007-01-04 17:27:05 +03:00
|
|
|
const int32 kMsgTurnOffSliderUpdate = 'TUup';
|
* 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
|
|
|
|
2006-06-09 20:03:16 +04:00
|
|
|
const int32 kMsgFadeCornerChanged = 'fdcc';
|
|
|
|
const int32 kMsgNeverFadeCornerChanged = 'nfcc';
|
|
|
|
|
|
|
|
|
* 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
|
|
|
class TimeSlider : public BSlider {
|
2010-06-30 17:49:27 +04:00
|
|
|
public:
|
|
|
|
TimeSlider(BRect frame, const char* name,
|
|
|
|
uint32 changedMessage,
|
|
|
|
uint32 updateMessage);
|
|
|
|
virtual ~TimeSlider();
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
virtual void AttachedToWindow();
|
|
|
|
virtual void SetValue(int32 value);
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
void SetTime(bigtime_t useconds);
|
|
|
|
bigtime_t Time() const;
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
private:
|
|
|
|
void _TimeToString(bigtime_t useconds,
|
|
|
|
BString& string);
|
* 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
|
|
|
};
|
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
class FadeView : public BView {
|
2010-06-30 17:49:27 +04:00
|
|
|
public:
|
|
|
|
FadeView(BRect frame, const char* name,
|
|
|
|
ScreenSaverSettings& settings);
|
2006-06-06 20:56:30 +04:00
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
virtual void AttachedToWindow();
|
2006-06-06 20:56:30 +04:00
|
|
|
};
|
|
|
|
|
2010-06-30 17:49:27 +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
|
|
|
class ModulesView : public BView {
|
2010-06-30 17:49:27 +04:00
|
|
|
public:
|
|
|
|
ModulesView(BRect frame, const char* name,
|
|
|
|
ScreenSaverSettings& settings);
|
|
|
|
virtual ~ModulesView();
|
|
|
|
|
|
|
|
virtual void DetachedFromWindow();
|
|
|
|
virtual void AttachedToWindow();
|
|
|
|
virtual void AllAttached();
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
void PopulateScreenSaverList();
|
|
|
|
void SaveState();
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
private:
|
|
|
|
static int _CompareScreenSaverItems(const void* left,
|
|
|
|
const void* right);
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
BScreenSaver* _ScreenSaver();
|
|
|
|
void _CloseSaver();
|
|
|
|
void _OpenSaver();
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
private:
|
|
|
|
BFilePanel* fFilePanel;
|
|
|
|
BListView* fListView;
|
|
|
|
BButton* fTestButton;
|
|
|
|
BButton* fAddButton;
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
ScreenSaverSettings& fSettings;
|
|
|
|
ScreenSaverRunner* fSaverRunner;
|
|
|
|
BString fCurrentName;
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
BBox* fSettingsBox;
|
|
|
|
BView* fSettingsView;
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
PreviewView* fPreviewView;
|
2009-08-17 06:10:43 +04:00
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
team_id fScreenSaverTestTeam;
|
* 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
|
|
|
};
|
|
|
|
|
2010-06-30 17:49:27 +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
|
|
|
static const int32 kTimeInUnits[] = {
|
|
|
|
30, 60, 90,
|
|
|
|
120, 150, 180,
|
|
|
|
240, 300, 360,
|
|
|
|
420, 480, 540,
|
|
|
|
600, 900, 1200,
|
|
|
|
1500, 1800, 2400,
|
|
|
|
3000, 3600, 5400,
|
|
|
|
7200, 9000, 10800,
|
|
|
|
14400, 18000
|
|
|
|
};
|
2010-06-30 17:49:27 +04:00
|
|
|
static const int32 kTimeUnitCount
|
|
|
|
= sizeof(kTimeInUnits) / sizeof(kTimeInUnits[0]);
|
* 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
|
|
|
|
|
|
|
|
2007-01-04 17:27:05 +03:00
|
|
|
TimeSlider::TimeSlider(BRect frame, const char* name, uint32 changedMessage,
|
|
|
|
uint32 updateMessage)
|
2010-06-30 17:49:27 +04:00
|
|
|
:
|
2010-12-24 12:42:38 +03:00
|
|
|
BSlider(frame, name, B_TRANSLATE("30 seconds"),
|
|
|
|
new BMessage(changedMessage),
|
2007-01-04 17:27:05 +03:00
|
|
|
0, kTimeUnitCount - 1, B_TRIANGLE_THUMB, B_FOLLOW_LEFT_RIGHT)
|
2004-05-04 02:41:30 +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
|
|
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
2007-01-04 17:27:05 +03:00
|
|
|
SetModificationMessage(new BMessage(updateMessage));
|
* 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
|
|
|
SetBarThickness(10);
|
2004-05-04 02:41:30 +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
|
|
|
TimeSlider::~TimeSlider()
|
2005-08-01 16:53:23 +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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
TimeSlider::AttachedToWindow()
|
|
|
|
{
|
2006-06-13 16:53:35 +04:00
|
|
|
BSlider::AttachedToWindow();
|
2007-01-04 17:27:05 +03:00
|
|
|
SetTarget(Window());
|
* 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-01 16:53:23 +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
|
|
|
void
|
|
|
|
TimeSlider::SetValue(int32 value)
|
2005-08-01 16:53:23 +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
|
|
|
int32 oldValue = Value();
|
|
|
|
BSlider::SetValue(value);
|
|
|
|
|
|
|
|
if (oldValue != Value()) {
|
|
|
|
BString label;
|
|
|
|
_TimeToString(kTimeInUnits[Value()] * 1000000LL, label);
|
|
|
|
SetLabel(label.String());
|
|
|
|
}
|
|
|
|
}
|
2005-08-01 16:53:23 +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
|
|
|
|
|
|
|
void
|
|
|
|
TimeSlider::SetTime(bigtime_t useconds)
|
|
|
|
{
|
|
|
|
for (int t = 0; t < kTimeUnitCount; t++) {
|
|
|
|
if (kTimeInUnits[t] * 1000000LL == useconds) {
|
|
|
|
SetValue(t);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-08-01 16:53:23 +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
|
|
|
|
|
|
|
bigtime_t
|
2010-06-30 17:49:27 +04:00
|
|
|
TimeSlider::Time() const
|
2005-08-01 16:53:23 +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
|
|
|
return 1000000LL * kTimeInUnits[Value()];
|
2005-08-01 16:53:23 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
* 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
|
|
|
TimeSlider::_TimeToString(bigtime_t useconds, BString& string)
|
2005-08-01 16:53:23 +04:00
|
|
|
{
|
2010-12-24 12:42:38 +03:00
|
|
|
BDurationFormat formatter;
|
|
|
|
formatter.Format(0, useconds, &string);
|
2005-08-01 16:53:23 +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
|
|
|
// #pragma mark -
|
|
|
|
|
2005-09-02 19:15:37 +04:00
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
FadeView::FadeView(BRect rect, const char* name, ScreenSaverSettings& settings)
|
2010-06-30 17:49:27 +04:00
|
|
|
:
|
|
|
|
BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW)
|
2006-06-06 20:56:30 +04:00
|
|
|
{
|
|
|
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
FadeView::AttachedToWindow()
|
|
|
|
{
|
|
|
|
if (Parent() != NULL) {
|
|
|
|
// We adopt the size of our parent view (in case the window
|
|
|
|
// was resized during our absence (BTabView...)
|
|
|
|
ResizeTo(Parent()->Bounds().Width(), Parent()->Bounds().Height());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// #pragma mark -
|
|
|
|
|
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
ModulesView::ModulesView(BRect rect, const char* name,
|
|
|
|
ScreenSaverSettings& settings)
|
|
|
|
:
|
|
|
|
BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW),
|
2006-06-07 16:43:31 +04:00
|
|
|
fSettings(settings),
|
* 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
|
|
|
fSaverRunner(NULL),
|
2010-06-30 17:49:27 +04:00
|
|
|
fSettingsView(NULL),
|
|
|
|
fScreenSaverTestTeam(-1)
|
2005-07-26 20:12:05 +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
|
|
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
|
|
|
2010-12-24 12:42:38 +03:00
|
|
|
fTestButton = new BButton(rect, "TestButton", B_TRANSLATE("Test"),
|
2010-06-30 17:49:27 +04:00
|
|
|
new BMessage(kMsgTestSaver), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
2006-06-06 20:56:30 +04:00
|
|
|
float width, height;
|
|
|
|
fTestButton->GetPreferredSize(&width, &height);
|
|
|
|
fTestButton->ResizeTo(width + 16, height);
|
|
|
|
fTestButton->MoveTo(8, rect.bottom - 8 - height);
|
* 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
|
|
|
AddChild(fTestButton);
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
rect = fTestButton->Frame();
|
|
|
|
rect.OffsetBy(fTestButton->Bounds().Width() + 8, 0);
|
2010-12-24 12:42:38 +03:00
|
|
|
fAddButton = new BButton(rect, "AddButton",
|
|
|
|
B_TRANSLATE("Add" B_UTF8_ELLIPSIS), new BMessage(kMsgAddSaver),
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
* 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
|
|
|
AddChild(fAddButton);
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
rect = Bounds().InsetByCopy(8 + kPreviewMonitorGap, 12);
|
|
|
|
rect.right = fAddButton->Frame().right - kPreviewMonitorGap;
|
|
|
|
rect.bottom = rect.top + 3 * rect.Width() / 4;
|
|
|
|
// 4:3 monitor
|
|
|
|
|
|
|
|
fPreviewView = new PreviewView(rect, "preview");
|
|
|
|
AddChild(fPreviewView);
|
|
|
|
|
|
|
|
rect.left = 8;
|
|
|
|
rect.right -= B_V_SCROLL_BAR_WIDTH + 2 - kPreviewMonitorGap;
|
|
|
|
// scroll view border
|
|
|
|
rect.top = rect.bottom + 14;
|
|
|
|
rect.bottom = fTestButton->Frame().top - 10;
|
|
|
|
fListView = new BListView(rect, "SaversListView", B_SINGLE_SELECTION_LIST,
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM);
|
|
|
|
fListView->SetSelectionMessage(new BMessage(kMsgSaverSelected));
|
|
|
|
AddChild(new BScrollView("scroll_list", fListView,
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, 0, false, true));
|
|
|
|
|
|
|
|
rect = Bounds().InsetByCopy(8, 8);
|
|
|
|
rect.left = fAddButton->Frame().right + 8;
|
2010-06-30 17:49:27 +04:00
|
|
|
AddChild(fSettingsBox = new BBox(rect, "SettingsBox", B_FOLLOW_ALL,
|
|
|
|
B_WILL_DRAW));
|
2011-04-09 16:21:04 +04:00
|
|
|
fSettingsBox->SetLabel(B_TRANSLATE("Screensaver settings"));
|
* 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
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
PopulateScreenSaverList();
|
* 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
|
|
|
fFilePanel = new BFilePanel();
|
2005-07-26 20:12:05 +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
|
|
|
ModulesView::~ModulesView()
|
2005-07-26 20:12:05 +04:00
|
|
|
{
|
2005-08-23 15:29:30 +04:00
|
|
|
delete fFilePanel;
|
2005-07-26 20:12:05 +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
|
|
|
void
|
|
|
|
ModulesView::DetachedFromWindow()
|
2004-05-04 02:41:30 +04:00
|
|
|
{
|
2010-03-02 21:44:28 +03:00
|
|
|
SaveState();
|
* 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
|
|
|
_CloseSaver();
|
2004-04-20 06:05:24 +04:00
|
|
|
}
|
|
|
|
|
2004-05-04 02:41:30 +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
|
|
|
void
|
|
|
|
ModulesView::AttachedToWindow()
|
2004-05-04 02:41:30 +04:00
|
|
|
{
|
2006-06-06 20:56:30 +04:00
|
|
|
if (Parent() != NULL) {
|
|
|
|
// We adopt the size of our parent view (in case the window
|
|
|
|
// was resized during our absence (BTabView...)
|
|
|
|
ResizeTo(Parent()->Bounds().Width(), Parent()->Bounds().Height());
|
|
|
|
}
|
|
|
|
|
* 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
|
|
|
_OpenSaver();
|
|
|
|
|
|
|
|
fListView->SetTarget(this);
|
|
|
|
fTestButton->SetTarget(this);
|
|
|
|
fAddButton->SetTarget(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
void
|
|
|
|
ModulesView::AllAttached()
|
|
|
|
{
|
|
|
|
// This only works after the view has been attached
|
|
|
|
fListView->ScrollToSelection();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
* 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
|
|
|
void
|
|
|
|
ModulesView::MessageReceived(BMessage* message)
|
|
|
|
{
|
|
|
|
switch (message->what) {
|
|
|
|
case kMsgSaverSelected:
|
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
|
|
|
int selection = fListView->CurrentSelection();
|
|
|
|
if (selection < 0)
|
|
|
|
break;
|
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
ScreenSaverItem* item
|
|
|
|
= (ScreenSaverItem*)fListView->ItemAt(selection);
|
* 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
|
|
|
if (item == NULL)
|
|
|
|
break;
|
|
|
|
|
2010-12-24 12:42:38 +03:00
|
|
|
if (!strcmp(item->Text(), B_TRANSLATE("Blackness")))
|
2006-06-07 16:43:31 +04:00
|
|
|
fSettings.SetModuleName("");
|
* 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
|
|
|
else
|
2006-06-07 16:43:31 +04:00
|
|
|
fSettings.SetModuleName(item->Text());
|
* 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
|
|
|
|
2008-06-02 21:08:42 +04:00
|
|
|
SaveState();
|
* 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
|
|
|
_CloseSaver();
|
|
|
|
_OpenSaver();
|
2008-08-23 16:19:34 +04:00
|
|
|
fSettings.Save();
|
2004-04-20 06:05:24 +04:00
|
|
|
break;
|
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
|
|
|
|
|
|
|
case kMsgTestSaver:
|
2010-06-30 02:30:42 +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
|
|
|
SaveState();
|
2006-06-09 20:03:16 +04:00
|
|
|
fSettings.Save();
|
* 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
|
|
|
|
2009-08-17 06:10:43 +04:00
|
|
|
_CloseSaver();
|
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
be_roster->StartWatching(BMessenger(this, Looper()),
|
2009-08-17 06:19:13 +04:00
|
|
|
B_REQUEST_QUIT);
|
2010-06-30 02:30:42 +04:00
|
|
|
if (be_roster->Launch(SCREEN_BLANKER_SIG, &fSettings.Message(),
|
2010-06-30 17:49:27 +04:00
|
|
|
&fScreenSaverTestTeam) == B_OK)
|
2010-06-30 02:30:42 +04:00
|
|
|
break;
|
2010-06-30 17:49:27 +04:00
|
|
|
|
|
|
|
// Try really hard to launch it. It's very likely that this fails
|
|
|
|
// when we run from the CD, and there is only an incomplete mime
|
2010-06-30 02:30:42 +04:00
|
|
|
// database for example...
|
|
|
|
BPath path;
|
|
|
|
if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK
|
2010-06-30 17:49:27 +04:00
|
|
|
|| path.Append("screen_blanker") != B_OK)
|
2010-06-30 02:30:42 +04:00
|
|
|
path.SetTo("/boot/system/bin/screen_blanker");
|
2010-06-30 17:49:27 +04:00
|
|
|
|
2010-06-30 02:30:42 +04:00
|
|
|
BEntry entry(path.Path());
|
|
|
|
entry_ref ref;
|
2010-06-30 17:49:27 +04:00
|
|
|
if (entry.GetRef(&ref) == B_OK) {
|
2010-06-30 02:30:42 +04:00
|
|
|
be_roster->Launch(&ref, &fSettings.Message(),
|
2010-06-30 17:49:27 +04:00
|
|
|
&fScreenSaverTestTeam);
|
|
|
|
}
|
2004-04-20 06:05:24 +04:00
|
|
|
break;
|
2010-06-30 02:30:42 +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
|
|
|
case kMsgAddSaver:
|
|
|
|
fFilePanel->Show();
|
2004-04-20 06:05:24 +04:00
|
|
|
break;
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
case B_SOME_APP_QUIT:
|
|
|
|
{
|
|
|
|
team_id team;
|
|
|
|
if (message->FindInt32("be:team", &team) == B_OK
|
|
|
|
&& team == fScreenSaverTestTeam) {
|
|
|
|
be_roster->StopWatching(this);
|
|
|
|
_OpenSaver();
|
2009-08-17 06:10:43 +04:00
|
|
|
}
|
|
|
|
break;
|
2010-06-30 17:49:27 +04:00
|
|
|
}
|
2009-08-17 06:10:43 +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
|
|
|
default:
|
|
|
|
BView::MessageReceived(message);
|
|
|
|
}
|
2004-03-31 04:35:20 +04:00
|
|
|
}
|
|
|
|
|
2004-05-04 02:41:30 +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
|
|
|
void
|
|
|
|
ModulesView::SaveState()
|
2004-05-04 02:41:30 +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
|
|
|
BScreenSaver* saver = _ScreenSaver();
|
|
|
|
if (saver == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
BMessage state;
|
|
|
|
if (saver->SaveState(&state) == B_OK)
|
2006-06-09 20:03:16 +04:00
|
|
|
fSettings.SetModuleState(fCurrentName.String(), &state);
|
* 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-03-31 04:35:20 +04:00
|
|
|
|
2004-05-04 02:41:30 +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
|
|
|
void
|
|
|
|
ModulesView::PopulateScreenSaverList()
|
2004-05-04 02:41:30 +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
|
|
|
fListView->DeselectAll();
|
2010-06-30 17:49:27 +04:00
|
|
|
while (ScreenSaverItem* item
|
|
|
|
= (ScreenSaverItem*)fListView->RemoveItem((int32)0)) {
|
* 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
|
|
|
delete item;
|
2005-07-29 11:41:58 +04:00
|
|
|
}
|
2004-03-31 04:35:20 +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
|
|
|
// Blackness is a built-in screen saver
|
2010-12-24 12:42:38 +03:00
|
|
|
fListView->AddItem(new ScreenSaverItem(B_TRANSLATE("Blackness"), ""));
|
2004-04-20 06:05:24 +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
|
|
|
// Iterate over add-on directories, and add their files to the list view
|
2004-04-20 06:05:24 +04:00
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
directory_which which[] = {
|
|
|
|
B_BEOS_ADDONS_DIRECTORY, B_USER_ADDONS_DIRECTORY};
|
* 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
|
|
|
ScreenSaverItem* selectItem = NULL;
|
2004-03-31 04:35:20 +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
|
|
|
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {
|
|
|
|
BPath basePath;
|
|
|
|
find_directory(which[i], &basePath);
|
|
|
|
basePath.Append("Screen Savers", true);
|
2004-03-31 04:35:20 +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
|
|
|
BDirectory dir(basePath.Path());
|
|
|
|
BEntry entry;
|
|
|
|
while (dir.GetNextEntry(&entry, true) == B_OK) {
|
|
|
|
char name[B_FILE_NAME_LENGTH];
|
|
|
|
if (entry.GetName(name) != B_OK)
|
|
|
|
continue;
|
2004-04-20 06:05:24 +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
|
|
|
BPath path = basePath;
|
|
|
|
path.Append(name);
|
2004-03-31 04:35:20 +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
|
|
|
ScreenSaverItem* item = new ScreenSaverItem(name, path.Path());
|
2010-03-02 21:44:28 +03:00
|
|
|
fListView->AddItem(item);
|
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
if (!strcmp(fSettings.ModuleName(), item->Text())
|
2010-03-02 21:44:28 +03:00
|
|
|
|| (!strcmp(fSettings.ModuleName(), "")
|
2010-12-24 12:42:38 +03:00
|
|
|
&& !strcmp(item->Text(), B_TRANSLATE("Blackness"))))
|
* 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
|
|
|
selectItem = item;
|
|
|
|
}
|
|
|
|
}
|
2004-03-31 04:35:20 +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
|
|
|
fListView->SortItems(_CompareScreenSaverItems);
|
2004-03-31 04:35:20 +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
|
|
|
fListView->Select(fListView->IndexOf(selectItem));
|
|
|
|
fListView->ScrollToSelection();
|
|
|
|
}
|
2004-05-04 02:41:30 +04:00
|
|
|
|
2005-09-02 19:15:37 +04:00
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
//! Sorting function for ScreenSaverItems
|
* 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
|
|
|
int
|
2010-03-02 21:44:28 +03:00
|
|
|
ModulesView::_CompareScreenSaverItems(const void* left, const void* right)
|
* 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
|
|
|
{
|
|
|
|
ScreenSaverItem* leftItem = *(ScreenSaverItem **)left;
|
|
|
|
ScreenSaverItem* rightItem = *(ScreenSaverItem **)right;
|
2005-09-02 19:15:37 +04:00
|
|
|
|
2006-06-16 23:07:00 +04:00
|
|
|
return strcasecmp(leftItem->Text(), rightItem->Text());
|
* 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-03-31 04:35:20 +04:00
|
|
|
|
2004-05-04 02:41:30 +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
|
|
|
BScreenSaver*
|
|
|
|
ModulesView::_ScreenSaver()
|
2005-08-01 16:53:23 +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
|
|
|
if (fSaverRunner != NULL)
|
|
|
|
return fSaverRunner->ScreenSaver();
|
|
|
|
|
|
|
|
return NULL;
|
2005-08-01 16:53:23 +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
|
|
|
void
|
|
|
|
ModulesView::_CloseSaver()
|
2004-05-04 02:41:30 +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
|
|
|
// remove old screen saver preview & config
|
|
|
|
|
|
|
|
BScreenSaver* saver = _ScreenSaver();
|
2006-06-06 20:56:30 +04:00
|
|
|
BView* view = fPreviewView->RemovePreview();
|
* 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
|
|
|
if (fSettingsView != NULL)
|
|
|
|
fSettingsBox->RemoveChild(fSettingsView);
|
|
|
|
|
2007-01-21 16:20:20 +03:00
|
|
|
if (fSaverRunner != NULL)
|
|
|
|
fSaverRunner->Quit();
|
* 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
|
|
|
if (saver != NULL)
|
|
|
|
saver->StopConfig();
|
2010-03-02 21:44:28 +03: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
|
|
|
delete view;
|
|
|
|
delete fSettingsView;
|
|
|
|
delete fSaverRunner;
|
2007-01-21 16:20:20 +03:00
|
|
|
// the saver runner also unloads the add-on, so it must
|
|
|
|
// be deleted last
|
* 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
|
|
|
|
|
|
|
fSettingsView = NULL;
|
|
|
|
fSaverRunner = NULL;
|
2004-05-04 02:41:30 +04:00
|
|
|
}
|
|
|
|
|
2004-03-31 04:35:20 +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
|
|
|
void
|
|
|
|
ModulesView::_OpenSaver()
|
2004-05-04 02:41:30 +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
|
|
|
// create new screen saver preview & config
|
|
|
|
|
2008-01-14 02:05:30 +03:00
|
|
|
BView* view = fPreviewView->AddPreview();
|
2006-06-07 16:43:31 +04:00
|
|
|
fCurrentName = fSettings.ModuleName();
|
|
|
|
fSaverRunner = new ScreenSaverRunner(Window(), view, true, fSettings);
|
* 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
|
|
|
BScreenSaver* saver = _ScreenSaver();
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
#ifdef __HAIKU__
|
2006-06-07 18:04:03 +04:00
|
|
|
BRect rect = fSettingsBox->InnerFrame().InsetByCopy(4, 4);
|
2006-06-06 20:56:30 +04:00
|
|
|
#else
|
2006-06-07 18:04:03 +04:00
|
|
|
BRect rect = fSettingsBox->Bounds().InsetByCopy(4, 4);
|
2006-06-06 20:56:30 +04:00
|
|
|
rect.top += 14;
|
|
|
|
#endif
|
|
|
|
fSettingsView = new BView(rect, "SettingsView", B_FOLLOW_ALL, B_WILL_DRAW);
|
* 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
|
|
|
fSettingsView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
|
|
fSettingsBox->AddChild(fSettingsView);
|
|
|
|
|
|
|
|
if (saver != NULL) {
|
|
|
|
fSaverRunner->Run();
|
|
|
|
saver->StartConfig(fSettingsView);
|
2004-05-04 02:41:30 +04:00
|
|
|
}
|
2006-06-06 20:56:30 +04:00
|
|
|
|
|
|
|
if (fSettingsView->ChildAt(0) == NULL) {
|
|
|
|
// There are no settings at all, we add the module name here to
|
|
|
|
// let it look a bit better at least.
|
2009-10-02 00:48:14 +04:00
|
|
|
BPrivate::BuildScreenSaverDefaultSettingsView(fSettingsView,
|
2011-02-16 18:36:05 +03:00
|
|
|
fSettings.ModuleName()[0] ? fSettings.ModuleName() :
|
2010-12-24 12:42:38 +03:00
|
|
|
B_TRANSLATE("Blackness"), saver || !fSettings.ModuleName()[0]
|
|
|
|
? B_TRANSLATE("No options available") :
|
|
|
|
B_TRANSLATE("Could not load screen saver"));
|
2006-06-06 20:56:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
ScreenSaverWindow* window = dynamic_cast<ScreenSaverWindow*>(Window());
|
|
|
|
if (window == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// find the minimal size of the settings view
|
|
|
|
|
|
|
|
float right = 0, bottom = 0;
|
|
|
|
int32 i = 0;
|
|
|
|
while ((view = fSettingsView->ChildAt(i++)) != NULL) {
|
|
|
|
// very simple heuristic...
|
|
|
|
float viewRight = view->Frame().right;
|
2010-06-30 17:49:27 +04:00
|
|
|
if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf))
|
|
|
|
== B_FOLLOW_LEFT_RIGHT) {
|
2006-06-06 20:56:30 +04:00
|
|
|
float width, height;
|
|
|
|
view->GetPreferredSize(&width, &height);
|
|
|
|
viewRight = view->Frame().left + width / 2;
|
2010-06-30 17:49:27 +04:00
|
|
|
} else if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf))
|
|
|
|
== B_FOLLOW_RIGHT)
|
2006-06-06 20:56:30 +04:00
|
|
|
viewRight = 8 + view->Frame().Width();
|
|
|
|
|
|
|
|
float viewBottom = view->Frame().bottom;
|
2010-06-30 17:49:27 +04:00
|
|
|
if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0))
|
|
|
|
== B_FOLLOW_TOP_BOTTOM) {
|
2006-06-06 20:56:30 +04:00
|
|
|
float width, height;
|
|
|
|
view->GetPreferredSize(&width, &height);
|
|
|
|
viewBottom = view->Frame().top + height;
|
2010-06-30 17:49:27 +04:00
|
|
|
} else if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0))
|
|
|
|
== B_FOLLOW_BOTTOM)
|
2006-06-06 20:56:30 +04:00
|
|
|
viewBottom = 8 + view->Frame().Height();
|
|
|
|
|
|
|
|
if (viewRight > right)
|
|
|
|
right = viewRight;
|
|
|
|
if (viewBottom > bottom)
|
|
|
|
bottom = viewBottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (right < kMinSettingsWidth)
|
|
|
|
right = kMinSettingsWidth;
|
|
|
|
if (bottom < kMinSettingsHeight)
|
|
|
|
bottom = kMinSettingsHeight;
|
|
|
|
|
|
|
|
BPoint leftTop = fSettingsView->LeftTop();
|
|
|
|
fSettingsView->ConvertToScreen(&leftTop);
|
|
|
|
window->ConvertFromScreen(&leftTop);
|
|
|
|
window->SetMinimalSizeLimit(leftTop.x + right + 16,
|
|
|
|
leftTop.y + bottom + 16);
|
2004-03-31 04:35:20 +04:00
|
|
|
}
|
|
|
|
|
2004-05-04 02:41:30 +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
|
|
|
// #pragma mark -
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2004-05-04 02:41:30 +04:00
|
|
|
|
2010-03-02 21:44:28 +03:00
|
|
|
ScreenSaverWindow::ScreenSaverWindow()
|
2010-06-30 17:49:27 +04:00
|
|
|
:
|
2011-03-26 01:13:48 +03:00
|
|
|
BWindow(BRect(50, 50, 496, 375), B_TRANSLATE_SYSTEM_NAME("ScreenSaver"),
|
2010-06-30 17:49:27 +04:00
|
|
|
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS)
|
2004-05-04 02:41:30 +04:00
|
|
|
{
|
2006-06-09 20:03:16 +04:00
|
|
|
fSettings.Load();
|
* 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
|
|
|
|
|
|
|
BRect rect = Bounds();
|
2006-06-16 23:07:00 +04:00
|
|
|
fMinWidth = 430;
|
|
|
|
fMinHeight = 325;
|
* 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
|
|
|
|
|
|
|
// Create a background view
|
|
|
|
BView *background = new BView(rect, "background", B_FOLLOW_ALL, 0);
|
|
|
|
background->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
|
|
AddChild(background);
|
2004-04-20 06:05:24 +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
|
|
|
// Add the tab view to the background
|
|
|
|
rect.top += 4;
|
|
|
|
fTabView = new BTabView(rect, "tab_view");
|
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
|
|
|
// Create the controls inside the tabs
|
|
|
|
rect = fTabView->ContainerView()->Bounds();
|
|
|
|
_SetupFadeTab(rect);
|
2011-04-09 16:21:04 +04:00
|
|
|
fModulesView = new ModulesView(rect, B_TRANSLATE("Screensavers"), fSettings);
|
* 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
|
|
|
|
|
|
|
fTabView->AddTab(fFadeView);
|
|
|
|
fTabView->AddTab(fModulesView);
|
|
|
|
background->AddChild(fTabView);
|
|
|
|
|
|
|
|
// Create the password editing window
|
2006-06-07 16:43:31 +04:00
|
|
|
fPasswordWindow = new PasswordWindow(fSettings);
|
* 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
|
|
|
fPasswordWindow->Run();
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
SetMinimalSizeLimit(fMinWidth, fMinHeight);
|
2006-06-07 16:43:31 +04:00
|
|
|
MoveTo(fSettings.WindowFrame().left, fSettings.WindowFrame().top);
|
|
|
|
ResizeTo(fSettings.WindowFrame().Width(), fSettings.WindowFrame().Height());
|
* 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
|
|
|
|
2010-06-30 17:49:27 +04:00
|
|
|
fEnableCheckBox->SetValue(
|
|
|
|
fSettings.TimeFlags() & ENABLE_SAVER ? B_CONTROL_ON : B_CONTROL_OFF);
|
2006-06-07 16:43:31 +04:00
|
|
|
fRunSlider->SetTime(fSettings.BlankTime());
|
|
|
|
fTurnOffSlider->SetTime(fSettings.OffTime() + fSettings.BlankTime());
|
2006-06-09 20:03:16 +04:00
|
|
|
fFadeNow->SetCorner(fSettings.BlankCorner());
|
|
|
|
fFadeNever->SetCorner(fSettings.NeverBlankCorner());
|
2006-06-07 16:43:31 +04:00
|
|
|
fPasswordCheckBox->SetValue(fSettings.LockEnable());
|
|
|
|
fPasswordSlider->SetTime(fSettings.PasswordTime());
|
* 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
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
fTabView->Select(fSettings.WindowTab());
|
* 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
|
|
|
|
|
|
|
_UpdateTurnOffScreen();
|
|
|
|
_UpdateStatus();
|
2004-03-31 04:35:20 +04:00
|
|
|
}
|
|
|
|
|
2004-05-04 02:41:30 +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
|
|
|
ScreenSaverWindow::~ScreenSaverWindow()
|
2004-05-04 02:41:30 +04:00
|
|
|
{
|
2010-03-02 21:44:28 +03:00
|
|
|
Hide();
|
|
|
|
_UpdateStatus();
|
|
|
|
|
|
|
|
delete fTabView->RemoveTab(1);
|
|
|
|
// We delete this here in order to make sure the module view saves its
|
|
|
|
// state while the window is still intact.
|
|
|
|
|
|
|
|
fSettings.Save();
|
* 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
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-09 16:21:04 +04:00
|
|
|
//! Create the controls for the "General" tab
|
* 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
|
|
|
void
|
|
|
|
ScreenSaverWindow::_SetupFadeTab(BRect rect)
|
2004-05-04 02:41:30 +04:00
|
|
|
{
|
2011-04-09 16:21:04 +04:00
|
|
|
fFadeView = new FadeView(rect, B_TRANSLATE("General"), fSettings);
|
* 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
|
|
|
|
2011-04-09 16:34:32 +04:00
|
|
|
float StringWidth1 = be_plain_font->StringWidth(B_TRANSLATE
|
|
|
|
("Start screensaver"));
|
|
|
|
float StringWidth2 = be_plain_font->StringWidth(B_TRANSLATE
|
|
|
|
("Turn off screen"));
|
|
|
|
float StringWidth3 = be_plain_font->StringWidth(B_TRANSLATE
|
|
|
|
("Password lock"));
|
|
|
|
|
|
|
|
float labelWidth = StringWidth1;
|
|
|
|
if (labelWidth < StringWidth2)
|
|
|
|
labelWidth = StringWidth2;
|
|
|
|
if (labelWidth < StringWidth3)
|
|
|
|
labelWidth = StringWidth3;
|
|
|
|
|
|
|
|
labelWidth += 20.0f;
|
2006-06-07 18:04:03 +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
|
|
|
font_height fontHeight;
|
|
|
|
be_plain_font->GetHeight(&fontHeight);
|
2006-06-07 18:04:03 +04:00
|
|
|
float textHeight = ceilf(fontHeight.ascent + fontHeight.descent);
|
|
|
|
|
|
|
|
// taken from BRadioButton:
|
2010-06-30 17:49:27 +04:00
|
|
|
float radioButtonOffset = 2 * floorf(textHeight / 2 - 2)
|
|
|
|
+ floorf(textHeight / 2);
|
2006-06-07 18:04:03 +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
|
|
|
fEnableCheckBox = new BCheckBox(BRect(0, 0, 1, 1), "EnableCheckBox",
|
2011-04-09 16:21:04 +04:00
|
|
|
B_TRANSLATE("Enable screensaver"),
|
2010-12-24 12:42:38 +03:00
|
|
|
new BMessage(kMsgEnableScreenSaverBox));
|
* 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
|
|
|
fEnableCheckBox->ResizeToPreferred();
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
rect.InsetBy(8, 8);
|
* 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
|
|
|
BBox* box = new BBox(rect, "EnableScreenSaverBox", B_FOLLOW_ALL);
|
|
|
|
box->SetLabel(fEnableCheckBox);
|
|
|
|
fFadeView->AddChild(box);
|
2004-04-20 06:05:24 +04:00
|
|
|
|
2011-04-09 16:34:32 +04:00
|
|
|
// Start Screensaver
|
|
|
|
rect.left += radioButtonOffset + 6;
|
* 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
|
|
|
rect.top = fEnableCheckBox->Bounds().bottom + 8.0f;
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.right = box->Bounds().right - 8;
|
2010-12-24 12:42:38 +03:00
|
|
|
BStringView* stringView = new BStringView(rect, NULL,
|
2011-04-09 16:21:04 +04:00
|
|
|
B_TRANSLATE("Start screensaver"));
|
* 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
|
|
|
stringView->ResizeToPreferred();
|
|
|
|
box->AddChild(stringView);
|
|
|
|
|
2011-04-09 16:34:32 +04:00
|
|
|
rect.left += labelWidth - 4;
|
2007-01-04 18:36:22 +03:00
|
|
|
fRunSlider = new TimeSlider(rect, "RunSlider", kMsgRunSliderChanged,
|
2007-01-04 17:27:05 +03:00
|
|
|
kMsgRunSliderUpdate);
|
* 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
|
|
|
float width, height;
|
|
|
|
fRunSlider->GetPreferredSize(&width, &height);
|
|
|
|
fRunSlider->ResizeTo(fRunSlider->Bounds().Width(), height);
|
|
|
|
box->AddChild(fRunSlider);
|
2004-04-20 06:05:24 +04:00
|
|
|
|
|
|
|
// Turn Off
|
2011-04-09 16:34:32 +04:00
|
|
|
rect.left = 10;
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.OffsetBy(0, fRunSlider->Bounds().Height() + 4.0f);
|
|
|
|
fTurnOffCheckBox = new BCheckBox(rect, "TurnOffScreenCheckBox",
|
2010-12-24 12:42:38 +03:00
|
|
|
B_TRANSLATE("Turn off screen"), new BMessage(kMsgTurnOffCheckBox));
|
* 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
|
|
|
fTurnOffCheckBox->ResizeToPreferred();
|
|
|
|
box->AddChild(fTurnOffCheckBox);
|
2004-04-20 06:05:24 +04:00
|
|
|
|
2011-04-09 16:34:32 +04:00
|
|
|
rect.top += 3;
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left += radioButtonOffset + labelWidth;
|
2007-01-04 18:36:22 +03:00
|
|
|
fTurnOffSlider = new TimeSlider(rect, "TurnOffSlider",
|
|
|
|
kMsgTurnOffSliderChanged, kMsgTurnOffSliderUpdate);
|
* 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
|
|
|
fTurnOffSlider->ResizeTo(fTurnOffSlider->Bounds().Width(), height);
|
|
|
|
box->AddChild(fTurnOffSlider);
|
2004-04-20 06:05:24 +04:00
|
|
|
|
2011-02-16 18:36:05 +03:00
|
|
|
rgb_color textColor = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
|
|
|
|
B_DISABLED_LABEL_TINT);
|
|
|
|
BRect textRect(0, 0, fTurnOffSlider->Bounds().Width(), height);
|
|
|
|
textRect.InsetBy(0, 3);
|
|
|
|
fTurnOffNotSupported = new BTextView(rect, "not_supported",
|
|
|
|
textRect, be_plain_font, &textColor, B_FOLLOW_ALL, B_WILL_DRAW);
|
|
|
|
fTurnOffNotSupported->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
|
|
fTurnOffNotSupported->MakeEditable(false);
|
|
|
|
fTurnOffNotSupported->MakeSelectable(false);
|
|
|
|
fTurnOffNotSupported->SetText(
|
|
|
|
B_TRANSLATE("Display Power Management Signaling not available"));
|
|
|
|
|
|
|
|
fTurnOffNotSupported->ResizeTo(fTurnOffSlider->Bounds().Width(), height);
|
|
|
|
box->AddChild(fTurnOffNotSupported);
|
|
|
|
|
2004-04-20 06:05:24 +04:00
|
|
|
// Password
|
2011-04-09 16:34:32 +04:00
|
|
|
rect.left = 10;
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.OffsetBy(0, fTurnOffSlider->Bounds().Height() + 4.0f);
|
|
|
|
fPasswordCheckBox = new BCheckBox(rect, "PasswordCheckbox",
|
2010-12-24 12:42:38 +03:00
|
|
|
B_TRANSLATE("Password lock"), new BMessage(kMsgPasswordCheckBox));
|
* 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
|
|
|
fPasswordCheckBox->ResizeToPreferred();
|
|
|
|
box->AddChild(fPasswordCheckBox);
|
|
|
|
|
2011-04-09 16:34:32 +04:00
|
|
|
rect.top += 3;
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left += radioButtonOffset + labelWidth;
|
2007-01-04 18:36:22 +03:00
|
|
|
fPasswordSlider = new TimeSlider(rect, "PasswordSlider",
|
|
|
|
kMsgPasswordSliderChanged, kMsgPasswordSliderUpdate);
|
* 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
|
|
|
fPasswordSlider->ResizeTo(fPasswordSlider->Bounds().Width(), height);
|
|
|
|
box->AddChild(fPasswordSlider);
|
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.OffsetBy(0, fTurnOffSlider->Bounds().Height() + 4.0f);
|
|
|
|
rect.left = rect.right;
|
2010-06-30 17:49:27 +04:00
|
|
|
fPasswordButton = new BButton(rect, "PasswordButton",
|
2010-12-24 12:42:38 +03:00
|
|
|
B_TRANSLATE("Password" B_UTF8_ELLIPSIS),
|
|
|
|
new BMessage(kMsgChangePassword), B_FOLLOW_TOP | B_FOLLOW_RIGHT);
|
* 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
|
|
|
fPasswordButton->ResizeToPreferred();
|
|
|
|
fPasswordButton->MoveBy(-fPasswordButton->Bounds().Width(), 0);
|
|
|
|
box->AddChild(fPasswordButton);
|
2004-03-31 04:35:20 +04:00
|
|
|
|
|
|
|
// Bottom
|
|
|
|
|
2006-06-16 23:07:00 +04:00
|
|
|
float monitorHeight = 10 + textHeight * 3;
|
|
|
|
float monitorWidth = monitorHeight * 4 / 3;
|
2011-04-09 16:34:32 +04:00
|
|
|
rect.left = 11;
|
2006-06-16 23:07:00 +04:00
|
|
|
rect.top = box->Bounds().Height() - 15 - monitorHeight;
|
|
|
|
rect.right = rect.left + monitorWidth;
|
|
|
|
rect.bottom = rect.top + monitorHeight;
|
|
|
|
box->AddChild(fFadeNow = new ScreenCornerSelector(rect, "FadeNow",
|
2006-06-09 20:03:16 +04:00
|
|
|
new BMessage(kMsgFadeCornerChanged), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM));
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2006-06-16 23:07:00 +04:00
|
|
|
rect.OffsetBy(monitorWidth + 10, 0);
|
2010-12-24 12:42:38 +03:00
|
|
|
stringView = new BStringView(rect, NULL, B_TRANSLATE("Fade now when"),
|
2006-06-07 18:04:03 +04:00
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
2006-06-16 23:07:00 +04:00
|
|
|
float maxWidth = stringView->Bounds().Width();
|
2006-06-07 15:51:37 +04:00
|
|
|
box->AddChild(stringView);
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.OffsetBy(0, stringView->Bounds().Height());
|
2010-12-24 12:42:38 +03:00
|
|
|
stringView = new BStringView(rect, NULL, B_TRANSLATE("mouse is here"),
|
2006-06-07 18:04:03 +04:00
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
2006-06-16 23:07:00 +04:00
|
|
|
if (maxWidth < stringView->Bounds().Width())
|
|
|
|
maxWidth = stringView->Bounds().Width();
|
2006-06-07 15:51:37 +04:00
|
|
|
box->AddChild(stringView);
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2006-06-16 23:07:00 +04:00
|
|
|
rect.left += maxWidth + 20;
|
|
|
|
rect.top = box->Bounds().Height() - 15 - monitorHeight;
|
|
|
|
rect.right = rect.left + monitorWidth;
|
|
|
|
rect.bottom = rect.top + monitorHeight;
|
|
|
|
box->AddChild(fFadeNever = new ScreenCornerSelector(rect, "FadeNever",
|
2010-06-30 17:49:27 +04:00
|
|
|
new BMessage(kMsgNeverFadeCornerChanged),
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM));
|
2006-06-16 23:07:00 +04:00
|
|
|
|
|
|
|
rect.OffsetBy(monitorWidth + 10, 0);
|
2010-12-24 12:42:38 +03:00
|
|
|
stringView = new BStringView(rect, NULL,B_TRANSLATE("Don't fade when"),
|
2006-06-07 18:04:03 +04:00
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
2006-06-16 23:07:00 +04:00
|
|
|
if (maxWidth < stringView->Bounds().Width())
|
|
|
|
maxWidth = stringView->Bounds().Width();
|
2006-06-07 15:51:37 +04:00
|
|
|
box->AddChild(stringView);
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.OffsetBy(0, stringView->Bounds().Height());
|
2010-12-24 12:42:38 +03:00
|
|
|
stringView = new BStringView(rect, NULL, B_TRANSLATE("mouse is here"),
|
2006-06-07 18:04:03 +04:00
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
2006-06-16 23:07:00 +04:00
|
|
|
if (maxWidth < stringView->Bounds().Width())
|
|
|
|
maxWidth = stringView->Bounds().Width();
|
2006-06-07 15:51:37 +04:00
|
|
|
box->AddChild(stringView);
|
2006-06-16 23:07:00 +04:00
|
|
|
|
|
|
|
float size = rect.left + maxWidth + 40;
|
|
|
|
if (fMinWidth < size)
|
|
|
|
fMinWidth = size;
|
|
|
|
size = fPasswordButton->Frame().bottom + box->Frame().top
|
|
|
|
+ monitorHeight + 40 + textHeight * 2;
|
|
|
|
if (fMinHeight < size)
|
|
|
|
fMinHeight = size;
|
2004-03-31 04:35:20 +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
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
ScreenSaverWindow::_UpdateTurnOffScreen()
|
|
|
|
{
|
2006-06-07 16:43:31 +04:00
|
|
|
bool enabled = (fSettings.TimeFlags() & ENABLE_DPMS_MASK) != 0;
|
* 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
|
|
|
|
|
|
|
BScreen screen(this);
|
|
|
|
uint32 dpmsCapabilities = screen.DPMSCapabilites();
|
|
|
|
|
|
|
|
fTurnOffScreenFlags = 0;
|
|
|
|
if (dpmsCapabilities & B_DPMS_OFF)
|
|
|
|
fTurnOffScreenFlags |= ENABLE_DPMS_OFF;
|
|
|
|
if (dpmsCapabilities & B_DPMS_STAND_BY)
|
|
|
|
fTurnOffScreenFlags |= ENABLE_DPMS_STAND_BY;
|
|
|
|
if (dpmsCapabilities & B_DPMS_SUSPEND)
|
|
|
|
fTurnOffScreenFlags |= ENABLE_DPMS_SUSPEND;
|
|
|
|
|
|
|
|
fTurnOffCheckBox->SetValue(enabled && fTurnOffScreenFlags != 0
|
|
|
|
? B_CONTROL_ON : B_CONTROL_OFF);
|
2011-02-16 18:36:05 +03:00
|
|
|
|
|
|
|
enabled = fEnableCheckBox->Value() == B_CONTROL_ON;
|
|
|
|
fTurnOffCheckBox->SetEnabled(enabled && fTurnOffScreenFlags != 0);
|
|
|
|
if (fTurnOffScreenFlags != 0) {
|
|
|
|
fTurnOffNotSupported->Hide();
|
|
|
|
fTurnOffSlider->Show();
|
|
|
|
} else {
|
|
|
|
fTurnOffSlider->Hide();
|
|
|
|
fTurnOffNotSupported->Show();
|
|
|
|
}
|
* 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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2006-06-06 20:56:30 +04:00
|
|
|
ScreenSaverWindow::_UpdateStatus()
|
|
|
|
{
|
|
|
|
DisableUpdates();
|
|
|
|
|
|
|
|
bool enabled = fEnableCheckBox->Value() == B_CONTROL_ON;
|
|
|
|
fPasswordCheckBox->SetEnabled(enabled);
|
|
|
|
fTurnOffCheckBox->SetEnabled(enabled && fTurnOffScreenFlags != 0);
|
|
|
|
fRunSlider->SetEnabled(enabled);
|
|
|
|
fTurnOffSlider->SetEnabled(enabled && fTurnOffCheckBox->Value());
|
|
|
|
fPasswordSlider->SetEnabled(enabled && fPasswordCheckBox->Value());
|
|
|
|
fPasswordButton->SetEnabled(enabled && fPasswordCheckBox->Value());
|
|
|
|
|
|
|
|
EnableUpdates();
|
|
|
|
|
|
|
|
// Update the saved preferences
|
2010-03-02 21:44:28 +03:00
|
|
|
fSettings.SetWindowFrame(Frame());
|
2006-06-07 16:43:31 +04:00
|
|
|
fSettings.SetWindowTab(fTabView->Selection());
|
|
|
|
fSettings.SetTimeFlags((enabled ? ENABLE_SAVER : 0)
|
2006-06-06 20:56:30 +04:00
|
|
|
| (fTurnOffCheckBox->Value() ? fTurnOffScreenFlags : 0));
|
2006-06-07 16:43:31 +04:00
|
|
|
fSettings.SetBlankTime(fRunSlider->Time());
|
|
|
|
bigtime_t offTime = fTurnOffSlider->Time() - fSettings.BlankTime();
|
|
|
|
fSettings.SetOffTime(offTime);
|
|
|
|
fSettings.SetSuspendTime(offTime);
|
|
|
|
fSettings.SetStandByTime(offTime);
|
|
|
|
fSettings.SetBlankCorner(fFadeNow->Corner());
|
|
|
|
fSettings.SetNeverBlankCorner(fFadeNever->Corner());
|
|
|
|
fSettings.SetLockEnable(fPasswordCheckBox->Value());
|
|
|
|
fSettings.SetPasswordTime(fPasswordSlider->Time());
|
2006-06-06 20:56:30 +04:00
|
|
|
|
|
|
|
// TODO - Tell the password window to update its stuff
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
ScreenSaverWindow::SetMinimalSizeLimit(float width, float height)
|
|
|
|
{
|
|
|
|
if (width < fMinWidth)
|
|
|
|
width = fMinWidth;
|
|
|
|
if (height < fMinHeight)
|
|
|
|
height = fMinHeight;
|
|
|
|
|
|
|
|
SetSizeLimits(width, 32767, height, 32767);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
ScreenSaverWindow::MessageReceived(BMessage *msg)
|
* 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
|
|
|
{
|
2011-04-09 16:21:04 +04:00
|
|
|
// "Settings" tab, slider updates
|
* 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
|
|
|
|
2007-01-04 18:36:22 +03:00
|
|
|
switch (msg->what) {
|
|
|
|
case kMsgRunSliderChanged:
|
2007-01-04 17:27:05 +03:00
|
|
|
case kMsgRunSliderUpdate:
|
* 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
|
|
|
if (fRunSlider->Value() > fTurnOffSlider->Value())
|
|
|
|
fTurnOffSlider->SetValue(fRunSlider->Value());
|
|
|
|
|
|
|
|
if (fRunSlider->Value() > fPasswordSlider->Value())
|
|
|
|
fPasswordSlider->SetValue(fRunSlider->Value());
|
|
|
|
break;
|
|
|
|
|
2007-01-04 18:36:22 +03:00
|
|
|
case kMsgTurnOffSliderChanged:
|
2007-01-04 17:27:05 +03:00
|
|
|
case kMsgTurnOffSliderUpdate:
|
* 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
|
|
|
if (fRunSlider->Value() > fTurnOffSlider->Value())
|
|
|
|
fRunSlider->SetValue(fTurnOffSlider->Value());
|
|
|
|
break;
|
|
|
|
|
2007-01-04 18:36:22 +03:00
|
|
|
case kMsgPasswordSliderChanged:
|
2007-01-04 17:27:05 +03:00
|
|
|
case kMsgPasswordSliderUpdate:
|
* 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
|
|
|
if (fPasswordSlider->Value() < fRunSlider->Value())
|
|
|
|
fRunSlider->SetValue(fPasswordSlider->Value());
|
|
|
|
break;
|
2007-01-04 18:36:22 +03: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
|
|
|
|
2007-01-04 18:36:22 +03:00
|
|
|
switch (msg->what) {
|
2011-04-09 16:21:04 +04:00
|
|
|
// "General" tab
|
2007-01-04 18:36:22 +03:00
|
|
|
|
|
|
|
case kMsgTurnOffCheckBox:
|
2010-06-30 17:49:27 +04:00
|
|
|
fTurnOffSlider->SetEnabled(
|
|
|
|
fTurnOffCheckBox->Value() == B_CONTROL_ON);
|
2007-01-04 18:36:22 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kMsgRunSliderChanged:
|
|
|
|
case kMsgTurnOffSliderChanged:
|
|
|
|
case kMsgPasswordSliderChanged:
|
* 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
|
|
|
case kMsgPasswordCheckBox:
|
|
|
|
case kMsgEnableScreenSaverBox:
|
2006-06-09 20:03:16 +04:00
|
|
|
case kMsgFadeCornerChanged:
|
|
|
|
case kMsgNeverFadeCornerChanged:
|
* 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
|
|
|
_UpdateStatus();
|
2006-06-09 20:03:16 +04:00
|
|
|
fSettings.Save();
|
* 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
|
|
|
break;
|
|
|
|
|
|
|
|
case kMsgChangePassword:
|
|
|
|
fPasswordWindow->Show();
|
|
|
|
break;
|
|
|
|
|
2011-04-09 16:21:04 +04:00
|
|
|
// "Screensavers" tab
|
* 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
|
|
|
|
|
|
|
case kMsgUpdateList:
|
|
|
|
fModulesView->PopulateScreenSaverList();
|
|
|
|
break;
|
2007-01-04 18:36:22 +03:00
|
|
|
|
|
|
|
default:
|
|
|
|
BWindow::MessageReceived(msg);
|
|
|
|
break;
|
2008-01-14 02:05:30 +03: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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
ScreenSaverWindow::ScreenChanged(BRect frame, color_space colorSpace)
|
|
|
|
{
|
|
|
|
_UpdateTurnOffScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
2006-06-06 20:56:30 +04:00
|
|
|
ScreenSaverWindow::QuitRequested()
|
* 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
|
|
|
{
|
|
|
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
|
|
|
return true;
|
2010-03-02 21:44:28 +03: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
|
|
|
|