xref: /haiku/src/add-ons/screen_savers/icons/IconDisplay.h (revision 9760dcae2038d47442f4658c2575844c6cf92c40)
1 /*
2 	Copyright 2009 Vincent Duvert, vincent.duvert@free.fr
3 	All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef ICON_DISPLAY_H
6 #define ICON_DISPLAY_H
7 
8 #include <Rect.h>
9 #include <View.h>
10 
11 struct VectorIcon {
12         uint8* data;
13         size_t size;
14 };
15 
16 
17 class BBitmap;
18 
19 
20 class IconDisplay {
21 public:
22 								IconDisplay();
23 								~IconDisplay();
24 
25 			void				Run(VectorIcon* icon, BRect frame);
26 	inline	bool				IsRunning() { return fIsRunning; };
27 	inline	BRect				GetFrame() { return fFrame; };
28 
29 			void				ClearOn(BView* view);
30 			void				DrawOn(BView* view, uint32 delta);
31 
32 private:
33 	bool						fIsRunning;
34 	uint8						fState;
35 
36 	int32						fTicks;
37 	int32						fDelay;
38 
39 	BBitmap*					fBitmap;
40 	BRect						fFrame;
41 };
42 
43 #endif
44