summaryrefslogtreecommitdiff
path: root/Development/Documentation/XGE.mdwn
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@freedesktop.org>2013-07-08 08:27:59 (GMT)
committerJoe Rayhawk <jrayhawk@freedesktop.org>2013-07-08 08:27:59 (GMT)
commit3c31659f79fdbc046153c2182bcc94b6fb001507 (patch)
treeaa3542055704e612caa07ab9a0bf933a1a03a24c /Development/Documentation/XGE.mdwn
parent91e762a70af43a0f9cd78c7ba8582864ffcb7af3 (diff)
moin2mdwn: convert page Development/Documentation/XGE
Diffstat (limited to 'Development/Documentation/XGE.mdwn')
-rw-r--r--Development/Documentation/XGE.mdwn75
1 files changed, 75 insertions, 0 deletions
diff --git a/Development/Documentation/XGE.mdwn b/Development/Documentation/XGE.mdwn
new file mode 100644
index 0000000..05cd4e5
--- /dev/null
+++ b/Development/Documentation/XGE.mdwn
@@ -0,0 +1,75 @@
+
+
+# X Generic Event Extension
+
+The X Generic Event extension (XGE) grew out of the problem that X only allows 64 event opcodes for all extensions together. Right now, there are only around 15 or so left, depending on how many extensions are enabled in your server. XGE simply defines one new event opcode (35, [[GenericEvent|GenericEvent]]) in the core protocol, and then re-uses this opcode for multiple events.
+
+
+## Event Structure
+
+
+[[!format txt """
+typedef struct
+{
+ BYTE type; /* Always GenericEvent */
+ CARD8 extension;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 evtype B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xGenericEvent;
+
+"""]]
+The actual type of an event is specified as the combination of _extension_ and _evtype_. _extension_ specifies the matching extension's major opcode. _evtype_ is a static type as defined for this extension. _evtype_ must be unique within the extension.
+
+
+## Long events
+
+XGE allows events that are longer than the standard X protocol's 32 byte events. The _length_ field of a [[GenericEvent|GenericEvent]] defines the number of bytes after the initial 32 bytes in 4 byte units.
+
+**Sending long events requires an XGE-aware libX11/libxcb!** The server must not send a long event unless it is sure that the client supports XGE, otherwise the protocol will be unaligned. libX11 without xcb support does **not** support [[GenericEvents|GenericEvents]].
+
+
+## Requests
+
+XGE provides a single request: _GEQueryVersion_.
+
+
+[[!format txt """
+/* QueryVersion */
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GEQueryVersion */
+ CARD16 length B16;
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+} xGEQueryVersionReq;
+
+#define sz_xGEQueryVersionReq 8
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GEQueryVersion */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGEQueryVersionReply;
+
+"""]]
+
+## Usage
+
+As the event selection is specific to the extension, it is (currently) required that each extension provides its own event selection request. For example, in XI this is _[[XiSelectEvent|XiSelectEvent]]_.
+
+XGE is being used by XI (MPX) to send long events. Much of its current implementation supports device-specific events, but it is intended to be usable by other extensions as well.