182d2e399SKarsten Heimrich /* 282d2e399SKarsten Heimrich * Copyright Karsten Heimrich, host.haiku@gmx.de. All rights reserved. 382d2e399SKarsten Heimrich * Distributed under the terms of the MIT License. 482d2e399SKarsten Heimrich */ 582d2e399SKarsten Heimrich #ifndef _FLURRY_H_ 682d2e399SKarsten Heimrich #define _FLURRY_H_ 782d2e399SKarsten Heimrich 882d2e399SKarsten Heimrich 982d2e399SKarsten Heimrich #include <DateTime.h> 1082d2e399SKarsten Heimrich #include <GLView.h> 1182d2e399SKarsten Heimrich #include <ScreenSaver.h> 1282d2e399SKarsten Heimrich 1382d2e399SKarsten Heimrich 1482d2e399SKarsten Heimrich struct flurry_info_t; 1582d2e399SKarsten Heimrich 1682d2e399SKarsten Heimrich 1782d2e399SKarsten Heimrich class FlurryView : public BGLView { 1882d2e399SKarsten Heimrich public: 1982d2e399SKarsten Heimrich FlurryView(BRect bounds); 2082d2e399SKarsten Heimrich virtual ~FlurryView(); 2182d2e399SKarsten Heimrich 2282d2e399SKarsten Heimrich status_t InitCheck() const; 2382d2e399SKarsten Heimrich 2482d2e399SKarsten Heimrich virtual void AttachedToWindow(); 2582d2e399SKarsten Heimrich virtual void DrawFlurryScreenSaver(); 2682d2e399SKarsten Heimrich virtual void FrameResized(float width, float height); 2782d2e399SKarsten Heimrich 2882d2e399SKarsten Heimrich private: 2982d2e399SKarsten Heimrich void _SetupFlurryBaseInfo(); 3082d2e399SKarsten Heimrich 3182d2e399SKarsten Heimrich double _CurrentTime() const; 3282d2e399SKarsten Heimrich double _SecondsSinceStart() const; 3382d2e399SKarsten Heimrich 3482d2e399SKarsten Heimrich private: 3582d2e399SKarsten Heimrich float fWidth; 3682d2e399SKarsten Heimrich float fHeight; 3782d2e399SKarsten Heimrich 3882d2e399SKarsten Heimrich double fStartTime; 3982d2e399SKarsten Heimrich double fOldFrameTime; 40e11db35dSJohn Scipione flurry_info_t* fFlurryInfo; 4182d2e399SKarsten Heimrich 42a070cf53SStephan Aßmus BTime fTime; 43a070cf53SStephan Aßmus BDateTime fDateTime; 4482d2e399SKarsten Heimrich }; 4582d2e399SKarsten Heimrich 4682d2e399SKarsten Heimrich 4782d2e399SKarsten Heimrich class Flurry : public BScreenSaver { 4882d2e399SKarsten Heimrich public: 4982d2e399SKarsten Heimrich Flurry(BMessage* archive, image_id imageId); 5082d2e399SKarsten Heimrich virtual ~Flurry(); 5182d2e399SKarsten Heimrich 5282d2e399SKarsten Heimrich virtual status_t InitCheck(); 5382d2e399SKarsten Heimrich 5482d2e399SKarsten Heimrich virtual status_t StartSaver(BView* view, bool preview); 5582d2e399SKarsten Heimrich virtual void StopSaver(); 5682d2e399SKarsten Heimrich 57*1333f5f7SAdrien Destugues virtual void Draw(BView*, int32 frame); 5882d2e399SKarsten Heimrich virtual void DirectConnected(direct_buffer_info* info); 5982d2e399SKarsten Heimrich 6082d2e399SKarsten Heimrich virtual void StartConfig(BView* configView); 6182d2e399SKarsten Heimrich virtual void StopConfig(); 6282d2e399SKarsten Heimrich 6382d2e399SKarsten Heimrich virtual status_t SaveState(BMessage* into) const; 6482d2e399SKarsten Heimrich 6582d2e399SKarsten Heimrich private: 6682d2e399SKarsten Heimrich FlurryView* fFlurryView; 6782d2e399SKarsten Heimrich }; 6882d2e399SKarsten Heimrich 6982d2e399SKarsten Heimrich 7082d2e399SKarsten Heimrich #endif // _FLURRY_H_ 71