/*
- * Copyright (C) 2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007 Andre Noll <maan@tuebingen.mpg.de>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Licensed under the GPL v2. For licencing details see 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