summaryrefslogtreecommitdiff
path: root/dpms.c
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2006-02-18 16:49:41 -0800
committerJosh Triplett <josh@josh-mobile.localdomain>2006-02-18 16:49:41 -0800
commita49d7099e26ff026dfec35067908b18dc05d2e88 (patch)
tree3feac3cc85b79718d01ffc21f02b26ae4444ff0f /dpms.c
Remove xcl and CVSROOT.
Diffstat (limited to 'dpms.c')
-rw-r--r--dpms.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/dpms.c b/dpms.c
new file mode 100644
index 0000000..a739f97
--- /dev/null
+++ b/dpms.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2001-2005 Bart Massey and Jamey Sharp.
+ * All Rights Reserved. See the file COPYING in this directory
+ * for licensing information.
+ */
+
+#include <X11/XCB/xcb.h>
+#include <X11/XCB/dpms.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ XCBConnection *c = XCBConnect(0, 0);
+ XCBDPMSGetVersionCookie vc;
+ XCBDPMSGetVersionRep *ver;
+ XCBDPMSCapableCookie cc;
+ XCBDPMSCapableRep *cap;
+ XCBDPMSGetTimeoutsCookie tc;
+ XCBDPMSGetTimeoutsRep *time;
+
+ XCBPrefetchExtensionData(c, &XCBDPMSId);
+
+ vc = XCBDPMSGetVersion(c, 1, 1);
+ cc = XCBDPMSCapable(c);
+ tc = XCBDPMSGetTimeouts(c);
+
+ ver = XCBDPMSGetVersionReply(c, vc, 0);
+ cap = XCBDPMSCapableReply(c, cc, 0);
+ time = XCBDPMSGetTimeoutsReply(c, tc, 0);
+
+ assert(ver);
+ assert(ver->server_major_version == 1);
+ assert(ver->server_minor_version == 1);
+ free(ver);
+
+ assert(cap);
+ assert(cap->capable);
+ free(cap);
+
+ assert(time);
+ printf("Standby: %d\n" "Suspend: %d\n" "Off: %d\n",
+ time->standby_timeout, time->suspend_timeout, time->off_timeout);
+ free(time);
+
+ XCBDisconnect(c);
+
+ exit(0);
+ /*NOTREACHED*/
+}