rofi  1.5.1
view.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2017 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 
195 void rofi_view_set_active ( RofiViewState *state );
196 
203 int rofi_view_error_dialog ( const char *msg, int markup );
204 
209 void rofi_view_queue_redraw ( void );
210 
214 void rofi_view_cleanup ( void );
215 
224 
228 void rofi_view_hide ( void );
229 
236 void rofi_view_reload ( void );
237 
244 void rofi_view_switch_mode ( RofiViewState *state, Mode *mode );
245 
252 void rofi_view_set_overlay ( RofiViewState *state, const char *text );
253 
259 void rofi_view_clear_input ( RofiViewState *state );
260 
273 xcb_window_t rofi_view_get_window ( void );
276 /***
277  * @defgroup ViewThreadPool ViewThreadPool
278  * @ingroup View
279  *
280  * The view can (optionally) keep a set of worker threads around to parallize work.
281  * This includes filtering and sorting.
282  *
283  * @{
284  */
288 void rofi_view_workers_initialize ( void );
292 void rofi_view_workers_finalize ( void );
293 
299 void rofi_view_get_current_monitor ( int *width, int *height );
300 
304 void rofi_capture_screenshot ( void );
306 #endif
void rofi_view_cleanup(void)
Definition: view.c:1777
MenuReturn
Definition: mode.h:66
void rofi_view_finalize(RofiViewState *state)
Definition: view.c:1110
BindingsScope
Definition: keyb.h:39
void rofi_view_clear_input(RofiViewState *state)
Definition: view.c:1876
void rofi_view_reload(void)
Definition: view.c:424
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition: view.c:1415
void rofi_view_queue_redraw(void)
Definition: view.c:431
void rofi_view_get_current_monitor(int *width, int *height)
Definition: view.c:134
Mode * rofi_view_get_mode(RofiViewState *state)
Definition: view.c:1849
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition: view.c:537
void __create_window(MenuFlags menu_flags)
Definition: view.c:660
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition: view.c:474
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition: view.c:1443
RofiViewState * rofi_view_get_active(void)
Definition: view.c:446
void rofi_view_workers_initialize(void)
Definition: view.c:1815
void rofi_capture_screenshot(void)
Definition: view.c:176
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition: view.c:512
void rofi_view_workers_finalize(void)
Definition: view.c:1842
void rofi_view_frame_callback(void)
Definition: view.c:1453
void rofi_view_free(RofiViewState *state)
Definition: view.c:490
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y)
Definition: view.c:1382
void rofi_view_hide(void)
Definition: view.c:1769
xcb_window_t rofi_view_get_window(void)
Definition: view.c:1904
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition: view.c:522
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition: view.c:1375
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition: view.c:532
void rofi_view_set_active(RofiViewState *state)
Definition: view.c:451
int rofi_view_error_dialog(const char *msg, int markup)
Definition: view.c:1726
textbox * text
Definition: view-internal.h:58
gboolean rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1337
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition: view.c:1884
void(* finalize)(struct RofiViewState *state)
void rofi_view_restart(RofiViewState *state)
Definition: view.c:440
void rofi_view_maybe_update(RofiViewState *state)
Definition: view.c:1392
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition: view.c:517
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition: view.c:1854
unsigned int selected_line
Definition: view-internal.h:91
MenuFlags menu_flags
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition: view.c:1654
MenuFlags
Definition: view.h:43