rofi  1.6.1
view.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2020 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 #include "mode.h"
31 
43 typedef enum
44 {
55 } MenuFlags;
56 
67 RofiViewState *rofi_view_create ( Mode *sw, const char *input, MenuFlags menu_flags, void ( *finalize )( RofiViewState * ) );
68 
74 void rofi_view_finalize ( RofiViewState *state );
75 
91 unsigned int rofi_view_get_next_position ( const RofiViewState *state );
98 void rofi_view_handle_text ( RofiViewState *state, char *text );
106 void rofi_view_handle_mouse_motion ( RofiViewState *state, gint x, gint y );
112 void rofi_view_maybe_update ( RofiViewState *state );
113 void rofi_view_temp_configure_notify ( RofiViewState *state, xcb_configure_notify_event_t *xce );
114 void rofi_view_temp_click_to_exit ( RofiViewState *state, xcb_window_t target );
118 void rofi_view_frame_callback ( void );
124 unsigned int rofi_view_get_completed ( const RofiViewState *state );
130 const char * rofi_view_get_user_input ( const RofiViewState *state );
131 
138 void rofi_view_set_selected_line ( RofiViewState *state, unsigned int selected_line );
139 
147 unsigned int rofi_view_get_selected_line ( const RofiViewState *state );
154 void rofi_view_restart ( RofiViewState *state );
155 
163 gboolean rofi_view_trigger_action ( RofiViewState *state, BindingsScope scope, guint action );
164 
171 void rofi_view_free ( RofiViewState *state );
188 
197 void rofi_view_set_active ( RofiViewState *state );
198 
206 void rofi_view_remove_active ( RofiViewState *state );
213 int rofi_view_error_dialog ( const char *msg, int markup );
214 
219 void rofi_view_queue_redraw ( void );
220 
224 void rofi_view_cleanup ( void );
225 
234 
238 void rofi_view_hide ( void );
239 
246 void rofi_view_reload ( void );
247 
254 void rofi_view_switch_mode ( RofiViewState *state, Mode *mode );
255 
262 void rofi_view_set_overlay ( RofiViewState *state, const char *text );
263 
269 void rofi_view_clear_input ( RofiViewState *state );
270 
278 
284 xcb_window_t rofi_view_get_window ( void );
287 /***
288  * @defgroup ViewThreadPool ViewThreadPool
289  * @ingroup View
290  *
291  * The view can (optionally) keep a set of worker threads around to parallize work.
292  * This includes filtering and sorting.
293  *
294  * @{
295  */
299 void rofi_view_workers_initialize ( void );
303 void rofi_view_workers_finalize ( void );
304 
310 void rofi_view_get_current_monitor ( int *width, int *height );
311 
315 void rofi_capture_screenshot ( void );
319 void rofi_view_set_window_title ( const char * title );
320 
326 #endif
void rofi_view_cleanup(void)
Definition: view.c:1949
MenuReturn
Definition: mode.h:66
void rofi_view_finalize(RofiViewState *state)
Definition: view.c:1202
BindingsScope
Definition: keyb.h:42
void rofi_view_clear_input(RofiViewState *state)
Definition: view.c:2041
void rofi_view_reload(void)
Definition: view.c:469
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition: view.c:1516
void rofi_view_queue_redraw(void)
Definition: view.c:476
void rofi_view_get_current_monitor(int *width, int *height)
Definition: view.c:135
Mode * rofi_view_get_mode(RofiViewState *state)
Definition: view.c:2021
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition: view.c:588
void __create_window(MenuFlags menu_flags)
Definition: view.c:731
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition: view.c:528
void rofi_view_remove_active(RofiViewState *state)
Definition: view.c:496
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition: view.c:1547
void rofi_view_ellipsize_start(RofiViewState *state)
Definition: view.c:2049
RofiViewState * rofi_view_get_active(void)
Definition: view.c:491
void rofi_view_workers_initialize(void)
Definition: view.c:1987
void rofi_capture_screenshot(void)
Definition: view.c:177
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition: view.c:563
void rofi_view_workers_finalize(void)
Definition: view.c:2014
void rofi_view_frame_callback(void)
Definition: view.c:1557
void rofi_view_free(RofiViewState *state)
Definition: view.c:544
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y)
Definition: view.c:1479
void rofi_view_hide(void)
Definition: view.c:1941
xcb_window_t rofi_view_get_window(void)
Definition: view.c:2082
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition: view.c:573
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition: view.c:1472
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition: view.c:583
void rofi_view_set_active(RofiViewState *state)
Definition: view.c:505
int rofi_view_error_dialog(const char *msg, int markup)
Definition: view.c:1898
textbox * text
Definition: view-internal.h:59
gboolean rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1434
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition: view.c:2054
void(* finalize)(struct RofiViewState *state)
void rofi_view_set_window_title(const char *title)
Definition: view.c:2087
void rofi_view_restart(RofiViewState *state)
Definition: view.c:485
void rofi_view_maybe_update(RofiViewState *state)
Definition: view.c:1489
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition: view.c:568
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition: view.c:2026
unsigned int selected_line
Definition: view-internal.h:92
MenuFlags menu_flags
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition: view.c:1821
MenuFlags
Definition: view.h:43