rofi  1.7.0
rofi.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_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_modi(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);
84 void rofi_set_return_code(int code);
85 
86 void rofi_quit_main_loop(void);
87 
93 Mode *rofi_collect_modi_search(const char *name);
95 #define color_reset "\033[0m"
97 #define color_bold "\033[1m"
99 #define color_italic "\033[2m"
101 #define color_green "\033[0;32m"
103 #define color_red "\033[0;31m"
104 
106 #define ERROR_MSG(a) \
107  a "\n" \
108  "If you suspect this is caused by a bug in rofi,\n" \
109  "please report the following information to rofi's github page:\n" \
110  " * The generated commandline output when the error occurred.\n" \
111  " * Output of -dump-xresource\n" \
112  " * Steps to reproduce\n" \
113  " * The version of rofi you are running\n\n" \
114  " <i>https://github.com/davatorium/rofi/</i>"
116 #define ERROR_MSG_MARKUP TRUE
118 #endif
void rofi_quit_main_loop(void)
Definition: rofi.c:665
Mode * rofi_collect_modi_search(const char *name)
Definition: rofi.c:491
void rofi_clear_error_messages(void)
Definition: rofi.c:92
void rofi_set_return_code(int code)
Definition: rofi.c:131
unsigned int rofi_get_num_enabled_modi(void)
Definition: rofi.c:133
const Mode * rofi_get_mode(unsigned int index)
Definition: rofi.c:135
const char * cache_dir
Definition: rofi.c:83
void rofi_add_error_message(GString *str)
Definition: rofi.c:89