29 #define G_LOG_DOMAIN "View"
41 #include <xcb/xcb_ewmh.h>
42 #include <xcb/xcb_icccm.h>
44 #include <xkbcommon/xkbcommon-x11.h>
46 #include <cairo-xcb.h>
50 #define SN_API_NOT_YET_FROZEN
125 .main_window = XCB_WINDOW_NONE,
131 .views = G_QUEUE_INIT,
163 static int lev_sort(
const void *p1,
const void *p2,
void *arg) {
166 int *distances = arg;
168 return distances[*a] - distances[*b];
175 const char *outp = g_getenv(
"ROFI_PNG_OUTPUT");
178 g_warning(
"There is no rofi surface to store");
181 const char *xdg_pict_dir = g_get_user_special_dir(G_USER_DIRECTORY_PICTURES);
182 if (outp == NULL && xdg_pict_dir == NULL) {
183 g_warning(
"XDG user picture directory or ROFI_PNG_OUTPUT is not set. "
184 "Cannot store screenshot.");
188 GDateTime *now = g_date_time_new_now_local();
190 char *timestmp = g_date_time_format(now,
"rofi-%Y-%m-%d-%H%M");
191 char *filename = g_strdup_printf(
"%s-%05d.png", timestmp, 0);
196 fpath = g_build_filename(xdg_pict_dir, filename, NULL);
197 while (g_file_test(fpath, G_FILE_TEST_EXISTS) && index < 99) {
203 filename = g_strdup_printf(
"%s-%05d.png", timestmp, index);
205 fpath = g_build_filename(xdg_pict_dir, filename, NULL);
208 fpath = g_strdup(outp);
211 cairo_status_t status =
212 cairo_surface_write_to_png(
CacheState.edit_surf, fpath);
213 if (status != CAIRO_STATUS_SUCCESS) {
214 g_warning(
"Failed to produce screenshot '%s', got error: '%s'", fpath,
215 cairo_status_to_string(status));
220 g_date_time_unref(now);
241 }
BenchMark = {.time = NULL, .draws = 0, .last_ts = 0.0, .min = G_MAXDOUBLE};
253 double ts = g_timer_elapsed(
BenchMark.time, NULL);
254 double fps = 1024 / (ts -
BenchMark.last_ts);
259 printf(
"current: %.2f fps, avg: %.2f fps, min: %.2f fps, %lu draws\r\n",
273 g_debug(
"expose event");
282 return (
bench_update() == TRUE) ? G_SOURCE_CONTINUE : G_SOURCE_REMOVE;
311 int anchor = location;
316 }
else if (location ==
WL_EAST) {
318 }
else if (location ==
WL_WEST) {
368 state->
x -= state->
width / 2;
381 state->
x -= state->
width / 2;
392 state->
x -= state->
width / 2;
410 uint16_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
411 XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
412 uint32_t vals[] = {state->
x, state->
y, state->
width, state->
height};
429 g_debug(
"Re-size window based internal request: %dx%d.", state->
width,
456 return G_SOURCE_REMOVE;
465 const char *action = p->
value.
s;
467 if (
id != UINT32_MAX) {
470 g_warning(
"Failed to parse keybinding: %s\r\n", action);
474 return G_SOURCE_REMOVE;
532 g_debug(
"stack view.");
537 if (state == NULL && !g_queue_is_empty(&(
CacheState.views))) {
538 g_debug(
"pop view.");
551 unsigned int selected_line) {
554 unsigned int selected = 0;
555 for (
unsigned int i = 0; ((state->
selected_line)) < UINT32_MAX && !selected &&
598 (next_pos) = state->
line_map[selected + 1];
663 G_GNUC_UNUSED gpointer user_data) {
665 for (
unsigned int i = t->
start; i < t->stop; i++) {
673 glong slen = g_utf8_strlen(str, -1);
690 g_mutex_lock(t->
mutex);
692 g_cond_signal(t->
cond);
693 g_mutex_unlock(t->
mutex);
699 const char *
const fake_background) {
701 cairo_surface_t *s = NULL;
707 if (g_strcmp0(fake_background,
"real") == 0) {
710 if (g_strcmp0(fake_background,
"screenshot") == 0) {
712 }
else if (g_strcmp0(fake_background,
"background") == 0) {
716 g_debug(
"Opening %s to use as background.", fpath);
717 s = cairo_image_surface_create_from_png(fpath);
723 if (cairo_surface_status(s) != CAIRO_STATUS_SUCCESS) {
724 g_debug(
"Failed to open surface fake background: %s",
725 cairo_status_to_string(cairo_surface_status(s)));
726 cairo_surface_destroy(s);
729 CacheState.fake_bg = cairo_image_surface_create(
733 cairo_t *dr = cairo_create(
CacheState.fake_bg);
735 cairo_set_source_surface(dr, s, 0, 0);
741 cairo_surface_destroy(s);
748 TICK_N(
"Fake transparency");
752 uint32_t selmask = XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL |
753 XCB_CW_BIT_GRAVITY | XCB_CW_BACKING_STORE |
754 XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
755 uint32_t xcb_event_masks =
756 XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS |
757 XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS |
758 XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_KEYMAP_STATE |
759 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_FOCUS_CHANGE |
760 XCB_EVENT_MASK_BUTTON_1_MOTION | XCB_EVENT_MASK_POINTER_MOTION;
762 uint32_t selval[] = {XCB_BACK_PIXMAP_NONE, 0,
763 XCB_GRAVITY_STATIC, XCB_BACKING_STORE_NOT_USEFUL,
764 xcb_event_masks,
map};
767 xcb_void_cookie_t cc = xcb_create_window_checked(
769 0, 200, 100, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
visual->visual_id, selmask,
771 xcb_generic_error_t *error;
774 g_error(
"xcb_create_window() failed error=0x%x\n", error->error_code);
777 TICK_N(
"xcb create window");
787 CacheState.edit_surf = cairo_xcb_surface_create(
791 TICK_N(
"create cairo surface");
793 cairo_font_options_t *fo = cairo_font_options_create();
795 cairo_surface_get_font_options(
CacheState.edit_surf, fo);
797 PangoContext *p = pango_cairo_create_context(
CacheState.edit_draw);
799 pango_cairo_context_set_font_options(p, fo);
800 TICK_N(
"pango cairo font setup");
807 PangoFontMap *font_map = pango_cairo_font_map_get_default();
808 pango_cairo_font_map_set_resolution((PangoCairoFontMap *)font_map,
816 dpi = (
xcb->
screen->height_in_pixels * 25.4) /
817 (
double)(
xcb->
screen->height_in_millimeters);
820 g_debug(
"Auto-detected DPI: %.2lf", dpi);
821 PangoFontMap *font_map = pango_cairo_font_map_get_default();
822 pango_cairo_font_map_set_resolution((PangoCairoFontMap *)font_map, dpi);
826 PangoFontMap *font_map = pango_cairo_font_map_get_default();
828 pango_cairo_font_map_get_resolution((PangoCairoFontMap *)font_map);
836 PangoFontDescription *pfd = pango_font_description_from_string(font);
838 pango_context_set_font_description(p, pfd);
840 pango_font_description_free(pfd);
842 PangoLanguage *l = pango_language_get_default();
843 pango_context_set_language(p, l);
850 cairo_font_options_destroy(fo);
856 &(
xcb->
ewmh._NET_WM_STATE_ABOVE), 1);
857 uint32_t values[] = {1};
859 XCB_CW_OVERRIDE_REDIRECT, values);
862 &(
xcb->
ewmh._NET_WM_WINDOW_TYPE_NORMAL), 1);
866 TICK_N(
"setup window attributes");
870 xcb_atom_t atoms[] = {
xcb->
ewmh._NET_WM_STATE_FULLSCREEN,
871 xcb->
ewmh._NET_WM_STATE_ABOVE};
873 sizeof(atoms) /
sizeof(xcb_atom_t));
876 xcb_atom_t protocols[] = {
netatoms[WM_TAKE_FOCUS]};
878 xcb->
ewmh.WM_PROTOCOLS, G_N_ELEMENTS(protocols),
881 TICK_N(
"setup window fullscreen");
884 const char wm_class_name[] =
"rofi\0Rofi";
885 xcb_icccm_set_wm_class(
xcb->
connection, box_window,
sizeof(wm_class_name),
888 TICK_N(
"setup window name and class");
889 const char *transparency =
897 TICK_N(
"setup startup notification");
902 pid_t pid = getpid();
906 const char *hostname = g_get_host_name();
907 char *ahost = g_hostname_to_ascii(hostname);
910 XCB_ATOM_STRING, 8, strlen(ahost), ahost);
929 "width", state->
width);
972 if (selected < state->filtered_lines) {
1009 GList *add_list = NULL;
1012 &fstate, &add_list, TRUE);
1020 pango_attr_list_ref(list);
1022 list = pango_attr_list_new();
1026 cairo_surface_t *
icon =
1033 {0.0, 0.0, 0.0, 0.0}};
1038 for (GList *iter = g_list_first(add_list); iter != NULL;
1039 iter = g_list_next(iter)) {
1040 pango_attr_list_insert(list, (PangoAttribute *)(iter->data));
1043 pango_attr_list_unref(list);
1044 g_list_free(add_list);
1060 g_debug(
"Redraw view");
1063 cairo_set_operator(d, CAIRO_OPERATOR_SOURCE);
1066 cairo_set_source_surface(d,
CacheState.fake_bg, 0.0, 0.0);
1068 cairo_set_source_surface(d,
CacheState.fake_bg,
1073 cairo_set_operator(d, CAIRO_OPERATOR_OVER);
1076 cairo_set_source_rgba(d, 0, 0, 0, 0.0);
1082 cairo_set_operator(d, CAIRO_OPERATOR_OVER);
1103 if (state->
sw == NULL) {
1111 TICK_N(
"Filter reload rows");
1116 TICK_N(
"Filter tokenize");
1120 glong plen = pattern ? g_utf8_strlen(pattern, -1) : 0;
1129 unsigned int nt = MAX(1, state->
num_lines / 500);
1133 g_mutex_init(&mutex);
1135 unsigned int count = nt;
1136 unsigned int steps = (state->
num_lines + nt) / nt;
1137 for (
unsigned int i = 0; i < nt; i++) {
1138 states[i].
state = state;
1139 states[i].
start = i * steps;
1141 states[i].
count = 0;
1142 states[i].
cond = &cond;
1143 states[i].
mutex = &mutex;
1145 states[i].
plen = plen;
1149 g_thread_pool_push(
tpool, &states[i], NULL);
1156 g_mutex_lock(&mutex);
1158 g_cond_wait(&cond, &mutex);
1160 g_mutex_unlock(&mutex);
1162 g_cond_clear(&cond);
1163 g_mutex_clear(&mutex);
1164 for (
unsigned int i = 0; i < nt; i++) {
1165 if (j != states[i].start) {
1167 sizeof(
unsigned int) * (states[i].
count));
1169 j += states[i].
count;
1180 for (
unsigned int i = 0; i < state->
num_lines; i++) {
1185 TICK_N(
"Filter matching done");
1194 char *r = g_strdup_printf(
"%u", state->
num_lines);
1198 TICK_N(
"Update filter lines");
1210 if (height != state->
height) {
1214 g_debug(
"Resize based on re-filter");
1216 TICK_N(
"Filter resize window based on window ");
1227 if (state && state->
finalize != NULL) {
1238 XCB_ATOM_PRIMARY,
xcb->
ewmh.UTF8_STRING,
1239 xcb->
ewmh.UTF8_STRING, XCB_CURRENT_TIME);
1245 xcb->
ewmh.UTF8_STRING, XCB_CURRENT_TIME);
1277 if (selected < state->filtered_lines) {
1296 if (selected < state->filtered_lines) {
1314 if (index < state->filtered_lines) {
1342 if (selected < state->filtered_lines) {
1413 }
else if (rc == 2) {
1421 if (selected < state->filtered_lines) {
1448 if (selected < state->filtered_lines) {
1477 if (target == NULL) {
1541 gboolean find_mouse_target) {
1549 if (find_mouse_target) {
1553 if (target != NULL) {
1562 if (find_mouse_target) {
1576 if (state == NULL) {
1595 xcb_configure_notify_event_t *xce) {
1597 if (state->
x != xce->x || state->
y != xce->y) {
1602 if (state->
width != xce->width || state->
height != xce->height) {
1603 state->
width = xce->width;
1604 state->
height = xce->height;
1618 g_debug(
"Re-size window based external request: %d %d", state->
width,
1663 G_GNUC_UNUSED gint y, G_GNUC_UNUSED
void *user_data) {
1672 if (
id != UINT32_MAX) {
1688 G_GNUC_UNUSED gint y, G_GNUC_UNUSED
void *user_data) {
1691 for (i = 0; i < state->
num_modi; i++) {
1730 char *defaults = NULL;
1736 if (strcmp(name,
"mainbox") == 0) {
1740 defaults =
"inputbar,message,listview,mode-switcher";
1742 defaults =
"inputbar,message,listview";
1748 else if (strcmp(name,
"inputbar") == 0) {
1751 defaults =
"prompt,entry,overlay,case-indicator";
1757 else if (strcmp(name,
"prompt") == 0) {
1758 if (state->
prompt != NULL) {
1759 g_error(
"Prompt widget can only be added once to the layout.");
1769 }
else if (strcmp(name,
"num-rows") == 0) {
1775 }
else if (strcmp(name,
"num-filtered-rows") == 0) {
1785 else if (strcmp(name,
"case-indicator") == 0) {
1787 g_error(
"Case indicator widget can only be added once to the layout.");
1800 else if (strcmp(name,
"entry") == 0) {
1801 if (state->
text != NULL) {
1802 g_error(
"Entry textbox widget can only be added once to the layout.");
1816 else if (strcmp(name,
"message") == 0) {
1818 g_error(
"Message widget can only be added once to the layout.");
1832 else if (strcmp(name,
"listview") == 0) {
1834 g_error(
"Listview widget can only be added once to the layout.");
1856 else if (strcmp(name,
"mode-switcher") == 0 || strcmp(name,
"sidebar") == 0) {
1858 g_error(
"Mode-switcher can only be added once to the layout.");
1866 for (
unsigned int j = 0; j < state->
num_modi; j++) {
1876 }
else if (g_ascii_strcasecmp(name,
"overlay") == 0) {
1882 }
else if (g_ascii_strncasecmp(name,
"textbox", 7) == 0) {
1886 }
else if (g_ascii_strncasecmp(name,
"button", 6) == 0) {
1892 }
else if (g_ascii_strncasecmp(name,
"icon", 4) == 0) {
1909 for (
const GList *iter = list; iter != NULL; iter = g_list_next(iter)) {
1912 g_list_free_full(list, g_free);
1917 xcb_query_pointer_cookie_t pointer_cookie =
1919 xcb_query_pointer_reply_t *pointer_reply =
1920 xcb_query_pointer_reply(
xcb->
connection, pointer_cookie, NULL);
1922 if (pointer_reply == NULL) {
1929 free(pointer_reply);
1942 state->
quit = FALSE;
1960 TICK_N(
"Startup notification");
1963 TICK_N(
"Get active monitor");
1969 for (
const GList *iter = list; iter != NULL; iter = g_list_next(iter)) {
1971 (
const char *)iter->data);
1973 g_list_free_full(list, g_free);
1975 if (state->
text && input) {
1997 state->
quit = FALSE;
2031 NORMAL, (msg != NULL) ? msg :
"", 0, 0);
2064 if (
CacheState.main_window != XCB_WINDOW_NONE) {
2072 g_debug(
"Cleanup.");
2097 if (
CacheState.main_window != XCB_WINDOW_NONE) {
2098 g_debug(
"Unmapping and free'ing window");
2106 if (
map != XCB_COLORMAP_NONE) {
2108 map = XCB_COLORMAP_NONE;
2111 g_assert(g_queue_is_empty(&(
CacheState.views)));
2114 TICK_N(
"Setup Threadpool, start");
2117 long procs = sysconf(_SC_NPROCESSORS_CONF);
2123 GError *error = NULL;
2126 if (error == NULL) {
2128 g_thread_pool_set_max_idle_time(60000);
2133 if (error != NULL) {
2134 g_warning(
"Failed to setup thread pool: '%s'", error->message);
2135 g_error_free(error);
2138 TICK_N(
"Setup Threadpool, done");
2142 g_thread_pool_free(
tpool, TRUE, TRUE);
2188 for (
unsigned int j = 0; j < state->
num_modi; j++) {
2203 ssize_t len = strlen(title);
2206 xcb->
ewmh.UTF8_STRING, 8, len, title);
2208 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)
void helper_tokenize_free(rofi_int_matcher **tokens)
unsigned int levenshtein(const char *needle, const glong needlelen, const char *haystack, const glong haystacklen)
int rofi_scorer_fuzzy_evaluate(const char *pattern, glong plen, const char *str, glong slen)
char * rofi_expand_path(const char *input)
rofi_int_matcher ** helper_tokenize(const char *input, int case_sensitive)
guint key_binding_get_action_from_name(const char *name)
MouseBindingMouseDefaultAction
@ SCOPE_MOUSE_LISTVIEW_ELEMENT
@ SCOPE_MOUSE_MODE_SWITCHER
@ TOGGLE_CASE_SENSITIVITY
char * mode_get_completion(const Mode *mode, unsigned int selected_line)
unsigned int mode_get_num_entries(const Mode *mode)
const char * mode_get_display_name(const Mode *mode)
char * mode_get_display_value(const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
char * mode_preprocess_input(Mode *mode, const char *input)
int mode_token_match(const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line)
char * mode_get_message(const Mode *mode)
cairo_surface_t * mode_get_icon(const Mode *mode, unsigned int selected_line, int height)
void rofi_quit_main_loop(void)
unsigned int rofi_get_num_enabled_modi(void)
const Mode * rofi_get_mode(unsigned int index)
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)
PangoAttrList * textbox_get_pango_attributes(textbox *tb)
textbox * textbox_create(widget *parent, WidgetType type, const char *name, TextboxFlags flags, TextBoxFontType tbft, const char *text, double xalign, double yalign)
void textbox_set_pango_context(const char *font, PangoContext *p)
void textbox_cursor_end(textbox *tb)
gboolean textbox_append_text(textbox *tb, const char *pad, const int pad_len)
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)
void rofi_view_hide(void)
void rofi_view_reload(void)
Mode * rofi_view_get_mode(RofiViewState *state)
xcb_window_t rofi_view_get_window(void)
void rofi_view_remove_active(RofiViewState *state)
RofiViewState * rofi_view_get_active(void)
int rofi_view_error_dialog(const char *msg, int markup)
void rofi_view_set_active(RofiViewState *state)
void rofi_view_queue_redraw(void)
void rofi_view_restart(RofiViewState *state)
void rofi_view_handle_text(RofiViewState *state, char *text)
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
unsigned int rofi_view_get_completed(const RofiViewState *state)
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
gboolean rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
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)
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
void rofi_view_frame_callback(void)
void rofi_view_free(RofiViewState *state)
const char * rofi_view_get_user_input(const RofiViewState *state)
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)
container * container_create(widget *parent, const char *name)
void container_add(container *container, widget *child)
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)
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
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)
void listview_nav_left(listview *lv)
void listview_set_scroll_type(listview *lv, ScrollType type)
gboolean listview_get_fixed_num_lines(listview *lv)
void listview_set_ellipsize_start(listview *lv)
unsigned int listview_get_selected(listview *lv)
void listview_set_multi_select(listview *lv, gboolean enable)
void listview_nav_up(listview *lv)
void listview_nav_page_prev(listview *lv)
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
void(* finalize)(struct RofiViewState *state)
textbox * tb_filtered_rows
rofi_int_matcher ** tokens
unsigned int selected_line
KeyBindingAction prev_action
unsigned int scroll_method
unsigned int case_sensitive
unsigned int sidebar_mode
SortingMethod sorting_method_enum
void(* callback)(struct _thread_state *t, gpointer data)
xcb_connection_t * connection
SnLauncheeContext * sncontext
xcb_ewmh_connection_t ewmh
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
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)
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)
GList * rofi_theme_get_list(const widget *widget, const char *property, const char *defaults)
int rofi_theme_get_position(const widget *widget, const char *property, int def)
const char * rofi_theme_get_string(const widget *widget, const char *property, const char *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 char * get_matching_state(void)
static void rofi_view_set_user_timeout(G_GNUC_UNUSED gpointer data)
static gboolean rofi_view_reload_idle(G_GNUC_UNUSED gpointer data)
static gboolean bench_update(void)
struct _thread_state_view thread_state_view
static RofiViewState * __rofi_view_state_create(void)
static void rofi_view_nav_row_select(RofiViewState *state)
static void rofi_view_listview_mouse_activated_cb(listview *lv, gboolean custom, void *udata)
cairo_surface_t * edit_surf
static void rofi_view_add_widget(RofiViewState *state, widget *parent_widget, const char *name)
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)
void rofi_view_update(RofiViewState *state, gboolean qr)
static const int loc_transtable[9]
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 WidgetTriggerActionResult textbox_sidebar_modi_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_cursor(RofiCursorType type)
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 void _rofi_view_reload_row(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)
void rofi_xcb_set_input_focus(xcb_window_t w)
void x11_set_cursor(xcb_window_t window, X11CursorType type)
cairo_surface_t * x11_helper_get_bg_surface(void)
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