Commit 073cf52b authored by Dom Lachowicz's avatar Dom Lachowicz

re-merge the RSVG-filters branch back into HEAD

parent c8cbc856
== librsvg 2.6.2 ==
2004-03-17 Dom Lachowicz <cinamod@hotmail.com>
2004-03-15 Caleb Moore <c.moore@student.unsw.edu.au>
* *: re-merge rsvg-filters branch back into HEAD
2004-03-16 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-styles.c: Implemented masks.
2004-03-16 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-bpath-util.c: Applied double move fix contributed by ross
alexander.
2004-03-14 Dom Lachowicz <cinamod@.hotmail.com>
* test-performance.c: Make this a useful performance tester
2004-03-15 Dom Lachowicz <cinamod@hotmail.com>
2004-03-12 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-css.c: Work around something for jimmac
* rsvg-shapes.c: Allow for base64 embedded image data
2004-03-11 Dom Lachowicz <cinamod@hotmail.com>
* rsvg.c: More work on 105316
* rsvg.c: Ability to scale SVGs that don't provide a width or height
2004-03-11 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-shapes.c: Improve image scaling, translation. Rotation is still
horked, though. Agree with Caleb's comments below.
2004-03-11 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-shapes.c, rsvg-styles.c: added state domination, ability for a
use's values to overwrite even explicitly set state variables in the
symbol.
* rsvg-shapes.c: Fixed image bitmap sizing, may need to give the whole
system a good rewrite sometime to avoid having to use crappy libart
rotation etc. and eventually make it easier to port to cairo, added
ability to use filters with images.
* rsvg-filter.c: Fixed arithmetic compositition.
* rsvg-text.c: fixed little filter bug I opened up a few days ago
* rsvg-defs.c: fixed memory leak that means unnamed defs are never
freed.
2004-03-10 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-shapes.c: exported drawable structures and functions
* rsvg-filter.c: made feImage work for internal references (like use)
* rsvg-css.c: fixed spelling of dodgerblue (was dogerblue)
2004-03-09 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-shapes.c: HUUUUGE fixes to use
2004-03-09 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-shapes.c: made groups "use"able
* rsvg-styles.c: changed inheritance mechanism
2004-03-07 Dom Lachowicz <cinamod@hotmail.com>
* rsvg.c: Do something for clahey (bug #105316)
* rsvg.c: Do something for clahey (bug 105316)
2004-03-05 Dodji Seketeli <dodji@gnome.org>
2004-03-07 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-styles.c:
(ccss_property): changed the signature of this function
to comply with the new signature of CRDocHandler::property()
in libcroco.
* gtk-engine/*.[ch]: Theme engine now renders SVGs at their display
size, thus cutting down on a lot of nasty raster scaling
2004-03-04 Dom Lachowicz <cinamod@hotmail.com>
2004-03-04 Glynn Foster <glynn.foster@sun.com>
* configure.in: Forward-port things from Gman
* rsvg-styles.c: Forward-port patch from Dodji
* *.c: Use new RsvgPropertyBag interface
2004-03-04 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Added final filter: feTile
* Makefile.am, configure.in, librsvg-2.0-uninstalled.pc.in:
Add uninstalled pkg-config file.
2004-03-04 Caleb Moore <c.moore@student.unsw.edu.au>
2004-02-19 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-filter.c: Fixed feDiffuseLighting and feSpecular lighting to scale
more consistantly
* Makefile.am: disable vector text path code for the 2.6 release
2004-03-03 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Fixed feDiffuseLighting and feSpecular lighting for small
kernel length at the expense of speed, hopefully this can be optimised later.
Fixed a "what the hell was I thinking?!" bug in filter dimentioning.
2004-03-02 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Added new filters: feDiffuseLighting and feSpecular lighting
2004-02-29 Dom Lachowicz <cinamod@hotmail.com>
* moz-plugin/moz-plugin.c: Make Netscape/Mozilla plugin kind-of work
2004-02-29 Dom Lachowicz <cinamod@hotmail.com>
* configure.in:
* Makefile.am:
* test-display.c: Build + install 'rsvg-view'
* rsvg-file-util.c:
* rsvg-private.h: Export some things that I need in order to build rsvg-view
2004-02-29 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-filter.c: Added new filter: feImage
2004-02-29 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-filter.c: Added new filter: feTurbulence
2004-03-01 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Implemented bi-linear filtering for displacement
map. The algorithm is still pretty crap but it makes it look a lot
better than it did before.
2004-02-29 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Added new filter: feDisplacementMap
2004-02-28 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-text.c: Made standard text the default. Vector text was
annoying me.
* rsvg-filter.c: Fixed a segfault in feComponentTransfer
2004-02-28 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-styles.c: made filters render before opacity is taken care of,
this seems like the official way it is done
* rsvg-filter.c: fixed a few problem with coordinate units and
dimentions
2004-02-27 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-styles.c: implemented the "enable-background" style value.
This allows backgrounds to be used by filters even when they are
are based on multiple opacity levels. It also allows one to specify
exactly how many levels of groups one wants to be included in the
background.
2004-02-19 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-styles.c, rsvg-styles.h: Changed "opacity groups" into
"discrete layers" which are like opacity groups but handle filters
as well as opacity groups and will eventually handle masks. This fixes
bugs relating to transperency and filters being used at the same time.
* rsvg-filter.c: fixed a couple of little bugs relating to gaussian
blurs with a standard deviation less than 1 in an axis, it will now
just ommit blurring in this axis, saving us time. Also disabled perfect
blurs because they are really quite silly most of the time, Dom was
right.
2004-02-18 Brian Koebbe <brian@koebbe.org>
......@@ -40,7 +162,7 @@
2004-02-17 Thomas Vander Stichele <thomas at apestaart dot org>
* rsvg-gz.c: (rsvg_handle_gz_close_impl):
catch read error from gsf_input_read
catch read error from gsf_input_read
break from infinite loops that do not manage to write (#134653)
2004-02-16 Dom Lachowicz <cinamod@hotmail.com>
......@@ -54,10 +176,69 @@
2004-02-14 Dom Lachowicz <cinamod@hotmail.com>
* rsvg.c: Fix bug #133947
2004-02-11 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: added feComposite filter
2004-02-07 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-styles.[ch]: Implement get_font_size() function
* rsvg-shapes.c: Use the above fn
* rsvg-filter.c: Ditto
2004-02-06 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: made gassian blur use 3 box blurs (technically 6 motion blurs) when the geometric mean of the standard deviations of the filter is over two. Misc enhancements in feConvolveMatrix
2004-02-05 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Made colormatrix a lot safer, added checking to make sure colvolvematrix doesn't segfault, fixed embarrasing little buglet in feOffset.
* rsvg-filter.c: fixed table in feComponantTransfer, I won't pretend to know how I did it. It truely is an aweful hack, but its the best we have and it seems to work as per the examples
2004-02-04 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-filter.c: Fix bug in pixbuf_get_alpha(), speed up pixbuf_new_cleared(),
be more paranoid in ComponentTransfer
2004-02-04 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Implemented the feMorphology filter
2004-02-04 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Implemented the ComponentTransfer filter, it works properly now
2004-02-03 Dom Lachowicz <cinamod@hotmail.com>
* rsvg-filter.[ch]: Start implementing ComponentTransfer filter
Indent, make code ansi-compliant.
* rsvg-css.[ch]: Tweak VBOX parsing, free unused string array properly
2004-02-03 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Implemented ColorMatrix filter, Made GaussianBlur scaled according to the current coordinate system
* rsvg-css.c: Added \n to the types of whitespace that splits arguments in list
2004-02-02 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Implemented Merge filter, implemented Offset filter
2004-02-01 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-filter.c: Implemented ConvolveMatrix filter
2004-01-31 Dom Lachowicz <cinamod@hotmail.com>
2004-02-01 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-css.*: Hopefully fix bug #113538
* rsvg-syles.c: implemented filter groups using the same code as the opacity grops
* rsvg-private.h: added a current filter pointer for loading primitives in context
* rsvg-defs.c: added new def type: filter
* rsvg.c: allowed filters and filter primitives to be specified in file, also added the ability for a group to use a filter if neccisary
* rsvg-shapes.c: added the ability for a shape to use a filter if it needs to
* rsvg-text.c: added the ability for text to use a filter if it needs to
* rsvg-filter.c: added new file
* rsvg-filter.h: added new file
2004-01-29 Dom Lachowicz <cinamod@hotmail.com>
......
SUBDIRS = . gtk-engine gdk-pixbuf-loader doc
SUBDIRS = . gtk-engine gdk-pixbuf-loader moz-plugin doc
bin_PROGRAMS = rsvg
if HAVE_GTK
target_rsvg_view = rsvg-view
else
target_rsvg_view =
endif
bin_PROGRAMS = rsvg $(target_rsvg_view)
noinst_PROGRAMS = test-performance #test-display
noinst_PROGRAMS = test-performance
man_MANS = rsvg.1
......@@ -19,17 +25,6 @@ else
libm = -lm
endif
EXTRA_DIST = \
COPYING.LIB \
librsvg.spec.in \
librsvg-2.0.pc.in \
librsvg-2.0-uninstalled.pc.in \
librsvg-zip.in \
rsvg-text-vectors.c \
rsvg-gz.c \
rsvg-gz.h \
$(man_MANS)
lib_LTLIBRARIES = librsvg-2.la
librsvg_2_la_SOURCES = \
......@@ -47,11 +42,14 @@ librsvg_2_la_SOURCES = \
rsvg-path.h \
rsvg-private.h \
rsvg-file-util.c \
rsvg-filter.c \
rsvg-filter.h \
rsvg-shapes.c \
rsvg-shapes.h \
rsvg-styles.c \
rsvg-styles.h \
rsvg-text.c \
rsvg-text-vectors.c \
rsvg-text.h \
rsvg.c
......@@ -71,6 +69,7 @@ INCLUDES = \
-I$(top_builddir) \
$(LIBRSVG_CFLAGS) \
$(GTK_CFLAGS) \
$(GDK_X11_CFLAGS) \
-DG_LOG_DOMAIN=\"librsvg\" \
-DDATADIR="\"$(datadir)\""
......@@ -92,10 +91,22 @@ test_performance_LDFLAGS =
test_performance_DEPENDENCIES = $(DEPS)
test_performance_LDADD = $(LDADDS) $(libm)
#test_display_SOURCES=test-display.c
#test_display_LDFLAGS =
#test_display_DEPENDENCIES = $(DEPS)
#test_display_LDADD = $(LDADDS) $(GTK_LIBS) $(libm)
rsvg_view_SOURCES = \
test-display.c
rsvg_view_LDFLAGS =
rsvg_view_DEPENDENCIES = $(DEPS)
rsvg_view_LDADD = $(LDADDS) $(GTK_LIBS) $(GDK_X11_LIBS) $(libm)
EXTRA_DIST = \
COPYING.LIB \
librsvg.spec.in \
librsvg-2.0.pc.in \
librsvg-2.0-uninstalled.pc.in \
librsvg-zip.in \
rsvg-gz.c \
rsvg-gz.h \
$(man_MANS) \
$(rsvg_view_SOURCES)
tests: rsvg
......
......@@ -6,8 +6,6 @@ TODO:
* Fixing image transforms
* Image effects/filters
* Fill patterns
* Add actual GError support in the loader, rather then the g_warnings
......@@ -18,5 +16,4 @@ On the back burner:
* Make error messages translatable (requires adding gettext).
Requests from Christian:
* gaussian blur
* gtk theme engine supporting automatic mouseover-and-light-up effect
......@@ -19,8 +19,8 @@ AC_SUBST(POPT_REQUIRED)
dnl ===========================================================================
LIBRSVG_MAJOR_VERSION=2
LIBRSVG_MINOR_VERSION=6
LIBRSVG_MICRO_VERSION=2
LIBRSVG_MINOR_VERSION=7
LIBRSVG_MICRO_VERSION=1
AC_SUBST(LIBRSVG_MAJOR_VERSION)
AC_SUBST(LIBRSVG_MINOR_VERSION)
AC_SUBST(LIBRSVG_MICRO_VERSION)
......@@ -203,23 +203,36 @@ else
AC_MSG_RESULT(no)
fi
have_gtk=no
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 1.3.12, have_gtk=yes,
have_gtk=no)
GTK_VERSION=
if test "x$have_gtk" = "xyes"; then
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_VERSION)
AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
have_gdk_x11=no
PKG_CHECK_MODULES(GDK_X11, gdk-x11-2.0 >= 2.0.0, have_gdk_x11=yes, have_gdk_x11=no)
AC_SUBST(GDK_X11_CFLAGS)
AC_SUBST(GDK_X11_LIBS)
if test "x$have_gdk_x11" = "xyes"; then
AC_DEFINE(ENABLE_XEMBED, 1, [Is XEmbed available])
fi
AC_ARG_ENABLE(gtk-theme,
[ --enable-gtk-theme Enable a RSVG based GTK+ theme engine [default=auto]],,
enable_gtk_theme=yes)
if test "x$enable_gtk_theme" = "xyes"; then
GTK_VERSION=
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 1.3.12, enable_gtk_theme=yes,
enable_gtk_theme=no)
if test "x$enable_gtk_theme" = "xyes"; then
GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_VERSION)
if test "x$have_gtk" = "xno"; then
enable_gtk_theme=no;
fi
fi
AM_CONDITIONAL(ENABLE_GTK_ENGINE, test "x$enable_gtk_theme" = "xyes")
......@@ -240,6 +253,26 @@ fi
AM_CONDITIONAL(ENABLE_PIXBUF_LOADER, test x$enable_pixbuf_loader = xyes)
##################################################
##################################################
MOZILLA_CFLAGS=
if test -z "$MOZILLA_CONFIG"; then
AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
fi
if test "x$MOZILLA_CONFIG" != "xno"; then
_mozilla_include_dir=`mozilla-config --cflags|sed 's/-I\(.*\) .*/\1/'`
MOZILLA_CFLAGS="-I$_mozilla_include_dir/plugin -I$_mozilla_include_dir/java -I$_mozilla_include_dir/nspr"
else
AC_MSG_WARN([mozilla-config not found. Mozilla/Netscape plugin will not be built])
fi
build_mozilla_plugin=no
if test "x$MOZILLA_CFLAGS" != "x"; then
build_mozilla_plugin=yes
fi
AM_CONDITIONAL(WITH_MOZILLA,[test "x$build_mozilla_plugin" = "xyes"])
AC_SUBST(MOZILLA_CFLAGS)
##################################################
# Checks for gtk-doc and docbook-tools
##################################################
......@@ -310,6 +343,7 @@ gtk-engine/examples/Makefile
gtk-engine/examples/bubble/Makefile
gtk-engine/examples/bubble/gtk-2.0/Makefile
gdk-pixbuf-loader/Makefile
moz-plugin/Makefile
])
dnl =============================================================================================
......@@ -321,10 +355,10 @@ librsvg-$LIBRSVG_VERSION
Build GdkPixbuf loader: ${enable_pixbuf_loader}
Build theme engine: ${enable_gtk_theme}
Build Netscape plugin: ${build_mozilla_plugin}
Handle svgz files: ${test_gsf}
Use libcroco for css parsing: ${test_croco}
Build documentation: ${enable_gtk_doc}
"
AC_MSG_RESULT([$croco_warning
]);
AC_MSG_RESULT([$croco_warning]);
......@@ -30,3 +30,5 @@ libsvg_la_SOURCES = \
libsvg_la_LDFLAGS = -avoid-version -module $(no_undefined)
libsvg_la_LIBADD = $(GTK_LIBS) $(LIBRSVG_LIBS) $(LIBCROCO_LIBS) $(top_builddir)/librsvg-2.la
EXTRA_DIST = $(libsvg_la_SOURCES)
......@@ -200,7 +200,7 @@ draw_gap_image(GtkStyle *style,
components |= COMPONENT_CENTER;
if (image->gap_start)
pixbuf = theme_pixbuf_get_pixbuf (image->gap_start);
pixbuf = theme_pixbuf_get_pixbuf (image->gap_start, -1, -1);
switch (gap_side)
{
......
......@@ -21,11 +21,13 @@
* Carsten Haitzler <raster@rasterman.com>
*/
#include <stdio.h>
#include <string.h>
#include "svg.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <rsvg.h>
#include <rsvg-gz.h>
GCache *pixbuf_cache = NULL;
......@@ -443,7 +445,7 @@ theme_pixbuf_new (void)
{
ThemePixbuf *result = g_new0 (ThemePixbuf, 1);
result->filename = NULL;
result->pixbuf = NULL;
result->svg_bytes = NULL;
result->stretch = TRUE;
result->border_left = 0;
......@@ -465,10 +467,10 @@ void
theme_pixbuf_set_filename (ThemePixbuf *theme_pb,
const char *filename)
{
if (theme_pb->pixbuf)
if (theme_pb->svg_bytes)
{
g_cache_remove (pixbuf_cache, theme_pb->pixbuf);
theme_pb->pixbuf = NULL;
g_cache_remove (pixbuf_cache, theme_pb->svg_bytes);
theme_pb->svg_bytes = NULL;
}
if (theme_pb->filename)
......@@ -546,11 +548,11 @@ compute_hint (GdkPixbuf *pixbuf,
}
static void
theme_pixbuf_compute_hints (ThemePixbuf *theme_pb)
theme_pixbuf_compute_hints (ThemePixbuf *theme_pb, GdkPixbuf *pixbuf)
{
int i, j;
gint width = gdk_pixbuf_get_width (theme_pb->pixbuf);
gint height = gdk_pixbuf_get_height (theme_pb->pixbuf);
gint width = gdk_pixbuf_get_width (pixbuf);
gint height = gdk_pixbuf_get_height (pixbuf);
if (theme_pb->border_left + theme_pb->border_right > width ||
theme_pb->border_top + theme_pb->border_bottom > height)
......@@ -610,7 +612,7 @@ theme_pixbuf_compute_hints (ThemePixbuf *theme_pb)
break;
}
theme_pb->hints[i][j] = compute_hint (theme_pb->pixbuf, x0, x1, y0, y1);
theme_pb->hints[i][j] = compute_hint (pixbuf, x0, x1, y0, y1);
}
}
......@@ -627,9 +629,6 @@ theme_pixbuf_set_border (ThemePixbuf *theme_pb,
theme_pb->border_right = right;
theme_pb->border_top = top;
theme_pb->border_bottom = bottom;
if (theme_pb->pixbuf)
theme_pixbuf_compute_hints (theme_pb);
}
void
......@@ -637,46 +636,116 @@ theme_pixbuf_set_stretch (ThemePixbuf *theme_pb,
gboolean stretch)
{
theme_pb->stretch = stretch;
}
static void
svg_cache_value_free(gpointer foo)
{
GByteArray * arr;
arr = (GByteArray *)foo;
if(arr != NULL)
g_byte_array_free(arr, TRUE);
}
#define SVG_BUFFER_SIZE (1024*8)
static GByteArray *
svg_cache_value_new (gchar *filename)
{
GByteArray *result = NULL;
FILE *fp;
fp = fopen(filename, "rb");
if(fp)
{
size_t nread;
char buf[SVG_BUFFER_SIZE];
result = g_byte_array_new();
while((nread = fread(buf, 1, sizeof(buf), fp)) > 0)
g_byte_array_append(result, buf, nread);
fclose(fp);
}
else
{
g_warning("Couldn't load theme part: %s\n", filename);
}
return result;
}
struct SizeInfo
{
gint width, height;
};
static void set_size_fn(gint *width, gint *height, gpointer foo)
{
struct SizeInfo * info = (struct SizeInfo *)foo;
if (theme_pb->pixbuf)
theme_pixbuf_compute_hints (theme_pb);
*width = info->width;
*height = info->height;
}
static GdkPixbuf *
pixbuf_cache_value_new (gchar *filename)
get_pixbuf(GByteArray * arr, gint width, gint height)
{
GError *err = NULL;
GdkPixbuf *result = rsvg_pixbuf_from_file (filename, &err);
if (!result)
RsvgHandle * handle;
GdkPixbuf * result;
if(!arr || !arr->len)
return NULL;
#ifdef HAVE_SVGZ
if((arr->len >= 2) && (arr->data[0] == (guchar)0x1f) && (arr->data[1] == (guchar)0x8b))
handle = rsvg_handle_new_gz();
else
#endif
handle = rsvg_handle_new();
if(width > 0 && height > 0)
{
g_warning ("Rsvg theme: Cannot load SVG file %s: %s\n",
filename, err->message);
g_error_free (err);
struct SizeInfo info;
info.width = width;
info.height = height;
rsvg_handle_set_size_callback(handle, set_size_fn, &info, NULL);
}
rsvg_handle_write(handle, arr->data, arr->len, NULL);
rsvg_handle_close(handle, NULL);
result = rsvg_handle_get_pixbuf(handle);
rsvg_handle_free(handle);
return result;
}
GdkPixbuf *
theme_pixbuf_get_pixbuf (ThemePixbuf *theme_pb)
theme_pixbuf_get_pixbuf (ThemePixbuf *theme_pb, gint width, gint height)
{
if (!theme_pb->pixbuf)
GdkPixbuf *result = NULL;
if (!theme_pb->svg_bytes)
{
if (!pixbuf_cache)
pixbuf_cache = g_cache_new ((GCacheNewFunc)pixbuf_cache_value_new,
(GCacheDestroyFunc)gdk_pixbuf_unref,
pixbuf_cache = g_cache_new ((GCacheNewFunc)svg_cache_value_new,
(GCacheDestroyFunc)svg_cache_value_free,
(GCacheDupFunc)g_strdup,
(GCacheDestroyFunc)g_free,
g_str_hash, g_direct_hash, g_str_equal);
theme_pb->pixbuf = g_cache_insert (pixbuf_cache, theme_pb->filename);
if (theme_pb->stretch)
theme_pixbuf_compute_hints (theme_pb);
theme_pb->svg_bytes = g_cache_insert (pixbuf_cache, theme_pb->filename);
}
return theme_pb->pixbuf;
result = get_pixbuf(theme_pb->svg_bytes, width, height);
if(result)
theme_pixbuf_compute_hints(theme_pb, result);
return result;
}
void
......@@ -691,7 +760,7 @@ theme_pixbuf_render (ThemePixbuf *theme_pb,
gint width,
gint height)
{
GdkPixbuf *pixbuf = theme_pixbuf_get_pixbuf (theme_pb);
GdkPixbuf *pixbuf = theme_pixbuf_get_pixbuf (theme_pb, width, height);
gint src_x[4], src_y[4], dest_x[4], dest_y[4];
gint pixbuf_width = gdk_pixbuf_get_width (pixbuf);
gint pixbuf_height = gdk_pixbuf_get_height (pixbuf);
......@@ -804,4 +873,6 @@ theme_pixbuf_render (ThemePixbuf *theme_pb,
gdk_pixmap_unref (tmp_pixmap);
}
}
g_object_unref(G_OBJECT(pixbuf));
}
......@@ -129,14 +129,14 @@ typedef enum {
struct _ThemePixbuf
{
gchar *filename;
GdkPixbuf *pixbuf;
gboolean stretch;
gint border_left;
gint border_right;
gint border_bottom;
gint border_top;
guint hints[3][3];
gchar *filename;
GByteArray *svg_bytes;
gboolean stretch;
gint border_left;
gint border_right;
gint border_bottom;
gint border_top;
guint hints[3][3];
};
struct _ThemeMatchData
......@@ -173,7 +173,7 @@ ThemePixbuf *theme_pixbuf_new (void);
void theme_pixbuf_destroy (ThemePixbuf *theme_pb);
void theme_pixbuf_set_filename (ThemePixbuf *theme_pb,
const char *filename);
GdkPixbuf * theme_pixbuf_get_pixbuf (ThemePixbuf *theme_pb);
GdkPixbuf * theme_pixbuf_get_pixbuf (ThemePixbuf *theme_pb, gint width, gint height);
void theme_pixbuf_set_border (ThemePixbuf *theme_pb,
gint left,
gint right,
......
plugindir = $(libdir)/mozilla/plugins/
if WITH_MOZILLA
......@@ -7,10 +6,12 @@ else
plugin_LTLIBRARIES =
endif
INCLUDES+=$(MOZILLA_CFLAGS) -DBINDIR=\"$(bindir)/\" $(GDK_X11_CFLAGS)
libmozsvgdec_la_SOURCES = moz-plugin.c
libmozsvgdec_la_CFLAGS = $(MOZILLA_CFLAGS) $(X_CFLAGS) -DBINDIR=\"$(bindir)\"
libmozsvgdec_la_LDFLAGS = -module -avoid-version $(X_LIBS)
libmozsvgdec_la_LIBADD = -lXt $(LIBRSVG_LIBS) \
libmozsvgdec_la_LDFLAGS = -module -avoid-version
libmozsvgdec_la_LIBADD = $(LIBRSVG_LIBS) \
$(LIBGSF_LIBS) $(LIBCROCO_LIBS)\
$(top_builddir)/librsvg-2.la
EXTRA_DIST=moz-plugin.c
......@@ -2,7 +2,7 @@
/*
moz-plugin.c: Mozilla plugin
Copyright (C) 2003 Dom Lachowicz <cinamod@hotmail.com>
Copyright (C) 2003-2004 Dom Lachowicz <cinamod@hotmail.com>
Copyright (C) 2003 David Schleef <ds@schleef.org>
This program is free software; you can redistribute it and/or
...