PipeWire: ansi.h Source File

PipeWire 0.3.34

ansi.h
Go to the documentation of this file.
1 /* Simple Plugin API
2 *
3 * Copyright © 2021 Red Hat, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef SPA_UTILS_ANSI_H
26 #define SPA_UTILS_ANSI_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
45 #define SPA_ANSI_RESET "\x1B[0m"
46 #define SPA_ANSI_BOLD "\x1B[1m"
47 #define SPA_ANSI_ITALIC "\x1B[3m"
48 #define SPA_ANSI_UNDERLINE "\x1B[4m"
49
50 #define SPA_ANSI_BLACK "\x1B[0;30m"
51 #define SPA_ANSI_RED "\x1B[0;31m"
52 #define SPA_ANSI_GREEN "\x1B[0;32m"
53 #define SPA_ANSI_YELLOW "\x1B[0;33m"
54 #define SPA_ANSI_BLUE "\x1B[0;34m"
55 #define SPA_ANSI_MAGENTA "\x1B[0;35m"
56 #define SPA_ANSI_CYAN "\x1B[0;36m"
57 #define SPA_ANSI_WHITE "\x1B[0;37m"
58 #define SPA_ANSI_BRIGHT_BLACK "\x1B[90m"
59 #define SPA_ANSI_BRIGHT_RED "\x1B[91m"
60 #define SPA_ANSI_BRIGHT_GREEN "\x1B[92m"
61 #define SPA_ANSI_BRIGHT_YELLOW "\x1B[93m"
62 #define SPA_ANSI_BRIGHT_BLUE "\x1B[94m"
63 #define SPA_ANSI_BRIGHT_MAGENTA "\x1B[95m"
64 #define SPA_ANSI_BRIGHT_CYAN "\x1B[96m"
65 #define SPA_ANSI_BRIGHT_WHITE "\x1B[97m"
66
67 /* Shortcut because it's a common use-case and easier than combining both */
68 #define SPA_ANSI_BOLD_BLACK "\x1B[1;30m"
69 #define SPA_ANSI_BOLD_RED "\x1B[1;31m"
70 #define SPA_ANSI_BOLD_GREEN "\x1B[1;32m"
71 #define SPA_ANSI_BOLD_YELLOW "\x1B[1;33m"
72 #define SPA_ANSI_BOLD_BLUE "\x1B[1;34m"
73 #define SPA_ANSI_BOLD_MAGENTA "\x1B[1;35m"
74 #define SPA_ANSI_BOLD_CYAN "\x1B[1;36m"
75 #define SPA_ANSI_BOLD_WHITE "\x1B[1;37m"
76
77 #define SPA_ANSI_DARK_BLACK "\x1B[2;30m"
78 #define SPA_ANSI_DARK_RED "\x1B[2;31m"
79 #define SPA_ANSI_DARK_GREEN "\x1B[2;32m"
80 #define SPA_ANSI_DARK_YELLOW "\x1B[2;33m"
81 #define SPA_ANSI_DARK_BLUE "\x1B[2;34m"
82 #define SPA_ANSI_DARK_MAGENTA "\x1B[2;35m"
83 #define SPA_ANSI_DARK_CYAN "\x1B[2;36m"
84 #define SPA_ANSI_DARK_WHITE "\x1B[2;37m"
85
86 /* Background colors */
87 #define SPA_ANSI_BG_BLACK "\x1B[0;40m"
88 #define SPA_ANSI_BG_RED "\x1B[0;41m"
89 #define SPA_ANSI_BG_GREEN "\x1B[0;42m"
90 #define SPA_ANSI_BG_YELLOW "\x1B[0;43m"
91 #define SPA_ANSI_BG_BLUE "\x1B[0;44m"
92 #define SPA_ANSI_BG_MAGENTA "\x1B[0;45m"
93 #define SPA_ANSI_BG_CYAN "\x1B[0;46m"
94 #define SPA_ANSI_BG_WHITE "\x1B[0;47m"
95 #define SPA_ANSI_BG_BRIGHT_BLACK "\x1B[100m"
96 #define SPA_ANSI_BG_BRIGHT_RED "\x1B[101m"
97 #define SPA_ANSI_BG_BRIGHT_GREEN "\x1B[102m"
98 #define SPA_ANSI_BG_BRIGHT_YELLOW "\x1B[103m"
99 #define SPA_ANSI_BG_BRIGHT_BLUE "\x1B[104m"
100 #define SPA_ANSI_BG_BRIGHT_MAGENTA "\x1B[105m"
101 #define SPA_ANSI_BG_BRIGHT_CYAN "\x1B[106m"
102 #define SPA_ANSI_BG_BRIGHT_WHITE "\x1B[107m"
103
108 #ifdef __cplusplus
109 } /* extern "C" */
110 #endif
111
112 #endif /* SPA_UTILS_ANSI_H */