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);
478 return G_SOURCE_REMOVE;
536 g_debug(
"stack view.");
541 if (state == NULL && !g_queue_is_empty(&(
CacheState.views))) {
542 g_debug(
"pop view.");
555 unsigned int selected_line) {
558 unsigned int selected = 0;
559 for (
unsigned int i = 0; ((state->
selected_line)) < UINT32_MAX && !selected &&
602 (next_pos) = state->
line_map[selected + 1];
667 G_GNUC_UNUSED gpointer user_data) {
669 for (
unsigned int i = t->
start; i < t->stop; i++) {
677 glong slen = g_utf8_strlen(str, -1);
694 g_mutex_lock(t->
mutex);
696 g_cond_signal(t->
cond);
697 g_mutex_unlock(t->
mutex);
703 const char *
const fake_background) {
705 cairo_surface_t *s = NULL;
711 if (g_strcmp0(fake_background,
"real") == 0) {
714 if (g_strcmp0(fake_background,
"screenshot") == 0) {
716 }
else if (g_strcmp0(fake_background,
"background") == 0) {
720 g_debug(
"Opening %s to use as background.", fpath);
721 s = cairo_image_surface_create_from_png(fpath);
727 if (cairo_surface_status(s) != CAIRO_STATUS_SUCCESS) {
728 g_debug(
"Failed to open surface fake background: %s",
729 cairo_status_to_string(cairo_surface_status(s)));
730 cairo_surface_destroy(s);
733 CacheState.fake_bg = cairo_image_surface_create(
737 cairo_t *dr = cairo_create(
CacheState.fake_bg);
739 cairo_set_source_surface(dr, s, 0, 0);
745 cairo_surface_destroy(s);
752 TICK_N(
"Fake transparency");
756 uint32_t selmask = XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL |
757 XCB_CW_BIT_GRAVITY | XCB_CW_BACKING_STORE |
758 XCB_CW_EVENT_MASK | XCB_CW_COLORMAP;
759 uint32_t xcb_event_masks =
760 XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS |
761 XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS |
762 XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_KEYMAP_STATE |
763 XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_FOCUS_CHANGE |
764 XCB_EVENT_MASK_BUTTON_1_MOTION | XCB_EVENT_MASK_POINTER_MOTION;
766 uint32_t selval[] = {XCB_BACK_PIXMAP_NONE, 0,
767 XCB_GRAVITY_STATIC, XCB_BACKING_STORE_NOT_USEFUL,
768 xcb_event_masks,
map};
771 xcb_void_cookie_t cc = xcb_create_window_checked(
773 0, 200, 100, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
visual->visual_id, selmask,
775 xcb_generic_error_t *error;
778 g_error(
"xcb_create_window() failed error=0x%x\n", error->error_code);
781 TICK_N(
"xcb create window");
791 CacheState.edit_surf = cairo_xcb_surface_create(
795 TICK_N(
"create cairo surface");
797 cairo_font_options_t *fo = cairo_font_options_create();
799 cairo_surface_get_font_options(
CacheState.edit_surf, fo);
801 PangoContext *p = pango_cairo_create_context(
CacheState.edit_draw);
803 pango_cairo_context_set_font_options(p, fo);
804 TICK_N(
"pango cairo font setup");
811 PangoFontMap *font_map = pango_cairo_font_map_get_default();
812 pango_cairo_font_map_set_resolution((PangoCairoFontMap *)font_map,
820 dpi = (
xcb->
screen->height_in_pixels * 25.4) /
821 (
double)(
xcb->
screen->height_in_millimeters);
824 g_debug(
"Auto-detected DPI: %.2lf", dpi);
825 PangoFontMap *font_map = pango_cairo_font_map_get_default();
826 pango_cairo_font_map_set_resolution((PangoCairoFontMap *)font_map, dpi);
830 PangoFontMap *font_map = pango_cairo_font_map_get_default();
832 pango_cairo_font_map_get_resolution((PangoCairoFontMap *)font_map);
840 PangoFontDescription *pfd = pango_font_description_from_string(font);
842 pango_context_set_font_description(p, pfd);
844 pango_font_description_free(pfd);
846 PangoLanguage *l = pango_language_get_default();
847 pango_context_set_language(p, l);
854 cairo_font_options_destroy(fo);
860 &(
xcb->
ewmh._NET_WM_STATE_ABOVE), 1);
861 uint32_t values[] = {1};
863 XCB_CW_OVERRIDE_REDIRECT, values);
866 &(
xcb->
ewmh._NET_WM_WINDOW_TYPE_NORMAL), 1);
870 TICK_N(
"setup window attributes");
874 xcb_atom_t atoms[] = {
xcb->
ewmh._NET_WM_STATE_FULLSCREEN,
875 xcb->
ewmh._NET_WM_STATE_ABOVE};
877 sizeof(atoms) /
sizeof(xcb_atom_t));
880 xcb_atom_t protocols[] = {
netatoms[WM_TAKE_FOCUS]};
882 xcb->
ewmh.WM_PROTOCOLS, G_N_ELEMENTS(protocols),
885 TICK_N(
"setup window fullscreen");
888 const char wm_class_name[] =
"rofi\0Rofi";
889 xcb_icccm_set_wm_class(
xcb->
connection, box_window,
sizeof(wm_class_name),
892 TICK_N(
"setup window name and class");
893 const char *transparency =
901 TICK_N(
"setup startup notification");
906 pid_t pid = getpid();
910 const char *hostname = g_get_host_name();
911 char *ahost = g_hostname_to_ascii(hostname);
914 XCB_ATOM_STRING, 8, strlen(ahost), ahost);
933 "width", state->
width);
976 if (selected < state->filtered_lines) {
1013 GList *add_list = NULL;
1016 &fstate, &add_list, TRUE);
1024 pango_attr_list_ref(list);
1026 list = pango_attr_list_new();
1030 cairo_surface_t *
icon =
1037 {0.0, 0.0, 0.0, 0.0}};
1042 for (GList *iter = g_list_first(add_list); iter != NULL;
1043 iter = g_list_next(iter)) {
1044 pango_attr_list_insert(list, (PangoAttribute *)(iter->data));
1047 pango_attr_list_unref(list);
1048 g_list_free(add_list);
1064 g_debug(
"Redraw view");
1067 cairo_set_operator(d, CAIRO_OPERATOR_SOURCE);
1070 cairo_set_source_surface(d,
CacheState.fake_bg, 0.0, 0.0);
1072 cairo_set_source_surface(d,
CacheState.fake_bg,
1077 cairo_set_operator(d, CAIRO_OPERATOR_OVER);
1080 cairo_set_source_rgba(d, 0, 0, 0, 0.0);
1086 cairo_set_operator(d, CAIRO_OPERATOR_OVER);
1107 if (state->
sw == NULL) {
1115 TICK_N(
"Filter reload rows");
1120 TICK_N(
"Filter tokenize");
1124 glong plen = pattern ? g_utf8_strlen(pattern, -1) : 0;
1133 unsigned int nt = MAX(1, state->
num_lines / 500);
1137 g_mutex_init(&mutex);
1139 unsigned int count = nt;
1140 unsigned int steps = (state->
num_lines + nt) / nt;
1141 for (
unsigned int i = 0; i < nt; i++) {
1142 states[i].
state = state;
1143 states[i].
start = i * steps;
1145 states[i].
count = 0;
1146 states[i].
cond = &cond;
1147 states[i].
mutex = &mutex;
1149 states[i].
plen = plen;
1153 g_thread_pool_push(
tpool, &states[i], NULL);
1160 g_mutex_lock(&mutex);
1162 g_cond_wait(&cond, &mutex);
1164 g_mutex_unlock(&mutex);
1166 g_cond_clear(&cond);
1167 g_mutex_clear(&mutex);
1168 for (
unsigned int i = 0; i < nt; i++) {
1169 if (j != states[i].start) {
1171 sizeof(
unsigned int) * (states[i].
count));
1173 j += states[i].
count;
1184 for (
unsigned int i = 0; i < state->
num_lines; i++) {
1189 TICK_N(
"Filter matching done");
1198 char *r = g_strdup_printf(
"%u", state->
num_lines);
1202 TICK_N(
"Update filter lines");
1214 if (height != state->
height) {
1218 g_debug(
"Resize based on re-filter");
1220 TICK_N(
"Filter resize window based on window ");
1231 if (state && state->
finalize != NULL) {
1248 XCB_ATOM_PRIMARY,
xcb->
ewmh.UTF8_STRING,
1249 xcb->
ewmh.UTF8_STRING, XCB_CURRENT_TIME);
1255 xcb->
ewmh.UTF8_STRING, XCB_CURRENT_TIME);
1287 if (selected < state->filtered_lines) {
1306 if (selected < state->filtered_lines) {
1324 if (index < state->filtered_lines) {
1352 if (selected < state->filtered_lines) {
1424 }
else if (rc == 2) {
1432 if (selected < state->filtered_lines) {
1459 if (selected < state->filtered_lines) {
1486 if (target == NULL) {
1519 if (target == NULL) {
1583 gboolean find_mouse_target) {
1591 if (find_mouse_target) {
1595 if (target != NULL) {
1604 if (find_mouse_target) {
1618 if (state == NULL) {
1637 xcb_configure_notify_event_t *xce) {
1639 if (state->
x != xce->x || state->
y != xce->y) {
1644 if (state->
width != xce->width || state->
height != xce->height) {
1645 state->
width = xce->width;
1646 state->
height = xce->height;
1660 g_debug(
"Re-size window based external request: %d %d", state->
width,
1705 G_GNUC_UNUSED gint y, G_GNUC_UNUSED
void *user_data) {
1718 if (
id != UINT32_MAX) {
1734 G_GNUC_UNUSED gint y, G_GNUC_UNUSED
void *user_data) {
1737 for (i = 0; i < state->
num_modi; i++) {
1776 char *defaults = NULL;
1782 if (strcmp(name,
"mainbox") == 0) {
1786 defaults =
"inputbar,message,listview,mode-switcher";
1788 defaults =
"inputbar,message,listview";
1794 else if (strcmp(name,
"inputbar") == 0) {
1797 defaults =
"prompt,entry,overlay,case-indicator";
1803 else if (strcmp(name,
"prompt") == 0) {
1804 if (state->
prompt != NULL) {
1805 g_error(
"Prompt widget can only be added once to the layout.");
1815 }
else if (strcmp(name,
"num-rows") == 0) {
1821 }
else if (strcmp(name,
"num-filtered-rows") == 0) {
1831 else if (strcmp(name,
"case-indicator") == 0) {
1833 g_error(
"Case indicator widget can only be added once to the layout.");
1846 else if (strcmp(name,
"entry") == 0) {
1847 if (state->
text != NULL) {
1848 g_error(
"Entry textbox widget can only be added once to the layout.");
1862 else if (strcmp(name,
"message") == 0) {
1864 g_error(
"Message widget can only be added once to the layout.");
1878 else if (strcmp(name,
"listview") == 0) {
1880 g_error(
"Listview widget can only be added once to the layout.");
1902 else if (strcmp(name,
"mode-switcher") == 0 || strcmp(name,
"sidebar") == 0) {
1904 g_error(
"Mode-switcher can only be added once to the layout.");
1912 for (
unsigned int j = 0; j < state->
num_modi; j++) {
1922 }
else if (g_ascii_strcasecmp(name,
"overlay") == 0) {
1928 }
else if (g_ascii_strncasecmp(name,
"textbox", 7) == 0) {
1932 }
else if (g_ascii_strncasecmp(name,
"button", 6) == 0) {
1938 }
else if (g_ascii_strncasecmp(name,
"icon", 4) == 0) {
1957 char **a = g_strsplit(defaults,
",", 0);
1958 for (
int i = 0; a && a[i]; i++) {
1964 for (
const GList *iter = g_list_first(list); iter != NULL;
1965 iter = g_list_next(iter)) {
1968 g_list_free_full(list, g_free);
1974 xcb_query_pointer_cookie_t pointer_cookie =
1976 xcb_query_pointer_reply_t *pointer_reply =
1977 xcb_query_pointer_reply(
xcb->
connection, pointer_cookie, NULL);
1979 if (pointer_reply == NULL) {
1986 free(pointer_reply);
1999 state->
quit = FALSE;
2017 TICK_N(
"Startup notification");
2020 TICK_N(
"Get active monitor");
2029 for (
const GList *iter = list; iter != NULL; iter = g_list_next(iter)) {
2031 (
const char *)iter->data);
2033 g_list_free_full(list, g_free);
2036 if (state->
text && input) {
2056 state->
quit = FALSE;
2090 NORMAL, (msg != NULL) ? msg :
"", 0, 0);
2120 if (
CacheState.main_window != XCB_WINDOW_NONE) {
2128 g_debug(
"Cleanup.");
2153 if (
CacheState.main_window != XCB_WINDOW_NONE) {
2154 g_debug(
"Unmapping and free'ing window");
2162 if (
map != XCB_COLORMAP_NONE) {
2164 map = XCB_COLORMAP_NONE;
2167 g_assert(g_queue_is_empty(&(
CacheState.views)));
2170 TICK_N(
"Setup Threadpool, start");
2173 long procs = sysconf(_SC_NPROCESSORS_CONF);
2179 GError *error = NULL;
2182 if (error == NULL) {
2184 g_thread_pool_set_max_idle_time(60000);
2189 if (error != NULL) {
2190 g_warning(
"Failed to setup thread pool: '%s'", error->message);
2191 g_error_free(error);
2194 TICK_N(
"Setup Threadpool, done");
2198 g_thread_pool_free(
tpool, TRUE, TRUE);
2244 for (
unsigned int j = 0; j < state->
num_modi; j++) {
2259 ssize_t len = strlen(title);
2262 xcb->
ewmh.UTF8_STRING, 8, len, title);
2264 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)
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)
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)
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
GList * rofi_theme_get_list_strings(const widget *widget, const char *property)
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)
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)
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 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_take_action(const char *name)
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