[Xcb] [PATCH] proto: experimental Xi and SELinux extensions

Eamon Walsh ewalsh at tycho.nsa.gov
Fri Dec 7 13:43:21 PST 2007


I pushed the autotools patch.  I would like to push XInput and SELinux 
extensions upstream, disabled by default.  I am still testing XInput so 
I have marked it experimental in the configure option and pc.in file.  
Please consider for upstream, this is an important piece of the puzzle 
for people experimenting with SELinux support for X.

Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
---

 Makefile.am  |    4 
 xinput.xml   |  963 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 xselinux.xml |  159 +++++++++
 3 files changed, 1125 insertions(+), 1 deletion(-)


diff --git a/src/Makefile.am b/src/Makefile.am
index dd0d329..3caaed2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,10 +16,12 @@ xcbinclude_HEADERS = \
 	sync.xml \
 	xc_misc.xml \
 	xevie.xml \
-	xinerama.xml \
 	xf86dri.xml \
 	xfixes.xml \
+	xinerama.xml \
+	xinput.xml \
 	xprint.xml \
+	xselinux.xml \
 	xtest.xml \
 	xv.xml \
 	xvmc.xml
diff --git a/src/xinput.xml b/src/xinput.xml
new file mode 100644
index 0000000..fde3d97
--- /dev/null
+++ b/src/xinput.xml
@@ -0,0 +1,963 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2006 Peter Hutterer 
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the names of the authors or their
+institutions shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from the authors.
+-->
+
+<!-- Spec: http://refspecs.freestandards.org/X11/Xinput.pdf -->
+
+<xcb header="xinput" extension-xname="XInputExtension" extension-name="Input"
+     major-version="1" minor-version="4">
+  <import>xproto</import>
+
+  <typedef oldname="CARD8" newname="KeyCode" />
+  <typedef oldname="CARD32" newname="EventClass" />
+
+  <enum name="ValuatorMode">
+    <item name="Relative"> <value>0</value></item>
+    <item name="Absolute"> <value>1</value></item>
+  </enum>
+
+  <enum name="PropagateMode">
+    <item name="AddToList"> <value>0</value></item>
+    <item name="DeleteFromList"> <value>1</value></item>
+  </enum>
+
+  <!-- GetExtensionVersion -->
+
+  <request name="GetExtensionVersion" opcode="1">
+    <field type="CARD16" name="name_len" />
+    <pad bytes="2" />
+    <list type="char" name="name">
+      <fieldref>name_len</fieldref>
+    </list>
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="server_major" />
+      <field type="CARD16" name="server_minor" />
+      <field type="CARD8" name="present" />
+    </reply>
+  </request>
+
+  <!-- ListInputDevices -->
+
+  <request name="ListInputDevices" opcode="2">
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="devices_len" />
+      <pad bytes="23" />
+      <list type="DeviceInfo" name="devices">
+	<fieldref>devices_len</fieldref>
+      </list>
+      <!-- Uninterpreted: list of deviceinfo structs of 3 the subtypes -->
+      <!-- Uninterpreted: list of null-terminated strings -->
+    </reply>
+  </request>
+
+  <struct name="DeviceInfo">
+    <field type="ATOM" name="device_type" />
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="num_class_info" />
+    <field type="CARD8" name="device_use" />
+    <pad bytes="1" />
+  </struct>
+
+  <enum name="DeviceUse">
+    <item name="IsXPointer"><value>0</value></item>
+    <item name="IsXKeyboard"><value>1</value></item>
+    <item name="IsXExtensionDevice"><value>2</value></item>
+    <item name="IsXExtensionKeyboard"><value>3</value></item>
+    <item name="IsXExtensionPointer"><value>4</value></item>
+  </enum>
+
+  <struct name="InputInfo">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+  </struct>
+
+  <struct name="KeyInfo">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="KeyCode" name="min_keycode" />
+    <field type="KeyCode" name="max_keycode" />
+    <field type="CARD16" name="num_keys" />
+  </struct>
+
+  <struct name="ButtonInfo">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="CARD16" name="num_buttons" />
+  </struct>
+
+  <struct name="ValuatorInfo">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="CARD8" name="axes_len" />
+    <field type="CARD8" name="mode" />
+    <field type="CARD32" name="motion_size" />
+    <list type="AxisInfo" name="axes">
+      <fieldref>axes_len</fieldref>
+    </list>
+  </struct>
+
+  <struct name="AxisInfo">
+    <field type="CARD32" name="resolution" />
+    <field type="CARD32" name="minimum" />
+    <field type="CARD32" name="maximum" />
+  </struct>
+
+  <!-- OpenDevice -->
+
+  <request name="OpenDevice" opcode="3">
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="num_classes" />
+      <pad bytes="23" />
+      <list type="InputClassInfo" name="class_info">
+        <fieldref>num_classes</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <struct name="InputClassInfo">
+    <field type="CARD8" name="class" />
+    <field type="CARD8" name="event_type_base" />
+  </struct>
+
+  <enum name="InputClass">
+    <item name="Key"><value>0</value></item>
+    <item name="Button"><value>1</value></item>
+    <item name="Valuator"><value>2</value></item>
+    <item name="Feedback"><value>3</value></item>
+    <item name="Proximity"><value>4</value></item>
+    <item name="Focus"><value>5</value></item>
+    <item name="Other"><value>6</value></item>
+  </enum>
+
+  <!-- CloseDevice -->
+
+  <request name="CloseDevice" opcode="4">
+    <field type="CARD8" name="device_id" />
+  </request>
+
+  <!-- SetDeviceMode -->
+
+  <request name="SetDeviceMode" opcode="5">
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="mode" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </reply>
+  </request>
+
+  <!-- SelectExtensionEvent -->
+
+  <request name="SelectExtensionEvent" opcode="6">
+    <field type="WINDOW" name="window" />
+    <field type="CARD16" name="num_classes" />
+    <pad bytes="2" />
+    <list type="EventClass" name="classes">
+      <fieldref>num_classes</fieldref>
+    </list>
+  </request>
+
+  <!-- GetSelectedExtensionEvents -->
+
+  <request name="GetSelectedExtensionEvents" opcode="7">
+    <field type="WINDOW" name="window" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="num_this_classes" />
+      <field type="CARD16" name="num_all_classes" />
+      <pad bytes="20" />
+      <list type="EventClass" name="this_classes">
+        <fieldref>num_this_classes</fieldref>
+      </list>
+      <list type="EventClass" name="all_classes">
+        <fieldref>num_all_classes</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <!-- ChangeDeviceDontPropagateList -->
+
+  <request name="ChangeDeviceDontPropagateList" opcode="8">
+    <field type="WINDOW" name="window" />
+    <field type="CARD16" name="num_classes" />
+    <field type="CARD8" name="mode" />
+    <pad bytes="1" />
+    <list type="EventClass" name="classes">
+      <fieldref>num_classes</fieldref>
+    </list>
+  </request>
+
+  <!-- GetDeviceDontPropagateList -->
+
+  <request name="GetDeviceDontPropagateList" opcode="9">
+    <field type="WINDOW" name="window" />
+    <request>
+      <pad bytes="1" />
+      <field type="CARD16" name="num_classes" />
+      <pad bytes="22" />
+      <list type="EventClass" name="classes">
+        <fieldref>num_classes</fieldref>
+      </list>
+    </request>
+  </request>
+
+  <!-- GetDeviceMotionEvents -->
+
+  <request name="GetDeviceMotionEvents" opcode="10">
+    <field type="TIMESTAMP" name="start" />
+    <field type="TIMESTAMP" name="stop" />
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD32" name="num_coords" />
+      <field type="CARD8" name="num_axes" />
+      <field type="CARD8" name="device_mode" />
+      <pad bytes="18" />
+      <!-- Uninterpreted: list of DeviceTimeCoord structures -->
+    </reply>
+  </request>
+
+  <struct name="DeviceTimeCoord">
+    <field type="TIMESTAMP" name="time" />
+    <!-- Uninterpreted: list of CARD16 -->
+  </struct>
+
+  <!-- ChangeKeyboardDevice -->
+  <request name="ChangeKeyboardDevice" opcode="11">
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </reply>
+  </request>
+
+  <!-- ChangePointerDevice -->
+
+  <request name="ChangePointerDevice" opcode="12">
+    <field type="CARD8" name="x_axis" />
+    <field type="CARD8" name="y_axis" />
+    <field type="CARD8" name="device_id" />
+    <request>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </request>
+  </request>
+
+  <!-- GrabDevice -->
+
+  <request name="GrabDevice" opcode="13">
+    <field type="WINDOW" name="grab_window" />
+    <field type="TIMESTAMP" name="time" />
+    <field type="CARD16" name="num_classes" />
+    <field type="CARD8" name="this_device_mode" />
+    <field type="CARD8" name="other_device_mode" />
+    <field type="BOOL" name="owner_events" />
+    <field type="CARD8" name="device_id" />
+    <pad bytes="2" />
+    <list type="EventClass" name="classes">
+      <fieldref>num_classes</fieldref>
+    </list>
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </reply>
+  </request>
+
+  <!-- UngrabDevice -->
+
+  <request name="UngrabDevice" opcode="14">
+    <field type="TIMESTAMP" name="time" />
+    <field type="CARD8" name="device_id" />
+  </request>
+
+  <!-- GrabDeviceKey -->
+
+  <request name="GrabDeviceKey" opcode="15">
+    <field type="WINDOW" name="grab_window" />
+    <field type="CARD16" name="num_classes" />
+    <field type="CARD16" name="modifiers" />
+    <field type="CARD8" name="modifier_device" />
+    <field type="CARD8" name="grabbed_device" />
+    <field type="CARD8" name="key" />
+    <field type="CARD8" name="this_device_mode" />
+    <field type="CARD8" name="other_device_mode" />
+    <field type="BOOL" name="owner_events" />
+    <pad bytes="2" />
+    <list type="EventClass" name="classes">
+      <fieldref>num_classes</fieldref>
+    </list>
+  </request>
+
+  <!-- UngrabDeviceKey -->
+
+  <request name="UngrabDeviceKey" opcode="16">
+    <field type="WINDOW" name="grabWindow" />
+    <field type="CARD16" name="modifiers" />
+    <field type="CARD8" name="modifier_device" />
+    <field type="CARD8" name="key" />
+    <field type="CARD8" name="grabbed_device" />
+  </request>
+
+  <!-- GrabDeviceButton -->
+
+  <request name="GrabDeviceButton" opcode="17">
+    <field type="WINDOW" name="grab_window" />
+    <field type="CARD8" name="grabbed_device" />
+    <field type="CARD8" name="modifier_device" />
+    <field type="CARD16" name="num_classes" />
+    <field type="CARD16" name="modifiers" />
+    <field type="CARD8" name="this_device_mode" />
+    <field type="CARD8" name="other_device_mode" />
+    <field type="CARD8" name="button" />
+    <field type="CARD8" name="owner_events" />
+    <pad bytes="2" />
+    <list type="EventClass" name="classes">
+      <fieldref>num_classes</fieldref>
+    </list>
+  </request>
+
+  <!-- UngrabDeviceButton -->
+
+  <request name="UngrabDeviceButton" opcode="18">
+    <field type="WINDOW" name="grab_window" />
+    <field type="CARD16" name="modifiers" />
+    <field type="CARD8" name="modifier_device" />
+    <field type="CARD8" name="button" />
+    <field type="CARD8" name="grabbed_device" />
+  </request>
+
+  <!-- AllowDeviceEvents -->
+
+  <request name="AllowDeviceEvents" opcode="19">
+    <field type="TIMESTAMP" name="time" />
+    <field type="CARD8" name="mode" />
+    <field type="CARD8" name="device_id" />
+  </request>
+
+  <!-- GetDeviceFocus -->
+
+  <request name="GetDeviceFocus" opcode="20">
+    <field type="CARD8" name="device_id" />
+    <request>
+      <pad bytes="1" />
+      <field type="WINDOW" name="focus" />
+      <field type="TIMESTAMP" name="time" />
+      <field type="CARD8" name="revert_to" />
+    </request>
+  </request>
+
+  <!-- SetDeviceFocus -->
+
+  <request name="SetDeviceFocus" opcode="21">
+    <field type="WINDOW" name="focus" />
+    <field type="TIMESTAMP" name="time" />
+    <field type="CARD8" name="revert_to" />
+    <field type="CARD8" name="device_id" />
+  </request>
+
+  <!-- GetFeedbackControl -->
+
+  <request name="GetFeedbackControl" opcode="22">
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="num_feedback" />
+      <pad bytes="22" />
+      <!-- Uninterpreted: list of FeedbackState structures -->
+    </reply>
+  </request>
+
+  <struct name="FeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+  </struct>
+    
+  <struct name="KbdFeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD16" name="pitch" />
+    <field type="CARD16" name="duration" />
+    <field type="CARD32" name="led_mask" />
+    <field type="CARD32" name="led_values" />
+    <field type="BOOL" name="global_auto_repeat" />
+    <field type="CARD8" name="click" />
+    <field type="CARD8" name="percent" />
+    <pad bytes="1" />
+    <list type="CARD8" name="auto_repeats"><value>31</value></list>
+    </struct>
+
+  <struct name="PtrFeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <pad bytes="2" />
+    <field type="CARD16" name="accel_num" />
+    <field type="CARD16" name="accel_denom" />
+    <field type="CARD16" name="threshold" />
+  </struct>
+
+  <struct name="IntegerFeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD32" name="resolution" />
+    <field type="INT32" name="min_value" />
+    <field type="INT32" name="max_value" />
+  </struct>
+
+  <struct name="StringFeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD32" name="len" />
+    <field type="CARD16" name="max_symbols" />
+    <field type="CARD16" name="num_keysyms" />
+    <list type="KEYSYM" name="keysyms">
+      <fieldref>num_keysyms</fieldref>
+    </list>
+  </struct>
+
+  <struct name="BellFeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD8" name="percent" />
+    <pad bytes="3" />
+    <field type="CARD16" name="pitch" />
+    <field type="CARD16" name="duration" />
+  </struct>
+
+  <struct name="LedFeedbackState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD32" name="led_mask" />
+    <field type="CARD32" name="led_values" />
+  </struct>
+
+  <!-- ChangeFeedbackControl -->
+
+  <request name="ChangeFeedbackControl" opcode="23">
+    <field type="CARD32" name="mask" />
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="feedback_id" />
+    <!-- Uninterpreted: list of FeedbackCtl structures -->
+  </request>
+
+  <struct name="FeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+  </struct>
+
+  <struct name="KbdFeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="KeyCode" name="key" />
+    <field type="CARD8" name="auto_repeat_mode" />
+    <field type="INT8" name="key_click_percent" />
+    <field type="INT8" name="bell_percent" />
+    <field type="INT16" name="bell_pitch" />
+    <field type="INT16" name="bell_duration" />
+    <field type="CARD32" name="led_mask" />
+    <field type="CARD32" name="led_values" />
+  </struct>
+
+  <struct name="PtrFeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <pad bytes="2" />
+    <field type="INT16" name="num" />
+    <field type="INT16" name="denom" />
+    <field type="INT16" name="threshold" />
+  </struct>
+
+  <struct name="IntegerFeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="INT32" name="int_to_display" />
+  </struct>
+
+  <struct name="StringFeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <pad bytes="2" />
+    <field type="CARD16" name="num_keysyms" />
+    <list type="KEYSYM" name="keysyms">
+      <fieldref>num_keysyms</fieldref>
+    </list>
+  </struct>
+
+  <struct name="BellFeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="INT8" name="percent" />
+    <pad bytes="3" />
+    <field type="INT16" name="pitch" />
+    <field type="INT16" name="duration" />
+  </struct>
+
+  <struct name="LedFeedbackCtl">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD32" name="led_mask" />
+    <field type="CARD32" name="led_values" />
+  </struct>
+
+  <!-- GetDeviceKeyMapping -->
+
+  <request name="GetDeviceKeyMapping" opcode="24">
+    <field type="CARD8" name="device_id" />
+    <field type="KeyCode" name="first_keycode" />
+    <field type="CARD8" name="count" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="keysyms_per_keycode" />
+      <pad bytes="23" />
+      <!-- Uninterpreted: list of KEYSYM structures -->
+    </reply>
+  </request>
+
+  <!-- ChangeDeviceKeyMapping -->
+
+  <request name="ChangeDeviceKeyMapping" opcode="25">
+    <field type="CARD8" name="device_id" />
+    <field type="KeyCode" name="first_keycode" />
+    <field type="CARD8" name="keysyms_per_keycode" />
+    <field type="CARD8" name="keycode_count" />
+    <list type="KEYSYM" name="keysyms">
+      <op op="*">
+        <fieldref>keycode_count</fieldref>
+        <fieldref>keysyms_per_keycode</fieldref>
+      </op>
+    </list>
+  </request>
+
+  <!-- GetDeviceModifierMapping -->
+
+  <request name="GetDeviceModifierMapping" opcode="26">
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="keycodes_per_modifier" />
+      <pad bytes="23" />
+      <list type="CARD8" name="keymaps">
+        <op op="*">
+          <fieldref>keycodes_per_modifier</fieldref>
+          <value>8</value>
+        </op>
+      </list>
+    </reply>
+  </request>
+
+  <!-- SetDeviceModifierMapping -->
+
+  <request name="SetDeviceModifierMapping" opcode="27">
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="keycodes_per_modifier" />
+    <pad bytes="1" />
+    <list type="CARD8" name="keymaps">
+      <op op="*">
+        <fieldref>keycodes_per_modifier</fieldref>
+        <value>8</value>
+      </op>
+    </list>
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </reply>
+  </request>
+
+  <!-- GetDeviceButtonMapping -->
+
+  <request name="GetDeviceButtonMapping" opcode="28">
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="map_size" />
+      <pad bytes="23" />
+      <list type="CARD8" name="map">
+        <fieldref>map_size</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <!-- SetDeviceButtonMapping -->
+
+  <request name="SetDeviceButtonMapping" opcode="29">
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="map_size" />
+    <pad bytes="2" />
+    <list type="CARD8" name="map">
+      <fieldref>map_size</fieldref>
+    </list>
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </reply>
+  </request>
+
+  <!-- QueryDeviceState -->
+
+  <request name="QueryDeviceState" opcode="30">
+    <field type="CARD8" name="device_id" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="num_classes" />
+      <pad bytes="23" />
+      <!-- Uninterpreted: list of InputState structures -->
+    </reply>
+  </request>
+
+  <struct name="InputState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="CARD8" name="num_items" />
+  </struct>
+
+  <struct name="KeyState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="CARD8" name="num_keys" />
+    <pad bytes="1" />
+    <list type="CARD8" name="keys">
+      <value>32</value>
+    </list>
+  </struct>
+
+  <struct name="ButtonState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="CARD8" name="num_buttons" />
+    <pad bytes="1" />
+    <list type="CARD8" name="buttons">
+      <value>32</value>
+    </list>
+  </struct>
+
+  <struct name="ValuatorState">
+    <field type="CARD8" name="class_id" />
+    <field type="CARD8" name="len" />
+    <field type="CARD8" name="num_valuators" />
+    <field type="CARD8" name="mode" />
+    <list type="CARD32" name="valuators">
+      <fieldref>num_valuators</fieldref>
+    </list>
+  </struct>
+
+  <!-- SendExtensionEvent -->
+
+  <request name="SendExtensionEvent" opcode="31">
+    <field type="WINDOW" name="destination" />
+    <field type="CARD8" name="device_id" />
+    <field type="BOOL" name="propagate" />
+    <field type="CARD16" name="num_classes" />
+    <field type="CARD8" name="num_events" />
+    <pad bytes="3" />
+    <list type="char" name="events">
+      <op op="*">
+	<fieldref>num_events</fieldref>
+	<value>32</value>
+      </op>
+    </list>
+    <list type="EventClass" name="classes">
+      <fieldref>num_classes</fieldref>
+    </list>
+  </request>
+
+  <!-- DeviceBell -->
+
+  <request name="DeviceBell" opcode="32">
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="feedback_id" />
+    <field type="CARD8" name="feedback_class" />
+    <field type="INT8" name="percent" />
+  </request>
+
+  <!-- SetDeviceValuators -->
+
+  <request name="SetDeviceValuators" opcode="33">
+    <field type="CARD8" name="device_id" />
+    <field type="CARD8" name="first_valuator" />
+    <field type="CARD8" name="num_valuators" />
+    <pad bytes="1" />
+    <list type="INT32" name="valuators">
+      <fieldref>num_valuators</fieldref>
+    </list>
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+    </reply>
+  </request>
+
+  <!-- GetDeviceControl -->
+
+  <request name="GetDeviceControl" opcode="34">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD8" name="device_id" />
+    <pad bytes="1" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD8" name="status" />
+      <!-- Uninterpreted: list of DeviceState structures -->
+    </reply>
+  </request>
+
+  <struct name="DeviceState">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD16" name="len" />
+  </struct>
+
+  <struct name="DeviceResolutionState">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD32" name="num_valuators" />
+    <list type="CARD32" name="resolution_values">
+      <fieldref>num_valuators</fieldref>
+    </list>
+    <list type="CARD32" name="resolution_min">
+      <fieldref>num_valuators</fieldref>
+    </list>
+    <list type="CARD32" name="resolution_max">
+      <fieldref>num_valuators</fieldref>
+    </list>
+  </struct>
+
+  <struct name="DeviceAbsCalibState">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD16" name="len" />
+    <field type="INT32" name="min_x" />
+    <field type="INT32" name="max_x" />
+    <field type="INT32" name="min_y" />
+    <field type="INT32" name="max_y" />
+    <field type="CARD32" name="flip_x" />
+    <field type="CARD32" name="flip_y" />
+    <field type="CARD32" name="rotation" />
+    <field type="CARD32" name="button_threshold" />
+  </struct>
+
+  <struct name="DeviceAbsAreaState">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD32" name="offset_x" />
+    <field type="CARD32" name="offset_y" />
+    <field type="CARD32" name="width" />
+    <field type="CARD32" name="height" />
+    <field type="CARD32" name="following" />
+  </struct>
+
+  <struct name="DeviceCoreState">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD8" name="status" />
+    <field type="CARD8" name="iscore" />
+    <pad bytes="2" />
+  </struct>
+
+  <struct name="DeviceEnableState">
+    <field type="CARD16" name="control_id" />
+    <field type="CARD16" name="len" />
+    <field type="CARD8" name="enable" />
+    <pad bytes="3" />
+  </struct>
+
+  <!-- ChangeDeviceControl -->
+
+    <request name="ChangeDeviceControl" opcode="35">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD8" name="device_id" />
+      <pad bytes="1" />
+      <!-- Uninterpreted: list of DeviceCtl structures -->
+      <reply>
+        <pad byte="1" />
+        <field type="CARD8" name="status" />
+        <pad bytes="23" />
+      </reply>
+    </request>
+
+    <struct name="DeviceCtl">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD16" name="len" />
+    </struct>
+
+    <struct name="DeviceResolutionCtl">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD16" name="len" />
+      <field type="CARD8" name="first_valuator" />
+      <field type="CARD8" name="num_valuators" />
+      <list type="CARD32" name="resolution_values">
+	<fieldref>num_valuators</fieldref>
+      </list>
+      <pad bytes="2" />
+    </struct>
+
+    <struct name="DeviceAbsCalibCtl">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD16" name="len" />
+      <field type="INT32" name="min_x" />
+      <field type="INT32" name="max_x" />
+      <field type="INT32" name="min_y" />
+      <field type="INT32" name="max_y" />
+      <field type="CARD32" name="flip_x" />
+      <field type="CARD32" name="flip_y" />
+      <field type="CARD32" name="rotation" />
+      <field type="CARD32" name="button_threshold" />
+    </struct>
+
+    <struct name="DeviceAbsAreaCtrl">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD16" name="len" />
+      <field type="CARD32" name="offset_x" />
+      <field type="CARD32" name="offset_y" />
+      <field type="INT32" name="width" />
+      <field type="INT32" name="height" />
+      <field type="INT32" name="screen" />
+      <field type="CARD32" name="following" />
+    </struct>
+
+    <struct name="DeviceCoreCtrl">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD16" name="len" />
+      <field type="CARD8" name="status" />
+      <pad bytes="3" />
+    </struct>
+
+    <struct name="DeviceEnableCtrl">
+      <field type="CARD16" name="control_id" />
+      <field type="CARD16" name="len" />
+      <field type="CARD8" name="enable" />
+      <pad bytes="3" />
+    </struct>
+
+    <!-- EVENTS --> 
+
+    <event name="DeviceValuator" number="0">
+      <field type="CARD8" name="device_id" />
+      <field type="CARD16" name="device_state" />
+      <field type="CARD8" name="num_valuators" />
+      <field type="CARD8" name="first_valuator" />
+      <list type="INT32" name="valuators"><value>6</value></list>
+    </event>
+
+    <event name="DeviceKeyPress" number="1">
+      <field type="BYTE" name="detail" />
+      <field type="TIMESTAMP" name="time" />
+      <field type="WINDOW" name="root" />
+      <field type="WINDOW" name="event" />
+      <field type="WINDOW" name="child" />
+      <field type="INT16" name="root_x" />
+      <field type="INT16" name="root_y" />
+      <field type="INT16" name="event_x" />
+      <field type="INT16" name="event_y" />
+      <field type="CARD16" name="state" />
+      <field type="BOOL" name="same_screen" />
+      <field type="CARD8" name="device_id" />
+    </event>
+
+    <eventcopy name="DeviceKeyRelease" number="2" ref="DeviceKeyPress" />
+    <eventcopy name="DeviceButtonPress" number="3" ref="DeviceKeyPress" />
+    <eventcopy name="DeviceButtonRelease" number="4" ref="DeviceKeyPress" />
+    <eventcopy name="DeviceMotionNotify" number="5" ref="DeviceKeyPress" />
+    <eventcopy name="ProximityIn" number="8" ref="DeviceKeyPress" />
+    <eventcopy name="ProximityOut" number="9" ref="DeviceKeyPress" />
+
+    <event name="FocusIn" number="6">
+      <field type="BYTE" name="detail" />
+      <field type="TIMESTAMP" name="time" />
+      <field type="WINDOW" name="window" />
+      <field type="BYTE" name="mode" />
+      <field type="CARD8" name="device_id" />
+    </event>
+
+    <eventcopy name="FocusOut" number="7" ref="DeviceKeyPress" />
+
+    <event name="DeviceStateNotify" number="10">
+      <field type="BYTE" name="device_id" />
+      <field type="TIMESTAMP" name="time" />
+      <field type="CARD8" name="num_keys" />
+      <field type="CARD8" name="num_buttons" />
+      <field type="CARD8" name="num_valuators" />
+      <field type="CARD8" name="classes_reported" />
+      <list type="CARD8" name="buttons">
+        <value>4</value>
+      </list>
+      <list type="CARD8" name="keys">
+        <value>4</value>
+      </list>
+      <list type="CARD32" name="valuators">
+	<value>3</value>
+      </list>
+    </event>
+
+    <event name="DeviceMappingNotify" number="11">
+      <field type="BYTE" name="device_id" />
+      <field type="CARD8" name="request" />
+      <field type="KeyCode" name="first_keycode" />
+      <field type="CARD8" name="count" />
+      <pad bytes="1" />
+      <field type="TIMESTAMP" name="time" />
+    </event>
+
+    <event name="ChangeDeviceNotify" number="12">
+      <field type="BYTE" name="device_id" />
+      <field type="TIMESTAMP" name="time" />
+      <field type="CARD8" name="request" />
+    </event>
+
+    <event name="DeviceKeyStateNotify" number="13">
+      <field type="BYTE" name="device_id" />
+      <list type="CARD8" name="keys">
+        <value>28</value>
+      </list>
+    </event>
+
+    <event name="DeviceButtonStateNotify" number="14">
+      <field type="BYTE" name="device_id" />
+      <list type="CARD8" name="buttons">
+        <value>28</value>
+      </list>
+    </event>
+
+    <event name="DevicePresenceNotify" number="15">
+        <pad bytes="1" />
+        <field type="TIMESTAMP" name="time" />
+        <field type="BYTE" name="devchange" />
+        <field type="BYTE" name="device_id" />
+        <field type="CARD16" name="control" />
+    </event>
+</xcb>
diff --git a/src/xselinux.xml b/src/xselinux.xml
new file mode 100644
index 0000000..f09f26d
--- /dev/null
+++ b/src/xselinux.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright (C) 2007 Xavier Toth (txtoth at gmail.com)
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the names of the authors or their
+institutions shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization from the authors.
+-->
+<xcb header="xselinux" extension-xname="SELinux" extension-name="SELinux"
+     extension-oneword="true" major-version="1" minor-version="0">
+  <import>xproto</import>
+
+  <request name="QueryVersion" opcode="0">
+    <field type="CARD8" name="client_major" />
+    <field type="CARD8" name="client_minor" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="server_major" />
+      <field type="CARD16" name="server_minor" />
+    </reply>
+  </request>
+
+  <request name="SetSelectionManager" opcode="1">
+    <field type="WINDOW" name="owner" />
+  </request>
+
+  <request name="GetSelectionManager" opcode="2">
+    <reply>
+      <pad bytes="1" />
+      <field type="WINDOW" name="owner" />
+    </reply>
+  </request>
+
+  <request name="SetDeviceCreateContext" opcode="3">
+    <field type="BOOL" name="is_permanent" />
+    <pad bytes="1" />
+    <field type="CARD16" name="context_len" />
+    <list type="char" name="context">
+      <fieldref>context_len</fieldref>
+    </list>
+  </request>
+
+  <request name="GetDeviceCreateContext" opcode="4">
+    <reply>
+      <field type="BOOL" name="is_permanent" />
+      <field type="CARD16" name="context_len" />
+      <pad bytes="22" />
+      <list type="char" name="context">
+	<fieldref>context_len</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <request name="SetDeviceContext" opcode="5">
+    <field type="CARD32" name="device" />
+    <pad bytes="2" />
+    <field type="CARD16" name="context_len" />
+    <list type="char" name="context">
+      <fieldref>context_len</fieldref>
+    </list>
+  </request>
+
+  <request name="GetDeviceContext" opcode="6">
+    <field type="CARD32" name="device" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="context_len" />
+      <pad bytes="22" />
+      <list type="char" name="context">
+	<fieldref>context_len</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <request name="SetPropertyCreateContext" opcode="7">
+    <field type="BOOL" name="is_permanent" />
+    <pad bytes="1" />
+    <field type="CARD16" name="context_len" />
+    <list type="char" name="context">
+      <fieldref>context_len</fieldref>
+    </list>
+  </request>
+
+  <request name="GetPropertyCreateContext" opcode="8">
+    <reply>
+      <field type="BOOL" name="is_permanent" />
+      <field type="CARD16" name="context_len" />
+      <pad bytes="22" />
+      <list type="char" name="context">
+	<fieldref>context_len</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <request name="GetPropertyContext" opcode="9">
+    <field type="WINDOW" name="window" />
+    <field type="ATOM" name="property" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="context_len" />
+      <pad bytes="22" />
+      <list type="char" name="context">
+	<fieldref>context_len</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <request name="SetWindowCreateContext" opcode="10">
+    <field type="BOOL" name="is_permanent" />
+    <pad bytes="1" />
+    <field type="CARD16" name="context_len" />
+    <list type="char" name="context">
+      <fieldref>context_len</fieldref>
+    </list>
+  </request>
+
+  <request name="GetWindowCreateContext" opcode="11">
+    <reply>
+      <field type="BOOL" name="is_permanent" />
+      <field type="CARD16" name="context_len" />
+      <pad bytes="22" />
+      <list type="char" name="context">
+	<fieldref>context_len</fieldref>
+      </list>
+    </reply>
+  </request>
+
+  <request name="GetWindowContext" opcode="12">
+    <pad bytes="1" />
+    <field type="WINDOW" name="window" />
+    <reply>
+      <pad bytes="1" />
+      <field type="CARD16" name="context_len" />
+      <pad bytes="22" />
+      <list type="char" name="context">
+	<fieldref>context_len</fieldref>
+      </list>
+    </reply>
+  </request>
+</xcb>


-- 
Eamon Walsh <ewalsh at tycho.nsa.gov>
National Security Agency



More information about the Xcb mailing list