diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-11-11 03:46:25 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-11-11 03:46:25 +0000 |
| commit | f0e2abf573760ab075b4683d7724f72f2d00f914 (patch) | |
| tree | 071da116aa0217fb2028b729283fa2c997d136c6 /otk/widget.hh | |
| parent | 6852efaa9e4c5915aba5f9895a8f09cd9593083e (diff) | |
can now map windows and render textures
Diffstat (limited to 'otk/widget.hh')
| -rw-r--r-- | otk/widget.hh | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/otk/widget.hh b/otk/widget.hh index bee3ef82..dd12de7c 100644 --- a/otk/widget.hh +++ b/otk/widget.hh @@ -4,6 +4,7 @@ #include "rect.hh" #include "point.hh" #include "texture.hh" +#include "style.hh" namespace otk { @@ -11,10 +12,13 @@ class OtkWidget { public: + enum Direction { Horizontal, Vertical }; + typedef std::list<OtkWidget *> OtkWidgetList; - OtkWidget(OtkWidget *parent); - OtkWidget(unsigned int screen, Cursor); + OtkWidget(OtkWidget *parent, Direction = Horizontal); + OtkWidget(Style *style, Direction direction = Horizontal, + Cursor cursor = 0, int bevel_width = 1); virtual ~OtkWidget(); @@ -40,7 +44,6 @@ public: inline bool isFocused(void) const { return _focused; }; virtual void focus(void); - virtual void blur(void); inline bool hasGrabbedMouse(void) const { return _grabbed_mouse; } bool grabMouse(void); @@ -51,9 +54,9 @@ public: void ungrabKeyboard(void); inline const BTexture *getTexture(void) const { return _texture; } - virtual void setTexture(BTexture *texture); + virtual void setTexture(BTexture *texture = 0); - virtual void addChild(OtkWidget *child); + virtual void addChild(OtkWidget *child, bool front = false); virtual void removeChild(OtkWidget *child); inline bool getStretchableHorz(void) const { return _stretchable_horz; } @@ -64,6 +67,16 @@ public: inline Cursor getCursor(void) const { return _cursor; } + inline int getBevelWidth(void) const { return _bevel_width; } + void setBevelWidth(int bevel_width) + { assert(bevel_width > 0); _bevel_width = bevel_width; } + + inline Direction getDirection(void) const { return _direction; } + void setDirection(Direction dir) { _direction = dir; } + + inline Style *getStyle(void) const { return _style; } + void setStyle(Style *style) { _style = style; } + private: void create(void); @@ -73,6 +86,11 @@ private: OtkWidget *_parent; OtkWidgetList _children; + Style *_style; + Direction _direction; + Cursor _cursor; + int _bevel_width; + bool _visible; bool _focused; @@ -83,11 +101,10 @@ private: bool _stretchable_horz; BTexture *_texture; + Pixmap _bg_pixmap; Rect _rect; unsigned int _screen; - - Cursor _cursor; }; } |
