1/* 2 * Copyright 2012, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Aaron Hill <serac@hillvisions.com> 7 */ 8#ifndef _GLIFE_GLIFESAVER_H 9#define _GLIFE_GLIFESAVER_H 10 11 12#include <OS.h> 13#include <ScreenSaver.h> 14#include <View.h> 15 16#include "GLifeGrid.h" 17#include "GLifeState.h" 18#include "GLifeView.h" 19 20 21// Constants 22const int32 c_iTickSize = 50000; 23 24 25// GLifeSaver Class Declaration 26class GLifeSaver : public BScreenSaver 27{ 28public: 29 // Constructor 30 GLifeSaver(BMessage*, image_id); 31 32 // State/Preferences Methods 33 status_t SaveState(BMessage*) const; 34 void RestoreState(BMessage*); 35 void StartConfig(BView*); 36 37 // Start/Stop Methods 38 status_t StartSaver(BView*, bool); 39 void StopSaver(void); 40 41 // Graphics Methods 42 void DirectConnected(direct_buffer_info*); 43 void Draw(BView*, int32); 44 45private: 46 GLifeState fGLifeState; 47 GLifeView* fGLifeViewport; 48}; 49 50 51#endif /* _GLIFE_GLIFESAVER_H */ 52