29#define G_LOG_DOMAIN "Modes.Window"
38#include <wayland-client.h>
51#include "ext-foreign-toplevel-list-v1-protocol.h"
52#include "wlr-foreign-toplevel-management-unstable-v1-protocol.h"
54#define EXT_FOREIGN_TOPLEVEL_VERSION 1
55#define WLR_FOREIGN_TOPLEVEL_VERSION 3
57enum WaylandWindowMatchingFields {
58 WW_MATCH_FIELD_TITLE = 1 << 0,
59 WW_MATCH_FIELD_APP_ID = 1 << 1,
60 WW_MATCH_FIELD_ALL = ~0,
63typedef struct _WaylandWindowModePrivateData {
65 struct wl_registry *registry;
66 struct ext_foreign_toplevel_list_v1 *list;
67 struct zwlr_foreign_toplevel_manager_v1 *manager;
77} WaylandWindowModePrivateData;
79enum ForeignToplevelState {
80 TOPLEVEL_STATE_MAXIMIZED = 1
81 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED,
82 TOPLEVEL_STATE_MINIMIZED = 1
83 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MINIMIZED,
84 TOPLEVEL_STATE_ACTIVATED = 1
85 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED,
86 TOPLEVEL_STATE_FULLSCREEN =
87 1 << ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN,
88 TOPLEVEL_STATE_CLOSED = 1 << 4
92 struct ext_foreign_toplevel_handle_v1 *handle;
93 WaylandWindowModePrivateData *view;
98} ExtForeignToplevelHandle;
101 struct zwlr_foreign_toplevel_handle_v1 *handle;
102 WaylandWindowModePrivateData *view;
111 unsigned int cached_icon_uid;
112 unsigned int cached_icon_size;
113 guint cached_icon_scale;
114} WlrForeignToplevelHandle;
116static void ext_foreign_toplevel_handle_free(ExtForeignToplevelHandle *self) {
118 ext_foreign_toplevel_handle_v1_destroy(self->handle);
121 g_free(self->app_id);
122 g_free(self->identifier);
126static void wlr_foreign_toplevel_handle_free(WlrForeignToplevelHandle *self) {
128 zwlr_foreign_toplevel_handle_v1_destroy(self->handle);
132 g_free(self->app_id);
134 if (self->identifier) {
135 g_free(self->identifier);
136 self->identifier = NULL;
143static void wlr_toplevels_set_one_identifier(gpointer data, gpointer user_data) {
144 GList *wlr_toplevels = (GList *)user_data;
145 ExtForeignToplevelHandle *entry = (ExtForeignToplevelHandle *)data;
152 WlrForeignToplevelHandle *toplevel =
153 (WlrForeignToplevelHandle *)(wlr_toplevels->data);
155 if (toplevel->identifier)
continue;
156 if (g_strcmp0(toplevel->app_id, entry->app_id) != 0)
continue;
158 g_debug(
"matched ext window %p to wlr window %p via app_id=%s, "
159 "assigning identifier=%s",
160 (
void *)entry, (
void *)toplevel, entry->app_id, entry->identifier);
161 toplevel->identifier = g_strdup(entry->identifier);
164 }
while ((wlr_toplevels = g_list_next(wlr_toplevels)) != NULL);
167static void toplevels_list_update_max_len(gpointer data, gpointer user_data) {
168 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)user_data;
169 WlrForeignToplevelHandle *entry = (WlrForeignToplevelHandle *)data;
171 pd->title_len = MAX(entry->title_len, pd->title_len);
172 pd->app_id_len = MAX(entry->app_id_len, pd->app_id_len);
176static void wayland_window_update_toplevel(WlrForeignToplevelHandle *toplevel) {
177 WaylandWindowModePrivateData *pd = toplevel->view;
181 toplevels_list_update_max_len(toplevel, pd);
186 g_list_foreach(pd->wlr_toplevels, toplevels_list_update_max_len, pd);
193static void wlr_foreign_toplevel_handle_activate(WlrForeignToplevelHandle *self,
194 struct wl_seat *seat) {
195 zwlr_foreign_toplevel_handle_v1_activate(self->handle, seat);
198static void wlr_foreign_toplevel_handle_close(WlrForeignToplevelHandle *self) {
199 zwlr_foreign_toplevel_handle_v1_close(self->handle);
204static void ext_foreign_toplevel_handle_done(
205 void *data, G_GNUC_UNUSED
struct ext_foreign_toplevel_handle_v1 *handle) {
206 ExtForeignToplevelHandle *self = (ExtForeignToplevelHandle *)data;
208 g_debug(
"ext window %p id=%s identifier=%s", (
void *)self,
209 self->app_id, self->identifier);
212static void ext_foreign_toplevel_handle_closed(
213 void *data, G_GNUC_UNUSED
struct ext_foreign_toplevel_handle_v1 *handle) {
214 ExtForeignToplevelHandle *self = (ExtForeignToplevelHandle *)data;
217 self->view->ext_toplevels = g_list_remove(self->view->ext_toplevels, self);
218 ext_foreign_toplevel_handle_free(self);
221static void ext_foreign_toplevel_handle_identifier(
222 void *data, G_GNUC_UNUSED
struct ext_foreign_toplevel_handle_v1 *handle,
223 const char *identifier) {
224 ExtForeignToplevelHandle *self = (ExtForeignToplevelHandle *)data;
225 if (self->identifier) {
226 g_free(self->identifier);
228 self->identifier = g_strdup(identifier);
231static void ext_foreign_toplevel_handle_title(
232 G_GNUC_UNUSED
void *data,
233 G_GNUC_UNUSED
struct ext_foreign_toplevel_handle_v1 *handle,
234 G_GNUC_UNUSED
const char *title) {
238static void ext_foreign_toplevel_handle_app_id(
239 void *data, G_GNUC_UNUSED
struct ext_foreign_toplevel_handle_v1 *handle,
240 const char *app_id) {
241 ExtForeignToplevelHandle *self = (ExtForeignToplevelHandle *)data;
243 g_free(self->app_id);
245 self->app_id = g_strdup(app_id);
248static struct ext_foreign_toplevel_handle_v1_listener
249 ext_foreign_toplevel_handle_listener = {
250 .identifier = &ext_foreign_toplevel_handle_identifier,
251 .title = &ext_foreign_toplevel_handle_title,
252 .app_id = &ext_foreign_toplevel_handle_app_id,
253 .closed = &ext_foreign_toplevel_handle_closed,
254 .done = &ext_foreign_toplevel_handle_done};
256static ExtForeignToplevelHandle *
257ext_foreign_toplevel_handle_new(
struct ext_foreign_toplevel_handle_v1 *handle,
258 WaylandWindowModePrivateData *view) {
259 ExtForeignToplevelHandle *self =
260 (ExtForeignToplevelHandle *)g_malloc0(
sizeof(ExtForeignToplevelHandle));
262 self->handle = handle;
265 ext_foreign_toplevel_handle_v1_add_listener(
266 handle, &ext_foreign_toplevel_handle_listener, self);
270static void ext_foreign_toplevel_list_toplevel(
271 void *data, G_GNUC_UNUSED
struct ext_foreign_toplevel_list_v1 *list,
272 struct ext_foreign_toplevel_handle_v1 *toplevel) {
273 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)data;
275 ExtForeignToplevelHandle *handle = ext_foreign_toplevel_handle_new(toplevel, pd);
276 pd->ext_toplevels = g_list_prepend(pd->ext_toplevels, handle);
279static void ext_foreign_toplevel_list_finished(
280 G_GNUC_UNUSED
void *data,
281 struct ext_foreign_toplevel_list_v1 *list) {
282 ext_foreign_toplevel_list_v1_destroy(list);
285static struct ext_foreign_toplevel_list_v1_listener
286 ext_foreign_toplevel_list_listener = {
287 .toplevel = &ext_foreign_toplevel_list_toplevel,
288 .finished = &ext_foreign_toplevel_list_finished};
292static void wlr_foreign_toplevel_handle_title(
293 void *data, G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle,
295 WlrForeignToplevelHandle *self = (WlrForeignToplevelHandle *)data;
299 self->title = g_strdup(title);
300 self->title_len = g_utf8_strlen(self->title, -1);
303static void wlr_foreign_toplevel_handle_app_id(
304 void *data, G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle,
305 const char *app_id) {
306 WlrForeignToplevelHandle *self = (WlrForeignToplevelHandle *)data;
308 g_free(self->app_id);
310 self->app_id = g_strdup(app_id);
311 self->app_id_len = g_utf8_strlen(self->app_id, -1);
314static void wlr_foreign_toplevel_handle_output_enter(
315 G_GNUC_UNUSED
void *data,
316 G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle,
317 G_GNUC_UNUSED
struct wl_output *output) {
321static void wlr_foreign_toplevel_handle_output_leave(
322 G_GNUC_UNUSED
void *data,
323 G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle,
324 G_GNUC_UNUSED
struct wl_output *output) {
328static void wlr_foreign_toplevel_handle_state(
329 void *data, G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle,
330 struct wl_array *value) {
331 WlrForeignToplevelHandle *self = (WlrForeignToplevelHandle *)data;
335 wl_array_for_each(elem, value) { self->state |= 1 << *elem; }
338static void wlr_foreign_toplevel_handle_done(
339 void *data, G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle) {
340 WlrForeignToplevelHandle *self = (WlrForeignToplevelHandle *)data;
342 g_debug(
"wlr window %p id=%s title=%s state=%d", (
void *)self,
343 self->app_id, self->title, self->state);
345 wayland_window_update_toplevel(self);
348static void wlr_foreign_toplevel_handle_closed(
349 void *data, G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle) {
350 WlrForeignToplevelHandle *self = (WlrForeignToplevelHandle *)data;
353 self->state = TOPLEVEL_STATE_CLOSED;
354 self->view->wlr_toplevels = g_list_remove(self->view->wlr_toplevels, self);
355 wayland_window_update_toplevel(self);
356 wlr_foreign_toplevel_handle_free(self);
359static void wlr_foreign_toplevel_handle_parent(
360 G_GNUC_UNUSED
void *data,
361 G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *handle,
362 G_GNUC_UNUSED
struct zwlr_foreign_toplevel_handle_v1 *parent) {
366static struct zwlr_foreign_toplevel_handle_v1_listener
367 wlr_foreign_toplevel_handle_listener = {
368 .title = &wlr_foreign_toplevel_handle_title,
369 .app_id = &wlr_foreign_toplevel_handle_app_id,
370 .output_enter = &wlr_foreign_toplevel_handle_output_enter,
371 .output_leave = &wlr_foreign_toplevel_handle_output_leave,
372 .state = &wlr_foreign_toplevel_handle_state,
373 .done = &wlr_foreign_toplevel_handle_done,
374 .closed = &wlr_foreign_toplevel_handle_closed,
375 .parent = &wlr_foreign_toplevel_handle_parent};
377static WlrForeignToplevelHandle *
378wlr_foreign_toplevel_handle_new(
struct zwlr_foreign_toplevel_handle_v1 *handle,
379 WaylandWindowModePrivateData *view) {
380 WlrForeignToplevelHandle *self =
381 (WlrForeignToplevelHandle *)g_malloc0(
sizeof(WlrForeignToplevelHandle));
383 self->handle = handle;
385 zwlr_foreign_toplevel_handle_v1_add_listener(
386 handle, &wlr_foreign_toplevel_handle_listener, self);
390static void wlr_foreign_toplevel_manager_toplevel(
391 void *data, G_GNUC_UNUSED
struct zwlr_foreign_toplevel_manager_v1 *manager,
392 struct zwlr_foreign_toplevel_handle_v1 *toplevel) {
393 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)data;
395 WlrForeignToplevelHandle *handle = wlr_foreign_toplevel_handle_new(toplevel, pd);
396 pd->wlr_toplevels = g_list_prepend(pd->wlr_toplevels, handle);
399static void wlr_foreign_toplevel_manager_finished(
400 G_GNUC_UNUSED
void *data,
401 struct zwlr_foreign_toplevel_manager_v1 *manager) {
402 zwlr_foreign_toplevel_manager_v1_destroy(manager);
405static struct zwlr_foreign_toplevel_manager_v1_listener
406 wlr_foreign_toplevel_manager_listener = {
407 .toplevel = &wlr_foreign_toplevel_manager_toplevel,
408 .finished = &wlr_foreign_toplevel_manager_finished};
410static void handle_global(
void *data,
struct wl_registry *registry,
411 uint32_t name,
const char *interface,
413 WaylandWindowModePrivateData *pd = (WaylandWindowModePrivateData *)data;
415 if (g_strcmp0(interface, zwlr_foreign_toplevel_manager_v1_interface.name) ==
418 pd->manager = (
struct zwlr_foreign_toplevel_manager_v1 *)wl_registry_bind(
419 registry, name, &zwlr_foreign_toplevel_manager_v1_interface,
420 MIN(version, WLR_FOREIGN_TOPLEVEL_VERSION));
422 else if (g_strcmp0(interface, ext_foreign_toplevel_list_v1_interface.name) ==
424 pd->list = (
struct ext_foreign_toplevel_list_v1 *)wl_registry_bind(
425 registry, name, &ext_foreign_toplevel_list_v1_interface,
426 MIN(version, EXT_FOREIGN_TOPLEVEL_VERSION));
430static void handle_global_remove(G_GNUC_UNUSED
void *data,
431 G_GNUC_UNUSED
struct wl_registry *registry,
432 G_GNUC_UNUSED uint32_t name) {}
434static struct wl_registry_listener registry_listener = {
435 .global = &handle_global, .global_remove = &handle_global_remove};
437static int wayland_window_mode_parse_fields(
void) {
441 char *switcher_str = g_strdup(
config.window_match_fields);
443 const char *
const sep =
",#";
444 for (
char *token = strtok_r(switcher_str, sep, &savept); token != NULL;
445 token = strtok_r(NULL, sep, &savept)) {
446 if (g_strcmp0(token,
"all") == 0) {
447 result |= WW_MATCH_FIELD_ALL;
449 }
else if (g_strcmp0(token,
"title") == 0) {
450 result |= WW_MATCH_FIELD_TITLE;
452 }
else if (g_strcmp0(token,
"class") == 0 ||
453 g_strcmp0(token,
"app-id") == 0) {
454 result |= WW_MATCH_FIELD_APP_ID;
457 g_warning(
"Unsupported window field name :%s. "
458 "Wayland window switcher supports only 'title' and 'app-id' "
463 g_free(switcher_str);
467static void get_wayland_window(
Mode *sw) {
468 WaylandWindowModePrivateData *pd =
471 pd->match_fields = wayland_window_mode_parse_fields();
472 pd->window_regex = g_regex_new(
"{[-\\w]+(:-?[0-9]+)?}", 0, 0, NULL);
476 pd->registry = wl_display_get_registry(
wayland->display);
477 wl_registry_add_listener(pd->registry, ®istry_listener, pd);
478 wl_display_roundtrip(
wayland->display);
480 if (pd->manager == NULL) {
481 g_warning(
"Unable to initialize Window mode: Wayland compositor does not "
482 "support wlr-foreign-toplevel-management protocol");
486 if (pd->list == NULL) {
487 g_warning(
"Window mode: Wayland compositor does not support "
488 "ext-foreign-toplevel-list protocol; window-command will not work");
491 ext_foreign_toplevel_list_v1_add_listener(
492 pd->list, &ext_foreign_toplevel_list_listener, pd);
495 zwlr_foreign_toplevel_manager_v1_add_listener(
496 pd->manager, &wlr_foreign_toplevel_manager_listener, pd);
498 wl_display_roundtrip(
wayland->display);
502static void wlr_toplevels_list_item_free(gpointer data,
503 G_GNUC_UNUSED gpointer user_data) {
504 wlr_foreign_toplevel_handle_free((WlrForeignToplevelHandle *)data);
507static void wayland_window_private_free(WaylandWindowModePrivateData *pd) {
508 if (pd->wlr_toplevels) {
509 g_list_foreach(pd->wlr_toplevels, wlr_toplevels_list_item_free, NULL);
510 g_list_free(pd->wlr_toplevels);
511 pd->wlr_toplevels = NULL;
515 wl_registry_destroy(pd->registry);
520 zwlr_foreign_toplevel_manager_v1_stop(pd->manager);
522 wl_display_roundtrip(pd->wayland->display);
525 if (pd->window_regex) {
526 g_regex_unref(pd->window_regex);
532static int wayland_window_mode_init(
Mode *sw) {
537 WaylandWindowModePrivateData *pd =
538 (WaylandWindowModePrivateData *)g_malloc0(
539 sizeof(WaylandWindowModePrivateData));
542 get_wayland_window(sw);
547static unsigned int wayland_window_mode_get_num_entries(
const Mode *sw) {
548 const WaylandWindowModePrivateData *pd =
551 g_return_val_if_fail(pd != NULL, 0);
553 return g_list_length(pd->wlr_toplevels);
556static inline int wayland_act_on_window(WlrForeignToplevelHandle *toplevel,
557 WaylandWindowModePrivateData *pd) {
559 if (toplevel->identifier == NULL) {
568 g_list_foreach(pd->ext_toplevels, wlr_toplevels_set_one_identifier,
571 if (toplevel->identifier == NULL) {
573 "Couldn't resolve {window} identifier for the selected window",
577 g_debug(
"resolved selected window to identifier %s", toplevel->identifier);
584 toplevel->identifier, (
char *)0);
586 GError *error = NULL;
587 g_spawn_async(NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL,
590 char *msg = g_strdup_printf(
591 "Failed to execute action for window: '%s'\nError: '%s'",
592 toplevel->identifier, error->message);
605static ModeMode wayland_window_mode_result(
Mode *sw,
int mretv,
606 G_GNUC_UNUSED
char **input,
607 unsigned int selected_line) {
609 WaylandWindowModePrivateData *pd =
612 g_return_val_if_fail(pd != NULL, retv);
620 }
else if ((mretv &
MENU_OK)) {
622 WlrForeignToplevelHandle *toplevel =
623 (WlrForeignToplevelHandle *)g_list_nth_data(pd->wlr_toplevels, selected_line);
626 wayland_act_on_window(toplevel, pd);
629 wlr_foreign_toplevel_handle_activate(
630 toplevel, pd->wayland->last_seat->seat);
631 wl_display_flush(pd->wayland->display);
635 WlrForeignToplevelHandle *toplevel =
636 (WlrForeignToplevelHandle *)g_list_nth_data(pd->wlr_toplevels, selected_line);
637 wlr_foreign_toplevel_handle_close(toplevel);
638 wl_display_flush(pd->wayland->display);
648 GError *error = NULL;
650 gsize lf_cmd_size = 0;
651 gchar *lf_cmd = g_locale_from_utf8(*input, -1, NULL, &lf_cmd_size, &error);
653 g_warning(
"Failed to convert command to locale encoding: %s",
661 run_in_term ? &context : NULL)) {
672static void wayland_window_mode_destroy(
Mode *sw) {
673 WaylandWindowModePrivateData *pd =
680 wayland_window_private_free(pd);
685 unsigned int index) {
686 WaylandWindowModePrivateData *pd =
688 WlrForeignToplevelHandle *toplevel =
689 (WlrForeignToplevelHandle *)g_list_nth_data(pd->wlr_toplevels, index);
691 g_return_val_if_fail(toplevel != NULL, 0);
696 for (
int j = 0; match && tokens[j] != NULL; j++) {
703 if ((pd->match_fields & WW_MATCH_FIELD_TITLE) &&
704 toplevel->title != NULL && toplevel->title[0] !=
'\0') {
708 if (test == tokens[j]->invert &&
709 (pd->match_fields & WW_MATCH_FIELD_APP_ID) &&
710 toplevel->app_id != NULL && toplevel->app_id[0] !=
'\0') {
723static void helper_eval_add_str(GString *str,
const char *input,
int len,
724 int max_len,
int nc) {
726 const char *input_nn = input ? input :
"";
731 int bl = g_utf8_offset_to_pointer(input_nn, len) - input_nn;
732 char *tmp = g_markup_escape_text(input_nn, bl);
733 g_string_append(str, tmp);
737 char *tmp = g_markup_escape_text(input_nn, -1);
738 g_string_append(str, tmp);
742 char *tmp = g_markup_escape_text(input_nn, -1);
743 g_string_append(str, tmp);
746 spaces = MAX(0, max_len - nc);
750 g_string_append_c(str,
' ');
755 const WaylandWindowModePrivateData *pd;
756 WlrForeignToplevelHandle *toplevel;
759static gboolean helper_eval_cb(
const GMatchInfo *info, GString *str,
761 struct arg *d = (
struct arg *)data;
764 match = g_match_info_fetch(info, 0);
767 if (match[2] ==
':') {
768 l = (int)g_ascii_strtoll(&match[3], NULL, 10);
773 helper_eval_add_str(str, d->toplevel->title, l, d->pd->title_len,
774 d->toplevel->title_len);
778 helper_eval_add_str(str, d->toplevel->app_id, l, d->pd->app_id_len,
779 d->toplevel->app_id_len);
788static char *_generate_display_string(
const WaylandWindowModePrivateData *pd,
789 WlrForeignToplevelHandle *toplevel) {
791 struct arg d = {pd, toplevel};
792 char *res = g_regex_replace_eval(pd->window_regex,
config.window_format, -1,
793 0, 0, helper_eval_cb, &d, NULL);
794 return g_strchomp(res);
798 int *state, G_GNUC_UNUSED GList **attr_list,
800 WaylandWindowModePrivateData *pd =
803 g_return_val_if_fail(pd != NULL, NULL);
805 WlrForeignToplevelHandle *toplevel =
806 (WlrForeignToplevelHandle *)g_list_nth_data(pd->wlr_toplevels, selected_line);
808 if (toplevel == NULL || toplevel->state & TOPLEVEL_STATE_CLOSED) {
809 return get_entry ? g_strdup(
"Window has vanished") : NULL;
813 if (toplevel->state & TOPLEVEL_STATE_ACTIVATED) {
818 return get_entry ? _generate_display_string(pd, toplevel) : NULL;
821static cairo_surface_t *
_get_icon(
const Mode *sw,
unsigned int selected_line,
822 unsigned int height) {
823 WaylandWindowModePrivateData *pd =
827 g_return_val_if_fail(pd != NULL, NULL);
829 WlrForeignToplevelHandle *toplevel =
830 (WlrForeignToplevelHandle *)g_list_nth_data(pd->wlr_toplevels, selected_line);
833 if (toplevel == NULL || toplevel->app_id == NULL ||
834 toplevel->app_id[0] ==
'\0') {
838 if (toplevel->cached_icon_uid > 0 && toplevel->cached_icon_size == height &&
839 toplevel->cached_icon_scale == scale) {
848 gchar *app_id_lower = g_utf8_strdown(toplevel->app_id, -1);
849 toplevel->cached_icon_size = height;
850 toplevel->cached_icon_scale = scale;
852 g_free(app_id_lower);
859Mode wayland_window_mode = {.name =
"window",
860 .cfg_name_key =
"display-window",
861 ._init = wayland_window_mode_init,
862 ._destroy = wayland_window_mode_destroy,
864 wayland_window_mode_get_num_entries,
865 ._result = wayland_window_mode_result,
866 ._token_match = wayland_window_token_match,
869 ._get_completion = NULL,
870 ._preprocess_input = NULL,
871 ._get_message = NULL,
872 .private_data = NULL,
guint display_scale(void)
static cairo_surface_t * _get_icon(const Mode *sw, unsigned int selected_line, unsigned int height)
static char * _get_display_value(const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry)
Property * rofi_theme_find_property(ThemeWidget *wid, PropertyType type, const char *property, gboolean exact)
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
int helper_parse_setup(char *string, char ***output, int *length,...)
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
void * mode_get_private_data(const Mode *mode)
void mode_set_private_data(Mode *mode, void *pd)
void rofi_view_hide(void)
void rofi_view_reload(void)
int rofi_view_error_dialog(const char *msg, int markup)
struct rofi_int_matcher_t rofi_int_matcher