[xcb] dpms: Add DPMSInfoNotify event

Submitted by Alexander Volkov on Oct. 2, 2018, 1:10 p.m.

Details

Message ID 20181002131038.17564-3-avolkov@astralinux.ru
State New
Series "Add DPMSInfoNotify event"
Headers show

Commit Message

Alexander Volkov Oct. 2, 2018, 1:10 p.m.
From: Alexander Volkov <a.volkov@rusbitech.ru>

See the description in xorgproto repository.

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
---
 src/dpms.xml | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/dpms.xml b/src/dpms.xml
index 5581284..51decb7 100644
--- a/src/dpms.xml
+++ b/src/dpms.xml
@@ -26,7 +26,8 @@  sale, use or other dealings in this Software without prior written
 authorization from the authors.
 -->
 <xcb header="dpms" extension-xname="DPMS" extension-name="DPMS"
-    major-version="0" minor-version="0">
+    major-version="1" minor-version="2">
+  <import>xproto</import>
   <request name="GetVersion" opcode="0">
     <field type="CARD16" name="client_major_version" />
     <field type="CARD16" name="client_minor_version" />
@@ -84,4 +85,20 @@  authorization from the authors.
       <pad bytes="21" />
     </reply>
   </request>
+
+  <enum name="EventMask" >
+    <item name="InfoNotify"> <bit>0</bit> </item>
+  </enum>
+
+  <request name="SelectInput" opcode="8">
+    <field type="CARD32" name="event_mask" mask="EventMask"/>
+  </request>
+
+  <event name="InfoNotify" number="0">
+    <pad bytes="1" />
+    <field type="TIMESTAMP" name="timestamp"/>
+    <field type="CARD16" name="power_level" enum="DPMSMode" />
+    <field type="BOOL" name="state" />
+    <pad bytes="21"/>
+  </event>
 </xcb>

Comments

Alexander Volkov Oct. 2, 2018, 2:20 p.m.
Oh, sorry for sending it twice.

See the test program in the attachment.
It can be compiled by gcc -o dpmsnotify dpmsnotify.c -lxcb -lxcb-dpms