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