Commit 05d32e6b authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

clock: remove rsvg dependency

parent 926a84bf
......@@ -439,16 +439,18 @@ clock_face_load_face (ClockFace *this, gint width, gint height)
"clock-face-", size_string[priv->size],
"-", daytime_string[priv->timeofday], ".svg",
NULL);
priv->face_pixbuf = clock_utils_pixbuf_from_svg_resource_at_size (name,
width, height);
priv->face_pixbuf = gdk_pixbuf_new_from_resource_at_scale (name,
width, height,
FALSE, NULL);
g_free (name);
if (!priv->face_pixbuf) {
name = g_strconcat (CLOCK_RESOURCE_PATH "icons/",
"clock-face-", size_string[priv->size], ".svg",
NULL);
priv->face_pixbuf = clock_utils_pixbuf_from_svg_resource_at_size (name,
width, height);
priv->face_pixbuf = gdk_pixbuf_new_from_resource_at_scale (name,
width, height,
FALSE, NULL);
g_free (name);
}
......
......@@ -32,8 +32,6 @@
#include <gtk/gtk.h>
#include <librsvg/rsvg.h>
#include "clock-applet.h"
#include "clock-utils.h"
......@@ -125,50 +123,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;
}
......@@ -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__ */
......@@ -104,7 +104,7 @@ AC_ARG_ENABLE([documentation],
AM_CONDITIONAL(ENABLE_DOCUMENTATION, test x$enable_documentation = xyes)
LIBGNOME_DESKTOP_REQUIRED=2.91.0
GDK_PIXBUF_REQUIRED=2.25.2
GDK_PIXBUF_REQUIRED=2.26.0
PANGO_REQUIRED=1.15.4
GLIB_REQUIRED=2.45.3
GTK_REQUIRED=3.22.0
......@@ -115,7 +115,6 @@ LIBEDATASERVER_REQUIRED=3.5.3
CAIRO_REQUIRED=1.0.0
GWEATHER_REQUIRED=3.17.1
DCONF_REQUIRED=0.13.4
LIBRSVG_REQUIRED=2.36.2
XRANDR_REQUIRED=1.3.0
dnl pkg-config dependency checks
......@@ -172,9 +171,16 @@ AC_SUBST(WNCKLET_LIBS)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_FUNCS(nl_langinfo)
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)
AC_SUBST(CLOCK_CFLAGS)
AC_SUBST(CLOCK_LIBS)
PKG_CHECK_MODULES([CLOCK], [
dconf >= $DCONF_REQUIRED
gio-2.0 >= $GLIB_REQUIRED
glib-2.0 >= $GLIB_REQUIRED
gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
gweather-3.0 >= $GWEATHER_REQUIRED
pango >= $PANGO_REQUIRED
polkit-gobject-1
])
# Check whether to enable e-d-s support for clock applet
AC_MSG_CHECKING([whether to enable evolution-data-server support])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment