rofi  1.5.4
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 
42 typedef struct RofiViewState RofiViewState;
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
RofiViewState::sw
Mode * sw
Definition: view-internal.h:50
BindingsScope
BindingsScope
Definition: keyb.h:43
rofi_view_frame_callback
void rofi_view_frame_callback(void)
Definition: view.c:1481
rofi_view_workers_initialize
void rofi_view_workers_initialize(void)
Definition: view.c:1852
MenuFlags
MenuFlags
Definition: view.h:44
RofiViewState::height
int height
Definition: view-internal.h:116
rofi_view_workers_finalize
void rofi_view_workers_finalize(void)
Definition: view.c:1879
MENU_INDICATOR
@ MENU_INDICATOR
Definition: view.h:54
rofi_view_clear_input
void rofi_view_clear_input(RofiViewState *state)
Definition: view.c:1906
rofi_view_get_next_position
unsigned int rofi_view_get_next_position(const RofiViewState *state)
Definition: view.c:520
rofi_view_get_active
RofiViewState * rofi_view_get_active(void)
Definition: view.c:447
mode.h
rofi_view_error_dialog
int rofi_view_error_dialog(const char *msg, int markup)
Definition: view.c:1763
rofi_view_maybe_update
void rofi_view_maybe_update(RofiViewState *state)
Definition: view.c:1413
rofi_view_handle_text
void rofi_view_handle_text(RofiViewState *state, char *text)
Definition: view.c:1396
rofi_view_queue_redraw
void rofi_view_queue_redraw(void)
Definition: view.c:432
rofi_view_get_selected_line
unsigned int rofi_view_get_selected_line(const RofiViewState *state)
Definition: view.c:515
rofi_view_get_mode
Mode * rofi_view_get_mode(RofiViewState *state)
Definition: view.c:1886
MENU_NORMAL
@ MENU_NORMAL
Definition: view.h:46
__create_window
void __create_window(MenuFlags menu_flags)
Definition: view.c:678
rofi_view_free
void rofi_view_free(RofiViewState *state)
Definition: view.c:491
MenuReturn
MenuReturn
Definition: mode.h:67
rofi_view_get_return_value
MenuReturn rofi_view_get_return_value(const RofiViewState *state)
Definition: view.c:510
rofi_view_set_active
void rofi_view_set_active(RofiViewState *state)
Definition: view.c:452
rofi_view_handle_mouse_motion
void rofi_view_handle_mouse_motion(RofiViewState *state, gint x, gint y)
Definition: view.c:1403
rofi_view_get_current_monitor
void rofi_view_get_current_monitor(int *width, int *height)
Definition: view.c:135
rofi_capture_screenshot
void rofi_capture_screenshot(void)
Definition: view.c:177
rofi_view_temp_configure_notify
void rofi_view_temp_configure_notify(RofiViewState *state, xcb_configure_notify_event_t *xce)
Definition: view.c:1440
rofi_view_finalize
void rofi_view_finalize(RofiViewState *state)
Definition: view.c:1126
RofiViewState::y
int y
Definition: view-internal.h:120
rofi_view_restart
void rofi_view_restart(RofiViewState *state)
Definition: view.c:441
rofi_view_get_window
xcb_window_t rofi_view_get_window(void)
Definition: view.c:1934
rofi_mode
Definition: mode-private.h:152
RofiViewState::selected_line
unsigned int selected_line
Definition: view-internal.h:92
rofi_view_temp_click_to_exit
void rofi_view_temp_click_to_exit(RofiViewState *state, xcb_window_t target)
Definition: view.c:1471
RofiViewState::menu_flags
MenuFlags menu_flags
Definition: view-internal.h:105
MENU_PASSWORD
@ MENU_PASSWORD
Definition: view.h:48
RofiViewState::width
int width
Definition: view-internal.h:114
MENU_NORMAL_WINDOW
@ MENU_NORMAL_WINDOW
Definition: view.h:50
RofiViewState::finalize
void(* finalize)(struct RofiViewState *state)
Definition: view-internal.h:111
RofiViewState::text
textbox * text
Definition: view-internal.h:59
rofi_view_hide
void rofi_view_hide(void)
Definition: view.c:1806
MENU_ERROR_DIALOG
@ MENU_ERROR_DIALOG
Definition: view.h:52
RofiViewState::x
int x
Definition: view-internal.h:118
rofi_view_create
RofiViewState * rofi_view_create(Mode *sw, const char *input, MenuFlags menu_flags, void(*finalize)(RofiViewState *))
Definition: view.c:1693
rofi_view_get_user_input
const char * rofi_view_get_user_input(const RofiViewState *state)
Definition: view.c:535
rofi_view_cleanup
void rofi_view_cleanup(void)
Definition: view.c:1814
rofi_view_get_completed
unsigned int rofi_view_get_completed(const RofiViewState *state)
Definition: view.c:530
rofi_view_trigger_action
gboolean rofi_view_trigger_action(RofiViewState *state, BindingsScope scope, guint action)
Definition: view.c:1358
RofiViewState
Definition: view-internal.h:48
rofi_view_set_selected_line
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition: view.c:475
rofi_view_set_overlay
void rofi_view_set_overlay(RofiViewState *state, const char *text)
Definition: view.c:1891
rofi_view_reload
void rofi_view_reload(void)
Definition: view.c:425
rofi_view_switch_mode
void rofi_view_switch_mode(RofiViewState *state, Mode *mode)
Definition: view.c:1914