vss: Add documentation of MAP_POPULATE.
[paraslash.git] / gui.h
diff --git a/gui.h b/gui.h
index abc3191befcb29abd0fda8bb93d3c51c3a697f38..d868581847d19072377bb777520c59ccf7725173 100644 (file)
--- a/gui.h
+++ b/gui.h
@@ -1,38 +1,68 @@
-/*
- * Copyright (C) 2007-2009 Andre Noll <maan@systemlinux.org>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \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. */
+};
+
+/** How to display one status item. */
 struct stat_item_data {
-       const char *prefix, *postfix;
-       unsigned x, y, len;
-       int fg, bg, align;
+       const char *prefix; /**< Text to print before the item content. */
+       const char *postfix; /**< Text to print after item content. */
+       unsigned x; /**< Horizontal start coordinate for this item. */
+       unsigned y; /**< Vertical start coordinate for this item. */
+       unsigned len; /**< Item width, including \a prefix and \a postfix. */
+       struct gui_color_spec color; /**< Foreground and background color. */
+       int align; /**< How to align this item. */
 };
 
+/** Theme definition. */
 struct gui_theme {
+       /** Printed at startup. */
        const char *name;
+       /** Also printed at startup. */
        const char *author;
-       int sb_fg, sb_bg;
-       int cmd_fg, cmd_bg;
-       int output_fg, output_bg;
-       int msg_fg, msg_bg;
-       int err_msg_fg, err_msg_bg;
-       int welcome_fg, welcome_bg;
-       int sep_fg, sep_bg;
-       const char *sep_str;
-       int default_fg, default_bg;
-
-       int top_lines_default, top_lines_min;
-       int lines_min, cols_min;
+       /** The character for the separator line. */
+       char sep_char;
+       /** Default color, see assume_default_colors(3). */
+       struct gui_color_spec dflt;
+       /** 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;
+       /** Individual status item properties. */
        struct stat_item_data data[NUM_STAT_ITEMS];
+       /** Color of the status bar. */
+       struct gui_color_spec sb;
+       /** 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 for the separator line. */
+       struct gui_color_spec sep;
 };
 
-void init_theme(int i, struct gui_theme *);
-void next_theme(struct gui_theme *);
-void prev_theme(struct gui_theme *);
+void theme_init(const char *name, struct gui_theme *t);
+void theme_prev(struct gui_theme *t);
+void theme_next(struct gui_theme *t);
+
+/** 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