[gnumeric] Compilation: future-proof gnm_cell_renderer_text_copy_background_to_cairo



commit 6fc73712fff2d2bcecb183e50880fbb57ff43424
Author: Morten Welinder <terra gnome org>
Date:   Tue Nov 9 16:14:27 2010 -0500

    Compilation: future-proof gnm_cell_renderer_text_copy_background_to_cairo

 configure.in   |    3 ++-
 src/gui-util.c |   10 ++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/configure.in b/configure.in
index 31f8a45..69f5d0f 100644
--- a/configure.in
+++ b/configure.in
@@ -687,7 +687,7 @@ CFLAGS="$CFLAGS $GNUMERIC_CFLAGS"
 LIBS="$GNUMERIC_LIBS $LIBS"
 
 AC_CHECK_FUNCS(g_option_context_set_delocalize g_hash_table_get_keys)
-AC_CHECK_FUNCS(pango_font_map_create_context)
+AC_CHECK_FUNCS(gdk_cairo_set_source_rgba)
 AC_CHECK_FUNCS(gtk_adjustment_configure gtk_adjustment_set_lower gtk_adjustment_set_upper gtk_adjustment_get_page_size)
 AC_CHECK_FUNCS(gtk_cell_renderer_get_alignment gtk_cell_renderer_get_padding)
 AC_CHECK_FUNCS(gtk_cell_renderer_text_get_background_set gtk_cell_renderer_text_get_foreground_set gtk_cell_renderer_text_get_editable)
@@ -699,6 +699,7 @@ AC_CHECK_FUNCS(gtk_table_get_size)
 AC_CHECK_FUNCS(gtk_tree_view_column_get_button)
 AC_CHECK_FUNCS(gtk_widget_get_visible gtk_widget_set_visible gtk_widget_get_state gtk_widget_is_toplevel gtk_widget_get_window gtk_widget_get_can_focus gtk_widget_has_focus gtk_widget_get_style gtk_widget_get_allocation gtk_widget_is_sensitive gtk_widget_set_can_focus gtk_widget_get_realized)
 AC_CHECK_FUNCS(gsf_infile_msvba_steal_modules gsf_open_pkg_foreach_rel )
+AC_CHECK_FUNCS(pango_font_map_create_context)
 
 AC_MSG_CHECKING([for working GTK_WIDGET_REALIZED.])
 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gtk/gtk.h>]],
diff --git a/src/gui-util.c b/src/gui-util.c
index 0e64385..b210823 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -1507,9 +1507,15 @@ void
 gnm_cell_renderer_text_copy_background_to_cairo (GtkCellRendererText *crt,
 						 cairo_t *cr)
 {
+#ifdef HAVE_GDK_CAIRO_SET_SOURCE_RGBA
+	/* Untested code.  */
+	GdkRGBA *c = NULL;
+	g_object_get (crt, "background-rgba", &c, NULL);
+	gdk_cairo_set_source_rgba (cr, c);
+	gdk_rgba_free (c);
+#else
 	GdkColor c;
-
-	/* FIXME: If we have GdkRGBA we can do better.  */
 	g_object_get (crt, "background-gdk", &c, NULL);
 	gdk_cairo_set_source_color (cr, &c);
+#endif
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]