]>
Dogcows Code - chaz/openbox/blob - otk/widget.hh
18 enum Direction
{ Horizontal
, Vertical
};
20 typedef std::list
<OtkWidget
*> OtkWidgetList
;
22 OtkWidget(OtkWidget
*parent
, Direction
= Horizontal
);
23 OtkWidget(Style
*style
, Direction direction
= Horizontal
,
24 Cursor cursor
= 0, int bevel_width
= 1);
28 virtual void update(void);
30 inline Window
getWindow(void) const { return _window
; }
31 inline const OtkWidget
*getParent(void) const { return _parent
; }
32 inline const OtkWidgetList
&getChildren(void) const { return _children
; }
33 inline unsigned int getScreen(void) const { return _screen
; }
34 inline const Rect
&getRect(void) const { return _rect
; }
36 void move(const Point
&to
);
37 void move(int x
, int y
);
39 virtual void setWidth(int);
40 virtual void setHeight(int);
42 virtual void resize(const Point
&to
);
43 virtual void resize(int x
, int y
);
45 virtual void setGeometry(const Rect
&new_geom
);
46 virtual void setGeometry(const Point
&topleft
, int width
, int height
);
47 virtual void setGeometry(int x
, int y
, int width
, int height
);
49 inline bool isVisible(void) const { return _visible
; };
50 virtual void show(void);
51 virtual void hide(void);
53 inline bool isFocused(void) const { return _focused
; };
54 virtual void focus(void);
56 inline bool hasGrabbedMouse(void) const { return _grabbed_mouse
; }
58 void ungrabMouse(void);
60 inline bool hasGrabbedKeyboard(void) const { return _grabbed_keyboard
; }
61 bool grabKeyboard(void);
62 void ungrabKeyboard(void);
64 inline BTexture
*getTexture(void) const { return _texture
; }
65 virtual void setTexture(BTexture
*texture
)
66 { _texture
= texture
; _dirty
= true; }
68 virtual void addChild(OtkWidget
*child
, bool front
= false);
69 virtual void removeChild(OtkWidget
*child
);
71 inline bool isStretchableHorz(void) const { return _stretchable_horz
; }
72 void setStretchableHorz(bool s_horz
) { _stretchable_horz
= s_horz
; }
74 inline bool isStretchableVert(void) const { return _stretchable_vert
; }
75 void setStretchableVert(bool s_vert
) { _stretchable_vert
= s_vert
; }
77 inline Cursor
getCursor(void) const { return _cursor
; }
79 inline int getBevelWidth(void) const { return _bevel_width
; }
80 void setBevelWidth(int bevel_width
)
81 { assert(bevel_width
> 0); _bevel_width
= bevel_width
; }
83 inline Direction
getDirection(void) const { return _direction
; }
84 void setDirection(Direction dir
) { _direction
= dir
; }
86 inline Style
*getStyle(void) const { return _style
; }
87 void setStyle(Style
*style
) { _style
= style
; }
93 void adjustHorz(void);
94 void adjustVert(void);
95 void internalResize(int width
, int height
);
101 OtkWidgetList _children
;
104 Direction _direction
;
112 bool _grabbed_keyboard
;
114 bool _stretchable_vert
;
115 bool _stretchable_horz
;
119 unsigned int _bg_pixel
;
122 unsigned int _screen
;
132 #endif // __widget_hh
This page took 0.0417 seconds and 5 git commands to generate.