rofi  1.5.1
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
86 } MenuReturn;
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
MenuReturn
Definition: mode.h:66
int mode_token_match(const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line)
Definition: mode.c:105
Definition: mode.h:69
cairo_surface_t * mode_get_icon(const Mode *mode, unsigned int selected_line, int height)
Definition: mode.c:72
char * mode_preprocess_input(Mode *mode, const char *input)
Definition: mode.c:157
void mode_free(Mode **mode)
Definition: mode.c:118
ModeMode
Definition: mode.h:49
Definition: mode.h:52
void * mode_get_private_data(const Mode *mode)
Definition: mode.c:128
void mode_set_config(Mode *mode)
Definition: mode.c:151
void mode_destroy(Mode *mode)
Definition: mode.c:49
unsigned int mode_get_num_entries(const Mode *mode)
Definition: mode.c:56
char * mode_get_display_value(const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
Definition: mode.c:63
const char * mode_get_name(const Mode *mode)
Definition: mode.c:112
void mode_set_private_data(Mode *mode, void *pd)
Definition: mode.c:134
ModeMode mode_result(Mode *mode, int menu_retv, char **input, unsigned int selected_line)
Definition: mode.c:97
Definition: mode.h:73
char * mode_get_message(const Mode *mode)
Definition: mode.c:164
const char * mode_get_display_name(const Mode *mode)
Definition: mode.c:143
char * mode_get_completion(const Mode *mode, unsigned int selected_line)
Definition: mode.c:84
int mode_init(Mode *mode)
Definition: mode.c:42