summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-curses-color.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/curses/gui-curses-color.c')
-rw-r--r--src/gui/curses/gui-curses-color.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index 8c7476b9e..e18c04732 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -55,8 +55,6 @@ struct t_gui_color gui_weechat_colors[GUI_CURSES_NUM_WEECHAT_COLORS + 1] =
{ 0, 0, 0, NULL }
};
-struct t_gui_color *gui_color[GUI_NUM_COLORS];
-
/*
* gui_color_search: search a color by name
@@ -296,7 +294,7 @@ gui_color_get_pair (int num_color)
{
int fg, bg;
- if ((num_color < 0) || (num_color > GUI_NUM_COLORS - 1))
+ if ((num_color < 0) || (num_color > GUI_COLOR_NUM_COLORS - 1))
return COLOR_WHITE;
fg = gui_color[num_color]->foreground;
@@ -430,7 +428,7 @@ gui_color_rebuild_weechat ()
if (has_colors ())
{
- for (i = 0; i < GUI_NUM_COLORS; i++)
+ for (i = 0; i < GUI_COLOR_NUM_COLORS; i++)
{
if (gui_color[i])
{
@@ -445,6 +443,22 @@ gui_color_rebuild_weechat ()
}
/*
+ * gui_color_pre_init: pre-init colors
+ */
+
+void
+gui_color_pre_init ()
+{
+ int i;
+
+ for (i = 0; i < GUI_COLOR_NUM_COLORS; i++)
+ {
+ gui_color[i] = NULL;
+ }
+}
+
+
+/*
* gui_color_init: init GUI colors
*/
@@ -468,8 +482,8 @@ void
gui_color_end ()
{
int i;
-
- for (i = 0; i < GUI_NUM_COLORS; i++)
+
+ for (i = 0; i < GUI_COLOR_NUM_COLORS; i++)
{
gui_color_free (gui_color[i]);
}