From cdf48fc3e9ce71ef09c0b9ddbdf7057f6d36e6da Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Fri, 27 Jan 2017 23:41:15 +0100 Subject: [PATCH] Configure SVG library MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit • New feature flag HAVE_SVG, enabled by default if dependencies are available (librsvg-2.0 >= 2.36.0). • New item in About window's Features tab for librSVG. --- claws-features.h.in | 1 + configure.ac | 24 ++++++++++++++++++++++++ src/Makefile.am | 2 ++ src/gtk/about.c | 10 ++++++++++ 4 files changed, 37 insertions(+) diff --git a/claws-features.h.in b/claws-features.h.in index 0d5e8ad3c..65d71e6f3 100644 --- a/claws-features.h.in +++ b/claws-features.h.in @@ -7,6 +7,7 @@ #undef HAVE_NETWORKMANAGER_SUPPORT #undef HAVE_STARTUP_NOTIFICATION #undef HAVE_VALGRIND +#undef HAVE_SVG #undef USE_BOGOFILTER_PLUGIN #undef USE_ENCHANT #undef USE_GNUTLS diff --git a/configure.ac b/configure.ac index e8e4ae427..99cb4482c 100644 --- a/configure.ac +++ b/configure.ac @@ -290,6 +290,10 @@ AC_ARG_ENABLE(gtk3, [ --enable-gtk3 Build GTK3 support], [enable_gtk3=$enableval], [enable_gtk3=no]) +AC_ARG_ENABLE(svg, + [ --disable-svg Do not build SVG support], + [enable_svg=$enableval], [enable_svg=yes]) + AC_ARG_ENABLE(deprecated, [ --disable-deprecated Disable deprecated GTK functions], [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], []) @@ -927,6 +931,25 @@ else fi AM_CONDITIONAL(CLAWS_LIBETPAN, test "x$libetpan_result" = "xyes") +dnl librsvg +AC_MSG_CHECKING([whether to use librsvg]) +if test x"$enable_svg" = xyes; then + AC_MSG_RESULT(yes) + PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.36.0 cairo >= 1.0.0], + [ + AC_SUBST(SVG_CFLAGS) + AC_SUBST(SVG_LIBS) + AC_DEFINE(HAVE_SVG, 1, [Define if librsvg2 is available for SVG support]) + enable_svg=yes + ], + [ + AC_MSG_NOTICE([SVG support deactivated as librsvg2 >= 2.36 was not found]) + enable_svg=no + ]) +else + AC_MSG_RESULT(no) +fi + AC_MSG_CHECKING([whether to use valgrind]) if test x$enable_valgrind = xyes; then AC_MSG_RESULT(yes) @@ -2009,6 +2032,7 @@ echo "DBUS : $enable_dbus" echo "NetworkManager : $enable_networkmanager" echo "Manual : $enable_manual" echo "Generic UMPC code : $enable_generic_umpc" +echo "SVG support : $enable_svg" echo "Config dir : $ac_cv_with_config_dir" echo "Password crypto : $pwd_crypto" diff --git a/src/Makefile.am b/src/Makefile.am index b78a58ddf..ba1b837b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -599,6 +599,7 @@ claws_mail_LDADD = \ $(STARTUP_NOTIFICATION_LIBS) \ $(LIBETPAN_LIBS) \ $(DBUS_LIBS) \ + $(SVG_LIBS) \ $(CONTACTS_LIBS) pixmapdir=$(datadir)/icons/hicolor/48x48/apps @@ -619,6 +620,7 @@ AM_CPPFLAGS = \ $(LIBETPAN_CPPFLAGS) \ $(STARTUP_NOTIFICATION_CFLAGS) \ $(DBUS_CFLAGS) \ + $(SVG_CFLAGS) \ $(NETWORKMANAGER_SUPPORT_CFLAGS) \ $(VALGRIND_CFLAGS) \ $(CONTACTS_CFLAGS) diff --git a/src/gtk/about.c b/src/gtk/about.c index 86570acb3..980989283 100644 --- a/src/gtk/about.c +++ b/src/gtk/about.c @@ -510,6 +510,16 @@ static GtkWidget *about_create_child_page_features(void) gtk_text_buffer_insert(buffer, &iter, (gchar *)C_("NetworkManager", "adds support for detection of network connection changes\n"), -1); +#if HAVE_SVG + gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf); +#else + gtk_text_buffer_insert_pixbuf(buffer, &iter, inactive_pixbuf); +#endif + gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" librSVG "), -1, + "bold", NULL); + gtk_text_buffer_insert(buffer, &iter, + (gchar *)C_("librSVG", "adds support for SVG themes\n"), -1); + return scrolledwin; } -- 2.11.4.GIT