304708052d31be5068a1b0ad5d9f5214df6f5761
1 #ifndef BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H
2 #define BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H
5 * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #include "common/common.h"
31 const char *color_reset(struct details_write_ctx
*ctx
)
33 const char *code
= "";
35 if (ctx
->details_comp
->cfg
.with_color
) {
36 code
= bt_common_color_reset();
43 const char *color_bold(struct details_write_ctx
*ctx
)
45 const char *code
= "";
47 if (ctx
->details_comp
->cfg
.with_color
) {
48 code
= bt_common_color_bold();
55 const char *color_fg_default(struct details_write_ctx
*ctx
)
57 const char *code
= "";
59 if (ctx
->details_comp
->cfg
.with_color
) {
60 code
= bt_common_color_fg_default();
67 const char *color_fg_red(struct details_write_ctx
*ctx
)
69 const char *code
= "";
71 if (ctx
->details_comp
->cfg
.with_color
) {
72 code
= bt_common_color_fg_red();
79 const char *color_fg_green(struct details_write_ctx
*ctx
)
81 const char *code
= "";
83 if (ctx
->details_comp
->cfg
.with_color
) {
84 code
= bt_common_color_fg_green();
91 const char *color_fg_yellow(struct details_write_ctx
*ctx
)
93 const char *code
= "";
95 if (ctx
->details_comp
->cfg
.with_color
) {
96 code
= bt_common_color_fg_yellow();
103 const char *color_fg_blue(struct details_write_ctx
*ctx
)
105 const char *code
= "";
107 if (ctx
->details_comp
->cfg
.with_color
) {
108 code
= bt_common_color_fg_blue();
115 const char *color_fg_magenta(struct details_write_ctx
*ctx
)
117 const char *code
= "";
119 if (ctx
->details_comp
->cfg
.with_color
) {
120 code
= bt_common_color_fg_magenta();
127 const char *color_fg_cyan(struct details_write_ctx
*ctx
)
129 const char *code
= "";
131 if (ctx
->details_comp
->cfg
.with_color
) {
132 code
= bt_common_color_fg_cyan();
139 const char *color_fg_light_gray(struct details_write_ctx
*ctx
)
141 const char *code
= "";
143 if (ctx
->details_comp
->cfg
.with_color
) {
144 code
= bt_common_color_fg_light_gray();
151 const char *color_fg_bright_red(struct details_write_ctx
*ctx
)
153 const char *code
= "";
155 if (ctx
->details_comp
->cfg
.with_color
) {
156 code
= bt_common_color_fg_bright_red();
163 const char *color_fg_bright_green(struct details_write_ctx
*ctx
)
165 const char *code
= "";
167 if (ctx
->details_comp
->cfg
.with_color
) {
168 code
= bt_common_color_fg_bright_green();
175 const char *color_fg_bright_yellow(struct details_write_ctx
*ctx
)
177 const char *code
= "";
179 if (ctx
->details_comp
->cfg
.with_color
) {
180 code
= bt_common_color_fg_bright_yellow();
187 const char *color_fg_bright_blue(struct details_write_ctx
*ctx
)
189 const char *code
= "";
191 if (ctx
->details_comp
->cfg
.with_color
) {
192 code
= bt_common_color_fg_bright_blue();
199 const char *color_fg_bright_magenta(struct details_write_ctx
*ctx
)
201 const char *code
= "";
203 if (ctx
->details_comp
->cfg
.with_color
) {
204 code
= bt_common_color_fg_bright_magenta();
211 const char *color_fg_bright_cyan(struct details_write_ctx
*ctx
)
213 const char *code
= "";
215 if (ctx
->details_comp
->cfg
.with_color
) {
216 code
= bt_common_color_fg_bright_cyan();
223 const char *color_fg_bright_light_gray(struct details_write_ctx
*ctx
)
225 const char *code
= "";
227 if (ctx
->details_comp
->cfg
.with_color
) {
228 code
= bt_common_color_fg_bright_light_gray();
235 const char *color_bg_default(struct details_write_ctx
*ctx
)
237 const char *code
= "";
239 if (ctx
->details_comp
->cfg
.with_color
) {
240 code
= bt_common_color_bg_default();
247 const char *color_bg_red(struct details_write_ctx
*ctx
)
249 const char *code
= "";
251 if (ctx
->details_comp
->cfg
.with_color
) {
252 code
= bt_common_color_bg_red();
259 const char *color_bg_green(struct details_write_ctx
*ctx
)
261 const char *code
= "";
263 if (ctx
->details_comp
->cfg
.with_color
) {
264 code
= bt_common_color_bg_green();
271 const char *color_bg_yellow(struct details_write_ctx
*ctx
)
273 const char *code
= "";
275 if (ctx
->details_comp
->cfg
.with_color
) {
276 code
= bt_common_color_bg_yellow();
283 const char *color_bg_blue(struct details_write_ctx
*ctx
)
285 const char *code
= "";
287 if (ctx
->details_comp
->cfg
.with_color
) {
288 code
= bt_common_color_bg_blue();
295 const char *color_bg_magenta(struct details_write_ctx
*ctx
)
297 const char *code
= "";
299 if (ctx
->details_comp
->cfg
.with_color
) {
300 code
= bt_common_color_bg_magenta();
307 const char *color_bg_cyan(struct details_write_ctx
*ctx
)
309 const char *code
= "";
311 if (ctx
->details_comp
->cfg
.with_color
) {
312 code
= bt_common_color_bg_cyan();
319 const char *color_bg_light_gray(struct details_write_ctx
*ctx
)
321 const char *code
= "";
323 if (ctx
->details_comp
->cfg
.with_color
) {
324 code
= bt_common_color_bg_light_gray();
330 #endif /* BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H */
This page took 0.036015 seconds and 3 git commands to generate.