making some nice batch-query stuff for initializing the display statics
[dana/dcompmgr.git] / display.h
1 #ifndef dc__display_h
2 #define dc__display_h
3
4 #include <xcb/xcb.h>
5
6 #include <glib.h>
7
8 typedef struct d_display_ext {
9     gboolean          present;
10     int               error;
11     int               event;
12     int               opcode;
13     int               major_version;
14     int               minor_version;
15 } d_display_ext_t;
16
17 typedef struct d_display {
18     xcb_connection_t *conn;
19     int               ref;
20
21     d_display_ext_t xfixes;
22     d_display_ext_t render;
23     d_display_ext_t composite;
24     d_display_ext_t damage;
25
26     struct {
27         /* types */
28         xcb_atom_t atom;
29         xcb_atom_t cardinal;
30         xcb_atom_t utf8_string;
31         xcb_atom_t string;
32         xcb_atom_t pixmap;
33         /* properties */
34         xcb_atom_t net_wm_window_type;
35         xcb_atom_t net_wm_window_type_desktop;
36         xcb_atom_t net_wm_window_type_dock;
37         xcb_atom_t net_wm_window_type_normal;
38         xcb_atom_t net_wm_window_type_dialog;
39         xcb_atom_t net_wm_window_type_toolbar;
40         xcb_atom_t net_wm_window_type_menu;
41         xcb_atom_t net_wm_window_type_utility;
42         xcb_atom_t net_wm_window_type_splash;
43         xcb_atom_t net_wm_window_type_dropdown_menu;
44         xcb_atom_t net_wm_window_type_popup_menu;
45         xcb_atom_t net_wm_window_type_tooltip;
46         xcb_atom_t net_wm_window_type_notification;
47         xcb_atom_t net_wm_window_type_combo;
48         xcb_atom_t net_wm_window_type_dnd;
49     } a;
50 } d_display_t;
51
52 d_display_t* display_open(const char *name);
53
54 void display_ref(d_display_t *dpy);
55 void display_unref(d_display_t *dpy);
56
57 void display_error(d_display_t *dpy, xcb_generic_error_t *ev);
58
59 #endif