rofi  1.5.4
mode.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_MODE_H
29 #define ROFI_MODE_H
30 #include <cairo.h>
31 #include "rofi-types.h"
32 G_BEGIN_DECLS
44 typedef struct rofi_mode Mode;
45 
49 typedef enum
50 {
52  MODE_EXIT = 1000,
54  NEXT_DIALOG = 1001,
56  RELOAD_DIALOG = 1002,
60  RESET_DIALOG = 1004,
61 } ModeMode;
62 
66 typedef enum
67 {
69  MENU_OK = 0x00010000,
71  MENU_CANCEL = 0x00020000,
73  MENU_NEXT = 0x00040000,
75  MENU_CUSTOM_INPUT = 0x00080000,
77  MENU_ENTRY_DELETE = 0x00100000,
79  MENU_QUICK_SWITCH = 0x00200000,
81  MENU_PREVIOUS = 0x00400000,
83  MENU_CUSTOM_ACTION = 0x10000000,
85  MENU_LOWER_MASK = 0x0000FFFF
87 
95 int mode_init ( Mode *mode );
96 
102 void mode_destroy ( Mode *mode );
103 
111 unsigned int mode_get_num_entries ( const Mode *mode );
112 
124 char * mode_get_display_value ( const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry );
125 
135 cairo_surface_t * mode_get_icon ( const Mode *mode, unsigned int selected_line, int height );
136 
145 char * mode_get_completion ( const Mode *mode, unsigned int selected_line );
146 
157 ModeMode mode_result ( Mode *mode, int menu_retv, char **input, unsigned int selected_line );
158 
168 int mode_token_match ( const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line );
169 
177 const char * mode_get_name ( const Mode *mode );
178 
184 void mode_free ( Mode **mode );
185 
192 void *mode_get_private_data ( const Mode *mode );
193 
201 void mode_set_private_data ( Mode *mode, void *pd );
202 
210 const char *mode_get_display_name ( const Mode *mode );
211 
217 void mode_set_config ( Mode *mode );
218 
228 char * mode_preprocess_input ( Mode *mode, const char *input );
229 
237 char *mode_get_message ( const Mode *mode );
239 G_END_DECLS
240 #endif
RESET_DIALOG
@ RESET_DIALOG
Definition: mode.h:60
MENU_QUICK_SWITCH
@ MENU_QUICK_SWITCH
Definition: mode.h:79
mode_get_completion
char * mode_get_completion(const Mode *mode, unsigned int selected_line)
Definition: mode.c:84
mode_token_match
int mode_token_match(const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line)
Definition: mode.c:105
MENU_OK
@ MENU_OK
Definition: mode.h:69
rofi_int_matcher_t
Definition: rofi-types.h:235
mode_get_icon
cairo_surface_t * mode_get_icon(const Mode *mode, unsigned int selected_line, int height)
Definition: mode.c:72
mode_set_private_data
void mode_set_private_data(Mode *mode, void *pd)
Definition: mode.c:134
PREVIOUS_DIALOG
@ PREVIOUS_DIALOG
Definition: mode.h:58
rofi-types.h
MENU_PREVIOUS
@ MENU_PREVIOUS
Definition: mode.h:81
mode_init
int mode_init(Mode *mode)
Definition: mode.c:42
NEXT_DIALOG
@ NEXT_DIALOG
Definition: mode.h:54
MenuReturn
MenuReturn
Definition: mode.h:67
mode_get_name
const char * mode_get_name(const Mode *mode)
Definition: mode.c:112
mode_free
void mode_free(Mode **mode)
Definition: mode.c:118
MODE_EXIT
@ MODE_EXIT
Definition: mode.h:52
mode_get_num_entries
unsigned int mode_get_num_entries(const Mode *mode)
Definition: mode.c:56
MENU_ENTRY_DELETE
@ MENU_ENTRY_DELETE
Definition: mode.h:77
mode_preprocess_input
char * mode_preprocess_input(Mode *mode, const char *input)
Definition: mode.c:157
mode_destroy
void mode_destroy(Mode *mode)
Definition: mode.c:49
rofi_mode
Definition: mode-private.h:152
MENU_CUSTOM_ACTION
@ MENU_CUSTOM_ACTION
Definition: mode.h:83
mode_get_display_name
const char * mode_get_display_name(const Mode *mode)
Definition: mode.c:143
MENU_CUSTOM_INPUT
@ MENU_CUSTOM_INPUT
Definition: mode.h:75
mode_get_private_data
void * mode_get_private_data(const Mode *mode)
Definition: mode.c:128
MENU_NEXT
@ MENU_NEXT
Definition: mode.h:73
MENU_CANCEL
@ MENU_CANCEL
Definition: mode.h:71
mode_get_display_value
char * mode_get_display_value(const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
Definition: mode.c:63
ModeMode
ModeMode
Definition: mode.h:50
RELOAD_DIALOG
@ RELOAD_DIALOG
Definition: mode.h:56
mode_get_message
char * mode_get_message(const Mode *mode)
Definition: mode.c:164
MENU_LOWER_MASK
@ MENU_LOWER_MASK
Definition: mode.h:85
mode_result
ModeMode mode_result(Mode *mode, int menu_retv, char **input, unsigned int selected_line)
Definition: mode.c:97
mode_set_config
void mode_set_config(Mode *mode)
Definition: mode.c:151