2 * Copyright (C) 2001-2005 Bart Massey and Jamey Sharp.
3 * All Rights Reserved. See the file COPYING in this directory
4 * for licensing information.
7 #include <X11/XCB/xcb.h>
8 #include <X11/XCB/dpms.h>
13 int main(int argc, char **argv)
15 xcb_connection_t *c = xcb_connect(0, 0);
16 xcb_dpms_get_version_cookie_t vc;
17 xcb_dpms_get_version_reply_t *ver;
18 xcb_dpms_capable_cookie_t cc;
19 xcb_dpms_capable_reply_t *cap;
20 xcb_dpms_get_timeouts_cookie_t tc;
21 xcb_dpms_get_timeouts_reply_t *time;
23 xcb_prefetch_extension_data(c, &xcb_dpms_id);
25 vc = xcb_dpms_get_version(c, 1, 1);
26 cc = xcb_dpms_capable(c);
27 tc = xcb_dpms_get_timeouts(c);
29 ver = xcb_dpms_get_version_reply(c, vc, 0);
30 cap = xcb_dpms_capable_reply(c, cc, 0);
31 time = xcb_dpms_get_timeouts_reply(c, tc, 0);
34 assert(ver->server_major_version == 1);
35 assert(ver->server_minor_version == 1);
43 printf("Standby: %d\n" "Suspend: %d\n" "Off: %d\n",
44 time->standby_timeout, time->suspend_timeout, time->off_timeout);