From 2ef950eab96311d36bab7d70aabac5e6e37c2593 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Sun, 21 Feb 2016 19:42:32 +0100 Subject: WIP: Port window stuff to xcb Signed-off-by: Quentin Glidic --- include/i3-support.h | 2 +- include/textbox.h | 2 +- include/view.h | 2 +- include/x11-helper.h | 22 +++++++++++++--------- 4 files changed, 16 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/i3-support.h b/include/i3-support.h index 1e73fe73..e90dd315 100644 --- a/include/i3-support.h +++ b/include/i3-support.h @@ -28,7 +28,7 @@ void i3_support_focus_window ( Window id ); * @returns TRUE when i3 is running, FALSE when not. */ -int i3_support_initialize ( Display *display ); +int i3_support_initialize ( Display *display, xcb_connection_t *xcb_connection ); /** * Cleanup. diff --git a/include/textbox.h b/include/textbox.h index ea638ff0..80169c2d 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -142,7 +142,7 @@ void textbox_insert ( textbox *tb, int pos, char *str, int slen ); * before any of the textbox_ functions is called. * Clean with textbox_cleanup() */ -void textbox_setup ( Display *display ); +void textbox_setup ( void ); /** * Cleanup the allocated colors and fonts by textbox_setup(). diff --git a/include/view.h b/include/view.h index 79a2997b..758894ef 100644 --- a/include/view.h +++ b/include/view.h @@ -90,7 +90,7 @@ void rofi_view_update ( RofiViewState *state ); * * Enables fake transparancy on this view. */ -void rofi_view_setup_fake_transparency ( Display *display, RofiViewState *state ); +void rofi_view_setup_fake_transparency ( xcb_connection_t *xcb_connection, xcb_screen_t *xcb_screen, RofiViewState *state ); /** * @param state The handle to the view diff --git a/include/x11-helper.h b/include/x11-helper.h index 6bcf62ae..02167248 100644 --- a/include/x11-helper.h +++ b/include/x11-helper.h @@ -1,6 +1,7 @@ #ifndef X11_ROFI_HELPER_H #define X11_ROFI_HELPER_H #include +#include #include "xkb.h" @@ -27,7 +28,7 @@ int window_get_prop ( Display *display, Window w, Atom prop, char* window_get_text_prop ( Display *display, Window w, Atom atom ); int window_get_atom_prop ( Display *display, Window w, Atom atom, Atom *list, int count ); -void window_set_atom_prop ( Display *display, Window w, Atom prop, Atom *atoms, int count ); +void window_set_atom_prop ( Display *display, Window w, Atom atom, Atom *atoms, int count ); int window_get_cardinal_prop ( Display *display, Window w, Atom atom, unsigned long *list, int count ); @@ -65,7 +66,7 @@ int window_get_cardinal_prop ( Display *display, Window w, Atom atom, unsigned l enum { EWMH_ATOMS ( ATOM_ENUM ), NUM_NETATOMS }; extern const char *netatom_names[]; -extern Atom netatoms[NUM_NETATOMS]; +extern Atom netatoms[NUM_NETATOMS]; typedef struct { int x, y, w, h; @@ -134,13 +135,16 @@ void x11_set_window_opacity ( Display *display, Window box, unsigned int opacity */ void x11_setup ( Display *display, xkb_stuff *xkb ); +extern xcb_depth_t *depth; +extern xcb_visualtype_t *visual; +extern xcb_colormap_t map; +extern xcb_depth_t *root_depth; +extern xcb_visualtype_t *root_visual; /** - * @param display Connection to the X server. - * * This function tries to create a 32bit TrueColor colormap. * If this fails, it falls back to the default for the connected display. */ -void create_visual_and_colormap ( Display *display ); +void x11_create_visual_and_colormap ( xcb_connection_t *xcb_connection, xcb_screen_t *xcb_screen ); typedef struct { @@ -153,11 +157,11 @@ typedef struct * * Allocate a pixel value for an X named color */ -Color color_get ( Display *display, const char *const name, const char * const defn ); +Color color_get ( const char *const name ); -void color_background ( Display *display, cairo_t *d ); -void color_border ( Display *display, cairo_t *d ); -void color_separator ( Display *display, cairo_t *d ); +void color_background ( cairo_t *d ); +void color_border ( cairo_t *d ); +void color_separator ( cairo_t *d ); void color_cache_reset ( void ); void x11_helper_set_cairo_rgba ( cairo_t *d, Color col ); -- cgit v1.2.3