[xorgproto,v2] Add DPMSInfoNotify event

Submitted by Alexander Volkov on Oct. 2, 2018, 5:01 p.m.

Details

Message ID 20181002170146.31120-1-avolkov@astralinux.ru
State New
Headers show
Series "Add DPMSInfoNotify event" ( rev: 7 ) in X.org

Not browsing as part of any series.

Commit Message

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

This allows applications to respond to changes of power level
of a monitor, e.g. an application may stop rendering and related
calculations when the monitor is off.

Bump DPMS version to 1.2.

v2: add it as generic event

Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
---
 include/X11/extensions/dpmsconst.h |  5 ++++-
 include/X11/extensions/dpmsproto.h | 26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/include/X11/extensions/dpmsconst.h b/include/X11/extensions/dpmsconst.h
index 75f0586..f46d2d9 100644
--- a/include/X11/extensions/dpmsconst.h
+++ b/include/X11/extensions/dpmsconst.h
@@ -30,7 +30,7 @@  Equipment Corporation.
 #define _DPMSCONST_H 1
 
 #define DPMSMajorVersion	1
-#define DPMSMinorVersion	1
+#define DPMSMinorVersion	2
 
 #define DPMSExtensionName	"DPMS"
 
@@ -39,5 +39,8 @@  Equipment Corporation.
 #define DPMSModeSuspend	2
 #define DPMSModeOff	3
 
+#define DPMSInfoNotifyMask	(1L << 0)
+#define DPMSInfoNotify		0
+
 #endif /* !_DPMSCONST_H */
 
diff --git a/include/X11/extensions/dpmsproto.h b/include/X11/extensions/dpmsproto.h
index 63fd3fc..5d1aeec 100644
--- a/include/X11/extensions/dpmsproto.h
+++ b/include/X11/extensions/dpmsproto.h
@@ -39,6 +39,7 @@  Equipment Corporation.
 #define X_DPMSDisable		5
 #define X_DPMSForceLevel       	6
 #define X_DPMSInfo       	7
+#define X_DPMSSelectInput	8
 
 #define DPMSNumberEvents	0
 
@@ -172,4 +173,29 @@  typedef struct {
 } xDPMSInfoReply;
 #define sz_xDPMSInfoReply 32
 
+typedef struct {
+    CARD8	reqType;	/* always DPMSCode */
+    CARD8	dpmsReqType;	/* always X_DPMSSelectInput */
+    CARD16	length B16;
+    CARD32	eventMask B32;
+} xDPMSSelectInputReq;
+#define sz_xDPMSSelectInputReq 8
+
+typedef struct {
+    CARD8	type;
+    CARD8	extension;
+    CARD16	sequenceNumber B16;
+    CARD32	length;
+    CARD16	evtype B16;
+    CARD16	pad0 B16;
+    Time	timestamp B32;
+    CARD16	power_level B16;
+    BOOL	state;
+    CARD8	pad1;
+    CARD32	pad2 B32;
+    CARD32	pad3 B32;
+    CARD32	pad4 B32;
+} xDPMSInfoNotifyEvent;
+#define sz_xDPMSInfoNotifyEvent 32
+
 #endif /* _DPMSPROTO_H_ */