rofi  1.7.3
view.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2021 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 <xcb/xcb.h>
47 typedef struct RofiViewState RofiViewState;
48 typedef enum {
59 } MenuFlags;
60 
71 RofiViewState *rofi_view_create(Mode *sw, const char *input,
73  void (*finalize)(RofiViewState *));
74 
81 
97 unsigned int rofi_view_get_next_position(const RofiViewState *state);
104 void rofi_view_handle_text(RofiViewState *state, char *text);
113 void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y,
114  gboolean find_mouse_target);
122  xcb_configure_notify_event_t *xce);
123 void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target);
127 void rofi_view_frame_callback(void);
133 unsigned int rofi_view_get_completed(const RofiViewState *state);
139 const char *rofi_view_get_user_input(const RofiViewState *state);
140 
148  unsigned int selected_line);
149 
157 unsigned int rofi_view_get_selected_line(const RofiViewState *state);
164 void rofi_view_restart(RofiViewState *state);
165 
173 gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope,
174  guint action);
175 
182  guint action);
183 
190 void rofi_view_free(RofiViewState *state);
207 
217 
232 int rofi_view_error_dialog(const char *msg, int markup);
233 
238 void rofi_view_queue_redraw(void);
239 
243 void rofi_view_cleanup(void);
244 
253 
257 void rofi_view_hide(void);
258 
265 void rofi_view_reload(void);
266 
273 void rofi_view_switch_mode(RofiViewState *state, Mode *mode);
274 
281 void rofi_view_set_overlay(RofiViewState *state, const char *text);
282 
289 
297 
303 xcb_window_t rofi_view_get_window(void);
322 void rofi_view_workers_finalize(void);
323 
332 
336 void rofi_capture_screenshot(void);
340 void rofi_view_set_window_title(const char *title);
341 
347 #endif
BindingsScope
Definition: keyb.h:43
MenuReturn
Definition: mode.h:65
void rofi_view_cleanup(void)
Definition: view.c:2127
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition: view.c:2204
void __create_window(MenuFlags menu_flags)
Definition: view.c:755
void rofi_view_clear_input(RofiViewState *state)
Definition: view.c:2218
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition: view.c:2229
void rofi_view_hide(void)
Definition: view.c:2119
void rofi_view_reload(void)
Definition: view.c:501
Mode * rofi_view_get_mode(RofiViewState *state)
Definition: view.c:2202
xcb_window_t rofi_view_get_window(void)
Definition: view.c:2256
void rofi_view_remove_active(RofiViewState *state)
Definition: view.c:524
RofiViewState * rofi_view_get_active(void)
Definition: view.c:522
int rofi_view_error_dialog(const char *msg, int markup)
Definition: view.c:2077
void rofi_view_set_active(RofiViewState *state)
Definition: view.c:531
void rofi_view_queue_redraw(void)
Definition: view.c:508
void rofi_view_restart(RofiViewState *state)
Definition: view.c:517
MenuFlags
Definition: view.h:48
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition: view.c:1540
void rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1504
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition: view.c:590
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition: view.c:607
gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1473
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
Definition: view.c:1582
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition: view.c:1670
void rofi_view_finalize(RofiViewState *state)
Definition: view.c:1230
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition: view.c:554
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition: view.c:1636
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition: view.c:1989
void rofi_view_frame_callback(void)
Definition: view.c:1679
void rofi_view_free(RofiViewState *state)
Definition: view.c:572
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition: view.c:611
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition: view.c:594
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition: view.c:598
void rofi_view_maybe_update(RofiViewState *state)
Definition: view.c:1610
@ MENU_PASSWORD
Definition: view.h:52
@ MENU_INDICATOR
Definition: view.h:58
@ MENU_NORMAL_WINDOW
Definition: view.h:54
@ MENU_ERROR_DIALOG
Definition: view.h:56
@ MENU_NORMAL
Definition: view.h:50
void rofi_view_ellipsize_start(RofiViewState *state)
Definition: view.c:2225
void rofi_capture_screenshot(void)
Definition: view.c:174
void rofi_view_workers_initialize(void)
Definition: view.c:2169
void rofi_view_set_window_title(const char *title)
Definition: view.c:2258
void rofi_view_get_current_monitor(int *width, int *height)
Definition: view.c:139
void rofi_view_workers_finalize(void)
Definition: view.c:2196
textbox * text
Definition: view-internal.h:59
void(* finalize)(struct RofiViewState *state)
unsigned int selected_line
Definition: view-internal.h:92
MenuFlags menu_flags