Commit 0839b65b authored by Dom Lachowicz's avatar Dom Lachowicz

librsvg based theme engine...

parent 631337ff
2002-09-25 Dom Lachowicz <doml@appligent.com>
* (): Import and create a SVG based GTK+ theme engine
2002-09-22 Dom Lachowicz <doml@appligent.com>
* rsvg-css.c (clip_rgb_percent): fix bug. stoopid math...
......
SUBDIRS = gtk-engine
noinst_PROGRAMS = test-rsvg test-performance
EXTRA_DIST =\
......
......@@ -61,6 +61,16 @@ AC_SUBST(LIBRSVG_CFLAGS)
dnl ===========================================================================
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 1.3.12,,
AC_MSG_ERROR([GTK+-2.0 is required to compile gtk-engines]))
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_VERSION)
dnl ===========================================================================
AC_CHECK_LIB(popt, poptParseArgvString, [POPT_LIBS="-lpopt"],
AC_MSG_ERROR([popt 1.5 or newer is required to build librsvg.
You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]))
......@@ -116,4 +126,6 @@ AC_OUTPUT([
librsvg.spec
librsvg-features.h
Makefile
librsvg-2.0.pc])
librsvg-2.0.pc
gtk-engine/Makefile
])
INCLUDES = $(GTK_CFLAGS)
INCLUDES = $(GTK_CFLAGS) $(LIBRSVG_CFLAGS)
enginedir = $(libdir)/gtk-2.0/$(GTK_VERSION)/engines
......@@ -14,7 +14,7 @@ libsvg_la_SOURCES = \
svg.h
libsvg_la_LDFLAGS = -avoid-version -module
libsvg_la_LIBADD = $(GTK_LIBS)
libsvg_la_LIBADD = $(GTK_LIBS) $(LIBRSVG_LIBS)
dist-hook:
cp -pr examples $(distdir); \
......
......@@ -26,19 +26,24 @@
#include "svg-rc-style.h"
#include <gmodule.h>
G_MODULE_EXPORT void
G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
G_MODULE_EXPORT void theme_init (GTypeModule *module);
G_MODULE_EXPORT void theme_exit (void);
G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void);
void
theme_init (GTypeModule *module)
{
rsvg_rc_style_register_type (module);
rsvg_style_register_type (module);
}
G_MODULE_EXPORT void
void
theme_exit (void)
{
}
G_MODULE_EXPORT GtkRcStyle *
GtkRcStyle *
theme_create_rc_style (void)
{
return GTK_RC_STYLE (g_object_new (RSVG_TYPE_RC_STYLE, NULL));
......@@ -48,7 +53,6 @@ theme_create_rc_style (void)
* is loaded and checks to see if we are compatible with the
* version of GTK+ that loads us.
*/
G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
const gchar*
g_module_check_init (GModule *module)
{
......
......@@ -704,7 +704,7 @@ rsvg_rc_style_parse (GtkRcStyle *rc_style,
guint old_scope;
guint token;
gint i;
guint i;
ThemeImage *img;
/* Set up a new scope in this scanner. */
......
......@@ -25,7 +25,7 @@
#include "svg.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <librsvg/rsvg.h>
#include <rsvg.h>
GCache *pixbuf_cache = NULL;
......@@ -43,7 +43,8 @@ bilinear_gradient (GdkPixbuf *src,
guint dest_rowstride;
guchar *dest_pixels;
GdkPixbuf *result;
int i, j, k;
int i, j;
guint k;
p1 = src_pixels + (src_y - 1) * src_rowstride + (src_x - 1) * n_channels;
p2 = p1 + n_channels;
......@@ -96,7 +97,8 @@ horizontal_gradient (GdkPixbuf *src,
guint dest_rowstride;
guchar *dest_pixels;
GdkPixbuf *result;
int i, j, k;
int i, j;
guint k;
result = gdk_pixbuf_new (GDK_COLORSPACE_RGB, n_channels == 4, 8,
width, height);
......@@ -640,12 +642,12 @@ theme_pixbuf_set_stretch (ThemePixbuf *theme_pb,
theme_pixbuf_compute_hints (theme_pb);
}
GdkPixbuf *
static GdkPixbuf *
pixbuf_cache_value_new (gchar *filename)
{
GError *err = NULL;
GdkPixbuf *result = rsvg_pixbuf_new_from_file (filename, &err);
GdkPixbuf *result = rsvg_pixbuf_from_file (filename, &err);
if (!result)
{
g_warning ("Rsvg theme: Cannot load SVG file %s: %s\n",
......
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