vfs: check userland buffers before reading them.
[haiku.git] / src / servers / input / MethodMenuItem.h
blobf2608dbdc3ca2b5e0cf28860659491c0862652d3
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: MethodMenuItem.h
10 // Authors: Jérôme Duval,
12 // Description: Input Server
13 // Created: October 19, 2004
15 // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
17 #ifndef METHOD_MENUITEM_H_
18 #define METHOD_MENUITEM_H_
20 #include <Bitmap.h>
21 #include <MenuItem.h>
23 #define MENUITEM_ICON_SIZE 16
25 class MethodMenuItem : public BMenuItem {
26 public:
27 MethodMenuItem(int32 cookie, const char *label, const uchar *icon, BMenu *subMenu, BMessenger &messenger);
28 MethodMenuItem(int32 cookie, const char *label, const uchar *icon);
30 virtual ~MethodMenuItem();
32 virtual void DrawContent();
33 virtual void GetContentSize(float *width, float *height);
35 void SetName(const char *name);
36 const char *Name() { return Label(); };
38 void SetIcon(const uchar *icon);
39 const uchar *Icon() { return(uchar *)fIcon.Bits(); };
41 int32 Cookie() { return fCookie; };
42 private:
43 BBitmap fIcon;
44 int32 fCookie;
45 BMessenger fMessenger;
48 #endif