Configure SVG library
authorRicardo Mones <ricardo@mones.org>
Fri, 27 Jan 2017 22:41:15 +0000 (23:41 +0100)
committerRicardo Mones <ricardo@mones.org>
Tue, 7 Feb 2017 19:02:58 +0000 (20:02 +0100)
• 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
configure.ac
src/Makefile.am
src/gtk/about.c

index 0d5e8ad..65d71e6 100644 (file)
@@ -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
index e8e4ae4..99cb448 100644 (file)
@@ -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"
 
index b78a58d..ba1b837 100644 (file)
@@ -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)
index 86570ac..9809892 100644 (file)
@@ -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;
 }