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