summaryrefslogtreecommitdiff
path: root/Xext/geext.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-06-27 18:08:03 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-07-01 09:14:18 +0930
commitc1a16bdcfe7aa907fe78f27dc606a8e5a2699952 (patch)
tree23bb429d29cec4dd3347163c27bfbd40e7af3daa /Xext/geext.c
parent08779c62ba2f4cbfa47e3cf738daf8abd74b60cf (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.c')
-rw-r--r--Xext/geext.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/Xext/geext.c b/Xext/geext.c
index f0801cbf8..0add5e1fb 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -41,15 +41,8 @@ int GEErrorBase;
int GEClientPrivateIndex;
int GEEventType; /* The opcode for all GenericEvents will have. */
-/* Struct to keep information about registered extensions
- */
-typedef struct _GEExtension {
- /* event swap function */
- void (*evswap)(xGenericEvent* from, xGenericEvent* to);
-} GEExtension, *GEExtensionPtr;
-/* All registered extensions */
-static GEExtension GEExtensions[MAXEXTENSIONS];
+GEExtension GEExtensions[MAXEXTENSIONS];
/* Major available requests */
static const int version_requests[] = {
@@ -249,11 +242,15 @@ GEExtensionInit(void)
/* Register an extension with GE. The given swap function will be called each
* time an event is sent to a client with different byte order.
* @param extension The extensions major opcode
- * @param ev_swap the event swap function.
+ * @param ev_swap The event swap function.
+ * @param ev_fill Called for an event before delivery. The extension now has
+ * the chance to fill in necessary fields for the event.
*/
void GERegisterExtension(
int extension,
- void (*ev_swap)(xGenericEvent* from, xGenericEvent* to)
+ void (*ev_swap)(xGenericEvent* from, xGenericEvent* to),
+ void (*ev_fill)(xGenericEvent* ev, DeviceIntPtr pDev,
+ WindowPtr pWin, GrabPtr pGrab)
)
{
if ((extension & 0x7F) >= MAXEXTENSIONS)
@@ -261,6 +258,7 @@ void GERegisterExtension(
/* extension opcodes are > 128, might as well save some space here */
GEExtensions[extension & 0x7f].evswap = ev_swap;
+ GEExtensions[extension & 0x7f].evfill = ev_fill;
}