diff options
author | Peter Wu <lekensteyn@gmail.com> | 2012-09-26 15:04:18 +0200 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2012-09-26 15:04:18 +0200 |
commit | 2497c1392b81e093f4de2541a98746aebd449a7f (patch) | |
tree | db87e59d4c70c677ddb1899d9161b004f6e454ac /xlistpixmapformats.c | |
download | c-files-2497c1392b81e093f4de2541a98746aebd449a7f.tar.gz |
Initial commit
Diffstat (limited to 'xlistpixmapformats.c')
-rw-r--r-- | xlistpixmapformats.c | 18 |
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; +} |