Commit 564d18c8 authored by Alexander Volkov's avatar Alexander Volkov Committed by Alexander Volkov

Add DPMSInfoNotify event

This will allow 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, install dpmsproto.pc.
Signed-off-by: Alexander Volkov's avatarAlexander Volkov <a.volkov@rusbitech.ru>
parent 03290962
......@@ -48,6 +48,9 @@ dmx_HEADERS = \
dmxprotopkgconfigdir = $(datadir)/pkgconfig
dmxprotopkgconfig_DATA = dmxproto.pc
dpmsprotopkgconfigdir = $(datadir)/pkgconfig
dpmsprotopkgconfig_DATA = dpmsproto.pc
dri2dir = $(includedir)/X11/extensions
dri2_HEADERS = \
include/X11/extensions/dri2proto.h \
......
......@@ -110,6 +110,7 @@ AC_CONFIG_FILES([applewmproto.pc
compositeproto.pc
damageproto.pc
dmxproto.pc
dpmsproto.pc
dri2proto.pc
dri3proto.pc
evieproto.pc
......
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
Name: DPMSProto
Description: DPMS extension headers
Version: 1.2
Cflags: -I${includedir}
......@@ -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 */
......@@ -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_ */
......@@ -29,6 +29,7 @@ pcs = [
['compositeproto', '0.4.2'],
['damageproto', '1.2.1'],
['dmxproto', '2.3.1'],
['dpmsproto', '1.2'],
['dri2proto', '2.8'],
['dri3proto', '1.2'],
['fixesproto', '5.0'],
......
......@@ -175,7 +175,7 @@ increment for small, upward-compatible changes. Servers that support the
protocol defined in this document will return a
<emphasis remap='I'>server_major_version</emphasis>
of one (1), and a <emphasis remap='I'>server_minor_version</emphasis>
of one (1).
of two (2).
</para>
<para>
......@@ -435,13 +435,81 @@ of DPMSModeOn, DPMSModeStandby, DPMSModeSuspend or DPMSModeOff, otherwise
it is undefined.
</para>
<para>
<olink targetdoc='dpmslib' targetptr='DPMSSelectInput'><function>DPMSSelectInput</function></olink>
</para>
<informaltable frame="none">
<?dbfo keep-together="always" ?>
<tgroup cols='1' align='left' colsep='0' rowsep='0'>
<colspec colname='c1' colwidth="1.0*"/>
<tbody>
<row>
<entry>
<emphasis remap='I'>event_mask</emphasis>: CARD32
</entry>
</row>
<row>
<entry>=&gt;</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
This request specifies whether DPMS extension events should be generated for this client.
If DPMSInfoNotifyMask is set in <emphasis remap='I'>event-mask</emphasis>, then DPMSInfoNotifyEvent
events will be generated whenever the current DPMS on/off state or power level changes.
If no bits are set, then no events will be generated.
</para>
</chapter>
<chapter id="Events_and_Errors">
<title>Events and Errors</title>
<chapter id="Events">
<title>Events</title>
<para>
The DPMS extension adds one event:
</para>
<para>
No new events or errors are defined by this extension.
<function>DPMSInfoNotifyEvent</function>
</para>
<informaltable frame="none">
<?dbfo keep-together="always" ?>
<tgroup cols='1' align='left' colsep='0' rowsep='0'>
<colspec colname='c1' colwidth="1.0*"/>
<tbody>
<row>
<entry>
<emphasis remap='I'>timestamp</emphasis>: TIMESTAMP
</entry>
</row>
<row>
<entry>
<emphasis remap='I'>power_level</emphasis>: CARD16
</entry>
</row>
<row>
<entry>
<emphasis remap='I'>state</emphasis>: BOOL
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
This event is delivered to clients that have requested
DPMSInfoNotifyMask events using the <function>DPMSSelectInput</function> request
whenever the current DPMS on/off state or power level changes.
<emphasis remap='I'>state</emphasis> is one of DPMSEnabled or DPMSDisabled.
If <emphasis remap='I'>state</emphasis> is DPMSEnabled,
<emphasis remap='I'>power_level</emphasis> is one
of DPMSModeOn, DPMSModeStandby, DPMSModeSuspend or DPMSModeOff, otherwise
it is undefined.
</para>
</chapter>
<chapter id="Encoding">
......@@ -563,5 +631,33 @@ The name of this extension is "DPMS".
21 unused
</literallayout>
<literallayout class="monospaced">
<olink targetdoc='dpmslib' targetptr='DPMSSelectInput'><function>DPMSSelectInput</function></olink>
1 CARD8 opcode
1 8 DPMS opcode
2 2 request length
4 event mask
0 no events
1 DPMSInfoNotifyMask
</literallayout>
<literallayout class="monospaced">
<olink targetdoc='dpmslib' targetptr='DPMSInfoNotifyEvent'><function>DPMSInfoNotifyEvent</function></olink>
1 GenericEvent type
1 CARD8 DPMS extension offset
2 CARD16 sequence number
4 0 length
2 DPMSInfoNotify evtype
2 unused
4 TIMESTAMP timestamp
2 power_level
0 DPMSModeOn
1 DPMSModeStandby
2 DPMSModeSuspend
3 DPMSModeOff
1 BOOL state
13 unused
</literallayout>
</chapter>
</book>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment