[poppler] glib/demo
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Sun Dec 2 09:26:02 PST 2012
glib/demo/selections.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
New commits:
commit c46646020826136b403e9aae8e2ded24c7165522
Author: Hib Eris <hib at hiberis.nl>
Date: Sun Dec 2 10:04:28 2012 +0100
glib-demo: Do not use deprecated gtk_color_button_{get,set}_rgba()
Since Gtk 3.4, gtk_color_button_get_rgba() and
gtk_color_button_set_rgba() have been deprecated.
https://bugs.freedesktop.org/show_bug.cgi?id=57798
diff --git a/glib/demo/selections.c b/glib/demo/selections.c
index 0e0d709..7ff17cd 100644
--- a/glib/demo/selections.c
+++ b/glib/demo/selections.c
@@ -336,9 +336,17 @@ pgd_selections_drawing_area_realize (GtkWidget *area,
g_object_set (area, "has-tooltip", TRUE, NULL);
gtk_style_context_get_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba);
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->fg_color_button), &rgba);
+#else
gtk_color_button_set_rgba (GTK_COLOR_BUTTON (demo->fg_color_button), &rgba);
+#endif
gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba);
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->bg_color_button), &rgba);
+#else
gtk_color_button_set_rgba (GTK_COLOR_BUTTON (demo->bg_color_button), &rgba);
+#endif
}
static gboolean
@@ -457,7 +465,11 @@ pgd_selections_fg_color_changed (GtkColorButton *button,
{
GdkRGBA color;
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
+#else
gtk_color_button_get_rgba (GTK_COLOR_BUTTON (button), &color);
+#endif
demo->glyph_color.red = CLAMP ((guint) (color.red * 65535), 0, 65535);
demo->glyph_color.green = CLAMP ((guint) (color.green * 65535), 0, 65535);
demo->glyph_color.blue = CLAMP ((guint) (color.blue * 65535), 0, 65535);
@@ -470,7 +482,11 @@ pgd_selections_bg_color_changed (GtkColorButton *button,
{
GdkRGBA color;
+#if GTK_CHECK_VERSION(3,4,0)
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
+#else
gtk_color_button_get_rgba (GTK_COLOR_BUTTON (button), &color);
+#endif
demo->background_color.red = CLAMP ((guint) (color.red * 65535), 0, 65535);
demo->background_color.green = CLAMP ((guint) (color.green * 65535), 0, 65535);
demo->background_color.blue = CLAMP ((guint) (color.blue * 65535), 0, 65535);
More information about the poppler
mailing list