rofi  1.7.5
view.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2022 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 {
57 } MenuFlags;
58 
69 RofiViewState *rofi_view_create(Mode *sw, const char *input,
71  void (*finalize)(RofiViewState *));
72 
79 
95 unsigned int rofi_view_get_next_position(const RofiViewState *state);
102 void rofi_view_handle_text(RofiViewState *state, char *text);
111 void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y,
112  gboolean find_mouse_target);
120  xcb_configure_notify_event_t *xce);
121 void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target);
125 void rofi_view_frame_callback(void);
131 unsigned int rofi_view_get_completed(const RofiViewState *state);
137 const char *rofi_view_get_user_input(const RofiViewState *state);
138 
146  unsigned int selected_line);
147 
155 unsigned int rofi_view_get_selected_line(const RofiViewState *state);
162 void rofi_view_restart(RofiViewState *state);
163 
171 gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope,
172  guint action);
173 
180  guint action);
181 
188 void rofi_view_free(RofiViewState *state);
205 
215 
230 int rofi_view_error_dialog(const char *msg, int markup);
231 
236 void rofi_view_queue_redraw(void);
237 
241 void rofi_view_cleanup(void);
242 
251 
255 void rofi_view_hide(void);
256 
263 void rofi_view_reload(void);
264 
271 void rofi_view_switch_mode(RofiViewState *state, Mode *mode);
272 
279 void rofi_view_set_overlay(RofiViewState *state, const char *text);
280 
287 
295 
301 xcb_window_t rofi_view_get_window(void);
320 void rofi_view_workers_finalize(void);
321 
330 
334 void rofi_capture_screenshot(void);
338 void rofi_view_set_window_title(const char *title);
339 
345 #endif
BindingsScope
Definition: keyb.h:43
MenuReturn
Definition: mode.h:65
void rofi_view_cleanup(void)
Definition: view.c:2241
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition: view.c:2322
void __create_window(MenuFlags menu_flags)
Definition: view.c:782
void rofi_view_clear_input(RofiViewState *state)
Definition: view.c:2336
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition: view.c:2347
void rofi_view_hide(void)
Definition: view.c:2233
void rofi_view_reload(void)
Definition: view.c:528
Mode * rofi_view_get_mode(RofiViewState *state)
Definition: view.c:2320
xcb_window_t rofi_view_get_window(void)
Definition: view.c:2375
void rofi_view_remove_active(RofiViewState *state)
Definition: view.c:551
RofiViewState * rofi_view_get_active(void)
Definition: view.c:549
int rofi_view_error_dialog(const char *msg, int markup)
Definition: view.c:2191
void rofi_view_set_active(RofiViewState *state)
Definition: view.c:558
void rofi_view_queue_redraw(void)
Definition: view.c:535
void rofi_view_restart(RofiViewState *state)
Definition: view.c:544
MenuFlags
Definition: view.h:48
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition: view.c:1643
void rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1607
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition: view.c:617
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition: view.c:634
gboolean rofi_view_check_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1576
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
Definition: view.c:1685
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition: view.c:1774
void rofi_view_finalize(RofiViewState *state)
Definition: view.c:1323
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition: view.c:581
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition: view.c:1740
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition: view.c:2103
void rofi_view_frame_callback(void)
Definition: view.c:1783
void rofi_view_free(RofiViewState *state)
Definition: view.c:599
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition: view.c:638
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition: view.c:621
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition: view.c:625
void rofi_view_maybe_update(RofiViewState *state)
Definition: view.c:1713
@ MENU_PASSWORD
Definition: view.h:52
@ 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:2343
void rofi_capture_screenshot(void)
Definition: view.c:179
void rofi_view_workers_initialize(void)
Definition: view.c:2287
void rofi_view_set_window_title(const char *title)
Definition: view.c:2377
void rofi_view_get_current_monitor(int *width, int *height)
Definition: view.c:144
void rofi_view_workers_finalize(void)
Definition: view.c:2314
textbox * text
Definition: view-internal.h:59
void(* finalize)(struct RofiViewState *state)
unsigned int selected_line
Definition: view-internal.h:92
MenuFlags menu_flags