rofi  1.7.0
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 
174  guint action);
175 
182 void rofi_view_free(RofiViewState *state);
199 
209 
224 int rofi_view_error_dialog(const char *msg, int markup);
225 
230 void rofi_view_queue_redraw(void);
231 
235 void rofi_view_cleanup(void);
236 
245 
249 void rofi_view_hide(void);
250 
257 void rofi_view_reload(void);
258 
265 void rofi_view_switch_mode(RofiViewState *state, Mode *mode);
266 
273 void rofi_view_set_overlay(RofiViewState *state, const char *text);
274 
281 
289 
295 xcb_window_t rofi_view_get_window(void);
314 void rofi_view_workers_finalize(void);
315 
324 
328 void rofi_capture_screenshot(void);
332 void rofi_view_set_window_title(const char *title);
333 
339 #endif
BindingsScope
Definition: keyb.h:43
MenuReturn
Definition: mode.h:65
void rofi_view_cleanup(void)
Definition: view.c:2071
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition: view.c:2148
void __create_window(MenuFlags menu_flags)
Definition: view.c:751
void rofi_view_clear_input(RofiViewState *state)
Definition: view.c:2162
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition: view.c:2173
void rofi_view_hide(void)
Definition: view.c:2063
void rofi_view_reload(void)
Definition: view.c:497
Mode * rofi_view_get_mode(RofiViewState *state)
Definition: view.c:2146
xcb_window_t rofi_view_get_window(void)
Definition: view.c:2200
void rofi_view_remove_active(RofiViewState *state)
Definition: view.c:520
RofiViewState * rofi_view_get_active(void)
Definition: view.c:518
int rofi_view_error_dialog(const char *msg, int markup)
Definition: view.c:2018
void rofi_view_set_active(RofiViewState *state)
Definition: view.c:527
void rofi_view_queue_redraw(void)
Definition: view.c:504
void rofi_view_restart(RofiViewState *state)
Definition: view.c:513
MenuFlags
Definition: view.h:48
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition: view.c:1499
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition: view.c:586
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition: view.c:603
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y, gboolean find_mouse_target)
Definition: view.c:1540
gboolean rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1462
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition: view.c:1628
void rofi_view_finalize(RofiViewState *state)
Definition: view.c:1226
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition: view.c:550
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition: view.c:1594
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition: view.c:1932
void rofi_view_frame_callback(void)
Definition: view.c:1637
void rofi_view_free(RofiViewState *state)
Definition: view.c:568
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition: view.c:607
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition: view.c:590
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition: view.c:594
void rofi_view_maybe_update(RofiViewState *state)
Definition: view.c:1568
@ 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:2169
void rofi_capture_screenshot(void)
Definition: view.c:174
void rofi_view_workers_initialize(void)
Definition: view.c:2113
void rofi_view_set_window_title(const char *title)
Definition: view.c:2202
void rofi_view_get_current_monitor(int *width, int *height)
Definition: view.c:139
void rofi_view_workers_finalize(void)
Definition: view.c:2140
textbox * text
Definition: view-internal.h:59
void(* finalize)(struct RofiViewState *state)
unsigned int selected_line
Definition: view-internal.h:92
MenuFlags menu_flags