super fading
[dana/dcompmgr.git] / screen.h
index 2af3c98..15ef143 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -12,6 +12,7 @@ struct d_list;
 /* inherits from xcb_screen_t */
 typedef struct d_screen {
     xcb_screen_t      super;
+    int               ref;
     struct d_display *dpy;
     int               num;
 
@@ -21,35 +22,60 @@ typedef struct d_screen {
     xcb_window_t      overlay;
 
     struct timeval    next_repaint;
+    gboolean          need_repaint;
 
     GHashTable       *winhash;
     struct d_list    *stacking;
-    GHashTable       *plugin_data;
+    struct d_list    *plugin_data;
+
+    /* don't read this directly, use screen_get_root_pixmap() */
+    xcb_pixmap_t              root_pixmap;
+    gboolean                  root_pixmap_waiting;
+    xcb_get_property_cookie_t root_pixmap_ck[3];
 
     void (*screen_paint)(struct d_screen *sc);
     void (*window_show)(struct d_window *w);
     void (*window_hide)(struct d_window *w);
     void (*window_become_zombie)(struct d_window *w);
+    void (*window_zombie_dead)(struct d_window *w);
+    void (*window_move)(struct d_window *w);
+    void (*window_resize)(struct d_window *w);
+    void (*window_reshape)(struct d_window *w);
+    void (*window_opacity_change)(struct d_window *w);
+    void (*screen_root_pixmap_change)(struct d_screen *sc);
 } d_screen_t;
 
+d_screen_t* screen_new(struct d_display *dpy, int num, xcb_screen_t *xcb);
+
+void screen_ref(d_screen_t *sc);
+void screen_unref(d_screen_t *sc);
+
 /*! Tries to register on the screen given by @sc.  If it succeeds, it fills
     in @sc and returns TRUE, otherwise it returns FALSE.
 */
-gboolean screen_register(struct d_display *dpy, int num, d_screen_t *sc);
-void screen_free(d_screen_t *sc);
+gboolean screen_register(d_screen_t *sc);
 
-void screen_add_window(d_screen_t *sc, xcb_window_t wid);
+struct d_window* screen_add_window(d_screen_t *sc, xcb_window_t wid);
 void screen_remove_window(d_screen_t *sc, struct d_window *w);
 
 struct d_window* screen_find_window(d_screen_t *sc, xcb_window_t id);
 
 void screen_stacking_add(d_screen_t *sc, struct d_window *w);
 void screen_stacking_remove(d_screen_t *sc, struct d_window *w);
+void screen_stacking_move_above(d_screen_t *sc, struct d_window *w,
+                                struct d_window *above);
+void screen_stacking_move_to_top(d_screen_t *sc, struct d_window *w);
+void screen_stacking_move_to_bottom(d_screen_t *sc, struct d_window *w);
 
 void screen_setup_default_functions(d_screen_t *sc);
 
-void  screen_add_plugin_data(d_screen_t *sc, const char *key, void *data);
-void* screen_find_plugin_data(d_screen_t *sc, const char *key);
-void  screen_remove_plugin_data(d_screen_t *sc, const char *key);
+void  screen_add_plugin_data(d_screen_t *sc, int id, void *data);
+void* screen_find_plugin_data(d_screen_t *sc, int id);
+void  screen_remove_plugin_data(d_screen_t *sc, int id);
+
+void screen_refresh(d_screen_t *sc);
+
+void screen_update_root_pixmap(d_screen_t *sc);
+xcb_pixmap_t screen_get_root_pixmap(d_screen_t *sc);
 
 #endif