summaryrefslogtreecommitdiff
path: root/src/gui/curses
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/curses')
-rw-r--r--src/gui/curses/gui-curses-bar-window.c12
-rw-r--r--src/gui/curses/gui-curses-color.c103
-rw-r--r--src/gui/curses/gui-curses-window.c250
-rw-r--r--src/gui/curses/gui-curses.h2
4 files changed, 240 insertions, 127 deletions
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c
index 98b4b4f66..25ee7fd0d 100644
--- a/src/gui/curses/gui-curses-bar-window.c
+++ b/src/gui/curses/gui-curses-bar-window.c
@@ -262,10 +262,9 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
break;
case GUI_COLOR_RESET_CHAR:
string++;
- gui_window_set_custom_color_fg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
- CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]));
- gui_window_set_custom_color_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
- CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
+ gui_window_set_custom_color_fg_bg (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
+ CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_FG]),
+ CONFIG_COLOR(bar_window->bar->options[GUI_BAR_OPTION_COLOR_BG]));
gui_window_remove_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
A_BOLD | A_UNDERLINE | A_REVERSE);
break;
@@ -564,6 +563,11 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
A_BOLD | A_UNDERLINE | A_REVERSE);
wclrtobot (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar);
}
+ else
+ {
+ gui_window_remove_color_style (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
+ A_BOLD | A_UNDERLINE | A_REVERSE);
+ }
while (x < bar_window->width)
{
gui_bar_window_print_string (bar_window, filling,
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index e93557583..6347f1633 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -77,7 +77,6 @@ short *gui_color_term_color_content = NULL; /* content of colors (r/b/g) */
/* pairs */
int gui_color_num_pairs = 63; /* number of pairs used by WeeChat */
-int gui_color_num_bg = 8; /* number of backgrounds */
short *gui_color_pairs = NULL; /* table with pair for each fg+bg */
int gui_color_pairs_used = 0; /* number of pairs currently used */
int gui_color_warning_pairs_full = 0; /* warning displayed? */
@@ -118,24 +117,34 @@ gui_color_search (const char *color_name)
int
gui_color_assign (int *color, const char *color_name)
{
- int color_index, pair;
+ int flag, extra_attr, color_index, number;
char *error;
- /* search for color alias */
- pair = gui_color_palette_get_alias (color_name);
- if (pair >= 0)
+ /* read extended attributes */
+ extra_attr = 0;
+ while ((flag = gui_color_attr_get_flag (color_name[0])) > 0)
{
- *color = GUI_COLOR_EXTENDED_FLAG | pair;
+ extra_attr |= flag;
+ color_name++;
+ }
+
+ /* is it a color alias? */
+ number = gui_color_palette_get_alias (color_name);
+ if (number >= 0)
+ {
+ *color = number | GUI_COLOR_EXTENDED_FLAG | extra_attr;
return 1;
}
- /* is it pair number? */
+ /* is it a color number? */
error = NULL;
- pair = (int)strtol (color_name, &error, 10);
- if (color_name[0] && error && !error[0] && (pair >= 0))
+ number = (int)strtol (color_name, &error, 10);
+ if (color_name[0] && error && !error[0] && (number >= 0))
{
- /* color_name is a number, use this pair number */
- *color = GUI_COLOR_EXTENDED_FLAG | pair;
+ /* color_name is a number, use this color number */
+ if (number > GUI_COLOR_EXTENDED_MAX)
+ number = GUI_COLOR_EXTENDED_MAX;
+ *color = number | GUI_COLOR_EXTENDED_FLAG | extra_attr;
return 1;
}
else
@@ -144,7 +153,7 @@ gui_color_assign (int *color, const char *color_name)
color_index = gui_color_search (color_name);
if (color_index >= 0)
{
- *color = color_index;
+ *color = color_index | extra_attr;
return 1;
}
}
@@ -284,6 +293,11 @@ error:
}
}
+/*
+ * gui_color_timer_warning_pairs_full: display a warning when no more pair is
+ * available in table
+ */
+
int
gui_color_timer_warning_pairs_full (void *data, int remaining_calls)
{
@@ -383,30 +397,51 @@ gui_color_weechat_get_pair (int weechat_color)
const char *
gui_color_get_name (int num_color)
{
- static char color[32][16];
+ static char color[16][64];
static int index_color = 0;
+ char str_attr[8];
struct t_gui_color_palette *ptr_color_palette;
+ /* init color string */
+ index_color = (index_color + 1) % 16;
+ color[index_color][0] = '\0';
+
+ /* build string with extra-attributes */
+ gui_color_attr_build_string (num_color, str_attr);
+
if (num_color & GUI_COLOR_EXTENDED_FLAG)
{
+ /* search alias */
ptr_color_palette = gui_color_palette_get (num_color & GUI_COLOR_EXTENDED_MASK);
if (ptr_color_palette && ptr_color_palette->alias)
- return ptr_color_palette->alias;
- index_color = (index_color + 1) % 32;
- color[index_color][0] = '\0';
+ {
+ /* alias */
+ snprintf (color[index_color], sizeof (color[index_color]),
+ "%s%s", str_attr, ptr_color_palette->alias);
+ }
+ else
+ {
+ /* color number */
+ snprintf (color[index_color], sizeof (color[index_color]),
+ "%s%d", str_attr, num_color & GUI_COLOR_EXTENDED_MASK);
+ }
+ }
+ else
+ {
snprintf (color[index_color], sizeof (color[index_color]),
- "%d", num_color & GUI_COLOR_EXTENDED_MASK);
- return color[index_color];
+ "%s%s",
+ str_attr,
+ gui_weechat_colors[num_color & GUI_COLOR_EXTENDED_MASK].string);
}
- return gui_weechat_colors[num_color].string;
+ return color[index_color];
}
/*
* gui_color_build: build a WeeChat color with foreground and background
- * (foreground and background must be >= 0,
- * if they are >= 0x10000, then it is a pair number
- * (pair = value & 0xFFFF))
+ * Foreground and background must be >= 0 and can be a
+ * WeeChat or extended color, with optional attributes for
+ * foreground.
*/
void
@@ -427,22 +462,28 @@ gui_color_build (int number, int foreground, int background)
}
/* set foreground and attributes */
- if (foreground <= GUI_CURSES_NUM_WEECHAT_COLORS)
+ if (foreground & GUI_COLOR_EXTENDED_FLAG)
{
- gui_color[number]->foreground = gui_weechat_colors[foreground].foreground;
- gui_color[number]->attributes = gui_weechat_colors[foreground].attributes;
+ gui_color[number]->foreground = foreground & GUI_COLOR_EXTENDED_MASK;
+ gui_color[number]->attributes = 0;
}
else
{
- gui_color[number]->foreground = foreground;
- gui_color[number]->attributes = 0;
+ gui_color[number]->foreground = gui_weechat_colors[foreground & GUI_COLOR_EXTENDED_MASK].foreground;
+ gui_color[number]->attributes = gui_weechat_colors[foreground & GUI_COLOR_EXTENDED_MASK].attributes;
}
+ if (foreground & GUI_COLOR_EXTENDED_BOLD_FLAG)
+ gui_color[number]->attributes |= A_BOLD;
+ if (foreground & GUI_COLOR_EXTENDED_REVERSE_FLAG)
+ gui_color[number]->attributes |= A_REVERSE;
+ if (foreground & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
+ gui_color[number]->attributes |= A_UNDERLINE;
/* set background */
- if (background <= GUI_CURSES_NUM_WEECHAT_COLORS)
- gui_color[number]->background = gui_weechat_colors[background].foreground;
+ if (background & GUI_COLOR_EXTENDED_FLAG)
+ gui_color[number]->background = background & GUI_COLOR_EXTENDED_MASK;
else
- gui_color[number]->background = background;
+ gui_color[number]->background = gui_weechat_colors[background & GUI_COLOR_EXTENDED_MASK].background;
/* set string */
if (gui_color[number]->string)
@@ -467,7 +508,6 @@ gui_color_init_vars ()
gui_color_term_color_pairs = 0;
gui_color_term_can_change_color = 0;
gui_color_num_pairs = 63;
- gui_color_num_bg = 8;
if (gui_color_pairs)
{
free (gui_color_pairs);
@@ -483,7 +523,6 @@ gui_color_init_vars ()
gui_color_num_pairs = (gui_color_term_color_pairs >= 256) ?
255 : gui_color_term_color_pairs - 1;
- gui_color_num_bg = (gui_color_term_color_pairs >= 256) ? 16 : 8;
if (gui_color_term_colors > 0)
{
size = (gui_color_term_colors + 2)
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 7d601cfa8..762a67d02 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -194,12 +194,12 @@ gui_window_clear (WINDOW *window, int fg, int bg)
if ((fg > 0) && (fg & GUI_COLOR_EXTENDED_FLAG))
fg &= GUI_COLOR_EXTENDED_MASK;
else
- fg = gui_weechat_colors[fg].foreground;
+ fg = gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].foreground;
if ((bg > 0) && (bg & GUI_COLOR_EXTENDED_FLAG))
bg &= GUI_COLOR_EXTENDED_MASK;
else
- bg = gui_weechat_colors[bg].background;
+ bg = gui_weechat_colors[bg & GUI_COLOR_EXTENDED_MASK].background;
wbkgdset (window, ' ' | COLOR_PAIR (gui_color_get_pair (fg, bg)));
werase (window);
@@ -284,7 +284,6 @@ gui_window_set_weechat_color (WINDOW *window, int num_color)
if ((num_color >= 0) && (num_color < GUI_COLOR_NUM_COLORS))
{
gui_window_reset_style (window, num_color);
- wattron (window, gui_color[num_color]->attributes);
fg = gui_color[num_color]->foreground;
bg = gui_color[num_color]->background;
@@ -307,51 +306,6 @@ gui_window_set_weechat_color (WINDOW *window, int num_color)
}
/*
- * gui_window_set_custom_color_fg_bg: set a custom color for a window
- * (foreground and background)
- */
-
-void
-gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg)
-{
- int attributes;
-
- if ((fg >= 0) && (bg >= 0))
- {
- gui_window_remove_color_style (window, A_BOLD);
-
- if ((fg > 0) && (fg & GUI_COLOR_EXTENDED_FLAG))
- fg &= GUI_COLOR_EXTENDED_MASK;
- else
- {
- attributes = gui_weechat_colors[fg].attributes;
- wattron (window, attributes);
- fg = gui_weechat_colors[fg].foreground;
-
- /*
- * if not real white, we use default terminal foreground instead of
- * white if bold attribute is set
- */
- if ((fg == COLOR_WHITE) && (attributes & A_BOLD)
- && !CONFIG_BOOLEAN(config_look_color_real_white))
- {
- fg = -1;
- }
- }
-
- if ((bg > 0) && (bg & GUI_COLOR_EXTENDED_FLAG))
- bg &= GUI_COLOR_EXTENDED_MASK;
- else
- {
- bg = (gui_color_num_bg > 8) ?
- gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground;
- }
-
- gui_window_set_color (window, fg, bg);
- }
-}
-
-/*
* gui_window_set_custom_color_fg: set a custom color for a window
* (foreground only)
*/
@@ -365,19 +319,38 @@ gui_window_set_custom_color_fg (WINDOW *window, int fg)
{
current_bg = window_current_style_bg;
- gui_window_remove_color_style (window, A_BOLD);
-
if ((fg > 0) && (fg & GUI_COLOR_EXTENDED_FLAG))
{
+ if (fg & GUI_COLOR_EXTENDED_BOLD_FLAG)
+ gui_window_set_color_style (window, A_BOLD);
+ else
+ gui_window_remove_color_style (window, A_BOLD);
+ if (fg & GUI_COLOR_EXTENDED_REVERSE_FLAG)
+ gui_window_set_color_style (window, A_REVERSE);
+ else
+ gui_window_remove_color_style (window, A_REVERSE);
+ if (fg & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
+ gui_window_set_color_style (window, A_UNDERLINE);
+ else
+ gui_window_remove_color_style (window, A_UNDERLINE);
gui_window_set_color (window,
fg & GUI_COLOR_EXTENDED_MASK,
current_bg);
}
- else if (fg < GUI_CURSES_NUM_WEECHAT_COLORS)
+ else if ((fg & GUI_COLOR_EXTENDED_MASK) < GUI_CURSES_NUM_WEECHAT_COLORS)
{
- attributes = gui_weechat_colors[fg].attributes;
+ gui_window_remove_color_style (window,
+ A_BOLD | A_REVERSE | A_UNDERLINE);
+ attributes = 0;
+ if (fg & GUI_COLOR_EXTENDED_BOLD_FLAG)
+ attributes |= A_BOLD;
+ if (fg & GUI_COLOR_EXTENDED_REVERSE_FLAG)
+ attributes |= A_REVERSE;
+ if (fg & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
+ attributes |= A_UNDERLINE;
+ attributes |= gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
gui_window_set_color_style (window, attributes);
- fg = gui_weechat_colors[fg].foreground;
+ fg = gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].foreground;
/*
* if not real white, we use default terminal foreground instead of
@@ -415,17 +388,85 @@ gui_window_set_custom_color_bg (WINDOW *window, int bg)
current_fg,
bg & GUI_COLOR_EXTENDED_MASK);
}
- else if (bg < GUI_CURSES_NUM_WEECHAT_COLORS)
+ else if ((bg & GUI_COLOR_EXTENDED_MASK) < GUI_CURSES_NUM_WEECHAT_COLORS)
{
+ bg &= GUI_COLOR_EXTENDED_MASK;
gui_window_set_color_style (window, current_attr);
gui_window_set_color (window, current_fg,
- (gui_color_num_bg > 8) ?
+ (gui_color_term_colors >= 16) ?
gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground);
}
}
}
/*
+ * gui_window_set_custom_color_fg_bg: set a custom color for a window
+ * (foreground and background)
+ */
+
+void
+gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg)
+{
+ int attributes;
+
+ if ((fg >= 0) && (bg >= 0))
+ {
+ if ((fg > 0) && (fg & GUI_COLOR_EXTENDED_FLAG))
+ {
+ if (fg & GUI_COLOR_EXTENDED_BOLD_FLAG)
+ gui_window_set_color_style (window, A_BOLD);
+ else
+ gui_window_remove_color_style (window, A_BOLD);
+ if (fg & GUI_COLOR_EXTENDED_REVERSE_FLAG)
+ gui_window_set_color_style (window, A_REVERSE);
+ else
+ gui_window_remove_color_style (window, A_REVERSE);
+ if (fg & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
+ gui_window_set_color_style (window, A_UNDERLINE);
+ else
+ gui_window_remove_color_style (window, A_UNDERLINE);
+ fg &= GUI_COLOR_EXTENDED_MASK;
+ }
+ else if ((fg & GUI_COLOR_EXTENDED_MASK) < GUI_CURSES_NUM_WEECHAT_COLORS)
+ {
+ gui_window_remove_color_style (window,
+ A_BOLD | A_REVERSE | A_UNDERLINE);
+ attributes = 0;
+ if (fg & GUI_COLOR_EXTENDED_BOLD_FLAG)
+ attributes |= A_BOLD;
+ if (fg & GUI_COLOR_EXTENDED_REVERSE_FLAG)
+ attributes |= A_REVERSE;
+ if (fg & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
+ attributes |= A_UNDERLINE;
+ attributes |= gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].attributes;
+ gui_window_set_color_style (window, attributes);
+ fg = gui_weechat_colors[fg & GUI_COLOR_EXTENDED_MASK].foreground;
+
+ /*
+ * if not real white, we use default terminal foreground instead of
+ * white if bold attribute is set
+ */
+ if ((fg == COLOR_WHITE) && (attributes & A_BOLD)
+ && !CONFIG_BOOLEAN(config_look_color_real_white))
+ {
+ fg = -1;
+ }
+ }
+
+ if ((bg > 0) && (bg & GUI_COLOR_EXTENDED_FLAG))
+ bg &= GUI_COLOR_EXTENDED_MASK;
+ else
+ {
+ bg &= GUI_COLOR_EXTENDED_MASK;
+ bg = (gui_color_term_colors >= 16) ?
+ gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground;
+ }
+
+ gui_window_set_color (window, fg, bg);
+ }
+}
+
+/*
* gui_window_set_custom_color_pair: set a custom color for a window
* (pair number)
*/
@@ -435,7 +476,8 @@ gui_window_set_custom_color_pair (WINDOW *window, int pair)
{
if ((pair >= 0) && (pair <= gui_color_num_pairs))
{
- gui_window_remove_color_style (window, A_BOLD);
+ gui_window_remove_color_style (window,
+ A_BOLD | A_REVERSE | A_UNDERLINE);
wattron (window, COLOR_PAIR(pair));
}
}
@@ -448,36 +490,49 @@ gui_window_set_custom_color_pair (WINDOW *window, int pair)
*/
void
-gui_window_string_apply_color_fg (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_fg (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
char str_fg[6], *error;
- int fg;
+ int fg, extra_attr, flag;
- ptr_string = *str;
+ ptr_string = *string;
if (ptr_string[0] == GUI_COLOR_EXTENDED_CHAR)
{
- if (ptr_string[1] && ptr_string[2] && ptr_string[3]
- && ptr_string[4] && ptr_string[5])
+ ptr_string++;
+ extra_attr = 0;
+ while ((flag = gui_color_attr_get_flag (ptr_string[0])) > 0)
+ {
+ extra_attr |= flag;
+ ptr_string++;
+ }
+ if (ptr_string[0] && ptr_string[1] && ptr_string[2]
+ && ptr_string[3] && ptr_string[4])
{
if (window)
{
- memcpy (str_fg, ptr_string + 1, 5);
+ memcpy (str_fg, ptr_string, 5);
str_fg[5] = '\0';
error = NULL;
fg = (int)strtol (str_fg, &error, 10);
if (error && !error[0])
{
gui_window_set_custom_color_fg (window,
- fg | GUI_COLOR_EXTENDED_FLAG);
+ fg | GUI_COLOR_EXTENDED_FLAG | extra_attr);
}
}
- ptr_string += 6;
+ ptr_string += 5;
}
}
else
{
+ extra_attr = 0;
+ while ((flag = gui_color_attr_get_flag (ptr_string[0])) > 0)
+ {
+ extra_attr |= flag;
+ ptr_string++;
+ }
if (ptr_string[0] && ptr_string[1])
{
if (window)
@@ -489,14 +544,14 @@ gui_window_string_apply_color_fg (unsigned char **str, WINDOW *window)
fg = (int)strtol (str_fg, &error, 10);
if (error && !error[0])
{
- gui_window_set_custom_color_fg (window, fg);
+ gui_window_set_custom_color_fg (window, fg | extra_attr);
}
}
ptr_string += 2;
}
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
@@ -507,13 +562,13 @@ gui_window_string_apply_color_fg (unsigned char **str, WINDOW *window)
*/
void
-gui_window_string_apply_color_bg (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_bg (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
char str_bg[6], *error;
int bg;
- ptr_string = *str;
+ ptr_string = *string;
if (ptr_string[0] == GUI_COLOR_EXTENDED_CHAR)
{
@@ -555,7 +610,7 @@ gui_window_string_apply_color_bg (unsigned char **str, WINDOW *window)
}
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
@@ -567,13 +622,13 @@ gui_window_string_apply_color_bg (unsigned char **str, WINDOW *window)
*/
void
-gui_window_string_apply_color_fg_bg (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_fg_bg (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
char str_fg[6], str_bg[6], *error;
- int fg, bg;
+ int fg, bg, extra_attr, flag;
- ptr_string = *str;
+ ptr_string = *string;
str_fg[0] = '\0';
str_bg[0] = '\0';
@@ -581,25 +636,38 @@ gui_window_string_apply_color_fg_bg (unsigned char **str, WINDOW *window)
bg = -1;
if (ptr_string[0] == GUI_COLOR_EXTENDED_CHAR)
{
- if (ptr_string[1] && ptr_string[2] && ptr_string[3]
- && ptr_string[4] && ptr_string[5])
+ ptr_string++;
+ extra_attr = 0;
+ while ((flag = gui_color_attr_get_flag (ptr_string[0])) > 0)
+ {
+ extra_attr |= flag;
+ ptr_string++;
+ }
+ if (ptr_string[0] && ptr_string[1] && ptr_string[2]
+ && ptr_string[3] && ptr_string[4])
{
if (window)
{
- memcpy (str_fg, ptr_string + 1, 5);
+ memcpy (str_fg, ptr_string, 5);
str_fg[5] = '\0';
error = NULL;
fg = (int)strtol (str_fg, &error, 10);
if (!error || error[0])
fg = -1;
else
- fg |= GUI_COLOR_EXTENDED_FLAG;
+ fg |= GUI_COLOR_EXTENDED_FLAG | extra_attr;
}
- ptr_string += 6;
+ ptr_string += 5;
}
}
else
{
+ extra_attr = 0;
+ while ((flag = gui_color_attr_get_flag (ptr_string[0])) > 0)
+ {
+ extra_attr |= flag;
+ ptr_string++;
+ }
if (ptr_string[0] && ptr_string[1])
{
if (window)
@@ -611,6 +679,8 @@ gui_window_string_apply_color_fg_bg (unsigned char **str, WINDOW *window)
fg = (int)strtol (str_fg, &error, 10);
if (!error || error[0])
fg = -1;
+ else
+ fg |= extra_attr;
}
ptr_string += 2;
}
@@ -660,7 +730,7 @@ gui_window_string_apply_color_fg_bg (unsigned char **str, WINDOW *window)
gui_window_set_custom_color_fg_bg (window, fg, bg);
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
@@ -672,13 +742,13 @@ gui_window_string_apply_color_fg_bg (unsigned char **str, WINDOW *window)
*/
void
-gui_window_string_apply_color_pair (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_pair (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
char str_pair[6], *error;
int pair;
- ptr_string = *str;
+ ptr_string = *string;
if ((isdigit (ptr_string[0])) && (isdigit (ptr_string[1]))
&& (isdigit (ptr_string[2])) && (isdigit (ptr_string[3]))
@@ -698,7 +768,7 @@ gui_window_string_apply_color_pair (unsigned char **str, WINDOW *window)
ptr_string += 5;
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
@@ -711,13 +781,13 @@ gui_window_string_apply_color_pair (unsigned char **str, WINDOW *window)
*/
void
-gui_window_string_apply_color_weechat (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_weechat (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
char str_number[3], *error;
int weechat_color;
- ptr_string = *str;
+ ptr_string = *string;
if (isdigit (ptr_string[0]) && isdigit (ptr_string[1]))
{
@@ -737,7 +807,7 @@ gui_window_string_apply_color_weechat (unsigned char **str, WINDOW *window)
ptr_string += 2;
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
@@ -750,11 +820,11 @@ gui_window_string_apply_color_weechat (unsigned char **str, WINDOW *window)
*/
void
-gui_window_string_apply_color_set_attr (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_set_attr (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
- ptr_string = *str;
+ ptr_string = *string;
switch (ptr_string[0])
{
@@ -779,7 +849,7 @@ gui_window_string_apply_color_set_attr (unsigned char **str, WINDOW *window)
break;
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
@@ -792,11 +862,11 @@ gui_window_string_apply_color_set_attr (unsigned char **str, WINDOW *window)
*/
void
-gui_window_string_apply_color_remove_attr (unsigned char **str, WINDOW *window)
+gui_window_string_apply_color_remove_attr (unsigned char **string, WINDOW *window)
{
unsigned char *ptr_string;
- ptr_string = *str;
+ ptr_string = *string;
switch (ptr_string[0])
{
@@ -821,7 +891,7 @@ gui_window_string_apply_color_remove_attr (unsigned char **str, WINDOW *window)
break;
}
- *str = ptr_string;
+ *string = ptr_string;
}
/*
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index 0d7e2bf67..47ac40e97 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -57,8 +57,8 @@ struct t_gui_bar_window_curses_objects
extern int gui_term_cols, gui_term_lines;
extern struct t_gui_color gui_weechat_colors[];
+extern int gui_color_term_colors;
extern int gui_color_num_pairs;
-extern int gui_color_num_bg;
extern int gui_color_buffer_refresh_needed;
/* color functions */