rofi 2.0.0
view.h
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
28#ifndef ROFI_VIEW_H
29#define ROFI_VIEW_H
30
31#include "mode.h"
32#include "widgets/widget.h"
33#include <pango/pango.h>
34#ifdef ENABLE_XCB
35#include <xcb/xcb.h>
36#else
37#include "xcb-dummy.h"
38#endif
46
66
77RofiViewState *rofi_view_create(Mode *sw, const char *input,
79 void (*finalize)(RofiViewState *));
80
87
103unsigned int rofi_view_get_next_position(const RofiViewState *state);
110void rofi_view_handle_text(RofiViewState *state, char *text);
119void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y,
120 gboolean find_mouse_target);
133void rofi_view_frame_callback(void);
139unsigned int rofi_view_get_completed(const RofiViewState *state);
145const char *rofi_view_get_user_input(const RofiViewState *state);
146
154 unsigned int selected_line);
155
163unsigned int rofi_view_get_selected_line(const RofiViewState *state);
171
180 guint action);
181
188 guint action);
189
196void rofi_view_free(RofiViewState *state);
206
213
221
223
238int rofi_view_error_dialog(const char *msg, int markup);
239
244void rofi_view_queue_redraw(void);
245
247
251void rofi_view_cleanup(void);
252
261
265void rofi_view_hide(void);
266
273void rofi_view_reload(void);
274
281void rofi_view_switch_mode(RofiViewState *state, Mode *mode);
282
289void rofi_view_set_overlay(RofiViewState *state, const char *text);
297void rofi_view_set_overlay_timeout (RofiViewState *state, const char *text);
298
305
313
321
339
348
352void rofi_capture_screenshot(void);
356void rofi_view_set_window_title(const char *title);
357
358void rofi_view_set_size(RofiViewState *state, gint width, gint height);
359
360void rofi_view_get_size(RofiViewState *state, gint *width, gint *height);
361
363
364void rofi_view_set_window_title(const char *title);
365void rofi_view_pool_refresh(void);
366
368
372
373void input_history_save(void);
374void input_history_initialize(void);
375
376struct _view_proxy;
377
378/* Implementations */
379extern const struct _view_proxy *xcb_view_proxy;
380#ifdef ENABLE_WAYLAND
381extern const struct _view_proxy *wayland_view_proxy;
382#endif
383
384void view_init(const struct _view_proxy *view_in);
385
392 PangoEllipsizeMode mode);
393
401gboolean rofi_set_im_window_pos(int new_x, int new_y);
402
415 widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x,
416 G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data);
417
419#endif
BindingsScope
Definition keyb.h:43
MouseBindingMouseDefaultAction
Definition keyb.h:174
struct rofi_mode Mode
Definition mode.h:49
MenuReturn
Definition mode.h:70
void rofi_view_cleanup(void)
Definition view.c:2153
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition view.c:2054
void __create_window(MenuFlags menu_flags)
Definition view.c:2159
void rofi_view_clear_input(RofiViewState *state)
Definition view.c:2072
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition view.c:2084
Mode * rofi_view_get_mode(RofiViewState *state)
Definition view.c:2028
void rofi_view_hide(void)
Definition view.c:2155
void rofi_view_calculate_window_position(RofiViewState *state)
Definition view.c:2135
void rofi_view_reload(void)
Definition view.c:2157
xcb_window_t rofi_view_get_window(void)
Definition view.c:2163
void rofi_view_remove_active(RofiViewState *state)
Definition view.c:301
void rofi_view_set_overlay_timeout(RofiViewState *state, const char *text)
Definition view.c:2040
int rofi_view_error_dialog(const char *msg, int markup)
Definition view.c:1915
void rofi_view_set_active(RofiViewState *state)
Definition view.c:308
void rofi_view_queue_redraw(void)
Definition view.c:2129
RofiViewState * rofi_view_get_active(void)
Definition view.c:299
void rofi_view_restart(RofiViewState *state)
Definition view.c:294
MenuFlags
Definition view.h:54
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition view.c:1401
void rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition view.c:1360
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition view.c:371
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition view.c:388
gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope, guint action)
Definition view.c:1329
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition view.c:392
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
Definition view.c:1435
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition view.c:2123
void rofi_view_finalize(RofiViewState *state)
Definition view.c:944
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition view.c:330
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition view.c:2118
void rofi_view_frame_callback(void)
Definition view.c:2127
void rofi_view_free(RofiViewState *state)
Definition view.c:353
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition view.c:1795
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition view.c:375
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition view.c:379
void rofi_view_maybe_update(RofiViewState *state)
Definition view.c:1495
@ MENU_PASSWORD
Definition view.h:58
@ MENU_TRANSIENT_WINDOW
Definition view.h:64
@ MENU_NORMAL_WINDOW
Definition view.h:60
@ MENU_ERROR_DIALOG
Definition view.h:62
@ MENU_NORMAL
Definition view.h:56
gboolean rofi_set_im_window_pos(int new_x, int new_y)
void rofi_view_ping_mouse(RofiViewState *state)
Definition view.c:2177
void rofi_capture_screenshot(void)
Definition view.c:132
void rofi_view_workers_initialize(void)
Definition view.c:1992
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)
Definition view.c:1519
void rofi_view_set_size(RofiViewState *state, gint width, gint height)
Definition view.c:2169
const view_proxy * xcb_view_proxy
Definition view.c:980
void view_init(const struct _view_proxy *view_in)
void rofi_view_set_window_title(const char *title)
Definition view.c:2131
void input_history_save(void)
Definition view.c:526
void input_history_initialize(void)
Definition view.c:483
void rofi_view_ellipsize_listview(RofiViewState *state, PangoEllipsizeMode mode)
Definition view.c:2079
void rofi_view_set_cursor(RofiCursorType type)
Definition view.c:2151
void rofi_view_get_current_monitor(int *width, int *height)
Definition view.c:2165
void rofi_view_workers_finalize(void)
Definition view.c:2021
void rofi_view_pool_refresh(void)
Definition view.c:2179
void rofi_view_get_size(RofiViewState *state, gint *width, gint *height)
Definition view.c:2173
struct _widget widget
Definition widget.h:49
WidgetTriggerActionResult
Definition widget.h:74
RofiCursorType
Definition rofi-types.h:147
textbox * text
void(* finalize)(struct RofiViewState *state)
unsigned int selected_line
MenuFlags menu_flags
const view_proxy * wayland_view_proxy
Definition view.c:442
int xcb_window_t
Definition xcb-dummy.h:9
int xcb_configure_notify_event_t
Definition xcb-dummy.h:8