From f39f5bb0cb1f296feae08152f2c30f2156c2aa58 Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Mon, 22 Feb 2016 16:53:30 +0100 Subject: view-internal: Use XCB types Signed-off-by: Quentin Glidic --- include/view-internal.h | 80 ++++++++++++++++++++++++------------------------- include/xkb-internal.h | 6 ++-- include/xkb.h | 2 +- source/view.c | 6 ++-- 4 files changed, 48 insertions(+), 46 deletions(-) diff --git a/include/view-internal.h b/include/view-internal.h index b4bbd8c6..3a822a4c 100644 --- a/include/view-internal.h +++ b/include/view-internal.h @@ -14,63 +14,63 @@ struct RofiViewState { - Mode *sw; - unsigned int menu_lines; - unsigned int max_elements; - unsigned int max_rows; - unsigned int columns; + Mode *sw; + unsigned int menu_lines; + unsigned int max_elements; + unsigned int max_rows; + unsigned int columns; // window width,height - unsigned int w, h; - int x, y; - unsigned int element_width; - int top_offset; + unsigned int w, h; + int x, y; + unsigned int element_width; + int top_offset; // Update/Refilter list. - int update; - int refilter; - int rchanged; - int cur_page; + int update; + int refilter; + int rchanged; + int cur_page; // Entries - textbox *text; - textbox *prompt_tb; - textbox *message_tb; - textbox *case_indicator; - textbox **boxes; - scrollbar *scrollbar; - int *distance; - unsigned int *line_map; + textbox *text; + textbox *prompt_tb; + textbox *message_tb; + textbox *case_indicator; + textbox **boxes; + scrollbar *scrollbar; + int *distance; + unsigned int *line_map; - unsigned int num_lines; + unsigned int num_lines; // Selected element. - unsigned int selected; - unsigned int filtered_lines; + unsigned int selected; + unsigned int filtered_lines; // Last offset in paginating. - unsigned int last_offset; + unsigned int last_offset; - KeySym prev_key; - Time last_button_press; + xkb_keysym_t prev_key; + xcb_timestamp_t last_button_press; - int quit; - int skip_absorb; + int quit; + int skip_absorb; // Return state - unsigned int selected_line; - MenuReturn retv; - int *lines_not_ascii; - int line_height; - unsigned int border; - workarea mon; + unsigned int selected_line; + MenuReturn retv; + int *lines_not_ascii; + int line_height; + unsigned int border; + workarea mon; // Sidebar view - unsigned int num_modi; - textbox **modi; + unsigned int num_modi; + textbox **modi; - MenuFlags menu_flags; + MenuFlags menu_flags; // Handlers. - void ( *x11_event_loop )( struct RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb ); - void ( *finalize )( struct RofiViewState *state ); + void ( *x11_event_loop )( struct RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb ); + void ( *finalize )( struct RofiViewState *state ); }; /** @} */ #endif diff --git a/include/xkb-internal.h b/include/xkb-internal.h index d9a3debc..3a95c1a2 100644 --- a/include/xkb-internal.h +++ b/include/xkb-internal.h @@ -4,14 +4,16 @@ #include #include -struct xkb_stuff { +struct xkb_stuff +{ xcb_connection_t *xcb_connection; struct xkb_context *context; uint8_t first_event; int32_t device_id; struct xkb_keymap *keymap; struct xkb_state *state; - struct { + struct + { struct xkb_compose_table *table; struct xkb_compose_state * state; } compose; diff --git a/include/xkb.h b/include/xkb.h index 2af1ccb8..8e648665 100644 --- a/include/xkb.h +++ b/include/xkb.h @@ -1,6 +1,6 @@ #ifndef ROFI_XKB_H #define ROFI_XKB_H -typedef struct xkb_stuff xkb_stuff; +typedef struct xkb_stuff xkb_stuff; #endif diff --git a/source/view.c b/source/view.c index 460a2487..378999bf 100644 --- a/source/view.c +++ b/source/view.c @@ -77,7 +77,7 @@ Window main_window = None; cairo_surface_t *surface = NULL; cairo_surface_t *fake_bg = NULL; cairo_t *draw = NULL; -Colormap map = None; +Colormap map = None; XVisualInfo vinfo; static char * get_matching_state ( void ) @@ -1307,8 +1307,8 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t switch ( xkb_compose_state_get_status ( xkb->compose.state ) ) { case XKB_COMPOSE_CANCELLED: - /* Eat the keysym that cancelled the compose sequence. - * This is default behaviour with Xlib */ + /* Eat the keysym that cancelled the compose sequence. + * This is default behaviour with Xlib */ case XKB_COMPOSE_COMPOSING: key = XKB_KEY_NoSymbol; break; -- cgit v1.2.3