1 --- misc/librsvg-2.32.1/librsvg-features.h 2010-11-13 11:52:49.000000000 +0100
2 +++ misc/build/librsvg-2.32.1/librsvg-features.h 2011-03-28 16:29:01.357827800 +0200
4 (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION > (minor)) || \
5 (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION == (minor) && LIBRSVG_MICRO_VERSION >= (micro)))
7 -#define LIBRSVG_HAVE_SVGZ (1)
8 +#define LIBRSVG_HAVE_SVGZ (0)
9 #define LIBRSVG_HAVE_CSS (1)
11 #define LIBRSVG_CHECK_FEATURE(FEATURE) (defined(LIBRSVG_HAVE_##FEATURE) && LIBRSVG_HAVE_##FEATURE)
12 --- misc/librsvg-2.32.1/rsvg-image.c 2010-09-27 19:18:35.000000000 +0200
13 +++ misc/build/librsvg-2.32.1/rsvg-image.c 2011-03-28 20:14:53.630005800 +0200
15 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA.
18 - Authors: Raph Levien <raph@artofcode.com>,
19 - Dom Lachowicz <cinamod@hotmail.com>,
20 + Authors: Raph Levien <raph@artofcode.com>,
21 + Dom Lachowicz <cinamod@hotmail.com>,
22 Caleb Moore <c.moore@student.unsw.edu.au>
33 +static const char s_UTF8_B64Alphabet[64] = {
34 + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
35 + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, /* A-Z */
36 + 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
37 + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, /* a-z */
38 + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, /* 0-9 */
42 +static const char utf8_b64_pad = 0x3d;
45 +b64_decode_char (char c, int *b64)
47 + if ((c >= 0x41) && (c <= 0x5a)) {
51 + if ((c >= 0x61) && (c <= 0x7a)) {
52 + *b64 = c - (0x61 - 26);
55 + if ((c >= 0x30) && (c <= 0x39)) {
56 + *b64 = c + (52 - 0x30);
71 +utf8_base64_decode (guchar ** binptr, size_t * binlen, const char *b64ptr, size_t b64len)
73 + gboolean decoded = TRUE;
74 + gboolean padding = FALSE;
79 + unsigned char byte1 = 0;
80 + unsigned char byte2;
82 + gunichar ucs4, *ucs4_str;
87 + if ((binptr == 0) || (b64ptr == 0))
90 + ucs4_str = g_utf8_to_ucs4_fast (b64ptr, b64len, &ucs4_len);
92 + for (j = 0; j < ucs4_len; j++) {
94 + if ((ucs4 & 0x7f) == ucs4) {
96 + char c = (char) (ucs4);
98 + if (b64_decode_char (c, &b64)) {
99 + if (padding || (*binlen == 0)) {
106 + byte1 = (unsigned char) (b64) << 2;
110 + byte2 = (unsigned char) (b64);
111 + byte1 |= byte2 >> 4;
112 + *(*binptr)++ = (char) (byte1);
114 + byte1 = (byte2 & 0x0f) << 4;
118 + byte2 = (unsigned char) (b64);
119 + byte1 |= byte2 >> 2;
120 + *(*binptr)++ = (char) (byte1);
122 + byte1 = (byte2 & 0x03) << 6;
126 + byte1 |= (unsigned char) (b64);
127 + *(*binptr)++ = (char) (byte1);
137 + } else if (c == utf8_b64_pad) {
147 + *(*binptr)++ = (char) (byte1);
158 + *(*binptr)++ = (char) (byte1);
172 + if (g_unichar_isspace (ucs4))
184 rsvg_acquire_base64_resource (const char *data, GError ** error)
186 - GByteArray *array = NULL;
187 - gsize data_len, written_len;
193 + size_t buffer_len, buffer_max_len, data_len;
195 rsvg_return_val_if_fail (data != NULL, NULL, error);
200 data_len = strlen (data);
201 - array = g_byte_array_sized_new (data_len / 4 * 3);
202 - written_len = g_base64_decode_step (data, data_len, array->data,
204 - g_byte_array_set_size (array, written_len);
206 + buffer_max_len = ((data_len >> 2) + 1) * 3;
207 + buffer_len = buffer_max_len;
209 + array = g_byte_array_sized_new (buffer_max_len);
210 + bufptr = array->data;
212 + if (!utf8_base64_decode (&bufptr, &buffer_len, data, data_len)) {
213 + g_byte_array_free (array, TRUE);
217 + array->len = buffer_max_len - buffer_len;
222 if (base_filename != NULL) {
223 tmpcdir = g_path_get_dirname (base_filename);
224 g_free (base_filename);
229 tmpcdir = g_get_current_dir ();
234 - gchar *data = NULL;
237 + guchar buffer[4096];
241 rsvg_return_val_if_fail (filename != NULL, NULL, error);
243 @@ -101,20 +264,53 @@
247 - if (!g_file_get_contents (path, &data, &length, error)) {
249 + f = fopen (path, "rb");
253 + g_set_error (error,
255 + g_file_error_from_errno (errno),
256 + _("Failed to open file '%s': %s"), filename, g_strerror (errno));
260 + /* TODO: an optimization is to use the file's size */
261 array = g_byte_array_new ();
263 - g_byte_array_append (array, (guint8 *)data, length);
266 + while (!feof (f)) {
267 + length = fread (buffer, 1, sizeof (buffer), f);
269 + if (g_byte_array_append (array, buffer, length) == NULL) {
271 + g_byte_array_free (array, TRUE);
274 + } else if (ferror (f)) {
276 + g_byte_array_free (array, TRUE);
289 +rsvg_free_error (GError ** err)
293 + g_error_free (*err);
300 rsvg_acquire_vfs_resource (const char *filename, const char *base_uri, GError ** error)
302 @@ -133,19 +329,19 @@
303 if (base_uri != NULL) {
306 - g_clear_error (error);
308 - g_object_unref (file);
309 + rsvg_free_error(error);
311 + g_object_unref (file);
313 base = g_file_new_for_uri (base_uri);
314 file = g_file_resolve_relative_path (base, filename);
315 g_object_unref (base);
317 - res = g_file_load_contents (file, NULL, &data, &size, NULL, error);
318 + res = g_file_load_contents (file, NULL, &data, &size, NULL, error);
322 - g_object_unref (file);
323 + g_object_unref (file);
326 array = g_byte_array_new ();
334 _rsvg_acquire_xlink_href_resource (const char *href, const char *base_uri, GError ** err)
337 arr = rsvg_acquire_file_resource (href, base_uri, NULL);
341 arr = rsvg_acquire_vfs_resource (href, base_uri, NULL);
347 RsvgNodeImage *z = (RsvgNodeImage *) self;
348 rsvg_state_finalize (z->super.state);
349 g_free (z->super.state);
350 - z->super.state = NULL;
352 - g_object_unref (z->img);
353 - _rsvg_node_free(self);
354 + g_object_unref (G_OBJECT (z->img));
361 rsvg_push_discrete_layer (ctx);
363 - if (!rsvg_current_state (ctx)->overflow && (aspect_ratio & RSVG_ASPECT_RATIO_SLICE)) {
364 + if (!rsvg_current_state(ctx)->overflow && (aspect_ratio & RSVG_ASPECT_RATIO_SLICE)) {
365 rsvg_add_clipping_rect (ctx, x, y, w, h);
368 @@ -357,10 +555,11 @@
369 RsvgNodeImage *image;
370 image = g_new (RsvgNodeImage, 1);
371 _rsvg_node_init (&image->super);
372 - g_assert (image->super.state);
374 image->preserve_aspect_ratio = RSVG_ASPECT_RATIO_XMID_YMID;
375 image->x = image->y = image->w = image->h = _rsvg_css_parse_length ("0");
376 + image->super.state = g_new (RsvgState, 1);
377 + rsvg_state_init (image->super.state);
378 image->super.free = rsvg_node_image_free;
379 image->super.draw = rsvg_node_image_draw;
380 image->super.set_atts = rsvg_node_image_set_atts;
381 --- misc/librsvg-2.32.1/config.h 2011-03-28 20:38:20.301880800 +0200
382 +++ misc/build/librsvg-2.32.1/config.h 2011-03-28 20:40:54.958130800 +0200
385 +#define HAVE_FLOAT_H 1
386 +/* #undef ENABLE_XEMBED */
387 +/* #undef HAVE_BASENAME */
388 +/* #undef HAVE_DLFCN_H */
390 +/* #undef HAVE_INTTYPES_H */
391 +/* #undef HAVE_LC_MESSAGES */
392 +#define HAVE_LOCALE_H 1
393 +#define HAVE_MEMORY_H 1
394 +/* #undef HAVE_STDINT_H */
395 +#define HAVE_STDLIB_H 1
396 +/* #undef HAVE_STRINGS_H */
397 +#define HAVE_STRING_H 1
398 +/* #undef HAVE_STRTOK_R */
399 +#define HAVE_SYS_STAT_H 1
400 +#define HAVE_SYS_TYPES_H 1
401 +/* #undef HAVE_UNISTD_H */
403 +#define PACKAGE "librsvg"
404 +#define PACKAGE_BUGREPORT ""
405 +#define PACKAGE_NAME ""
406 +#define PACKAGE_STRING ""
407 +#define PACKAGE_TARNAME ""
408 +#define PACKAGE_VERSION ""
409 +#define VERSION "2.32.1"
410 +#define STDC_HEADERS 1
411 +#define X_DISPLAY_MISSING 1
412 --- misc/librsvg-2.32.1/makefile.mk 2011-03-28 20:38:20.489380800 +0200
413 +++ misc/build/librsvg-2.32.1/makefile.mk 2011-03-28 20:40:38.786255800 +0200
416 +#*************************************************************************
418 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
420 +# Copyright 2000, 2010 Oracle and/or its affiliates.
422 +# OpenOffice.org - a multi-platform office productivity suite
424 +# This file is part of OpenOffice.org.
426 +# OpenOffice.org is free software: you can redistribute it and/or modify
427 +# it under the terms of the GNU Lesser General Public License version 3
428 +# only, as published by the Free Software Foundation.
430 +# OpenOffice.org is distributed in the hope that it will be useful,
431 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
432 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
433 +# GNU Lesser General Public License version 3 for more details
434 +# (a copy is included in the LICENSE file that accompanied this code).
436 +# You should have received a copy of the GNU Lesser General Public License
437 +# version 3 along with OpenOffice.org. If not, see
438 +# <http://www.openoffice.org/license.html>
439 +# for a copy of the LGPLv3 License.
441 +#*************************************************************************
448 +VISIBILITY_HIDDEN=TRUE
449 +EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
451 +# --- Settings ----------------------------------
453 +.INCLUDE : settings.mk
455 +CFLAGS+= -DHAVE_GSF -DHAVE_LIBCROCO \
456 + -I. -I$(SOLARINCDIR)$/external/glib-2.0 \
457 + -I. -I$(SOLARINCDIR)$/external/gdk-pixbuf-2.0 \
458 + -I$(SOLARINCDIR)$/external/pango-1.0 \
459 + -I$(SOLARINCDIR)$/external/cairo \
460 + -I$(SOLARINCDIR)$/external/libgsf-1 \
461 + -I$(SOLARINCDIR)$/external/libcroco-0.6
463 +# --- Files -------------------------------------
466 + $(SLO)$/librsvg-enum-types.obj \
467 + $(SLO)$/librsvg-features.obj \
468 + $(SLO)$/rsvg-affine.obj \
469 + $(SLO)$/rsvg-base-file-util.obj \
470 + $(SLO)$/rsvg-base.obj \
471 + $(SLO)$/rsvg-bpath-util.obj \
472 + $(SLO)$/rsvg-cairo-clip.obj \
473 + $(SLO)$/rsvg-cairo-draw.obj \
474 + $(SLO)$/rsvg-cairo-render.obj \
475 + $(SLO)$/rsvg-cond.obj \
476 + $(SLO)$/rsvg-convert.obj \
477 + $(SLO)$/rsvg-css.obj \
478 + $(SLO)$/rsvg-defs.obj \
479 + $(SLO)$/rsvg-file-util.obj \
480 + $(SLO)$/rsvg-filter.obj \
481 + $(SLO)$/rsvg-gobject.obj \
482 + $(SLO)$/rsvg-image.obj \
483 + $(SLO)$/rsvg-marker.obj \
484 + $(SLO)$/rsvg-mask.obj \
485 + $(SLO)$/rsvg-paint-server.obj \
486 + $(SLO)$/rsvg-path.obj \
487 + $(SLO)$/rsvg-shapes.obj \
488 + $(SLO)$/rsvg-structure.obj \
489 + $(SLO)$/rsvg-styles.obj \
490 + $(SLO)$/rsvg-text.obj \
491 + $(SLO)$/rsvg-xml.obj \
494 +# --- Library -----------------------------------
496 +SHL1TARGET= $(TARGET)
497 +SHL1OBJS=$(SLOFILES)
505 + gdk_pixbuf-2.0.lib \
509 + libcroco-0.6-3.lib \
513 +SHL1IMPLIB= i$(TARGET)
514 +SHL1DEF= $(MISC)$/$(SHL1TARGET).def
515 +DEF1NAME= $(SHL1TARGET)
516 +DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt $(SLB)$/$(TARGET).lib
517 +DEFLIB1NAME= $(TARGET)
519 +# --- Targets ----------------------------------
521 +.INCLUDE : target.mk
523 +# --- filter file ------------------------------
525 +$(MISC)$/$(SHL1TARGET).flt: makefile.mk
526 + @echo CLEAR_THE_FILE > $@