xref: /haiku/src/add-ons/screen_savers/leaves/Leaves.h (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2010-2011, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		Geoffry Song, goffrie@gmail.com
7  */
8 #ifndef _LEAVES_H_
9 #define _LEAVES_H_
10 
11 
12 #include <vector>
13 
14 #include <ScreenSaver.h>
15 
16 
17 class BSlider;
18 
19 class Leaves : public BScreenSaver, public BHandler {
20 public:
21 						Leaves(BMessage* archive, image_id id);
22 	virtual	void		Draw(BView* view, int32 frame);
23 	virtual	void		StartConfig(BView* view);
24 	virtual	status_t	StartSaver(BView* view, bool preview);
25 
26 	virtual	status_t	SaveState(BMessage* into) const;
27 
28 	virtual	void		MessageReceived(BMessage* message);
29 
30 private:
31 			BSlider*	fDropRateSlider;
32 			BSlider*	fLeafSizeSlider;
33 			BSlider*	fSizeVariationSlider;
34 			int32		fDropRate;
35 			int32		fLeafSize;
36 			int32		fSizeVariation;
37 
38 	inline	BPoint		_RandomPoint(const BRect& bound);
39 };
40 
41 #endif	// _LEAVES_H_
42 
43