diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c | 338 |
1 files changed, 0 insertions, 338 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c deleted file mode 100644 index cb7249f..0000000 --- a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_screensaver.c +++ /dev/null | |||
@@ -1,338 +0,0 @@ | |||
1 | #include "ecore_xcb_private.h" | ||
2 | # ifdef ECORE_XCB_SCREENSAVER | ||
3 | # include <xcb/screensaver.h> | ||
4 | # endif | ||
5 | |||
6 | /* local variables */ | ||
7 | static Eina_Bool _screensaver_avail = EINA_FALSE; | ||
8 | |||
9 | /* external variables */ | ||
10 | int _ecore_xcb_event_screensaver = -1; | ||
11 | |||
12 | void | ||
13 | _ecore_xcb_screensaver_init(void) | ||
14 | { | ||
15 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
16 | |||
17 | #ifdef ECORE_XCB_SCREENSAVER | ||
18 | xcb_prefetch_extension_data(_ecore_xcb_conn, &xcb_screensaver_id); | ||
19 | #endif | ||
20 | } | ||
21 | |||
22 | void | ||
23 | _ecore_xcb_screensaver_finalize(void) | ||
24 | { | ||
25 | #ifdef ECORE_XCB_SCREENSAVER | ||
26 | const xcb_query_extension_reply_t *ext_reply; | ||
27 | #endif | ||
28 | |||
29 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
30 | |||
31 | #ifdef ECORE_XCB_SCREENSAVER | ||
32 | ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_screensaver_id); | ||
33 | if ((ext_reply) && (ext_reply->present)) | ||
34 | { | ||
35 | xcb_screensaver_query_version_cookie_t cookie; | ||
36 | xcb_screensaver_query_version_reply_t *reply; | ||
37 | |||
38 | cookie = | ||
39 | xcb_screensaver_query_version_unchecked(_ecore_xcb_conn, | ||
40 | XCB_SCREENSAVER_MAJOR_VERSION, | ||
41 | XCB_SCREENSAVER_MINOR_VERSION); | ||
42 | reply = | ||
43 | xcb_screensaver_query_version_reply(_ecore_xcb_conn, cookie, NULL); | ||
44 | if (reply) | ||
45 | { | ||
46 | if ((reply->server_major_version >= XCB_SCREENSAVER_MAJOR_VERSION) && | ||
47 | (reply->server_minor_version >= XCB_SCREENSAVER_MINOR_VERSION)) | ||
48 | _screensaver_avail = EINA_TRUE; | ||
49 | |||
50 | free(reply); | ||
51 | } | ||
52 | |||
53 | if (_screensaver_avail) | ||
54 | _ecore_xcb_event_screensaver = ext_reply->first_event; | ||
55 | } | ||
56 | #endif | ||
57 | } | ||
58 | |||
59 | EAPI int | ||
60 | ecore_x_screensaver_idle_time_get(void) | ||
61 | { | ||
62 | int ret = 0; | ||
63 | #ifdef ECORE_XCB_SCREENSAVER | ||
64 | xcb_screensaver_query_info_cookie_t cookie; | ||
65 | xcb_screensaver_query_info_reply_t *reply; | ||
66 | Ecore_X_Window root; | ||
67 | #endif | ||
68 | |||
69 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
70 | CHECK_XCB_CONN; | ||
71 | |||
72 | if (!_screensaver_avail) return 0; | ||
73 | |||
74 | #ifdef ECORE_XCB_SCREENSAVER | ||
75 | root = ((xcb_screen_t *)_ecore_xcb_screen)->root; | ||
76 | cookie = xcb_screensaver_query_info_unchecked(_ecore_xcb_conn, root); | ||
77 | reply = xcb_screensaver_query_info_reply(_ecore_xcb_conn, cookie, NULL); | ||
78 | if (!reply) return 0; | ||
79 | ret = (reply->ms_until_server / 1000); | ||
80 | free(reply); | ||
81 | #endif | ||
82 | |||
83 | return ret; | ||
84 | } | ||
85 | |||
86 | EAPI void | ||
87 | ecore_x_screensaver_set(int timeout, | ||
88 | int interval, | ||
89 | int prefer_blanking, | ||
90 | int allow_exposures) | ||
91 | { | ||
92 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
93 | CHECK_XCB_CONN; | ||
94 | |||
95 | if (!_screensaver_avail) return; | ||
96 | |||
97 | #ifdef ECORE_XCB_SCREENSAVER | ||
98 | xcb_set_screen_saver(_ecore_xcb_conn, | ||
99 | timeout, interval, prefer_blanking, allow_exposures); | ||
100 | #endif | ||
101 | } | ||
102 | |||
103 | EAPI void | ||
104 | ecore_x_screensaver_timeout_set(int timeout) | ||
105 | { | ||
106 | #ifdef ECORE_XCB_SCREENSAVER | ||
107 | xcb_get_screen_saver_cookie_t cookie; | ||
108 | xcb_get_screen_saver_reply_t *reply; | ||
109 | uint16_t pint; | ||
110 | uint8_t pblank, pexpo; | ||
111 | #endif | ||
112 | |||
113 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
114 | CHECK_XCB_CONN; | ||
115 | |||
116 | if (!_screensaver_avail) return; | ||
117 | |||
118 | #ifdef ECORE_XCB_SCREENSAVER | ||
119 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
120 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
121 | if (!reply) return; | ||
122 | pint = reply->interval; | ||
123 | pblank = reply->prefer_blanking; | ||
124 | pexpo = reply->allow_exposures; | ||
125 | free(reply); | ||
126 | xcb_set_screen_saver(_ecore_xcb_conn, timeout, pint, pblank, pexpo); | ||
127 | #endif | ||
128 | } | ||
129 | |||
130 | EAPI int | ||
131 | ecore_x_screensaver_timeout_get(void) | ||
132 | { | ||
133 | int timeout = 0; | ||
134 | #ifdef ECORE_XCB_SCREENSAVER | ||
135 | xcb_get_screen_saver_cookie_t cookie; | ||
136 | xcb_get_screen_saver_reply_t *reply; | ||
137 | #endif | ||
138 | |||
139 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
140 | CHECK_XCB_CONN; | ||
141 | |||
142 | if (!_screensaver_avail) return 0; | ||
143 | |||
144 | #ifdef ECORE_XCB_SCREENSAVER | ||
145 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
146 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
147 | if (!reply) return 0; | ||
148 | timeout = reply->timeout; | ||
149 | free(reply); | ||
150 | #endif | ||
151 | |||
152 | return timeout; | ||
153 | } | ||
154 | |||
155 | EAPI void | ||
156 | ecore_x_screensaver_blank_set(int blank) | ||
157 | { | ||
158 | #ifdef ECORE_XCB_SCREENSAVER | ||
159 | xcb_get_screen_saver_cookie_t cookie; | ||
160 | xcb_get_screen_saver_reply_t *reply; | ||
161 | uint16_t pint, pto; | ||
162 | uint8_t pexpo; | ||
163 | #endif | ||
164 | |||
165 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
166 | CHECK_XCB_CONN; | ||
167 | |||
168 | if (!_screensaver_avail) return; | ||
169 | |||
170 | #ifdef ECORE_XCB_SCREENSAVER | ||
171 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
172 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
173 | if (!reply) return; | ||
174 | pto = reply->timeout; | ||
175 | pint = reply->interval; | ||
176 | pexpo = reply->allow_exposures; | ||
177 | free(reply); | ||
178 | xcb_set_screen_saver(_ecore_xcb_conn, pto, pint, blank, pexpo); | ||
179 | #endif | ||
180 | } | ||
181 | |||
182 | EAPI int | ||
183 | ecore_x_screensaver_blank_get(void) | ||
184 | { | ||
185 | int blank = 0; | ||
186 | #ifdef ECORE_XCB_SCREENSAVER | ||
187 | xcb_get_screen_saver_cookie_t cookie; | ||
188 | xcb_get_screen_saver_reply_t *reply; | ||
189 | #endif | ||
190 | |||
191 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
192 | CHECK_XCB_CONN; | ||
193 | |||
194 | if (!_screensaver_avail) return 0; | ||
195 | |||
196 | #ifdef ECORE_XCB_SCREENSAVER | ||
197 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
198 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
199 | if (!reply) return 0; | ||
200 | blank = reply->prefer_blanking; | ||
201 | free(reply); | ||
202 | #endif | ||
203 | |||
204 | return blank; | ||
205 | } | ||
206 | |||
207 | EAPI void | ||
208 | ecore_x_screensaver_expose_set(int expose) | ||
209 | { | ||
210 | #ifdef ECORE_XCB_SCREENSAVER | ||
211 | xcb_get_screen_saver_cookie_t cookie; | ||
212 | xcb_get_screen_saver_reply_t *reply; | ||
213 | uint16_t pint, pto; | ||
214 | uint8_t pblank; | ||
215 | #endif | ||
216 | |||
217 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
218 | CHECK_XCB_CONN; | ||
219 | |||
220 | if (!_screensaver_avail) return; | ||
221 | |||
222 | #ifdef ECORE_XCB_SCREENSAVER | ||
223 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
224 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
225 | if (!reply) return; | ||
226 | pto = reply->timeout; | ||
227 | pint = reply->interval; | ||
228 | pblank = reply->prefer_blanking; | ||
229 | free(reply); | ||
230 | xcb_set_screen_saver(_ecore_xcb_conn, pto, pint, pblank, expose); | ||
231 | #endif | ||
232 | } | ||
233 | |||
234 | EAPI int | ||
235 | ecore_x_screensaver_expose_get(void) | ||
236 | { | ||
237 | int expose = 0; | ||
238 | #ifdef ECORE_XCB_SCREENSAVER | ||
239 | xcb_get_screen_saver_cookie_t cookie; | ||
240 | xcb_get_screen_saver_reply_t *reply; | ||
241 | #endif | ||
242 | |||
243 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
244 | CHECK_XCB_CONN; | ||
245 | |||
246 | if (!_screensaver_avail) return 0; | ||
247 | |||
248 | #ifdef ECORE_XCB_SCREENSAVER | ||
249 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
250 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
251 | if (!reply) return 0; | ||
252 | expose = reply->allow_exposures; | ||
253 | free(reply); | ||
254 | #endif | ||
255 | |||
256 | return expose; | ||
257 | } | ||
258 | |||
259 | EAPI void | ||
260 | ecore_x_screensaver_interval_set(int interval) | ||
261 | { | ||
262 | #ifdef ECORE_XCB_SCREENSAVER | ||
263 | xcb_get_screen_saver_cookie_t cookie; | ||
264 | xcb_get_screen_saver_reply_t *reply; | ||
265 | uint16_t pto; | ||
266 | uint8_t pblank, pexpose; | ||
267 | #endif | ||
268 | |||
269 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
270 | CHECK_XCB_CONN; | ||
271 | |||
272 | if (!_screensaver_avail) return; | ||
273 | |||
274 | #ifdef ECORE_XCB_SCREENSAVER | ||
275 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
276 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
277 | if (!reply) return; | ||
278 | pto = reply->timeout; | ||
279 | pblank = reply->prefer_blanking; | ||
280 | pexpose = reply->allow_exposures; | ||
281 | free(reply); | ||
282 | xcb_set_screen_saver(_ecore_xcb_conn, pto, interval, pblank, pexpose); | ||
283 | #endif | ||
284 | } | ||
285 | |||
286 | EAPI int | ||
287 | ecore_x_screensaver_interval_get(void) | ||
288 | { | ||
289 | int interval = 0; | ||
290 | #ifdef ECORE_XCB_SCREENSAVER | ||
291 | xcb_get_screen_saver_cookie_t cookie; | ||
292 | xcb_get_screen_saver_reply_t *reply; | ||
293 | #endif | ||
294 | |||
295 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
296 | CHECK_XCB_CONN; | ||
297 | |||
298 | if (!_screensaver_avail) return 0; | ||
299 | |||
300 | #ifdef ECORE_XCB_SCREENSAVER | ||
301 | cookie = xcb_get_screen_saver_unchecked(_ecore_xcb_conn); | ||
302 | reply = xcb_get_screen_saver_reply(_ecore_xcb_conn, cookie, NULL); | ||
303 | if (!reply) return 0; | ||
304 | interval = reply->interval; | ||
305 | free(reply); | ||
306 | #endif | ||
307 | |||
308 | return interval; | ||
309 | } | ||
310 | |||
311 | EAPI void | ||
312 | ecore_x_screensaver_event_listen_set(Eina_Bool on) | ||
313 | { | ||
314 | #ifdef ECORE_XCB_SCREENSAVER | ||
315 | Ecore_X_Window root; | ||
316 | #endif | ||
317 | |||
318 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
319 | CHECK_XCB_CONN; | ||
320 | |||
321 | if (!_screensaver_avail) return; | ||
322 | |||
323 | #ifdef ECORE_XCB_SCREENSAVER | ||
324 | root = ((xcb_screen_t *)_ecore_xcb_screen)->root; | ||
325 | if (on) | ||
326 | xcb_screensaver_select_input(_ecore_xcb_conn, root, | ||
327 | XCB_SCREENSAVER_EVENT_NOTIFY_MASK); | ||
328 | else | ||
329 | xcb_screensaver_select_input(_ecore_xcb_conn, root, 0); | ||
330 | #endif | ||
331 | } | ||
332 | |||
333 | EAPI Eina_Bool | ||
334 | ecore_x_screensaver_event_available_get(void) | ||
335 | { | ||
336 | return _screensaver_avail; | ||
337 | } | ||
338 | |||