summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-11-17 09:41:58 +0000
committerDana Jansens <danakj@orodu.net>2002-11-17 09:41:58 +0000
commit1d897f432e54400cb2a0e1499712782b336fd728 (patch)
tree2ff371ac0e95fbb1ea237e430bf561f8120564c6
parent638d4e6f1902c92e73b04246f349318236378437 (diff)
add the config header and emacs comment to all the .cc's
-rw-r--r--otk/application.cc6
-rw-r--r--otk/appwidget.cc6
-rw-r--r--otk/button.cc6
-rw-r--r--otk/display.cc2
-rw-r--r--otk/eventdispatcher.cc6
-rw-r--r--otk/eventdispatcher.hh2
-rw-r--r--otk/eventhandler.cc22
-rw-r--r--otk/eventhandler.hh19
-rw-r--r--otk/focuslabel.cc6
-rw-r--r--otk/focuswidget.cc6
-rw-r--r--otk/image.cc2
-rw-r--r--otk/imagecontrol.cc2
-rw-r--r--otk/label.cc6
-rw-r--r--otk/otk_test.cc6
-rw-r--r--otk/rect.cc6
-rw-r--r--otk/screeninfo.cc2
-rw-r--r--otk/style.cc8
-rw-r--r--otk/timer.cc2
-rw-r--r--otk/timerqueuemanager.cc2
-rw-r--r--otk/widget.cc6
-rw-r--r--otk/widget.hh16
21 files changed, 119 insertions, 20 deletions
diff --git a/otk/application.cc b/otk/application.cc
index 8e4d93b3..70f9e24b 100644
--- a/otk/application.cc
+++ b/otk/application.cc
@@ -1,3 +1,9 @@
+// -*- 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"
diff --git a/otk/appwidget.cc b/otk/appwidget.cc
index f406c654..035a429c 100644
--- a/otk/appwidget.cc
+++ b/otk/appwidget.cc
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "appwidget.hh"
#include "application.hh"
diff --git a/otk/button.cc b/otk/button.cc
index 1b2ef7ce..502a226f 100644
--- a/otk/button.cc
+++ b/otk/button.cc
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "button.hh"
namespace otk {
diff --git a/otk/display.cc b/otk/display.cc
index 77111d3c..7fafed0c 100644
--- a/otk/display.cc
+++ b/otk/display.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
diff --git a/otk/eventdispatcher.cc b/otk/eventdispatcher.cc
index 2de28369..30996de0 100644
--- a/otk/eventdispatcher.cc
+++ b/otk/eventdispatcher.cc
@@ -1,3 +1,9 @@
+// -*- 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>
diff --git a/otk/eventdispatcher.hh b/otk/eventdispatcher.hh
index 5e7a1fe4..28741d95 100644
--- a/otk/eventdispatcher.hh
+++ b/otk/eventdispatcher.hh
@@ -28,6 +28,8 @@ private:
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!
};
}
diff --git a/otk/eventhandler.cc b/otk/eventhandler.cc
index 9d37bcff..6603b3e1 100644
--- a/otk/eventhandler.cc
+++ b/otk/eventhandler.cc
@@ -1,5 +1,11 @@
+// -*- 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 {
@@ -78,7 +84,19 @@ void OtkEventHandler::handle(const XEvent &e)
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 &)
+{
+
}
}
diff --git a/otk/eventhandler.hh b/otk/eventhandler.hh
index 05dfac3b..bb4f6d6b 100644
--- a/otk/eventhandler.hh
+++ b/otk/eventhandler.hh
@@ -3,6 +3,10 @@
extern "C" {
#include <X11/Xlib.h>
+
+#ifdef SHAPE
+#include <X11/extensions/shape.h>
+#endif // SHAPE
}
namespace otk {
@@ -93,9 +97,6 @@ public:
//! 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 &) {}
@@ -108,6 +109,18 @@ public:
//! 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:
diff --git a/otk/focuslabel.cc b/otk/focuslabel.cc
index ea4e9ca2..e75a1d33 100644
--- a/otk/focuslabel.cc
+++ b/otk/focuslabel.cc
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "focuslabel.hh"
namespace otk {
diff --git a/otk/focuswidget.cc b/otk/focuswidget.cc
index c21697ce..22a6100b 100644
--- a/otk/focuswidget.cc
+++ b/otk/focuswidget.cc
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "focuswidget.hh"
namespace otk {
diff --git a/otk/image.cc b/otk/image.cc
index 59c26ae6..8b4e8ede 100644
--- a/otk/image.cc
+++ b/otk/image.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
diff --git a/otk/imagecontrol.cc b/otk/imagecontrol.cc
index 8cc6b2af..07b1132c 100644
--- a/otk/imagecontrol.cc
+++ b/otk/imagecontrol.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
diff --git a/otk/label.cc b/otk/label.cc
index 40a85bb3..1537b927 100644
--- a/otk/label.cc
+++ b/otk/label.cc
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "label.hh"
namespace otk {
diff --git a/otk/otk_test.cc b/otk/otk_test.cc
index 39baa7f6..495b81d5 100644
--- a/otk/otk_test.cc
+++ b/otk/otk_test.cc
@@ -1,3 +1,9 @@
+// -*- 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"
diff --git a/otk/rect.cc b/otk/rect.cc
index bf34970d..40d369e9 100644
--- a/otk/rect.cc
+++ b/otk/rect.cc
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
#include "rect.hh"
namespace otk {
diff --git a/otk/screeninfo.cc b/otk/screeninfo.cc
index e0a3ca9d..14faf0c0 100644
--- a/otk/screeninfo.cc
+++ b/otk/screeninfo.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
diff --git a/otk/style.cc b/otk/style.cc
index 277924d6..89c7b05d 100644
--- a/otk/style.cc
+++ b/otk/style.cc
@@ -1,6 +1,8 @@
-#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>
diff --git a/otk/timer.cc b/otk/timer.cc
index c8e91262..2e2205f7 100644
--- a/otk/timer.cc
+++ b/otk/timer.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
diff --git a/otk/timerqueuemanager.cc b/otk/timerqueuemanager.cc
index 846648d3..a37fe94d 100644
--- a/otk/timerqueuemanager.cc
+++ b/otk/timerqueuemanager.cc
@@ -1,4 +1,4 @@
-// -*- mode: C++; indent-tabs-mode: nil; -*-
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
diff --git a/otk/widget.cc b/otk/widget.cc
index 0e5eaf15..79a1f93a 100644
--- a/otk/widget.cc
+++ b/otk/widget.cc
@@ -1,3 +1,9 @@
+// -*- 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"
diff --git a/otk/widget.hh b/otk/widget.hh
index cbf2f9c5..cc6827cf 100644
--- a/otk/widget.hh
+++ b/otk/widget.hh
@@ -1,9 +1,6 @@
#ifndef __widget_hh
#define __widget_hh
-#include <string>
-#include <list>
-
#include "rect.hh"
#include "point.hh"
#include "texture.hh"
@@ -11,6 +8,13 @@
#include "eventdispatcher.hh"
#include "application.hh"
+extern "C" {
+#include <assert.h>
+}
+
+#include <string>
+#include <list>
+
namespace otk {
class OtkWidget : public OtkEventHandler {
@@ -78,10 +82,10 @@ public:
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; }
@@ -93,7 +97,7 @@ public:
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; }