rofi  1.7.0
mode-private.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2021 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_PRIVATE_H
29 #define ROFI_MODE_PRIVATE_H
30 #include <gmodule.h>
31 G_BEGIN_DECLS
32 
34 #define ABI_VERSION 0x00000006
35 
41 typedef void (*_mode_free)(Mode *data);
42 
55 typedef char *(*_mode_get_display_value)(const Mode *sw,
56  unsigned int selected_line, int *state,
57  GList **attribute_list, int get_entry);
58 
67 typedef cairo_surface_t *(*_mode_get_icon)(const Mode *sw,
68  unsigned int selected_line,
69  int height);
70 
79 typedef char *(*_mode_get_completion)(const Mode *sw,
80  unsigned int selected_line);
81 
93 typedef int (*_mode_token_match)(const Mode *data, rofi_int_matcher **tokens,
94  unsigned int index);
95 
103 typedef int (*__mode_init)(Mode *sw);
104 
112 typedef unsigned int (*__mode_get_num_entries)(const Mode *sw);
113 
120 typedef void (*__mode_destroy)(Mode *sw);
121 
132 typedef ModeMode (*_mode_result)(Mode *sw, int menu_retv, char **input,
133  unsigned int selected_line);
134 
143 typedef char *(*_mode_preprocess_input)(Mode *sw, const char *input);
144 
152 typedef char *(*_mode_get_message)(const Mode *sw);
153 
159 struct rofi_mode {
161  unsigned int abi_version;
163  char *name;
164  char cfg_name_key[128];
166 
186 
188 
190 
193 
201  void *ed;
202 
204  GModule *module;
205 };
206 G_END_DECLS
207 #endif // ROFI_MODE_PRIVATE_H
ModeMode
Definition: mode.h:49
char *(* _mode_get_completion)(const Mode *sw, unsigned int selected_line)
Definition: mode-private.h:79
void(* _mode_free)(Mode *data)
Definition: mode-private.h:41
int(* _mode_token_match)(const Mode *data, rofi_int_matcher **tokens, unsigned int index)
Definition: mode-private.h:93
char *(* _mode_get_message)(const Mode *sw)
Definition: mode-private.h:152
unsigned int(* __mode_get_num_entries)(const Mode *sw)
Definition: mode-private.h:112
char *(* _mode_get_display_value)(const Mode *sw, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
Definition: mode-private.h:55
char *(* _mode_preprocess_input)(Mode *sw, const char *input)
Definition: mode-private.h:143
int(* __mode_init)(Mode *sw)
Definition: mode-private.h:103
cairo_surface_t *(* _mode_get_icon)(const Mode *sw, unsigned int selected_line, int height)
Definition: mode-private.h:67
ModeMode(* _mode_result)(Mode *sw, int menu_retv, char **input, unsigned int selected_line)
Definition: mode-private.h:132
void(* __mode_destroy)(Mode *sw)
Definition: mode-private.h:120
_mode_result _result
Definition: mode-private.h:177
__mode_get_num_entries _get_num_entries
Definition: mode-private.h:175
__mode_destroy _destroy
Definition: mode-private.h:173
_mode_preprocess_input _preprocess_input
Definition: mode-private.h:187
char * display_name
Definition: mode-private.h:165
_mode_free free
Definition: mode-private.h:199
unsigned int abi_version
Definition: mode-private.h:161
_mode_token_match _token_match
Definition: mode-private.h:179
_mode_get_display_value _get_display_value
Definition: mode-private.h:181
_mode_get_icon _get_icon
Definition: mode-private.h:183
_mode_get_completion _get_completion
Definition: mode-private.h:185
char cfg_name_key[128]
Definition: mode-private.h:164
GModule * module
Definition: mode-private.h:204
void * ed
Definition: mode-private.h:201
__mode_init _init
Definition: mode-private.h:171
char * name
Definition: mode-private.h:163
_mode_get_message _get_message
Definition: mode-private.h:189
void * private_data
Definition: mode-private.h:192