- typedef std::list<OtkWidget *> OtkWidgetList;
-
- OtkWidget(OtkWidget *parent, Direction = Horizontal);
- OtkWidget(Style *style, Direction direction = Horizontal,
- Cursor cursor = 0, int bevel_width = 1);
-
- virtual ~OtkWidget();
-
- virtual void update(void);
-
- virtual void expose(const XExposeEvent &e);
-
- inline Window getWindow(void) const { return _window; }
- inline const OtkWidget *getParent(void) const { return _parent; }
- inline const OtkWidgetList &getChildren(void) const { return _children; }
- inline unsigned int getScreen(void) const { return _screen; }
- inline const Rect &getRect(void) const { return _rect; }
-
- void move(const Point &to);
- void move(int x, int y);
-
- virtual void setWidth(int);
- virtual void setHeight(int);
-
- virtual void resize(const Point &to);
- virtual void resize(int x, int y);
-
- virtual void setGeometry(const Rect &new_geom);
- virtual void setGeometry(const Point &topleft, int width, int height);
- virtual void setGeometry(int x, int y, int width, int height);
-
- inline bool isVisible(void) const { return _visible; };
- virtual void show(void);
- virtual void hide(void);
+ Widget(int screen, EventDispatcher *ed, Direction direction = Horizontal,
+ int bevel = 3, bool overrideredir = false);
+ Widget(Widget *parent, Direction direction = Horizontal, int bevel = 3);
+ virtual ~Widget();
+
+ inline int screen() const { return _screen; }
+ inline Window window() const { return _window; }
+ inline Widget *parent() const { return _parent; }
+ inline Direction direction() const { return _direction; }
+
+ inline RenderStyle::Justify alignment() const { return _alignment; }
+ void setAlignment(RenderStyle::Justify a);
+
+ inline long eventMask() const { return _event_mask; }
+ virtual void setEventMask(long e);
+
+ inline const Rect& area() const { return _area; }
+ inline Rect usableArea() const { return Rect(_area.position(),
+ Size(_area.width() -
+ _borderwidth * 2,
+ _area.height() -
+ _borderwidth * 2));}
+ inline const Size& minSize() const { return _min_size; }
+ inline const Size& maxSize() const { return _max_size; }
+ virtual void setMaxSize(const Size &s);
+
+ virtual void show(bool children = false);
+ virtual void hide();
+ inline bool visible() const { return _visible; }
+
+ virtual void update();
+ virtual void refresh() { _dirty = true; render(); }
+
+ virtual void setBevel(int b);
+ inline int bevel() const { return _bevel; }
+
+ void move(const Point &p)
+ { moveresize(Rect(p, _area.size())); }
+ void resize(const Size &s)
+ { moveresize(Rect(_area.position(), s)); }
+ /*!
+ When a widget has a parent, this won't change the widget directly, but will
+ just cause the parent to re-layout all its children.
+ */
+ virtual void moveresize(const Rect &r);
+
+ inline const RenderColor *borderColor() const { return _bordercolor; }
+ virtual void setBorderColor(const RenderColor *c);
+
+ inline int borderWidth() const { return _borderwidth; }
+ virtual void setBorderWidth(int w);
+
+ const std::list<Widget*>& children() const { return _children; }
+
+ virtual void exposeHandler(const XExposeEvent &e);
+ virtual void configureHandler(const XConfigureEvent &e);
+ virtual void styleChanged(const RenderStyle &style);