]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gui_theme.c
gui: Move call to print_all_items() into init_wins().
[paraslash.git] / gui_theme.c
index ffa5d792ee199f16e5bb26c5e6557054520f8e5c..3c9886d18a2a2a3cbae88a74f79b052391b64672 100644 (file)
@@ -1,10 +1,9 @@
 /*
- * Copyright (C) 2005-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2014 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
 
-#include <stdbool.h>
 #include "para.h"
 #include "gui.h"
 #include <curses.h>
@@ -27,13 +26,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 = "";
@@ -86,11 +83,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;
 
@@ -362,7 +357,7 @@ struct theme_description {
        void (*init)(struct gui_theme *t);
 };
 
-struct theme_description themes[] = {
+static struct theme_description themes[] = {
        {
                .name = "colorful blackness",
                .init = init_theme_colorful_blackness,
@@ -386,9 +381,10 @@ 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)
+void theme_init(const char *name, struct gui_theme *t)
 {
        int i;
 
@@ -403,12 +399,12 @@ void init_theme_or_die(const char *name, struct gui_theme *t)
        exit(EXIT_FAILURE);
 }
 
-void prev_theme(struct gui_theme *t)
+void theme_prev(struct gui_theme *t)
 {
        return set_theme(++current_theme_num, t);
 }
 
-void next_theme(struct gui_theme *t)
+void theme_next(struct gui_theme *t)
 {
        return set_theme(--current_theme_num, t);
 }