1ea1d6981Smrg<?xml version="1.0" encoding="UTF-8" ?>
2ea1d6981Smrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3ea1d6981Smrg                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
4ea1d6981Smrg[
5ea1d6981Smrg<!ENTITY % defs SYSTEM "defs.ent"> %defs;
6ea1d6981Smrg]>
7ea1d6981Smrg
8ea1d6981Smrg<book id="saver">
9ea1d6981Smrg
10ea1d6981Smrg<bookinfo>
11ea1d6981Smrg   <title>X11 Screen Saver Extension</title>
12ea1d6981Smrg   <subtitle>MIT X Consortium Proposed Standard</subtitle>
13ea1d6981Smrg   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
14ea1d6981Smrg   <releaseinfo>Version 1.0</releaseinfo>
15ea1d6981Smrg   <authorgroup>
16ea1d6981Smrg     <author>
17ea1d6981Smrg      <firstname>Jim</firstname><surname>Fulton</surname>
18ea1d6981Smrg      <affiliation><orgname>Network Computing Devices, Inc</orgname></affiliation>
19ea1d6981Smrg     </author>
20ea1d6981Smrg     <author>
21ea1d6981Smrg      <firstname>Keith</firstname><surname>Packard</surname>
22ea1d6981Smrg      <affiliation><orgname>
23ea1d6981SmrgX Consortium, Laboratory for Computer Science, Massachusetts Institute of Technology
24ea1d6981Smrg      </orgname></affiliation>
25ea1d6981Smrg     </author>
26ea1d6981Smrg   </authorgroup>
27ea1d6981Smrg
28ea1d6981Smrg   <copyright><year>1992</year>
29ea1d6981Smrg     <holder>Massachusetts Institute of Technology</holder>
30ea1d6981Smrg     <holder>Network Computing Devices, Inc</holder>
31ea1d6981Smrg   </copyright>
32ea1d6981Smrg
33ea1d6981Smrg
34ea1d6981Smrg<legalnotice>
35ea1d6981Smrg<para>
36ea1d6981SmrgPermission to use, copy, modify, and distribute this documentation for any
37ea1d6981Smrgpurpose and without fee is hereby granted, provided that the above copyright
38ea1d6981Smrgnotice and this permission notice appear in all copies.  MIT and
39ea1d6981SmrgNetwork Computing Devices, Inc. make no
40ea1d6981Smrgrepresentations about the suitability for any purpose of the information in
41ea1d6981Smrgthis document.  This documentation is provided "as is" without express or
42ea1d6981Smrgimplied warranty.
43ea1d6981Smrg</para>
44ea1d6981Smrg
45ea1d6981Smrg</legalnotice>
46ea1d6981Smrg</bookinfo>
47ea1d6981Smrg
48ea1d6981Smrg<chapter id='Introduction'>
49ea1d6981Smrg<title>Introduction</title>
50ea1d6981Smrg<para>
51ea1d6981SmrgThe X Window System provides support for changing the image on a display screen
52ea1d6981Smrgafter a user-settable period of inactivity to avoid burning the cathode ray
53ea1d6981Smrgtube phosphors.  However, no interfaces are provided for the user to control
54ea1d6981Smrgthe image that is drawn.  This extension allows an external "screen saver"
55ea1d6981Smrgclient to detect when the alternate image is to be displayed and to provide the
56ea1d6981Smrggraphics.
57ea1d6981Smrg</para>
58ea1d6981Smrg<para>
59ea1d6981SmrgCurrent X server implementations typically provide at least one form of
60ea1d6981Smrg"screen saver" image.  Historically, this has been a copy of the X logo
61ea1d6981Smrgdrawn against the root background pattern.  However, many users have asked
62ea1d6981Smrgfor the mechanism to allow them to write screen saver programs that provide
63ea1d6981Smrgcapabilities similar to those provided by other window systems.  In
64ea1d6981Smrgparticular, such users often wish to be able to display corporate logos,
65ea1d6981Smrginstructions on how to reactivate the screen, and automatic screen-locking
66ea1d6981Smrgutilities.  This extension provides a means for writing such clients.
67ea1d6981Smrg</para>
68ea1d6981Smrg</chapter>
69ea1d6981Smrg
70ea1d6981Smrg<chapter id="Assumptions">
71ea1d6981Smrg<title>Assumptions</title>
72ea1d6981Smrg<para>
73ea1d6981SmrgThis extension exports the notion of a special screen saver window that is
74ea1d6981Smrgmapped above all other windows on a display.  This window has the
75ea1d6981Smrg<emphasis remap='I'>override-redirect</emphasis> attribute set so that it is not subject to manipulation by
76ea1d6981Smrgthe window manager.  Furthermore, the X identifier for the window is never
77ea1d6981Smrgreturned by <function>QueryTree</function> requests on the root window, so it is typically
78ea1d6981Smrgnot visible to other clients.
79ea1d6981Smrg</para>
80ea1d6981Smrg</chapter>
81ea1d6981Smrg
82ea1d6981Smrg<chapter id="Overview">
83ea1d6981Smrg<title>Overview</title>
84ea1d6981Smrg<para>
85ea1d6981SmrgThe core
86ea1d6981Smrg<function>SetScreenSaver</function>
87ea1d6981Smrgrequest can be used to set the length of time without
88ea1d6981Smrgactivity on any input devices after which the screen saver should "activate"
89ea1d6981Smrgand alter the image on the screen.  This image periodically "cycles" to
90ea1d6981Smrgreduce
91ea1d6981Smrgthe length of time that any particular pixel is illuminated.  Finally, the
92ea1d6981Smrgscreen saver is "deactivated" in response to activity on any of the input
93ea1d6981Smrgdevices
94ea1d6981Smrgor particular X requests.
95ea1d6981Smrg</para>
96ea1d6981Smrg
97ea1d6981Smrg<para>
98ea1d6981SmrgScreen saving is typically done by disabling video output to the display tube
99ea1d6981Smrgor by drawing a changing pattern onto the display.  If the server chooses the
100ea1d6981Smrglatter approach, a window with a special identifier is created and mapped at
101ea1d6981Smrgthe top of the stacking order where it remains until the screen saver
102ea1d6981Smrgdeactivates.  At this time, the window is unmapped and is not accessible to any
103ea1d6981Smrgclient requests.
104ea1d6981Smrg</para>
105ea1d6981Smrg<para>
106d63b911fSmrgThe server's default mechanism is referred to as the <emphasis remap='I'>internal</emphasis> screen
107ea1d6981Smrgsaver.  An <emphasis remap='I'>external</emphasis>
108ea1d6981Smrgscreen saver client requires a means of determining the window
109ea1d6981Smrgid for the screen saver window and setting the attributes (e.g. size,
110ea1d6981Smrglocation, visual, colormap) to be used when the window is mapped.  These
111ea1d6981Smrgrequirements form the basis of this extension.
112ea1d6981Smrg</para>
113ea1d6981Smrg</chapter>
114ea1d6981Smrg
115ea1d6981Smrg<chapter id="Issues">
116ea1d6981Smrg<title>Issues</title>
117ea1d6981Smrg<para>
118ea1d6981SmrgThis extension raises several interesting issues.  First is the question of
119ea1d6981Smrgwhat should be done if some other client has the server grabbed when the screen
120ea1d6981Smrgsaver is supposed to activate?  This commonly occurs with window managers that
121ea1d6981Smrgautomatically ask the user to position a window when it is first mapped by
122ea1d6981Smrggrabbing the server and drawing XORed lines on the root window.
123ea1d6981Smrg</para>
124ea1d6981Smrg<para>
125ea1d6981SmrgSecond, a screen saver program must control the actual RGB values sent to the
126ea1d6981Smrgdisplay tube to ensure that the values change periodically to avoid phosphor
127ea1d6981Smrgburn in.  Thus, the client must have a known colormap installed whenever the
128ea1d6981Smrgscreen saver window is displayed.  To prevent screen flashing, the visual type
129d63b911fSmrgof the screen saver window should also be controllable.
130ea1d6981Smrg</para>
131ea1d6981Smrg<para>
132ea1d6981SmrgThird, some implementations may wish to destroy the screen saver window when
133ea1d6981Smrgit is not mapped so that it need not be avoided during event delivery.  Thus,
134ea1d6981Smrgscreen saver clients may find that the requests that reference the screen
135ea1d6981Smrgsaver window may fail when the window is not displayed.
136ea1d6981Smrg</para>
137ea1d6981Smrg</chapter>
138ea1d6981Smrg
139ea1d6981Smrg<chapter id="Protocol">
140ea1d6981Smrg<title>Protocol</title>
141ea1d6981Smrg<para>
142ea1d6981SmrgThe Screen Saver extension is as follows:
143ea1d6981Smrg</para>
144ea1d6981Smrg
145ea1d6981Smrg<sect1 id="Types">
146ea1d6981Smrg<title>Types</title>
147ea1d6981Smrg<para>
148d63b911fSmrgIn addition to the common types described in the core protocol, the following
149ea1d6981Smrgtype is used in the request and event definitions in subsequent sections.
150ea1d6981Smrg</para>
151ea1d6981Smrg
152ea1d6981Smrg<informaltable frame="topbot">
153ea1d6981Smrg  <?dbfo keep-together="always" ?>
154ea1d6981Smrg  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
155ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
156ea1d6981Smrg  <colspec colname='c2' colwidth="1.5*"/>
157ea1d6981Smrg  <thead>
158ea1d6981Smrg    <row rowsep='1'>
159ea1d6981Smrg      <entry>Name</entry>
160ea1d6981Smrg      <entry>Value</entry>
161ea1d6981Smrg    </row>
162ea1d6981Smrg  </thead>
163ea1d6981Smrg  <tbody>
164ea1d6981Smrg    <row>
165ea1d6981Smrg      <entry>SCREENSAVEREVENT</entry>
166ea1d6981Smrg      <entry><emphasis role="bold">ScreenSaverNotify</emphasis>,
167ea1d6981Smrg      <emphasis role="bold">ScreenSaverCycle</emphasis></entry>
168ea1d6981Smrg    </row>
169ea1d6981Smrg  </tbody>
170ea1d6981Smrg  </tgroup>
171ea1d6981Smrg</informaltable>
172ea1d6981Smrg</sect1>
173ea1d6981Smrg
174ea1d6981Smrg<sect1 id="Errors">
175ea1d6981Smrg<title>Errors</title>
176ea1d6981Smrg<para>
177ea1d6981SmrgThe Screen Saver extension adds no errors beyond the core protocol.
178ea1d6981Smrg</para>
179ea1d6981Smrg</sect1>
180ea1d6981Smrg
181ea1d6981Smrg<sect1 id="Requests">
182ea1d6981Smrg<title>Requests</title>
183ea1d6981Smrg<para>
184ea1d6981SmrgThe Screen Saver extension adds the following requests:
185ea1d6981Smrg</para>
186ea1d6981Smrg
187ea1d6981Smrg<literallayout>
188ea1d6981Smrg<emphasis role="bold">ScreenSaverQueryVersion</emphasis>
189ea1d6981Smrg     client-major-version: CARD8
190ea1d6981Smrg     client-minor-version: CARD8
191ea1d6981Smrg->
192ea1d6981Smrg     server-major-version: CARD8
193ea1d6981Smrg     server-minor-version: CARD8
194ea1d6981Smrg</literallayout>
195ea1d6981Smrg
196ea1d6981Smrg<para>
197ea1d6981SmrgThis request allows the client and server to determine which version of
198ea1d6981Smrgthe protocol should be used.  The client sends the version that it
199ea1d6981Smrgprefers; if the server understands that
200ea1d6981Smrgversion, it returns the same values and interprets subsequent requests
201ea1d6981Smrgfor this extension according to the specified version.  Otherwise,
202ea1d6981Smrgthe server returns the closest version of the protocol that it can
203ea1d6981Smrgsupport and interprets subsequent requests according to that version.
204ea1d6981SmrgThis document describes major version 1, minor version 0; the major
205ea1d6981Smrgand minor revision numbers should only be incremented in response to
206ea1d6981Smrgincompatible and compatible changes, respectively.
207ea1d6981Smrg</para>
208ea1d6981Smrg
209ea1d6981Smrg<literallayout>
210ea1d6981Smrg<emphasis role="bold">ScreenSaverQueryInfo</emphasis>
211ea1d6981Smrg<emphasis>drawable</emphasis> DRAWABLE
212ea1d6981Smrg
213ea1d6981Smrgsaver-window: WINDOW
214ea1d6981Smrgstate: {<emphasis role="bold">Disabled</emphasis>, <emphasis role="bold">Off</emphasis>, <emphasis role="bold">On</emphasis>}
215ea1d6981Smrgkind: {<emphasis role="bold">Blanked</emphasis>, <emphasis role="bold">Internal</emphasis>, <emphasis role="bold">External</emphasis>}
216ea1d6981Smrgtil-or-since: CARD32
217ea1d6981Smrgidle: CARD32
218ea1d6981Smrgevent-mask: SETofSCREENSAVEREVENT
219ea1d6981Smrg
220ea1d6981SmrgErrors: <emphasis role="bold">Drawable</emphasis>
221ea1d6981Smrg</literallayout>
222ea1d6981Smrg
223ea1d6981Smrg<para>
224ea1d6981SmrgThis request returns information about the state of the screen
225ea1d6981Smrgsaver on the screen associated with <emphasis remap='I'>drawable</emphasis>.  The <emphasis remap='I'>saver-window</emphasis>
226ea1d6981Smrgis the XID that is associated with the screen saver window.  This
227ea1d6981Smrgwindow is not guaranteed to exist
228ea1d6981Smrgexcept when external screen saver is active.  Although it is a
229ea1d6981Smrgchild of the root, this window is not returned by
230ea1d6981Smrg<function>QueryTree</function>
231ea1d6981Smrgrequests on the root.  Whenever this window is mapped, it is always above
232ea1d6981Smrgany of its siblings in the stacking order.  XXX - TranslateCoords?
233ea1d6981Smrg</para>
234ea1d6981Smrg<para>
235ea1d6981SmrgThe <emphasis remap='I'>state</emphasis> field specifies whether or not the screen saver is currently
236d63b911fSmrgactive and how the <emphasis remap='I'>til-or-since</emphasis> value should be interpreted:
237ea1d6981Smrg</para>
238ea1d6981Smrg
239ea1d6981Smrg<informaltable frame="none">
240ea1d6981Smrg  <?dbfo keep-together="always" ?>
241ea1d6981Smrg  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
242ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
243ea1d6981Smrg  <colspec colname='c2' colwidth="5.0*"/>
244ea1d6981Smrg  <tbody>
245ea1d6981Smrg    <row>
246ea1d6981Smrg      <entry><emphasis role="bold">Off</emphasis></entry>
247ea1d6981Smrg      <entry>
248ea1d6981SmrgThe screen is not currently being saved;
249ea1d6981Smrg<emphasis remap='I'>til-or-since</emphasis>
250ea1d6981Smrgspecifies the number of milliseconds until the screen saver is expected to
251ea1d6981Smrgactivate.
252ea1d6981Smrg      </entry>
253ea1d6981Smrg    </row>
254ea1d6981Smrg    <row>
255ea1d6981Smrg      <entry><emphasis role="bold">On</emphasis></entry>
256ea1d6981Smrg      <entry>
257ea1d6981SmrgThe screen is currently being saved;
258ea1d6981Smrg<emphasis remap='I'>til-or-since</emphasis> specifies
259ea1d6981Smrgthe number of milliseconds since the screen saver activated.
260ea1d6981Smrg      </entry>
261ea1d6981Smrg    </row>
262ea1d6981Smrg    <row>
263ea1d6981Smrg      <entry><emphasis role="bold">Disabled</emphasis></entry>
264ea1d6981Smrg      <entry>
265ea1d6981SmrgThe screen saver is currently disabled;
266ea1d6981Smrg<emphasis remap='I'>til-or-since</emphasis> is zero.
267ea1d6981Smrg      </entry>
268ea1d6981Smrg    </row>
269ea1d6981Smrg  </tbody>
270ea1d6981Smrg  </tgroup>
271ea1d6981Smrg</informaltable>
272ea1d6981Smrg
273ea1d6981Smrg<para>
274ea1d6981SmrgThe <emphasis remap='I'>kind</emphasis> field specifies the mechanism that either is currently being
275ea1d6981Smrgused or would have been were the screen being saved:
276ea1d6981Smrg</para>
277ea1d6981Smrg
278ea1d6981Smrg<informaltable frame="none">
279ea1d6981Smrg  <?dbfo keep-together="always" ?>
280ea1d6981Smrg  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
281ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
282ea1d6981Smrg  <colspec colname='c2' colwidth="5.0*"/>
283ea1d6981Smrg  <tbody>
284ea1d6981Smrg    <row>
285ea1d6981Smrg      <entry><emphasis role="bold">Blanked</emphasis></entry>
286ea1d6981Smrg      <entry>The video signal to the display monitor was disabled.</entry>
287ea1d6981Smrg    </row>
288ea1d6981Smrg    <row>
289ea1d6981Smrg      <entry><emphasis role="bold">Internal</emphasis></entry>
290ea1d6981Smrg      <entry>A server-dependent, built-in screen saver image was displayed; either no
291ea1d6981Smrg      client had set the screen saver window attributes or a different client
292ea1d6981Smrg      had the server grabbed when the screen saver activated.</entry>
293ea1d6981Smrg    </row>
294ea1d6981Smrg    <row>
295ea1d6981Smrg      <entry><emphasis role="bold">External</emphasis></entry>
296ea1d6981Smrg      <entry>The screen saver window was mapped with attributes set by a
297ea1d6981Smrg      client using the <function>ScreenSaverSetAttributes</function> request.</entry>
298ea1d6981Smrg    </row>
299ea1d6981Smrg  </tbody>
300ea1d6981Smrg  </tgroup>
301ea1d6981Smrg</informaltable>
302ea1d6981Smrg
303ea1d6981Smrg<para>
304ea1d6981SmrgThe <emphasis remap='I'>idle</emphasis> field specifies the number of milliseconds since the last
305ea1d6981Smrginput was received from the user on any of the input devices.
306ea1d6981Smrg</para>
307ea1d6981Smrg
308ea1d6981Smrg<para>
309ea1d6981SmrgThe <emphasis remap='I'>event-mask</emphasis> field specifies which, if any, screen saver
310ea1d6981Smrgevents this client has requested using <function>ScreenSaverSelectInput</function>.
311ea1d6981Smrg</para>
312ea1d6981Smrg
313ea1d6981Smrg<para>
314ea1d6981SmrgIf <emphasis remap='I'>drawable</emphasis> is not a valid drawable identifier, a Drawable
315ea1d6981Smrgerror is returned and the request is ignored.
316ea1d6981Smrg</para>
317ea1d6981Smrg
318ea1d6981Smrg<literallayout>
319ea1d6981Smrg<emphasis role="bold">ScreenSaverSelectInput</emphasis>
320ea1d6981Smrgdrawable: DRAWABLE
321ea1d6981Smrgevent-mask: SETofSCREENSAVEREVENT
322ea1d6981Smrg</literallayout>
323ea1d6981Smrg
324ea1d6981Smrg<para>
325ea1d6981SmrgErrors:
326ea1d6981Smrg<emphasis role="bold">Drawable</emphasis>,
327ea1d6981Smrg<emphasis role="bold">Match</emphasis>
328ea1d6981Smrg</para>
329ea1d6981Smrg
330ea1d6981Smrg<para>
331ea1d6981SmrgThis request specifies which Screen Saver extension events on the screen
332ea1d6981Smrgassociated with <emphasis remap='I'>drawable</emphasis> should be generated for this client.  If
333ea1d6981Smrgno bits are set in <emphasis remap='I'>event-mask</emphasis>, then no events will be generated.
334ea1d6981SmrgOtherwise, any combination of the following bits may be set:
335ea1d6981Smrg</para>
336ea1d6981Smrg
337ea1d6981Smrg<informaltable frame="none">
338ea1d6981Smrg  <?dbfo keep-together="always" ?>
339ea1d6981Smrg  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
340ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
341ea1d6981Smrg  <colspec colname='c2' colwidth="3.0*"/>
342ea1d6981Smrg  <tbody>
343ea1d6981Smrg    <row>
344ea1d6981Smrg      <entry><emphasis role="bold">ScreenSaverNotify</emphasis></entry>
345ea1d6981Smrg      <entry>
346ea1d6981SmrgIf this bit is set, <emphasis role="bold">ScreenSaverNotify</emphasis> events are generated whenever
347ea1d6981Smrgthe screen saver is activated or deactivated.
348ea1d6981Smrg      </entry>
349ea1d6981Smrg    </row>
350ea1d6981Smrg    <row>
351ea1d6981Smrg      <entry><emphasis role="bold">ScreenSaverCycle</emphasis></entry>
352ea1d6981Smrg      <entry>
353ea1d6981SmrgIf this bit is set, <emphasis role="bold">ScreenSaverNotify</emphasis> events are generated whenever
354ea1d6981Smrgthe screen saver cycle interval passes.
355ea1d6981Smrg      </entry>
356ea1d6981Smrg    </row>
357ea1d6981Smrg  </tbody>
358ea1d6981Smrg  </tgroup>
359ea1d6981Smrg</informaltable>
360ea1d6981Smrg
361ea1d6981Smrg<para>
362ea1d6981SmrgIf <emphasis remap='I'>drawable</emphasis> is not a valid drawable identifier, a Drawable
363ea1d6981Smrgerror is returned.  If any undefined bits are set in <emphasis remap='I'>event-mask</emphasis>,
364ea1d6981Smrga Value error is returned.  If an error is returned,
365ea1d6981Smrgthe request is ignored.
366ea1d6981Smrg</para>
367ea1d6981Smrg
368ea1d6981Smrg<para>
369ea1d6981Smrg<emphasis role="bold">ScreenSaverSetAttributes</emphasis>
370ea1d6981Smrg</para>
371ea1d6981Smrg<literallayout>
372ea1d6981Smrgdrawable: DRAWABLE
373ea1d6981Smrgclass:
374ea1d6981Smrg{<emphasis role="bold">InputOutput</emphasis>, <emphasis role="bold">InputOnly</emphasis>, <emphasis role="bold">CopyFromParent</emphasis>}
375ea1d6981Smrgdepth: CARD8
376ea1d6981Smrgvisual: VISUALID or <emphasis role="bold">CopyFromParent</emphasis>
377ea1d6981Smrgx, y: INT16
378ea1d6981Smrgwidth, height, border-width: CARD16
379ea1d6981Smrgvalue-mask: BITMASK
380ea1d6981Smrgvalue-list: LISTofVALUE
381ea1d6981Smrg
382ea1d6981Smrg<emphasis role="bold">Access</emphasis>, <emphasis role="bold">Window</emphasis>, <emphasis role="bold">Pixmap</emphasis>, <emphasis role="bold">Colormap</emphasis>, <emphasis role="bold">Cursor</emphasis>, <emphasis role="bold">Match</emphasis>, <emphasis role="bold">Value</emphasis>, <emphasis role="bold">Alloc</emphasis>
383ea1d6981Smrg</literallayout>
384ea1d6981Smrg
385ea1d6981Smrg<para>
386ea1d6981SmrgThis request sets the attributes that this client would like to see
387ea1d6981Smrgused in creating the screen saver window on the screen associated
388ea1d6981Smrgwith <emphasis remap='I'>drawable</emphasis>.  If another client currently has the attributes set,
389ea1d6981Smrgan Access error is generated and the request is ignored.
390ea1d6981Smrg</para>
391ea1d6981Smrg
392ea1d6981Smrg<para>
393ea1d6981SmrgOtherwise, the specified window attributes are checked as if
394ea1d6981Smrgthey were used in a core <function>CreateWindow</function> request whose
395ea1d6981Smrgparent is the root.  The <emphasis remap='I'>override-redirect</emphasis> field is ignored as
396ea1d6981Smrgit is implicitly set to True.  If the window attributes result in an
397ea1d6981Smrgerror according to the rules for <function>CreateWindow</function>, the request is ignored.
398ea1d6981Smrg</para>
399ea1d6981Smrg<para>
400ea1d6981SmrgOtherwise, the attributes are stored and will take effect on the next
401ea1d6981Smrgactivation that occurs when the server is not grabbed by another client.
402ea1d6981SmrgAny resources specified for the
403ea1d6981Smrg<emphasis remap='I'>background-pixmap</emphasis> or <emphasis remap='I'>cursor</emphasis> attributes may be
404ea1d6981Smrgfreed immediately.  The server is free to copy the <emphasis remap='I'>background-pixmap</emphasis>
405ea1d6981Smrgor <emphasis remap='I'>cursor</emphasis> resources or to use them in place; therefore, the effect of
406ea1d6981Smrgchanging the contents of those resources is undefined.  If the
407ea1d6981Smrgspecified <emphasis remap='I'>colormap</emphasis> no longer exists when the screen saver activates,
408ea1d6981Smrgthe parent's colormap is used instead.  If no errors are generated by this
409ea1d6981Smrgrequest, any previous
410ea1d6981Smrgscreen saver window attributes set by this client are released.
411ea1d6981Smrg</para>
412ea1d6981Smrg<para>
413ea1d6981SmrgWhen the screen saver next activates and the server is not grabbed by
414ea1d6981Smrganother client, the screen saver window is
415ea1d6981Smrgcreated, if necessary, and set to the specified attributes and events
416ea1d6981Smrgare generated as usual.  The colormap
417ea1d6981Smrgassociated with the screen saver window is
418ea1d6981Smrginstalled.  Finally, the screen saver window is mapped.
419ea1d6981Smrg</para>
420ea1d6981Smrg<para>
421ea1d6981SmrgThe window remains mapped and at the top of the stacking order
422ea1d6981Smrguntil the screen saver is deactivated in response to activity on
423ea1d6981Smrgany of the user input devices, a <function>ForceScreenSaver</function> request with
424ea1d6981Smrga value of Reset, or any request that would cause the window to be
425ea1d6981Smrgunmapped.
426ea1d6981Smrg</para>
427ea1d6981Smrg<para>
428ea1d6981SmrgIf the screen saver activates while the server is grabbed by another
429ea1d6981Smrgclient, the internal saver mechanism is used.  The <function>ForceScreenSaver</function>
430ea1d6981Smrgrequest may be used with a value of Active to
431ea1d6981Smrgdeactivate the internal saver and activate the external saver.
432ea1d6981Smrg</para>
433ea1d6981Smrg<para>
434ea1d6981SmrgIf the screen saver client's connection to the server is broken
435ea1d6981Smrgwhile the screen saver is activated and the client's close down mode has not
436ea1d6981Smrgbeen RetainPermanent or RetainTemporary, the current screen saver
437ea1d6981Smrgis deactivated and the internal screen saver is immediately activated.
438ea1d6981Smrg</para>
439ea1d6981Smrg<para>
440ea1d6981SmrgWhen the screen saver deactivates, the screen saver window's colormap
441ea1d6981Smrgis uninstalled and the window is unmapped (except as described below).
442ea1d6981SmrgThe screen saver XID is disassociated
443ea1d6981Smrgwith the window and the server may, but is not required to,
444ea1d6981Smrgdestroy the window along with any children.
445ea1d6981Smrg</para>
446ea1d6981Smrg<para>
447ea1d6981SmrgWhen the screen saver is being deactivated and then immediately
448ea1d6981Smrgreactivated (such as when switching screen savers), the server
449ea1d6981Smrgmay leave the screen saver window mapped (typically to avoid
450ea1d6981Smrggenerating exposures).
451ea1d6981Smrg</para>
452ea1d6981Smrg
453ea1d6981Smrg<para>
454ea1d6981Smrg<emphasis role="bold">ScreenSaverUnsetAttributes</emphasis>
455ea1d6981Smrg</para>
456ea1d6981Smrg
457ea1d6981Smrg<literallayout>
458ea1d6981Smrg<emphasis>drawble</emphasis>: <emphasis role="bold">DRAWABLE</emphasis>
459ea1d6981Smrg
460ea1d6981SmrgErrors: <emphasis role="bold">Drawable</emphasis>
461ea1d6981Smrg</literallayout>
462ea1d6981Smrg
463ea1d6981Smrg<para>
464ea1d6981SmrgThis request notifies the server that this client no longer
465ea1d6981Smrgwishes to control the screen saver window.  Any screen saver
466ea1d6981Smrgattributes set by this client and any descendents of the screen
467ea1d6981Smrgsaver window created by this client should be released
468ea1d6981Smrgimmediately if the screen saver is not active, else upon
469ea1d6981Smrgdeactivation.
470ea1d6981Smrg</para>
471ea1d6981Smrg<para>
472ea1d6981SmrgThis request is ignored if the client has not previously set the screen saver
473ea1d6981Smrgwindow attributes.
474ea1d6981Smrg</para>
475ea1d6981Smrg</sect1>
476ea1d6981Smrg
477ea1d6981Smrg<sect1 id="Events">
478ea1d6981Smrg<title>Events</title>
479ea1d6981Smrg<para>
480ea1d6981SmrgThe Screen Saver extension adds one event:
481ea1d6981Smrg</para>
482ea1d6981Smrg<para>
483ea1d6981Smrg<emphasis role="bold">ScreenSaverNotify</emphasis>
484ea1d6981Smrg</para>
485ea1d6981Smrg
486ea1d6981Smrg<literallayout>
487ea1d6981Smrg<emphasis role="bold">root</emphasis>: WINDOW
488ea1d6981Smrg<emphasis role="bold">window</emphasis>: WINDOW
489ea1d6981Smrg<emphasis role="bold">state</emphasis>: {<emphasis role="bold">Off</emphasis>, <emphasis role="bold">On</emphasis>, <emphasis role="bold">Cycle</emphasis>}
490ea1d6981Smrg<emphasis role="bold">kind</emphasis>: { <emphasis role="bold">Blanked</emphasis>, <emphasis role="bold">Internal</emphasis> , <emphasis role="bold">External</emphasis> }
491ea1d6981Smrg<emphasis role="bold">forced</emphasis>: BOOL
492ea1d6981Smrg<emphasis role="bold">time</emphasis>: TIMESTAMP
493ea1d6981Smrg</literallayout>
494ea1d6981Smrg<para>
495ea1d6981SmrgThis event is delivered to clients that have requested
496ea1d6981SmrgScreenSaverNotify events using the <function>ScreenSaverSelectInput</function> request
497ea1d6981Smrgwhenever the screen saver activates or deactivates.
498ea1d6981Smrg</para>
499ea1d6981Smrg<para>
500ea1d6981SmrgThe <emphasis remap='I'>root</emphasis> field specifies root window of the screen for
501ea1d6981Smrgwhich the event was generated.  The <emphasis remap='I'>window</emphasis> field specifies
502ea1d6981Smrgthe value that is returned by <function>ScreenSaverQueryInfo</function> as
503ea1d6981Smrgthe identifier for the screen saver window.  This window is not
504ea1d6981Smrgrequired to exist if the external screen saver is not active.
505ea1d6981Smrg</para>
506ea1d6981Smrg<para>
507ea1d6981SmrgThe <emphasis remap='I'>state</emphasis> field specifies the cause of the event:
508ea1d6981Smrg</para>
509ea1d6981Smrg
510ea1d6981Smrg<informaltable frame="none">
511ea1d6981Smrg  <?dbfo keep-together="always" ?>
512ea1d6981Smrg  <tgroup cols='2' align='left' colsep='0' rowsep='0'>
513ea1d6981Smrg  <colspec colname='c1' colwidth="1.0*"/>
514ea1d6981Smrg  <colspec colname='c2' colwidth="5.0*"/>
515ea1d6981Smrg  <tbody>
516ea1d6981Smrg    <row>
517ea1d6981Smrg      <entry><emphasis role="bold">Off</emphasis></entry>
518ea1d6981Smrg      <entry>
519ea1d6981SmrgThe screen saver deactivated; this event is sent if the client has set the
520ea1d6981SmrgScreenSaverNotify bit in its event mask.
521ea1d6981Smrg      </entry>
522ea1d6981Smrg    </row>
523ea1d6981Smrg    <row>
524ea1d6981Smrg      <entry><emphasis role="bold">On</emphasis></entry>
525ea1d6981Smrg      <entry>
526ea1d6981SmrgThe screen saver activated.  This event is sent if the client has set the
527ea1d6981SmrgScreenSaverNotify bit in its event mask.
528ea1d6981Smrg      </entry>
529ea1d6981Smrg    </row>
530ea1d6981Smrg    <row>
531ea1d6981Smrg      <entry><emphasis role="bold">Cycle</emphasis></entry>
532ea1d6981Smrg      <entry>
533ea1d6981SmrgThe cycle interval passed and the client is expected to change the image on
534ea1d6981Smrgthe screen.  This event is sent if the client has set the
535ea1d6981SmrgScreenSaverCycle bit in its event mask.
536ea1d6981Smrg      </entry>
537ea1d6981Smrg    </row>
538ea1d6981Smrg  </tbody>
539ea1d6981Smrg  </tgroup>
540ea1d6981Smrg</informaltable>
541ea1d6981Smrg
542ea1d6981Smrg<para>
543ea1d6981SmrgIf <emphasis remap='I'>state</emphasis> is set to
544ea1d6981Smrg<emphasis role="bold">On </emphasis> or
545ea1d6981Smrg<emphasis role="bold">Off</emphasis>
546ea1d6981Smrgthen <emphasis remap='I'>forced</emphasis> indicates whether or not
547ea1d6981Smrgactivation or deactivation was caused by a core
548ea1d6981Smrg<function>ForceScreenSaver</function>
549ea1d6981Smrgrequest; otherwise, <emphasis remap='I'>forced</emphasis> is set to False.
550ea1d6981Smrg</para>
551ea1d6981Smrg
552ea1d6981Smrg<para>
553ea1d6981SmrgThe <emphasis remap='I'>kind</emphasis> field specifies mechanism that was used to save the screen
554ea1d6981Smrgwhen the screen saver was activated, as described in
555ea1d6981Smrg<function>ScreenSaverQueryInfo</function>.
556ea1d6981Smrg</para>
557ea1d6981Smrg
558ea1d6981Smrg<para>
559ea1d6981SmrgThe <emphasis remap='I'>time</emphasis> field indicates the server time
560ea1d6981Smrgwhen the event was generated.
561ea1d6981Smrg</para>
562ea1d6981Smrg</sect1>
563ea1d6981Smrg</chapter>
564ea1d6981Smrg
565ea1d6981Smrg<chapter id="Encoding">
566ea1d6981Smrg<title>Encoding</title>
567ea1d6981Smrg<para>
568ea1d6981SmrgPlease refer to the X11 Protocol Encoding document as this document uses
569ea1d6981Smrgconventions established there.
570ea1d6981Smrg</para>
571ea1d6981Smrg<para>
572ea1d6981SmrgThe name of this extension is "SCREEN-SAVER".
573ea1d6981Smrg</para>
574ea1d6981Smrg
575ea1d6981Smrg<sect1 id="Common_Types">
576ea1d6981Smrg<title>Common Types</title>
577ea1d6981Smrg<literallayout class="monospaced">
578ea1d6981SmrgSETofSCREENSAVEREVENT
579ea1d6981Smrg     #x00000001     ScreenSaverNotifyMask
580ea1d6981Smrg     #x00000002     ScreenSaverCycleMask
581ea1d6981Smrg</literallayout>
582ea1d6981Smrg</sect1>
583ea1d6981Smrg
584ea1d6981Smrg<sect1 id="Requests_2">
585ea1d6981Smrg<title>Requests</title>
586ea1d6981Smrg<literallayout class="monospaced">
587ea1d6981Smrg<emphasis role="bold">ScreenSaverQueryVersion</emphasis>
588ea1d6981Smrg1     CARD8                   screen saver opcode
589ea1d6981Smrg1     0                       minor opcode
590ea1d6981Smrg2     2                       request length
591ea1d6981Smrg1     CARD8                   client major version
592ea1d6981Smrg1     CARD8                   client minor version
593ea1d6981Smrg2                             unused
594ea1d6981Smrg->
595ea1d6981Smrg1     1                       Reply
596ea1d6981Smrg1                             unused
597ea1d6981Smrg2     CARD16                  sequence number
598ea1d6981Smrg4     0                       reply length
599ea1d6981Smrg1     CARD8                   server major version
600ea1d6981Smrg1     CARD8                   server minor version
601ea1d6981Smrg22                            unused
602ea1d6981Smrg
603ea1d6981Smrg<emphasis role="bold">ScreenSaverQueryInfo</emphasis>
604ea1d6981Smrg1     CARD8                   screen saver opcode
605ea1d6981Smrg1     1                       minor opcode
606ea1d6981Smrg2     2                       request length
607ea1d6981Smrg4     DRAWABLE                drawable associated with screen
608ea1d6981Smrg->
609ea1d6981Smrg1     1                       Reply
610ea1d6981Smrg1     CARD8                   state
611ea1d6981Smrg      0          Off
612ea1d6981Smrg      1          On
613ea1d6981Smrg      3          Disabled
614ea1d6981Smrg2     CARD16                  sequence number
615ea1d6981Smrg4     0                       reply length
616ea1d6981Smrg4     WINDOW                  saver window
617ea1d6981Smrg4     CARD32                  milliseconds until saver or since saver
618ea1d6981Smrg4     CARD32                  milliseconds since last user device input
619ea1d6981Smrg4     SETofSCREENSAVEREVENT   event mask
620ea1d6981Smrg1     CARD8                   kind
621ea1d6981Smrg      0          Blanked
622ea1d6981Smrg      1          Internal
623ea1d6981Smrg      2          External
624ea1d6981Smrg10               unused
625ea1d6981Smrg
626ea1d6981Smrg<emphasis role="bold">ScreenSaverSelectInput</emphasis>
627ea1d6981Smrg1     CARD8                   screen saver opcode
628ea1d6981Smrg1     2                       minor opcode
629ea1d6981Smrg2     3                       request length
630ea1d6981Smrg4     DRAWABLE                drawable associated with screen
631ea1d6981Smrg4     SETofSCREENSAVEREVENT   event mask
632ea1d6981Smrg
633ea1d6981Smrg<emphasis role="bold">ScreenSaverSetAttributes</emphasis>
634ea1d6981Smrg1     CARD8                   screen saver opcode
635ea1d6981Smrg1     3                       minor opcode
636ea1d6981Smrg2     6+n                     request length
637ea1d6981Smrg4     DRAWABLE                drawable associated with screen
638ea1d6981Smrg2     INT16                   x
639ea1d6981Smrg2     INT16                   y
640ea1d6981Smrg2     CARD16                  width
641ea1d6981Smrg2     CARD16                  height
642ea1d6981Smrg2     CARD16                  border-width
643ea1d6981Smrg1                             class
644ea1d6981Smrg      0          CopyFromParent
645ea1d6981Smrg      1          InputOutput
646ea1d6981Smrg      2          InputOnly
647ea1d6981Smrg1     CARD8                   depth
648ea1d6981Smrg4     VISUALID                visual
649ea1d6981Smrg      0          CopyFromParent
650ea1d6981Smrg4     BITMASK                 value-mask (has n bits set to 1)
651ea1d6981Smrg      encodings are the same as for core CreateWindow
652ea1d6981Smrg4n    LISTofVALUE             value-list
653ea1d6981Smrg      encodings are the same as for core CreateWindow
654ea1d6981Smrg
655ea1d6981Smrg<emphasis role="bold">ScreenSaverUnsetAttributes</emphasis>
656ea1d6981Smrg1     CARD8                   screen saver opcode
657ea1d6981Smrg1     4                       minor opcode
658ea1d6981Smrg2     3                       request length
659ea1d6981Smrg4     DRAWABLE                drawable associated with screen
660ea1d6981Smrg</literallayout>
661ea1d6981Smrg</sect1>
662ea1d6981Smrg
663ea1d6981Smrg<sect1 id="Events_2">
664ea1d6981Smrg<title>Events</title>
665ea1d6981Smrg
666ea1d6981Smrg<literallayout class="monospaced">
667ea1d6981Smrg<emphasis role="bold">ScreenSaverNotify</emphasis>
668ea1d6981Smrg1     CARD8                   code assigned by core
669ea1d6981Smrg1     CARD8                   state
670ea1d6981Smrg      0          Off
671ea1d6981Smrg      1          On
672ea1d6981Smrg      2          Cycle
673ea1d6981Smrg2     CARD16                  sequence number
674ea1d6981Smrg4     TIMESTAMP               time
675ea1d6981Smrg4     WINDOW                  root
676ea1d6981Smrg4     WINDOW                  screen saver window
677ea1d6981Smrg1     CARD8                   kind
678ea1d6981Smrg      0          Blanked
679ea1d6981Smrg      1          Internal
680ea1d6981Smrg      2          External
681ea1d6981Smrg1     BOOL                    forced
682ea1d6981Smrg14                            unused
683ea1d6981Smrg</literallayout>
684ea1d6981Smrg</sect1>
685ea1d6981Smrg</chapter>
686ea1d6981Smrg
687ea1d6981Smrg<chapter id='Inter_Client_Communications_Conventions'>
688ea1d6981Smrg<title>Inter-Client Communications Conventions</title>
689ea1d6981Smrg<para>
690ea1d6981SmrgScreen saver clients should create at least one resource value whose
691ea1d6981Smrgidentifier can be stored in a property named
692ea1d6981Smrg<emphasis role="bold">_SCREEN_SAVER_ID</emphasis>
693ea1d6981Smrgon the root of each screen it is managing.
694ea1d6981SmrgThis property should have one 32-bit value corresponding to the resource
695ea1d6981Smrgidentifier; the type of the property should indicate the type of the
696ea1d6981Smrgresource and should be one of the following:
697ea1d6981Smrg<emphasis role="bold">WINDOW</emphasis>,
698ea1d6981Smrg<emphasis role="bold">PIXMAP</emphasis>,
699ea1d6981Smrg<emphasis role="bold">CURSOR</emphasis>,
700ea1d6981Smrg<emphasis role="bold">FONT</emphasis>, or
701ea1d6981Smrg<emphasis role="bold">COLORMAP</emphasis>.
702ea1d6981Smrg</para>
703ea1d6981Smrg</chapter>
704ea1d6981Smrg
705ea1d6981Smrg<chapter id="C_language_binding">
706ea1d6981Smrg<title>C language binding</title>
707ea1d6981Smrg
708ea1d6981Smrg<para>
709ea1d6981SmrgThe C binding for this extension simply provide access to the protocol; they
710ea1d6981Smrgadd no semantics beyond what is described above.
711ea1d6981Smrg</para>
712ea1d6981Smrg
713ea1d6981Smrg<para>
714ea1d6981SmrgThe include file for this extension is
715ea1d6981Smrg<emphasis role="bold">&lt;X11/extensions/scrnsaver.h&gt;</emphasis>.
716ea1d6981Smrg</para>
717ea1d6981Smrg
718ea1d6981Smrg
719ea1d6981Smrg<funcsynopsis id='XScreenSaverQueryExtension'>
720ea1d6981Smrg<funcprototype>
721ea1d6981Smrg  <funcdef>Bool <function>XScreenSaverQueryExtension</function></funcdef>
722ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
723ea1d6981Smrg    <paramdef>int <parameter>*event_base</parameter></paramdef>
724ea1d6981Smrg    <paramdef>int <parameter>*error_base</parameter></paramdef>
725ea1d6981Smrg</funcprototype>
726ea1d6981Smrg</funcsynopsis>
727ea1d6981Smrg
728ea1d6981Smrg<para>
729ea1d6981SmrgThis routine returns
730ea1d6981Smrg<emphasis role="bold">True</emphasis>
731ea1d6981Smrgif the specified <emphasis remap='I'>display</emphasis> supports the
732ea1d6981SmrgSCREEN-SAVER extension; otherwise it returns
733ea1d6981Smrg<emphasis role="bold">False</emphasis>.
734ea1d6981SmrgIf the extension is supported, the event number for
735ea1d6981Smrg<function>ScreenSaverNotify</function>
736ea1d6981Smrgevents is returned in the value pointed to by
737ea1d6981Smrg<emphasis remap='I'>event_base</emphasis>.  Since
738ea1d6981Smrgno additional errors are defined by this extension, the results
739ea1d6981Smrgof <emphasis remap='I'>error_base</emphasis> are not defined.
740ea1d6981Smrg</para>
741ea1d6981Smrg
742ea1d6981Smrg<funcsynopsis id='XScreenSaverQueryVersion'>
743ea1d6981Smrg<funcprototype>
744ea1d6981Smrg  <funcdef>Status <function>XScreenSaverQueryVersion</function></funcdef>
745ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
746ea1d6981Smrg    <paramdef>int <parameter>*major</parameter></paramdef>
747ea1d6981Smrg    <paramdef>int <parameter>*minor</parameter></paramdef>
748ea1d6981Smrg</funcprototype>
749ea1d6981Smrg</funcsynopsis>
750ea1d6981Smrg
751ea1d6981Smrg<para>
752ea1d6981SmrgIf the specified <emphasis remap='I'>display</emphasis> supports the
753ea1d6981Smrgextension, the version numbers of the protocol
754ea1d6981Smrgexpected by the server are returned in
755ea1d6981Smrg<emphasis remap='I'>major</emphasis> and
756ea1d6981Smrg<emphasis remap='I'>minor</emphasis> and
757ea1d6981Smrga non-zero value is returned.  Otherwise, the arguments are not
758ea1d6981Smrgset and 0 is returned.
759ea1d6981Smrg</para>
760ea1d6981Smrg
761ea1d6981Smrg<para>XScreenSaverInfo *</para>
762ea1d6981Smrg<para>XScreenSaverAllocInfo()</para>
763ea1d6981Smrg
764ea1d6981Smrg<para>
765ea1d6981SmrgThis routine allocates and returns an
766ea1d6981Smrg<emphasis role="bold">XScreenSaverInfo</emphasis> structure
767ea1d6981Smrgfor use in calls to <xref linkend='XScreenSaverQueryInfo' xrefstyle='select: title'/>.
768ea1d6981SmrgAll fields in the
769ea1d6981Smrgstructure are initialized to zero.  If insufficient memory is available,
770ea1d6981SmrgNULL is returned.  The results of this routine can be released
771ea1d6981Smrgusing <olink targetdoc='libX11' targetptr='XFree'><function>XFree</function></olink>.
772ea1d6981Smrg</para>
773ea1d6981Smrg
774ea1d6981Smrg<funcsynopsis id='XScreenSaverQueryInfo'>
775ea1d6981Smrg<funcprototype>
776ea1d6981Smrg  <funcdef>Status <function>XScreenSaverQueryInfo</function></funcdef>
777ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
778ea1d6981Smrg    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
779ea1d6981Smrg    <paramdef>XScreenSaverInfo <parameter>*saver_info</parameter></paramdef>
780ea1d6981Smrg</funcprototype>
781ea1d6981Smrg</funcsynopsis>
782ea1d6981Smrg
783ea1d6981Smrg<para>
784ea1d6981SmrgIf the specified <emphasis remap='I'>display</emphasis> supports the extension,
785ea1d6981Smrginformation about the current state of the
786ea1d6981Smrgscreen server is returned in <emphasis remap='I'>saver_info</emphasis> and a non-zero value is
787ea1d6981Smrgreturned.  The <function>XScreenSaverInfo</function> structure is
788ea1d6981Smrgdefined as follows:
789ea1d6981Smrg</para>
790ea1d6981Smrg
791ea1d6981Smrg<literallayout class="monospaced">
792ea1d6981Smrgtypedef struct {
793ea1d6981Smrg    Window window;                /* screen saver window */
794ea1d6981Smrg    int state;                    /* ScreenSaver{Off,On,Disabled} */
795ea1d6981Smrg    int kind;                     /* ScreenSaver{Blanked,Internal,External} */
796ea1d6981Smrg    unsigned long til_or_since;   /* milliseconds */
797ea1d6981Smrg    unsigned long idle;           /* milliseconds */
798ea1d6981Smrg    unsigned long event_mask;     /* events */
799ea1d6981Smrg} XScreenSaverInfo;
800ea1d6981Smrg</literallayout>
801ea1d6981Smrg
802ea1d6981Smrg<para>
803ea1d6981SmrgSee the <function>ScreenSaverQueryInfo</function> request for a
804ea1d6981Smrgdescription of the fields.  If the extension is not supported,
805ea1d6981Smrg<emphasis remap='I'>saver_info</emphasis> is not changed and 0
806ea1d6981Smrgis returned.
807ea1d6981Smrg</para>
808ea1d6981Smrg
809ea1d6981Smrg<funcsynopsis id='XScreenSaverSelectInput'>
810ea1d6981Smrg<funcprototype>
811ea1d6981Smrg  <funcdef>void <function>XScreenSaverSelectInput</function></funcdef>
812ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
813ea1d6981Smrg    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
814ea1d6981Smrg    <paramdef>unsigned long <parameter>event_mask</parameter></paramdef>
815ea1d6981Smrg</funcprototype>
816ea1d6981Smrg</funcsynopsis>
817ea1d6981Smrg
818ea1d6981Smrg<para>
819ea1d6981SmrgIf the specified <emphasis remap='I'>display</emphasis> supports the extension,
820ea1d6981Smrgthis routine asks that events related to
821ea1d6981Smrgthe screen saver be generated for this client.
822ea1d6981SmrgThe format of the events generated is:
823ea1d6981Smrg</para>
824ea1d6981Smrg
825ea1d6981Smrg<literallayout class="monospaced">
826ea1d6981Smrgtypedef struct {
827ea1d6981Smrg    int type;               /* of event */
828ea1d6981Smrg    unsigned long serial;   /* # of last request processed by server */
829d63b911fSmrg    Bool send_event;        /* true if this came from a SendEvent request */
830ea1d6981Smrg    Display *display;       /* Display the event was read from */
831ea1d6981Smrg    Window window;          /* screen saver window */
832ea1d6981Smrg    Window root;            /* root window of event screen */
833ea1d6981Smrg    int state;              /* ScreenSaver{Off,On,Cycle} */
834ea1d6981Smrg    int kind;               /* ScreenSaver{Blanked,Internal,External} */
835ea1d6981Smrg    Bool forced;            /* extents of new region */
836ea1d6981Smrg    Time time;              /* event timestamp */
837ea1d6981Smrg} XScreenSaverNotifyEvent;
838ea1d6981Smrg</literallayout>
839ea1d6981Smrg
840ea1d6981Smrg<para>
841ea1d6981SmrgSee the definition of the
842ea1d6981Smrg<function>ScreenSaverSelectInput</function> request for descriptions
843ea1d6981Smrgof the allowed event masks.   <!-- xref ? -->
844ea1d6981Smrg</para>
845ea1d6981Smrg
846ea1d6981Smrg<funcsynopsis id='XScreenSaverSetAttributes'>
847ea1d6981Smrg<funcprototype>
848ea1d6981Smrg  <funcdef>void <function>XScreenSaverSetAttributes</function></funcdef>
849ea1d6981Smrg    <paramdef>Display <parameter>*dpy</parameter></paramdef>
850ea1d6981Smrg    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
851ea1d6981Smrg    <paramdef>int <parameter>x</parameter></paramdef>
852ea1d6981Smrg    <paramdef>int <parameter>y</parameter></paramdef>
853ea1d6981Smrg    <paramdef>unsigned int <parameter>width</parameter></paramdef>
854ea1d6981Smrg    <paramdef>unsigned int <parameter>height</parameter></paramdef>
855ea1d6981Smrg    <paramdef>unsigned int <parameter>border_width</parameter></paramdef>
856ea1d6981Smrg    <paramdef>int <parameter>depth</parameter></paramdef>
857ea1d6981Smrg    <paramdef>unsigned int <parameter>class</parameter></paramdef>
858ea1d6981Smrg    <paramdef>Visual <parameter>*visual</parameter></paramdef>
859ea1d6981Smrg    <paramdef>unsigned long <parameter>valuemask</parameter></paramdef>
860ea1d6981Smrg    <paramdef>XSetWindowAttributes <parameter>*attributes</parameter></paramdef>
861ea1d6981Smrg</funcprototype>
862ea1d6981Smrg</funcsynopsis>
863ea1d6981Smrg
864ea1d6981Smrg<para>
865ea1d6981SmrgIf the specified <emphasis remap='I'>display</emphasis> supports the
866ea1d6981Smrgextension, this routine sets the attributes to be used
867ea1d6981Smrgthe next time the external screen saver is activated.  See the definition
868ea1d6981Smrgof the <function>ScreenSaverSetAttributes</function> request for a
869ea1d6981Smrgdescription of each of the arguments.
870ea1d6981Smrg</para>
871ea1d6981Smrg
872ea1d6981Smrg<funcsynopsis id='XScreenSaverUnsetAttributes'>
873ea1d6981Smrg<funcprototype>
874ea1d6981Smrg  <funcdef>void <function>XScreenSaverUnsetAttributes</function></funcdef>
875ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
876ea1d6981Smrg    <paramdef>Drawable <parameter>drawable</parameter></paramdef>
877ea1d6981Smrg</funcprototype>
878ea1d6981Smrg</funcsynopsis>
879ea1d6981Smrg
880ea1d6981Smrg<para>
881ea1d6981SmrgIf the specified <emphasis remap='I'>display</emphasis> supports the
882ea1d6981Smrgextension, this routine instructs the server to discard
883ea1d6981Smrgany previous screen saver window attributes set by this client.
884ea1d6981Smrg</para>
885ea1d6981Smrg
886ea1d6981Smrg<funcsynopsis id='XScreenSaverRegister'>
887ea1d6981Smrg<funcprototype>
888ea1d6981Smrg  <funcdef>Status <function>XScreenSaverRegister</function></funcdef>
889ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
890ea1d6981Smrg    <paramdef>int <parameter>screen</parameter></paramdef>
891ea1d6981Smrg    <paramdef>XID <parameter>xid</parameter></paramdef>
892ea1d6981Smrg    <paramdef>Atom <parameter>type</parameter></paramdef>
893ea1d6981Smrg</funcprototype>
894ea1d6981Smrg</funcsynopsis>
895ea1d6981Smrg
896ea1d6981Smrg<para>
897ea1d6981SmrgThis routine stores the given <emphasis remap='I'>XID</emphasis> in the
898ea1d6981Smrg<emphasis role="bold">_SCREEN_SAVER_ID</emphasis> property (of the given
899ea1d6981Smrg<emphasis remap='I'>type</emphasis>) on the root window of the specified
900ea1d6981Smrg<emphasis remap='I'>screen</emphasis>.  It returns zero if an error
901ea1d6981Smrgis encountered and the property is not changed, otherwise it returns
902ea1d6981Smrgnon-zero.
903ea1d6981Smrg</para>
904ea1d6981Smrg
905ea1d6981Smrg<funcsynopsis id='XScreenSaverUnregister'>
906ea1d6981Smrg<funcprototype>
907ea1d6981Smrg  <funcdef>Status <function>XScreenSaverUnregister</function></funcdef>
908ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
909ea1d6981Smrg    <paramdef>int <parameter>screen</parameter></paramdef>
910ea1d6981Smrg</funcprototype>
911ea1d6981Smrg</funcsynopsis>
912ea1d6981Smrg
913ea1d6981Smrg<para>
914ea1d6981SmrgThis routine removes any <function>_SCREEN_SAVER_ID</function> from the
915ea1d6981Smrgroot window of the specified <emphasis remap='I'>screen</emphasis>.
916ea1d6981SmrgIt returns zero if an error is encountered and the property is changed,
917ea1d6981Smrgotherwise it returns non-zero.
918ea1d6981Smrg</para>
919ea1d6981Smrg
920ea1d6981Smrg<funcsynopsis id='XScreenSaverGetRegistered'>
921ea1d6981Smrg<funcprototype>
922ea1d6981Smrg  <funcdef>Status <function>XScreenSaverGetRegistered</function></funcdef>
923ea1d6981Smrg    <paramdef>Display <parameter>*display</parameter></paramdef>
924ea1d6981Smrg    <paramdef>int <parameter>screen</parameter></paramdef>
925ea1d6981Smrg    <paramdef>XID <parameter>*xid</parameter></paramdef>
926ea1d6981Smrg    <paramdef>ATOM <parameter>*type</parameter></paramdef>
927ea1d6981Smrg</funcprototype>
928ea1d6981Smrg</funcsynopsis>
929ea1d6981Smrg
930ea1d6981Smrg
931ea1d6981Smrg<para>
932ea1d6981SmrgThis routine returns the
933ea1d6981Smrg<emphasis remap='I'>XID</emphasis> and
934ea1d6981Smrg<emphasis remap='I'>type</emphasis> stored in the
935ea1d6981Smrg<emphasis role="bold">_SCREEN_SAVER_ID</emphasis> property on the
936ea1d6981Smrgroot window of the specified <emphasis remap='I'>screen</emphasis>.
937ea1d6981SmrgIt returns zero if an error
938ea1d6981Smrgis encountered or if the property does not exist or is not of the correct
939ea1d6981Smrgformat; otherwise it returns non-zero.
940ea1d6981Smrg</para>
941ea1d6981Smrg
942ea1d6981Smrg</chapter>
943ea1d6981Smrg</book>
944