all repos — openbox @ 1d897f432e54400cb2a0e1499712782b336fd728

openbox fork - make it a bit more like ryudo

add the config header and emacs comment to all the .cc's
Dana Jansens danakj@orodu.net
commit

1d897f432e54400cb2a0e1499712782b336fd728

parent

638d4e6f1902c92e73b04246f349318236378437

M otk/application.ccotk/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"
M otk/appwidget.ccotk/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"
M otk/button.ccotk/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 {
M otk/display.ccotk/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"
M otk/eventdispatcher.ccotk/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>
M otk/eventdispatcher.hhotk/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! }; }
M otk/eventhandler.ccotk/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 @@ case SelectionNotify:

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 &) +{ + } }
M otk/eventhandler.hhotk/eventhandler.hh

@@ -3,6 +3,10 @@ #define __eventhandler__hh

extern "C" { #include <X11/Xlib.h> + +#ifdef SHAPE +#include <X11/extensions/shape.h> +#endif // SHAPE } namespace otk {

@@ -93,9 +97,6 @@

//! 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 &) {}

@@ -107,6 +108,18 @@ virtual void selectionHandler(const XSelectionEvent &) {}

//! 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();
M otk/focuslabel.ccotk/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 {
M otk/focuswidget.ccotk/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 {
M otk/image.ccotk/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"
M otk/imagecontrol.ccotk/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"
M otk/label.ccotk/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 {
M otk/otk_test.ccotk/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"
M otk/rect.ccotk/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 {
M otk/screeninfo.ccotk/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"
M otk/style.ccotk/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>
M otk/timer.ccotk/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"
M otk/timerqueuemanager.ccotk/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"
M otk/widget.ccotk/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"
M otk/widget.hhotk/widget.hh

@@ -1,15 +1,19 @@

#ifndef __widget_hh #define __widget_hh -#include <string> -#include <list> - #include "rect.hh" #include "point.hh" #include "texture.hh" #include "style.hh" #include "eventdispatcher.hh" #include "application.hh" + +extern "C" { +#include <assert.h> +} + +#include <string> +#include <list> namespace otk {

@@ -78,10 +82,10 @@ virtual void addChild(OtkWidget *child, bool front = false);

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 @@ inline Direction getDirection(void) const { return _direction; }

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; }