1 module deimos.X11.extensions.scrnsaver;
2 
3 /*
4  * Copyright (c) 1992  X Consortium
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19  * X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * Except as contained in this notice, the name of the X Consortium shall not be
24  * used in advertising or otherwise to promote the sale, use or other dealings
25  * in this Software without prior written authorization from the X Consortium.
26  *
27  * Author:  Keith Packard, MIT X Consortium
28  */
29 
30 import deimos.X11.X;
31 import deimos.X11.Xlib;
32 import deimos.X11.extensions.saver;
33 
34 private import core.stdc.config;
35 
36 extern (C) nothrow:
37 
38 struct XScreenSaverNotifyEvent {
39     int type;               /* of event */
40     c_ulong serial;         /* # of last request processed by server */
41     Bool send_event;        /* true if this came frome a SendEvent request */
42     Display *display;       /* Display the event was read from */
43     Window window;          /* screen saver window */
44     Window root;            /* root window of event screen */
45     int state;              /* ScreenSaverOff, ScreenSaverOn, ScreenSaverCycle*/
46     int kind;               /* ScreenSaverBlanked, ...Internal, ...External */
47     Bool forced;            /* extents of new region */
48     Time time;              /* event timestamp */
49 }
50 
51 struct XScreenSaverInfo {
52     Window  window;         /* screen saver window - may not exist */
53     int   state;            /* ScreenSaverOff, ScreenSaverOn, ScreenSaverDisabled*/
54     int   kind;             /* ScreenSaverBlanked, ...Internal, ...External */
55     c_ulong til_or_since;   /* time til or since screen saver */
56     c_ulong idle;           /* total time since last user input */
57     c_ulong eventMask;      /* currently selected events for this client */
58 }
59 
60 // _XFUNCPROTOBEGIN
61 
62 extern Bool XScreenSaverQueryExtension (
63     Display*    /* display */,
64     int*        /* event_base */,
65     int*        /* error_base */
66 );
67 
68 extern Status XScreenSaverQueryVersion (
69     Display*    /* display */,
70     int*        /* major_version */,
71     int*        /* minor_version */
72 );
73 
74 extern XScreenSaverInfo *XScreenSaverAllocInfo ();
75 
76 extern Status XScreenSaverQueryInfo (
77     Display*            /* display */,
78     Drawable            /* drawable */,
79     XScreenSaverInfo*   /* info */
80 );
81 
82 extern void XScreenSaverSelectInput (
83     Display*    /* display */,
84     Drawable    /* drawable */,
85     c_ulong     /* eventMask */
86 );
87 
88 extern void XScreenSaverSetAttributes (
89     Display*                /* display */,
90     Drawable                /* drawable */,
91     int                     /* x */,
92     int                     /* y */,
93     uint                    /* width */,
94     uint                    /* height */,
95     uint                    /* border_width */,
96     int                     /* depth */,
97     uint                    /* class */,
98     Visual *                /* visual */,
99     c_ulong                 /* valuemask */,
100     XSetWindowAttributes *  /* attributes */
101 );
102 
103 extern void XScreenSaverUnsetAttributes (
104     Display*    /* display */,
105     Drawable    /* drawable */
106 );
107 
108 extern Status XScreenSaverRegister (
109     Display*    /* display */,
110     int         /* screen */,
111     XID         /* xid */,
112     Atom        /* type */
113 );
114 
115 extern Status XScreenSaverUnregister (
116     Display*    /* display */,
117     int         /* screen */
118 );
119 
120 extern Status XScreenSaverGetRegistered (
121     Display*    /* display */,
122     int         /* screen */,
123     XID*        /* xid */,
124     Atom*       /* type */
125 );
126 
127 extern void XScreenSaverSuspend (
128     Display*    /* display */,
129     Bool        /* suspend */
130 );
131 
132 // _XFUNCPROTOEND