rofi 1.7.9
mode.h
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2023 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 "rofi-types.h"
31#include <cairo.h>
32#include <gmodule.h>
33G_BEGIN_DECLS
34
36#define ABI_VERSION 7u
37
44
49typedef struct rofi_mode Mode;
50
54typedef enum {
56 MODE_EXIT = 1000,
65} ModeMode;
66
70typedef enum {
72 MENU_OK = 0x00010000,
74 MENU_CANCEL = 0x00020000,
76 MENU_NEXT = 0x00040000,
78 MENU_CUSTOM_INPUT = 0x00080000,
80 MENU_ENTRY_DELETE = 0x00100000,
82 MENU_QUICK_SWITCH = 0x00200000,
84 MENU_CUSTOM_COMMAND = 0x00800000,
86 MENU_PREVIOUS = 0x00400000,
88 MENU_COMPLETE = 0x01000000,
90 MENU_CUSTOM_ACTION = 0x10000000,
92 MENU_LOWER_MASK = 0x0000FFFF
94
102int mode_init(Mode *mode);
103
109void mode_destroy(Mode *mode);
110
118unsigned int mode_get_num_entries(const Mode *mode);
119
134char *mode_get_display_value(const Mode *mode, unsigned int selected_line,
135 int *state, GList **attribute_list, int get_entry);
136
146cairo_surface_t *mode_get_icon(Mode *mode, unsigned int selected_line,
147 unsigned int height);
148
158char *mode_get_completion(const Mode *mode, unsigned int selected_line);
159
170ModeMode mode_result(Mode *mode, int menu_retv, char **input,
171 unsigned int selected_line);
172
182int mode_token_match(const Mode *mode, rofi_int_matcher **tokens,
183 unsigned int selected_line);
184
192const char *mode_get_name(const Mode *mode);
193
199void mode_free(Mode **mode);
200
207void *mode_get_private_data(const Mode *mode);
208
216void mode_set_private_data(Mode *mode, void *pd);
217
225const char *mode_get_display_name(const Mode *mode);
226
233void mode_set_config(Mode *mode);
234
244char *mode_preprocess_input(Mode *mode, const char *input);
245
254char *mode_get_message(const Mode *mode);
255
261Mode *mode_create(const Mode *mode);
262
274ModeMode mode_completer_result(Mode *sw, int menu_retv, char **input,
275 unsigned int selected_line, char **path);
276
284gboolean mode_is_completer(const Mode *sw);
285
291int mode_get_abi_version(Mode *const mode);
292
300void mode_plugin_set_module(Mode *mode, GModule *mod);
306GModule *mode_plugin_get_module(Mode *mode);
308G_END_DECLS
309#endif
void mode_destroy(Mode *mode)
Definition mode.c:64
const char * mode_get_name(const Mode *mode)
Definition mode.c:157
char * mode_preprocess_input(Mode *mode, const char *input)
Definition mode.c:212
int mode_init(Mode *mode)
Definition mode.c:44
cairo_surface_t * mode_get_icon(Mode *mode, unsigned int selected_line, unsigned int height)
Definition mode.c:87
const char * mode_get_display_name(const Mode *mode)
Definition mode.c:189
struct rofi_mode Mode
Definition mode.h:49
unsigned int mode_get_num_entries(const Mode *mode)
Definition mode.c:70
void mode_free(Mode **mode)
Definition mode.c:167
int mode_get_abi_version(Mode *const mode)
Definition mode.c:162
ModeMode mode_result(Mode *mode, int menu_retv, char **input, unsigned int selected_line)
Definition mode.c:131
Mode * mode_create(const Mode *mode)
Definition mode.c:225
void mode_plugin_set_module(Mode *mode, GModule *mod)
Definition mode.c:253
gboolean mode_is_completer(const Mode *sw)
Definition mode.c:244
ModeMode mode_completer_result(Mode *sw, int menu_retv, char **input, unsigned int selected_line, char **path)
Definition mode.c:232
void * mode_get_private_data(const Mode *mode)
Definition mode.c:176
MenuReturn
Definition mode.h:70
char * mode_get_message(const Mode *mode)
Definition mode.c:218
GModule * mode_plugin_get_module(Mode *mode)
Definition mode.c:256
void mode_set_private_data(Mode *mode, void *pd)
Definition mode.c:181
int mode_token_match(const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line)
Definition mode.c:150
ModeMode
Definition mode.h:54
char * mode_get_display_value(const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
Definition mode.c:76
void mode_set_config(Mode *mode)
Definition mode.c:205
char * mode_get_completion(const Mode *mode, unsigned int selected_line)
Definition mode.c:121
@ MENU_CUSTOM_COMMAND
Definition mode.h:84
@ MENU_COMPLETE
Definition mode.h:88
@ MENU_LOWER_MASK
Definition mode.h:92
@ MENU_PREVIOUS
Definition mode.h:86
@ MENU_CANCEL
Definition mode.h:74
@ MENU_QUICK_SWITCH
Definition mode.h:82
@ MENU_ENTRY_DELETE
Definition mode.h:80
@ MENU_NEXT
Definition mode.h:76
@ MENU_CUSTOM_ACTION
Definition mode.h:90
@ MENU_OK
Definition mode.h:72
@ MENU_CUSTOM_INPUT
Definition mode.h:78
@ MODE_EXIT
Definition mode.h:56
@ NEXT_DIALOG
Definition mode.h:58
@ RELOAD_DIALOG
Definition mode.h:60
@ PREVIOUS_DIALOG
Definition mode.h:62
@ RESET_DIALOG
Definition mode.h:64
struct rofi_int_matcher_t rofi_int_matcher