From 8fa010ad99e13ba2bba6f3a198daf8db1d6573ec Mon Sep 17 00:00:00 2001 From: John Ellson Date: Wed, 6 Nov 2013 11:01:29 -0500 Subject: [PATCH] conditionalize deprecated functions --- configure.ac | 6 +++++- plugin/gdk/gvdevice_gdk.c | 4 ++++ plugin/pango/gvtextlayout_pango.c | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d5eba2909..e677f92da 100644 --- a/configure.ac +++ b/configure.ac @@ -2231,7 +2231,7 @@ if test "x$use_pangocairo" = "xYes"; then save_LIBS=$LIBS PKG_CHECK_MODULES(PANGOFT2, [pangoft2]) LIBS="$LIBS $PANGOCAIRO_LIBS $PANGOFT2_LIBS" - AC_CHECK_FUNCS([pango_fc_font_lock_face pango_fc_font_unlock_face]) + AC_CHECK_FUNCS([pango_fc_font_lock_face pango_fc_font_unlock_face pango_font_map_create_context]) LIBS=$save_LIBS fi @@ -2391,6 +2391,10 @@ else [Define if you have the gdk library]) AC_SUBST([GDK_CFLAGS]) AC_SUBST([GDK_LIBS]) + save_LIBS=$LIBS + LIBS="$LIBS $GDK_LIBS" + AC_CHECK_FUNCS([g_object_unref]) + LIBS=$save_LIBS ],[ use_gdk_pixbuf="No (gdk library not available)" ]) diff --git a/plugin/gdk/gvdevice_gdk.c b/plugin/gdk/gvdevice_gdk.c index 475d1a11f..77f803c79 100644 --- a/plugin/gdk/gvdevice_gdk.c +++ b/plugin/gdk/gvdevice_gdk.c @@ -105,7 +105,11 @@ static void gdk_format(GVJ_t * job) gdk_pixbuf_save_to_callback(pixbuf, writer, job, format_str, NULL, NULL); +#if HAVE_G_OBJECT_UNREF g_object_unref(pixbuf); +#else + gdk_pixbuf_unref(pixbuf); +#endif } static gvdevice_engine_t gdk_engine = { diff --git a/plugin/pango/gvtextlayout_pango.c b/plugin/pango/gvtextlayout_pango.c index 8ae09b39b..9227718d2 100644 --- a/plugin/pango/gvtextlayout_pango.c +++ b/plugin/pango/gvtextlayout_pango.c @@ -88,7 +88,11 @@ static boolean pango_textlayout(textspan_t * span, char **fontpath) if (!context) { fontmap = pango_cairo_font_map_new(); gv_fmap = get_font_mapping(fontmap); +#ifdef HAVE_PANGO_FONT_MAP_CREATE_CONTEXT context = pango_font_map_create_context (fontmap); +#else + context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP(fontmap)); +#endif options=cairo_font_options_create(); cairo_font_options_set_antialias(options,CAIRO_ANTIALIAS_GRAY); cairo_font_options_set_hint_style(options,CAIRO_HINT_STYLE_FULL); -- 2.40.0