From 1d897f432e54400cb2a0e1499712782b336fd728 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 17 Nov 2002 09:41:58 +0000 Subject: [PATCH] add the config header and emacs comment to all the .cc's --- otk/application.cc | 6 ++++++ otk/appwidget.cc | 6 ++++++ otk/button.cc | 6 ++++++ otk/display.cc | 2 +- otk/eventdispatcher.cc | 6 ++++++ otk/eventdispatcher.hh | 2 ++ otk/eventhandler.cc | 22 ++++++++++++++++++++-- otk/eventhandler.hh | 19 ++++++++++++++++--- otk/focuslabel.cc | 6 ++++++ otk/focuswidget.cc | 6 ++++++ otk/image.cc | 2 +- otk/imagecontrol.cc | 2 +- otk/label.cc | 6 ++++++ otk/otk_test.cc | 6 ++++++ otk/rect.cc | 6 ++++++ otk/screeninfo.cc | 2 +- otk/style.cc | 8 +++++--- otk/timer.cc | 2 +- otk/timerqueuemanager.cc | 2 +- otk/widget.cc | 6 ++++++ otk/widget.hh | 16 ++++++++++------ 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 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 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 + +#ifdef SHAPE +#include +#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 #include 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 -#include - #include "rect.hh" #include "point.hh" #include "texture.hh" @@ -11,6 +8,13 @@ #include "eventdispatcher.hh" #include "application.hh" +extern "C" { +#include +} + +#include +#include + 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; } -- 2.45.2