rofi 1.7.5
mode.h
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2022 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>
32G_BEGIN_DECLS
44typedef struct rofi_mode Mode;
45
49typedef enum {
51 MODE_EXIT = 1000,
60} ModeMode;
61
65typedef enum {
67 MENU_OK = 0x00010000,
69 MENU_CANCEL = 0x00020000,
71 MENU_NEXT = 0x00040000,
73 MENU_CUSTOM_INPUT = 0x00080000,
75 MENU_ENTRY_DELETE = 0x00100000,
77 MENU_QUICK_SWITCH = 0x00200000,
79 MENU_CUSTOM_COMMAND = 0x00800000,
81 MENU_PREVIOUS = 0x00400000,
83 MENU_COMPLETE = 0x01000000,
85 MENU_CUSTOM_ACTION = 0x10000000,
87 MENU_LOWER_MASK = 0x0000FFFF
89
97int mode_init(Mode *mode);
98
104void mode_destroy(Mode *mode);
105
113unsigned int mode_get_num_entries(const Mode *mode);
114
129char *mode_get_display_value(const Mode *mode, unsigned int selected_line,
130 int *state, GList **attribute_list, int get_entry);
131
141cairo_surface_t *mode_get_icon(Mode *mode, unsigned int selected_line,
142 unsigned int height);
143
153char *mode_get_completion(const Mode *mode, unsigned int selected_line);
154
165ModeMode mode_result(Mode *mode, int menu_retv, char **input,
166 unsigned int selected_line);
167
177int mode_token_match(const Mode *mode, rofi_int_matcher **tokens,
178 unsigned int selected_line);
179
187const char *mode_get_name(const Mode *mode);
188
194void mode_free(Mode **mode);
195
202void *mode_get_private_data(const Mode *mode);
203
211void mode_set_private_data(Mode *mode, void *pd);
212
220const char *mode_get_display_name(const Mode *mode);
221
228void mode_set_config(Mode *mode);
229
239char *mode_preprocess_input(Mode *mode, const char *input);
240
249char *mode_get_message(const Mode *mode);
251G_END_DECLS
252#endif
void mode_destroy(Mode *mode)
Definition mode.c:52
const char * mode_get_name(const Mode *mode)
Definition mode.c:145
char * mode_preprocess_input(Mode *mode, const char *input)
Definition mode.c:195
int mode_init(Mode *mode)
Definition mode.c:43
cairo_surface_t * mode_get_icon(Mode *mode, unsigned int selected_line, unsigned int height)
Definition mode.c:75
const char * mode_get_display_name(const Mode *mode)
Definition mode.c:172
unsigned int mode_get_num_entries(const Mode *mode)
Definition mode.c:58
void mode_free(Mode **mode)
Definition mode.c:150
ModeMode mode_result(Mode *mode, int menu_retv, char **input, unsigned int selected_line)
Definition mode.c:119
void * mode_get_private_data(const Mode *mode)
Definition mode.c:159
MenuReturn
Definition mode.h:65
char * mode_get_message(const Mode *mode)
Definition mode.c:201
void mode_set_private_data(Mode *mode, void *pd)
Definition mode.c:164
int mode_token_match(const Mode *mode, rofi_int_matcher **tokens, unsigned int selected_line)
Definition mode.c:138
ModeMode
Definition mode.h:49
char * mode_get_display_value(const Mode *mode, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
Definition mode.c:64
void mode_set_config(Mode *mode)
Definition mode.c:188
char * mode_get_completion(const Mode *mode, unsigned int selected_line)
Definition mode.c:109
@ MENU_CUSTOM_COMMAND
Definition mode.h:79
@ MENU_COMPLETE
Definition mode.h:83
@ MENU_LOWER_MASK
Definition mode.h:87
@ MENU_PREVIOUS
Definition mode.h:81
@ MENU_CANCEL
Definition mode.h:69
@ MENU_QUICK_SWITCH
Definition mode.h:77
@ MENU_ENTRY_DELETE
Definition mode.h:75
@ MENU_NEXT
Definition mode.h:71
@ MENU_CUSTOM_ACTION
Definition mode.h:85
@ MENU_OK
Definition mode.h:67
@ MENU_CUSTOM_INPUT
Definition mode.h:73
@ MODE_EXIT
Definition mode.h:51
@ NEXT_DIALOG
Definition mode.h:53
@ RELOAD_DIALOG
Definition mode.h:55
@ PREVIOUS_DIALOG
Definition mode.h:57
@ RESET_DIALOG
Definition mode.h:59