vfs: check userland buffers before reading them.
[haiku.git] / src / apps / pulse / CPUButton.h
blob681486b4ae806a6f5eed31086fdd93bcd88a8ab6
1 //****************************************************************************************
2 //
3 // File: CPUButton.h
4 //
5 // Written by: Daniel Switkin
6 //
7 // Copyright 1999, Be Incorporated
8 //
9 //****************************************************************************************
11 #ifndef CPUBUTTON_H
12 #define CPUBUTTON_H
14 #include <interface/Control.h>
15 #include <app/MessageRunner.h>
17 class CPUButton : public BControl {
18 public:
19 CPUButton(BRect rect, const char *name, const char *label, BMessage *message);
20 CPUButton(BMessage *message);
21 virtual ~CPUButton();
23 virtual void Draw(BRect rect);
24 virtual void MouseDown(BPoint point);
25 virtual void MouseUp(BPoint point);
26 virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
28 virtual void MessageReceived(BMessage *message);
29 virtual void AttachedToWindow();
30 virtual void DetachedFromWindow();
32 status_t Invoke(BMessage *message = NULL);
33 static CPUButton *Instantiate(BMessage *data);
34 status_t Archive(BMessage *data, bool deep = true) const;
36 void UpdateColors(int32 color);
38 private:
39 void _InitData();
40 void _AddDragger();
42 rgb_color fOnColor, fOffColor;
43 bool fReplicant;
44 int32 fCPU;
45 BMessageRunner *fPulseRunner;
46 bool fReplicantInDeskbar;
49 #endif // CPUBUTTON_H