rofi 2.1.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/textbox.h"
33#include "widgets/widget.h"
34#include <pango/pango.h>
35#ifdef ENABLE_XCB
36#include <xcb/xcb.h>
37#else
38#include "xcb-dummy.h"
39#endif
47
67
78RofiViewState *rofi_view_create(Mode *sw, const char *input,
80 void (*finalize)(RofiViewState *));
81
88
104unsigned int rofi_view_get_next_position(const RofiViewState *state);
111void rofi_view_handle_text(RofiViewState *state, const char *text);
120void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y,
121 gboolean find_mouse_target);
134void rofi_view_frame_callback(void);
140unsigned int rofi_view_get_completed(const RofiViewState *state);
146const char *rofi_view_get_user_input(const RofiViewState *state);
147
155 unsigned int selected_line);
156
164unsigned int rofi_view_get_selected_line(const RofiViewState *state);
165
174unsigned int rofi_view_get_element_pitch(const RofiViewState *state,
175 RofiOrientation orientation);
183
192 guint action);
193
200 guint action);
201
208void rofi_view_free(RofiViewState *state);
218
225
232
240
242
257int rofi_view_error_dialog(const char *msg, int markup);
258
263void rofi_view_queue_redraw(void);
264
266
270void rofi_view_cleanup(void);
271
280
284void rofi_view_hide(void);
285
292void rofi_view_reload(void);
293
300void rofi_view_switch_mode(RofiViewState *state, Mode *mode);
301
308void rofi_view_set_overlay(RofiViewState *state, const char *text);
316void rofi_view_set_overlay_timeout(RofiViewState *state, const char *text);
317
324
332
340
358
367
371void rofi_capture_screenshot(void);
375void rofi_view_set_window_title(const char *title);
376
377void rofi_view_set_size(RofiViewState *state, gint width, gint height);
378
379void rofi_view_get_size(RofiViewState *state, gint *width, gint *height);
380
382
383void rofi_view_set_window_title(const char *title);
384void rofi_view_pool_refresh(void);
385
386void rofi_view_get_menu_rect(int *x, int *y, int *w, int *h);
387
389
390
394
395void input_history_save(void);
396void input_history_initialize(void);
397
398struct _view_proxy;
399
400/* Implementations */
401extern const struct _view_proxy *xcb_view_proxy;
402#ifdef ENABLE_WAYLAND
403extern const struct _view_proxy *wayland_view_proxy;
404#endif
405
406void view_init(const struct _view_proxy *view_in);
407
414 PangoEllipsizeMode mode);
415
423gboolean rofi_set_im_window_pos(int new_x, int new_y);
424
425// Cancel the current view
427
440 widget *wid, MouseBindingMouseDefaultAction action, G_GNUC_UNUSED gint x,
441 G_GNUC_UNUSED gint y, G_GNUC_UNUSED void *user_data);
442
444#endif
BindingsScope
Definition keyb.h:43
MouseBindingMouseDefaultAction
Definition keyb.h:176
struct rofi_mode Mode
Definition mode.h:49
MenuReturn
Definition mode.h:70
textbox * rofi_view_get_active_text(void)
Definition view.c:323
void rofi_view_cleanup(void)
Definition view.c:2217
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition view.c:2118
void __create_window(MenuFlags menu_flags)
Definition view.c:2223
void rofi_view_clear_input(RofiViewState *state)
Definition view.c:2136
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition view.c:2148
Mode * rofi_view_get_mode(RofiViewState *state)
Definition view.c:2092
void rofi_view_hide(void)
Definition view.c:2219
void rofi_view_calculate_window_position(RofiViewState *state)
Definition view.c:2199
void rofi_view_reload(void)
Definition view.c:2221
xcb_window_t rofi_view_get_window(void)
Definition view.c:2227
void rofi_view_remove_active(RofiViewState *state)
Definition view.c:340
void rofi_view_set_overlay_timeout(RofiViewState *state, const char *text)
Definition view.c:2104
int rofi_view_error_dialog(const char *msg, int markup)
Definition view.c:1980
void rofi_view_set_active(RofiViewState *state)
Definition view.c:347
void rofi_view_queue_redraw(void)
Definition view.c:2193
RofiViewState * rofi_view_get_active(void)
Definition view.c:321
void rofi_view_restart(RofiViewState *state)
Definition view.c:316
MenuFlags
Definition view.h:55
void rofi_view_handle_text(RofiViewState *state, const char *text)
Definition view.c:1463
void rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition view.c:1422
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition view.c:410
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition view.c:435
gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope, guint action)
Definition view.c:1391
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition view.c:439
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
Definition view.c:1500
unsigned int rofi_view_get_element_pitch(const RofiViewState *state, RofiOrientation orientation)
Definition view.c:418
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition view.c:2187
void rofi_view_finalize(RofiViewState *state)
Definition view.c:1003
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition view.c:369
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition view.c:2182
void rofi_view_frame_callback(void)
Definition view.c:2191
void rofi_view_free(RofiViewState *state)
Definition view.c:392
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition view.c:1860
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition view.c:414
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition view.c:426
void rofi_view_maybe_update(RofiViewState *state)
Definition view.c:1560
@ MENU_PASSWORD
Definition view.h:59
@ MENU_TRANSIENT_WINDOW
Definition view.h:65
@ MENU_NORMAL_WINDOW
Definition view.h:61
@ MENU_ERROR_DIALOG
Definition view.h:63
@ MENU_NORMAL
Definition view.h:57
gboolean rofi_set_im_window_pos(int new_x, int new_y)
void rofi_view_ping_mouse(RofiViewState *state)
Definition view.c:2241
void rofi_capture_screenshot(void)
Definition view.c:154
void rofi_view_workers_initialize(void)
Definition view.c:2057
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:1584
void rofi_view_set_size(RofiViewState *state, gint width, gint height)
Definition view.c:2233
const view_proxy * xcb_view_proxy
Definition view.c:1003
void rofi_view_get_menu_rect(int *x, int *y, int *w, int *h)
Definition view.c:2245
void rofi_view_set_window_title(const char *title)
Definition view.c:2195
void input_history_save(void)
Definition view.c:580
void input_history_initialize(void)
Definition view.c:537
void rofi_view_ellipsize_listview(RofiViewState *state, PangoEllipsizeMode mode)
Definition view.c:2143
void rofi_view_cancel(RofiViewState *state)
Definition view.c:331
void rofi_view_set_cursor(RofiCursorType type)
Definition view.c:2215
void rofi_view_get_current_monitor(int *width, int *height)
Definition view.c:2229
void rofi_view_workers_finalize(void)
Definition view.c:2085
void rofi_view_pool_refresh(void)
Definition view.c:2243
void rofi_view_get_size(RofiViewState *state, gint *width, gint *height)
Definition view.c:2237
struct _widget widget
Definition widget.h:49
WidgetTriggerActionResult
Definition widget.h:74
RofiOrientation
Definition rofi-types.h:139
RofiCursorType
Definition rofi-types.h:147
textbox * text
void(*) finalize(struct RofiViewState *state)
unsigned int selected_line
MenuFlags menu_flags
void view_init(const view_proxy *view_in)
Definition view.c:67
const view_proxy * wayland_view_proxy
Definition view.c:584
int xcb_window_t
Definition xcb-dummy.h:9
int xcb_configure_notify_event_t
Definition xcb-dummy.h:8