/* SPDX-License-Identifier: GPL-2.0 */ /** \file gui.h symbols used by gui and gui_theme */ /** * The foreground and background color of each status item, the decorations and * all messages can be customized through an instance of this structure. */ struct gui_color_spec { int fg; /**< Foreground color. */ int bg; /**< Background color. */ }; /** Theme definition. */ struct gui_theme { /** Printed at startup. */ const char *name; /** Default color, see assume_default_colors(3). */ struct gui_color_spec dflt; /** Color for the top window. */ struct gui_color_spec top; /** Color for the bottom window. */ struct gui_color_spec bot; /** Default number of lines of the top window. */ int top_lines_default; /** Minimal admissible number of lines to display the top window. */ int top_lines_min; /** Minimal admissible number of lines to display this theme. */ int lines_min; /** Minimal admissible number of columns to display this theme. */ int cols_min; /** Called when status items change, it should update the top window. */ bool (*print_status_items)(uint64_t mask, char **stat_content, WINDOW *win); /** Color of the bar that contains the version string. */ struct gui_color_spec vbar; /** Color of the name and args of the executing process. */ struct gui_color_spec cmd; /** Color for stdout of the executing process. */ struct gui_color_spec output; /** Color for log messages of moderate severity. */ struct gui_color_spec msg; /** Color for severe log messages. */ struct gui_color_spec err_msg; /** Color of the progress bar. */ struct gui_color_spec pbar; /** Color of the duration text shown next to the progress bar. */ struct gui_color_spec duration; }; /* gui.c */ int align_str(WINDOW *win, const char *str, unsigned int len, unsigned int align); /* gui_theme.c */ const struct gui_theme *theme_init(const char *name); const struct gui_theme *theme_prev(void); const struct gui_theme *theme_next(void); /** Status item text should be left-aligned. */ #define LEFT 1 /** Status item text should be right-aligned. */ #define RIGHT 2 /** Status item text should be displayed centered. */ #define CENTER 3