+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "application.hh"
#include "eventhandler.hh"
#include "widget.hh"
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "appwidget.hh"
#include "application.hh"
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "button.hh"
namespace otk {
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "eventdispatcher.hh"
#include "display.hh"
#include <iostream>
OtkEventMap _map;
OtkEventHandler *_fallback;
+ //! The time at which the last XEvent with a time was received
+ Time _lasttime; // XXX: store this! also provide an accessor!
};
}
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
+#include "display.hh"
#include "eventhandler.hh"
-#include <iostream>
namespace otk {
return selectionHandler(e.xselection);
case SelectionRequest:
return selectionRequestHandler(e.xselectionrequest);
- };
+ default:
+#ifdef SHAPE
+ if (e.type == otk::OBDisplay::shapeEventBase())
+ return shapeHandler((*(XShapeEvent*)&e));
+#endif // SHAPE
+ ;
+ }
+}
+
+
+void OtkEventHandler::clientMessageHandler(const XClientMessageEvent &)
+{
+
}
}
extern "C" {
#include <X11/Xlib.h>
+
+#ifdef SHAPE
+#include <X11/extensions/shape.h>
+#endif // SHAPE
}
namespace otk {
//! Called when the colormap changes, or is installed or unistalled
virtual void colorMapHandler(const XColormapEvent &) {}
- //! Called when a client calls XSendEvent
- virtual void clientMessageHandler(const XClientMessageEvent &) {}
-
//! Called when a property of a window changes
virtual void propertyHandler(const XPropertyEvent &) {}
//! Called when a SelectionEvent occurs
virtual void selectionRequestHandler(const XSelectionRequestEvent &) {}
+ //! Called when a client calls XSendEvent
+ /*!
+ Some types of client messages are filtered out and sent to more specific
+ event handler functions.
+ */
+ virtual void clientMessageHandler(const XClientMessageEvent &);
+
+#if defined(SHAPE) || defined(DOXYGEN_IGNORE)
+ //! Called when a shape extention event fires
+ virtual void shapeHandler(const XShapeEvent &) {};
+#endif // SHAPE
+
virtual ~OtkEventHandler();
protected:
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "focuslabel.hh"
namespace otk {
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "focuswidget.hh"
namespace otk {
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "label.hh"
namespace otk {
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "application.hh"
#include "focuswidget.hh"
#include "appwidget.hh"
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "rect.hh"
namespace otk {
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
-#ifdef HAVE_CONFIG_H
-#include "../config.h"
-#endif // HAVE_CONFIG_H
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
#include <assert.h>
#include <iostream>
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif // HAVE_CONFIG_H
+
#include "widget.hh"
#include "display.hh"
#include "assassin.hh"
#ifndef __widget_hh
#define __widget_hh
-#include <string>
-#include <list>
-
#include "rect.hh"
#include "point.hh"
#include "texture.hh"
#include "eventdispatcher.hh"
#include "application.hh"
+extern "C" {
+#include <assert.h>
+}
+
+#include <string>
+#include <list>
+
namespace otk {
class OtkWidget : public OtkEventHandler {
virtual void removeChild(OtkWidget *child);
inline bool isStretchableHorz(void) const { return _stretchable_horz; }
- void setStretchableHorz(bool s_horz) { _stretchable_horz = s_horz; }
+ void setStretchableHorz(bool s_horz = true) { _stretchable_horz = s_horz; }
inline bool isStretchableVert(void) const { return _stretchable_vert; }
- void setStretchableVert(bool s_vert) { _stretchable_vert = s_vert; }
+ void setStretchableVert(bool s_vert = true) { _stretchable_vert = s_vert; }
inline Cursor getCursor(void) const { return _cursor; }
void setDirection(Direction dir) { _direction = dir; }
inline Style *getStyle(void) const { return _style; }
- void setStyle(Style *style) { _style = style; }
+ void setStyle(Style *style) { assert(style); _style = style; }
inline OtkEventDispatcher *getEventDispatcher(void)
{ return _event_dispatcher; }