2af3c984c6b3872e56716559fce839df0cc81f7e
[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 #include <sys/time.h>
7
8 struct d_window;
9 struct d_display;
10 struct d_list;
11
12 /* inherits from xcb_screen_t */
13 typedef struct d_screen {
14     xcb_screen_t      super;
15     struct d_display *dpy;
16     int               num;
17
18     xcb_window_t      selwin;  /* for the selection */
19     xcb_atom_t        selatom; /* ditto.. */
20
21     xcb_window_t      overlay;
22
23     struct timeval    next_repaint;
24
25     GHashTable       *winhash;
26     struct d_list    *stacking;
27     GHashTable       *plugin_data;
28
29     void (*screen_paint)(struct d_screen *sc);
30     void (*window_show)(struct d_window *w);
31     void (*window_hide)(struct d_window *w);
32     void (*window_become_zombie)(struct d_window *w);
33 } d_screen_t;
34
35 /*! Tries to register on the screen given by @sc.  If it succeeds, it fills
36     in @sc and returns TRUE, otherwise it returns FALSE.
37 */
38 gboolean screen_register(struct d_display *dpy, int num, d_screen_t *sc);
39 void screen_free(d_screen_t *sc);
40
41 void screen_add_window(d_screen_t *sc, xcb_window_t wid);
42 void screen_remove_window(d_screen_t *sc, struct d_window *w);
43
44 struct d_window* screen_find_window(d_screen_t *sc, xcb_window_t id);
45
46 void screen_stacking_add(d_screen_t *sc, struct d_window *w);
47 void screen_stacking_remove(d_screen_t *sc, struct d_window *w);
48
49 void screen_setup_default_functions(d_screen_t *sc);
50
51 void  screen_add_plugin_data(d_screen_t *sc, const char *key, void *data);
52 void* screen_find_plugin_data(d_screen_t *sc, const char *key);
53 void  screen_remove_plugin_data(d_screen_t *sc, const char *key);
54
55 #endif