summaryrefslogtreecommitdiff
path: root/src/gui/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gtk')
-rw-r--r--src/gui/gtk/gui-gtk-chat.c11
-rw-r--r--src/gui/gtk/gui-gtk-color.c127
-rw-r--r--src/gui/gtk/gui-gtk.h2
3 files changed, 63 insertions, 77 deletions
diff --git a/src/gui/gtk/gui-gtk-chat.c b/src/gui/gtk/gui-gtk-chat.c
index 950646583..f416389dc 100644
--- a/src/gui/gtk/gui-gtk-chat.c
+++ b/src/gui/gtk/gui-gtk-chat.c
@@ -147,17 +147,6 @@ void
gui_chat_set_color (struct t_gui_window *window, int fg, int bg)
{
/* TODO: write this function for Gtk */
- /*if (((fg == -1) || (fg == 99))
- && ((bg == -1) || (bg == 99)))
- wattron (window->win_chat, COLOR_PAIR(63));
- else
- {
- if ((fg == -1) || (fg == 99))
- fg = WEECHAT_COLOR_WHITE;
- if ((bg == -1) || (bg == 99))
- bg = 0;
- wattron (window->win_chat, COLOR_PAIR((bg * 8) + fg));
- }*/
(void) window;
(void) fg;
(void) bg;
diff --git a/src/gui/gtk/gui-gtk-color.c b/src/gui/gtk/gui-gtk-color.c
index 49697ed65..50f8220af 100644
--- a/src/gui/gtk/gui-gtk-color.c
+++ b/src/gui/gtk/gui-gtk-color.c
@@ -132,70 +132,48 @@ gui_color_get_weechat_colors_number ()
}
/*
- * gui_color_get_last_pair: get last pair number
+ * gui_color_get_term_colors: get number of colors supported by terminal
*/
int
-gui_color_get_last_pair ()
+gui_color_get_term_colors ()
{
return 0;
}
/*
- * gui_color_get_name: get color name
- */
-
-const char *
-gui_color_get_name (int num_color)
-{
- return gui_weechat_colors[num_color].string;
-}
-
-/*
- * gui_color_get_pair: get color pair with a WeeChat color number
+ * gui_color_get_pair: get a pair with given foreground/background colors
*/
int
-gui_color_get_pair (int num_color)
+gui_color_get_pair (int fg, int bg)
{
- int fg, bg;
-
- if ((num_color < 0) || (num_color > GUI_COLOR_NUM_COLORS - 1))
- return WEECHAT_COLOR_WHITE;
-
- fg = gui_color[num_color]->foreground;
- bg = gui_color[num_color]->background;
+ (void) fg;
+ (void) bg;
- if (((fg == -1) || (fg == 99))
- && ((bg == -1) || (bg == 99)))
- return 63;
- if ((fg == -1) || (fg == 99))
- fg = WEECHAT_COLOR_WHITE;
- if ((bg == -1) || (bg == 99))
- bg = 0;
-
- return (bg * 8) + fg;
+ return 0;
}
/*
- * gui_color_init_pair: init a color pair
+ * gui_color_weechat_get_pair: get color pair with a WeeChat color number
*/
-void
-gui_color_init_pair (int number)
+int
+gui_color_weechat_get_pair (int weechat_color)
{
- /* This function does nothing in Gtk GUI */
- (void) number;
+ (void) weechat_color;
+
+ return 0;
}
/*
- * gui_color_init_pairs: init color pairs
+ * gui_color_get_name: get color name
*/
-void
-gui_color_init_pairs ()
+const char *
+gui_color_get_name (int num_color)
{
- /* This function does nothing in Gtk GUI */
+ return gui_weechat_colors[num_color].string;
}
/*
@@ -231,32 +209,6 @@ 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
- */
-
-void
-gui_color_init ()
-{
- gui_color_init_pairs ();
- gui_color_init_weechat ();
-}
-
-/*
* gui_color_display_terminal_colors: display terminal colors
* This is called by command line option
* "-c" / "--colors"
@@ -289,6 +241,16 @@ gui_color_switch_colors ()
}
/*
+ * gui_color_reset_pairs: reset all color pairs
+ */
+
+void
+gui_color_reset_pairs ()
+{
+ /* This function does nothing in Gtk GUI */
+}
+
+/*
* gui_color_buffer_assign: assign color buffer to pointer if it is not yet set
*/
@@ -344,6 +306,41 @@ gui_color_palette_free (struct t_gui_color_palette *color_palette)
}
/*
+ * 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
+ */
+
+void
+gui_color_init ()
+{
+ gui_color_init_weechat ();
+}
+
+/*
+ * gui_color_dump: dump colors
+ */
+
+void
+gui_color_dump ()
+{
+ /* This function does nothing in Gtk GUI */
+}
+
+/*
* gui_color_end: end GUI colors
*/
diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h
index c93ba13e2..fac1eb00a 100644
--- a/src/gui/gtk/gui-gtk.h
+++ b/src/gui/gtk/gui-gtk.h
@@ -88,7 +88,7 @@ extern GtkWidget *gui_gtk_entry_input;
extern GtkWidget *gui_gtk_label1;
/* color functions */
-extern int gui_color_get_pair (int num_color);
+extern int gui_color_get_pair (int fg, int bg);
extern void gui_color_pre_init ();
extern void gui_color_init ();
extern void gui_color_end ();