vfs: check userland buffers before reading them.
[haiku.git] / src / tests / servers / app / playground / ObjectView.h
blobd0bd0ff339e179d771d8dc541c3ee025bfab2857
1 // ObjectView.h
3 #ifndef OBJECT_VIEW_H
4 #define OBJECT_VIEW_H
6 #include <List.h>
7 #include <View.h>
9 class State;
11 enum {
12 MSG_OBJECT_COUNT_CHANGED = 'obcc',
13 MSG_OBJECT_ADDED = 'obad',
16 class ObjectView : public BView {
17 public:
18 ObjectView(BRect frame, const char* name,
19 uint32 resizeFlags, uint32 flags);
20 virtual ~ObjectView();
22 // BView
23 virtual void AttachedToWindow();
24 virtual void DetachedFromWindow();
26 virtual void Draw(BRect updateRect);
28 virtual void MouseDown(BPoint where);
29 virtual void MouseUp(BPoint where);
30 virtual void MouseMoved(BPoint where, uint32 transit,
31 const BMessage* dragMessage);
33 virtual void MessageReceived(BMessage* message);
35 // ObjectView
36 void SetState(State* state);
38 void SetObjectType(int32 type);
39 int32 ObjectType() const
40 { return fObjectType; }
42 void AddObject(State* state);
43 void RemoveObject(State* state);
44 int32 CountObjects() const;
45 void MakeEmpty();
47 void SetStateColor(rgb_color color);
48 rgb_color StateColor() const
49 { return fColor; }
51 void SetStateDrawingMode(drawing_mode mode);
52 drawing_mode StateDrawingMode() const
53 { return fDrawingMode; }
55 void SetStateFill(bool fill);
56 bool StateFill() const
57 { return fFill; }
59 void SetStatePenSize(float penSize);
60 float StatePenSize() const
61 { return fPenSize; }
63 private:
64 State* fState;
65 int32 fObjectType;
67 BList fStateList;
69 rgb_color fColor;
70 drawing_mode fDrawingMode;
71 bool fFill;
72 float fPenSize;
74 bool fScrolling;
75 bool fInitiatingDrag;
76 BPoint fLastMousePos;
79 #endif // OBJECT_VIEW_H