static void
create_new_color_filter(GtkButton *button, const char *filter)
{
- color_filter_t *colorf;
+#if 0/*GTK_CHECK_VERSION(3,0,0)*/
+ GtkStyleContext *context;
+ GdkRGBA *rgba_bg_color;
+ GdkRGBA *rgba_fg_color;
+#else
GtkStyle *style;
+#endif
+ color_filter_t *colorf;
color_t bg_color, fg_color;
GtkWidget *color_filters;
GtkTreeSelection *sel;
gtk_tree_selection_unselect_all (sel);
/* Use the default background and foreground colors as the colors. */
+#if 0/*GTK_CHECK_VERSION(3,0,0)*/
+ context = gtk_widget_get_style_context (new_packet_list_get_widget());
+ gtk_style_context_get (context, GTK_STATE_NORMAL,
+ "background-color", &rgba_bg_color,
+ NULL);
+ gtk_style_context_get (context, GTK_STATE_NORMAL,
+ "forground-color", &rgba_fg_color,
+ NULL);
+/* gdk_rgba_free (rgba_bg_color); */
+
+#else
style = gtk_widget_get_style(new_packet_list_get_widget());
gdkcolor_to_color_t(&bg_color, &style->base[GTK_STATE_NORMAL]);
gdkcolor_to_color_t(&fg_color, &style->text[GTK_STATE_NORMAL]);
-
+#endif
colorf = color_filter_new("name", filter, &bg_color, &fg_color, FALSE);
add_filter_to_list(colorf, color_filters, TRUE);
select_row(color_filters, 0);
color_dialog = (GtkWidget *)user_data;
gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))), &new_color);
-
+#if 0
if ( ! get_color(&new_color) ){
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not allocate color. Try again.");
} else {
+#endif
/* Find the "Edit color filter" dialog box with which this is
associated. */
parent = (GtkWidget *)g_object_get_data(G_OBJECT(color_dialog), COLOR_SELECTION_PARENT);
gtk_widget_modify_base(filt_name_entry, GTK_STATE_NORMAL, &new_color);
else
gtk_widget_modify_text(filt_name_entry, GTK_STATE_NORMAL, &new_color);
+#if 0
}
+#endif
}
/* Don't choose the selected color as the foreground or background
#include "gtk/color_utils.h"
#include "gtk/gtkglobals.h"
-
+#if 0
static GdkColormap* sys_cmap;
static GdkColormap* our_cmap = NULL;
-
+#endif
GdkColor WHITE = { 0, 65535, 65535, 65535 };
-GdkColor LTGREY = { 0, 57343, 57343, 57343 };
+/*GdkColor LTGREY = { 0, 57343, 57343, 57343 };*/
GdkColor BLACK = { 0, 0, 0, 0 };
/*
gdk_color.red = red;
gdk_color.green = green;
gdk_color.blue = blue;
+#if 0
if (!get_color(&gdk_color))
return FALSE;
+#endif
gdkcolor_to_color_t(color, &gdk_color);
return TRUE;
}
void
colors_init(void)
{
+#if 0
gboolean got_white, got_black;
sys_cmap = gdk_colormap_get_system();
/* Allocate "constant" colors. */
got_white = get_color(&WHITE);
got_black = get_color(&BLACK);
-
/* Got milk? */
if (!got_white) {
if (!got_black)
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
"Could not allocate color black.");
}
-}
+#endif
+}
+#if 0
/* allocate a color from the color map */
gboolean
get_color(GdkColor *new_color)
}
return (gdk_colormap_alloc_color(our_cmap, new_color, FALSE, TRUE));
}
-
+#endif
void
color_t_to_gdkcolor(GdkColor *target, const color_t *source)
{
* @param new_color the new color
* @return TRUE if the allocation succeeded
*/
+#if 0
gboolean get_color(GdkColor *new_color);
-
+#endif
/** Convert color_t to GdkColor.
*
* @param target the GdkColor to be filled
if(colors_ok) {
return;
}
-
+#if 0
+ /* Allocating collor isn't necessary? */
get_color(&expert_color_chat);
get_color(&expert_color_note);
get_color(&expert_color_warn);
get_color(&expert_color_error);
get_color(&expert_color_foreground);
+#endif
expert_color_chat_str = gdk_color_to_string(&expert_color_chat);
expert_color_note_str = gdk_color_to_string(&expert_color_note);
expert_color_warn_str = gdk_color_to_string(&expert_color_warn);
expert_color_error_str = gdk_color_to_string(&expert_color_error);
expert_color_foreground_str = gdk_color_to_string(&expert_color_foreground);
- get_color(&hidden_proto_item);
-
+#if 0
+ get_color(&hidden_proto_item);
+#endif
colors_ok = TRUE;
}
#endif
/* prepare colors */
+#if 0
+ /* Allocating collor isn't necessary? */
/* "page" background */
get_color(&welcome_bg);
/* topic content background color */
get_color(&topic_content_bg);
-
+#endif
topic_item_idle_bg = topic_content_bg;
+#if 0
+ /* Allocating collor isn't necessary? */
/* topic item entered color */
get_color(&topic_item_entered_bg);
-
+#endif
welcome_scrollw = scrolled_window_new(NULL, NULL);
welcome_vb = gtk_vbox_new(FALSE, 0);