diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-06-27 18:08:03 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-07-01 09:14:18 +0930 |
commit | c1a16bdcfe7aa907fe78f27dc606a8e5a2699952 (patch) | |
tree | 23bb429d29cec4dd3347163c27bfbd40e7af3daa /Xext/geext.h | |
parent | 08779c62ba2f4cbfa47e3cf738daf8abd74b60cf (diff) |
Add 'evfill' field to GEExtensions.
We need this to allow extensions to fill in extra data for an event before it
is sent to the client. This is probably to be used like
FillUpEventsFromWindow().
Diffstat (limited to 'Xext/geext.h')
-rw-r--r-- | Xext/geext.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/Xext/geext.h b/Xext/geext.h index 7a73e81e6..bac472662 100644 --- a/Xext/geext.h +++ b/Xext/geext.h @@ -34,6 +34,23 @@ from the author. #define _GEEXT_H_ #include <X11/extensions/geproto.h> +/* Struct to keep information about registered extensions + * + * evswap ... use to swap event fields for different byte ordered clients. + * evfill ... use to fill various event fields from the given parameters. + */ +typedef struct _GEExtension { + void (*evswap)(xGenericEvent* from, xGenericEvent* to); + void (*evfill)(xGenericEvent* ev, + DeviceIntPtr pDev, /* device */ + WindowPtr pWin, /* event window */ + GrabPtr pGrab /* current grab, may be NULL */ + ); +} GEExtension, *GEExtensionPtr; + +/* All registered extensions and their handling functions. */ +extern GEExtension GEExtensions[MAXEXTENSIONS]; + /* Returns the extension offset from the event */ #define GEEXT(ev) (((xGenericEvent*)(ev))->extension) @@ -50,11 +67,19 @@ from the author. #define GECLIENT(pWin) \ (((pWin)->optional) ? (pWin)->optional->geMasks->geClients : NULL) +/* Returns the event_fill for the given event */ +#define GEEventFill(ev) \ + GEExtensions[GEEXTIDX(xE)].evfill + /* Interface for other extensions */ void GEWindowSetMask(ClientPtr pClient, WindowPtr pWin, int extension, Mask mask); void GERegisterExtension( int extension, - void (*ev_dispatch)(xGenericEvent* from, xGenericEvent* to)); + void (*ev_dispatch)(xGenericEvent* from, xGenericEvent* to), + void (*ev_fill)(xGenericEvent* ev, DeviceIntPtr pDev, + WindowPtr pWin, GrabPtr pGrab) + ); + void GEInitEvent(xGenericEvent* ev, int extension); |