aboutsummaryrefslogtreecommitdiff
path: root/src/Basemenu.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-03-20 14:10:03 (GMT)
committerfluxgen <fluxgen>2002-03-20 14:10:03 (GMT)
commit3b330a5f6225f48f299371d5154bfb89db495903 (patch)
tree6213617ff1242a68b6cc530e3aa704c060ef21ca /src/Basemenu.hh
parente072c2c7444cab25d0795c23a0d6eff112c7d3b8 (diff)
downloadfluxbox-3b330a5f6225f48f299371d5154bfb89db495903.zip
fluxbox-3b330a5f6225f48f299371d5154bfb89db495903.tar.bz2
signed/unsigned warnings
Diffstat (limited to 'src/Basemenu.hh')
-rw-r--r--src/Basemenu.hh179
1 files changed, 88 insertions, 91 deletions
diff --git a/src/Basemenu.hh b/src/Basemenu.hh
index 14f7c67..d2794ff 100644
--- a/src/Basemenu.hh
+++ b/src/Basemenu.hh
@@ -22,10 +22,10 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Basemenu.hh,v 1.7 2002/02/17 19:00:04 fluxgen Exp $ 25// $Id: Basemenu.hh,v 1.8 2002/03/20 14:10:03 fluxgen Exp $
26 26
27#ifndef BASEMENU_HH 27#ifndef BASEMENU_HH
28#define BASEMENU_HH 28#define BASEMENU_HH
29 29
30#include <X11/Xlib.h> 30#include <X11/Xlib.h>
31#include <vector> 31#include <vector>
@@ -40,103 +40,100 @@ class BImageControl;
40class BScreen; 40class BScreen;
41 41
42class Basemenu { 42class Basemenu {
43public:
44 explicit Basemenu(BScreen *);
45 virtual ~Basemenu(void);
46
47 inline const Bool &isTorn(void) const { return torn; }
48 inline const Bool &isVisible(void) const { return visible; }
49
50 inline BScreen *getScreen(void) const { return screen; }
51
52 inline const Window &getWindowID(void) const { return menu.window; }
53
54 inline const char *getLabel(void) const { return menu.label; }
55
56 int insert(const char *, int = 0, const char * = (const char *) 0, int = -1);
57 int insert(const char **, int = -1, int = 0);
58 int insert(const char *, Basemenu *, int = -1);
59 int remove(unsigned int item);
60
61 inline const int &getX(void) const { return menu.x; }
62 inline const int &getY(void) const { return menu.y; }
63 inline int getCount(void) { return menuitems.size(); }
64 inline const int &getCurrentSubmenu(void) const { return which_sub; }
65
66 inline const unsigned int &getWidth(void) const { return menu.width; }
67 inline const unsigned int &getHeight(void) const { return menu.height; }
68 inline const unsigned int &getTitleHeight(void) const { return menu.title_h; }
69
70 inline void setInternalMenu(void) { internal_menu = True; }
71 inline void setAlignment(int a) { alignment = a; }
72 inline void setTorn(void) { torn = True; }
73 inline void removeParent(void) { if (internal_menu) parent = (Basemenu *) 0; }
74
75 bool hasSubmenu(unsigned int index);
76 bool isItemSelected(unsigned int index);
77 bool isItemEnabled(unsigned int index);
78
79 void buttonPressEvent(XButtonEvent *);
80 void buttonReleaseEvent(XButtonEvent *);
81 void motionNotifyEvent(XMotionEvent *);
82 void enterNotifyEvent(XCrossingEvent *);
83 void leaveNotifyEvent(XCrossingEvent *);
84 void exposeEvent(XExposeEvent *);
85 void reconfigure(void);
86 void setLabel(const char *n);
87 void move(int, int);
88 void update(void);
89 void setItemSelected(unsigned int index, bool val);
90 void setItemEnabled(unsigned int, bool val);
91
92 virtual void drawSubmenu(unsigned int index);
93 virtual void show(void);
94 virtual void hide(void);
95
96 enum { ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
97 enum { RIGHT = 1, LEFT };
98 enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND };
99
43private: 100private:
44 typedef std::vector<BasemenuItem *> Menuitems; 101 typedef std::vector<BasemenuItem *> Menuitems;
45 Menuitems menuitems; 102 Menuitems menuitems;
46 Fluxbox *fluxbox; 103 Fluxbox *fluxbox;
47 Basemenu *parent; 104 Basemenu *parent;
48 BImageControl *image_ctrl; 105 BImageControl *image_ctrl;
49 BScreen *screen; 106 BScreen *screen;
50 107
51 Bool moving, visible, movable, torn, internal_menu, title_vis, shifted, 108 Bool moving, visible, movable, torn, internal_menu, title_vis, shifted,
52 hide_tree; 109 hide_tree;
53 Display *display; 110 Display *display;
54 int which_sub, which_press, which_sbl, alignment; 111 int which_sub, which_press, which_sbl, alignment;
55 112
56 struct _menu { 113 struct _menu {
57 Pixmap frame_pixmap, title_pixmap, hilite_pixmap, sel_pixmap; 114 Pixmap frame_pixmap, title_pixmap, hilite_pixmap, sel_pixmap;
58 Window window, frame, title; 115 Window window, frame, title;
59 116
60 char *label; 117 char *label;
61 int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub, 118 int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub,
62 grab_x, grab_y; 119 grab_x, grab_y;
63 unsigned int width, height, title_h, frame_h, item_w, item_h, bevel_w, 120 unsigned int width, height, title_h, frame_h, item_w, item_h, bevel_w,
64 bevel_h; 121 bevel_h;
65 } menu; 122 } menu;
66 123
67 124
68protected: 125protected:
69 inline BasemenuItem *find(int index) { return menuitems[index]; } 126 inline BasemenuItem *find(unsigned int index) { return menuitems[index]; }
70 inline void setTitleVisibility(Bool b) { title_vis = b; } 127 inline void setTitleVisibility(bool b) { title_vis = b; }
71 inline void setMovable(Bool b) { movable = b; } 128 inline void setMovable(bool b) { movable = b; }
72 inline void setHideTree(Bool h) { hide_tree = h; } 129 inline void setHideTree(bool h) { hide_tree = h; }
73 inline void setMinimumSublevels(int m) { menu.minsub = m; } 130 inline void setMinimumSublevels(int m) { menu.minsub = m; }
74 131
75 virtual void itemSelected(int, int) = 0; 132 virtual void itemSelected(int, int) = 0;
76 virtual void drawItem(int, Bool = False, Bool = False, 133 virtual void drawItem(unsigned int index, bool highlight= false, bool clear= false,
77 int = -1, int = -1, unsigned int = 0, unsigned int = 0); 134 int x= -1, int y= -1, unsigned int width= 0, unsigned int height= 0);
78 virtual void redrawTitle(); 135 virtual void redrawTitle();
79 virtual void internal_hide(void); 136 virtual void internal_hide(void);
80
81
82public:
83 Basemenu(BScreen *);
84 virtual ~Basemenu(void);
85
86 inline const Bool &isTorn(void) const { return torn; }
87 inline const Bool &isVisible(void) const { return visible; }
88
89 inline BScreen *getScreen(void) { return screen; }
90
91 inline const Window &getWindowID(void) const { return menu.window; }
92
93 inline const char *getLabel(void) const { return menu.label; }
94
95 int insert(const char *, int = 0, const char * = (const char *) 0, int = -1);
96 int insert(const char **, int = -1, int = 0);
97 int insert(const char *, Basemenu *, int = -1);
98 int remove(int);
99
100 inline const int &getX(void) const { return menu.x; }
101 inline const int &getY(void) const { return menu.y; }
102 inline int getCount(void) { return menuitems.size(); }
103 inline const int &getCurrentSubmenu(void) const { return which_sub; }
104
105 inline const unsigned int &getWidth(void) const { return menu.width; }
106 inline const unsigned int &getHeight(void) const { return menu.height; }
107 inline const unsigned int &getTitleHeight(void) const { return menu.title_h; }
108
109 inline void setInternalMenu(void) { internal_menu = True; }
110 inline void setAlignment(int a) { alignment = a; }
111 inline void setTorn(void) { torn = True; }
112 inline void removeParent(void)
113 { if (internal_menu) parent = (Basemenu *) 0; }
114
115 Bool hasSubmenu(int);
116 Bool isItemSelected(int);
117 Bool isItemEnabled(int);
118
119 void buttonPressEvent(XButtonEvent *);
120 void buttonReleaseEvent(XButtonEvent *);
121 void motionNotifyEvent(XMotionEvent *);
122 void enterNotifyEvent(XCrossingEvent *);
123 void leaveNotifyEvent(XCrossingEvent *);
124 void exposeEvent(XExposeEvent *);
125 void reconfigure(void);
126 void setLabel(const char *n);
127 void move(int, int);
128 void update(void);
129 void setItemSelected(int, Bool);
130 void setItemEnabled(int, Bool);
131
132 virtual void drawSubmenu(int);
133 virtual void show(void);
134 virtual void hide(void);
135
136 enum { ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
137 enum { RIGHT = 1, LEFT };
138 enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND };
139
140}; 137};
141 138
142class BasemenuItem { 139class BasemenuItem {