[PATCH] XGE: Add xGESendEventReq to send events > 32bytes
carlosg at gnome.org
carlosg at gnome.org
Fri Nov 26 14:57:44 PST 2010
From: Carlos Garnacho <carlosg at gnome.org>
xSendEventReq is a fixed size request, so it can't send
xGenericEvents, which may be larger than the usual 32bytes
boundary.
The extension version has been bumped to 1.1 since a new
request has been added, and a new chapter has been added
to the protocol documentation for this request.
Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
---
ge.h | 5 +++--
geproto.h | 13 +++++++++++++
specs/geproto.xml | 36 +++++++++++++++++++++++++++++++++---
3 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/ge.h b/ge.h
index aca1d8a..f52821b 100644
--- a/ge.h
+++ b/ge.h
@@ -29,7 +29,7 @@
#define GE_NAME "Generic Event Extension"
#define GE_MAJOR 1
-#define GE_MINOR 0
+#define GE_MINOR 1
/*********************************************************
*
@@ -38,8 +38,9 @@
*/
#define X_GEQueryVersion 0
+#define X_GESendEvent 1
-#define GENumberRequests (X_GEQueryVersion + 1)
+#define GENumberRequests (X_GESendEvent + 1)
/*********************************************************
*
diff --git a/geproto.h b/geproto.h
index c8860dd..0c70e5f 100644
--- a/geproto.h
+++ b/geproto.h
@@ -81,5 +81,18 @@ typedef struct {
#define sz_xGEQueryVersionReply 32
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType;
+ CARD16 length B16;
+ CARD8 propagate;
+ CARD8 pad1;
+ CARD16 pad2;
+ CARD32 destination B32;
+ CARD32 eventMask B32;
+} xGESendEventReq;
+
+#define sz_xGESendEventReq 16
+
#endif /* _GEPROTO_H_ */
diff --git a/specs/geproto.xml b/specs/geproto.xml
index 7bba357..13490c9 100644
--- a/specs/geproto.xml
+++ b/specs/geproto.xml
@@ -4,6 +4,7 @@
<book>
<bookinfo>
<title>X Generic Event Extension</title>
+ <releaseinfo>Version 1.1</releaseinfo>
<author>
<firstname>Peter</firstname>
@@ -14,6 +15,13 @@
<orgname>peter.hutterer at who-t.net</orgname>
</affiliation>
</author>
+
+ <collab>
+ <collabname>Carlos Garnacho</collabname>
+ <affiliation>
+ <orgname>carlos at lanedo.com</orgname>
+ </affiliation>
+ </collab>
</bookinfo>
<chapter>
@@ -51,9 +59,6 @@
compatible changes. It is the clients responsibility to ensure that the
server supports a version which is compatible with its
expectations.</para>
-
- <para>As of version 1.0, no other requests are provided by this extension.
- </para>
</chapter>
<chapter>
@@ -77,6 +82,31 @@
</chapter>
<chapter>
+ <title>Sending events</title>
+
+ <para>Since version 1.1, GE provides a request to complement the SendEvent
+ request in the core protocol, this is a variable length request that will
+ take the xGenericEventCookie being sent as the extra data.</para>
+
+ <programlisting>GESendEvent
+ propagate: CARD8
+ pad1: CARD8
+ pad2: CARD16
+ destination: CARD32
+ eventMask: CARD32
+
+ Errors: Device, Value, Window</programlisting>
+
+ <para>The arguments are very similar to its core protocol counterpart, with
+ the exception of eventMask being an event mask of the extension protocol the
+ event pertains to.</para>
+
+ <para>In libX11, This functionality is handled in XSendEvent() itself, so
+ if one client wants to send a GE-based event to another client, such function
+ can be used by passing a XGenericEventCookie pointer.</para>
+ </chapter>
+
+ <chapter>
<title>Notes</title>
<para>Although the wire event is of arbitrary length, the actual size of
--
1.7.3.2
More information about the xorg-devel
mailing list