-#ifndef __focus_hh
-#define __focus_hh
+#ifndef __widget_hh
+#define __widget_hh
#include <string>
#include <list>
#include "point.hh"
#include "texture.hh"
#include "style.hh"
+#include "eventhandler.hh"
+#include "application.hh"
namespace otk {
-class OtkWidget {
+class OtkWidget : public OtkEventHandler {
public:
typedef std::list<OtkWidget *> OtkWidgetList;
OtkWidget(OtkWidget *parent, Direction = Horizontal);
+ OtkWidget(OtkApplication *app, Direction direction = Horizontal,
+ Cursor cursor = 0, int bevel_width = 1);
OtkWidget(Style *style, Direction direction = Horizontal,
Cursor cursor = 0, int bevel_width = 1);
virtual void update(void);
- virtual bool expose(const XExposeEvent &e);
- virtual bool configure(const XConfigureEvent &e);
+ int exposeHandler(const XExposeEvent &e);
+ int configureHandler(const XConfigureEvent &e);
inline Window getWindow(void) const { return _window; }
inline const OtkWidget *getParent(void) const { return _parent; }
inline Style *getStyle(void) const { return _style; }
void setStyle(Style *style) { _style = style; }
+ inline OtkEventDispatcher *getEventDispatcher(void)
+ { return _event_dispatcher; }
+ void setEventDispatcher(OtkEventDispatcher *disp);
+
+protected:
+
+ bool _dirty;
+
private:
void create(void);
bool _fixed_width;
bool _fixed_height;
- bool _dirty;
+ OtkEventDispatcher *_event_dispatcher;
};
}