vfs: check userland buffers before reading them.
[haiku.git] / src / servers / input / MethodReplicant.h
blobb826fba17c416f0485296645c03804467246dd0f
1 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
2 //
3 // Copyright (c) 2004, Haiku
4 //
5 // This software is part of the Haiku distribution and is covered
6 // by the Haiku license.
7 //
8 //
9 // File: MethodReplicant.h
10 // Authors: Jérôme Duval,
12 // Description: Input Server
13 // Created: October 13, 2004
15 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
17 #ifndef METHOD_REPLICANT_H_
18 #define METHOD_REPLICANT_H_
20 #include <PopUpMenu.h>
21 #include <View.h>
22 #include "MethodMenuItem.h"
24 #define REPLICANT_CTL_NAME "MethodReplicant"
26 class _EXPORT MethodReplicant;
28 class MethodReplicant : public BView {
29 public:
30 MethodReplicant(const char* signature);
32 MethodReplicant(BMessage *);
33 // BMessage * based constructor needed to support archiving
34 virtual ~MethodReplicant();
36 // archiving overrides
37 static MethodReplicant *Instantiate(BMessage *data);
38 virtual status_t Archive(BMessage *data, bool deep = true) const;
40 virtual void AttachedToWindow();
42 // misc BView overrides
43 virtual void MouseDown(BPoint);
44 virtual void MouseUp(BPoint);
46 virtual void Draw(BRect);
48 virtual void MessageReceived(BMessage *);
49 private:
50 BBitmap *fSegments;
51 char *fSignature;
52 BPopUpMenu fMenu;
54 void UpdateMethod(BMessage *);
55 void UpdateMethodIcon(BMessage *);
56 void UpdateMethodMenu(BMessage *);
57 void UpdateMethodName(BMessage *);
58 void AddMethod(BMessage *message);
59 void RemoveMethod(BMessage *message);
60 MethodMenuItem *FindItemByCookie(int32 cookie);
63 #endif