From 741854b58d4f199b73b66034f73e53dca62a77cd Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 11 May 2004 17:19:24 +0000 Subject: [PATCH] define G*_DISABLE_DEPRECATED for all G* modules except GTK+. Don't do so 2004-05-11 Michael Natterer * configure.in: define G*_DISABLE_DEPRECATED for all G* modules except GTK+. Don't do so if compiling against GLib, GTK+ >= 2.5.0 and Pango >= 1.5.0 * libgimpwidgets/gimpoffsetarea.c: s/gdk_gc_unref/g_object_unref/ * app/config/gimpconfig-deserialize.c * app/widgets/gimpdeviceinfo.c: s/g_value_set_foo_take_ownership/g_value_take_foo/ * app/text/gimptext-vectors.c * app/text/gimptext-bitmap.c: s/pango_ft2_font_get_face/pango_fc_font_lock,unlock_face/ --- ChangeLog | 16 ++++++++++ app/config/gimpconfig-deserialize.c | 2 +- app/config/gimpconfig-types.c | 2 +- app/text/gimptext-bitmap.c | 6 +++- app/text/gimptext-vectors.c | 5 +++- app/widgets/gimpdeviceinfo.c | 6 ++-- configure.in | 41 +++++++++++++++++++++----- libgimpconfig/gimpconfig-deserialize.c | 2 +- libgimpwidgets/gimpoffsetarea.c | 2 +- 9 files changed, 66 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9f1ef9053..e375e2e3ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2004-05-11 Michael Natterer + + * configure.in: define G*_DISABLE_DEPRECATED for all G* modules + except GTK+. Don't do so if compiling against GLib, GTK+ >= 2.5.0 + and Pango >= 1.5.0 + + * libgimpwidgets/gimpoffsetarea.c: s/gdk_gc_unref/g_object_unref/ + + * app/config/gimpconfig-deserialize.c + * app/widgets/gimpdeviceinfo.c: + s/g_value_set_foo_take_ownership/g_value_take_foo/ + + * app/text/gimptext-vectors.c + * app/text/gimptext-bitmap.c: + s/pango_ft2_font_get_face/pango_fc_font_lock,unlock_face/ + 2004-05-11 Michael Natterer * app/actions/images-commands.c: added missing #includes. diff --git a/app/config/gimpconfig-deserialize.c b/app/config/gimpconfig-deserialize.c index 24d380c08b..01b961435f 100644 --- a/app/config/gimpconfig-deserialize.c +++ b/app/config/gimpconfig-deserialize.c @@ -716,7 +716,7 @@ gimp_config_deserialize_value_array (GValue *value, return token; } - g_value_set_boxed_take_ownership (value, array); + g_value_take_boxed (value, array); return G_TOKEN_RIGHT_PAREN; } diff --git a/app/config/gimpconfig-types.c b/app/config/gimpconfig-types.c index 64aa88dd8b..2edec147e4 100644 --- a/app/config/gimpconfig-types.c +++ b/app/config/gimpconfig-types.c @@ -221,7 +221,7 @@ memsize_to_string (const GValue *src_value, else str = g_strdup_printf ("%" G_GUINT64_FORMAT, size); - g_value_set_string_take_ownership (dest_value, str); + g_value_take_string (dest_value, str); } static void diff --git a/app/text/gimptext-bitmap.c b/app/text/gimptext-bitmap.c index 5e9a392190..8c00b2b3c7 100644 --- a/app/text/gimptext-bitmap.c +++ b/app/text/gimptext-bitmap.c @@ -22,6 +22,8 @@ #include "config.h" #include + +#define PANGO_ENABLE_ENGINE #include #include "text/text-types.h" @@ -51,7 +53,7 @@ gimp_text_render_bitmap (PangoFont *font, const guchar *src; guchar *dest; - face = pango_ft2_font_get_face (font); + face = pango_fc_font_lock_face (PANGO_FC_FONT (font)); FT_Set_Transform (face, trafo, NULL); @@ -138,4 +140,6 @@ gimp_text_render_bitmap (PangoFont *font, default: break; } + + pango_fc_font_unlock_face (PANGO_FC_FONT (font)); } diff --git a/app/text/gimptext-vectors.c b/app/text/gimptext-vectors.c index 1be38b18f2..e3424dd72b 100644 --- a/app/text/gimptext-vectors.c +++ b/app/text/gimptext-vectors.c @@ -23,6 +23,7 @@ #include +#define PANGO_ENABLE_ENGINE #include #include @@ -237,7 +238,7 @@ gimp_text_render_vectors (PangoFont *font, FT_Face face; FT_Glyph glyph; - face = pango_ft2_font_get_face (font); + face = pango_fc_font_lock_face (PANGO_FC_FONT (font)); FT_Load_Glyph (face, (FT_UInt) pango_glyph, flags); @@ -254,4 +255,6 @@ gimp_text_render_vectors (PangoFont *font, } FT_Done_Glyph (glyph); + + pango_fc_font_unlock_face (PANGO_FC_FONT (font)); } diff --git a/app/widgets/gimpdeviceinfo.c b/app/widgets/gimpdeviceinfo.c index 0167f735d0..38f7d04fe2 100644 --- a/app/widgets/gimpdeviceinfo.c +++ b/app/widgets/gimpdeviceinfo.c @@ -382,7 +382,7 @@ gimp_device_info_get_property (GObject *object, g_value_unset (&enum_value); - g_value_set_boxed_take_ownership (value, array); + g_value_take_boxed (value, array); } break; @@ -429,13 +429,13 @@ gimp_device_info_get_property (GObject *object, { g_value_set_string (&string_value, ""); } - + g_value_array_append (array, &string_value); } g_value_unset (&string_value); - g_value_set_boxed_take_ownership (value, array); + g_value_take_boxed (value, array); } break; diff --git a/configure.in b/configure.in index ddba42aa47..ef9f6cdcfa 100644 --- a/configure.in +++ b/configure.in @@ -395,6 +395,14 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0 gobject-2.0) AC_SUBST(GMODULE_CFLAGS) AC_SUBST(GMODULE_LIBS) +AC_MSG_CHECKING([if GLib is version 2.5.0 or newer]) +if $PKG_CONFIG --atleast-version=2.5.0 glib-2.0; then + have_glib_2_5=yes +else + have_glib_2_5=no +fi +AC_MSG_RESULT($have_glib_2_5) + dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in. gimp_save_LIBS=$LIBS LIBS="$LIBS $GLIB_LIBS" @@ -407,13 +415,13 @@ AC_PATH_XTRA AM_PATH_GTK_2_0(gtk_required_version, :, AC_MSG_ERROR(Test for GTK+ failed. See the file 'INSTALL' for help.)) -AC_MSG_CHECKING([if GTK+ is version 2.3.0 or newer]) -if $PKG_CONFIG --atleast-version=2.3.0 gtk+-2.0; then - have_gtk_2_3=yes +AC_MSG_CHECKING([if GTK+ is version 2.5.0 or newer]) +if $PKG_CONFIG --atleast-version=2.5.0 gtk+-2.0; then + have_gtk_2_5=yes else - have_gtk_2_3=no + have_gtk_2_5=no fi -AC_MSG_RESULT($have_gtk_2_3) +AC_MSG_RESULT($have_gtk_2_5) PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0 >= gdk_pixbuf_required_version) AC_SUBST(GDK_PIXBUF_CFLAGS) @@ -435,6 +443,14 @@ PKG_CHECK_MODULES(PANGOFT2, pangoft2 >= pangoft2_required_version, :, AC_SUBST(PANGOFT2_CFLAGS) AC_SUBST(PANGOFT2_LIBS) +AC_MSG_CHECKING([if Pango is version 1.5.0 or newer]) +if $PKG_CONFIG --atleast-version=1.5.0 pango; then + have_pango_1_5=yes +else + have_pango_1_5=no +fi +AC_MSG_RESULT($have_pango_1_5) + PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= fontconfig_required_version) AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) @@ -1429,8 +1445,19 @@ CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED" # Default to disable deprecated GTK+ stuff for 2.2.x #################################################### -if test "x$have_gtk_2_3" != "xyes"; then - CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" +if test "x$have_glib_2_5" != "xyes"; then + CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED" +fi + +if test "x$have_gtk_2_5" != "xyes"; then + CPPFLAGS="${CPPFLAGS} -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED" + +# -DGTK_DISABLE_DEPRECATED" + +fi + +if test "x$have_pango_1_5" != "xyes"; then + CPPFLAGS="${CPPFLAGS} -DPANGO_DISABLE_DEPRECATED" fi ############################ diff --git a/libgimpconfig/gimpconfig-deserialize.c b/libgimpconfig/gimpconfig-deserialize.c index 24d380c08b..01b961435f 100644 --- a/libgimpconfig/gimpconfig-deserialize.c +++ b/libgimpconfig/gimpconfig-deserialize.c @@ -716,7 +716,7 @@ gimp_config_deserialize_value_array (GValue *value, return token; } - g_value_set_boxed_take_ownership (value, array); + g_value_take_boxed (value, array); return G_TOKEN_RIGHT_PAREN; } diff --git a/libgimpwidgets/gimpoffsetarea.c b/libgimpwidgets/gimpoffsetarea.c index 098cb62054..e2f8c8c3e6 100644 --- a/libgimpwidgets/gimpoffsetarea.c +++ b/libgimpwidgets/gimpoffsetarea.c @@ -474,7 +474,7 @@ gimp_offset_area_expose_event (GtkWidget *widget, gdk_draw_rectangle (widget->window, gc, FALSE, x + 1, y + 1, w - 3, h - 3); - gdk_gc_unref (gc); + g_object_unref (gc); } else {