X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui_theme.c;h=b13fdf9f13e3cbc13a19d051f86d09ca9610fcbd;hp=fa63e90972fa7b3b70ec9b2fec53adf098a3e107;hb=9775f534cc971999cec266cb0ea526e254559d87;hpb=56df9bb38aa4725f9244a7898d765608d8a1fffa diff --git a/gui_theme.c b/gui_theme.c index fa63e909..b13fdf9f 100644 --- a/gui_theme.c +++ b/gui_theme.c @@ -4,6 +4,8 @@ * Licensed under the GPL v2. For licencing details see COPYING. */ +/** \file gui_theme.c Theme definitions. */ + #include "para.h" #include "gui.h" #include @@ -26,13 +28,11 @@ static void init_theme_simple(struct gui_theme *t) t->msg_fg = COLOR_YELLOW; t->err_msg_bg = COLOR_RED; t->err_msg_fg = COLOR_WHITE; - t->welcome_bg = COLOR_BLUE; - t->welcome_fg = COLOR_WHITE; t->sep_bg = COLOR_BLUE; t->sep_fg = COLOR_CYAN; t->default_fg = COLOR_WHITE; t->default_bg = COLOR_BLUE; - t->sep_str = "*"; + t->sep_char = '*'; d[SI_BASENAME].prefix = ""; d[SI_BASENAME].postfix = ""; @@ -85,11 +85,9 @@ static void init_theme_colorful_blackness(struct gui_theme *t) t->msg_fg = COLOR_WHITE; t->err_msg_bg = COLOR_RED; t->err_msg_fg = COLOR_WHITE; - t->welcome_bg = COLOR_BLUE; - t->welcome_fg = COLOR_WHITE; t->sep_bg = COLOR_BLACK; /* color of the separator */ t->sep_fg = COLOR_BLUE; - t->sep_str = "-"; + t->sep_char = 0; /* default (ACS_HLINE) */ t->default_bg = COLOR_BLACK; t->default_fg = COLOR_MAGENTA; @@ -372,6 +370,7 @@ static struct theme_description themes[] = { }, }; +/** Number of elements in the \a themes array. */ #define NUM_THEMES (ARRAY_SIZE(themes)) static int current_theme_num; @@ -385,9 +384,18 @@ static void set_theme(int num, struct gui_theme *t) t->name = themes[num].name; themes[num].init(t); current_theme_num = num; + PARA_NOTICE_LOG("theme: %s\n", t->name); } -void init_theme_or_die(const char *name, struct gui_theme *t) +/** + * Initialize a theme. + * + * \param name Name of the theme to be initialized. + * \param t The function fills out this structure. + * + * This function exits if there is no theme called \a name. + */ +void theme_init(const char *name, struct gui_theme *t) { int i; @@ -402,12 +410,30 @@ void init_theme_or_die(const char *name, struct gui_theme *t) exit(EXIT_FAILURE); } -void prev_theme(struct gui_theme *t) +/** + * Activate the previous available theme. + * + * \param t Theme definition is stored here. + * + * This picks the theme that comes before the currently active one, or the last + * availabe theme, if the current one is the first. + * + * \sa \ref theme_next(). + */ +void theme_prev(struct gui_theme *t) { return set_theme(++current_theme_num, t); } -void next_theme(struct gui_theme *t) +/** + * Activate the next available theme. + * + * \param t Theme definition is stored here. + * + * This works exacly as theme_prev() but cycles forwards through the list of + * available themes. + */ +void theme_next(struct gui_theme *t) { return set_theme(--current_theme_num, t); }