summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-12-09 11:35:25 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-12-09 11:35:25 +0000
commit4a76e2728f29933fece00149b2edc86c48f119ae (patch)
tree5223abb34f560857bf060b971bea7f6ba47c4833
parentSelector tool: improve responsiveness for snapping a path's internal intersec... (diff)
downloadinkscape-4a76e2728f29933fece00149b2edc86c48f119ae.tar.gz
inkscape-4a76e2728f29933fece00149b2edc86c48f119ae.zip
Tidy up GTK/Glib deprecation flags and drop ancient pango support (<1.24)
Fixed bugs: - https://launchpad.net/bugs/1088134 (bzr r11938)
-rw-r--r--configure.ac38
-rw-r--r--src/libnrtype/FontFactory.cpp7
-rw-r--r--src/libnrtype/FontInstance.cpp7
-rw-r--r--src/libnrtype/Layout-TNG-Input.cpp6
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp6
5 files changed, 31 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac
index 7d8274440..ed1127418 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,11 +54,11 @@ if test "$GCC" = "yes"; then
CPPFLAGS="-Wformat -Wformat-security $CPPFLAGS"
# Enable all default warnings
CPPFLAGS="-Wall $CPPFLAGS"
- # Ensure that no deprecated glibmm symbols are introduced.
- # lp:inkscape builds cleanly with this option at r10957
- CPPFLAGS="-DGLIBMM_DISABLE_DEPRECATED $CPPFLAGS"
- CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
- CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
+
+ # Permit only top-level Glib headers to be used.
+ #
+ # TODO: This is already the case for Glib >= 2.32 so this flag can be dropped
+ # when all targeted distros use higher Glib versions.
CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
# Ensure that private GTK+ fields are not accessible. This is the case for
@@ -789,7 +789,7 @@ if test "x$enable_gtk3" = "xyes"; then
AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
fi
- PKG_CHECK_MODULES(INKSCAPE, gtkmm-3.0 gdkmm-3.0 gtk+-3.0 gdk-3.0 gdl-3.0 > 3.3.4 glib-2.0 >= 2.28 libxml-2.0 >= 2.6.11 libxslt >= 1.0.15 cairo >= 1.10 cairomm-1.0 >= 1.9.8 sigc++-2.0 >= $min_sigc_version $ink_spell_pkg gthread-2.0 >= 2.0 libpng >= 1.2 gsl glibmm-2.4 >= 2.28 giomm-2.4, with_gtkmm_3_0=yes, with_gtkmm_3_0=no)
+ PKG_CHECK_MODULES(INKSCAPE, gtkmm-3.0 gdkmm-3.0 gtk+-3.0 gdk-3.0 gdl-3.0 > 3.3.4 glib-2.0 >= 2.28 libxml-2.0 >= 2.6.11 libxslt >= 1.0.15 cairo >= 1.10 cairomm-1.0 >= 1.9.8 sigc++-2.0 >= $min_sigc_version $ink_spell_pkg gthread-2.0 >= 2.0 libpng >= 1.2 gsl glibmm-2.4 >= 2.28 giomm-2.4 pango >= 1.24, with_gtkmm_3_0=yes, with_gtkmm_3_0=no)
if test "x$with_gtkmm_3_0" = "xyes"; then
AC_MSG_RESULT([Using EXPERIMENTAL Gtkmm 3 build])
@@ -808,7 +808,7 @@ else
AC_DEFINE(WITH_GTKSPELL, 1, [enable gtk spelling widget])
fi
- PKG_CHECK_MODULES(INKSCAPE, glib-2.0 >= 2.28 gtk+-2.0 >= 2.24 libxml-2.0 >= 2.6.11 libxslt >= 1.0.15 cairo >= 1.10 cairomm-1.0 >= 1.9.8 sigc++-2.0 >= $min_sigc_version $ink_spell_pkg gthread-2.0 >= 2.0 libpng >= 1.2 gsl glibmm-2.4 >= 2.28 giomm-2.4 gdkmm-2.4 gtkmm-2.4 >= 2.24)
+ PKG_CHECK_MODULES(INKSCAPE, glib-2.0 >= 2.28 gtk+-2.0 >= 2.24 libxml-2.0 >= 2.6.11 libxslt >= 1.0.15 cairo >= 1.10 cairomm-1.0 >= 1.9.8 sigc++-2.0 >= $min_sigc_version $ink_spell_pkg gthread-2.0 >= 2.0 libpng >= 1.2 gsl glibmm-2.4 >= 2.28 giomm-2.4 gdkmm-2.4 gtkmm-2.4 >= 2.24 pango >= 1.24)
# Disable deprecated symbols to make GTK+ 3 migration easier.
# This should also be applied to GTK+ 3 builds too,
@@ -816,6 +816,11 @@ else
CPPFLAGS="-DGTKMM_DISABLE_DEPRECATED $CPPFLAGS"
CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
CPPFLAGS="-DGDKMM_DISABLE_DEPRECATED $CPPFLAGS"
+
+ # Allow only top-level GTK+ headers to be used. This is mandatory
+ # for GTK+ >= 3.0 so there is no need to apply the flag in GTK+ 3
+ # builds.
+ CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
# FIXME: This is disabled because our internal
# copy of GDL still uses deprecated GTK+ 2 symbols.
@@ -828,6 +833,25 @@ fi
AM_CONDITIONAL(WITH_EXT_GDL, test "x$with_gtkmm_3_0" = "xyes")
+dnl Pango 1.32.4 uses a deprecated Glib symbol:
+dnl https://bugzilla.gnome.org/show_bug.cgi?id=689843
+dnl
+dnl TODO: Get rid of this check once we are sure that all targeted
+dnl platforms have got rid of this Pango version. Apply the
+dnl G_DISABLE_DEPRECATED flag to all builds.
+with_pango_1_32_4="no"
+PKG_CHECK_MODULES(PANGO_1_32_4, pango = 1.32.4, with_pango_1_32_4=yes, with_pango_1_32_4=no)
+
+if test "x$with_pango_1_32_4" = "xyes"; then
+ AC_MSG_WARN([Pango 1.32.4 detected. Deprecated Glib symbol usage will be allowed])
+else
+ # Ensure that no deprecated glibmm symbols are introduced.
+ # lp:inkscape builds cleanly with this option at r10957
+ CPPFLAGS="-DGLIBMM_DISABLE_DEPRECATED $CPPFLAGS"
+ CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
+fi
+
+
# Check for GTK+ backend target
AC_MSG_CHECKING([for GTK+ backend target])
gtk_backend_target=`pkg-config --variable=target gtk+-2.0`
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index 76a3df0e8..ed1e1dc5c 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -22,13 +22,6 @@
#include "libnrtype/font-instance.h"
#include "util/unordered-containers.h"
-#if !PANGO_VERSION_CHECK(1,24,0)
-#define PANGO_WEIGHT_THIN static_cast<PangoWeight>(100)
-#define PANGO_WEIGHT_BOOK static_cast<PangoWeight>(380)
-#define PANGO_WEIGHT_MEDIUM static_cast<PangoWeight>(500)
-#define PANGO_WEIGHT_ULTRAHEAVY static_cast<PangoWeight>(1000)
-#endif
-
typedef INK_UNORDERED_MAP<PangoFontDescription*, font_instance*, font_descr_hash, font_descr_equal> FaceMapType;
// need to avoid using the size field
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index f8b2c3b9d..4ca8bf2a0 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -27,13 +27,6 @@
#include "livarot/Path.h"
#include "util/unordered-containers.h"
-#if !PANGO_VERSION_CHECK(1,24,0)
-#define PANGO_WEIGHT_THIN static_cast<PangoWeight>(100)
-#define PANGO_WEIGHT_BOOK static_cast<PangoWeight>(380)
-#define PANGO_WEIGHT_MEDIUM static_cast<PangoWeight>(500)
-#define PANGO_WEIGHT_ULTRAHEAVY static_cast<PangoWeight>(1000)
-#endif
-
struct font_style_hash : public std::unary_function<font_style, size_t> {
size_t operator()(font_style const &x) const;
diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp
index 07bf207c8..10310b4aa 100644
--- a/src/libnrtype/Layout-TNG-Input.cpp
+++ b/src/libnrtype/Layout-TNG-Input.cpp
@@ -19,12 +19,6 @@
#include "sp-string.h"
#include "FontFactory.h"
-#if !PANGO_VERSION_CHECK(1,24,0)
-#define PANGO_WEIGHT_THIN static_cast<PangoWeight>(100)
-#define PANGO_WEIGHT_BOOK static_cast<PangoWeight>(380)
-#define PANGO_WEIGHT_MEDIUM static_cast<PangoWeight>(500)
-#define PANGO_WEIGHT_ULTRAHEAVY static_cast<PangoWeight>(1000)
-#endif
namespace Inkscape {
namespace Text {
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index 4bdd2c6cb..bf746b41f 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -21,12 +21,6 @@
#include "display/curve.h"
#include <2geom/pathvector.h>
-#if !PANGO_VERSION_CHECK(1,24,0)
-#define PANGO_WEIGHT_THIN static_cast<PangoWeight>(100)
-#define PANGO_WEIGHT_BOOK static_cast<PangoWeight>(380)
-#define PANGO_WEIGHT_MEDIUM static_cast<PangoWeight>(500)
-#define PANGO_WEIGHT_ULTRAHEAVY static_cast<PangoWeight>(1000)
-#endif
namespace Inkscape {
namespace Extension {