#ifndef BARBER_POLE_H
#define BARBER_POLE_H
#include <View.h>
#include <Polygon.h>
class BMessageRunner;
class BarberPole : public BView {
public:
enum {
kRefreshMessage = 0x1001
};
public:
BarberPole(const char* name);
~BarberPole();
virtual void MessageReceived(BMessage* message);
virtual void Draw(BRect updateRect);
virtual void FrameResized(float width, float height);
virtual BSize MinSize();
void Start();
void Stop();
void SetSpinSpeed(float speed);
void SetColors(const rgb_color* colors,
uint32 numColors);
private:
void _Spin();
void _DrawSpin(BRect updateRect);
void _DrawNonSpin(BRect updateRect);
private:
bool fIsSpinning;
float fSpinSpeed;
const rgb_color* fColors;
uint32 fNumColors;
float fScrollOffset;
BPolygon fStripe;
float fStripeWidth;
uint32 fNumStripes;
};
#endif