From 45c2589ef6e6576604543229dfa1582d471e6a94 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 4 Nov 2002 09:25:26 +0000 Subject: xeventhandler can handle everything except client messages now. blackbox is no longer the event handler --- src/xeventhandler.hh | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 src/xeventhandler.hh (limited to 'src/xeventhandler.hh') diff --git a/src/xeventhandler.hh b/src/xeventhandler.hh new file mode 100644 index 00000000..4f62fa0c --- /dev/null +++ b/src/xeventhandler.hh @@ -0,0 +1,138 @@ +// -*- mode: C++; indent-tabs-mode: nil; -*- +#ifndef __xeventhandler_hh +#define __xeventhandler_hh + +extern "C" { +#include +} + +namespace ob { + +//! Handles X events +/*! + There are 2 type of X events:
+ a) User Actions
+ b) Background Events
+

+ User Actions are events like mouse drags and presses, key presses. + Background Events are everything else. Stuff that can't be bound to user + input. +

+ When an XEvent comes to the application, it is sent to this class. This class + will determine what the event means, such as "A Left-Mouse-Button Drag on + this window", or "Double click with right mouse button on root window" or + "space bar pressed", or Background Event. +

+ If the XEvent or combination of XEvents form a User Action, then the action + is dispatched to the OBBindingMapper. +

+ If the XEvent is a Background Event, it is simply dealt with as appropriate. +*/ +class OBXEventHandler +{ +private: + //! The time at which the last XEvent with a time was received + Time _lasttime; + + //! Handles mouse button press events + /*! + @param e The XEvent to handle + */ + void buttonPress(const XButtonEvent &e); + //! Handles mouse button release events + /*! + @param e The XEvent to handle + */ + void buttonRelease(const XButtonEvent &e); + //! Handles keyboard key press events + /*! + @param e The XEvent to handle + */ + void keyPress(const XKeyEvent &e); + //! Handles mouse motion events + /*! + @param e The XEvent to handle + */ + void motion(const XMotionEvent &e); + //! Handles mouse-enter events + /*! + @param e The XEvent to handle + */ + void enterNotify(const XCrossingEvent &e); + //! Handles mouse-leave events + /*! + @param e The XEvent to handle + */ + void leaveNotify(const XCrossingEvent &e); + //! Handles configure request events + /*! + @param e The XEvent to handle + */ + void configureRequest(const XConfigureRequestEvent &e); + //! Handles window map request events + /*! + @param e The XEvent to handle + */ + void mapRequest(const XMapRequestEvent &e); + //! Handles window unmap events + /*! + @param e The XEvent to handle + */ + void unmapNotify(const XUnmapEvent &e); + //! Handles window destroy events + /*! + @param e The XEvent to handle + */ + void destroyNotify(const XDestroyWindowEvent &e); + //! Handles window reparent events + /*! + @param e The XEvent to handle + */ + void reparentNotify(const XReparentEvent &e); + //! Handles window property change events + /*! + @param e The XEvent to handle + */ + void propertyNotify(const XPropertyEvent &e); + //! Handles window expose events + /*! + @param e The XEvent to handle + */ + void expose(const XExposeEvent &e); + //! Handles colormap events + /*! + @param e The XEvent to handle + */ + void colormapNotify(const XColormapEvent &e); + //! Handles focus-in events + /*! + @param e The XEvent to handle + */ + void focusIn(const XFocusChangeEvent &e); + //! Handles focus-out events + /*! + @param e The XEvent to handle + */ + void focusOut(const XFocusChangeEvent &e); +#if defined(SHAPE) || defined(DOXYGEN_IGNORE) + //! Handles Shape extension events + /*! + @param e The XEvent to handle + */ + void shapeEvent(const XShapeEvent &e); +#endif // SHAPE + +public: + //! Constructs an OBXEventHandler object + OBXEventHandler(); + + //! Handle an XEvent + /*! + @param e The XEvent to handle + */ + void handle(const XEvent &e); +}; + +} + +#endif // __xeventhandler_hh -- cgit v1.2.3