haiku/headers/os/add-ons/screen_saver/ScreenSaver.h
Axel Dörfler 7cae4a1ee0 * 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 08:16:46 +00:00

76 lines
1.9 KiB
C++

/*
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SCREENSAVER_H
#define _SCREENSAVER_H
#include <BeBuild.h>
#include <DirectWindow.h>
#include <image.h>
#include <Message.h>
class BView;
class BScreenSaver {
public:
BScreenSaver(BMessage* archive, image_id thisImage);
virtual ~BScreenSaver();
virtual status_t InitCheck();
virtual status_t StartSaver(BView* view, bool preview);
virtual void StopSaver();
virtual void Draw(BView* view, int32 frame);
// direct screen access
virtual void DirectConnected(direct_buffer_info* info);
virtual void DirectDraw(int32 frame);
// configuration dialog methods
virtual void StartConfig(BView* configView);
virtual void StopConfig();
// Module should fill this in with metadata
// example: randomizable = true
virtual void SupplyInfo(BMessage* info) const;
// Send all the metadata info to the module
virtual void ModulesChanged(const BMessage* info);
// BArchivable like parameter saver method
virtual status_t SaveState(BMessage* into) const;
// These methods can be used to control drawing frequency.
void SetTickSize(bigtime_t tickSize);
bigtime_t TickSize() const;
// These methods can be used to control animation loop cycles
void SetLoop(int32 onCount, int32 offCount);
int32 LoopOnCount() const;
int32 LoopOffCount() const;
private:
virtual void _ReservedScreenSaver1();
virtual void _ReservedScreenSaver2();
virtual void _ReservedScreenSaver3();
virtual void _ReservedScreenSaver4();
virtual void _ReservedScreenSaver5();
virtual void _ReservedScreenSaver6();
virtual void _ReservedScreenSaver7();
virtual void _ReservedScreenSaver8();
bigtime_t fTickSize;
int32 fLoopOnCount;
int32 fLoopOffCount;
uint32 _reserved[6];
};
extern "C" _EXPORT BScreenSaver *instantiate_screen_saver(BMessage *msg, image_id id);
#endif // _SCREENSAVER_H