summaryrefslogtreecommitdiff
path: root/xlistpixmapformats.c
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2012-09-26 15:04:18 +0200
committerPeter Wu <lekensteyn@gmail.com>2012-09-26 15:04:18 +0200
commit2497c1392b81e093f4de2541a98746aebd449a7f (patch)
treedb87e59d4c70c677ddb1899d9161b004f6e454ac /xlistpixmapformats.c
downloadc-files-2497c1392b81e093f4de2541a98746aebd449a7f.tar.gz
Initial commit
Diffstat (limited to 'xlistpixmapformats.c')
-rw-r--r--xlistpixmapformats.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlistpixmapformats.c b/xlistpixmapformats.c
new file mode 100644
index 0000000..93a9a20
--- /dev/null
+++ b/xlistpixmapformats.c
@@ -0,0 +1,18 @@
+#include <X11/Xlib.h>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ Display *dpy = XOpenDisplay(NULL);
+ int total = 0;
+ XPixmapFormatValues *fs = XListPixmapFormats(dpy, &total);
+ if (total) {
+ int i;
+ for (i=0; i<total; ++i) {
+ XPixmapFormatValues f = fs[i];
+ printf("depth=%2d bpp=%2d scanline_pad=%d\n",
+ f.depth, f.bits_per_pixel, f.scanline_pad);
+ }
+ }
+ XCloseDisplay(dpy);
+ return 0;
+}