rofi 2.1.0
rofi.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_MAIN_H
29#define ROFI_MAIN_H
30#include "keyb.h"
31#include "mode.h"
32#include "rofi-types.h"
33#include "view.h"
34#include <glib.h>
35#include <stdlib.h>
36#include <string.h>
37#include <xkbcommon/xkbcommon.h>
38
43
47extern const char *cache_dir;
48
54unsigned int rofi_get_num_enabled_modes(void);
55
64const Mode *rofi_get_mode(unsigned int index);
65
73int mode_lookup(const char *name);
74
80void rofi_add_error_message(GString *str);
81
86
92void rofi_add_warning_message(GString *str);
93
104void rofi_set_return_code(int code);
105
106void rofi_quit_main_loop(void);
107
113Mode *rofi_collect_modes_search(const char *name);
114
121const Mode *rofi_get_completer(void);
123#define color_reset "\033[0m"
125#define color_bold "\033[1m"
127#define color_italic "\033[2m"
129#define color_green "\033[0;32m"
131#define color_red "\033[0;31m"
132
134#define ERROR_MSG(a) \
135 a "\n" \
136 "If you suspect this is caused by a bug in rofi,\n" \
137 "please report the following information to rofi's github page:\n" \
138 " * The generated commandline output when the error occurred.\n" \
139 " * Output of -dump-xresource\n" \
140 " * Steps to reproduce\n" \
141 " * The version of rofi you are running\n\n" \
142 " <i>https://github.com/davatorium/rofi/</i>"
143
144#define ERROR_MSG_MARKUP TRUE
146#endif
struct rofi_mode Mode
Definition mode.h:49
const Mode * rofi_get_mode(unsigned int index)
Definition rofi.c:159
void rofi_quit_main_loop(void)
Definition rofi.c:833
unsigned int rofi_get_num_enabled_modes(void)
Definition rofi.c:157
void rofi_clear_error_messages(void)
Definition rofi.c:100
void rofi_clear_warning_messages(void)
Definition rofi.c:113
void rofi_set_return_code(int code)
Definition rofi.c:155
const Mode * rofi_get_completer(void)
Definition rofi.c:1414
Mode * rofi_collect_modes_search(const char *name)
Definition rofi.c:648
int mode_lookup(const char *name)
Definition rofi.c:161
const char * cache_dir
Definition rofi.c:86
void rofi_add_error_message(GString *str)
Definition rofi.c:97
void rofi_add_warning_message(GString *str)
Definition rofi.c:110