mixer: fade: Handle empty mood strings gracefully.
[paraslash.git] / gui.h
1 /* Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
2
3 /** \file gui.h symbols used by gui and gui_theme */
4
5 /**
6 * The foreground and background color of each status item, the decorations and
7 * all messages can be customized through an instance of this structure.
8 */
9 struct gui_color_spec {
10 int fg; /**< Foreground color. */
11 int bg; /**< Background color. */
12 };
13
14 /** How to display one status item. */
15 struct stat_item_data {
16 const char *prefix; /**< Text to print before the item content. */
17 const char *postfix; /**< Text to print after item content. */
18 unsigned x; /**< Horizontal start coordinate for this item. */
19 unsigned y; /**< Vertical start coordinate for this item. */
20 unsigned len; /**< Item width, including \a prefix and \a postfix. */
21 struct gui_color_spec color; /**< Foreground and background color. */
22 int align; /**< How to align this item. */
23 };
24
25 /** Theme definition. */
26 struct gui_theme {
27 /** Printed at startup. */
28 const char *name;
29 /** Also printed at startup. */
30 const char *author;
31 /** The character for the separator line. */
32 char sep_char;
33 /** Default color, see assume_default_colors(3). */
34 struct gui_color_spec dflt;
35 /** Default number of lines of the top window. */
36 int top_lines_default;
37 /** Minimal admissible number of lines to display the top window. */
38 int top_lines_min;
39 /** Minimal admissible number of lines to display this theme. */
40 int lines_min;
41 /** Minimal admissible number of columns to display this theme. */
42 int cols_min;
43 /** Individual status item properties. */
44 struct stat_item_data data[NUM_STAT_ITEMS];
45 /** Color of the status bar. */
46 struct gui_color_spec sb;
47 /** Color of the name and args of the executing process. */
48 struct gui_color_spec cmd;
49 /** Color for stdout of the executing process. */
50 struct gui_color_spec output;
51 /** Color for log messages of moderate severity. */
52 struct gui_color_spec msg;
53 /** Color for severe log messages. */
54 struct gui_color_spec err_msg;
55 /** Color for the separator line. */
56 struct gui_color_spec sep;
57 };
58
59 void theme_init(const char *name, struct gui_theme *t);
60 void theme_prev(struct gui_theme *t);
61 void theme_next(struct gui_theme *t);
62
63 /** Status item text should be left-aligned. */
64 #define LEFT 1
65 /** Status item text should be right-aligned. */
66 #define RIGHT 2
67 /** Status item text should be displayed centered. */
68 #define CENTER 3