#include <xcb/xcb.h>
#include <glib.h>
+#include <sys/time.h>
struct d_window;
struct d_display;
/* inherits from xcb_screen_t */
typedef struct d_screen {
xcb_screen_t super;
+ int ref;
struct d_display *dpy;
int num;
xcb_atom_t selatom; /* ditto.. */
xcb_window_t overlay;
+ xcb_visualid_t overlay_visual;
+
+ struct timeval next_repaint;
+ gboolean need_repaint;
GHashTable *winhash;
struct d_list *stacking;
+ 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 (*paint)(struct d_screen *sc);
+ 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 (*window_damage)(struct d_window *w);
+ void (*window_restack)(struct d_window *w, struct d_window *above);
+ 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, 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