From c1a16bdcfe7aa907fe78f27dc606a8e5a2699952 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 27 Jun 2007 18:08:03 +0930 Subject: 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(). --- Xext/geext.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'Xext/geext.h') 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 +/* 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); -- cgit v1.2.3