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
|
|
|
* Copyright 2003-2006, 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 "PreviewView.h"
|
2006-06-07 15:57:25 +04:00
|
|
|
#include "ScreenCornerSelector.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 "ScreenSaverItem.h"
|
|
|
|
#include "ScreenSaverWindow.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>
|
2004-03-31 04:35:20 +04:00
|
|
|
#include <Directory.h>
|
|
|
|
#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>
|
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
|
|
|
#include <stdio.h>
|
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
|
|
|
|
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';
|
|
|
|
const int32 kMsgRunSliderChanged = 'RSCG';
|
|
|
|
const int32 kMsgPasswordSliderChanged = 'PWCG';
|
|
|
|
const int32 kMsgChangePassword = 'PWBT';
|
|
|
|
const int32 kMsgEnableScreenSaverBox = 'ESCH';
|
|
|
|
|
|
|
|
const int32 kMsgTurnOffCheckBox = 'TUOF';
|
|
|
|
const int32 kMsgTurnOffSliderChanged = 'TUCG';
|
|
|
|
|
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
|
|
|
static const uint32 kTimeSliderChanged = 'tsch';
|
|
|
|
|
2006-06-09 20:03:16 +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 TimeSlider : public BSlider {
|
|
|
|
public:
|
|
|
|
TimeSlider(BRect frame, const char* name, uint32 modificationMessage);
|
|
|
|
virtual ~TimeSlider();
|
|
|
|
|
|
|
|
virtual void AttachedToWindow();
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
virtual void SetValue(int32 value);
|
|
|
|
|
|
|
|
void SetTime(bigtime_t useconds);
|
|
|
|
bigtime_t Time();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void _TimeToString(bigtime_t useconds, BString& string);
|
|
|
|
|
|
|
|
uint32 fModificationMessage;
|
|
|
|
};
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
class FadeView : public BView {
|
|
|
|
public:
|
2006-06-07 16:43:31 +04:00
|
|
|
FadeView(BRect frame, const char* name, ScreenSaverSettings& settings);
|
2006-06-06 20:56:30 +04:00
|
|
|
|
|
|
|
virtual void AttachedToWindow();
|
|
|
|
};
|
|
|
|
|
* 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 {
|
|
|
|
public:
|
2006-06-07 16:43:31 +04:00
|
|
|
ModulesView(BRect frame, const char* name, ScreenSaverSettings& 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
|
|
|
virtual ~ModulesView();
|
|
|
|
|
|
|
|
virtual void DetachedFromWindow();
|
|
|
|
virtual void AttachedToWindow();
|
2006-06-06 20:56:30 +04:00
|
|
|
virtual void AllAttached();
|
* 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
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
|
|
|
|
void PopulateScreenSaverList();
|
|
|
|
void SaveState();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static int _CompareScreenSaverItems(const void* left, const void* right);
|
|
|
|
BScreenSaver* _ScreenSaver();
|
|
|
|
void _CloseSaver();
|
|
|
|
void _OpenSaver();
|
|
|
|
|
|
|
|
BFilePanel* fFilePanel;
|
|
|
|
BListView* fListView;
|
|
|
|
BButton* fTestButton;
|
|
|
|
BButton* fAddButton;
|
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
ScreenSaverSettings& 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
|
|
|
ScreenSaverRunner* fSaverRunner;
|
|
|
|
BString fCurrentName;
|
|
|
|
|
|
|
|
BBox* fSettingsBox;
|
|
|
|
BView* fSettingsView;
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
PreviewView* fPreviewView;
|
* 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
|
|
|
|
};
|
|
|
|
static const int32 kTimeUnitCount = sizeof(kTimeInUnits) / sizeof(kTimeInUnits[0]);
|
|
|
|
|
|
|
|
|
|
|
|
TimeSlider::TimeSlider(BRect frame, const char* name, uint32 modificationMessage)
|
|
|
|
: BSlider(frame, name, "0 minutes", new BMessage(kTimeSliderChanged),
|
2006-06-06 20:56:30 +04:00
|
|
|
0, kTimeUnitCount - 1, B_TRIANGLE_THUMB, B_FOLLOW_LEFT_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
|
|
|
fModificationMessage(modificationMessage)
|
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));
|
|
|
|
SetModificationMessage(new BMessage(kTimeSliderChanged));
|
|
|
|
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();
|
* 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
|
|
|
SetTarget(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
TimeSlider::MessageReceived(BMessage* message)
|
|
|
|
{
|
|
|
|
switch (message->what) {
|
|
|
|
case kTimeSliderChanged:
|
|
|
|
Window()->PostMessage(fModificationMessage);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
BSlider::MessageReceived(message);
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
TimeSlider::Time()
|
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
|
|
|
{
|
* 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
|
|
|
useconds /= 1000000LL;
|
|
|
|
// convert to seconds
|
|
|
|
|
|
|
|
string = "";
|
|
|
|
|
|
|
|
// hours
|
|
|
|
uint32 hours = useconds / 3600;
|
|
|
|
if (hours != 0)
|
|
|
|
string << hours << " hours";
|
|
|
|
|
|
|
|
useconds %= 3600;
|
|
|
|
|
|
|
|
// minutes
|
|
|
|
uint32 minutes = useconds / 60;
|
|
|
|
if (hours != 0)
|
|
|
|
string << " ";
|
|
|
|
if (minutes != 0)
|
|
|
|
string << minutes << " minutes";
|
|
|
|
|
|
|
|
useconds %= 60;
|
|
|
|
|
|
|
|
// seconds
|
2006-06-06 21:49:09 +04:00
|
|
|
uint32 seconds = useconds;
|
* 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 (hours != 0 || minutes != 0)
|
|
|
|
string << " ";
|
|
|
|
if (seconds != 0)
|
|
|
|
string << seconds << " seconds";
|
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)
|
2006-06-06 20:56:30 +04:00
|
|
|
: BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW)
|
|
|
|
{
|
|
|
|
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 -
|
|
|
|
|
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
ModulesView::ModulesView(BRect rect, const char* name, ScreenSaverSettings& 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
|
|
|
: 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),
|
|
|
|
fSettingsView(NULL)
|
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));
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
fTestButton = new BButton(rect, "TestButton", "Test", new BMessage(kMsgTestSaver),
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
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);
|
|
|
|
fAddButton = new BButton(rect, "AddButton", "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;
|
|
|
|
AddChild(fSettingsBox = new BBox(rect, "SettingsBox", B_FOLLOW_ALL, B_WILL_DRAW));
|
|
|
|
fSettingsBox->SetLabel("Module 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
|
|
|
{
|
* 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;
|
|
|
|
|
|
|
|
ScreenSaverItem* item = (ScreenSaverItem *)fListView->ItemAt(selection);
|
|
|
|
if (item == NULL)
|
|
|
|
break;
|
|
|
|
|
2006-06-06 20:56:30 +04:00
|
|
|
if (!strcmp(item->Text(), "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
|
|
|
|
|
|
|
_CloseSaver();
|
|
|
|
_OpenSaver();
|
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:
|
|
|
|
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
|
|
|
|
2006-06-09 20:03:16 +04:00
|
|
|
be_roster->Launch(SCREEN_BLANKER_SIG, &fSettings.Message());
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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();
|
|
|
|
while (ScreenSaverItem* item = (ScreenSaverItem *)fListView->RemoveItem((int32)0)) {
|
|
|
|
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
|
|
|
|
fListView->AddItem(new ScreenSaverItem("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
|
|
|
|
* 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
|
|
|
directory_which which[] = {B_BEOS_ADDONS_DIRECTORY, B_USER_ADDONS_DIRECTORY};
|
|
|
|
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());
|
|
|
|
fListView->AddItem(item);
|
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
if (!strcmp(fSettings.ModuleName(), item->Text())
|
|
|
|
|| (!strcmp(fSettings.ModuleName(), "")
|
* 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
|
|
|
&& !strcmp(item->Text(), "Blackness")))
|
|
|
|
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
|
|
|
|
* 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
|
|
|
//! sorting function for ScreenSaverItems
|
|
|
|
int
|
|
|
|
ModulesView::_CompareScreenSaverItems(const void* left, const void* right)
|
|
|
|
{
|
|
|
|
ScreenSaverItem* leftItem = *(ScreenSaverItem **)left;
|
|
|
|
ScreenSaverItem* rightItem = *(ScreenSaverItem **)right;
|
2005-09-02 19:15:37 +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 strcmp(leftItem->Text(), rightItem->Text());
|
|
|
|
}
|
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);
|
|
|
|
|
|
|
|
if (saver != NULL)
|
|
|
|
saver->StopConfig();
|
|
|
|
|
|
|
|
SaveState();
|
|
|
|
|
|
|
|
delete view;
|
|
|
|
delete fSettingsView;
|
|
|
|
delete fSaverRunner;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2006-06-06 20:56:30 +04: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.
|
|
|
|
rect = BRect(15, 15, 20, 20);
|
2006-06-07 16:43:31 +04:00
|
|
|
BStringView* stringView = new BStringView(rect, "module", fSettings.ModuleName()[0]
|
|
|
|
? fSettings.ModuleName() : "Blackness");
|
2006-06-06 20:56:30 +04:00
|
|
|
stringView->SetFont(be_bold_font);
|
|
|
|
stringView->ResizeToPreferred();
|
|
|
|
fSettingsView->AddChild(stringView);
|
|
|
|
|
|
|
|
rect.OffsetBy(0, stringView->Bounds().Height() + 4);
|
2006-06-07 16:43:31 +04:00
|
|
|
stringView = new BStringView(rect, "info", saver || !fSettings.ModuleName()[0]
|
2006-06-06 20:56:30 +04:00
|
|
|
? "No options available" : "Could not load screen saver");
|
|
|
|
stringView->ResizeToPreferred();
|
|
|
|
fSettingsView->AddChild(stringView);
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf)) == B_FOLLOW_LEFT_RIGHT) {
|
|
|
|
float width, height;
|
|
|
|
view->GetPreferredSize(&width, &height);
|
|
|
|
viewRight = view->Frame().left + width / 2;
|
|
|
|
} else if ((view->ResizingMode() & _rule_(0, 0xf, 0, 0xf)) == B_FOLLOW_RIGHT)
|
|
|
|
viewRight = 8 + view->Frame().Width();
|
|
|
|
|
|
|
|
float viewBottom = view->Frame().bottom;
|
|
|
|
if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0)) == B_FOLLOW_TOP_BOTTOM) {
|
|
|
|
float width, height;
|
|
|
|
view->GetPreferredSize(&width, &height);
|
|
|
|
viewBottom = view->Frame().top + height;
|
|
|
|
} else if ((view->ResizingMode() & _rule_(0xf, 0, 0xf, 0)) == B_FOLLOW_BOTTOM)
|
|
|
|
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
|
|
|
|
* 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()
|
|
|
|
: BWindow(BRect(50, 50, 496, 375), "Screen Saver",
|
2006-06-07 15:51:37 +04:00
|
|
|
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS /*| B_NOT_ZOOMABLE | B_NOT_RESIZABLE*/)
|
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();
|
|
|
|
|
|
|
|
// 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);
|
2006-06-07 16:43:31 +04:00
|
|
|
fModulesView = new ModulesView(rect, "Modules", 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
|
|
|
// TODO: better limits!
|
|
|
|
fMinWidth = 430;
|
|
|
|
fMinHeight = 325;
|
|
|
|
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
|
|
|
|
2006-06-07 16:43:31 +04:00
|
|
|
fEnableCheckBox->SetValue(fSettings.TimeFlags() & ENABLE_SAVER ? B_CONTROL_ON : B_CONTROL_OFF);
|
|
|
|
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
|
|
|
{
|
* 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 for the fade tab
|
|
|
|
void
|
|
|
|
ScreenSaverWindow::_SetupFadeTab(BRect rect)
|
2004-05-04 02:41:30 +04:00
|
|
|
{
|
2006-06-07 16:43:31 +04:00
|
|
|
fFadeView = new FadeView(rect, "Fade", 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
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
float labelWidth = be_plain_font->StringWidth("Turn off screen") + 20.0f;
|
|
|
|
|
* 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:
|
|
|
|
float radioButtonOffset = 2 * floorf(textHeight / 2 - 2) + floorf(textHeight / 2);
|
|
|
|
|
* 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",
|
|
|
|
"Enable Screen Saver", new BMessage(kMsgEnableScreenSaverBox));
|
|
|
|
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
|
|
|
|
|
|
|
// Run Module
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left += radioButtonOffset;
|
* 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;
|
* 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
|
|
|
BStringView* stringView = new BStringView(rect, NULL, "Run module");
|
|
|
|
stringView->ResizeToPreferred();
|
|
|
|
box->AddChild(stringView);
|
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left += labelWidth;
|
|
|
|
fRunSlider = new TimeSlider(rect, "RunSlider", kMsgRunSliderChanged);
|
* 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
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left = 8;
|
|
|
|
rect.OffsetBy(0, fRunSlider->Bounds().Height() + 4.0f);
|
|
|
|
fTurnOffCheckBox = new BCheckBox(rect, "TurnOffScreenCheckBox",
|
|
|
|
"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
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left += radioButtonOffset + labelWidth;
|
|
|
|
fTurnOffSlider = new TimeSlider(rect, "TurnOffSlider", kMsgTurnOffSliderChanged);
|
* 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
|
|
|
|
|
|
|
// Password
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left = 8;
|
|
|
|
rect.OffsetBy(0, fTurnOffSlider->Bounds().Height() + 4.0f);
|
|
|
|
fPasswordCheckBox = new BCheckBox(rect, "PasswordCheckbox",
|
|
|
|
"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);
|
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect.left += radioButtonOffset + labelWidth;
|
|
|
|
fPasswordSlider = new TimeSlider(rect, "PasswordSlider", 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
|
|
|
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;
|
|
|
|
fPasswordButton = new BButton(rect, "PasswordButton", "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-09 20:03:16 +04:00
|
|
|
box->AddChild(fFadeNow = new ScreenCornerSelector(BRect(20,205,80,260), "FadeNow",
|
|
|
|
new BMessage(kMsgFadeCornerChanged), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM));
|
|
|
|
box->AddChild(fFadeNever = new ScreenCornerSelector(BRect(220,205,280,260), "FadeNever",
|
|
|
|
new BMessage(kMsgNeverFadeCornerChanged), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM));
|
2004-03-31 04:35:20 +04:00
|
|
|
|
2006-06-07 18:04:03 +04:00
|
|
|
rect = BRect(90,215,193,230);
|
|
|
|
stringView = new BStringView(rect, NULL, "Fade now when",
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
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());
|
|
|
|
stringView = new BStringView(rect, NULL, "mouse is here",
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
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 = BRect(290,215,387,230);
|
|
|
|
stringView = new BStringView(rect, NULL,"Don't fade when",
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
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());
|
|
|
|
stringView = new BStringView(rect, NULL, "mouse is here",
|
|
|
|
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
|
|
|
stringView->ResizeToPreferred();
|
2006-06-07 15:51:37 +04:00
|
|
|
box->AddChild(stringView);
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
2006-06-07 16:43:31 +04:00
|
|
|
fSettings.SetWindowFrame(Frame());
|
|
|
|
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
|
|
|
{
|
|
|
|
switch (msg->what) {
|
|
|
|
// "Fade" tab
|
|
|
|
|
|
|
|
case kMsgRunSliderChanged:
|
|
|
|
if (fRunSlider->Value() > fTurnOffSlider->Value())
|
|
|
|
fTurnOffSlider->SetValue(fRunSlider->Value());
|
|
|
|
|
|
|
|
if (fRunSlider->Value() > fPasswordSlider->Value())
|
|
|
|
fPasswordSlider->SetValue(fRunSlider->Value());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMsgTurnOffCheckBox:
|
|
|
|
fTurnOffSlider->SetEnabled(fTurnOffCheckBox->Value() == B_CONTROL_ON);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMsgTurnOffSliderChanged:
|
|
|
|
if (fRunSlider->Value() > fTurnOffSlider->Value())
|
|
|
|
fRunSlider->SetValue(fTurnOffSlider->Value());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMsgPasswordSliderChanged:
|
|
|
|
if (fPasswordSlider->Value() < fRunSlider->Value())
|
|
|
|
fRunSlider->SetValue(fPasswordSlider->Value());
|
|
|
|
break;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
// "Modules" tab
|
|
|
|
|
|
|
|
case kMsgUpdateList:
|
|
|
|
fModulesView->PopulateScreenSaverList();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
BWindow::MessageReceived(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
_UpdateStatus();
|
|
|
|
fModulesView->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
|
|
|
|
|
|
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|