1 /* 2 * Copyright 2012-2013 Tri-Edge AI <triedgeai@gmail.com> 3 * Copyright 2014 Haiku, Inc. All rights reserved. 4 * 5 * Distributed under the terms of the MIT license. 6 * 7 * Authors: 8 * Tri-Edge AI 9 * John Scipione, jscipione@gmail.com 10 */ 11 #ifndef GRAVITY_SCREEN_SAVER_H 12 #define GRAVITY_SCREEN_SAVER_H 13 14 15 #include <ScreenSaver.h> 16 17 18 class BMessage; 19 class BView; 20 21 class ConfigView; 22 class GravityView; 23 24 25 class Gravity : public BScreenSaver { 26 public: 27 struct { 28 int32 ShadeID; 29 int32 ParticleCount; 30 } Config; 31 32 Gravity(BMessage* prefs, image_id imageID); 33 34 status_t SaveState(BMessage* prefs) const; 35 36 void StartConfig(BView* view); 37 38 status_t StartSaver(BView* view, bool preview); 39 void StopSaver(); 40 41 void DirectConnected(direct_buffer_info* info); 42 void DirectDraw(int32 frame); 43 44 private: 45 GravityView* fGravityView; 46 ConfigView* fConfigView; 47 }; 48 49 50 #endif // GRAVITY_SCREEN_SAVER_H 51