aboutsummaryrefslogtreecommitdiffstats
path: root/xcb.c
diff options
context:
space:
mode:
authorEliteTK <tomasz.kramkowski@gmail.com>2014-07-10 22:35:35 +0100
committerEliteTK <tomasz.kramkowski@gmail.com>2014-07-10 22:35:35 +0100
commita8609ccd901b1942e862c14205026d841e640add (patch)
tree5eaf1d04d454bc45acfdf4c698b2860b91f48a00 /xcb.c
parent922fe2f68c39a765896d274356c7c9dc4fb9cd73 (diff)
downloadc-stuff-a8609ccd901b1942e862c14205026d841e640add.tar.gz
c-stuff-a8609ccd901b1942e862c14205026d841e640add.tar.xz
c-stuff-a8609ccd901b1942e862c14205026d841e640add.zip
More stuff.
Diffstat (limited to 'xcb.c')
-rw-r--r--xcb.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/xcb.c b/xcb.c
new file mode 100644
index 0000000..faa0a9e
--- /dev/null
+++ b/xcb.c
@@ -0,0 +1,30 @@
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <xcb/xcb.h>
+#include <inttypes.h>
+
+int main(int argc, char **argv)
+{
+ int i, screen_num;
+ xcb_connection_t *connection = xcb_connect(NULL, &screen_num);
+
+ const xcb_setup_t *setup = xcb_get_setup(connection);
+ xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup);
+
+ for (i = 0; i < screen_num; i++) {
+ xcb_screen_next(&iter);
+ }
+
+ xcb_screen_t *screen = iter.data;
+
+ printf("\n");
+ printf("Information about screen %"PRIu32":\n", screen->root);
+ printf(" width : %"PRIu16"\n", screen->width_in_pixels);
+ printf(" height : %"PRIu16"\n", screen->height_in_pixels);
+ printf(" white pixel : %"PRIu32"\n", screen->white_pixel);
+ printf(" black pixel : %"PRIu32"\n", screen->black_pixel);
+
+ xcb_disconnect(connection);
+ return 0;
+}