5a8ef8d6f420aa950861440a0d788bcbd5ff38d3
[dana/dcompmgr.git] / screen.h
1 #ifndef dc__screen_h
2 #define dc__screen_h
3
4 #include <xcb/xcb.h>
5 #include <glib.h>
6
7 struct d_window;
8 struct d_display;
9 struct d_list;
10
11 /* inherits from xcb_screen_t */
12 typedef struct d_screen {
13     xcb_screen_t      super;
14     struct d_display *dpy;
15     int               num;
16
17     xcb_window_t      selwin;  /* for the selection */
18     xcb_atom_t        selatom; /* ditto.. */
19
20     xcb_window_t      overlay;
21
22     GHashTable       *winhash;
23     struct d_list    *stacking;
24 } d_screen_t;
25
26 /*! Tries to register on the screen given by @sc.  If it succeeds, it fills
27     in @sc and returns TRUE, otherwise it returns FALSE.
28 */
29 gboolean screen_register(struct d_display *dpy, int num, d_screen_t *sc);
30 void screen_free(d_screen_t *sc);
31
32 void screen_add_window(d_screen_t *sc, xcb_window_t wid);
33 void screen_remove_window(d_screen_t *sc, struct d_window *w);
34
35 struct d_window* screen_find_window(d_screen_t *sc, xcb_window_t id);
36
37 void screen_stacking_add(d_screen_t *sc, struct d_window *w);
38 void screen_stacking_remove(d_screen_t *sc, struct d_window *w);
39
40 #endif