[gnome-panel/wip/applets/clock: 6/18] clock: remove rsvg dependency



commit 791fd52736c362d1ba54536e7e6de658eda3e01c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Nov 8 21:07:15 2014 +0200

    clock: remove rsvg dependency

 applets/clock/clock-utils.c |   49 -------------------------------------------
 applets/clock/clock-utils.h |    4 ---
 configure.ac                |    3 +-
 3 files changed, 1 insertions(+), 55 deletions(-)
---
diff --git a/applets/clock/clock-utils.c b/applets/clock/clock-utils.c
index d937b23..94589cc 100644
--- a/applets/clock/clock-utils.c
+++ b/applets/clock/clock-utils.c
@@ -32,8 +32,6 @@
 
 #include <gtk/gtk.h>
 
-#include <librsvg/rsvg.h>
-
 #include "clock.h"
 
 #include "clock-utils.h"
@@ -126,50 +124,3 @@ clock_utils_display_help (GtkWidget  *widget,
                gtk_widget_show (dialog);
        }
 }
-
-GdkPixbuf *
-clock_utils_pixbuf_from_svg_resource_at_size (const char *resource,
-                                             int         width,
-                                             int         height)
-{
-       GInputStream      *stream = NULL;
-       RsvgHandle        *handle = NULL;
-       RsvgDimensionData  svg_dimensions;
-       GdkPixbuf         *pixbuf = NULL;
-       cairo_surface_t   *surface = NULL;
-       cairo_matrix_t     matrix;
-       cairo_t           *cr = NULL;
-
-       stream = g_resources_open_stream (resource, 0, NULL);
-       if (!stream)
-               goto out;
-
-       handle = rsvg_handle_new ();
-       if (!handle)
-               goto out;
-
-       if (!rsvg_handle_read_stream_sync (handle, stream, NULL, NULL))
-               goto out;
-
-       rsvg_handle_get_dimensions (handle, &svg_dimensions);
-
-       surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
-       cr = cairo_create (surface);
-       cairo_matrix_init_scale (&matrix,
-                                ((double) width / svg_dimensions.width),
-                                ((double) height / svg_dimensions.height));
-       cairo_transform (cr, &matrix);
-       rsvg_handle_render_cairo (handle, cr);
-       cairo_destroy (cr);
-
-       pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
-       cairo_surface_destroy (surface);
-
-out:
-       if (handle)
-               rsvg_handle_close (handle, NULL);
-       if (stream)
-               g_object_unref (stream);
-
-       return pixbuf;
-}
diff --git a/applets/clock/clock-utils.h b/applets/clock/clock-utils.h
index f04e18d..c008d51 100644
--- a/applets/clock/clock-utils.h
+++ b/applets/clock/clock-utils.h
@@ -37,10 +37,6 @@ void clock_utils_display_help (GtkWidget  *widget,
                               const char *doc_id,
                               const char *link_id);
 
-GdkPixbuf *clock_utils_pixbuf_from_svg_resource_at_size (const char *resource,
-                                                        int         width,
-                                                        int         height);
-
 G_END_DECLS
 
 #endif /* __CLOCK_UTILS_H__ */
diff --git a/configure.ac b/configure.ac
index c69b8ae..57cab2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,7 +98,6 @@ LIBEDATASERVER_REQUIRED=3.5.3
 CAIRO_REQUIRED=1.0.0
 GWEATHER_REQUIRED=3.10.1
 DCONF_REQUIRED=0.13.4
-LIBRSVG_REQUIRED=2.36.2
 
 dnl pkg-config dependency checks
 
@@ -149,7 +148,7 @@ PKG_CHECK_MODULES(TZ, gio-2.0 >= $GLIB_REQUIRED)
 AC_SUBST(TZ_CFLAGS)
 AC_SUBST(TZ_LIBS)
 
-PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED 
gio-2.0 >= $GLIB_REQUIRED librsvg-2.0 >= $LIBRSVG_REQUIRED gweather-3.0 >= $GWEATHER_REQUIRED 
gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED polkit-gobject-1 dconf >= $DCONF_REQUIRED)
+PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED 
gio-2.0 >= $GLIB_REQUIRED gweather-3.0 >= $GWEATHER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED 
polkit-gobject-1 dconf >= $DCONF_REQUIRED)
 AC_SUBST(CLOCK_CFLAGS)
 AC_SUBST(CLOCK_LIBS)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]