rofi  1.7.5
rofi.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_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 <xcb/xcb.h>
38 #include <xkbcommon/xkbcommon.h>
39 
48 extern const char *cache_dir;
49 
55 unsigned int rofi_get_num_enabled_modes(void);
56 
65 const Mode *rofi_get_mode(unsigned int index);
66 
72 void rofi_add_error_message(GString *str);
73 
77 void rofi_clear_error_messages(void);
78 
84 void rofi_add_warning_message(GString *str);
85 
96 void rofi_set_return_code(int code);
97 
98 void rofi_quit_main_loop(void);
99 
105 Mode *rofi_collect_modes_search(const char *name);
107 #define color_reset "\033[0m"
109 #define color_bold "\033[1m"
111 #define color_italic "\033[2m"
113 #define color_green "\033[0;32m"
115 #define color_red "\033[0;31m"
116 
118 #define ERROR_MSG(a) \
119  a "\n" \
120  "If you suspect this is caused by a bug in rofi,\n" \
121  "please report the following information to rofi's github page:\n" \
122  " * The generated commandline output when the error occurred.\n" \
123  " * Output of -dump-xresource\n" \
124  " * Steps to reproduce\n" \
125  " * The version of rofi you are running\n\n" \
126  " <i>https://github.com/davatorium/rofi/</i>"
128 #define ERROR_MSG_MARKUP TRUE
130 #endif
void rofi_quit_main_loop(void)
Definition: rofi.c:691
unsigned int rofi_get_num_enabled_modes(void)
Definition: rofi.c:147
void rofi_clear_error_messages(void)
Definition: rofi.c:93
void rofi_clear_warning_messages(void)
Definition: rofi.c:106
void rofi_set_return_code(int code)
Definition: rofi.c:145
const Mode * rofi_get_mode(unsigned int index)
Definition: rofi.c:149
Mode * rofi_collect_modes_search(const char *name)
Definition: rofi.c:516
const char * cache_dir
Definition: rofi.c:83
void rofi_add_error_message(GString *str)
Definition: rofi.c:90
void rofi_add_warning_message(GString *str)
Definition: rofi.c:103