mirror of https://github.com/davatorium/rofi.git
view-internal: Use XCB types
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
09e520dfe8
commit
f39f5bb0cb
|
@ -14,63 +14,63 @@
|
||||||
|
|
||||||
struct RofiViewState
|
struct RofiViewState
|
||||||
{
|
{
|
||||||
Mode *sw;
|
Mode *sw;
|
||||||
unsigned int menu_lines;
|
unsigned int menu_lines;
|
||||||
unsigned int max_elements;
|
unsigned int max_elements;
|
||||||
unsigned int max_rows;
|
unsigned int max_rows;
|
||||||
unsigned int columns;
|
unsigned int columns;
|
||||||
|
|
||||||
// window width,height
|
// window width,height
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
int x, y;
|
int x, y;
|
||||||
unsigned int element_width;
|
unsigned int element_width;
|
||||||
int top_offset;
|
int top_offset;
|
||||||
|
|
||||||
// Update/Refilter list.
|
// Update/Refilter list.
|
||||||
int update;
|
int update;
|
||||||
int refilter;
|
int refilter;
|
||||||
int rchanged;
|
int rchanged;
|
||||||
int cur_page;
|
int cur_page;
|
||||||
|
|
||||||
// Entries
|
// Entries
|
||||||
textbox *text;
|
textbox *text;
|
||||||
textbox *prompt_tb;
|
textbox *prompt_tb;
|
||||||
textbox *message_tb;
|
textbox *message_tb;
|
||||||
textbox *case_indicator;
|
textbox *case_indicator;
|
||||||
textbox **boxes;
|
textbox **boxes;
|
||||||
scrollbar *scrollbar;
|
scrollbar *scrollbar;
|
||||||
int *distance;
|
int *distance;
|
||||||
unsigned int *line_map;
|
unsigned int *line_map;
|
||||||
|
|
||||||
unsigned int num_lines;
|
unsigned int num_lines;
|
||||||
|
|
||||||
// Selected element.
|
// Selected element.
|
||||||
unsigned int selected;
|
unsigned int selected;
|
||||||
unsigned int filtered_lines;
|
unsigned int filtered_lines;
|
||||||
// Last offset in paginating.
|
// Last offset in paginating.
|
||||||
unsigned int last_offset;
|
unsigned int last_offset;
|
||||||
|
|
||||||
KeySym prev_key;
|
xkb_keysym_t prev_key;
|
||||||
Time last_button_press;
|
xcb_timestamp_t last_button_press;
|
||||||
|
|
||||||
int quit;
|
int quit;
|
||||||
int skip_absorb;
|
int skip_absorb;
|
||||||
// Return state
|
// Return state
|
||||||
unsigned int selected_line;
|
unsigned int selected_line;
|
||||||
MenuReturn retv;
|
MenuReturn retv;
|
||||||
int *lines_not_ascii;
|
int *lines_not_ascii;
|
||||||
int line_height;
|
int line_height;
|
||||||
unsigned int border;
|
unsigned int border;
|
||||||
workarea mon;
|
workarea mon;
|
||||||
|
|
||||||
// Sidebar view
|
// Sidebar view
|
||||||
unsigned int num_modi;
|
unsigned int num_modi;
|
||||||
textbox **modi;
|
textbox **modi;
|
||||||
|
|
||||||
MenuFlags menu_flags;
|
MenuFlags menu_flags;
|
||||||
// Handlers.
|
// Handlers.
|
||||||
void ( *x11_event_loop )( struct RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb );
|
void ( *x11_event_loop )( struct RofiViewState *state, xcb_generic_event_t *ev, xkb_stuff *xkb );
|
||||||
void ( *finalize )( struct RofiViewState *state );
|
void ( *finalize )( struct RofiViewState *state );
|
||||||
};
|
};
|
||||||
/** @} */
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,14 +4,16 @@
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
#include <xkbcommon/xkbcommon-compose.h>
|
#include <xkbcommon/xkbcommon-compose.h>
|
||||||
|
|
||||||
struct xkb_stuff {
|
struct xkb_stuff
|
||||||
|
{
|
||||||
xcb_connection_t *xcb_connection;
|
xcb_connection_t *xcb_connection;
|
||||||
struct xkb_context *context;
|
struct xkb_context *context;
|
||||||
uint8_t first_event;
|
uint8_t first_event;
|
||||||
int32_t device_id;
|
int32_t device_id;
|
||||||
struct xkb_keymap *keymap;
|
struct xkb_keymap *keymap;
|
||||||
struct xkb_state *state;
|
struct xkb_state *state;
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
struct xkb_compose_table *table;
|
struct xkb_compose_table *table;
|
||||||
struct xkb_compose_state * state;
|
struct xkb_compose_state * state;
|
||||||
} compose;
|
} compose;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef ROFI_XKB_H
|
#ifndef ROFI_XKB_H
|
||||||
#define ROFI_XKB_H
|
#define ROFI_XKB_H
|
||||||
|
|
||||||
typedef struct xkb_stuff xkb_stuff;
|
typedef struct xkb_stuff xkb_stuff;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -77,7 +77,7 @@ Window main_window = None;
|
||||||
cairo_surface_t *surface = NULL;
|
cairo_surface_t *surface = NULL;
|
||||||
cairo_surface_t *fake_bg = NULL;
|
cairo_surface_t *fake_bg = NULL;
|
||||||
cairo_t *draw = NULL;
|
cairo_t *draw = NULL;
|
||||||
Colormap map = None;
|
Colormap map = None;
|
||||||
XVisualInfo vinfo;
|
XVisualInfo vinfo;
|
||||||
|
|
||||||
static char * get_matching_state ( void )
|
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 ) )
|
switch ( xkb_compose_state_get_status ( xkb->compose.state ) )
|
||||||
{
|
{
|
||||||
case XKB_COMPOSE_CANCELLED:
|
case XKB_COMPOSE_CANCELLED:
|
||||||
/* Eat the keysym that cancelled the compose sequence.
|
/* Eat the keysym that cancelled the compose sequence.
|
||||||
* This is default behaviour with Xlib */
|
* This is default behaviour with Xlib */
|
||||||
case XKB_COMPOSE_COMPOSING:
|
case XKB_COMPOSE_COMPOSING:
|
||||||
key = XKB_KEY_NoSymbol;
|
key = XKB_KEY_NoSymbol;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue