29#define G_LOG_DOMAIN "View"
41#include <xcb/xcb_ewmh.h>
42#include <xcb/xcb_icccm.h>
44#include <xkbcommon/xkbcommon-x11.h>
50#define SN_API_NOT_YET_FROZEN
128 .main_window = XCB_WINDOW_NONE,
134 .views = G_QUEUE_INIT,
136 .refilter_timeout = 0,
137 .refilter_timeout_count = 0,
168static int lev_sort(
const void *p1,
const void *p2,
void *arg) {
171 int *distances = arg;
173 return distances[*a] - distances[*b];
180 const char *outp = g_getenv(
"ROFI_PNG_OUTPUT");
183 g_warning(
"There is no rofi surface to store");
186 const char *xdg_pict_dir = g_get_user_special_dir(G_USER_DIRECTORY_PICTURES);
187 if (outp == NULL && xdg_pict_dir == NULL) {
188 g_warning(
"XDG user picture directory or ROFI_PNG_OUTPUT is not set. "
189 "Cannot store screenshot.");
193 GDateTime *now = g_date_time_new_now_local();
195 char *timestmp = g_date_time_format(now,
"rofi-%Y-%m-%d-%H%M");
196 char *filename = g_strdup_printf(
"%s-%05d.png", timestmp, 0);
201 fpath = g_build_filename(xdg_pict_dir, filename, NULL);
202 while (g_file_test(fpath, G_FILE_TEST_EXISTS) && index < 99999) {
208 filename = g_strdup_printf(
"%s-%05d.png", timestmp, index);
210 fpath = g_build_filename(xdg_pict_dir, filename, NULL);
213 fpath = g_strdup(outp);
216 cairo_status_t status =
217 cairo_surface_write_to_png(
CacheState.edit_surf, fpath);
218 if (status != CAIRO_STATUS_SUCCESS) {
219 g_warning(
"Failed to produce screenshot '%s', got error: '%s'", fpath,
220 cairo_status_to_string(status));
225 g_date_time_unref(now);
246}
BenchMark = {.time = NULL, .draws = 0, .last_ts = 0.0, .min = G_MAXDOUBLE};
258 double ts = g_timer_elapsed(
BenchMark.time, NULL);
259 double fps = 1024 / (ts -
BenchMark.last_ts);
264 printf(
"current: %.2f fps, avg: %.2f fps, min: %.2f fps, %lu draws\r\n",
280 g_debug(
"expose event");
289 return (
bench_update() == TRUE) ? G_SOURCE_CONTINUE : G_SOURCE_REMOVE;
364 state->
x -= state->
width / 2;
377 state->
x -= state->
width / 2;
388 state->
x -= state->
width / 2;
406 uint16_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
407 XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
408 uint32_t vals[] = {state->
x, state->
y, state->
width, state->
height};
425 g_debug(
"Re-size window based internal request: %dx%d.", state->
width,
440 GString *emesg = g_string_new(msg);
443 g_string_append_c(emesg,
'\n');
446 emesg,
"The following warnings were detected when starting rofi:\n");
449 for (; iter != NULL && index < 2; iter = g_list_next(iter)) {
450 GString *msg = (GString *)(iter->data);
451 g_string_append(emesg,
"\n\n");
452 g_string_append(emesg, msg->str);
455 if (g_list_length(iter) > 1) {
456 g_string_append_printf(emesg,
"\nThere are <b>%u</b> more errors.",
457 g_list_length(iter) - 1);
462 g_string_free(emesg, TRUE);
483 return G_SOURCE_REMOVE;
492 const char *action = p->
value.
s;
494 if (
id != UINT32_MAX) {
497 g_warning(
"Failed to parse keybinding: %s\r\n", action);
505 return G_SOURCE_REMOVE;
563 g_debug(
"stack view.");
568 if (state == NULL && !g_queue_is_empty(&(
CacheState.views))) {
569 g_debug(
"pop view.");
582 unsigned int selected_line) {
585 unsigned int selected = 0;
586 for (
unsigned int i = 0; ((state->
selected_line)) < UINT32_MAX && !selected &&
612 g_free(state->
modes);
629 (next_pos) = state->
line_map[selected + 1];
694 G_GNUC_UNUSED gpointer user_data) {
696 for (
unsigned int i = t->
start; i < t->
stop; i++) {
704 glong slen = g_utf8_strlen(str, -1);
721 g_mutex_lock(t->
mutex);
723 g_cond_signal(t->
cond);
724 g_mutex_unlock(t->
mutex);
730 const char *
const fake_background) {
732 cairo_surface_t *s = NULL;
738 if (g_strcmp0(fake_background,
"real") == 0) {
741 if (g_strcmp0(fake_background,
"screenshot") == 0) {
743 }
else if (g_strcmp0(fake_background,
"background") == 0) {
747 g_debug(
"Opening %s to use as background.", fpath);
748 s = cairo_image_surface_create_from_png(fpath);
754 if (cairo_surface_status(s) != CAIRO_STATUS_SUCCESS) {
755 g_debug(
"Failed to open surface fake background: %s",
756 cairo_status_to_string(cairo_surface_status(s)));
757 cairo_surface_destroy(s);
760 CacheState.fake_bg = cairo_image_surface_create(
764 cairo_t *dr = cairo_create(
CacheState.fake_bg);
766 cairo_set_source_surface(dr, s, 0, 0);
772 cairo_surface_destroy(s);
779 TICK_N(
"Fake transparency");
783 uint32_t selmask = XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL |
784 XCB_CW_BIT_GRAVITY | XCB_CW_BACKING_STORE |
785 XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
786 uint32_t xcb_event_masks =
787 XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS |
788 XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS |
789 XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_KEYMAP_STATE |
790 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_FOCUS_CHANGE |
791 XCB_EVENT_MASK_BUTTON_1_MOTION | XCB_EVENT_MASK_POINTER_MOTION;
793 uint32_t selval[] = {XCB_BACK_PIXMAP_NONE, 0,
794 XCB_GRAVITY_STATIC, XCB_BACKING_STORE_NOT_USEFUL,
795 xcb_event_masks,
map};
798 xcb_void_cookie_t cc = xcb_create_window_checked(
800 0, 200, 100, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
visual->visual_id, selmask,
802 xcb_generic_error_t *error;
805 g_error(
"xcb_create_window() failed error=0x%x\n", error->error_code);
808 TICK_N(
"xcb create window");
818 CacheState.edit_surf = cairo_xcb_surface_create(
822 TICK_N(
"create cairo surface");
824 cairo_font_options_t *fo = cairo_font_options_create();
826 cairo_surface_get_font_options(
CacheState.edit_surf, fo);
828 PangoContext *p = pango_cairo_create_context(
CacheState.edit_draw);
830 pango_cairo_context_set_font_options(p, fo);
831 TICK_N(
"pango cairo font setup");
838 PangoFontMap *font_map = pango_cairo_font_map_get_default();
839 pango_cairo_font_map_set_resolution((PangoCairoFontMap *)font_map,
847 dpi = (
xcb->
screen->height_in_pixels * 25.4) /
848 (
double)(
xcb->
screen->height_in_millimeters);
851 g_debug(
"Auto-detected DPI: %.2lf", dpi);
852 PangoFontMap *font_map = pango_cairo_font_map_get_default();
853 pango_cairo_font_map_set_resolution((PangoCairoFontMap *)font_map, dpi);
857 PangoFontMap *font_map = pango_cairo_font_map_get_default();
859 pango_cairo_font_map_get_resolution((PangoCairoFontMap *)font_map);
867 PangoFontDescription *pfd = pango_font_description_from_string(font);
869 pango_context_set_font_description(p, pfd);
871 pango_font_description_free(pfd);
873 PangoLanguage *l = pango_language_get_default();
874 pango_context_set_language(p, l);
881 cairo_font_options_destroy(fo);
887 &(
xcb->
ewmh._NET_WM_STATE_ABOVE), 1);
888 uint32_t values[] = {1};
890 XCB_CW_OVERRIDE_REDIRECT, values);
893 &(
xcb->
ewmh._NET_WM_WINDOW_TYPE_NORMAL), 1);
897 TICK_N(
"setup window attributes");
901 xcb_atom_t atoms[] = {
xcb->
ewmh._NET_WM_STATE_FULLSCREEN,
902 xcb->
ewmh._NET_WM_STATE_ABOVE};
904 sizeof(atoms) /
sizeof(xcb_atom_t));
907 xcb_atom_t protocols[] = {
netatoms[WM_TAKE_FOCUS]};
909 xcb->
ewmh.WM_PROTOCOLS, G_N_ELEMENTS(protocols),
912 TICK_N(
"setup window fullscreen");
915 const char wm_class_name[] =
"rofi\0Rofi";
916 xcb_icccm_set_wm_class(
xcb->
connection, box_window,
sizeof(wm_class_name),
919 TICK_N(
"setup window name and class");
920 const char *transparency =
928 TICK_N(
"setup startup notification");
933 pid_t pid = getpid();
937 const char *hostname = g_get_host_name();
938 char *ahost = g_hostname_to_ascii(hostname);
941 XCB_ATOM_STRING, 8, strlen(ahost), ahost);
960 "width", state->
width);
1003 if (selected < state->filtered_lines) {
1036 unsigned int index,
void *udata) {
1039 if (index < state->filtered_lines) {
1042 &fstate, NULL, TRUE);
1051 if (index < state->filtered_lines) {
1055 cairo_surface_t *
icon =
1067 GList *add_list = NULL;
1070 &fstate, &add_list, TRUE);
1075 cairo_surface_t *
icon =
1086 pango_attr_list_ref(list);
1088 list = pango_attr_list_new();
1093 {0.0, 0.0, 0.0, 0.0}};
1098 for (GList *iter = g_list_first(add_list); iter != NULL;
1099 iter = g_list_next(iter)) {
1100 pango_attr_list_insert(list, (PangoAttribute *)(iter->data));
1103 pango_attr_list_unref(list);
1105 g_list_free(add_list);
1122 g_debug(
"Redraw view");
1125 cairo_set_operator(d, CAIRO_OPERATOR_SOURCE);
1128 cairo_set_source_surface(d,
CacheState.fake_bg, 0.0, 0.0);
1130 cairo_set_source_surface(d,
CacheState.fake_bg,
1135 cairo_set_operator(d, CAIRO_OPERATOR_OVER);
1138 cairo_set_source_rgba(d, 0, 0, 0, 0.0);
1144 cairo_set_operator(d, CAIRO_OPERATOR_OVER);
1167 if (state->
sw == NULL) {
1168 return G_SOURCE_REMOVE;
1175 TICK_N(
"Filter reload rows");
1180 TICK_N(
"Filter tokenize");
1186 glong plen = pattern ? g_utf8_strlen(pattern, -1) : 0;
1195 unsigned int nt = MAX(1, state->
num_lines / 500);
1202 g_mutex_init(&mutex);
1204 unsigned int count = nt;
1205 unsigned int steps = (state->
num_lines + nt) / nt;
1206 for (
unsigned int i = 0; i < nt; i++) {
1207 states[i].
state = state;
1208 states[i].
start = i * steps;
1210 states[i].
count = 0;
1211 states[i].
cond = &cond;
1212 states[i].
mutex = &mutex;
1214 states[i].
plen = plen;
1218 g_thread_pool_push(
tpool, &states[i], NULL);
1225 g_mutex_lock(&mutex);
1227 g_cond_wait(&cond, &mutex);
1229 g_mutex_unlock(&mutex);
1231 g_cond_clear(&cond);
1232 g_mutex_clear(&mutex);
1233 for (
unsigned int i = 0; i < nt; i++) {
1234 if (j != states[i].start) {
1236 sizeof(
unsigned int) * (states[i].
count));
1238 j += states[i].
count;
1250 for (
unsigned int i = 0; i < state->
num_lines; i++) {
1255 TICK_N(
"Filter matching done");
1264 char *r = g_strdup_printf(
"%u", state->
num_lines);
1268 TICK_N(
"Update filter lines");
1280 if (height != state->
height) {
1284 g_debug(
"Resize based on re-filter");
1286 TICK_N(
"Filter resize window based on window ");
1290 return G_SOURCE_REMOVE;
1296 g_source_remove(
CacheState.refilter_timeout);
1310 g_source_remove(
CacheState.refilter_timeout);
1324 if (state && state->
finalize != NULL) {
1341 XCB_ATOM_PRIMARY,
xcb->
ewmh.UTF8_STRING,
1342 xcb->
ewmh.UTF8_STRING, XCB_CURRENT_TIME);
1348 xcb->
ewmh.UTF8_STRING, XCB_CURRENT_TIME);
1380 if (selected < state->filtered_lines) {
1399 if (selected < state->filtered_lines) {
1417 if (index < state->filtered_lines) {
1445 if (selected < state->filtered_lines) {
1523 }
else if (rc == 2) {
1532 if (selected < state->filtered_lines) {
1562 if (selected < state->filtered_lines) {
1589 if (target == NULL) {
1622 if (target == NULL) {
1686 gboolean find_mouse_target) {
1694 if (find_mouse_target) {
1698 if (target != NULL) {
1707 if (find_mouse_target) {
1721 if (state == NULL) {
1741 xcb_configure_notify_event_t *xce) {
1743 if (state->
x != xce->x || state->
y != xce->y) {
1748 if (state->
width != xce->width || state->
height != xce->height) {
1749 state->
width = xce->width;
1750 state->
height = xce->height;
1764 g_debug(
"Re-size window based external request: %d %d", state->
width,
1811 G_GNUC_UNUSED gint y, G_GNUC_UNUSED
void *user_data) {
1824 if (
id != UINT32_MAX) {
1840 G_GNUC_UNUSED gint y, G_GNUC_UNUSED
void *user_data) {
1843 for (i = 0; i < state->
num_modes; i++) {
1882 char *defaults = NULL;
1888 if (strcmp(name,
"mainbox") == 0) {
1892 defaults =
"inputbar,message,listview,mode-switcher";
1894 defaults =
"inputbar,message,listview";
1900 else if (strcmp(name,
"inputbar") == 0) {
1903 defaults =
"prompt,entry,overlay,case-indicator";
1909 else if (strcmp(name,
"prompt") == 0) {
1910 if (state->
prompt != NULL) {
1911 g_error(
"Prompt widget can only be added once to the layout.");
1921 }
else if (strcmp(name,
"num-rows") == 0) {
1927 }
else if (strcmp(name,
"num-filtered-rows") == 0) {
1933 }
else if (strcmp(name,
"textbox-current-entry") == 0) {
1939 }
else if (strcmp(name,
"icon-current-entry") == 0) {
1947 else if (strcmp(name,
"case-indicator") == 0) {
1949 g_error(
"Case indicator widget can only be added once to the layout.");
1962 else if (strcmp(name,
"entry") == 0) {
1963 if (state->
text != NULL) {
1964 g_error(
"Entry textbox widget can only be added once to the layout.");
1978 else if (strcmp(name,
"message") == 0) {
1980 g_error(
"Message widget can only be added once to the layout.");
1994 else if (strcmp(name,
"listview") == 0) {
1996 g_error(
"Listview widget can only be added once to the layout.");
2016 else if (strcmp(name,
"mode-switcher") == 0 || strcmp(name,
"sidebar") == 0) {
2018 g_error(
"Mode-switcher can only be added once to the layout.");
2026 for (
unsigned int j = 0; j < state->
num_modes; j++) {
2036 }
else if (g_ascii_strcasecmp(name,
"overlay") == 0) {
2042 }
else if (g_ascii_strncasecmp(name,
"textbox", 7) == 0) {
2046 }
else if (g_ascii_strncasecmp(name,
"button", 6) == 0) {
2052 }
else if (g_ascii_strncasecmp(name,
"icon", 4) == 0) {
2071 char **a = g_strsplit(defaults,
",", 0);
2072 for (
int i = 0; a && a[i]; i++) {
2078 for (
const GList *iter = g_list_first(list); iter != NULL;
2079 iter = g_list_next(iter)) {
2082 g_list_free_full(list, g_free);
2088 xcb_query_pointer_cookie_t pointer_cookie =
2090 xcb_query_pointer_reply_t *pointer_reply =
2091 xcb_query_pointer_reply(
xcb->
connection, pointer_cookie, NULL);
2093 if (pointer_reply == NULL) {
2100 free(pointer_reply);
2113 state->
quit = FALSE;
2131 TICK_N(
"Startup notification");
2134 TICK_N(
"Get active monitor");
2143 for (
const GList *iter = list; iter != NULL; iter = g_list_next(iter)) {
2145 (
const char *)iter->data);
2147 g_list_free_full(list, g_free);
2150 if (state->
text && input) {
2170 state->
quit = FALSE;
2204 NORMAL, (msg != NULL) ? msg :
"", 0, 0);
2234 if (
CacheState.main_window != XCB_WINDOW_NONE) {
2242 g_debug(
"Cleanup.");
2248 g_source_remove(
CacheState.refilter_timeout);
2271 if (
CacheState.main_window != XCB_WINDOW_NONE) {
2272 g_debug(
"Unmapping and free'ing window");
2280 if (
map != XCB_COLORMAP_NONE) {
2282 map = XCB_COLORMAP_NONE;
2285 g_assert(g_queue_is_empty(&(
CacheState.views)));
2288 TICK_N(
"Setup Threadpool, start");
2291 long procs = sysconf(_SC_NPROCESSORS_CONF);
2297 GError *error = NULL;
2300 if (error == NULL) {
2302 g_thread_pool_set_max_idle_time(60000);
2307 if (error != NULL) {
2308 g_warning(
"Failed to setup thread pool: '%s'", error->message);
2309 g_error_free(error);
2312 TICK_N(
"Setup Threadpool, done");
2316 g_thread_pool_free(
tpool, TRUE, TRUE);
2362 for (
unsigned int j = 0; j < state->
num_modes; j++) {
2378 ssize_t len = strlen(title);
2381 xcb->
ewmh.UTF8_STRING, 8, len, title);
2383 CacheState.main_window, XCB_ATOM_WM_NAME, XCB_ATOM_STRING,
PangoAttrList * helper_token_match_get_pango_attr(RofiHighlightColorStyle th, rofi_int_matcher **tokens, const char *input, PangoAttrList *retv)
gboolean helper_validate_font(PangoFontDescription *pfd, const char *font)
rofi_int_matcher ** helper_tokenize(const char *input, int case_sensitive)
void helper_tokenize_free(rofi_int_matcher **tokens)
unsigned int levenshtein(const char *needle, const glong needlelen, const char *haystack, const glong haystacklen)
char * rofi_expand_path(const char *input)
int rofi_scorer_fuzzy_evaluate(const char *pattern, glong plen, const char *str, glong slen)
guint key_binding_get_action_from_name(const char *name)
MouseBindingMouseDefaultAction
@ SCOPE_MOUSE_LISTVIEW_ELEMENT
@ SCOPE_MOUSE_MODE_SWITCHER
@ TOGGLE_CASE_SENSITIVITY
char * mode_preprocess_input(Mode *mode, const char *input)
cairo_surface_t * mode_get_icon(Mode *mode, unsigned int selected_line, unsigned int height)
const char * mode_get_display_name(const Mode *mode)
unsigned int mode_get_num_entries(const Mode *mode)
char * mode_get_message(const Mode *mode)
int mode_token_match(const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line)
char * mode_get_display_value(const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
char * mode_get_completion(const Mode *mode, unsigned int selected_line)
const Mode * rofi_get_mode(unsigned int index)
void rofi_quit_main_loop(void)
unsigned int rofi_get_num_enabled_modes(void)
void textbox_font(textbox *tb, TextBoxFontType tbft)
int textbox_keybinding(textbox *tb, KeyBindingAction action)
void textbox_set_pango_attributes(textbox *tb, PangoAttrList *list)
const char * textbox_get_visible_text(const textbox *tb)
void textbox_set_pango_context(const char *font, PangoContext *p)
textbox * textbox_create(widget *parent, WidgetType type, const char *name, TextboxFlags flags, TextBoxFontType tbft, const char *text, double xalign, double yalign)
void textbox_cursor_end(textbox *tb)
gboolean textbox_append_text(textbox *tb, const char *pad, const int pad_len)
PangoAttrList * textbox_get_pango_attributes(textbox *tb)
void textbox_text(textbox *tb, const char *text)
void rofi_view_set_overlay(RofiViewState *state, const char *text)
void __create_window(MenuFlags menu_flags)
void rofi_view_clear_input(RofiViewState *state)
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Mode * rofi_view_get_mode(RofiViewState *state)
void rofi_view_hide(void)
void rofi_view_reload(void)
xcb_window_t rofi_view_get_window(void)
void rofi_view_remove_active(RofiViewState *state)
int rofi_view_error_dialog(const char *msg, int markup)
void rofi_view_set_active(RofiViewState *state)
void rofi_view_queue_redraw(void)
RofiViewState * rofi_view_get_active(void)
void rofi_view_restart(RofiViewState *state)
void rofi_view_handle_text(RofiViewState *state, char *text)
void rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
unsigned int rofi_view_get_completed(const RofiViewState *state)
gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope, guint action)
const char * rofi_view_get_user_input(const RofiViewState *state)
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
void rofi_view_finalize(RofiViewState *state)
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
void rofi_view_frame_callback(void)
void rofi_view_free(RofiViewState *state)
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
unsigned int rofi_view_get_next_position(const RofiViewState *state)
void rofi_view_maybe_update(RofiViewState *state)
void rofi_view_ellipsize_start(RofiViewState *state)
void rofi_capture_screenshot(void)
void rofi_view_workers_initialize(void)
void rofi_view_set_window_title(const char *title)
void rofi_view_get_current_monitor(int *width, int *height)
void rofi_view_workers_finalize(void)
void box_add(box *box, widget *child, gboolean expand)
box * box_create(widget *parent, const char *name, RofiOrientation type)
void container_add(container *container, widget *child)
container * container_create(widget *parent, const char *name)
void icon_set_surface(icon *icon, cairo_surface_t *surf)
icon * icon_create(widget *parent, const char *name)
void listview_nav_page_next(listview *lv)
void listview_set_fixed_num_lines(listview *lv)
void listview_set_num_lines(listview *lv, unsigned int num_lines)
void listview_set_num_elements(listview *lv, unsigned int rows)
void listview_nav_right(listview *lv)
void listview_set_mouse_activated_cb(listview *lv, listview_mouse_activated_cb cb, void *udata)
void listview_toggle_ellipsizing(listview *lv)
void listview_set_selected(listview *lv, unsigned int selected)
void listview_set_max_lines(listview *lv, unsigned int max_lines)
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
void listview_nav_left(listview *lv)
void listview_set_scroll_type(listview *lv, ScrollType type)
void listview_set_ellipsize_start(listview *lv)
void listview_nav_prev(listview *lv)
unsigned int listview_get_selected(listview *lv)
void listview_set_filtered(listview *lv, gboolean filtered)
void listview_nav_up(listview *lv)
void listview_nav_next(listview *lv)
void listview_nav_page_prev(listview *lv)
void listview_set_selection_changed_callback(listview *lv, listview_selection_changed_callback cb, void *udata)
void listview_nav_down(listview *lv)
@ ROFI_ORIENTATION_HORIZONTAL
@ ROFI_ORIENTATION_VERTICAL
#define DEFAULT_MENU_LINES
#define DEFAULT_MENU_WIDTH
unsigned int filtered_lines
struct RofiViewState::@7 mouse
icon * icon_current_entry
void(* finalize)(struct RofiViewState *state)
textbox * tb_filtered_rows
rofi_int_matcher ** tokens
textbox * tb_current_entry
unsigned int selected_line
KeyBindingAction prev_action
unsigned int scroll_method
unsigned int case_sensitive
unsigned int sidebar_mode
unsigned int refilter_timeout_limit
SortingMethod sorting_method_enum
void(* callback)(struct _thread_state *t, gpointer data)
xcb_connection_t * connection
SnLauncheeContext * sncontext
xcb_ewmh_connection_t ewmh
GList * rofi_theme_get_list_strings(const widget *widget, const char *property)
const char * rofi_theme_get_string(const widget *widget, const char *property, const char *def)
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
int rofi_theme_get_boolean(const widget *widget, const char *property, int def)
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
Property * rofi_theme_find_property(ThemeWidget *widget, PropertyType type, const char *property, gboolean exact)
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
RofiHighlightColorStyle rofi_theme_get_highlight(widget *widget, const char *property, RofiHighlightColorStyle th)
int rofi_theme_get_integer(const widget *widget, const char *property, int def)
int rofi_theme_get_position(const widget *widget, const char *property, int def)
static void rofi_view_call_thread(gpointer data, gpointer user_data)
cairo_surface_t * fake_bg
static void rofi_view_nav_last(RofiViewState *state)
static gboolean rofi_view_repaint(G_GNUC_UNUSED void *data)
static WidgetTriggerActionResult textbox_button_trigger_action(widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x, G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data)
static void rofi_view_set_user_timeout(G_GNUC_UNUSED gpointer data)
GList * list_of_warning_msgs
static gboolean rofi_view_reload_idle(G_GNUC_UNUSED gpointer data)
static gboolean bench_update(void)
struct _thread_state_view thread_state_view
guint refilter_timeout_count
static void rofi_view_nav_row_select(RofiViewState *state)
static void rofi_view_listview_mouse_activated_cb(listview *lv, gboolean custom, void *udata)
static void rofi_view_input_changed()
cairo_surface_t * edit_surf
static void rofi_view_add_widget(RofiViewState *state, widget *parent_widget, const char *name)
static char * get_matching_state(void)
static void update_callback(textbox *t, icon *ico, unsigned int index, void *udata, TextBoxFontType *type, gboolean full)
static void rofi_view_nav_row_tab(RofiViewState *state)
static void rofi_view_setup_fake_transparency(widget *win, const char *const fake_background)
static struct @2 BenchMark
static void rofi_view_reload_message_bar(RofiViewState *state)
static void rofi_view_nav_first(RofiViewState *state)
static gboolean rofi_view_refilter_real(RofiViewState *state)
void rofi_view_update(RofiViewState *state, gboolean qr)
static const int loc_transtable[9]
static RofiViewState * __rofi_view_state_create(void)
static void rofi_view_trigger_global_action(KeyBindingAction action)
static void filter_elements(thread_state *ts, G_GNUC_UNUSED gpointer user_data)
void process_result(RofiViewState *state)
static void rofi_view_update_prompt(RofiViewState *state)
static gboolean rofi_view_user_timeout(G_GNUC_UNUSED gpointer data)
static void rofi_view_refilter(RofiViewState *state)
X11CursorType cursor_type
static int rofi_view_calculate_height(RofiViewState *state)
RofiViewState * current_active_menu
static void rofi_view_calculate_window_position(RofiViewState *state)
static void rofi_view_set_cursor(RofiCursorType type)
static void rofi_view_take_action(const char *name)
static void selection_changed_callback(G_GNUC_UNUSED listview *lv, unsigned int index, void *udata)
static void rofi_view_ping_mouse(RofiViewState *state)
static void rofi_view_window_update_size(RofiViewState *state)
static void rofi_view_calculate_window_width(RofiViewState *state)
static X11CursorType rofi_cursor_type_to_x11_cursor_type(RofiCursorType type)
static RofiCursorType rofi_view_resolve_cursor(RofiViewState *state, gint x, gint y)
static int lev_sort(const void *p1, const void *p2, void *arg)
static WidgetTriggerActionResult textbox_sidebar_modes_trigger_action(widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x, G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data)
static void _rofi_view_reload_row(RofiViewState *state)
static void rofi_view_refilter_force(RofiViewState *state)
int monitor_active(workarea *mon)
void display_early_cleanup(void)
cairo_surface_t * x11_helper_get_screenshot_surface(void)
void rofi_xcb_revert_input_focus(void)
cairo_surface_t * x11_helper_get_bg_surface(void)
void rofi_xcb_set_input_focus(xcb_window_t w)
void x11_set_cursor(xcb_window_t window, X11CursorType type)
xcb_window_t xcb_stuff_get_root_window(void)
void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
void cairo_image_surface_blur(cairo_surface_t *surface, double radius, double deviation)
void x11_disable_decoration(xcb_window_t window)
xcb_atom_t netatoms[NUM_NETATOMS]
xcb_visualtype_t * visual