diff -Nru wxsvg-1.4~dfsg/aclocal.m4 wxsvg-1.5.4/aclocal.m4 --- wxsvg-1.4~dfsg/aclocal.m4 2014-05-24 14:22:41.000000000 +0000 +++ wxsvg-1.5.4/aclocal.m4 2015-03-21 19:28:57.000000000 +0000 @@ -180,6 +180,61 @@ fi[]dnl ])# PKG_CHECK_MODULES + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR + # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -733,7 +788,8 @@ END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further diff -Nru wxsvg-1.4~dfsg/ChangeLog wxsvg-1.5.4/ChangeLog --- wxsvg-1.4~dfsg/ChangeLog 2014-05-24 13:03:49.000000000 +0000 +++ wxsvg-1.5.4/ChangeLog 2015-03-21 16:28:23.000000000 +0000 @@ -1,3 +1,41 @@ +Version 1.5.4 <2015-03-21> +-------------------------- + + * added support of 3-digit hex color codes (thanks to Constantine) + +Version 1.5.3 <2015-01-18> +-------------------------- + + * applied patch from Sebastian Vater to fix memory leak + +Version 1.5.2 <2014-12-14> +-------------------------- + + * fixed memory leak (thanks to Sebastian Vater) + +Version 1.5.1 <2014-11-23> +-------------------------- + + * fixed some compiler errors + +Version 1.5 <2014-08-09> +------------------------ + + * added support of marker element + * added support of patternTransform attribute + +Version 1.4.2 <2014-07-06> +-------------------------- + + * added support of stroke-dasharray + * fixed handling of preserveAspectRatio="none" + +Version 1.4.1 <2014-06-16> +-------------------------- + + * fixed rendering of tspan-element + * fixed rendering of use element in pattern and mask elements + Version 1.4 <2014-05-24> ------------------------ diff -Nru wxsvg-1.4~dfsg/config.guess wxsvg-1.5.4/config.guess --- wxsvg-1.4~dfsg/config.guess 2014-05-24 14:22:42.000000000 +0000 +++ wxsvg-1.5.4/config.guess 2015-03-21 19:28:58.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -826,7 +826,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +969,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1260,16 +1260,26 @@ if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1361,154 +1371,6 @@ exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='wxsvg' PACKAGE_TARNAME='wxsvg' -PACKAGE_VERSION='1.4' -PACKAGE_STRING='wxsvg 1.4' +PACKAGE_VERSION='1.5.4' +PACKAGE_STRING='wxsvg 1.5.4' PACKAGE_BUGREPORT='wx-svg-users@lists.sourceforge.net' PACKAGE_URL='' @@ -1366,7 +1366,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures wxsvg 1.4 to adapt to many kinds of systems. +\`configure' configures wxsvg 1.5.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1436,7 +1436,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of wxsvg 1.4:";; + short | recursive ) echo "Configuration of wxsvg 1.5.4:";; esac cat <<\_ACEOF @@ -1569,7 +1569,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -wxsvg configure 1.4 +wxsvg configure 1.5.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2090,7 +2090,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by wxsvg $as_me 1.4, which was +It was created by wxsvg $as_me 1.5.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2954,7 +2954,7 @@ # Define the identity of the package. PACKAGE='wxsvg' - VERSION='1.4' + VERSION='1.5.4' cat >>confdefs.h <<_ACEOF @@ -3047,6 +3047,7 @@ fi fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. @@ -3078,7 +3079,7 @@ # 4. If any interfaces have been added since the last public release, then increment age. # 5. If any interfaces have been removed since the last public release then set age to 0. -LIBRARY_VERSION=9:1:7 # current:revision:age -> libwxsvg.so.(C-A).(A).(R) +LIBRARY_VERSION=11:3:8 # current:revision:age -> libwxsvg.so.(C-A).(A).(R) # options @@ -16894,7 +16895,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by wxsvg $as_me 1.4, which was +This file was extended by wxsvg $as_me 1.5.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16951,7 +16952,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -wxsvg config.status 1.4 +wxsvg config.status 1.5.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wxsvg-1.4~dfsg/configure.ac wxsvg-1.5.4/configure.ac --- wxsvg-1.4~dfsg/configure.ac 2014-05-24 13:03:49.000000000 +0000 +++ wxsvg-1.5.4/configure.ac 2015-03-21 16:28:23.000000000 +0000 @@ -2,7 +2,7 @@ # initialization AC_PREREQ(2.57) -AC_INIT([wxsvg], [1.4], [wx-svg-users@lists.sourceforge.net]) +AC_INIT([wxsvg], [1.5.4], [wx-svg-users@lists.sourceforge.net]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE(foreign) AM_MAINTAINER_MODE @@ -15,7 +15,7 @@ # 4. If any interfaces have been added since the last public release, then increment age. # 5. If any interfaces have been removed since the last public release then set age to 0. -LIBRARY_VERSION=9:1:7 # current:revision:age -> libwxsvg.so.(C-A).(A).(R) +LIBRARY_VERSION=11:3:8 # current:revision:age -> libwxsvg.so.(C-A).(A).(R) AC_SUBST(LIBRARY_VERSION) # options @@ -126,7 +126,7 @@ AC_SUBST(WX_CONFIG_NAME) # create Makefiles -AC_OUTPUT([ +AC_CONFIG_FILES([ Makefile libwxsvg.pc include/Makefile @@ -137,3 +137,4 @@ src/cairo/Makefile svgview/Makefile ]) +AC_OUTPUT diff -Nru wxsvg-1.4~dfsg/.cvsignore wxsvg-1.5.4/.cvsignore --- wxsvg-1.4~dfsg/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/.cvsignore 2014-03-10 12:21:24.000000000 +0000 @@ -0,0 +1,24 @@ +Makefile +Makefile.in +*.cache +config.* +configure +cfg*.sh +build*.sh +.settings +site +tmp +aclocal.m4 +ltmain.sh +libtool +wxSVG.layout +Makefile.win +ltmain.sh.lnk +.project +*.bz2 +ftp.sh +README.txt +libwxsvg.pc +.pydevproject +libwxsvg.a +compile diff -Nru wxsvg-1.4~dfsg/debian/changelog wxsvg-1.5.4/debian/changelog --- wxsvg-1.4~dfsg/debian/changelog 2014-09-14 14:43:25.000000000 +0000 +++ wxsvg-1.5.4/debian/changelog 2015-05-04 00:38:48.000000000 +0000 @@ -1,3 +1,22 @@ +wxsvg (3:1.5.4-1~trusty) trusty; urgency=medium + + * New release + * Use libav11 + + -- Doug McMahon Sat, 02 May 2015 09:56:57 -0400 + +wxsvg (2:1.4~dfsg-2+ppa4) trusty; urgency=medium + + * Fix control + + -- Doug McMahon Sat, 02 May 2015 08:39:39 -0400 + +wxsvg (2:1.4~dfsg-2+ppa3) trusty; urgency=medium + + * Use ffmpeg + + -- Doug McMahon Sat, 02 May 2015 00:15:11 -0400 + wxsvg (2:1.4~dfsg-2+ppa2) trusty; urgency=medium * Rebuild for libav11 diff -Nru wxsvg-1.4~dfsg/debian/control wxsvg-1.5.4/debian/control --- wxsvg-1.4~dfsg/debian/control 2014-06-24 18:14:34.000000000 +0000 +++ wxsvg-1.5.4/debian/control 2015-05-04 00:37:58.000000000 +0000 @@ -1,79 +1,43 @@ Source: wxsvg Section: libs Priority: optional -Maintainer: Debian Multimedia Maintainers -Uploaders: - Alessio Treglia , - Fabrice Coutadeur -Build-Depends: - debhelper (>= 9), - dh-autoreconf, - libavcodec-dev, - libavformat-dev, - libavutil-dev, - libexpat-dev, - libpango1.0-dev (>= 1.20.2), - libswscale-dev, - libtool, - libwxgtk3.0-dev, - pkg-config, - python-scour +Maintainer: Doug McMahon +Homepage: http://www.wxsvg.org/ Standards-Version: 3.9.5 -Vcs-Git: git://anonscm.debian.org/pkg-multimedia/wxsvg.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/wxsvg.git -Homepage: http://wxsvg.sourceforge.net/ +Build-Depends: debhelper (>= 9), libpango1.0-dev, quilt, + libswscale-dev, libavcodec-dev, libavformat-dev, libexpat1-dev, + libwxgtk3.0-dev -Package: libwxsvg2 +Package: libwxsvg3 Architecture: any Multi-Arch: same -Breaks: - libwxsvg0 (= 2:1.3~dfsg-1) -Replaces: - libwxsvg0 (= 2:1.3~dfsg-1) Pre-Depends: ${misc:Pre-Depends} -Depends: - ${misc:Depends}, - ${shlibs:Depends} -Description: SVG library for the wxWidgets toolkit - wxSVG is a C++ library to create, manipulate and render - Scalable Vector Graphics (SVG) files with the wxWidgets - toolkit. +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: C++ library to create, manipulate and render SVG files + C++ library to create, manipulate and render SVG files, (not the same + description). . - This package contains the shared library. + Shared library. Package: libwxsvg-dev Architecture: any Multi-Arch: same Section: libdevel -Depends: - libart-2.0-dev, - libavcodec-dev, - libavformat-dev, - libexpat-dev, - libpango1.0-dev, - libswscale-dev, - libwxgtk3.0-dev, - libwxsvg2 (= ${binary:Version}), - pkg-config, - ${misc:Depends} -Description: Development files for wxSVG - wxSVG is a C++ library to create, manipulate and render - Scalable Vector Graphics (SVG) files with the wxWidgets - toolkit. +Depends: libwxsvg3 (= ${binary:Version}), ${misc:Depends}, libwxgtk3.0-dev +Description: C++ library to create, manipulate and render SVG files + C++ library to create, manipulate and render SVG files, (not the same + description). . - This package contains the development files. + Development files. Package: libwxsvg-dbg Architecture: any Multi-Arch: same Priority: extra Section: debug -Depends: - libwxsvg2 (= ${binary:Version}), - ${misc:Depends} +Depends: libwxsvg3 (= ${binary:Version}), ${misc:Depends} Description: Debugging symbols for wxSVG - wxSVG is a C++ library to create, manipulate and render - Scalable Vector Graphics (SVG) files with the wxWidgets - toolkit. + wxSVG is a C++ library to create, manipulate and render Scalable Vector + Graphics (SVG) files with the wxWidgets toolkit. . This package contains the debugging symbols. diff -Nru wxsvg-1.4~dfsg/debian/copyright wxsvg-1.5.4/debian/copyright --- wxsvg-1.4~dfsg/debian/copyright 2014-04-15 14:33:48.000000000 +0000 +++ wxsvg-1.5.4/debian/copyright 2015-05-02 13:14:42.000000000 +0000 @@ -1,75 +1,56 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: wxSVG -Upstream-Contact: Alex Thuering -Source: http://sourceforge.net/projects/wxsvg/files/ - -Files: * -Copyright: - 2005-2014 Alex Thuering - 2000 Vaclav Slavik - 2005 Edouard TISSERANT - 2005 Jonathan Hurtrel -License: wxWindows - -Files: debian/* -Copyright: 2011-2014 Alessio Treglia -License: GPL-2+ - -License: wxWindows - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public Licence as published by - the Free Software Foundation; either version 2 of the Licence, or (at - your option) any later version. - . - This library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library - General Public Licence for more details. - . - You should have received a copy of the GNU Library General Public Licence - along with this software, usually in a file named COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - Boston, MA 02110-1301 USA. - . - EXCEPTION NOTICE - . - 1. As a special exception, the copyright holders of this library give - permission for additional uses of the text contained in this release of - the library as licenced under the wxWindows Library Licence, applying - either version 3.1 of the Licence, or (at your option) any later version of - the Licence as published by the copyright holders of version - 3.1 of the Licence document. - . - 2. The exception is that you may use, copy, link, modify and distribute - under your own terms, binary object code versions of works based - on the Library. - . - 3. If you copy code from files distributed under the terms of the GNU - General Public Licence or the GNU Library General Public Licence into a - copy of this library, as this licence permits, the exception does not - apply to the code that you add in this way. To avoid misleading anyone as - to the status of such modified files, you must delete this exception - notice from such code and/or adjust the licensing conditions notice - accordingly. - . - 4. If you write modifications of your own for this library, it is your - choice whether to permit this exception to apply to your modifications. - If you do not wish that, you must delete the exception notice from such - code and/or adjust the licensing conditions notice accordingly. - -License: GPL-2+ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - On Debian systems, the complete text of the GNU General Public - License can be found in `/usr/share/common-licenses/GPL-2'. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . +This package was debianized by Christian Marillat on +Wed, 14 Jun 2006 17:32:03 +0200. + +It was downloaded from http://wxsvg.sourceforge.net/ + +Upstream Author: Alex Thuering + +Copyright: 2005-2006 Alex Thuering + +License: + wxWindows Library Licence, Version 3.1 + ====================================== + + Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + WXWINDOWS LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth + Floor, Boston, MA 02110-1301, USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxWindows Library Licence, applying + either version 3.1 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version + 3.1 of the Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under your own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. diff -Nru wxsvg-1.4~dfsg/debian/gbp.conf wxsvg-1.5.4/debian/gbp.conf --- wxsvg-1.4~dfsg/debian/gbp.conf 2014-04-15 14:17:54.000000000 +0000 +++ wxsvg-1.5.4/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -[DEFAULT] -pristine-tar = True -compression = bzip2 diff -Nru wxsvg-1.4~dfsg/debian/install wxsvg-1.5.4/debian/install --- wxsvg-1.4~dfsg/debian/install 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/debian/install 2015-05-02 13:14:42.000000000 +0000 @@ -0,0 +1,2 @@ +usr/bin +usr/lib/*/libwxsvg.so.* diff -Nru wxsvg-1.4~dfsg/debian/libwxsvg2.install wxsvg-1.5.4/debian/libwxsvg2.install --- wxsvg-1.4~dfsg/debian/libwxsvg2.install 2014-06-15 13:38:31.000000000 +0000 +++ wxsvg-1.5.4/debian/libwxsvg2.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/*/*.so.* diff -Nru wxsvg-1.4~dfsg/debian/libwxsvg-dev.install wxsvg-1.5.4/debian/libwxsvg-dev.install --- wxsvg-1.4~dfsg/debian/libwxsvg-dev.install 2014-04-15 14:17:54.000000000 +0000 +++ wxsvg-1.5.4/debian/libwxsvg-dev.install 2015-05-02 13:14:42.000000000 +0000 @@ -1,3 +1,3 @@ usr/include -usr/lib/*/*.so +usr/lib/*/libwxsvg.so usr/lib/*/pkgconfig diff -Nru wxsvg-1.4~dfsg/debian/patches/01_configure.diff wxsvg-1.5.4/debian/patches/01_configure.diff --- wxsvg-1.4~dfsg/debian/patches/01_configure.diff 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/debian/patches/01_configure.diff 2015-05-02 13:14:42.000000000 +0000 @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -15985,7 +15985,7 @@ $as_echo_n "checking for wxWidgets versi + if test -n "$wx_ver_ok"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5 + $as_echo "yes (version $WX_VERSION)" >&6; } +- WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs ` ++ WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs core base ` + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5 + $as_echo_n "checking for wxWidgets static library... " >&6; } diff -Nru wxsvg-1.4~dfsg/debian/patches/libav10.patch wxsvg-1.5.4/debian/patches/libav10.patch --- wxsvg-1.4~dfsg/debian/patches/libav10.patch 2014-06-15 13:41:47.000000000 +0000 +++ wxsvg-1.5.4/debian/patches/libav10.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Description: Fix build failure with libav 10 -Author: Anton Khirnov -Bug-Debian: https://bugs.debian.org/739454 -Reviewed-by: Alessio Treglia -Last-Update: 2014-04-15 ---- - src/mediadec_ffmpeg.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- wxsvg.orig/src/mediadec_ffmpeg.cpp -+++ wxsvg/src/mediadec_ffmpeg.cpp -@@ -116,11 +116,11 @@ float wxFfmpegMediaDecoder::GetFps() { - float result = -1; - for (unsigned int i = 0; i < m_formatCtx->nb_streams; i++) { - AVStream* st = m_formatCtx->streams[i]; -- if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->r_frame_rate.num && st->r_frame_rate.den) { -- if (st->r_frame_rate.num > st->r_frame_rate.den) -- result = ((float) st->r_frame_rate.num) / st->r_frame_rate.den; -+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->avg_frame_rate.num && st->avg_frame_rate.den) { -+ if (st->avg_frame_rate.num > st->avg_frame_rate.den) -+ result = ((float) st->avg_frame_rate.num) / st->avg_frame_rate.den; - else -- result = ((float) st->r_frame_rate.den) / st->r_frame_rate.num; -+ result = ((float) st->avg_frame_rate.den) / st->avg_frame_rate.num; - break; - } - } diff -Nru wxsvg-1.4~dfsg/debian/patches/series wxsvg-1.5.4/debian/patches/series --- wxsvg-1.4~dfsg/debian/patches/series 2014-04-15 14:17:54.000000000 +0000 +++ wxsvg-1.5.4/debian/patches/series 2015-05-02 13:14:42.000000000 +0000 @@ -1 +1 @@ -libav10.patch +01_configure.diff diff -Nru wxsvg-1.4~dfsg/debian/README.source wxsvg-1.5.4/debian/README.source --- wxsvg-1.4~dfsg/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/debian/README.source 2015-05-02 13:14:42.000000000 +0000 @@ -0,0 +1,2 @@ + +See /usr/share/doc/quilt/README.source diff -Nru wxsvg-1.4~dfsg/debian/rules wxsvg-1.5.4/debian/rules --- wxsvg-1.4~dfsg/debian/rules 2014-06-15 13:38:31.000000000 +0000 +++ wxsvg-1.5.4/debian/rules 2015-05-02 13:56:47.000000000 +0000 @@ -1,29 +1,19 @@ #!/usr/bin/make -f -DEBIAN_DIR := $(shell echo ${MAKEFILE_LIST} | awk '{print $$1}' | xargs dirname ) -UPSTREAM_VERSION ?=$(shell uscan --dehs | sed -n 's/.*\(.*\)<\/upstream-version>.*/\1/p') -PACKAGE = wxsvg -LDFLAGS+=-Wl,--as-needed +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: - dh $@ --parallel --with=autoreconf,scour + dh $@ --parallel override_dh_auto_configure: - dh_auto_configure -- --enable-static=no + dh_auto_configure -- \ + --enable-static=no + +override_dh_install: + dh_install --fail-missing -X.la -Xsvgview override_dh_strip: dh_strip --dbg-package=libwxsvg-dbg -get-orig-source: - cd $(DEBIAN_DIR)/.. && uscan --force-download --rename - tar xf ../$(PACKAGE)_$(UPSTREAM_VERSION).orig.tar.bz2 - rm ../$(PACKAGE)_$(UPSTREAM_VERSION).orig.tar.bz2 - tar cf ../$(PACKAGE)_$(UPSTREAM_VERSION)~dfsg.orig.tar \ - --exclude=pywxsvg \ - --exclude=share \ - --exclude=scripts \ - --exclude=debian \ - --exclude-vcs \ - $(PACKAGE)-$(UPSTREAM_VERSION) - bzip2 -9f ../$(PACKAGE)_$(UPSTREAM_VERSION)~dfsg.orig.tar - rm -r $(PACKAGE)-$(UPSTREAM_VERSION) +override_dh_makeshlibs: + dh_makeshlibs -V diff -Nru wxsvg-1.4~dfsg/debian/watch wxsvg-1.5.4/debian/watch --- wxsvg-1.4~dfsg/debian/watch 2014-04-15 14:17:54.000000000 +0000 +++ wxsvg-1.5.4/debian/watch 2015-05-02 13:14:42.000000000 +0000 @@ -1,3 +1,6 @@ version=3 -opts=dversionmangle=s/~dfsg[0-9]*//,uversionmangle=s/-/./ \ -http://sf.net/wxsvg/wxsvg-([\d\.-]+)\.tar\.bz2 + +#opts="uversionmangle=s/b/~b/" + +opts="uversionmangle=s/_1//" \ +http://sf.net/wxsvg/wxsvg-(.*)\.tar\.bz2 diff -Nru wxsvg-1.4~dfsg/include/.cvsignore wxsvg-1.5.4/include/.cvsignore --- wxsvg-1.4~dfsg/include/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/include/.cvsignore 2006-01-08 19:52:00.000000000 +0000 @@ -0,0 +1,3 @@ +Makefile +Makefile.in + diff -Nru wxsvg-1.4~dfsg/include/wxSVG/CSSStyleDeclaration.h wxsvg-1.5.4/include/wxSVG/CSSStyleDeclaration.h --- wxsvg-1.4~dfsg/include/wxSVG/CSSStyleDeclaration.h 2014-03-27 08:39:32.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/CSSStyleDeclaration.h 2014-06-30 19:07:49.000000000 +0000 @@ -907,22 +907,22 @@ } - inline const wxCSSPrimitiveValue& GetStrokeDasharray() const + inline const wxCSSValueList& GetStrokeDasharray() const { const_iterator it = find(wxCSS_PROPERTY_STROKE_DASHARRAY); - return it != end() ? ((wxCSSPrimitiveValue&)*it->second) : *s_emptyCSSValue; + return it != end() ? ((wxCSSValueList&)*it->second) : *s_emptyValueList; } inline bool HasStrokeDasharray() const { return HasProperty(wxCSS_PROPERTY_STROKE_DASHARRAY); } - inline void SetStrokeDasharray(const wxCSSPrimitiveValue& value) + inline void SetStrokeDasharray(const wxCSSValueList& value) { iterator it = find(wxCSS_PROPERTY_STROKE_DASHARRAY); if (it != end()) { delete it->second; - it->second = new wxCSSPrimitiveValue(value); + it->second = new wxCSSValueList(value); } else - (*this)[wxCSS_PROPERTY_STROKE_DASHARRAY] = new wxCSSPrimitiveValue(value); + (*this)[wxCSS_PROPERTY_STROKE_DASHARRAY] = new wxCSSValueList(value); } @@ -1142,6 +1142,7 @@ static wxSVGColor* s_emptySVGColor; static wxSVGPaint* s_emptySVGPaint; static wxSVGPaint* s_blackSVGPaint; + static wxCSSValueList* s_emptyValueList; public: static double ParseNumber(const wxString& value); diff -Nru wxsvg-1.4~dfsg/include/wxSVG/CSSValue.h wxsvg-1.5.4/include/wxSVG/CSSValue.h --- wxsvg-1.4~dfsg/include/wxSVG/CSSValue.h 2005-11-06 17:31:36.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/CSSValue.h 2014-06-30 19:06:11.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/05/03 -// RCS-ID: $Id: CSSValue.h,v 1.9 2005/11/06 17:31:36 ntalex Exp $ +// RCS-ID: $Id: CSSValue.h,v 1.10 2014/06/30 19:06:11 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -15,9 +15,9 @@ #include #include "RGBColor.h" #include "CSSValues.h" +#include -enum wxCSS_VALUE_TYPE -{ +enum wxCSS_VALUE_TYPE { wxCSS_INHERIT = 0, wxCSS_PRIMITIVE_VALUE, wxCSS_VALUE_LIST, @@ -26,12 +26,11 @@ wxCSS_CUSTOM = 3 }; -class wxCSSValue -{ - protected: +class wxCSSValue { +protected: wxCSS_VALUE_TYPE m_cssValueType; - public: +public: wxCSSValue(): m_cssValueType(wxCSS_INHERIT) {} wxCSSValue(wxCSS_VALUE_TYPE cssValueType): m_cssValueType(cssValueType) {} virtual ~wxCSSValue() {} @@ -42,13 +41,12 @@ virtual wxString GetCSSText() const = 0; virtual wxCSSValue* Clone() const = 0; - public: +public: static wxCSS_VALUE GetValueId(wxString value); static wxString GetValueString(wxCSS_VALUE value); }; -enum wxCSS_PRIMITIVE_TYPE -{ +enum wxCSS_PRIMITIVE_TYPE { wxCSS_UNKNOWN = 0, wxCSS_NUMBER = 1, wxCSS_PERCENTAGE = 2, @@ -77,12 +75,10 @@ wxCSS_RGBCOLOR = 25 }; -class wxCSSPrimitiveValue: public wxCSSValue -{ - protected: +class wxCSSPrimitiveValue: public wxCSSValue { +protected: wxCSS_PRIMITIVE_TYPE m_primitiveType; - union - { + union { wxCSS_VALUE m_ident; double m_number; wxString* m_string; @@ -90,7 +86,7 @@ wxRGBColor* m_color; }; - public: +public: wxCSSPrimitiveValue(): wxCSSValue(wxCSS_PRIMITIVE_VALUE), m_primitiveType(wxCSS_UNKNOWN) {} wxCSSPrimitiveValue(double value): wxCSSValue(wxCSS_PRIMITIVE_VALUE), @@ -105,12 +101,12 @@ m_primitiveType(wxCSS_IDENT), m_ident(value) {} wxCSSPrimitiveValue(const wxCSSPrimitiveValue& src); ~wxCSSPrimitiveValue() { CleanUp(); } - wxCSSValue* Clone() const { return new wxCSSPrimitiveValue(*this); } + virtual wxCSSValue* Clone() const { return new wxCSSPrimitiveValue(*this); } inline wxCSS_PRIMITIVE_TYPE GetCSSPrimitiveType() const { return m_primitiveType; } inline void SetCSSPrimitiveType(wxCSS_PRIMITIVE_TYPE primitiveType) { m_primitiveType = primitiveType; } - wxString GetCSSText() const; + virtual wxString GetCSSText() const; void SetStringValue(wxCSS_PRIMITIVE_TYPE stringType, const wxString& stringValue); wxString GetStringValue() const; @@ -127,9 +123,26 @@ void SetIdentValue(wxCSS_VALUE ident); wxCSS_VALUE GetIdentValue() const; - protected: +protected: void CleanUp(); }; +class wxCSSValueList: public wxCSSValue { +protected: + std::vector m_values; + +public: + wxCSSValueList() {} + wxCSSValueList(const std::vector& values): m_values(values) {} + wxCSSValueList(const wxCSSValueList& src); + virtual ~wxCSSValueList() {} + virtual wxCSSValue* Clone() const { return new wxCSSValueList(*this); } + virtual wxString GetCSSText() const; + virtual void SetCSSText(const wxString& value); + + int GetLength() const { return m_values.size(); } + wxCSSPrimitiveValue Item(int index) const { return wxCSSPrimitiveValue(m_values[index]); } +}; + #endif //wxSVG_CSS_VALUE_H diff -Nru wxsvg-1.4~dfsg/include/wxSVG/.cvsignore wxsvg-1.5.4/include/wxSVG/.cvsignore --- wxsvg-1.4~dfsg/include/wxSVG/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/.cvsignore 2006-01-08 19:52:00.000000000 +0000 @@ -0,0 +1,3 @@ +Makefile +Makefile.in + diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGCanvas.h wxsvg-1.5.4/include/wxSVG/SVGCanvas.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGCanvas.h 2014-05-24 13:03:49.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGCanvas.h 2014-08-09 11:13:55.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: wxSVGCanvas - Base class for SVG renders (backends) // Author: Alex Thuering // Created: 2005/05/02 -// RCS-ID: $Id: SVGCanvas.h,v 1.15 2014/05/24 13:03:49 ntalex Exp $ +// RCS-ID: $Id: SVGCanvas.h,v 1.16 2014/08/09 11:13:55 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -71,6 +71,7 @@ virtual void DrawCanvasText(wxSVGCanvasText& canvasText, wxSVGMatrix& matrix, const wxCSSStyleDeclaration& style, wxSVGSVGElement& svgElem); wxSVGPatternElement* GetPatternElement(const wxSVGSVGElement& svgElem, const wxString& href); + wxSVGMarkerElement* GetMarkerElement(const wxSVGSVGElement& svgElem, const wxString& href); wxSVGGradientElement* GetGradientElement(const wxSVGSVGElement& svgElem, const wxString& href); unsigned int GetGradientStops(const wxSVGSVGElement& svgElem, wxSVGGradientElement* gradElem, float opacity); virtual void SetStopValue(unsigned int index, float offset, float opacity, const wxRGBColor& RGBColor) = 0; diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGCanvasItem.h wxsvg-1.5.4/include/wxSVG/SVGCanvasItem.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGCanvasItem.h 2013-08-25 12:53:34.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGCanvasItem.h 2014-08-09 11:14:34.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Canvas items // Author: Alex Thuering // Created: 2005/05/09 -// RCS-ID: $Id: SVGCanvasItem.h,v 1.25 2013/08/25 12:53:34 ntalex Exp $ +// RCS-ID: $Id: SVGCanvasItem.h,v 1.26 2014/08/09 11:14:34 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -13,6 +13,9 @@ #include "svg.h" #include +#include + +using std::vector; enum wxSVGCanvasItemType { wxSVG_CANVAS_ITEM_PATH, @@ -21,9 +24,20 @@ wxSVG_CANVAS_ITEM_VIDEO }; + +struct wxSVGMark { + enum Type { + START, MID, END + }; + + double x, y, angle; + Type type; + + wxSVGMark(double aX, double aY, double aAngle, Type aType): x(aX), y(aY), angle(aAngle), type(aType) {} +}; + /** Base class for canvas items */ -class wxSVGCanvasItem -{ +class wxSVGCanvasItem { public: wxSVGCanvasItem(wxSVGCanvasItemType type) { m_type = type; } virtual ~wxSVGCanvasItem() {} @@ -72,7 +86,11 @@ inline void SetFill(bool fill = true) { m_fill = fill; } inline bool GetFill() { return m_fill; } + /** returns the marker points */ + virtual vector GetMarkPoints(); + protected: + wxSVGElement* m_element; bool m_fill; /* define, if a path can be filled (disabled for line) */ double m_curx, m_cury, m_cubicx, m_cubicy, m_quadx, m_quady, m_begx, m_begy; virtual void MoveToImpl(double x, double y) = 0; diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGLocatable.h wxsvg-1.5.4/include/wxSVG/SVGLocatable.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGLocatable.h 2007-10-30 21:59:22.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGLocatable.h 2014-08-09 11:13:02.000000000 +0000 @@ -42,7 +42,7 @@ static wxSVGMatrix GetCTM(const wxSVGElement* element); static wxSVGMatrix GetScreenCTM(const wxSVGElement* element); static wxSVGMatrix GetParentMatrix(const wxSVGElement* element); - virtual wxSVGMatrix GetTransformToElement(const wxSVGElement& element); + virtual wxSVGMatrix GetTransformToElement(const wxSVGElement& element) const; protected: static wxSVGRect GetChildrenBBox(const wxSVGElement* element, wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER); diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGMatrix.h wxsvg-1.5.4/include/wxSVG/SVGMatrix.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGMatrix.h 2005-06-17 13:24:05.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGMatrix.h 2014-08-09 11:13:02.000000000 +0000 @@ -43,17 +43,17 @@ wxSVGMatrix(double a, double b, double c, double d, double e, double f): m_a(a), m_b(b), m_c(c), m_d(d), m_e(e), m_f(f) {} virtual ~wxSVGMatrix() {} - virtual wxSVGMatrix Multiply(const wxSVGMatrix& secondMatrix); - virtual wxSVGMatrix Inverse(); - virtual wxSVGMatrix Translate(double x, double y); - virtual wxSVGMatrix Scale(double scaleFactor); - virtual wxSVGMatrix ScaleNonUniform(double scaleFactorX, double scaleFactorY); - virtual wxSVGMatrix Rotate(double angle); - virtual wxSVGMatrix RotateFromVector(double x, double y); - virtual wxSVGMatrix FlipX(); - virtual wxSVGMatrix FlipY(); - virtual wxSVGMatrix SkewX(double angle); - virtual wxSVGMatrix SkewY(double angle); + virtual wxSVGMatrix Multiply(const wxSVGMatrix& secondMatrix) const; + virtual wxSVGMatrix Inverse() const; + virtual wxSVGMatrix Translate(double x, double y) const; + virtual wxSVGMatrix Scale(double scaleFactor) const; + virtual wxSVGMatrix ScaleNonUniform(double scaleFactorX, double scaleFactorY) const; + virtual wxSVGMatrix Rotate(double angle) const; + virtual wxSVGMatrix RotateFromVector(double x, double y) const; + virtual wxSVGMatrix FlipX() const; + virtual wxSVGMatrix FlipY() const; + virtual wxSVGMatrix SkewX(double angle) const; + virtual wxSVGMatrix SkewY(double angle) const; }; #endif // WX_SVG_MATRIX_H diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGPathElement.h wxsvg-1.5.4/include/wxSVG/SVGPathElement.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGPathElement.h 2014-03-27 08:39:32.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGPathElement.h 2014-08-09 11:13:02.000000000 +0000 @@ -81,25 +81,25 @@ virtual double GetTotalLength(); virtual wxSVGPoint GetPointAtLength(double distance); virtual unsigned long GetPathSegAtLength(double distance); - virtual wxSVGPathSegClosePath CreateSVGPathSegClosePath(); - virtual wxSVGPathSegMovetoAbs CreateSVGPathSegMovetoAbs(double x, double y); - virtual wxSVGPathSegMovetoRel CreateSVGPathSegMovetoRel(double x, double y); - virtual wxSVGPathSegLinetoAbs CreateSVGPathSegLinetoAbs(double x, double y); - virtual wxSVGPathSegLinetoRel CreateSVGPathSegLinetoRel(double x, double y); - virtual wxSVGPathSegCurvetoCubicAbs CreateSVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2); - virtual wxSVGPathSegCurvetoCubicRel CreateSVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2); - virtual wxSVGPathSegCurvetoQuadraticAbs CreateSVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1); - virtual wxSVGPathSegCurvetoQuadraticRel CreateSVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1); - virtual wxSVGPathSegArcAbs CreateSVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag); - virtual wxSVGPathSegArcRel CreateSVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag); - virtual wxSVGPathSegLinetoHorizontalAbs CreateSVGPathSegLinetoHorizontalAbs(double x); - virtual wxSVGPathSegLinetoHorizontalRel CreateSVGPathSegLinetoHorizontalRel(double x); - virtual wxSVGPathSegLinetoVerticalAbs CreateSVGPathSegLinetoVerticalAbs(double y); - virtual wxSVGPathSegLinetoVerticalRel CreateSVGPathSegLinetoVerticalRel(double y); - virtual wxSVGPathSegCurvetoCubicSmoothAbs CreateSVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2); - virtual wxSVGPathSegCurvetoCubicSmoothRel CreateSVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2); - virtual wxSVGPathSegCurvetoQuadraticSmoothAbs CreateSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y); - virtual wxSVGPathSegCurvetoQuadraticSmoothRel CreateSVGPathSegCurvetoQuadraticSmoothRel(double x, double y); + virtual wxSVGPathSegClosePath CreateSVGPathSegClosePath() const; + virtual wxSVGPathSegMovetoAbs CreateSVGPathSegMovetoAbs(double x, double y) const; + virtual wxSVGPathSegMovetoRel CreateSVGPathSegMovetoRel(double x, double y) const; + virtual wxSVGPathSegLinetoAbs CreateSVGPathSegLinetoAbs(double x, double y) const; + virtual wxSVGPathSegLinetoRel CreateSVGPathSegLinetoRel(double x, double y) const; + virtual wxSVGPathSegCurvetoCubicAbs CreateSVGPathSegCurvetoCubicAbs(double x, double y, double x1, double y1, double x2, double y2) const; + virtual wxSVGPathSegCurvetoCubicRel CreateSVGPathSegCurvetoCubicRel(double x, double y, double x1, double y1, double x2, double y2) const; + virtual wxSVGPathSegCurvetoQuadraticAbs CreateSVGPathSegCurvetoQuadraticAbs(double x, double y, double x1, double y1) const; + virtual wxSVGPathSegCurvetoQuadraticRel CreateSVGPathSegCurvetoQuadraticRel(double x, double y, double x1, double y1) const; + virtual wxSVGPathSegArcAbs CreateSVGPathSegArcAbs(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag) const; + virtual wxSVGPathSegArcRel CreateSVGPathSegArcRel(double x, double y, double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag) const; + virtual wxSVGPathSegLinetoHorizontalAbs CreateSVGPathSegLinetoHorizontalAbs(double x) const; + virtual wxSVGPathSegLinetoHorizontalRel CreateSVGPathSegLinetoHorizontalRel(double x) const; + virtual wxSVGPathSegLinetoVerticalAbs CreateSVGPathSegLinetoVerticalAbs(double y) const; + virtual wxSVGPathSegLinetoVerticalRel CreateSVGPathSegLinetoVerticalRel(double y) const; + virtual wxSVGPathSegCurvetoCubicSmoothAbs CreateSVGPathSegCurvetoCubicSmoothAbs(double x, double y, double x2, double y2) const; + virtual wxSVGPathSegCurvetoCubicSmoothRel CreateSVGPathSegCurvetoCubicSmoothRel(double x, double y, double x2, double y2) const; + virtual wxSVGPathSegCurvetoQuadraticSmoothAbs CreateSVGPathSegCurvetoQuadraticSmoothAbs(double x, double y) const; + virtual wxSVGPathSegCurvetoQuadraticSmoothRel CreateSVGPathSegCurvetoQuadraticSmoothRel(double x, double y) const; bool HasAttribute(const wxString& name) const; wxString GetAttribute(const wxString& name) const; bool SetAttribute(const wxString& name, const wxString& value); diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGPoint.h wxsvg-1.5.4/include/wxSVG/SVGPoint.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGPoint.h 2007-10-30 21:59:22.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGPoint.h 2014-08-09 11:13:02.000000000 +0000 @@ -29,6 +29,11 @@ wxSVGPoint(double x, double y): m_x(x), m_y(y) {} virtual ~wxSVGPoint() {} virtual wxSVGPoint MatrixTransform(const wxSVGMatrix& matrix) const; + inline bool operator==(const wxSVGPoint& p) const { return m_x == p.m_x && m_y == p.m_y; } + inline bool operator!=(const wxSVGPoint& p) const { return m_x != p.m_x || m_y != p.m_y; } + inline wxSVGPoint operator-(const wxSVGPoint& p) const { return wxSVGPoint(m_x - p.m_x, m_y - p.m_y); } + inline wxSVGPoint operator+(const wxSVGPoint& p) const { return wxSVGPoint(m_x + p.m_x, m_y + p.m_y); } + inline wxSVGPoint operator*(double n) const { return wxSVGPoint(m_x*n, m_y*n); } }; #endif // WX_SVG_POINT_H diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGStylable.h wxsvg-1.5.4/include/wxSVG/SVGStylable.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGStylable.h 2014-03-27 08:39:32.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGStylable.h 2014-06-30 19:07:49.000000000 +0000 @@ -221,8 +221,8 @@ inline const wxSVGPaint& GetStroke() { return m_style.GetStroke(); } inline bool HasStroke() { return m_style.HasStroke(); } - inline void SetStrokeDasharray(const wxCSSPrimitiveValue& value) { m_style.SetStrokeDasharray(value); } - inline const wxCSSPrimitiveValue& GetStrokeDasharray() { return m_style.GetStrokeDasharray(); } + inline void SetStrokeDasharray(const wxCSSValueList& value) { m_style.SetStrokeDasharray(value); } + inline const wxCSSValueList& GetStrokeDasharray() { return m_style.GetStrokeDasharray(); } inline bool HasStrokeDasharray() { return m_style.HasStrokeDasharray(); } inline void SetStrokeDashoffset(double value) { m_style.SetStrokeDashoffset(value); } diff -Nru wxsvg-1.4~dfsg/include/wxSVG/SVGSVGElement.h wxsvg-1.5.4/include/wxSVG/SVGSVGElement.h --- wxsvg-1.4~dfsg/include/wxSVG/SVGSVGElement.h 2014-03-27 08:39:32.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVG/SVGSVGElement.h 2014-08-09 11:13:02.000000000 +0000 @@ -141,14 +141,14 @@ virtual bool CheckIntersection(const wxSVGElement& element, const wxSVGRect& rect); virtual bool CheckEnclosure(const wxSVGElement& element, const wxSVGRect& rect); virtual void DeselectAll(); - virtual wxSVGNumber CreateSVGNumber(); - virtual wxSVGLength CreateSVGLength(); - virtual wxSVGAngle CreateSVGAngle(); - virtual wxSVGPoint CreateSVGPoint(); - virtual wxSVGMatrix CreateSVGMatrix(); - virtual wxSVGRect CreateSVGRect(); - virtual wxSVGTransform CreateSVGTransform(); - virtual wxSVGTransform CreateSVGTransformFromMatrix(const wxSVGMatrix& matrix); + virtual wxSVGNumber CreateSVGNumber() const; + virtual wxSVGLength CreateSVGLength() const; + virtual wxSVGAngle CreateSVGAngle() const; + virtual wxSVGPoint CreateSVGPoint() const; + virtual wxSVGMatrix CreateSVGMatrix() const; + virtual wxSVGRect CreateSVGRect() const; + virtual wxSVGTransform CreateSVGTransform() const; + virtual wxSVGTransform CreateSVGTransformFromMatrix(const wxSVGMatrix& matrix) const; bool HasAttribute(const wxString& name) const; wxString GetAttribute(const wxString& name) const; bool SetAttribute(const wxString& name, const wxString& value); diff -Nru wxsvg-1.4~dfsg/include/wxSVGXML/.cvsignore wxsvg-1.5.4/include/wxSVGXML/.cvsignore --- wxsvg-1.4~dfsg/include/wxSVGXML/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/include/wxSVGXML/.cvsignore 2007-05-24 08:59:12.000000000 +0000 @@ -0,0 +1,3 @@ +Makefile +Makefile.in + diff -Nru wxsvg-1.4~dfsg/ltmain.sh wxsvg-1.5.4/ltmain.sh --- wxsvg-1.4~dfsg/ltmain.sh 2014-05-24 14:22:38.000000000 +0000 +++ wxsvg-1.5.4/ltmain.sh 2015-03-21 19:28:55.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.10ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +VERSION="2.4.2 Debian-2.4.2-1.10ubuntu1" TIMESTAMP="" package_revision=1.3337 diff -Nru wxsvg-1.4~dfsg/m4/.cvsignore wxsvg-1.5.4/m4/.cvsignore --- wxsvg-1.4~dfsg/m4/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/m4/.cvsignore 2013-09-20 10:05:18.000000000 +0000 @@ -0,0 +1 @@ +*.m4 diff -Nru wxsvg-1.4~dfsg/scripts/config.py wxsvg-1.5.4/scripts/config.py --- wxsvg-1.4~dfsg/scripts/config.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/config.py 2005-05-10 17:51:21.000000000 +0000 @@ -0,0 +1,5 @@ +svg_home_dir = ".." +include_dir = svg_home_dir + "/include/wxSVG" +src_dir = svg_home_dir + "/src" +share_dir = svg_home_dir + "/share" + diff -Nru wxsvg-1.4~dfsg/scripts/cppHeader.py wxsvg-1.5.4/scripts/cppHeader.py --- wxsvg-1.4~dfsg/scripts/cppHeader.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/cppHeader.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,70 @@ +############################################################################## +## Name: cppHeader.py +## Purpose: generates c++ header and saves it +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: cppHeader.py,v 1.4 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import os.path +import genFile +import string + +def make_header_name(name): + pos = 0 + if name[0:3] in ["SVG", "CSS"]: + pos = 3 + while len(name)>pos: + if name[pos] == name[pos].upper(): + if pos>0: + name = name[0:pos] + "_" + name[pos:] + pos = pos + 1 + pos = pos + 1 + if len(name)>pos and name[pos] == name[pos].upper(): + while len(name)>pos and name[pos] == name[pos].upper(): + pos = pos + 1 + name = name[0:pos-1] + "_" + name[pos-1:] + pos = pos + 1 + else: + pos = pos +1 + return name.upper() + +class Header: + def __init__(self, name, script_name, prefix="WX"): + self.name = name + self.script_name = script_name + self.prefix = prefix + + if self.prefix: + self.guard = self.prefix+'_'+make_header_name(self.name)+'_H' + else: + self.guard = self.name+'_H' + + self.content='' + + def add_content(self, content): + self.content = self.content + content + + def dump(self, path=''): + data = '''\ +////////////////////////////////////////////////////////////////////////////// +// Name: %s.h +// Author: Alex Thuering +// Copyright: (c) 2005 Alex Thuering +// Licence: wxWindows licence +// Notes: generated by %s +////////////////////////////////////////////////////////////////////////////// + +#ifndef %s +#define %s + +%s + +#endif // %s +'''%(self.name, self.script_name, self.guard, self.guard, self.content, self.guard) + + filename = os.path.join(path, self.name+'.h') + f = genFile.gfopen(filename,'wb') + f.write(data) diff -Nru wxsvg-1.4~dfsg/scripts/cppImpl.py wxsvg-1.5.4/scripts/cppImpl.py --- wxsvg-1.4~dfsg/scripts/cppImpl.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/cppImpl.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,38 @@ +############################################################################## +## Name: cppImpl.py +## Purpose: generates c++ file and saves it +## Author: Alex Thuering +## Created: 2005/05/10 +## RCS-ID: $Id: cppImpl.py,v 1.3 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import os.path +import genFile + +class Impl: + def __init__(self, name, script_name): + self.name = name + self.script_name = script_name + self.content='' + + def add_content(self, content): + self.content = self.content + content + + def dump(self, path=''): + data = '''\ +////////////////////////////////////////////////////////////////////////////// +// Name: %s.cpp +// Author: Alex Thuering +// Copyright: (c) 2005 Alex Thuering +// Licence: wxWindows licence +// Notes: generated by %s +////////////////////////////////////////////////////////////////////////////// + +%s +'''%(self.name, self.script_name, self.content) + + filename = os.path.join(path, self.name+'.cpp') + f = genFile.gfopen(filename,'wrU') + f.write(data) diff -Nru wxsvg-1.4~dfsg/scripts/cpp.py wxsvg-1.5.4/scripts/cpp.py --- wxsvg-1.4~dfsg/scripts/cpp.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/cpp.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,40 @@ +############################################################################## +## Name: cpp.py +## Purpose: +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: cpp.py,v 1.6 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import string + +builtin_types = ["float", "double", "int", "unsigned long", "long", "unsigned short", "char", "unsigned char", "bool", "void"] +number_types = ["float", "double", "int", "unsigned long", "long", "unsigned short", "char", "unsigned char", "bool"] + +def make_name(name): + tmp=name + tmp = tmp.replace('-','_') + tmp = tmp.replace(':','_') + return tmp + +def make_attr_name(name): + return 'm_' + make_name(name) + +def fix_typename(name): + pos = name.find("::") + if pos>0: + name = name[pos+2:] + if name == "boolean": + name = "bool" + elif name == "float": + name = "double" + elif name == "DOMString" or name == "String": + name = "wxString" + elif name == "Document" or name == "Element": + name = "wxSvgXml" + name + elif name not in builtin_types: #elif name[:3]=="SVG": + name = "wx" + name + return name + diff -Nru wxsvg-1.4~dfsg/scripts/.cvsignore wxsvg-1.5.4/scripts/.cvsignore --- wxsvg-1.4~dfsg/scripts/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/.cvsignore 2013-09-12 08:44:37.000000000 +0000 @@ -0,0 +1,2 @@ +*.pyc +__pycache__ diff -Nru wxsvg-1.4~dfsg/scripts/enum_map.py wxsvg-1.5.4/scripts/enum_map.py --- wxsvg-1.4~dfsg/scripts/enum_map.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/enum_map.py 2014-03-24 21:13:32.000000000 +0000 @@ -0,0 +1,56 @@ +############################################################################## +## Name: enum_map.py +## Purpose: +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: enum_map.py,v 1.4 2014/03/24 21:13:32 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +enum_map = { +"SVGFEConvolveMatrixElement::edgeMode": "SVG_EDGEMODE", +"SVGTextPathElement::method": "TEXTPATH_METHODTYPE", +"SVGTextPathElement::spacing": "TEXTPATH_SPACINGTYPE", +"SVGClipPathElement::clipPathUnits": "SVG_UNIT_TYPE", +"SVGLength::unitType": "SVG_LENGTHTYPE", +"SVGFEMorphologyElement::operator": "SVG_MORPHOLOGY_OPERATOR", +"SVGPaint::paintType": "SVG_PAINTTYPE", +"SVGTextContentElement::lengthAdjust": "LENGTHADJUST", +"SVGPatternElement::patternUnits": "SVG_UNIT_TYPE", +"SVGColor::colorType": "SVG_COLORTYPE", +"SVGFEBlendElement::mode": "SVG_FEBLEND_MODE", +"SVGGradientElement::gradientUnits": "SVG_UNIT_TYPE", +"SVGGradientElement::spreadMethod": "SVG_SPREADMETHOD", +"SVGComponentTransferFunctionElement::type": "SVG_FECOMPONENTTRANSFER_TYPE", +"SVGFETurbulenceElement::stitchTiles": "SVG_STITCHTYPE", +"SVGFETurbulenceElement::type": "SVG_TURBULENCE_TYPE", +"SVGPreserveAspectRatio::align": "SVG_PRESERVEASPECTRATIO", +"SVGPreserveAspectRatio::meetOrSlice": "SVG_MEETORSLICE", +"SVGColorProfileRule::renderingIntent": "RENDERING_INTENT", +"SVGAnimationElement::attributeType": "SVG_ANIMATION_ATTRIBUTE_TYPE", +"SVGAnimationElement::restart": "SVG_ANIMATION_RESTART", +"SVGAnimationElement::fill": "SVG_ANIMATION_FILL", +"SVGAnimationElement::additive": "SVG_ANIMATION_ADDITIVE", +"SVGAnimationElement::accumulate": "SVG_ANIMATION_ACCUMULATE", +"SVGAnimateTransformElement::type": "SVG_ANIMATETRANSFORM", +"SVGZoomAndPan::zoomAndPan": "SVG_ZOOMANDPAN", +"SVGTransform::type": "SVG_TRANSFORM", +"SVGPathSeg::pathSegType": "PATHSEG", +"SVGFEColorMatrixElement::type": "SVG_FECOLORMATRIX_TYPE", +"SVGMaskElement::maskUnits": "SVG_UNIT_TYPE", +"SVGFEDisplacementMapElement::xChannelSelector": "SVG_CHANNEL", +"SVGFEDisplacementMapElement::yChannelSelector": "SVG_CHANNEL", +"SVGFilterElement::filterUnits": "SVG_UNIT_TYPE", +"SVGFilterElement::primitiveUnits": "SVG_UNIT_TYPE", +"SVGAngle::unitType": "SVG_ANGLETYPE", +"SVGColorProfileElement::renderingIntent": "RENDERING_INTENT", +"SVGMarkerElement::markerUnits": "SVG_MARKERUNITS", +"SVGMarkerElement::orientType": "SVG_MARKER_ORIENT", +"SVGLangSpace::xmlspace": "SVG_XML_SPACE", +"SVGFECompositeElement::operator": "SVG_FECOMPOSITE_OPERATOR", +"SVGURIReference::xlinkType": "SVG_XLINK_TYPE", +"SVGURIReference::xlinkShow": "SVG_XLINK_SHOW", +"SVGURIReference::xlinkActuate": "SVG_XLINK_ACTUATE", +"SVGAElement::xlinkShow": "SVG_XLINK_SHOW" +} diff -Nru wxsvg-1.4~dfsg/scripts/genAnimated.py wxsvg-1.5.4/scripts/genAnimated.py --- wxsvg-1.4~dfsg/scripts/genAnimated.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genAnimated.py 2014-03-27 08:38:04.000000000 +0000 @@ -0,0 +1,119 @@ +############################################################################## +## Name: genAnimated.py +## Purpose: generates all SVGAnimated*.h +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: genAnimated.py,v 1.9 2014/03/27 08:38:04 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import config +import cpp +import cppHeader + +def getBaseType(name): + if name=="Enumeration": + return "unsigned char" + elif name=="Boolean": + return "bool" + elif name=="Integer": + return "long" + elif name=="Number": + return "float" + typename = name + if typename != "String": + typename = "SVG" + typename + return cpp.fix_typename(typename) + + +def generate(name): + typename = getBaseType(name) + include = '' + if name == "String": + include = '#include "String_wxsvg.h"\n' + elif typename not in cpp.builtin_types: + include = '#include "SVG%s.h"\n'%name + + output = '' + if typename in cpp.number_types: + output = '''%s +class wxSVGAnimated%s +{ + public: + wxSVGAnimated%s(): m_baseVal(0), m_animVal(0) {} + wxSVGAnimated%s(%s value): m_baseVal(value), m_animVal(value) {} + + inline %s GetBaseVal() const { return m_baseVal; }; + inline void SetBaseVal(%s value) { m_baseVal = m_animVal = value; } + + inline %s GetAnimVal() const { return m_animVal; } + inline void SetAnimVal(%s value) { m_animVal = value; } + + public: + inline operator %s() const { return GetAnimVal(); } + + protected: + %s m_baseVal; + %s m_animVal; +}; +'''%(include,name,name,name,typename,typename,typename,typename,typename,typename,typename,typename) + else: + output = '''%s +class wxSVGAnimated%s +{ + public: + wxSVGAnimated%s(): m_animVal(NULL) {} + wxSVGAnimated%s(const %s& value): m_baseVal(value), m_animVal(NULL) {} + wxSVGAnimated%s(const wxSVGAnimated%s& value): m_baseVal(value.m_baseVal), m_animVal(NULL) + { if (value.m_animVal != NULL) m_animVal = new %s(*value.m_animVal); } + ~wxSVGAnimated%s() { ResetAnimVal(); } + + inline wxSVGAnimated%s& operator=(const wxSVGAnimated%s& value) + { m_baseVal = value.m_baseVal; m_animVal = value.m_animVal != NULL ? new %s(*value.m_animVal) : NULL; return *this; } + + inline %s& GetBaseVal() { return m_baseVal; } + inline const %s& GetBaseVal() const { return m_baseVal; } + inline void SetBaseVal(const %s& value) { m_baseVal = value; ResetAnimVal(); } + + inline %s& GetAnimVal() + { + if (!m_animVal) + m_animVal = new %s(m_baseVal); + return *m_animVal; + } + inline const %s& GetAnimVal() const + { + return m_animVal ? *m_animVal : m_baseVal; + } + inline void SetAnimVal(const %s& value) + { + if (!m_animVal) + m_animVal = new %s(value); + else + *m_animVal = value; + } + inline void ResetAnimVal() + { + if (m_animVal) + { + delete m_animVal; + m_animVal = NULL; + } + } + + public: + inline operator const %s&() const { return GetAnimVal(); } + + protected: + %s m_baseVal; + %s* m_animVal; +}; +'''%(include,name,name,name,typename,name,name,typename,name,name,name,typename,\ + typename,typename,typename,typename,\ + typename,typename,typename,typename,typename,typename,typename) + + header = cppHeader.Header("SVGAnimated%s"%name, "genAnimated.py") + header.add_content(output) + header.dump(path=config.include_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/genCSS.py wxsvg-1.5.4/scripts/genCSS.py --- wxsvg-1.4~dfsg/scripts/genCSS.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genCSS.py 2014-06-30 19:10:55.000000000 +0000 @@ -0,0 +1,402 @@ +############################################################################## +## Name: genCSS.py +## Purpose: generates CSSStyleDeclaration +## Author: Alex Thuering +## Created: 2005/06/06 +## RCS-ID: $Id: genCSS.py,v 1.18 2014/06/30 19:10:55 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +############################################################################## + +import config +import string +import cpp +import cppHeader +import cppImpl +import sys +import xml.dom.minidom +from xml.dom.minidom import Node + +def generate(): + if len(cssProperties) == 0: + parseCSSProps() + genCSSStyleDeclaration() + genStyles() + genValues() + +####################### parseCSSProps ############################## +cssProperties = [] +class Property: + def __init__(self, dtdName): + self.dtdName = dtdName + self.cssType = '' + self.valueType = '' + self.defValue = '' + self.values = [] + def __str__(self): + return self.dtdName + "," + self.cssType + "," + self.valueType + "," + self.defValue + +# loads SVG11CSSpropidx.xhtml and fills cssProperties list +def parseCSSProps(): + doc = xml.dom.minidom.parse(config.share_dir + "/SVG11CSSpropidx.xhtml") + tbody = doc.getElementsByTagName('html')[0].getElementsByTagName('body')[0].getElementsByTagName('table')[0].getElementsByTagName('tbody')[0] + for tr in tbody.childNodes: + if tr.nodeName == "tr": + for propNode in tr.getElementsByTagName('td')[0].getElementsByTagName('a'): + propName = propNode.childNodes[0].childNodes[0].nodeValue + propName = propName[1:-1] + if propName == "marker": + #tr.getElementsByTagName('td')[1].childNodes[0].nodeValue = "none | inherit | " + #tr.getElementsByTagName('td')[2].childNodes[0].nodeValue = "none" + continue + if propName == "font": + #tr.getElementsByTagName('td')[1].childNodes[0].nodeValue = "" + #tr.getElementsByTagName('td')[2].childNodes[0].nodeValue = "" + continue + propDefValue = tr.getElementsByTagName('td')[2].childNodes[0].nodeValue + ## make propValuesStr + propValuesStr = '' + propTypes = [] + for child in tr.getElementsByTagName('td')[1].childNodes: + if child.nodeName == "#text": + propValuesStr = propValuesStr + child.nodeValue + elif child.nodeName == "a": + if child.getElementsByTagName('span').length > 0: + val = child.getElementsByTagName('span')[0].childNodes[0].nodeValue + if val[0] == "<": + propTypes.append(val[1:-1]) + elif val[0] != "'" and val != "inherit": + propValuesStr = propValuesStr + val + else: + val = child.childNodes[0].nodeValue + if val[0] == "<": + propTypes.append(val[1:-1]) + ## delete (...) + while 1: + beg = propValuesStr.find("(") + end = propValuesStr.find(")") + if beg != -1 and end != -1 and beg < end: + propValuesStr = propValuesStr[:beg] + propValuesStr[end+1:] + else: + break + ## delete [...], but not at the begin of string and not after "|" + beg = propValuesStr.find("[") + end = propValuesStr.rfind("]") + if beg > 1 and end != -1 and beg < end and propValuesStr[beg-2:beg] != "| ": + propValuesStr = propValuesStr[:beg] + propValuesStr[end+1:] + ## delete all other non-alphanum characters + tmp = '' + for c in propValuesStr: + if c in string.ascii_letters or c in string.digits or c in "|-_<>": + tmp = tmp + c + propValuesStr = tmp + # create property and append it to the list + prop = Property(propName) + for val in propValuesStr.split('|'): + if len(val) == 0: + continue + elif val[0] == "<": + propTypes.append(val[1:-1]) + elif val not in prop.values: + prop.values.append(val) + setCSSType(prop, propTypes) + setDefValue(prop, propDefValue) + cssProperties.append(prop) + +def setCSSType(prop, propTypes): + prop.cssType = 'wxCSSPrimitiveValue' + prop.valueType = 'wxCSS_VALUE' + if 'color' in propTypes: + if 'currentColor' in prop.values: + prop.cssType = 'wxSVGColor' + prop.valueType = 'wxSVGColor' + else: + prop.valueType = 'wxRGBColor' + elif 'paint' in propTypes: + prop.cssType = 'wxSVGPaint' + prop.valueType = 'wxSVGPaint' + elif 'dasharray' in propTypes: + prop.cssType = 'wxCSSValueList' + prop.valueType = 'wxCSSValueList' + elif 'opacity-value' in propTypes or 'miterlimit' in propTypes : + prop.valueType = 'double' + elif ('length' in propTypes or 'angle' in propTypes) and len(prop.values) == 0: + prop.valueType = 'double' + elif 'family-name' in propTypes: + prop.valueType = 'wxString' + elif len(propTypes): + prop.valueType = 'wxCSSPrimitiveValue' + +def setDefValue(prop, defValue): + ## fix some broken defs + if defValue == "see property description" or defValue == "see prose": + defValue = "auto" + ## defValue + if prop.valueType == 'wxRGBColor': + defValue = "wxRGBColor()" + elif prop.valueType == 'wxSVGPaint': + if defValue == "none": + defValue = '*s_emptySVGPaint' + else: + defValue = '*s_blackSVGPaint' + elif prop.valueType == 'wxSVGColor': + defValue = '*s_emptySVGColor' + elif prop.valueType == 'wxCSSValueList': + defValue = '*s_emptyValueList' + elif prop.valueType == 'wxCSSPrimitiveValue': + defValue = '*s_emptyCSSValue' + elif prop.valueType == 'wxString': + defValue = 'wxT("")' + elif prop.valueType == 'wxCSS_VALUE': + defValue = valueId(defValue) + elif prop.valueType == 'double' and defValue == 'medium': + defValue = '20' + elif prop.valueType == 'double' and defValue == '0deg': + defValue = '0' + prop.defValue = defValue + +######################### CSSStyleDeclaration.h ############################## +def genCSSStyleDeclaration(): + enum = '' + for prop in cssProperties: + if (len(enum)): + enum = enum + ',\n' + enum = enum + ' ' + propId(prop.dtdName) + + methods = '' + for prop in cssProperties: + methodName = makeMethodName(prop.dtdName) + valueType = prop.valueType + get = '((%s&)*it->second)'%prop.cssType + functionName = getFunctionName(prop.valueType) + if len(functionName): + get = get + '.Get' + functionName + '()' + else: + valueType = "const " + valueType + "&" + get = '''\ + inline %s Get%s() const + { + const_iterator it = find(%s); + return it != end() ? %s : %s; + } + '''%(valueType, methodName, propId(prop.dtdName), get, prop.defValue) + + has = 'inline bool Has%s() const { return HasProperty(%s); }\n'%(methodName, propId(prop.dtdName)) + + if len(functionName): + valueType = prop.valueType + if valueType not in cpp.builtin_types and valueType != "wxCSS_VALUE": + valueType = "const " + valueType + "&" + ptype = "" + if prop.valueType == "wxString": + ptype = "wxCSS_STRING, " + elif prop.valueType == "double": + ptype = "wxCSS_NUMBER, " + set = '''\ + inline void Set%s(%s value) + { + iterator it = find(%s); + if (it != end()) + ((%s*)it->second)->Set%s(%svalue); + else + (*this)[%s] = new %s(value); + } + '''%(methodName, valueType, propId(prop.dtdName), prop.cssType, functionName, ptype, propId(prop.dtdName), prop.cssType) + else: + set = '''\ + inline void Set%s(const %s& value) + { + iterator it = find(%s); + if (it != end()) + { + delete it->second; + it->second = new %s(value); + } + else + (*this)[%s] = new %s(value); + } + '''%(methodName, prop.valueType, propId(prop.dtdName), prop.valueType, propId(prop.dtdName), prop.valueType) + + + if len(methods): + methods = methods + '\n\n'; + methods = methods + get + has + set; + + output = ''' +#include "CSSValue.h" +#include "SVGPaint.h" +#include "SVGAnimatedType.h" +#include + +enum wxCSS_PROPERTY +{ + wxCSS_PROPERTY_UNKNOWN, +%s +}; + +WX_DECLARE_HASH_MAP(wxCSS_PROPERTY, wxCSSValue*, wxIntegerHash, wxIntegerEqual, wxHashMapCSSValue); + +typedef wxString wxCSSStyler; + +class wxCSSStyleDeclaration: public wxHashMapCSSValue +{ + public: + wxCSSStyleDeclaration() {} + wxCSSStyleDeclaration(const wxCSSStyleDeclaration& src) { Add(src); } + ~wxCSSStyleDeclaration(); + wxCSSStyleDeclaration& operator=(const wxCSSStyleDeclaration& src); + void Add(const wxCSSStyleDeclaration& style); + + public: + wxString GetCSSText() const; + void SetCSSText(const wxString& text); + + inline wxString GetPropertyValue(const wxString& propertyName) const + { return GetPropertyValue(GetPropertyId(propertyName)); } + + inline const wxCSSValue& GetPropertyCSSValue(const wxString& propertyName) const + { return GetPropertyCSSValue(GetPropertyId(propertyName)); } + + void SetProperty(const wxString& propertyName, const wxString& value) + { SetProperty(GetPropertyId(propertyName), value); } + + void SetProperty(const wxString& propertyName, const wxSVGAnimatedType& value) + { SetProperty(GetPropertyId(propertyName), value); } + + inline bool HasProperty(const wxString& propertyName) const + { return HasProperty(GetPropertyId(propertyName)); } + + inline wxString RemoveProperty(const wxString& propertyName) + { return RemoveProperty(GetPropertyId(propertyName)); } + + public: + inline wxString GetPropertyValue(wxCSS_PROPERTY propertyId) const + { const_iterator it = find(propertyId); if (it != end()) return it->second->GetCSSText(); return wxT(""); } + + inline const wxCSSValue& GetPropertyCSSValue(wxCSS_PROPERTY propertyId) const + { const_iterator it = find(propertyId); if (it != end()) return *it->second; return *s_emptyCSSValue; } + + void SetProperty(wxCSS_PROPERTY propertyId, const wxString& value); + void SetProperty(wxCSS_PROPERTY propertyId, const wxSVGAnimatedType& value); + inline bool HasProperty(wxCSS_PROPERTY propertyId) const { return find(propertyId) != end(); } + inline wxString RemoveProperty(wxCSS_PROPERTY propertyId) { erase(propertyId); return wxT(""); } + + static wxCSS_PROPERTY GetPropertyId(const wxString& propertyName); + static wxString GetPropertyName(wxCSS_PROPERTY propertyId); + + public: +%s + + protected: + static wxCSSPrimitiveValue* s_emptyCSSValue; + static wxSVGColor* s_emptySVGColor; + static wxSVGPaint* s_emptySVGPaint; + static wxSVGPaint* s_blackSVGPaint; + static wxCSSValueList* s_emptyValueList; + + public: + static double ParseNumber(const wxString& value); + static wxRGBColor ParseColor(const wxString& value); + static void ParseSVGPaint(wxSVGPaint& paint, const wxString& value); +}; + +/* this class copy only references of css values */ +class wxCSSStyleRef: public wxCSSStyleDeclaration +{ + public: + wxCSSStyleRef() {} + wxCSSStyleRef(const wxCSSStyleDeclaration& src) { Add(src); } + ~wxCSSStyleRef(); + void Add(const wxCSSStyleDeclaration& style); +}; +'''%(enum, methods) + + header = cppHeader.Header("CSSStyleDeclaration", "genCSS.py") + header.add_content(output) + header.dump(path=config.include_dir) + +def getFunctionName(valueType): + if valueType == 'wxCSS_VALUE': + return 'IdentValue' + elif valueType == 'wxRGBColor': + return 'RGBColorValue' + elif valueType == 'double': + return 'FloatValue' + elif valueType == 'wxString': + return 'StringValue' + elif valueType == 'wxCSS_VALUE': + return 'IdentValue' + return '' + +def propId(name): + return 'wxCSS_PROPERTY_' + cpp.make_name(name).upper() + +def valueId(name): + return 'wxCSS_VALUE_' + cpp.make_name(name).upper() + +def makeMethodName(dtdName): + methodName = dtdName[0].upper() + dtdName[1:] + while methodName.find('-') != -1: + pos = methodName.find('-') + methodName = methodName[0:pos] + methodName[pos+1].upper() + methodName[pos+2:] + return methodName + +####################### CSSStyleDeclaration_styles.h ######################### +def genStyles(): + properties = '' + for prop in cssProperties: + if len(properties): + properties = properties + ',\n' + properties = properties + ' wxT("%s")'%prop.dtdName + + output = ''' +wxString s_cssPropertyStrings[] = +{ +%s +}; + '''%properties + + impl = cppImpl.Impl("css_properties", "genCSS.py") + impl.add_content(output) + impl.dump(path=config.src_dir) + +############################### CSSValues.h ################################## +def genValues(): + cssValues = [] + for prop in cssProperties: + for val in prop.values: + if val not in cssValues: + cssValues.append(val) + cssValues.sort() + + values = '' + for value in cssValues: + if len(values): + values = values + ',\n' + values = values + ' %s'%valueId(value) + + output = '''\ +enum wxCSS_VALUE +{ + wxCSS_VALUE_UNKNOWN, +%s +};'''%values + + header = cppHeader.Header("CSSValues", "genCSS.py") + header.add_content(output) + header.dump(path=config.include_dir) + + values = '' + for value in cssValues: + if len(values): + values = values + ',\n' + values = values + ' wxT("%s")'%value + + output = '''\ +wxString s_cssValueStrings[] = +{ +%s +};'''%values + impl = cppImpl.Impl("css_values", "genCSS.py") + impl.add_content(output) + impl.dump(path=config.src_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/generate.py wxsvg-1.5.4/scripts/generate.py --- wxsvg-1.4~dfsg/scripts/generate.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/generate.py 2014-08-09 11:13:02.000000000 +0000 @@ -0,0 +1,628 @@ +############################################################################## +## Name: generate.py +## Purpose: generates the most headers from idl, but with some changes +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: generate.py,v 1.27 2014/08/09 11:13:02 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +############################################################################## +## generates the most headers from idl, but with some changes: +## - all properties in idl are "readonly", but I generate not only +## get methods, but also set methods. +## This allow you to call: +## rect->SetWidth(100) +## instead of +## rect->SetAttrubite("width", "100") +## - for animated properties (f.e.: SVGAnimatedLength width), in addition to +## the method SetWidth(const SVGAnimatedLength&) will be generated the +## method SetWidth(const SVGLength&) to set the base value directly +############################################################################## + +import parse_idl +import cpp +import cppHeader +import cppImpl +import enum_map +import string +import mapDtdIdl +import interfaces +import config +import genAnimated +import genList +import genCSS +import genFile +import os + +used_lists = [] +used_animated = [] +copy_constructor_impl = '' +copy_constructor_includes = ['SVGCanvasItem'] + +def find_dtd_attr_in_inherit(classdecl): + if len(classdecl.attributes): + for attr in classdecl.attributes: + if attr in mapDtdIdl.attributes_idl_dtd: + return 1 + + for inh in classdecl.inherits: + try: + res = find_dtd_attr_in_inherit(parse_idl.class_decls[inh]) + if res > 0: + return 1 + except KeyError: + pass + return 0 + +def find_anim_dtd_attr_in_inherit(classdecl): + if len(classdecl.attributes): + for attr in classdecl.attributes: + if attr in mapDtdIdl.attributes_idl_dtd and attr.type.name[0:11] == "SVGAnimated" and attr.type.name != "SVGAnimatedType": + return 1 + + for inh in classdecl.inherits: + try: + inh_classdecl = parse_idl.class_decls[inh]; + res = inh_classdecl.name != "SVGExternalResourcesRequired" and find_anim_dtd_attr_in_inherit(inh_classdecl) + if res > 0: + return 1 + except KeyError: + pass + return 0 + +if len(parse_idl.class_decls): + for (classname, classdecl) in parse_idl.class_decls.items(): + if classname.find("Animated") >=0 and classname not in ["SVGAnimatedPathData","SVGAnimatedPoints"]: + used_animated.append(classname) + continue + if classname.find("List") >=0: + used_lists.append(classname) + continue + + # print classdecl + header = cppHeader.Header(classname, "generate.py") + + includes=[] + fwd_decls=[] + doGetAttrByName=0 + + output = '' + cpp_output = '' + + # enums + for enum in classdecl.enums: + output = output + '\nenum %s\n{\n'%(cpp.fix_typename(enum.name)) + if len(enum.const_decls): + output = output + ' %s'%(cpp.fix_typename('%s'%enum.const_decls[0])) + if len(enum.const_decls[1:]): + for const_decl in enum.const_decls[1:]: + output = output + ',\n %s'%(cpp.fix_typename('%s'%const_decl)) + output = output + '\n};\n\n' + + # inheritance + output = output + "class %s"%(cpp.fix_typename(classname)) + copy_constr_init = '' + if len(classdecl.inherits): + first = 1 + for inherit in classdecl.inherits: + pos = inherit.find("::") + if pos>0: + inherit = inherit[pos+2:] + if first: + output = output + ':\n' + copy_constr_init = copy_constr_init + ':\n' + first = 0 + else: + output = output + ',\n' + copy_constr_init = copy_constr_init + ',\n' + output = output + ' public %s'%(cpp.fix_typename(inherit)) + copy_constr_init = copy_constr_init + ' %s(src)'%(cpp.fix_typename(inherit)) + includes.append(inherit) + output = output + '\n{\n' + + public = '' + protected = '' + + ######## attributes ########## + attributes=[] + + exclude_attributes=[] # really method that set/get + try: + exclude_attributes=interfaces.interfaces[classname].exclude_attributes + except KeyError: + pass + + + for attr in classdecl.attributes: + if (attr.name in exclude_attributes): + continue + typename = attr.type.name + + # is Attribute an Element ? + ispointer = False + isenum = False + pos = attr.type.name.find('Element') + if pos > 0: + fwd_decls.append(typename) + typename = typename+'*' + ispointer=1 + else: + if attr.type.name=="unsigned short":# or attr.type.name.find('Enumeration')>=0: + try: + enumname = enum_map.enum_map[classname+'::'+attr.name] + isenum = True + if attr.type.name=="unsigned short": + typename = enumname + else: + pos = attr.type.name.find('Animated') + if pos >= 0: + typename = 'SVGAnimated%s'%enumname + isenum = False + else: + typename = typename.replace('Enumeration', enumname) + # typename = classdecl.enums[numtype].name + except KeyError: # gen enum_map + try: + tmp = classdecl.enums[0].name + except IndexError: + # maybe a UnitType + for inh in ["SVGUnitTypes", "SVGRenderingIntent"]: + if inh in classdecl.inherits: + tmp = parse_idl.class_decls[inh].enums[0].name + break + else: + tmp = "0" + print("enum_map.py is not up-to-date. Please remove it, copy and paste what's dumped by this script in enum_map.py then rerun again") + print('"'+classname+'::'+attr.name +'": "' + tmp + '" ,') + + elif typename=="DOMString": + if "String_wxsvg" not in includes: + includes.append("String_wxsvg") + else: + if cpp.fix_typename(typename) not in cpp.builtin_types: + if typename not in includes: + includes.append(typename) + typename = cpp.fix_typename(typename) + + + attributes.append((typename, attr.name, ispointer, isenum)) + # get by name + try: + entity_name = mapDtdIdl.attributes_idl_dtd[attr] + doGetAttrByName=1 + except KeyError: + pass + + # exclude_methods + exclude_methods=[] + try: + exclude_methods=interfaces.interfaces[classname].exclude_methods + except KeyError: + pass + + # include_get_set_attributes + include_get_set_attributes=[] + try: + for attr in interfaces.interfaces[classname].include_get_set_attributes: + attributes.append(attr) + except KeyError: + pass + + ############### get/set methods ################# + if len(attributes)>0: + + # fields + for (typestr, attrname, ispointer, isenum) in attributes: + attrname = cpp.make_attr_name(attrname) + protected = protected +' ' + typestr + ' ' + attrname + ';\n' + + # get/set methods + for (typestr, attrname, ispointer, isenum) in attributes: + animated = 0 + typestrBase = "" + pos = typestr.find('Animated') + if pos>=0 and typestr != "wxSVGAnimatedType": # SVGAnimatedTypename + typestrBase = typestr[pos+len('Animated'):] + animated = 1 + + # get + methodName = 'Get' + attrname[0].upper()+attrname[1:] + if(methodName in exclude_methods): + continue + exclude_methods.append(methodName) + + ret_type = typestr + if (typestr[0:5] == "wxSVG" or typestr[0:5] == "wxCSS" or typestr == "wxString") and \ + typestr[0:6] != "wxSVG_" and not ispointer: + ret_type = 'const ' + ret_type + '&' + #if typestr[0:13] == "wxSVGAnimated": + # protected = protected + ' inline %s& %s() { %sreturn %s; }\n'%(typestr,methodName,calc,attrname_cpp) + + attrname_cpp = cpp.make_attr_name(attrname) + calc = '' + if classname[-7:] == "Element" and typestr in ["wxSVGAnimatedLength", "wxSVGAnimatedLengthList"]: + if "SVGSVGElement" not in includes: + includes.append("SVGSVGElement") + l = '' + if typestr == "wxSVGAnimatedLengthList": + l = '_LIST' + if attrname[len(attrname)-1].lower() == 'x' or attrname[-5:].lower() == 'width' or \ + attrname[len(attrname)-2].lower() == 'x' or attrname in ["startOffset", "textLength"]: + calc = 'WX_SVG_ANIM_LENGTH%s_CALC_WIDTH(%s, GetViewportElement()); '%(l,attrname_cpp) + elif attrname[len(attrname)-1].lower() == 'y' or attrname[-6:].lower() == 'height' or \ + attrname[len(attrname)-2].lower() == 'y': + calc = 'WX_SVG_ANIM_LENGTH%s_CALC_HEIGHT(%s, GetViewportElement()); '%(l,attrname_cpp) + elif attrname == 'r': + calc = 'WX_SVG_ANIM_LENGTH%s_CALC_SIZE(%s, GetViewportElement()); '%(l,attrname_cpp) + else: + calc = 'WX_SVG_ANIM_LENGTH%s_CALC_SIZE(%s, GetViewportElement()); '%(l,attrname_cpp) + print("Warning: unknown lengthtype of attribute " + classname + '::' + attrname) + #if classname[-7:] == "Element" and typestr == "wxSVGAnimatedLengthList": + # print classname + " - " + typestr + public = public + ' inline %s %s() const { %sreturn %s; }\n'%(ret_type,methodName,calc,attrname_cpp) + + # set + methodName = 'Set' + attrname[0].upper()+attrname[1:] + if(methodName in exclude_methods): + continue + exclude_methods.append(methodName) + + param_type = typestr + if typestr not in cpp.builtin_types and ispointer==0: + param_type = 'const ' + param_type + '&' + + dirty = '' + #if classname[-7:] == "Element" and classname != "SVGElement": + # dirty = ' SetDirty();' + + public = public + ' inline void %s(%s n) { %s = n;%s }\n'%(methodName,param_type,attrname_cpp,dirty) + if animated: + param_type = genAnimated.getBaseType(typestrBase) + if param_type not in cpp.builtin_types and ispointer==0: + param_type = 'const ' + param_type + '&' + public = public + ' inline void %s(%s n) { %s.SetBaseVal(n);%s }\n'%(methodName,param_type,attrname_cpp,dirty) + public = public + '\n' + + try: + for i in interfaces.interfaces[classname].include_attributes: + public = public+i + + except KeyError: + pass + + ################# wxSVGStylable #################### + if classname == "SVGStylable": + public = public + " public:\n" + genCSS.parseCSSProps() + for prop in genCSS.cssProperties: + methodName = genCSS.makeMethodName(prop.dtdName) + valueType = prop.valueType + if valueType not in cpp.builtin_types and valueType != "wxCSS_VALUE": + valueType = "const " + valueType + "&" + public = public + ' inline void Set%s(%s value) { m_style.Set%s(value); }\n'%(methodName, valueType, methodName) + valueType = prop.valueType + if len(genCSS.getFunctionName(prop.valueType)) == 0: + valueType = "const " + valueType + "&" + public = public + ' inline %s Get%s() { return m_style.Get%s(); }\n'%(valueType, methodName, methodName) + public = public + ' inline bool Has%s() { return m_style.Has%s(); }\n'%(methodName, methodName) + public = public + ' \n' + + + ################# constructor ####################### + methods_str = '' + + has_constructor = 0 + try: + has_constructor=interfaces.interfaces[classname].user_defined_constructor + except KeyError: + pass + if has_constructor==0: + init_attibutes = "" + try: + for (typestr, attrname, ispointer, isenum) in attributes: + attrname=cpp.make_attr_name(attrname) + if typestr in cpp.number_types: + init_attibutes = init_attibutes + ", %s(0)"%attrname + elif ispointer: + init_attibutes = init_attibutes + ", %s(NULL)"%attrname + elif isenum: + init_attibutes = init_attibutes + ", %s(%s(0))"%(attrname,typestr) + for (attrname, init_value) in interfaces.interfaces[classname].include_attributes_init: + attrname=cpp.make_attr_name(attrname) + init_attibutes = init_attibutes + ", %s(%s)"%(attrname, init_value) + except KeyError: + pass + cname = cpp.fix_typename(classname) + if classname.find("Element")>0: + # first find the directly inherited "Element" class + # generally SVGElement, but it can be SVGGradientElement for ex. + element_inherit=None + for inh in classdecl.inherits: + if inh.find("Element")>0: + element_inherit=cpp.fix_typename(inh) + break + element_string='' + if classdecl in mapDtdIdl.elements_idl_dtd: + element_string=mapDtdIdl.elements_idl_dtd[classdecl] + methods_str = methods_str + ' %s(wxString tagName = wxT("%s")):\n %s(tagName)%s {}\n'%(cname, element_string, element_inherit, init_attibutes) + elif classname[0:10] == "SVGPathSeg" and len(classname)>10: + seg_type = classname[10:].upper() + strs = ["ABS", "REL", "HORIZONTAL", "VERTICAL", "CUBIC", "QUADRATIC", "SMOOTH"] + for s in strs: + pos = seg_type.find(s) + if pos>0: + seg_type = seg_type[:pos] + "_" + seg_type[pos:] + seg_type = "wxPATHSEG_" + seg_type + methods_str = methods_str + ' %s():\n wxSVGPathSeg(%s)%s {}\n'%(cname, seg_type, init_attibutes) + elif len(init_attibutes)>0: + methods_str = methods_str + ' %s(): %s {}\n'%(cname, init_attibutes[2:]) + + has_canvas_item = 0 + try: + has_canvas_item=interfaces.interfaces[classname].has_canvas_item + except KeyError: + pass + if has_canvas_item==1: + methods_str = methods_str + ' %s(%s& src);\n'%(cname, cname) + if classname not in copy_constructor_includes: + copy_constructor_includes.append(classname) + attr_init = '' + for (typestr, attrname, ispointer, isenum) in attributes: + attrname=cpp.make_attr_name(attrname) + attr_init = attr_init + "\n %s = src.%s;"%(attrname,attrname) + copy_constructor_impl = copy_constructor_impl + ''' +// %s +%s::%s(%s& src)%s +{%s + m_canvasItem = NULL; +} + +%s::~%s() +{ + if (m_canvasItem) + delete m_canvasItem; +} +'''%(cname, cname, cname, cname, copy_constr_init, attr_init, cname, cname) + + ################# destructor ####################### + has_destructor = 0 + try: + has_destructor=interfaces.interfaces[classname].user_defined_destructor + except KeyError: + pass + if has_destructor == 0: + if has_canvas_item == 0: + methods_str = methods_str + ' virtual ~%s() {}\n'%cname + else: + methods_str = methods_str + ' virtual ~%s();\n'%cname + + ################# CloneNode ####################### + if classname.find("Element")>0 and classdecl in mapDtdIdl.elements_idl_dtd: + methods_str = methods_str + ' wxSvgXmlNode* CloneNode(bool deep = true) { return new %s(*this); }\n'%cpp.fix_typename(classname) + + ################### methods ######################### + try: + for i in interfaces.interfaces[classname].include_methods: + methods_str = methods_str+i + except KeyError: + pass + + for meth in classdecl.methods: + method_ret = '' + return_type = cpp.fix_typename(meth.return_type.name) + if return_type not in cpp.builtin_types: + if meth.return_type.name in ["DOMString"]: # confusion between typedef and class + if "String_wxsvg" not in includes: + includes.append("String_wxsvg") + else: + if meth.return_type.name not in includes: + includes.append(meth.return_type.name) + if meth.return_type.name in ["SVGDocument", "Element"]: + method_ret = return_type + '* ' + elif meth.return_type.name in ["css::CSSValue"]: + method_ret = 'const ' + return_type + '& ' + else: + method_ret = return_type + ' ' + + method_name = meth.name[0].upper() + meth.name[1:]; + if method_name in exclude_methods: + continue + method_decl = method_name + '(' + count=0 + for arg in meth.args: + if count>0: + method_decl = method_decl +', ' + arg_type = cpp.fix_typename(arg.type.name) + if arg_type not in cpp.builtin_types: + if arg.inout == 'in': + method_decl = method_decl + 'const %s& %s'%(arg_type, arg.name) + elif arg.inout == 'inout': + method_decl = method_decl + '%s* %s'%(arg_type, arg.name) + elif arg.inout == 'out': + method_decl = method_decl + '%s* %s'%(arg_type, arg.name) + + if arg.type.name in ["DOMString"]: # confusion between typedef and class + if "String_wxsvg" not in includes: + includes.append("String_wxsvg") + else: + if arg.type.name not in includes: + includes.append(arg.type.name) + else: + if arg_type == "unsigned short": + arg_type = cpp.fix_typename(enum_map.enum_map[classname+'::'+arg.name]) + method_decl = method_decl + '%s %s'%(arg_type, arg.name) + count = count+1 + + method_decl += ')' + if return_type == "wxSVGMatrix" or method_name[0:6] == "Create": + method_decl += ' const' + methods_str = methods_str + ' virtual ' + method_ret + method_decl + ';\n'; + method_decl = cpp.fix_typename(classname) + "::" + method_decl; + cpp_output = cpp_output + method_ret + method_decl + '\n{\n'; + if return_type != "void": + if method_ret.find("*") < 0: + cpp_output = cpp_output + ' ' + method_ret + 'res' + if return_type in cpp.builtin_types: + cpp_output = cpp_output + ' = 0'; + cpp_output = cpp_output + ';\n' + else: + cpp_output = cpp_output + ' ' + method_ret + 'res = new ' + return_type + '();\n' + cpp_output = cpp_output + ' ' + 'return res;' + cpp_output = cpp_output + '\n}\n\n' + + has_dtd_attributes=find_dtd_attr_in_inherit(classdecl) + if has_dtd_attributes==1 and "SetAttribute" not in exclude_methods: + methods_str = methods_str + ' bool HasAttribute(const wxString& name) const;\n'; + methods_str = methods_str + ' wxString GetAttribute(const wxString& name) const;\n'; + methods_str = methods_str + ' bool SetAttribute(const wxString& name, const wxString& value);\n'; + methods_str = methods_str + ' wxSvgXmlAttrHash GetAttributes() const;\n'; + if "String_wxsvg" not in includes: + includes.append("String_wxsvg") + if "Element" not in includes: + includes.append("Element") + doGetAttrByName=1 + if classname in ["SVGStylable", "SVGFEGaussianBlurElement"]: #genSetAttribute.customParser + protected += ' bool HasCustomAttribute(const wxString& name) const;\n'; + protected += ' wxString GetCustomAttribute(const wxString& name) const;\n'; + protected += ' bool SetCustomAttribute(const wxString& name, const wxString& value);\n'; + protected += ' wxSvgXmlAttrHash GetCustomAttributes() const;\n'; + protected += ' bool SetCustomAnimatedValue(const wxString& name, const wxSVGAnimatedType& value);\n'; + if find_anim_dtd_attr_in_inherit(classdecl): + methods_str = methods_str + ' bool SetAnimatedValue(const wxString& name, const wxSVGAnimatedType& value);\n'; + includes.append("SVGAnimatedType") + elif classname == "SVGElement": + methods_str = methods_str + ' virtual bool SetAnimatedValue(const wxString& name, const wxSVGAnimatedType& value) { return false; }\n'; + includes.append("SVGAnimatedType") + + element_string=None + if classdecl in mapDtdIdl.elements_idl_dtd: + element_string=mapDtdIdl.elements_idl_dtd[classdecl] + typename = cpp.fix_typename("SVGDTD") + dtdname = "SVG_" + element_string.upper() + "_ELEMENT" + dtdname = cpp.fix_typename(cpp.make_name(dtdname)) + methods_str = methods_str + ' virtual %s GetDtd() const { return %s; }\n'%(typename,dtdname) + + try: + fwds = interfaces.interfaces[classname].include_fwd_decls + for toto in fwds: + if toto not in fwd_decls: + fwd_decls.append(toto) + except KeyError: + pass + + if len(methods_str): + if len(public): + public = public + ' public:\n' + public = public + methods_str + + # protected + methods_str = '' + try: + for i in interfaces.interfaces[classname].include_methods_protected: + methods_str = methods_str+i + except KeyError: + pass + if len(methods_str): + if len(public): + public = public + '\n protected:\n' + public = public + methods_str + + # end struct + public = public + '};' + + ###################### includes ############################# + includestr="" + for inc in includes: + if inc==classname: + continue + realname = inc + pos = inc.find("::") + if pos>0: + realname = inc[pos+2:] + includestr = includestr + "#include \"%s.h\"\n"%(realname) + + try: + incs = interfaces.interfaces[classname].include_includes + for i in incs: + if i[0] == '<': + includestr = includestr + '#include %s\n'%(i) + else: + includestr = includestr + '#include "%s.h"\n'%(i) + except KeyError: + pass + if len(includestr): + includestr = includestr + '\n' + + fwd_decls_namespace = { "svg":[] } + for i in fwd_decls: + pos = i.find("::") + nspace = i[:pos] + if pos>=0: + if nspace in fwd_decls_namespace: + fwd_decls_namespace[nspace].append(i[pos+2:]) + else: + fwd_decls_namespace[nspace]=[i[pos+2:]] + else: + if i!='Element': + fwd_decls_namespace['svg'].append(i) + + if len(fwd_decls_namespace) > 0: + fwd_decl_str = '' + for (nspace, classnames) in fwd_decls_namespace.items(): + for i in classnames: + fwd_decl_str = fwd_decl_str + 'class %s;\n'%cpp.fix_typename(i) + if len(fwd_decl_str): + fwd_decl_str = fwd_decl_str + '\n' + + ##################### write header files ############################# + if len(protected): + output = output + ' protected:\n' + protected + '\n' + output = output + ' public:\n' + public + header.add_content(fwd_decl_str + includestr + output) + header.dump(path=config.include_dir) + + + ############## write cpp files (disabled) ############################ + if cpp_output != '' and classname.find("List") < 0: + cpp_output = ''' +///////////////////////////////////////////////////////////////////////////// +// Name: %s.cpp +// Purpose: +// Author: Alex Thuering +// Created: 2005/04/29 +// RCS-ID: $Id: generate.py,v 1.27 2014/08/09 11:13:02 ntalex Exp $ +// Copyright: (c) 2005 Alex Thuering +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#include "%s.h"\n +'''%(classname,classname) + cpp_output + #f = genFile.gfopen(os.path.join(config.src_dir, "%s.cpp"%classname),'w') + #f.write(cpp_output) + +###################### Generate copy constructor ############################ +includes = '' +for include in copy_constructor_includes: + includes = includes + '#include "%s.h"\n'%include +impl = cppImpl.Impl("Elements_CopyConstructors", "generate.py") +impl.add_content(includes + copy_constructor_impl) +impl.dump(path=config.src_dir) + +###################### Generate animated, lists, setattribute, ... ########## +for i in used_animated: + genAnimated.generate(i.replace('SVGAnimated','')) + +for i in used_lists: + name = i.replace('List','').replace('SVG','') + genList.generate(name) + +genCSS.generate() + +import genHasAttribute +import genGetAttribute +import genSetAttribute +import genGetAttributes +import genSvgElement + diff -Nru wxsvg-1.4~dfsg/scripts/genFile.py wxsvg-1.5.4/scripts/genFile.py --- wxsvg-1.4~dfsg/scripts/genFile.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genFile.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,57 @@ +############################################################################## +## Name: genFile.py +## Purpose: saves generated files +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: genFile.py,v 1.3 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +class genFile: + def __init__(self, filename): + self.filename = filename + self.content = "" + self.closed=0 + + def __del__(self): + if self.closed==0: + self.close() + + def close(self): + if(self.closed==1): + raise self.filename+' already closed' + writeit=0 + prevContent = None + try: + f = open(self.filename, 'rU') + prevContent = f.read() + if(prevContent != self.content): + #print 'different' + writeit=1 + else: + #print self.filename + " unchanged" + pass + f.close() + except IOError: + #print "can't open" + writeit=1 + + if(writeit==1): + print(self.filename + " changed") + if(prevContent): + f = open(self.filename+'.prev', 'wb') + f.write(bytes(prevContent, 'UTF-8')) + f.close() + f = open(self.filename, 'wb') + f.write(bytes(self.content, 'UTF-8')) + + f.close() + self.closed=1 + + def write(self, s): + self.content = self.content + s + +def gfopen(filename, rw='wb'): + return genFile(filename) + diff -Nru wxsvg-1.4~dfsg/scripts/genGetAttribute.py wxsvg-1.5.4/scripts/genGetAttribute.py --- wxsvg-1.4~dfsg/scripts/genGetAttribute.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genGetAttribute.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,164 @@ +############################################################################## +## Name: genGetAttribute.py +## Purpose: generates Elements_GetAttribute.cpp +## -> GetAttribute() methods for all svg elements +## Author: Alex Thuering +## Created: 2005/09/27 +## RCS-ID: $Id: genGetAttribute.py,v 1.9 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import parse_idl +import mapDtdIdl +import string +import config +import genFile +import cpp +import cppImpl +import enum_map + +customParser = ["SVGStylable", "SVGFEGaussianBlurElement"] ##TODO["SVGMarkerElement"] + +includes = ["String_wxsvg"] +already_done={} +output_cpps = {} + +def process(classdecl): + if classdecl.name in already_done.keys(): + return already_done[classdecl.name]; + + already_done[classdecl.name] = 0 + nattr=0 + func_body = '' + + for attr in classdecl.attributes: + try: + entity_name = mapDtdIdl.attributes_idl_dtd[attr] + except KeyError: + #print classdecl.name, attr ###### TODO + #print classdecl + #print mapDtdIdl.attributes_idl_dtd + #raise "" + continue + + if nattr == 0: + includes.append(classdecl.name) + nattr = nattr + 1 + + get_attr = cpp.make_attr_name(attr.name) + typestr = attr.type.name + anim_pos = typestr.find('Animated') + if anim_pos>=0 and typestr != "SVGAnimatedType": # SVGAnimatedTypename + typestr = typestr[anim_pos+len('Animated'):] + get_attr = get_attr + '.GetBaseVal()' + + #print classdecl.name, typestr + if typestr in ["Integer", "Boolean", "Enumeration", "unsigned short"]: + etype = '' + if typestr == "Integer": + etype = '(long int) ' + elif typestr == "Boolean": + etype = '(bool) ' + elif typestr == "Enumeration": + etype = '(char) ' + elif typestr == "unsigned short": + if classdecl.name == "SVGZoomAndPan": + etype = '(wxSVG_ZOOMANDPAN) ' + elif classdecl.name == "SVGColorProfileElement": + etype = '(wxRENDERING_INTENT) ' + if classdecl.name == "SVGGradientElement" and attr.name == "gradientUnits": + get_attr = ''' { + if (%s == wxSVG_UNIT_TYPE_USERSPACEONUSE) + return wxT("userSpaceOnUse"); + else if (%s == wxSVG_UNIT_TYPE_OBJECTBOUNDINGBOX) + return wxT("objectBoundingBox"); + return wxT(""); + }'''%(get_attr,get_attr) + elif (classdecl.name + '::' + attr.name) in enum_map.enum_map: + get_attr2 = '' + for enum in classdecl.enums: + if enum.name == enum_map.enum_map[classdecl.name + '::' + attr.name]: + get_attr2 = " switch (%s) {\n"%get_attr + for const_decl in enum.const_decls: + enum_str = const_decl.name.split('_')[-1].lower() + if enum_str != 'unknown': + get_attr2 = get_attr2 + ' case %s:\n'%(cpp.fix_typename('%s'%const_decl.name)) + get_attr2 = get_attr2 + ' return wxT("%s");\n'%(enum_str) + get_attr = get_attr2 + ' default:\n return wxT("");\n }' + break + if (not len(get_attr2)): + get_attr = etype + get_attr + get_attr = ' return wxString::Format(wxT("%%d"), %s);'%get_attr + else: + get_attr = etype + get_attr + get_attr = ' return wxString::Format(wxT("%%d"), %s);'%get_attr + elif typestr in ["float", "Number"]: + get_attr = ' return wxString::Format(wxT("%%g"), %s);'%get_attr + elif typestr == "css::CSSStyleDeclaration": + get_attr = ' return %s.GetCSSText();'%get_attr + elif typestr in ["SVGLength", "Length", "Rect", "PreserveAspectRatio", "SVGAnimatedType"] or typestr[-4:] == "List": + get_attr = ' return %s.GetValueAsString();'%get_attr + else: + get_attr = ' return ' + get_attr + ';' + func_body = func_body + 'if (attrName == wxT("%s"))\n'%entity_name + func_body = func_body + get_attr + '\n else ' + + for inh in classdecl.inherits: + if inh in ["Element", "events::EventTarget", "events::DocumentEvent", + "css::ViewCSS", "css::DocumentCSS", "css::CSSValue", + "smil::ElementTimeControl", "Document", "events::UIEvent", + "css::CSSRule", "events::Event"]: + continue + res = process(parse_idl.class_decls[inh]) + if res>0: + if nattr==0: + includes.append(classdecl.name) + + nattr = nattr + res + func_body = func_body + 'if (wx%s::HasAttribute(attrName))\n'%inh + func_body = func_body + ' return wx%s::GetAttribute(attrName);\n'%inh + func_body = func_body + ' else ' + + if nattr>0: + if classdecl.name in customParser: + func_body = func_body + 'if (HasCustomAttribute(attrName))\n' + func_body = func_body + ' return GetCustomAttribute(attrName);\n' + func_body = func_body + ' else' + if classdecl in mapDtdIdl.elements_idl_dtd: + func_body = func_body + '\n return wxT("");\n' #wxLogDebug(wxT("unknown attribute %s::") + attrName);%(classdecl.name) + else: + func_body = func_body + '\n return wxT("");\n' + + output_cpp = ''' +// wx%s +wxString wx%s::GetAttribute(const wxString& attrName) const { + %s + return wxT(""); +} +'''%(classdecl.name, classdecl.name, func_body) + + output_cpps[classdecl.name]=output_cpp + + already_done[classdecl.name] = nattr + return nattr + + +if len(parse_idl.class_decls): + cnames = parse_idl.class_decls.keys() + for name in cnames: + process(parse_idl.class_decls[name]) + +output_cpp="" +if len(output_cpps): + for name in sorted(output_cpps.keys()): + output_cpp = output_cpp + output_cpps[name] + +includestr='' +for i in includes: + includestr = includestr + '#include "%s.h"\n'%i + +impl = cppImpl.Impl("Elements_GetAttribute", "genGetAttribute.py") +impl.add_content(includestr + output_cpp) +impl.dump(path=config.src_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/genGetAttributes.py wxsvg-1.5.4/scripts/genGetAttributes.py --- wxsvg-1.4~dfsg/scripts/genGetAttributes.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genGetAttributes.py 2014-03-28 07:51:32.000000000 +0000 @@ -0,0 +1,162 @@ +############################################################################## +## Name: genGetAttributes.py +## Purpose: generates Elements_GetAttributes.cpp +## -> GetAttributes() methods for all svg elements +## Author: Alex Thuering +## Created: 2005/09/27 +## RCS-ID: $Id: genGetAttributes.py,v 1.13 2014/03/28 07:51:32 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import parse_idl +import mapDtdIdl +import string +import config +import genFile +import cpp +import cppImpl +import enum_map + +customParser = ["SVGStylable", "SVGFEGaussianBlurElement"] ##TODO["SVGMarkerElement"] + +includes = ["String_wxsvg"] +already_done={} +output_cpps = {} + +def process(classdecl): + if classdecl.name in already_done.keys(): + return already_done[classdecl.name]; + + already_done[classdecl.name] = 0 + nattr=0 + func_body = '' + + for attr in classdecl.attributes: + try: + entity_name = mapDtdIdl.attributes_idl_dtd[attr] + except KeyError: + #print classdecl.name, attr ###### TODO + #print classdecl + #print mapDtdIdl.attributes_idl_dtd + #raise "" + continue + + if nattr == 0: + includes.append(classdecl.name) + nattr = nattr + 1 + + get_attr = cpp.make_attr_name(attr.name) + typestr =attr.type.name + anim_pos = typestr.find('Animated') + if anim_pos>=0 and typestr != "SVGAnimatedType": # SVGAnimatedTypename + typestr = typestr[anim_pos+len('Animated'):] + get_attr = get_attr + '.GetBaseVal()' + + #print classdecl.name + '::' + attr.name, typestr + check = '' + if typestr in ["String", "DOMString"]: + check = '!%s.IsEmpty()'%get_attr + elif typestr in ["Integer", "Boolean", "Enumeration", "unsigned short"]: + etype = '' + if typestr == "Integer": + etype = '(long int) ' + elif typestr == "Boolean": + check = get_attr + etype = '(bool) ' + elif typestr == "Enumeration": + check = '%s != 0'%get_attr + etype = '(char) ' + elif typestr == "unsigned short": + if classdecl.name == "SVGZoomAndPan": + check = '%s != wxSVG_ZOOMANDPAN_UNKNOWN'%get_attr + etype = '(wxSVG_ZOOMANDPAN) ' + elif classdecl.name == "SVGColorProfileElement": + etype = '(wxRENDERING_INTENT) ' + if classdecl.name == "SVGGradientElement" and attr.name == "gradientUnits": + check = '%s != wxSVG_UNIT_TYPE_UNKNOWN && %s != wxSVG_UNIT_TYPE_OBJECTBOUNDINGBOX'%(get_attr,get_attr) + get_attr = 'wxT("userSpaceOnUse")' + elif (classdecl.name + '::' + attr.name) in enum_map.enum_map: + def_enum = '' + for enum in classdecl.enums: + if enum.name == enum_map.enum_map[classdecl.name + '::' + attr.name] and len(enum.const_decls): + def_enum = cpp.fix_typename('%s'%enum.const_decls[0].name) + if (len(def_enum)): + check = '%s != %s'%(get_attr,def_enum) + get_attr = 'GetAttribute(wxT("%s"))'%attr.name + else: + get_attr = etype + get_attr + get_attr = 'wxString::Format(wxT("%%d"), %s)'%get_attr + else: + get_attr = etype + get_attr + get_attr = 'wxString::Format(wxT("%%d"), %s)'%get_attr + elif typestr in ["float", "Number"]: + check = '%s > 0'%get_attr + get_attr = 'wxString::Format(wxT("%%g"), %s)'%get_attr + elif typestr == "css::CSSStyleDeclaration": + check = '!%s.empty()'%get_attr + get_attr = '%s.GetCSSText()'%get_attr + elif typestr in ["SVGLength", "Length", "Rect", "PreserveAspectRatio", "SVGAnimatedType"] or typestr[-4:] == "List": + if typestr == "Length" or typestr == "SVGLength": + check = '%s.GetUnitType() != wxSVG_LENGTHTYPE_UNKNOWN'%get_attr + elif typestr == "PreserveAspectRatio": + check = '%s.GetAlign() != wxSVG_PRESERVEASPECTRATIO_UNKNOWN'%get_attr + elif typestr == "SVGAnimatedType": + check = '%s.GetPropertyType() != wxSVG_ANIMATED_UNKNOWN'%get_attr + else: + check = '!%s.IsEmpty()'%get_attr + get_attr = '%s.GetValueAsString()'%get_attr + if len(check)>0: + func_body = func_body + ' if (%s)\n '%check + func_body = func_body + ' attrs.Add(wxT("%s"), %s);\n'%(entity_name, get_attr) + if classdecl.name in customParser: + func_body = func_body + ' attrs.Add(GetCustomAttributes());\n' + + for inh in classdecl.inherits: + if inh in ["Element", "events::EventTarget", "events::DocumentEvent", + "css::ViewCSS", "css::DocumentCSS", "css::CSSValue", + "smil::ElementTimeControl", "Document", "events::UIEvent", + "css::CSSRule", "events::Event"]: + continue + res = process(parse_idl.class_decls[inh]) + if res>0: + if nattr==0: + includes.append(classdecl.name) + nattr = nattr+res + func_body = func_body + ' attrs.Add(wx%s::GetAttributes());\n'%inh + + if nattr>0: + output_cpp = ''' +// wx%s +wxSvgXmlAttrHash wx%s::GetAttributes() const +{ + wxSvgXmlAttrHash attrs; +%s\ + return attrs; +} +'''%(classdecl.name, classdecl.name, func_body) + + output_cpps[classdecl.name]=output_cpp + + already_done[classdecl.name] = nattr + return nattr + + +if len(parse_idl.class_decls): + cnames = parse_idl.class_decls.keys() + for name in cnames: + process(parse_idl.class_decls[name]) + +output_cpp="" +if len(output_cpps): + for name in sorted(output_cpps.keys()): + output_cpp = output_cpp + output_cpps[name] + +includestr='' +for i in includes: + includestr = includestr + '#include "%s.h"\n'%i + +impl = cppImpl.Impl("Elements_GetAttributes", "genGetAttributes.py") +impl.add_content(includestr + output_cpp) +impl.dump(path=config.src_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/genHasAttribute.py wxsvg-1.5.4/scripts/genHasAttribute.py --- wxsvg-1.4~dfsg/scripts/genHasAttribute.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genHasAttribute.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,100 @@ +############################################################################## +## Name: genHasAttribute.py +## Purpose: generates Elements_HasAttribute.cpp +## -> HasAttribute() methods for all svg elements +## Author: Alex Thuering +## Created: 2005/09/27 +## RCS-ID: $Id: genHasAttribute.py,v 1.7 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import parse_idl +import mapDtdIdl +import string +import config +import genFile +import cpp +import cppImpl + +customParser = ["SVGStylable", "SVGFEGaussianBlurElement"] ##TODO["SVGMarkerElement"] + +includes = ["String_wxsvg"] +already_done={} +output_cpps = {} + +def process(classdecl): + if classdecl.name in already_done.keys(): + return already_done[classdecl.name]; + + already_done[classdecl.name] = 0 + nattr=0 + func_body = '' + + for attr in classdecl.attributes: + try: + entity_name = mapDtdIdl.attributes_idl_dtd[attr] + except KeyError: + #print(classdecl.name, attr) ###### TODO + #print classdecl + #print mapDtdIdl.attributes_idl_dtd + #raise "" + continue + + if nattr == 0: + includes.append(classdecl.name) + nattr = nattr + 1 + + if len(func_body): + func_body = func_body + " ||\n " + func_body = func_body + 'attrName == wxT("%s")'%entity_name + + for inh in classdecl.inherits: + if inh in ["Element", "events::EventTarget", "events::DocumentEvent", + "css::ViewCSS", "css::DocumentCSS", "css::CSSValue", + "smil::ElementTimeControl", "Document", "events::UIEvent", + "css::CSSRule", "events::Event"]: + continue + res = process(parse_idl.class_decls[inh]) + if res>0: + if nattr==0: + includes.append(classdecl.name) + + nattr = nattr+res + if len(func_body): + func_body = func_body + " ||\n " + func_body = func_body + 'wx%s::HasAttribute(attrName)'%inh + + if nattr>0: + if classdecl.name in customParser: + func_body = func_body + ' ||\n HasCustomAttribute(attrName)' + output_cpp = ''' +// wx%s +bool wx%s::HasAttribute(const wxString& attrName) const { + return %s; +} +'''%(classdecl.name, classdecl.name, func_body) + output_cpps[classdecl.name]=output_cpp + + already_done[classdecl.name] = nattr + return nattr + + +if len(parse_idl.class_decls): + cnames = parse_idl.class_decls.keys() + for name in cnames: + process(parse_idl.class_decls[name]) + +output_cpp="" +if len(output_cpps): + for name in sorted(output_cpps.keys()): + output_cpp = output_cpp + output_cpps[name] + +includestr='' +for i in includes: + includestr = includestr + '#include "%s.h"\n'%i + +impl = cppImpl.Impl("Elements_HasAttribute", "genHasAttribute.py") +impl.add_content(includestr + output_cpp) +impl.dump(path=config.src_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/genList.py wxsvg-1.5.4/scripts/genList.py --- wxsvg-1.4~dfsg/scripts/genList.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genList.py 2007-10-30 21:59:23.000000000 +0000 @@ -0,0 +1,60 @@ +############################################################################## +## Name: genList.py +## Purpose: generates all SVG*List.h/cpp +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: genList.py,v 1.7 2007/10/30 21:59:23 etisserant Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import config +import genAnimated +import cpp +import cppHeader +import cppImpl + +def generate(name): + if name == "PathSeg" or name == "ElementInstance": + return + typename = genAnimated.getBaseType(name) + include = "" + if name == "String": + include = '#include "String_wxsvg.h"\n' + elif typename not in cpp.builtin_types: + include = '#include "SVG%s.h"\n'%name + + output = '''%s#include "String_wxsvg.h" +#include +WX_DECLARE_OBJARRAY(%s, wxSVG%sListBase); + +class wxSVG%sList: public wxSVG%sListBase +{ + public: + wxSVG%sList() {} + + wxString GetValueAsString() const; + void SetValueAsString(const wxString& value); +};'''%(include,typename,name,name,name,name) + header = cppHeader.Header("SVG%sList"%name, "genList.py") + header.add_content(output) + header.dump(path=config.include_dir) + + output = '''#include "SVG%sList.h" +#include +WX_DEFINE_OBJARRAY(wxSVG%sListBase); + +wxString wxSVG%sList::GetValueAsString() +{ + wxString value; + return value; +} + +void wxSVG%sList::SetValueAsString(const wxString& value) +{ + +}'''%(name,name,name,name) +# impl = cppImpl.Impl("SVG%sList"%name, "genList.py") +# impl.add_content(output) +# impl.dump(path=config.src_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/genSetAttribute.py wxsvg-1.5.4/scripts/genSetAttribute.py --- wxsvg-1.4~dfsg/scripts/genSetAttribute.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genSetAttribute.py 2014-03-27 08:38:04.000000000 +0000 @@ -0,0 +1,242 @@ +############################################################################## +## Name: genSetAttribute.py +## Purpose: generates Elements_SetAttribute.cpp +## -> SetAttribute() methods for all svg elements +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: genSetAttribute.py,v 1.16 2014/03/27 08:38:04 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import parse_idl +import mapDtdIdl +import string +import config +import genFile +import cpp +import cppImpl +import enum_map + +customParser = ["SVGStylable", "SVGFEGaussianBlurElement"] ##TODO["SVGMarkerElement"] + +includes = ["String_wxsvg"] +already_done={} +output_cpps = {} + +def process(classdecl): + if classdecl.name in already_done.keys(): + return already_done[classdecl.name]; + + already_done[classdecl.name] = 0 + nattr=0 + func_body = '' + func_body_anim = '' + + for attr in classdecl.attributes: + try: + entity_name = mapDtdIdl.attributes_idl_dtd[attr] + except KeyError: + #print classdecl.name, attr ###### TODO + #print classdecl + #print mapDtdIdl.attributes_idl_dtd + #raise "" + continue + + if nattr == 0: + includes.append(classdecl.name) + nattr = nattr + 1 + + attr_name = cpp.make_attr_name(attr.name) + set_attr = attr_name + typestr = attr.type.name + anim_pos = -1 + if typestr != "SVGAnimatedType": + anim_pos = typestr.find('Animated') + if anim_pos >= 0: # SVGAnimatedTypename + typestr = typestr[anim_pos + len('Animated'):] + if typestr not in ["float", "Number", "Integer", "Boolean", "Enumeration", "unsigned short"]: + set_attr = set_attr + '.GetBaseVal()' + set_attr_anim = '' + + #print classdecl.name, attr.name, typestr + if typestr in ["Integer", "Boolean", "Enumeration", "unsigned short"]: + etype = '' + if typestr == "Integer": + etype = '(long int) ' + elif typestr == "Boolean": + etype = '(bool) ' + elif typestr == "Enumeration": + etype = '(unsigned char) ' + elif typestr == "unsigned short": + if classdecl.name == "SVGZoomAndPan": + etype = '(wxSVG_ZOOMANDPAN) ' + elif classdecl.name == "SVGColorProfileElement": + etype = '(wxRENDERING_INTENT) ' + if anim_pos >= 0: + set_attr = '%s.SetBaseVal(%svalue)'%(set_attr,etype) + set_attr_anim = '%s.SetAnimVal(%sattrValue.GetLength().GetValue());'%(attr_name,etype) + else: + set_attr = '%s = %svalue'%(set_attr,etype) + if classdecl.name == "SVGGradientElement" and attr.name == "gradientUnits": + set_attr = ''' { + wxSVG_UNIT_TYPE value = wxSVG_UNIT_TYPE_UNKNOWN; + if (attrValue.Lower() == wxT("userspaceonuse")) + value = wxSVG_UNIT_TYPE_USERSPACEONUSE; + else if (attrValue.Lower() == wxT("objectboundingbox")) + value = wxSVG_UNIT_TYPE_OBJECTBOUNDINGBOX; + %s; + }'''%set_attr + elif (classdecl.name + '::' + attr.name) in enum_map.enum_map: + set_attr2 = '' + for enum in classdecl.enums: + if enum.name == enum_map.enum_map[classdecl.name + '::' + attr.name] and len(enum.const_decls): + set_attr2 = ' {\n %s value = %s;\n'%(cpp.fix_typename(enum.name), cpp.fix_typename('%s'%enum.const_decls[0].name)) + for const_decl in enum.const_decls[1:]: + set_attr2 = set_attr2 + ' ' + if const_decl.name != enum.const_decls[1].name: + set_attr2 = set_attr2 + 'else ' + set_attr2 = set_attr2 + 'if (attrValue.Lower() == wxT("%s"))\n'%(const_decl.name.split('_')[-1].lower()) + set_attr2 = set_attr2 + ' value = %s;\n'%(cpp.fix_typename('%s'%const_decl.name)) + set_attr = set_attr2 + ' %s;\n }'%set_attr + break + if (not len(set_attr2)): + set_attr = ' {\n long value;\n if (attrValue.ToLong(&value))\n %s;\n }'%set_attr + else: + set_attr = ' {\n long value;\n if (attrValue.ToLong(&value))\n %s;\n }'%set_attr + elif typestr in ["float", "Number"]: + if anim_pos >= 0: + set_attr = '%s.SetBaseVal(value)'%set_attr + set_attr_anim = '%s.SetAnimVal(attrValue.GetLength().GetValue());'%attr_name + else: + set_attr = '%s = value'%set_attr + calc_proc = '' + if classdecl.name == "SVGStopElement" and attr.name == "offset": + calc_proc = 'if (attrValue.Last() == wxT(\'%%\') && attrValue.Left(attrValue.Length()-1).ToDouble(&value))\n {\n value = value/100;\n %s;\n }\n else '%set_attr + set_attr = " {\n double value;\n %sif (attrValue.ToDouble(&value))\n %s;\n }"%(calc_proc,set_attr) + elif typestr == "css::CSSStyleDeclaration": + set_attr = ' %s.SetCSSText(attrValue);'%set_attr + elif typestr in ["Rect"] or typestr[-4:] == "List": + set_attr = ' %s.SetValueAsString(attrValue);'%set_attr + if anim_pos >= 0: + set_attr_anim += 'if (attrValue.GetPropertyType() == wxSVG_ANIMATED_LENGTH_LIST) {\n' + if typestr == "NumberList": + set_attr_anim += "\t wxSVGNumberList list;\n" + set_attr_anim += "\t for (unsigned int i = 0; i < attrValue.GetLengthList().size(); i++) {\n" + set_attr_anim += "\t\tlist.push_back(attrValue.GetLengthList()[i].GetValue());\n" + set_attr_anim += "\t }\n" + set_attr_anim += '\t %s.SetAnimVal(list);\n'%attr_name + set_attr_anim += '\t} else if (attrValue.GetPropertyType() == wxSVG_ANIMATED_NUMBER_LIST) {\n' + set_attr_anim += '\t %s.SetAnimVal(attrValue.GetNumberList());\n'%attr_name + elif typestr == "TransformList": + set_attr_anim += '\t %s.SetAnimVal(attrValue.GetTransformList());\n'%attr_name + elif typestr == "Rect": + set_attr_anim += '\t if (attrValue.GetLengthList().size() >= 4) {\n' + set_attr_anim += '\t\tconst wxSVGLengthList& list = attrValue.GetLengthList();\n' + set_attr_anim += '\t\t%s.SetAnimVal(wxSVGRect(list[0], list[1], list[2], list[3]));\n'%attr_name + set_attr_anim += '\t }\n' + else: + set_attr_anim += '\t %s.SetAnimVal(attrValue.GetLengthList());\n'%attr_name + set_attr_anim += '\t} else {\n' + set_attr_anim += '\t %s.ResetAnimVal();\n'%attr_name + set_attr_anim += '\t}' + elif typestr in ["SVGLength", "Length", "PreserveAspectRatio", "SVGAnimatedType"]: + set_attr = ' %s.SetValueAsString(attrValue);'%set_attr + if anim_pos >= 0: + if typestr == "PreserveAspectRatio": + set_attr_anim += 'if (attrValue.GetPropertyType() == wxSVG_ANIMATED_STRING) {\n' + set_attr_anim += '\t wxSVGPreserveAspectRatio ratio;\n' + set_attr_anim += '\t ratio.SetValueAsString(attrValue.GetString());\n' + set_attr_anim += '\t %s.SetAnimVal(ratio);\n'%attr_name + else: + set_attr_anim += 'if (attrValue.GetPropertyType() == wxSVG_ANIMATED_LENGTH) {\n' + set_attr_anim += '\t %s.SetAnimVal(attrValue.GetLength().GetValue());\n'%attr_name + set_attr_anim += '\t} else {\n' + set_attr_anim += '\t %s.ResetAnimVal();\n'%attr_name + set_attr_anim += '\t}' + else: + set_attr = '\t' + set_attr + ' = attrValue;' + if anim_pos >= 0: + set_attr_anim += 'if (attrValue.GetPropertyType() != wxSVG_ANIMATED_UNKNOWN) {\n' + set_attr_anim += '\t %s.SetAnimVal(attrValue.GetString());\n'%attr_name + set_attr_anim += '\t} else {\n' + set_attr_anim += '\t %s.ResetAnimVal();\n'%attr_name + set_attr_anim += '\t}' + func_body = func_body + 'if (attrName == wxT("%s"))\n'%entity_name + func_body = func_body + set_attr + '\n else ' + if len(set_attr_anim): + func_body_anim += 'if (attrName == wxT("%s")) {\n'%entity_name + func_body_anim += ' ' + set_attr_anim + '\n } else ' + + for inh in classdecl.inherits: + if inh in ["Element", "events::EventTarget", "events::DocumentEvent", + "css::ViewCSS", "css::DocumentCSS", "css::CSSValue", + "smil::ElementTimeControl", "Document", "events::UIEvent", + "css::CSSRule", "events::Event"]: + continue + res = process(parse_idl.class_decls[inh]) + if res > 0: + if nattr == 0: + includes.append(classdecl.name) + nattr = nattr + res + func_body = func_body + "if (wx%s::SetAttribute(attrName, attrValue));\n else "%(inh) + has_anim = 0 + if len(parse_idl.class_decls[inh].attributes): + for attr in parse_idl.class_decls[inh].attributes: + if attr in mapDtdIdl.attributes_idl_dtd and attr.type.name[0:11] == "SVGAnimated" and attr.type.name != "SVGAnimatedType": + has_anim = 1 + break + if has_anim and parse_idl.class_decls[inh].name != "SVGExternalResourcesRequired": + func_body_anim += "if (wx%s::SetAnimatedValue(attrName, attrValue));\n else "%(inh) + + if nattr > 0: + if classdecl.name in customParser: + func_body += "if (SetCustomAttribute(attrName, attrValue));\n else" + func_body_anim += "if (SetCustomAnimatedValue(attrName, attrValue));\n else " + + #if it's an element + #if classdecl.name.find("Element")>0 and classdecl.name != "SVGElement": + if classdecl in mapDtdIdl.elements_idl_dtd: + func_body = func_body + '\n {\n //wxLogDebug(wxT("unknown attribute %s::") + attrName);\n return false;\n }\n'%(classdecl.name) + else: + func_body = func_body +'\n return false;\n' + + output_cpp = ''' +// wx%s +bool wx%s::SetAttribute(const wxString& attrName, const wxString& attrValue) { + %s + return true; +}\n'''%(classdecl.name, classdecl.name, func_body) + if len(func_body_anim): + output_cpp += ''' +bool wx%s::SetAnimatedValue(const wxString& attrName, const wxSVGAnimatedType& attrValue) { + %s{ + return false; + } + return true; +}\n'''%(classdecl.name, func_body_anim) + + output_cpps[classdecl.name]=output_cpp + + already_done[classdecl.name] = nattr + return nattr + + +if len(parse_idl.class_decls): + cnames = parse_idl.class_decls.keys() + for name in cnames: + process(parse_idl.class_decls[name]) + +output_cpp="" +if len(output_cpps): + for name in sorted(output_cpps.keys()): + output_cpp = output_cpp + output_cpps[name] + +includestr='' +for i in includes: + includestr = includestr + '#include "%s.h"\n'%i + +impl = cppImpl.Impl("Elements_SetAttribute", "genSetAttribute.py") +impl.add_content(includestr + output_cpp) +impl.dump(path=config.src_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/genSvgElement.py wxsvg-1.5.4/scripts/genSvgElement.py --- wxsvg-1.4~dfsg/scripts/genSvgElement.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/genSvgElement.py 2014-03-21 21:15:36.000000000 +0000 @@ -0,0 +1,96 @@ +############################################################################## +## Name: genSvgElement.py +## Purpose: generates svg.h, SVGDTD.h and SVGDocument_CreateElement.cpp +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: genSvgElement.py,v 1.7 2014/03/21 21:15:36 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import string + +import parse_dtd +import cpp +import cppHeader +import cppImpl +import config + +translate_to_classname = { + "Tbreak": "TBreak", + "Tspan": "TSpan", + "Tref": "TRef", + "Mpath": "MPath", + "Svg": "SVG", + "Vkern": "VKern", + "Hkern": "HKern" +} + +def make_cppname(name): + beg=0 + while 1: + pos = name.find('-', beg) + if pos==-1: + pos = name.find('-', beg) + if pos>0: + res = name[:pos]+ name[pos+1].upper() + name[pos+2:] + name=res + beg=pos + else: + break + + if name[:2]=="Fe": + name = "FE" + name[2:] + else: + try: + tmp=translate_to_classname[name] + name = tmp + except KeyError: + pass + return name + + +all_headers=[] +all_elements = [] + +for name, entity_types in parse_dtd.attlists.items(): + all_elements.append(name) + +includes ='' +create = '' +dtdenum = '' + +for element_dtd_name in sorted(all_elements): + classname = element_dtd_name[0].upper()+element_dtd_name[1:] + classname = make_cppname(classname) + dtdname = element_dtd_name.replace('-', '_') + dtdname = dtdname.replace(':', '_') + includes = includes + '#include "SVG%sElement.h"\n'%(classname) + dtdenum = dtdenum + ' wxSVG_%s_ELEMENT,\n'%(dtdname.upper()) + create = create + '''if (qualifiedName == wxT("%s")) + res = new wxSVG%sElement(); + else '''%(element_dtd_name, classname) + +create = '''wxSvgXmlElement* wxSVGDocument::CreateElementNS(const wxString& namespaceURI, + const wxString& qualifiedName) +{ + wxSVGElement* res = NULL; + ''' + create + ''' + res = new wxSVGGElement(); + return res; +}''' +dtdenum = 'enum wxSVGDTD\n{\n' + dtdenum + ' wxSVG_UNKNOWN_ELEMENT\n};' + +impl = cppImpl.Impl("SVGDocument_CreateElement", "genSvgElement.py") +impl.add_content(create) +impl.dump(path=config.src_dir) + +includes = includes + '#include "SVGDocument.h"\n' +header = cppHeader.Header("svg", "genSvgElement.py") +header.add_content(includes) +header.dump(path=config.include_dir) + +header = cppHeader.Header("SVGDTD", "genSvgElement.py") +header.add_content(dtdenum) +header.dump(path=config.include_dir) + diff -Nru wxsvg-1.4~dfsg/scripts/idl.py wxsvg-1.5.4/scripts/idl.py --- wxsvg-1.4~dfsg/scripts/idl.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/idl.py 2014-03-27 08:38:03.000000000 +0000 @@ -0,0 +1,106 @@ +############################################################################## +## Name: idl.py +## Purpose: +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: idl.py,v 1.2 2014/03/27 08:38:03 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +class class_decl: + def __init__(self, name=None, inherits=[], methods=[], enums=[], attributes=[]): + self.name = name + self.inherits = inherits + self.methods = methods + self.enums = enums + self.attributes = attributes + + def __str__(self): + output = '''class %s\n'''%self.name + + output = output + 'inherits:\n' + for i in self.inherits: + output = output + '\t' + str(i) +'\n' + + output = output + 'methods:\n' + for i in self.methods: + output = output + '\t' + str(i) +'\n' + + output = output + 'enums:\n' + for i in self.enums: + output = output + '\t' + str(i) +'\n' + + output = output + 'attributes:\n' + for i in self.attributes: + output = output + '\t' + str(i) +'\n' + + return output + +class method_decl: + def __init__(self, return_type=None, name=None, args=[], exceptions=[], class_decl=None): + self.name = name + self.return_type = return_type + self.args=args + self.class_decl=class_decl + self.exceptions = exceptions + + def __str__(self): + output = str(self.return_type) + ' ' + self.name + '( ' + for i in self.args: + output = output + str(i) + ',' + output = output + ') raises (' + for i in self.exceptions: + output = output + str(i) + output = output + ')' + return output + +class arg_decl: + def __init__(self, name=None, type=None, inout=None): + self.name = name + self.type = type + self.inout=inout + + def __str__(self): + output = '' + if(self.inout): + output = self.inout + output = output + ' ' + str(self.type) + if (self.name): + output = output + ' ' + self.name + return output + +class enum_decl: + def __init__(self, name='', const_decls=[], class_decl=None): + self.name = name + self.const_decls = const_decls + self.class_decl = class_decl + + def __str__(self): + output = 'enum ' + self.name + ' {\n' + for i in self.const_decls: + output = output + '\t' + str(i) + ',\n' + output = output + '};' + return output + +class const_decl: + def __init__(self, name, value): + self.name = name + self.value = value + + def __str__(self): + return str(self.name) + ' = ' + self.value + +class type_decl: + def __init__(self, name, const=0, pointer=0, reference=0): + self.name = name + self.const = const + self.pointer = pointer + self.reference = reference + + def __str__(self): + output='' + if self.const==1: + output = output + 'readonly ' + return output + self.name + diff -Nru wxsvg-1.4~dfsg/scripts/interfaces.py wxsvg-1.5.4/scripts/interfaces.py --- wxsvg-1.4~dfsg/scripts/interfaces.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/interfaces.py 2014-08-09 11:13:02.000000000 +0000 @@ -0,0 +1,487 @@ +############################################################################## +## Name: interface.py +## Purpose: +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: interfaces.py,v 1.41 2014/08/09 11:13:02 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +class interface: + def __init__(self): + self.exclude_methods = [] + self.exclude_attributes = [] + self.include_methods = [] + self.include_methods_protected = [] + self.include_attributes = [] + self.include_attributes_init = [] + self.include_get_set_attributes = [] + self.include_includes = [] + self.include_fwd_decls = [] + self.user_defined_constructor=0 + self.user_defined_destructor=0 + self.has_canvas_item=0 + +interfaces={} + +#SVGElement +inter = interface() +interfaces["SVGElement"]=inter +inter.include_attributes.append(''' + public: + virtual wxSVGElement* GetSvgElement(){return this;} + wxSVGElement(wxString tagName = wxT("")): + wxSvgXmlElement(wxSVGXML_ELEMENT_NODE, tagName), + m_ownerSVGElement(NULL), m_viewportElement(NULL) { } + virtual ~wxSVGElement() {} + + virtual wxSVGDTD GetDtd() const = 0; + virtual void AddProperty(const wxString& name, const wxString& value) + { SetAttribute(name, value); } +''') +# , m_dirty(true) +# bool m_dirty; +# inline bool IsDirty() { return m_dirty; } +# inline void SetDirty(bool dirty = true) { m_dirty = dirty; } +inter.include_fwd_decls=["SVGSVGElement", "SVGDocument"] +inter.include_includes=["SVGDTD"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGLocatable +inter = interface() +interfaces["SVGLocatable"]=inter +inter.include_methods.append(' virtual wxSVGRect GetBBox(wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER) = 0;\n') +inter.include_methods.append(' virtual wxSVGRect GetResultBBox(wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER) = 0;\n') +inter.include_methods.append(' virtual wxSVGMatrix GetCTM() = 0;\n') +inter.include_methods.append(' virtual wxSVGMatrix GetScreenCTM() = 0;\n') +inter.include_methods.append(' static wxSVGRect GetElementBBox(const wxSVGElement* element, wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER);\n') +inter.include_methods.append(' static wxSVGRect GetElementResultBBox(const wxSVGElement* element, wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER);\n') +inter.include_methods.append(' static wxSVGMatrix GetCTM(const wxSVGElement* element);\n') +inter.include_methods.append(' static wxSVGMatrix GetScreenCTM(const wxSVGElement* element);\n') +inter.include_methods.append(' static wxSVGMatrix GetParentMatrix(const wxSVGElement* element);\n') +inter.include_methods_protected.append(' static wxSVGRect GetChildrenBBox(const wxSVGElement* element, wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER);\n') +inter.include_methods_protected.append(' static wxSVGRect GetChildrenResultBBox(const wxSVGElement* element, wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER);\n') +inter.include_methods_protected.append(' inline wxSVGMatrix GetMatrix(wxSVG_COORDINATES coordinates)\n') +inter.include_methods_protected.append(' { return coordinates == wxSVG_COORDINATES_SCREEN ? GetScreenCTM() : (coordinates == wxSVG_COORDINATES_VIEWPORT ? GetCTM() : wxSVGMatrix()); }\n') +inter.exclude_methods = ["GetBBox", "GetResultBBox", "GetCTM", "GetScreenCTM"] +inter.include_includes=["SVGCoordinates"] + +# SVGTransformable +inter = interface() +interfaces["SVGTransformable"]=inter +inter.include_methods.append(' void Transform(const wxSVGMatrix& matrix);\n') +inter.include_methods.append(' void Translate(double tx, double ty);\n') +inter.include_methods.append(' void Scale(double s);\n') +inter.include_methods.append(' void Scale(double sx, double sy);\n') +inter.include_methods.append(' void Rotate(double angle, double cx = 0, double cy = 0);\n') +inter.include_methods.append(' void SkewX(double angle);\n') +inter.include_methods.append(' void SkewY(double angle);\n') +inter.include_methods.append(' void UpdateMatrix(wxSVGMatrix& matrix) const;\n') +inter.include_methods.append(' static wxSVGTransformable* GetSVGTransformable(wxSVGElement& element);\n') +inter.include_methods.append(' static const wxSVGTransformable* GetSVGTransformable(const wxSVGElement& element);\n') +inter.include_methods_protected.append(' inline wxSVGAnimatedTransformList& GetTransformList() { return m_transform; }\n') +inter.include_methods_protected.append(' friend class wxSVGAnimateTransformElement;\n') + +# SVGFitToViewBox +inter = interface() +interfaces["SVGFitToViewBox"]=inter +inter.include_methods.append(' void UpdateMatrix(wxSVGMatrix& matrix, const wxSVGLength& width, const wxSVGLength& height);\n') +inter.include_includes=["SVGLength", "SVGMatrix"] + +# SVGStylable +inter = interface() +interfaces["SVGStylable"]=inter +inter.include_methods.append(' static wxSVGStylable* GetSVGStylable(wxSVGElement& element);\n') +inter.include_methods.append(' static const wxSVGStylable* GetSVGStylable(const wxSVGElement& element);\n') +inter.include_methods.append(' static const wxCSSStyleDeclaration& GetElementStyle(const wxSVGElement& element);\n') +inter.include_methods.append(' static wxCSSStyleDeclaration GetResultStyle(const wxSVGElement& element);\n') +inter.include_get_set_attributes = [["wxCSSStyleDeclaration", "animStyle", False, False]] +inter.include_includes=["SVGElement"] + +# SVGElementInstance +inter = interface() +interfaces["SVGElementInstance"]=inter +inter.include_methods.append(' wxSVGElementInstance() {}\n') +inter.include_methods.append(' virtual ~wxSVGElementInstance() {}\n') +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# wxSVGColor +inter = interface() +interfaces["SVGColor"]=inter +inter.include_methods.append(' wxSVGColor(): wxCSSValue(wxCSS_SVG_COLOR),\n') +inter.include_methods.append(' m_colorType(wxSVG_COLORTYPE_UNKNOWN) {}\n') +inter.include_methods.append(' wxSVGColor(wxRGBColor color): wxCSSValue(wxCSS_SVG_COLOR),\n') +inter.include_methods.append(' m_colorType(wxSVG_COLORTYPE_RGBCOLOR), m_rgbColor(color) {}\n') +inter.include_methods.append(' wxSVGColor(unsigned char r, unsigned char g, unsigned char b):\n') +inter.include_methods.append(' wxCSSValue(wxCSS_SVG_COLOR),\n') +inter.include_methods.append(' m_colorType(wxSVG_COLORTYPE_RGBCOLOR), m_rgbColor(r, g, b) {}\n') +inter.include_methods.append(' virtual ~wxSVGColor() {}\n') +inter.include_methods.append(' wxCSSValue* Clone() const { return new wxSVGColor(*this); }\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' wxString GetCSSText() const;\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' inline const wxRGBColor& GetRGBColor() const { return m_rgbColor; }\n') +inter.include_methods.append(' virtual void SetRGBColor(const wxRGBColor& rgbColor);\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' inline const wxSVGICCColor& GetICCColor() const { return m_iccColor; }\n') +inter.include_methods.append(' virtual void SetICCColor(const wxSVGICCColor& iccColor);\n') +inter.include_methods.append(' \n') +inter.exclude_methods = ["GetRgbColor", "SetRgbColor", "GetIccColor", "SetIccColor"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# wxSVGPaint +inter = interface() +interfaces["SVGPaint"]=inter +inter.include_methods.append(' wxSVGPaint(): m_paintType(wxSVG_PAINTTYPE_NONE)\n') +inter.include_methods.append(' { m_cssValueType = wxCSS_SVG_PAINT; }\n') +inter.include_methods.append(' wxSVGPaint(unsigned char r, unsigned char g, unsigned char b):\n') +inter.include_methods.append(' wxSVGColor(r, g, b), m_paintType(wxSVG_PAINTTYPE_RGBCOLOR)\n') +inter.include_methods.append(' { m_cssValueType = wxCSS_SVG_PAINT; }\n') +inter.include_methods.append(' wxSVGPaint(wxRGBColor color):\n') +inter.include_methods.append(' wxSVGColor(color), m_paintType(wxSVG_PAINTTYPE_RGBCOLOR)\n') +inter.include_methods.append(' { m_cssValueType = wxCSS_SVG_PAINT; if (!color.Ok()) m_paintType = wxSVG_PAINTTYPE_NONE; }\n') +inter.include_methods.append(' virtual ~wxSVGPaint() {}\n') +inter.include_methods.append(' wxCSSValue* Clone() const { return new wxSVGPaint(*this); }\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' wxString GetCSSText() const;\n') +inter.include_methods.append(' inline const wxString& GetUri() const { return m_uri; }\n') +inter.include_methods.append(' virtual void SetUri(const wxString& uri);\n') +inter.include_methods.append(' virtual void SetRGBColor(const wxRGBColor& rgbColor);\n') +inter.include_methods.append(' virtual void SetICCColor(const wxSVGICCColor& iccColor);\n') +inter.include_methods.append(' \n') +inter.include_methods.append(''' inline bool Ok() const + { + return m_paintType != wxSVG_PAINTTYPE_UNKNOWN && + m_paintType != wxSVG_PAINTTYPE_NONE; + }\n''') +inter.include_methods.append(' \n') +inter.exclude_methods = ["GetUri", "SetUri"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGLength +inter = interface() +interfaces["SVGLength"]=inter +inter.include_methods.append(' wxSVGLength() : m_unitType(wxSVG_LENGTHTYPE_UNKNOWN), m_value(0), m_valueInSpecifiedUnits(0) {}\n') +inter.include_methods.append(' wxSVGLength(double v) : m_unitType(wxSVG_LENGTHTYPE_NUMBER), m_value(v), m_valueInSpecifiedUnits(v) {}\n') +inter.include_methods.append(' wxSVGLength(wxSVG_LENGTHTYPE unitType, double v): m_unitType(unitType) { SetValueInSpecifiedUnits(v); }\n') +inter.include_methods.append(' wxSVGLength(const wxSVGLength& l): m_unitType(l.m_unitType), m_value(l.m_value), m_valueInSpecifiedUnits(l.m_valueInSpecifiedUnits) {}\n') +inter.include_methods.append(' virtual ~wxSVGLength() {}\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' inline double GetValue() const { return m_value; }\n') +inter.include_methods.append(' inline void SetValue(double n) { m_unitType = wxSVG_LENGTHTYPE_NUMBER; m_valueInSpecifiedUnits = n; m_value = n; }\n') +inter.include_methods.append(' inline operator double() const { return GetValue(); }\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' double GetValueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }\n') +inter.include_methods.append(' void SetValueInSpecifiedUnits(double n);\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' wxString GetValueAsString() const;\n') +inter.include_methods.append(' void SetValueAsString(const wxString& n);\n') +inter.include_methods.append(''' + inline void ToViewportWidth(float viewportWidth) { m_value = m_valueInSpecifiedUnits*viewportWidth/100; } + inline void ToViewportHeight(float viewportHeight) { m_value = m_valueInSpecifiedUnits*viewportHeight/100; } + inline void ToViewportSize(float viewportWidth, float viewportHeight) + { + m_value = m_valueInSpecifiedUnits* + sqrt(viewportWidth*viewportWidth + viewportHeight*viewportHeight)/sqrt(2.0)/100; + }\n +''') +inter.exclude_methods = ["GetValue", "SetValue", "GetValueInSpecifiedUnits", "GetValueInSpecifiedUnits"] +inter.exclude_attributes = ["valueAsString"] +inter.include_includes = ["String_wxsvg", "SVGLengthCalculate", "math"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGAngle +inter = interface() +interfaces["SVGAngle"]=inter +inter.include_attributes_init = [["valueInSpecifiedUnits", "0"]] +inter.include_methods.append(' wxSVGAngle() : m_unitType(wxSVG_ANGLETYPE_UNKNOWN), m_value(0) {}\n') +inter.include_methods.append(' wxSVGAngle(double v) : m_unitType(wxSVG_ANGLETYPE_UNSPECIFIED), m_value(v) {}\n') +inter.include_methods.append(' virtual ~wxSVGAngle() {}\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' inline double GetValue() const { return m_value; }\n') +inter.include_methods.append(' inline void SetValue(double n) { m_unitType = wxSVG_ANGLETYPE_UNSPECIFIED; m_valueInSpecifiedUnits = n; m_value = n; }\n') +inter.include_methods.append(' inline operator double() const { return GetValue(); }\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' inline double GetValueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }\n') +inter.include_methods.append(' void SetValueInSpecifiedUnits(double n);\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' wxString GetValueAsString() const;\n') +inter.include_methods.append(' void SetValueAsString(const wxString& n);\n') +inter.include_methods.append(' \n') +inter.exclude_methods = ["GetValue", "SetValue", "GetValueInSpecifiedUnits", "GetValueInSpecifiedUnits"] +inter.exclude_attributes = ["valueAsString"] +inter.include_includes = ["String_wxsvg"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGNumber +inter = interface() +interfaces["SVGNumber"]=inter +inter.include_methods.append(' wxSVGNumber(): m_value(0) {}\n') +inter.include_methods.append(' wxSVGNumber(double value): m_value(value) {}\n') +inter.include_methods.append(' virtual ~wxSVGNumber() {}\n') +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGPoint +inter = interface() +interfaces["SVGPoint"]=inter +inter.include_methods.append(' wxSVGPoint(): m_x(0), m_y(0) {}\n') +inter.include_methods.append(' wxSVGPoint(double x, double y): m_x(x), m_y(y) {}\n') +inter.include_methods.append(' virtual ~wxSVGPoint() {}\n') +inter.include_methods.append(' virtual wxSVGPoint MatrixTransform(const wxSVGMatrix& matrix) const;\n') +inter.include_methods.append(' inline bool operator==(const wxSVGPoint& p) const { return m_x == p.m_x && m_y == p.m_y; }\n') +inter.include_methods.append(' inline bool operator!=(const wxSVGPoint& p) const { return m_x != p.m_x || m_y != p.m_y; }\n') +inter.include_methods.append(' inline wxSVGPoint operator-(const wxSVGPoint& p) const { return wxSVGPoint(m_x - p.m_x, m_y - p.m_y); }\n') +inter.include_methods.append(' inline wxSVGPoint operator+(const wxSVGPoint& p) const { return wxSVGPoint(m_x + p.m_x, m_y + p.m_y); }\n') +inter.include_methods.append(' inline wxSVGPoint operator*(double n) const { return wxSVGPoint(m_x*n, m_y*n); }\n') +inter.exclude_methods = ["MatrixTransform"] +inter.include_includes = ["SVGMatrix"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGRect +inter = interface() +interfaces["SVGRect"]=inter +inter.exclude_attributes = ['x', 'y', 'width', 'height'] +inter.include_attributes.append(''' + protected: + double m_x; + double m_y; + double m_width; + double m_height; + bool m_empty;\n +''') +inter.include_methods.append('''\ + inline double GetX() const { return m_x; } + inline void SetX(double n) { m_x = n; m_empty = false; } + + inline double GetY() const { return m_y; } + inline void SetY(double n) { m_y = n; m_empty = false; } + + inline double GetWidth() const { return m_width; } + inline void SetWidth(double n) { m_width = n; m_empty = false; } + + inline double GetHeight() const { return m_height; } + inline void SetHeight(double n) { m_height = n; m_empty = false; } + + inline bool IsEmpty() const { return m_empty; } + inline void Clear() { m_x = m_y = m_width = m_height = 0; m_empty = true; } + + public: + wxSVGRect(): m_x(0), m_y(0), m_width(0), m_height(0), m_empty(true) {} + wxSVGRect(double x, double y, double width, double height): + m_x(x), m_y(y), m_width(width), m_height(height), m_empty(false) {} + ~wxSVGRect() {} + wxString GetValueAsString() const; + void SetValueAsString(const wxString& value); + wxSVGRect MatrixTransform(const wxSVGMatrix& matrix) const; +''') +inter.include_includes = ["String_wxsvg", "SVGMatrix"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGMatrix +inter = interface() +interfaces["SVGMatrix"]=inter +inter.include_methods.append(' wxSVGMatrix(): m_a(1), m_b(0), m_c(0), m_d(1), m_e(0), m_f(0) {}\n') +inter.include_methods.append(' wxSVGMatrix(double a, double b, double c, double d, double e, double f):\n m_a(a), m_b(b), m_c(c), m_d(d), m_e(e), m_f(f) {}\n') +inter.include_methods.append(' virtual ~wxSVGMatrix() {}\n') +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGTransform +inter = interface() +interfaces["SVGTransform"]=inter +inter.include_get_set_attributes = [["double", "cx", False, False], ["double", "cy", False, False]] +inter.include_methods.append(' wxSVGTransform(const wxSVGMatrix& matrix): m_type(wxSVG_TRANSFORM_MATRIX), m_matrix(matrix), m_angle(0), m_cx(0), m_cy(0) {}\n') +inter.include_methods.append(' virtual ~wxSVGTransform() {}\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' wxString GetValueAsString() const;\n') +inter.include_methods.append(' void SetValueAsString(const wxString& value);\n') +inter.include_methods.append(' \n') +inter.include_methods.append(' inline void SetMatrix(const wxSVGMatrix& n) { m_type = wxSVG_TRANSFORM_MATRIX; m_matrix = n; }\n') +inter.exclude_methods = ["SetMatrix", "GetCx", "SetCx", "GetCy", "SetCy"] +inter.include_includes = ["String_wxsvg"] +inter.user_defined_destructor=1 + +# SVGPreserveAspectRatio +inter = interface() +interfaces["SVGPreserveAspectRatio"]=inter +inter.include_methods.append(''' wxSVGPreserveAspectRatio(): + m_align(wxSVG_PRESERVEASPECTRATIO_UNKNOWN), m_meetOrSlice(wxSVG_MEETORSLICE_UNKNOWN) {} + wxString GetValueAsString() const; + void SetValueAsString(const wxString& value); +''') +inter.include_includes = ["String_wxsvg"] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +# SVGPathSeg +inter = interface() +interfaces["SVGPathSeg"]=inter +inter.include_methods.append(' wxSVGPathSeg(wxPATHSEG type = wxPATHSEG_UNKNOWN) { m_pathSegType = type; }\n') +inter.include_methods.append(' virtual ~wxSVGPathSeg() {}\n') +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + +## container elements +for name in ["SVGSVGElement", "SVGGElement", "SVGDefsElement", "SVGAElement", +"SVGSwitchElement", "SVGForeignObjectElement", "SVGClipPathElement"]: + inter = interface() + interfaces[name] = inter + inter.include_methods.append(' wxSVGRect GetBBox(wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER) { return wxSVGLocatable::GetChildrenBBox(this, coordinates); }\n') + inter.include_methods.append(' wxSVGRect GetResultBBox(wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER) { return wxSVGLocatable::GetChildrenResultBBox(this, coordinates); }\n') + inter.include_methods.append(' wxSVGMatrix GetCTM() { return wxSVGLocatable::GetCTM(this); }\n') + inter.include_methods.append(' wxSVGMatrix GetScreenCTM() { return wxSVGLocatable::GetScreenCTM(this); }\n') + +## SVGSVGElement +inter = interfaces["SVGSVGElement"] +inter.include_methods.append(' wxSvgXmlElement* GetElementById(const wxString& elementId) const;\n') +inter.include_methods.append(' void UpdateMatrix(wxSVGMatrix& matrix) { wxSVGFitToViewBox::UpdateMatrix(matrix, GetWidth().GetAnimVal(), GetHeight().GetAnimVal()); }\n') +inter.exclude_methods = ["GetElementById"] + +## visible elements +for name in ["SVGLineElement", "SVGPolylineElement", "SVGPolygonElement", +"SVGRectElement", "SVGCircleElement", "SVGEllipseElement", "SVGPathElement", +"SVGTextElement", "SVGImageElement", "SVGVideoElement", "SVGUseElement"]: + inter = interface() + interfaces[name]=inter + if name not in ["SVGUseElement"]: + inter.has_canvas_item=1 + inter.include_attributes.append(' protected:\n') + inter.include_attributes.append(' wxSVGCanvasItem* m_canvasItem;\n') + inter.include_attributes.append(' public:\n') + inter.include_attributes.append(' inline wxSVGCanvasItem* GetCanvasItem() { return m_canvasItem; }\n') + inter.include_attributes.append(' void SetCanvasItem(wxSVGCanvasItem* canvasItem);\n\n') + inter.include_attributes_init = [["canvasItem", "NULL"]] + inter.include_fwd_decls = ["SVGCanvasItem"] + inter.include_methods.append(' wxSVGRect GetBBox(wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER);\n') + inter.include_methods.append(' wxSVGRect GetResultBBox(wxSVG_COORDINATES coordinates = wxSVG_COORDINATES_USER);\n') + inter.include_methods.append(' wxSVGMatrix GetCTM() { return wxSVGLocatable::GetCTM(this); }\n') + inter.include_methods.append(' wxSVGMatrix GetScreenCTM() { return wxSVGLocatable::GetScreenCTM(this); }\n') + +# SVGImageElement +inter = interfaces["SVGImageElement"] +inter.include_fwd_decls.append("ProgressDialog") +inter.include_methods.append(' int GetDefaultWidth(wxProgressDialog* progressDlg = NULL);\n') +inter.include_methods.append(' int GetDefaultHeight(wxProgressDialog* progressDlg = NULL);\n') +inter.include_methods.append(' void SetDefaultSize(wxProgressDialog* progressDlg = NULL);\n') + +# SVGVideElement +inter = interfaces["SVGVideoElement"] +inter.include_fwd_decls.append("ProgressDialog") +inter.include_methods.append(' double GetDuration(wxProgressDialog* progressDlg = NULL);\n') + +# SVGTextElement +inter = interfaces["SVGTextElement"] +inter.include_methods.append('''\ + long GetNumberOfChars(); + double GetComputedTextLength(); + double GetSubStringLength(unsigned long charnum, unsigned long nchars); + wxSVGPoint GetStartPositionOfChar(unsigned long charnum); + wxSVGPoint GetEndPositionOfChar(unsigned long charnum); + wxSVGRect GetExtentOfChar(unsigned long charnum); + double GetRotationOfChar(unsigned long charnum); + long GetCharNumAtPosition(const wxSVGPoint& point); +''') + +# SVGTextPositioningElement +inter = interface() +interfaces["SVGTextPositioningElement"]=inter +inter.include_methods.append(' inline void SetX(const wxSVGLength& n) { wxSVGLengthList list; list.Add(n); SetX(list); }\n') +inter.include_methods.append(' inline void SetY(const wxSVGLength& n) { wxSVGLengthList list; list.Add(n); SetY(list); }\n') + +# SVGRadialGradientElement +inter = interface() +interfaces["SVGRadialGradientElement"]=inter +inter.include_methods.append(''' + double GetQualifiedR() const; + double GetQualifiedCx() const; + double GetQualifiedCy() const; + double GetQualifiedFx() const; + double GetQualifiedFy() const;\n +''') + +# SVGAnimationElement +inter = interface() +interfaces["SVGAnimationElement"]=inter +inter.include_methods.append(''' + virtual void ApplyAnimation();\n +''') + +# SVGAnimateTransformElement +inter = interface() +interfaces["SVGAnimateTransformElement"]=inter +inter.include_attributes.append(''' protected: + int m_transformIdx; + +''') +inter.include_attributes_init = [["transformIdx", "-1"]] +inter.include_methods.append(''' + virtual void ApplyAnimation();\n +''') + +# SVGDocument +inter = interface() +interfaces["SVGDocument"]=inter + +inter.exclude_attributes = ["rootElement", "title"] +inter.include_attributes.append(''' protected: + wxSVGCanvas* m_canvas; + double m_scale; + double m_scaleY;\n + wxSVGMatrix m_screenCTM;\n + double m_time; + double GetDuration(wxSVGElement* parent); +''') +inter.include_methods.append(''' wxSVGDocument() { Init(); } + wxSVGDocument(const wxString& filename, const wxString& encoding = wxT("UTF-8")): + wxSvgXmlDocument(filename, encoding) { Init(); } + wxSVGDocument(wxInputStream& stream, const wxString& encoding = wxT("UTF-8")): + wxSvgXmlDocument(stream, encoding) { Init(); } + wxSVGDocument(const wxSVGDocument& doc); + virtual ~wxSVGDocument(); + + virtual bool Load(const wxString& filename, const wxString& encoding = wxT("UTF-8")); + virtual bool Load(wxInputStream& stream, const wxString& encoding = wxT("UTF-8")); + + void Init(); + inline wxSVGCanvas* GetCanvas() { return m_canvas; } + inline double GetScale() { return m_scale; } + inline double GetScaleX() { return m_scale; } + inline double GetScaleY() { return m_scaleY > 0 ? m_scaleY : m_scale; } + const wxSVGMatrix& GetScreenCTM() { return m_screenCTM; } + + wxString GetTitle(); + void SetTitle(const wxString& n); + + wxSVGSVGElement* GetRootElement() { return (wxSVGSVGElement*) GetRoot(); } + void SetRootElement(wxSVGSVGElement* n) { SetRoot((wxSvgXmlElement*) n); } + + wxSVGElement* GetElementById(const wxString& id); + + wxSvgXmlElement* CreateElement(const wxString& tagName); + wxSvgXmlElement* CreateElementNS(const wxString& namespaceURI, const wxString& qualifiedName); + + double GetDuration(); + double GetCurrentTime() { return m_time; } + void SetCurrentTime(double seconds); + + wxImage Render(int width = -1, int height = -1, const wxSVGRect* rect = NULL, bool preserveAspectRatio = true, + bool alpha = false, wxProgressDialog* progressDlg = NULL); + wxImage RenderElementById(const wxString& id); + private: + DECLARE_DYNAMIC_CLASS(wxSVGDocument) +''') +inter.include_fwd_decls = ["SVGSVGElement","SVGElement","SVGCanvas","ProgressDialog"] +inter.include_includes = ["SVGRect","SVGMatrix",""] +inter.user_defined_constructor=1 +inter.user_defined_destructor=1 + diff -Nru wxsvg-1.4~dfsg/scripts/mapDtdIdl.py wxsvg-1.5.4/scripts/mapDtdIdl.py --- wxsvg-1.4~dfsg/scripts/mapDtdIdl.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/mapDtdIdl.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,116 @@ +############################################################################## +## Name: mapDtdIdl.py +## Purpose: +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: mapDtdIdl.py,v 1.3 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import idl +import parse_idl +import parse_dtd +import string + +__doc__==''' +this module should map DOM interfaces to DTD Elements +''' + +attributes_dtd_idl = {} +attributes_idl_dtd = {} +elements_dtd_idl = {} +elements_idl_dtd = {} + +#first, lower the idl class name +parse_idl_class_decls={} +if len(parse_idl.class_decls): + for key,val in parse_idl.class_decls.items(): + parse_idl_class_decls[key.lower()]=val + + +def make_cppname(name): + beg=0 + while 1: + pos = name.find('-', beg) + if pos==-1: + pos = name.find(':', beg) + if pos>0: + res = name[:pos]+ name[pos+1].upper() + name[pos+2:] + name=res + beg=pos + else: + break + + if name=='class': + name = 'className' + elif name=='in': + name = 'in1' + elif name=='d': + name='pathSegList' + elif name=='xlinkHref': + name='href' + + + return name + + +def find_name_in_inherit(name, classdecl): + if len(classdecl.attributes): + for attr in classdecl.attributes: + if attr.name.lower()==name: + return (classdecl, attr) + + for inh in classdecl.inherits: + try: + (c, e) = find_name_in_inherit(name, parse_idl.class_decls[inh]) + if c and e: + return (c,e) + except KeyError: + pass + return (None,None) + + +elements = parse_dtd.attlists +if len(elements): + for name, entity_types in elements.items(): + classname = make_cppname(name[0].upper() + name[1:]) + classname = "SVG" + classname + "Element" + try: + classdecl = parse_idl_class_decls[classname.lower()] + except KeyError: + if classname=="SVGMpathElement": + continue + else: + raise + + elements_dtd_idl[name] = classdecl + + for entity_type in entity_types: + ltypes = entity_type.expand(parse_idl.class_decls, parse_dtd.entity_common_attrs) + if ltypes == None: + continue + for i in ltypes: + attrname = make_cppname(i.name) + (c, attr) = find_name_in_inherit(attrname.lower(), classdecl) + + if c!=None : + if i.name in attributes_dtd_idl: + attributes_dtd_idl[i.name].append(attr) + else: + attributes_dtd_idl[i.name]=[attr] + else: + pass + + +if len(attributes_dtd_idl): + for key, lval in attributes_dtd_idl.items(): + for val in lval: + attributes_idl_dtd[val]=key + #print key, val.name + +if len(elements_dtd_idl): + for key, val in elements_dtd_idl.items(): + elements_idl_dtd[val]=key + #print key, val.name + diff -Nru wxsvg-1.4~dfsg/scripts/parse_attr.py wxsvg-1.5.4/scripts/parse_attr.py --- wxsvg-1.4~dfsg/scripts/parse_attr.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/parse_attr.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,254 @@ +############################################################################## +## Name: parse_attr.py +## Purpose: +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: parse_attr.py,v 1.2 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import re, string +import cpp +import collections + +parenthesis_re = re.compile('\(|\)') + +def get_parenthesis_expr(content, pos=0): + depth=1 + while depth!=0: + m = parenthesis_re.search(content, pos) + if m==None: + raise "pas bon "+defi[begdef:] + if m.group()=='(': + depth=depth+1 + else: + depth=depth-1 + pos = m.end() + return pos + +#------------ +# attr_type + +#returns (implied, required, fixed, defaultvalue) + +class attr_type: + pass + +class attr_type_implied(attr_type): + def __str__(self): + return "#IMPLIED" + +class attr_type_required(attr_type): + def __str__(self): + return "#REQUIRED" + +class attr_type_fixed(attr_type): + def __init__(self, default_value): + self.default_value = default_value + + def __str__(self): + return "#FIXED '" + self.default_value + "'" + +class attr_type_default_value(attr_type): + def __init__(self, default_value): + self.default_value = default_value + + def __str__(self): + return "'" + self.default_value + "'" + + + + + +class attribute_def: + def __init__(self): + pass + + def expand(self, entity_type_decls={}, entity_common_attrs={} ): + return [self] + + +class attr_entity_ref (attribute_def): + def __init__(self, entity_name): + self.entity_name = entity_name + self.expandlist=None + + def __str__(self): + return '%' + self.entity_name + ';' + + def expand(self, entity_type_decls={}, entity_common_attrs={} ): + if self.entity_name in entity_type_decls: + return entity_type_decls[self.entity_name] + elif self.entity_name in entity_common_attrs: + entities = entity_common_attrs[self.entity_name] + l=[] + for i in entities: + l2 = i.expand(entity_type_decls, entity_common_attrs) + if isinstance(l2, collections.Iterable): + l.extend(l2) + return l + + +class attr_named (attribute_def): + def __init__(self, name): + attribute_def.__init__(self) + self.name = name + self.type = None + + def __str__(self): + return self.name + ' (' + str(self.type) + ') ' + +class attr_named_entity_ref (attr_named, attr_entity_ref): + def __init__(self, name, entity_name): + attr_named.__init__(self, name) + attr_entity_ref.__init__(self, entity_name) + + def __str__(self): + return attr_named.__str__(self) + ' ' + attr_entity_ref.__str__(self) + + def expand(self, entity_type_decls={}, entity_common_attrs={} ): + return [self] + + +class attr_named_simple_type (attr_named): + def __init__(self, name, simple_type): + attr_named.__init__(self, name) + self.simple_type = simple_type + + def __str__(self): + return attr_named.__str__(self) + ' ' + self.simple_type + + +class attr_named_enum (attr_named): + def __init__(self, name, enums): + attr_named.__init__(self, name) + self.enums = enums + + def __str__(self): + return attr_named.__str__(self) + ' ' + str(self.enums) + +class attr_expr (attr_named): + def __init__(self, name, expr): + attr_named.__init__(self, name) + self.expr = expr + + def __str__(self): + return attr_named.__str__(self) + ' ' + self.expr + + + +implied_re = re.compile('#IMPLIED') +required_re = re.compile('#REQUIRED') +fixed_re = re.compile('#FIXED') +default_value_re = re.compile("['\"]([^'\"]*)['|\"]") + +#returns (implied, required, fixed, defaultvalue) +def get_attr_typedef(content): + m = implied_re.search(content) + if m: + return attr_type_implied() + else: + m = required_re.search(content) + if m: + return attr_type_required() + else: + m = fixed_re.search(content) + if m: + n = default_value_re.search(content, m.end()) + return attr_type_fixed(n.group(1)) + else: + m = default_value_re.search(content) + if m: + return attr_type_default_value(m.group(1)) + else: + raise("error attr type", content) + + +def get_enums(content, beg=0): + pos=get_parenthesis_expr(content, beg) + tmp=content[beg:pos-1].split('|') + enums=[] + for i in tmp: + enums.append(i.strip()) + #print enums + return enums, pos + + +name_re = re.compile('\s*((\w|:|-|_)+)\s*') +entity_ref_re = re.compile('\s*%([\w\-_]+);\s*') +eat_re = re.compile('[^\n]+\n?', re.MULTILINE) + + +def parse_attr(defi): + defilen=len(defi) + begdefi=0 + + attributes=[] + + while begdefi makes maps to get dtd names from idl class +## names or the other way round +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: parse_dtd.py,v 1.4 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: It must be rewritten, because can't parse dtd file from svg 1.1 +## Now it use dtd file from svg 1.0 +## -> xmlto library can be used to parse dtd +############################################################################## + +import re, string +import parse_attr +import os.path +import config + +pathtosvg=os.path.expanduser(config.share_dir + "/svg.dtd") + +f=open(pathtosvg,'r') +content=f.read() + +# mmm... they should not be different, especially with a so thin +# difference: there is an \s before the > in the second case... + +entity_type_decl_re = re.compile('') +entity_common_attr_re = re.compile('', re.MULTILINE) + +element_re = re.compile(']+)>', re.MULTILINE) +attlist_re = re.compile(']+)>', re.MULTILINE) + +entity_type_decls={} +entity_common_attrs={} +elements={} +attlists={} +attlists["tbreak"] = "" + +beg=0 +while 1: + m = entity_type_decl_re.search(content, beg) + if m==None: + break + beg = m.end() + name = m.group(1) + defi = m.group(2) + + if defi[0]=='(': + enums, pos = parse_attr.get_enums(defi,1) + theattr = parse_attr.attr_named_enum(name, enums) + else: + theattr = parse_attr.attr_named_simple_type(name,defi) + + entity_type_decls[name]=theattr + + +beg=0 +while 1: + m = entity_common_attr_re.search(content, beg) + if m==None: + break + beg = m.end() + name = m.group(1).strip() + defi = m.group(2) + attributes=parse_attr.parse_attr(defi) + entity_common_attrs[name]=attributes + + +beg=0 +while 1: + m = element_re.search(content, beg) + if m==None: + break + beg = m.end() + + name = m.group(1).strip() + elements[name]=m.group(2) + +beg=0 +while 1: + m = attlist_re.search(content, beg) + if m==None: + break + beg = m.end() + + name = m.group(1).strip() + defi = m.group(2) + + attributes=parse_attr.parse_attr(defi) + attlists[name] = attributes + + continue + print('---') + print(name) + for i in attributes: + l = i.expand(entity_type_decls, entity_common_attrs) + for j in l: + print(j) + diff -Nru wxsvg-1.4~dfsg/scripts/parse_idl.py wxsvg-1.5.4/scripts/parse_idl.py --- wxsvg-1.4~dfsg/scripts/parse_idl.py 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/scripts/parse_idl.py 2014-03-21 21:15:35.000000000 +0000 @@ -0,0 +1,186 @@ +############################################################################## +## Name: parse_idl.py +## Purpose: parses idl file +## Author: Alex Thuering +## Created: 2005/01/19 +## RCS-ID: $Id: parse_idl.py,v 1.5 2014/03/21 21:15:35 ntalex Exp $ +## Copyright: (c) 2005 Alex Thuering +## Notes: some modules adapted from svgl project +############################################################################## + +import re +import string +import os.path +import idl +import config +import collections + +try: + import cPickle as pickle +except: + import pickle + + +interface_re = re.compile("interface\s+(\w+)\s+(:\s+[^{]+)?{") +attribute_re = re.compile("(readonly)?\s+attribute\s+([^;]+);") +const_as_enum_re = re.compile("const\s+unsigned\s+short\s+([^\s]+)\s+=\s+(\d+)") +method_re = re.compile("^\s+([^\(/]+)\(([^\)]+)\)(\s*raises\s*\(([^(]+)\))?", re.MULTILINE) + +bracket_re = re.compile("{|}") + +def get_close_bracket(content): + depth=1 + + while depth!=0: + m=bracket_re.search(content) + if m.group()=='{': + depth=depth+1 + else: + depth=depth-1 + return m.end() + +pathtoidl= config.share_dir+"/svg.idl" + +f=open(pathtoidl, 'r') +content = f.read() + + +class_decls={} +class_decls["SVGTBreakElement"] = idl.class_decl(name="SVGTBreakElement") +class_decls["SVGTBreakElement"].inherits = ["SVGElement"] + +while 1: + # search for "interface" + m = interface_re.search(content) + if m==None: + break + content = content[m.end():] + interface_name = m.group(1) + the_class_decl = idl.class_decl(name=interface_name) + class_decls[interface_name] = the_class_decl + + # inheritance + inherits = m.group(2) + inherits_names = [] + plaininherits = [] + if inherits!=None: + tmp = inherits[1:].split(',') + for i in tmp: + realname = i.strip() + plaininherits.append(realname) + + the_class_decl.inherits = plaininherits + + end_interface = get_close_bracket(content) + + # const as enum + first_enum=1 + did_enum=0 + beg=0 + + plain_enums = [] + theenum=idl.enum_decl(class_decl=the_class_decl) + theenum.const_decls=[] # ?? why ?????!!!!!! + + while 1: + m = const_as_enum_re.search(content, beg, end_interface) + if m==None: + break + beg=m.end() + const_name = m.group(1) + const_value = int(m.group(2)) + + if first_enum==1 and const_value!=0: + # not an enum + continue + + did_enum=1 + if const_value==0: + if first_enum==0: # new enum + plain_enums.append(theenum) + theenum=idl.enum_decl(class_decl=the_class_decl) + theenum.const_decls=[] # ?? why ?????!!!!!! + + first_enum=0 + pos = const_name.rfind('_') + theenum.name = const_name[:pos] + theenum.const_decls.append(idl.const_decl(const_name, str(const_value))) + + if did_enum==1: + plain_enums.append(theenum) + + the_class_decl.enums = plain_enums + + # attributes + beg=0 + has_attributes=0 + plain_attributes=[] + while 1: + m = attribute_re.search(content, beg, end_interface) + if m==None: + break + has_attributes=1 +# content = content[m.end():] + beg=m.end() + readonly=m.group(1) + attr_type_and_name = m.group(2) + attr_spec = attr_type_and_name.split() + attr_type=' '.join(attr_spec[:-1]).strip() + + attr_name=attr_spec[-1].strip() + tmpconst=0 + if readonly=='readonly': + tmpconst=1 + theattr = idl.arg_decl(name=attr_name, type=idl.type_decl(name=attr_type, const=tmpconst)) + plain_attributes.append(theattr) + + + if has_attributes==1: + the_class_decl.attributes=plain_attributes + + # methods + # beg=0 + + plain_methods=[] + + while 1: + m = method_re.search(content, beg, end_interface) + if m==None: + break + beg=m.end() + return_type_and_name = m.group(1).strip() + tmp = return_type_and_name.split() + meth_name = tmp[-1] + return_type = ' '.join(tmp[:-1]).strip() + + themeth = idl.method_decl(name = meth_name, return_type=idl.type_decl(name=return_type)) + + args = m.group(2).strip() + raises=[] + if (m.group(4)): + tmp = m.group(4).split(',') + for i in tmp: + raises.append(i.strip()) + themeth.exceptions=raises + + theargs=[] + if len(args): + args=args.split(',') + for arg in args: + spec = arg.split() + + inout = spec[0].strip() + typename = ' '.join(spec[1:-1]) + savtypename = typename + varname = spec[len(spec)-1].strip() + + theargs.append(idl.arg_decl(name=varname, inout=inout, type=idl.type_decl(name=savtypename ))) + + + themeth.args=theargs + plain_methods.append(themeth) + + + the_class_decl.methods = plain_methods + content=content[end_interface:] +class_decls = collections.OrderedDict(sorted(class_decls.items())) diff -Nru wxsvg-1.4~dfsg/share/SVG11CSSpropidx.xhtml wxsvg-1.5.4/share/SVG11CSSpropidx.xhtml --- wxsvg-1.4~dfsg/share/SVG11CSSpropidx.xhtml 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/share/SVG11CSSpropidx.xhtml 2006-07-20 01:52:57.000000000 +0000 @@ -0,0 +1,1362 @@ + + + + + + Property Index - SVG 1.1 - 20030114 + + + + + + + + + + + + + +
+

14 January + 2003

+
+

Appendix N: Property Index

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameValuesInitial valueApplies to
+ (Default: all)
Inherited?Percentages
+ (Default: N/A)
Media groupsAnimatable
'alignment-baseline'auto | baseline | before-edge | text-before-edge | + middle | central | after-edge | text-after-edge | + ideographic | alphabetic | hanging | mathematical | + inheritsee property description'tspan', 'tref', 'altGlyph', 'textPath' elementsno  + visualyes
'baseline-shift'baseline | sub | super | <percentage> + | <length> + | + inheritbaseline'tspan', 'tref', 'altGlyph', 'textPath' elementsnorefers to the 'line-height' of the 'text' element, which in + the case of SVG is defined to be equal to the + 'font-size' + visualyes (non-additive, 'set' and 'animate' elements + only)
'clip' + <shape> + | auto | + inheritautoelements + which establish a new viewport, 'pattern' elements and 'marker' elementsno  + visualyes
'clip-path'<uri> | + none | + inheritnonecontainer + elements and graphics + elementsno  + visualyes
'clip-rule'nonzero | evenodd | + inheritnonzerographics elements within a 'clipPath' elementyes  + visualyes
'color'<color> + | + inheritdepends on user agentelements to which properties 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' applyyes  + visualyes
'color-interpolation'auto | sRGB | linearRGB | + inheritsRGBcontainer + elements, graphics + elements and 'animateColor'yes  + visualyes
'color-interpolation-filters'auto | sRGB | linearRGB | + inheritlinearRGBfilter + primitivesyes  + visualyes
'color-profile'auto | sRGB | <name> | <uri> | + inheritauto'image' elements that + refer to raster imagesyes  + visualyes
'color-rendering'auto | optimizeSpeed | optimizeQuality | + inheritautocontainer + elements, graphics + elements and 'animateColor'yes  + visualyes
'cursor'[ [<uri> + ,]* [ auto | crosshair | default | pointer | move | + e-resize | ne-resize | nw-resize | n-resize | se-resize | + sw-resize | s-resize | w-resize| text | wait | help ] ] | + + inheritautocontainer + elements and graphics + elementsyes  + visual, + interactiveyes
'direction'ltr | rtl | + inheritltrtext + content elementsyes  + visualno
'display'inline | block | list-item | run-in | compact | + marker | table | inline-table | table-row-group | + table-header-group | table-footer-group | table-row | + table-column-group | table-column | table-cell | + table-caption | none | + inheritinline'svg', 'g', 'switch', 'a', 'foreignObject', graphics + elements (including the 'text' element) and text + sub-elements (i.e., 'tspan', 'tref', 'altGlyph', 'textPath')no  + allyes
'dominant-baseline'auto | use-script | no-change | reset-size | + ideographic | alphabetic | hanging | mathematical | + central | middle | text-after-edge | text-before-edge | + + inheritautotext + content elementsno  + visualyes
'enable-background'accumulate | new [ <x> <y> <width> + <height> ] | + inheritaccumulatecontainer + elementsno  + visualno
'fill'<paint> (See Specifying + paint)blackshapes and text content + elementsyes  + visualyes
'fill-opacity'<opacity-value> | + inherit1shapes and text content + elementsyes  + visualyes
'fill-rule'nonzero | evenodd | + inheritnonzeroshapes and text content + elementsyes  + visualyes
'filter'<uri> | none | + inheritnonecontainer + elements and graphics + elementsno  + visualyes
'flood-color'currentColor |
+ <color> + [icc-color(<name>[,<icccolorvalue>]*)] + |
+ + inherit
black'feFlood' elementsno  + visualyes
'flood-opacity'<opacity-value> | + inherit1'feFlood' elementsno  + visualyes
'font'[ [ 'font-style' + || 'font-variant' + || 'font-weight' + ]? 'font-size' + [ / + 'line-height' + ]? 'font-family' + ] | caption | icon | menu | message-box | small-caption | + status-bar | + inheritsee individual propertiestext + content elementsyesallowed on 'font-size' and 'line-height' + ('line-height' same as 'font-size' in SVG) + visualyes (non-additive, 'set' and 'animate' elements + only)
'font-family'[[ + <family-name> + | + <generic-family> + ],]* [ + <family-name> + | + <generic-family>] + | + inheritdepends on user agenttext + content elementsyes  + visualyes
'font-size' + <absolute-size> + | + <relative-size> + | <length> + | + <percentage> + | + inheritmediumtext + content elementsyes, the computed value is inheritedrefer to parent element's font size + visualyes
'font-size-adjust' + <number> + | none | + inheritnonetext + content elementsyes  + visualyes
'font-stretch'normal | wider | narrower | ultra-condensed | + extra-condensed | condensed | semi-condensed | + semi-expanded | expanded | extra-expanded | + ultra-expanded | + inheritnormaltext + content elementsyes  + visualyes
'font-style'normal | italic | oblique | + inheritnormaltext + content elementsyes  + visualyes
'font-variant'normal | small-caps | + inheritnormaltext + content elementsyes  + visualyes
'font-weight'normal | bold | bolder | lighter | 100 | 200 | 300 | + 400 | 500 | 600 | 700 | 800 | 900 | + inheritnormaltext + content elementsyes  + visualyes
'glyph-orientation-horizontal'<angle> | + inherit0degtext + content elementsyes  + visualno
'glyph-orientation-vertical'auto | <angle> | + inheritautotext + content elementsyes  + visualno
'image-rendering'auto | optimizeSpeed | optimizeQuality | + inheritautoimagesyes  + visualyes
'kerning'auto | <length> | + inheritautotext + content elementsyes  + visualyes
'letter-spacing'normal | <length> | + inheritnormaltext + content elementsyes  + visualyes
'lighting-color'currentColor |
+ <color> + [icc-color(<name>[,<icccolorvalue>]*)] + |
+ + inherit
white'feDiffuseLighting' and + 'feSpecularLighting' + elementsno  + visualyes
'marker'see individual propertiessee individual properties'path', 'line', 'polyline' and 'polygon' elementsyes  + visualyes
'marker-end'
+ 'marker-mid'
+ 'marker-start'
none |
+ + inherit + |
+ <uri>
none'path', 'line', 'polyline' and 'polygon' elementsyes  + visualyes
'mask'<uri> | none | + inheritnonecontainer + elements and graphics + elementsno  + visualyes
'opacity'<opacity-value> | + inherit1container + elements and graphics + elementsno  + visualyes
'overflow'visible | hidden | scroll | auto | + inheritsee proseelements + which establish a new viewport, 'pattern' elements and 'marker' elementsno  + visualyes
'pointer-events'visiblePainted | visibleFill | visibleStroke | + visible |
+ painted | fill | stroke | all | none | + inherit
visiblePaintedgraphics + elementsyes  + visualyes
'shape-rendering'auto | optimizeSpeed | crispEdges |
+ geometricPrecision | + inherit
autoshapesyes  + visualyes
'stop-color'currentColor |
+ <color> + [icc-color(<name>[,<icccolorvalue>]*)] + |
+ + inherit
black'stop' elementsno  + visualyes
'stop-opacity'<opacity-value> | + inherit1'stop' elementsno  + visualyes
'stroke'<paint> (See Specifying + paint)noneshapes and text content + elementsyes  + visualyes
'stroke-dasharray'none | <dasharray> | + inheritnoneshapes and text content + elementsyes  + visual
'stroke-dashoffset'<length> | + inherit0shapes and text content + elementsyessee prose + visualyes
'stroke-linecap'butt | round | square | + inheritbuttshapes and text content + elementsyes  + visualyes
'stroke-linejoin'miter | round | bevel | + inheritmitershapes and text content + elementsyes  + visualyes
'stroke-miterlimit'<miterlimit> | + inherit4shapes and text content + elementsyes  + visualyes
'stroke-opacity'<opacity-value> | + inherit1shapes and text content + elementsyes  + visualyes
'stroke-width'<length> | + inherit1shapes and text content + elementsyes  + visualyes
'text-anchor'start | middle | end | + inheritstarttext + content elementsyes  + visualyes
'text-decoration'none | [ underline || overline || line-through || + blink ] | + inheritnonetext + content elementsno (see prose)  + visualyes
'text-rendering'auto | optimizeSpeed | optimizeLegibility |
+ geometricPrecision | + inherit
auto'text' elementsyes  + visualyes
'unicode-bidi'normal | embed | bidi-override | + inheritnormaltext + content elementsno  + visualno
'visibility'visible | hidden | collapse | + inheritvisiblegraphics elements (including the 'text' element) and text + sub-elements (i.e., 'tspan', 'tref', 'altGlyph', 'textPath' and 'a')yes  + visualyes
'word-spacing'normal | <length> | + inheritnormaltext + content elementsyes  + visualyes
'writing-mode'lr-tb | rl-tb | tb-rl | lr | rl | tb | + inheritlr-tb'text' elementsyes  + visualno
+ + + + diff -Nru wxsvg-1.4~dfsg/share/svg.dtd wxsvg-1.5.4/share/svg.dtd --- wxsvg-1.4~dfsg/share/svg.dtd 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/share/svg.dtd 2011-11-24 00:02:56.000000000 +0000 @@ -0,0 +1,1665 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru wxsvg-1.4~dfsg/share/svg.idl wxsvg-1.5.4/share/svg.idl --- wxsvg-1.4~dfsg/share/svg.idl 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/share/svg.idl 2014-03-24 21:13:32.000000000 +0000 @@ -0,0 +1,1798 @@ +// File: svg.idl +#ifndef _SVG_IDL_ +#define _SVG_IDL_ + + +// For access to DOM2 core +#include "dom.idl" + +// For access to DOM2 events +#include "events.idl" + +// For access to those parts from DOM2 CSS OM used by SVG DOM. +#include "css.idl" + +// For access to those parts from DOM2 Views OM used by SVG DOM. +#include "views.idl" + +// For access to the SMIL OM used by SVG DOM. +#include "smil.idl" + +#pragma prefix "dom.w3c.org" +#pragma javaPackage "org.w3c.dom" +module svg +{ + typedef dom::DOMString DOMString; + typedef dom::DOMException DOMException; + typedef dom::Element Element; + typedef dom::Document Document; + typedef dom::NodeList NodeList; + + // Predeclarations + interface SVGElement; + interface SVGLangSpace; + interface SVGExternalResourcesRequired; + interface SVGTests; + interface SVGFitToViewBox; + interface SVGZoomAndPan; + interface SVGViewSpec; + interface SVGURIReference; + interface SVGPoint; + interface SVGMatrix; + interface SVGPreserveAspectRatio; + interface SVGAnimatedPreserveAspectRatio; + interface SVGTransformList; + interface SVGAnimatedTransformList; + interface SVGTransform; + interface SVGICCColor; + interface SVGColor; + interface SVGPaint; + interface SVGTransformable; + interface SVGDocument; + interface SVGSVGElement; + interface SVGElementInstance; + interface SVGElementInstanceList; + + + exception SVGException { + unsigned short code; + }; + + // SVGExceptionCode + const unsigned short SVG_WRONG_TYPE_ERR = 0; + const unsigned short SVG_INVALID_VALUE_ERR = 1; + const unsigned short SVG_MATRIX_NOT_INVERTABLE = 2; + + interface SVGElement : Element { + attribute DOMString id; + // raises DOMException on setting + attribute DOMString xmlbase; + // raises DOMException on setting + readonly attribute SVGSVGElement ownerSVGElement; + readonly attribute SVGElement viewportElement; + }; + + interface SVGAnimatedBoolean { + + attribute boolean baseVal; + // raises DOMException on setting + readonly attribute boolean animVal; + }; + + interface SVGAnimatedString { + + attribute DOMString baseVal; + // raises DOMException on setting + readonly attribute DOMString animVal; + }; + + interface SVGStringList { + + readonly attribute unsigned long numberOfItems; + + void clear ( ) + raises( DOMException ); + DOMString initialize ( in DOMString newItem ) + raises( DOMException, SVGException ); + DOMString getItem ( in unsigned long index ) + raises( DOMException ); + DOMString insertItemBefore ( in DOMString newItem, in unsigned long index ) + raises( DOMException, SVGException ); + DOMString replaceItem ( in DOMString newItem, in unsigned long index ) + raises( DOMException, SVGException ); + DOMString removeItem ( in unsigned long index ) + raises( DOMException ); + DOMString appendItem ( in DOMString newItem ) + raises( DOMException, SVGException ); + }; + + interface SVGAnimatedEnumeration { + + attribute unsigned short baseVal; + // raises DOMException on setting + readonly attribute unsigned short animVal; + }; + + interface SVGAnimatedInteger { + + attribute long baseVal; + // raises DOMException on setting + readonly attribute long animVal; + }; + + interface SVGNumber { + + attribute float value; + // raises DOMException on setting + }; + + interface SVGAnimatedNumber { + + attribute float baseVal; + // raises DOMException on setting + readonly attribute float animVal; + }; + + interface SVGNumberList { + + readonly attribute unsigned long numberOfItems; + + void clear ( ) + raises( DOMException ); + SVGNumber initialize ( in SVGNumber newItem ) + raises( DOMException, SVGException ); + SVGNumber getItem ( in unsigned long index ) + raises( DOMException ); + SVGNumber insertItemBefore ( in SVGNumber newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGNumber replaceItem ( in SVGNumber newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGNumber removeItem ( in unsigned long index ) + raises( DOMException ); + SVGNumber appendItem ( in SVGNumber newItem ) + raises( DOMException, SVGException ); + }; + + interface SVGAnimatedNumberList { + + readonly attribute SVGNumberList baseVal; + readonly attribute SVGNumberList animVal; + }; + + interface SVGLength { + + // Length Unit Types + const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0; + const unsigned short SVG_LENGTHTYPE_NUMBER = 1; + const unsigned short SVG_LENGTHTYPE_PERCENTAGE = 2; + const unsigned short SVG_LENGTHTYPE_EMS = 3; + const unsigned short SVG_LENGTHTYPE_EXS = 4; + const unsigned short SVG_LENGTHTYPE_PX = 5; + const unsigned short SVG_LENGTHTYPE_CM = 6; + const unsigned short SVG_LENGTHTYPE_MM = 7; + const unsigned short SVG_LENGTHTYPE_IN = 8; + const unsigned short SVG_LENGTHTYPE_PT = 9; + const unsigned short SVG_LENGTHTYPE_PC = 10; + + readonly attribute unsigned short unitType; + attribute float value; + // raises DOMException on setting + attribute float valueInSpecifiedUnits; + // raises DOMException on setting + attribute DOMString valueAsString; + // raises DOMException on setting + + void newValueSpecifiedUnits ( in unsigned short unitType, in float valueInSpecifiedUnits ); + void convertToSpecifiedUnits ( in unsigned short unitType ); + }; + + interface SVGAnimatedLength { + + readonly attribute SVGLength baseVal; + readonly attribute SVGLength animVal; + }; + + interface SVGLengthList { + + readonly attribute unsigned long numberOfItems; + + void clear ( ) + raises( DOMException ); + SVGLength initialize ( in SVGLength newItem ) + raises( DOMException, SVGException ); + SVGLength getItem ( in unsigned long index ) + raises( DOMException ); + SVGLength insertItemBefore ( in SVGLength newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGLength replaceItem ( in SVGLength newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGLength removeItem ( in unsigned long index ) + raises( DOMException ); + SVGLength appendItem ( in SVGLength newItem ) + raises( DOMException, SVGException ); + }; + + interface SVGAnimatedLengthList { + + readonly attribute SVGLengthList baseVal; + readonly attribute SVGLengthList animVal; + }; + + interface SVGAngle { + + // Angle Unit Types + const unsigned short SVG_ANGLETYPE_UNKNOWN = 0; + const unsigned short SVG_ANGLETYPE_UNSPECIFIED = 1; + const unsigned short SVG_ANGLETYPE_DEG = 2; + const unsigned short SVG_ANGLETYPE_RAD = 3; + const unsigned short SVG_ANGLETYPE_GRAD = 4; + + readonly attribute unsigned short unitType; + attribute float value; + // raises DOMException on setting + attribute float valueInSpecifiedUnits; + // raises DOMException on setting + attribute DOMString valueAsString; + // raises DOMException on setting + + void newValueSpecifiedUnits ( in unsigned short unitType, in float valueInSpecifiedUnits ); + void convertToSpecifiedUnits ( in unsigned short unitType ); + }; + + interface SVGAnimatedAngle { + + readonly attribute SVGAngle baseVal; + readonly attribute SVGAngle animVal; + }; + + interface SVGColor : css::CSSValue { + // Color Types + const unsigned short SVG_COLORTYPE_UNKNOWN = 0; + const unsigned short SVG_COLORTYPE_RGBCOLOR = 1; + const unsigned short SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2; + const unsigned short SVG_COLORTYPE_CURRENTCOLOR = 3; + + readonly attribute unsigned short colorType; + readonly attribute css::RGBColor rgbColor; + readonly attribute SVGICCColor iccColor; + + void setRGBColor ( in DOMString rgbColor ) + raises( SVGException ); + void setRGBColorICCColor ( in DOMString rgbColor, in DOMString iccColor ) + raises( SVGException ); + void setColor ( in unsigned short colorType, in DOMString rgbColor, in DOMString iccColor ) + raises( SVGException ); + }; + + interface SVGICCColor { + + attribute DOMString colorProfile; + // raises DOMException on setting + readonly attribute SVGNumberList colors; + }; + + interface SVGRect { + + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float width; + // raises DOMException on setting + attribute float height; + // raises DOMException on setting + }; + + interface SVGAnimatedRect { + + readonly attribute SVGRect baseVal; + readonly attribute SVGRect animVal; + }; + + interface SVGUnitTypes { + + // Unit Types + const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0; + const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE = 1; + const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; + }; + + interface SVGStylable { + + readonly attribute SVGAnimatedString className; + readonly attribute css::CSSStyleDeclaration style; + + css::CSSValue getPresentationAttribute ( in DOMString name ); + }; + + interface SVGLocatable { + + readonly attribute SVGElement nearestViewportElement; + readonly attribute SVGElement farthestViewportElement; + + SVGRect getBBox ( ); + SVGMatrix getCTM ( ); + SVGMatrix getScreenCTM ( ); + SVGMatrix getTransformToElement ( in SVGElement element ) + raises( SVGException ); + }; + + interface SVGTransformable : SVGLocatable { + readonly attribute SVGAnimatedTransformList transform; + }; + + interface SVGTests { + + readonly attribute SVGStringList requiredFeatures; + readonly attribute SVGStringList requiredExtensions; + readonly attribute SVGStringList systemLanguage; + + boolean hasExtension ( in DOMString extension ); + }; + + interface SVGLangSpace { + + attribute DOMString xmllang; + // raises DOMException on setting + attribute DOMString xmlspace; + // raises DOMException on setting + }; + + interface SVGExternalResourcesRequired { + + readonly attribute SVGAnimatedBoolean externalResourcesRequired; + }; + + interface SVGFitToViewBox { + + readonly attribute SVGAnimatedRect viewBox; + readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio; + }; + + interface SVGZoomAndPan { + + // Zoom and Pan Types + const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0; + const unsigned short SVG_ZOOMANDPAN_DISABLE = 1; + const unsigned short SVG_ZOOMANDPAN_MAGNIFY = 2; + + attribute unsigned short zoomAndPan; + // raises DOMException on setting + }; + + interface SVGViewSpec : + SVGZoomAndPan, + SVGFitToViewBox { + + readonly attribute SVGTransformList transform; + readonly attribute SVGElement viewTarget; + readonly attribute DOMString viewBoxString; + readonly attribute DOMString preserveAspectRatioString; + readonly attribute DOMString transformString; + readonly attribute DOMString viewTargetString; + }; + + interface SVGURIReference { + + readonly attribute SVGAnimatedString href; + }; + + interface SVGCSSRule : css::CSSRule { + // Additional CSS RuleType to support ICC color specifications + const unsigned short COLOR_PROFILE_RULE = 7; + }; + + interface SVGRenderingIntent { + + // Rendering Intent Types + const unsigned short RENDERING_INTENT_UNKNOWN = 0; + const unsigned short RENDERING_INTENT_AUTO = 1; + const unsigned short RENDERING_INTENT_PERCEPTUAL = 2; + const unsigned short RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3; + const unsigned short RENDERING_INTENT_SATURATION = 4; + const unsigned short RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5; + }; + + interface SVGDocument : + Document, + events::DocumentEvent { + + readonly attribute DOMString title; + readonly attribute DOMString referrer; + readonly attribute DOMString domain; + readonly attribute DOMString URL; + readonly attribute DOMString path; + readonly attribute SVGSVGElement rootElement; + }; + + interface SVGSVGElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGLocatable, + SVGFitToViewBox, + SVGZoomAndPan, + events::EventTarget, + events::DocumentEvent, + css::ViewCSS, + css::DocumentCSS { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + attribute DOMString contentScriptType; + // raises DOMException on setting + attribute DOMString contentStyleType; + // raises DOMException on setting + readonly attribute SVGRect viewport; + readonly attribute float pixelUnitToMillimeterX; + readonly attribute float pixelUnitToMillimeterY; + readonly attribute float screenPixelToMillimeterX; + readonly attribute float screenPixelToMillimeterY; + attribute boolean useCurrentView; + // raises DOMException on setting + readonly attribute SVGViewSpec currentView; + attribute float currentScale; + // raises DOMException on setting + readonly attribute SVGPoint currentTranslate; + + unsigned long suspendRedraw ( in unsigned long max_wait_milliseconds ); + void unsuspendRedraw ( in unsigned long suspend_handle_id ) + raises( DOMException ); + void unsuspendRedrawAll ( ); + void forceRedraw ( ); + void pauseAnimations ( ); + void unpauseAnimations ( ); + boolean animationsPaused ( ); + float getCurrentTime ( ); + void setCurrentTime ( in float seconds ); + NodeList getIntersectionList ( in SVGRect rect, in SVGElement referenceElement ); + NodeList getEnclosureList ( in SVGRect rect, in SVGElement referenceElement ); + boolean checkIntersection ( in SVGElement element, in SVGRect rect ); + boolean checkEnclosure ( in SVGElement element, in SVGRect rect ); + void deselectAll ( ); + SVGNumber createSVGNumber ( ); + SVGLength createSVGLength ( ); + SVGAngle createSVGAngle ( ); + SVGPoint createSVGPoint ( ); + SVGMatrix createSVGMatrix ( ); + SVGRect createSVGRect ( ); + SVGTransform createSVGTransform ( ); + SVGTransform createSVGTransformFromMatrix ( in SVGMatrix matrix ); + Element getElementById ( in DOMString elementId ); + }; + + interface SVGGElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget {}; + + interface SVGDefsElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget {}; + + interface SVGDescElement : + SVGElement, + SVGLangSpace, + SVGStylable {}; + + interface SVGTitleElement : + SVGElement, + SVGLangSpace, + SVGStylable {}; + + interface SVGSymbolElement : + SVGElement, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGFitToViewBox, + events::EventTarget {}; + + interface SVGUseElement : + SVGElement, + SVGURIReference, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + readonly attribute SVGElementInstance instanceRoot; + readonly attribute SVGElementInstance animatedInstanceRoot; + }; + + interface SVGElementInstance : events::EventTarget { + readonly attribute SVGElement correspondingElement; + readonly attribute SVGUseElement correspondingUseElement; + readonly attribute SVGElementInstance parentNode; + readonly attribute SVGElementInstanceList childNodes; + readonly attribute SVGElementInstance firstChild; + readonly attribute SVGElementInstance lastChild; + readonly attribute SVGElementInstance previousSibling; + readonly attribute SVGElementInstance nextSibling; + }; + + interface SVGElementInstanceList { + + readonly attribute unsigned long length; + + SVGElementInstance item ( in unsigned long index ); + }; + + interface SVGImageElement : + SVGElement, + SVGURIReference, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio; + }; + + interface SVGSwitchElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget {}; + + interface GetSVGDocument { + + SVGDocument getSVGDocument ( ) + raises( DOMException ); + }; + + interface SVGStyleElement : SVGElement { + attribute DOMString xmlspace; + // raises DOMException on setting + attribute DOMString type; + // raises DOMException on setting + attribute DOMString media; + // raises DOMException on setting + attribute DOMString title; + // raises DOMException on setting + }; + + interface SVGPoint { + + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + + SVGPoint matrixTransform ( in SVGMatrix matrix ); + }; + + interface SVGPointList { + + readonly attribute unsigned long numberOfItems; + + void clear ( ) + raises( DOMException ); + SVGPoint initialize ( in SVGPoint newItem ) + raises( DOMException, SVGException ); + SVGPoint getItem ( in unsigned long index ) + raises( DOMException ); + SVGPoint insertItemBefore ( in SVGPoint newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGPoint replaceItem ( in SVGPoint newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGPoint removeItem ( in unsigned long index ) + raises( DOMException ); + SVGPoint appendItem ( in SVGPoint newItem ) + raises( DOMException, SVGException ); + }; + + interface SVGMatrix { + + attribute float a; + // raises DOMException on setting + attribute float b; + // raises DOMException on setting + attribute float c; + // raises DOMException on setting + attribute float d; + // raises DOMException on setting + attribute float e; + // raises DOMException on setting + attribute float f; + // raises DOMException on setting + + SVGMatrix multiply ( in SVGMatrix secondMatrix ); + SVGMatrix inverse ( ) + raises( SVGException ); + SVGMatrix translate ( in float x, in float y ); + SVGMatrix scale ( in float scaleFactor ); + SVGMatrix scaleNonUniform ( in float scaleFactorX, in float scaleFactorY ); + SVGMatrix rotate ( in float angle ); + SVGMatrix rotateFromVector ( in float x, in float y ) + raises( SVGException ); + SVGMatrix flipX ( ); + SVGMatrix flipY ( ); + SVGMatrix skewX ( in float angle ); + SVGMatrix skewY ( in float angle ); + }; + + interface SVGTransform { + + // Transform Types + const unsigned short SVG_TRANSFORM_UNKNOWN = 0; + const unsigned short SVG_TRANSFORM_MATRIX = 1; + const unsigned short SVG_TRANSFORM_TRANSLATE = 2; + const unsigned short SVG_TRANSFORM_SCALE = 3; + const unsigned short SVG_TRANSFORM_ROTATE = 4; + const unsigned short SVG_TRANSFORM_SKEWX = 5; + const unsigned short SVG_TRANSFORM_SKEWY = 6; + + readonly attribute unsigned short type; + readonly attribute SVGMatrix matrix; + readonly attribute float angle; + + void setMatrix ( in SVGMatrix matrix ); + void setTranslate ( in float tx, in float ty ); + void setScale ( in float sx, in float sy ); + void setRotate ( in float angle, in float cx, in float cy ); + void setSkewX ( in float angle ); + void setSkewY ( in float angle ); + }; + + interface SVGTransformList { + + readonly attribute unsigned long numberOfItems; + + void clear ( ) + raises( DOMException ); + SVGTransform initialize ( in SVGTransform newItem ) + raises( DOMException, SVGException ); + SVGTransform getItem ( in unsigned long index ) + raises( DOMException ); + SVGTransform insertItemBefore ( in SVGTransform newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGTransform replaceItem ( in SVGTransform newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGTransform removeItem ( in unsigned long index ) + raises( DOMException ); + SVGTransform appendItem ( in SVGTransform newItem ) + raises( DOMException, SVGException ); + SVGTransform createSVGTransformFromMatrix ( in SVGMatrix matrix ); + SVGTransform consolidate ( ); + }; + + interface SVGAnimatedTransformList { + + readonly attribute SVGTransformList baseVal; + readonly attribute SVGTransformList animVal; + }; + + interface SVGPreserveAspectRatio { + + // Alignment Types + const unsigned short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0; + const unsigned short SVG_PRESERVEASPECTRATIO_NONE = 1; + const unsigned short SVG_PRESERVEASPECTRATIO_XMINYMIN = 2; + const unsigned short SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3; + const unsigned short SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4; + const unsigned short SVG_PRESERVEASPECTRATIO_XMINYMID = 5; + const unsigned short SVG_PRESERVEASPECTRATIO_XMIDYMID = 6; + const unsigned short SVG_PRESERVEASPECTRATIO_XMAXYMID = 7; + const unsigned short SVG_PRESERVEASPECTRATIO_XMINYMAX = 8; + const unsigned short SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9; + const unsigned short SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10; + // Meet-or-slice Types + const unsigned short SVG_MEETORSLICE_UNKNOWN = 0; + const unsigned short SVG_MEETORSLICE_MEET = 1; + const unsigned short SVG_MEETORSLICE_SLICE = 2; + + attribute unsigned short align; + // raises DOMException on setting + attribute unsigned short meetOrSlice; + // raises DOMException on setting + }; + + interface SVGAnimatedPreserveAspectRatio { + + readonly attribute SVGPreserveAspectRatio baseVal; + readonly attribute SVGPreserveAspectRatio animVal; + }; + + interface SVGPathSeg { + + // Path Segment Types + const unsigned short PATHSEG_UNKNOWN = 0; + const unsigned short PATHSEG_CLOSEPATH = 1; + const unsigned short PATHSEG_MOVETO_ABS = 2; + const unsigned short PATHSEG_MOVETO_REL = 3; + const unsigned short PATHSEG_LINETO_ABS = 4; + const unsigned short PATHSEG_LINETO_REL = 5; + const unsigned short PATHSEG_CURVETO_CUBIC_ABS = 6; + const unsigned short PATHSEG_CURVETO_CUBIC_REL = 7; + const unsigned short PATHSEG_CURVETO_QUADRATIC_ABS = 8; + const unsigned short PATHSEG_CURVETO_QUADRATIC_REL = 9; + const unsigned short PATHSEG_ARC_ABS = 10; + const unsigned short PATHSEG_ARC_REL = 11; + const unsigned short PATHSEG_LINETO_HORIZONTAL_ABS = 12; + const unsigned short PATHSEG_LINETO_HORIZONTAL_REL = 13; + const unsigned short PATHSEG_LINETO_VERTICAL_ABS = 14; + const unsigned short PATHSEG_LINETO_VERTICAL_REL = 15; + const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16; + const unsigned short PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17; + const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18; + const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; + + readonly attribute unsigned short pathSegType; + readonly attribute DOMString pathSegTypeAsLetter; + }; + + interface SVGPathSegClosePath : SVGPathSeg {}; + + interface SVGPathSegMovetoAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegMovetoRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegLinetoAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegLinetoRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoCubicAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float x1; + // raises DOMException on setting + attribute float y1; + // raises DOMException on setting + attribute float x2; + // raises DOMException on setting + attribute float y2; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoCubicRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float x1; + // raises DOMException on setting + attribute float y1; + // raises DOMException on setting + attribute float x2; + // raises DOMException on setting + attribute float y2; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoQuadraticAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float x1; + // raises DOMException on setting + attribute float y1; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoQuadraticRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float x1; + // raises DOMException on setting + attribute float y1; + // raises DOMException on setting + }; + + interface SVGPathSegArcAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float r1; + // raises DOMException on setting + attribute float r2; + // raises DOMException on setting + attribute float angle; + // raises DOMException on setting + attribute boolean largeArcFlag; + // raises DOMException on setting + attribute boolean sweepFlag; + // raises DOMException on setting + }; + + interface SVGPathSegArcRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float r1; + // raises DOMException on setting + attribute float r2; + // raises DOMException on setting + attribute float angle; + // raises DOMException on setting + attribute boolean largeArcFlag; + // raises DOMException on setting + attribute boolean sweepFlag; + // raises DOMException on setting + }; + + interface SVGPathSegLinetoHorizontalAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + }; + + interface SVGPathSegLinetoHorizontalRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + }; + + interface SVGPathSegLinetoVerticalAbs : SVGPathSeg { + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegLinetoVerticalRel : SVGPathSeg { + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoCubicSmoothAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float x2; + // raises DOMException on setting + attribute float y2; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoCubicSmoothRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float x2; + // raises DOMException on setting + attribute float y2; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoQuadraticSmoothAbs : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegCurvetoQuadraticSmoothRel : SVGPathSeg { + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + }; + + interface SVGPathSegList { + + readonly attribute unsigned long numberOfItems; + + void clear ( ) + raises( DOMException ); + SVGPathSeg initialize ( in SVGPathSeg newItem ) + raises( DOMException, SVGException ); + SVGPathSeg getItem ( in unsigned long index ) + raises( DOMException ); + SVGPathSeg insertItemBefore ( in SVGPathSeg newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGPathSeg replaceItem ( in SVGPathSeg newItem, in unsigned long index ) + raises( DOMException, SVGException ); + SVGPathSeg removeItem ( in unsigned long index ) + raises( DOMException ); + SVGPathSeg appendItem ( in SVGPathSeg newItem ) + raises( DOMException, SVGException ); + }; + + interface SVGAnimatedPathData { + + readonly attribute SVGPathSegList pathSegList; + readonly attribute SVGPathSegList normalizedPathSegList; + readonly attribute SVGPathSegList animatedPathSegList; + readonly attribute SVGPathSegList animatedNormalizedPathSegList; + }; + + interface SVGPathElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget, + SVGAnimatedPathData { + + readonly attribute SVGAnimatedNumber pathLength; + + float getTotalLength ( ); + SVGPoint getPointAtLength ( in float distance ); + unsigned long getPathSegAtLength ( in float distance ); + SVGPathSegClosePath createSVGPathSegClosePath ( ); + SVGPathSegMovetoAbs createSVGPathSegMovetoAbs ( in float x, in float y ); + SVGPathSegMovetoRel createSVGPathSegMovetoRel ( in float x, in float y ); + SVGPathSegLinetoAbs createSVGPathSegLinetoAbs ( in float x, in float y ); + SVGPathSegLinetoRel createSVGPathSegLinetoRel ( in float x, in float y ); + SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs ( in float x, in float y, in float x1, in float y1, in float x2, in float y2 ); + SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel ( in float x, in float y, in float x1, in float y1, in float x2, in float y2 ); + SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs ( in float x, in float y, in float x1, in float y1 ); + SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel ( in float x, in float y, in float x1, in float y1 ); + SVGPathSegArcAbs createSVGPathSegArcAbs ( in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag ); + SVGPathSegArcRel createSVGPathSegArcRel ( in float x, in float y, in float r1, in float r2, in float angle, in boolean largeArcFlag, in boolean sweepFlag ); + SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs ( in float x ); + SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel ( in float x ); + SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs ( in float y ); + SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel ( in float y ); + SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs ( in float x, in float y, in float x2, in float y2 ); + SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel ( in float x, in float y, in float x2, in float y2 ); + SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs ( in float x, in float y ); + SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel ( in float x, in float y ); + }; + + interface SVGRectElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + readonly attribute SVGAnimatedLength rx; + readonly attribute SVGAnimatedLength ry; + }; + + interface SVGCircleElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength cx; + readonly attribute SVGAnimatedLength cy; + readonly attribute SVGAnimatedLength r; + }; + + interface SVGEllipseElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength cx; + readonly attribute SVGAnimatedLength cy; + readonly attribute SVGAnimatedLength rx; + readonly attribute SVGAnimatedLength ry; + }; + + interface SVGLineElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength x1; + readonly attribute SVGAnimatedLength y1; + readonly attribute SVGAnimatedLength x2; + readonly attribute SVGAnimatedLength y2; + }; + + interface SVGAnimatedPoints { + + readonly attribute SVGPointList points; + readonly attribute SVGPointList animatedPoints; + }; + + interface SVGPolylineElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget, + SVGAnimatedPoints {}; + + interface SVGPolygonElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget, + SVGAnimatedPoints {}; + + interface SVGTextContentElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + events::EventTarget { + + // lengthAdjust Types + const unsigned short LENGTHADJUST_UNKNOWN = 0; + const unsigned short LENGTHADJUST_SPACING = 1; + const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2; + + readonly attribute SVGAnimatedLength textLength; + readonly attribute SVGAnimatedEnumeration lengthAdjust; + + long getNumberOfChars ( ); + float getComputedTextLength ( ); + float getSubStringLength ( in unsigned long charnum, in unsigned long nchars ) + raises( DOMException ); + SVGPoint getStartPositionOfChar ( in unsigned long charnum ) + raises( DOMException ); + SVGPoint getEndPositionOfChar ( in unsigned long charnum ) + raises( DOMException ); + SVGRect getExtentOfChar ( in unsigned long charnum ) + raises( DOMException ); + float getRotationOfChar ( in unsigned long charnum ) + raises( DOMException ); + long getCharNumAtPosition ( in SVGPoint point ); + void selectSubString ( in unsigned long charnum, in unsigned long nchars ) + raises( DOMException ); + }; + + interface SVGTextPositioningElement : SVGTextContentElement { + readonly attribute SVGAnimatedLengthList x; + readonly attribute SVGAnimatedLengthList y; + readonly attribute SVGAnimatedLengthList dx; + readonly attribute SVGAnimatedLengthList dy; + readonly attribute SVGAnimatedNumberList rotate; + }; + + interface SVGTextElement : + SVGTextPositioningElement, + SVGTransformable {}; + + interface SVGTSpanElement : SVGTextPositioningElement {}; + + interface SVGTRefElement : + SVGTextPositioningElement, + SVGURIReference {}; + + interface SVGTextPathElement : + SVGTextContentElement, + SVGURIReference { + + // textPath Method Types + const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0; + const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1; + const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2; + // textPath Spacing Types + const unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN = 0; + const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1; + const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2; + + readonly attribute SVGAnimatedLength startOffset; + readonly attribute SVGAnimatedEnumeration method; + readonly attribute SVGAnimatedEnumeration spacing; + }; + + interface SVGAltGlyphElement : + SVGTextPositioningElement, + SVGURIReference { + + attribute DOMString glyphRef; + // raises DOMException on setting + attribute DOMString format; + // raises DOMException on setting + }; + + interface SVGAltGlyphDefElement : SVGElement {}; + + interface SVGAltGlyphItemElement : SVGElement {}; + + interface SVGGlyphRefElement : + SVGElement, + SVGURIReference, + SVGStylable { + + attribute DOMString glyphRef; + // raises DOMException on setting + attribute DOMString format; + // raises DOMException on setting + attribute float x; + // raises DOMException on setting + attribute float y; + // raises DOMException on setting + attribute float dx; + // raises DOMException on setting + attribute float dy; + // raises DOMException on setting + }; + + interface SVGPaint : SVGColor { + // Paint Types + const unsigned short SVG_PAINTTYPE_UNKNOWN = 0; + const unsigned short SVG_PAINTTYPE_RGBCOLOR = 1; + const unsigned short SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR = 2; + const unsigned short SVG_PAINTTYPE_NONE = 101; + const unsigned short SVG_PAINTTYPE_CURRENTCOLOR = 102; + const unsigned short SVG_PAINTTYPE_URI_NONE = 103; + const unsigned short SVG_PAINTTYPE_URI_CURRENTCOLOR = 104; + const unsigned short SVG_PAINTTYPE_URI_RGBCOLOR = 105; + const unsigned short SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR = 106; + const unsigned short SVG_PAINTTYPE_URI = 107; + + readonly attribute unsigned short paintType; + readonly attribute DOMString uri; + + void setUri ( in DOMString uri ); + void setPaint ( in unsigned short paintType, in DOMString uri, in DOMString rgbColor, in DOMString iccColor ) + raises( SVGException ); + }; + + interface SVGMarkerElement : + SVGElement, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGFitToViewBox { + + // Marker Unit Types + const unsigned short SVG_MARKERUNITS_UNKNOWN = 0; + const unsigned short SVG_MARKERUNITS_USERSPACEONUSE = 1; + const unsigned short SVG_MARKERUNITS_STROKEWIDTH = 2; + // Marker Orientation Types + const unsigned short SVG_MARKER_ORIENT_UNKNOWN = 0; + const unsigned short SVG_MARKER_ORIENT_AUTO = 1; + const unsigned short SVG_MARKER_ORIENT_ANGLE = 2; + + readonly attribute SVGAnimatedLength refX; + readonly attribute SVGAnimatedLength refY; + readonly attribute SVGAnimatedEnumeration markerUnits; + readonly attribute SVGAnimatedLength markerWidth; + readonly attribute SVGAnimatedLength markerHeight; + readonly attribute SVGAnimatedEnumeration orientType; + readonly attribute SVGAnimatedAngle orientAngle; + + void setOrientToAuto ( ); + void setOrientToAngle ( in SVGAngle angle ); + }; + + interface SVGColorProfileElement : + SVGElement, + SVGURIReference, + SVGRenderingIntent { + + attribute DOMString local; + // raises DOMException on setting + attribute DOMString name; + // raises DOMException on setting + attribute unsigned short renderingIntent; + // raises DOMException on setting + }; + + interface SVGColorProfileRule : + SVGCSSRule, + SVGRenderingIntent { + + attribute DOMString src; + // raises DOMException on setting + attribute DOMString name; + // raises DOMException on setting + attribute unsigned short renderingIntent; + // raises DOMException on setting + }; + + interface SVGGradientElement : + SVGElement, + SVGURIReference, + SVGExternalResourcesRequired, + SVGStylable, + SVGUnitTypes { + + // Spread Method Types + const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0; + const unsigned short SVG_SPREADMETHOD_PAD = 1; + const unsigned short SVG_SPREADMETHOD_REFLECT = 2; + const unsigned short SVG_SPREADMETHOD_REPEAT = 3; + + readonly attribute SVGAnimatedEnumeration gradientUnits; + readonly attribute SVGAnimatedTransformList gradientTransform; + readonly attribute SVGAnimatedEnumeration spreadMethod; + }; + + interface SVGLinearGradientElement : SVGGradientElement { + readonly attribute SVGAnimatedLength x1; + readonly attribute SVGAnimatedLength y1; + readonly attribute SVGAnimatedLength x2; + readonly attribute SVGAnimatedLength y2; + }; + + interface SVGRadialGradientElement : SVGGradientElement { + readonly attribute SVGAnimatedLength cx; + readonly attribute SVGAnimatedLength cy; + readonly attribute SVGAnimatedLength r; + readonly attribute SVGAnimatedLength fx; + readonly attribute SVGAnimatedLength fy; + }; + + interface SVGStopElement : + SVGElement, + SVGStylable { + + readonly attribute SVGAnimatedNumber offset; + }; + + interface SVGPatternElement : + SVGElement, + SVGURIReference, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGFitToViewBox, + SVGUnitTypes { + + readonly attribute SVGAnimatedEnumeration patternUnits; + readonly attribute SVGAnimatedEnumeration patternContentUnits; + readonly attribute SVGAnimatedTransformList patternTransform; + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + }; + + interface SVGClipPathElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + SVGUnitTypes { + + readonly attribute SVGAnimatedEnumeration clipPathUnits; + }; + + interface SVGMaskElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGUnitTypes { + + readonly attribute SVGAnimatedEnumeration maskUnits; + readonly attribute SVGAnimatedEnumeration maskContentUnits; + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + }; + + interface SVGFilterElement : + SVGElement, + SVGURIReference, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGUnitTypes { + + readonly attribute SVGAnimatedEnumeration filterUnits; + readonly attribute SVGAnimatedEnumeration primitiveUnits; + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + readonly attribute SVGAnimatedInteger filterResX; + readonly attribute SVGAnimatedInteger filterResY; + + void setFilterRes ( in unsigned long filterResX, in unsigned long filterResY ); + }; + + interface SVGFilterPrimitiveStandardAttributes : SVGStylable { + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + readonly attribute SVGAnimatedString result; + }; + + interface SVGFEBlendElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Blend Mode Types + const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0; + const unsigned short SVG_FEBLEND_MODE_NORMAL = 1; + const unsigned short SVG_FEBLEND_MODE_MULTIPLY = 2; + const unsigned short SVG_FEBLEND_MODE_SCREEN = 3; + const unsigned short SVG_FEBLEND_MODE_DARKEN = 4; + const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5; + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedString in2; + readonly attribute SVGAnimatedEnumeration mode; + }; + + interface SVGFEColorMatrixElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Color Matrix Types + const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0; + const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1; + const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2; + const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3; + const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4; + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedEnumeration type; + readonly attribute SVGAnimatedNumberList values; + }; + + interface SVGFEComponentTransferElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + }; + + interface SVGComponentTransferFunctionElement : SVGElement { + // Component Transfer Types + const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0; + const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1; + const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2; + const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3; + const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4; + const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5; + + readonly attribute SVGAnimatedEnumeration type; + readonly attribute SVGAnimatedNumberList tableValues; + readonly attribute SVGAnimatedNumber slope; + readonly attribute SVGAnimatedNumber intercept; + readonly attribute SVGAnimatedNumber amplitude; + readonly attribute SVGAnimatedNumber exponent; + readonly attribute SVGAnimatedNumber offset; + }; + + interface SVGFEFuncRElement : SVGComponentTransferFunctionElement {}; + + interface SVGFEFuncGElement : SVGComponentTransferFunctionElement {}; + + interface SVGFEFuncBElement : SVGComponentTransferFunctionElement {}; + + interface SVGFEFuncAElement : SVGComponentTransferFunctionElement {}; + + interface SVGFECompositeElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Composite Operators + const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0; + const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1; + const unsigned short SVG_FECOMPOSITE_OPERATOR_IN = 2; + const unsigned short SVG_FECOMPOSITE_OPERATOR_OUT = 3; + const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4; + const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5; + const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6; + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedString in2; + readonly attribute SVGAnimatedEnumeration operator; + readonly attribute SVGAnimatedNumber k1; + readonly attribute SVGAnimatedNumber k2; + readonly attribute SVGAnimatedNumber k3; + readonly attribute SVGAnimatedNumber k4; + }; + + interface SVGFEConvolveMatrixElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Edge Mode Values + const unsigned short SVG_EDGEMODE_UNKNOWN = 0; + const unsigned short SVG_EDGEMODE_DUPLICATE = 1; + const unsigned short SVG_EDGEMODE_WRAP = 2; + const unsigned short SVG_EDGEMODE_NONE = 3; + + readonly attribute SVGAnimatedInteger orderX; + readonly attribute SVGAnimatedInteger orderY; + readonly attribute SVGAnimatedNumberList kernelMatrix; + readonly attribute SVGAnimatedNumber divisor; + readonly attribute SVGAnimatedNumber bias; + readonly attribute SVGAnimatedInteger targetX; + readonly attribute SVGAnimatedInteger targetY; + readonly attribute SVGAnimatedEnumeration edgeMode; + readonly attribute SVGAnimatedLength kernelUnitLengthX; + readonly attribute SVGAnimatedLength kernelUnitLengthY; + readonly attribute SVGAnimatedBoolean preserveAlpha; + }; + + interface SVGFEDiffuseLightingElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedNumber surfaceScale; + readonly attribute SVGAnimatedNumber diffuseConstant; + }; + + interface SVGFEDistantLightElement : SVGElement { + readonly attribute SVGAnimatedNumber azimuth; + readonly attribute SVGAnimatedNumber elevation; + }; + + interface SVGFEPointLightElement : SVGElement { + readonly attribute SVGAnimatedNumber x; + readonly attribute SVGAnimatedNumber y; + readonly attribute SVGAnimatedNumber z; + }; + + interface SVGFESpotLightElement : SVGElement { + readonly attribute SVGAnimatedNumber x; + readonly attribute SVGAnimatedNumber y; + readonly attribute SVGAnimatedNumber z; + readonly attribute SVGAnimatedNumber pointsAtX; + readonly attribute SVGAnimatedNumber pointsAtY; + readonly attribute SVGAnimatedNumber pointsAtZ; + readonly attribute SVGAnimatedNumber specularExponent; + readonly attribute SVGAnimatedNumber limitingConeAngle; + }; + + interface SVGFEDisplacementMapElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Channel Selectors + const unsigned short SVG_CHANNEL_UNKNOWN = 0; + const unsigned short SVG_CHANNEL_R = 1; + const unsigned short SVG_CHANNEL_G = 2; + const unsigned short SVG_CHANNEL_B = 3; + const unsigned short SVG_CHANNEL_A = 4; + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedString in2; + readonly attribute SVGAnimatedNumber scale; + readonly attribute SVGAnimatedEnumeration xChannelSelector; + readonly attribute SVGAnimatedEnumeration yChannelSelector; + }; + + interface SVGFEFloodElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + }; + + interface SVGFEGaussianBlurElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedNumber stdDeviationX; + readonly attribute SVGAnimatedNumber stdDeviationY; + + void setStdDeviation ( in float stdDeviationX, in float stdDeviationY ); + }; + + interface SVGFEImageElement : + SVGElement, + SVGURIReference, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGFilterPrimitiveStandardAttributes {}; + + interface SVGFEMergeElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes {}; + + interface SVGFEMergeNodeElement : SVGElement { + readonly attribute SVGAnimatedString in1; + }; + + interface SVGFEMorphologyElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Morphology Operators + const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0; + const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1; + const unsigned short SVG_MORPHOLOGY_OPERATOR_DILATE = 2; + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedEnumeration operator; + readonly attribute SVGAnimatedLength radiusX; + readonly attribute SVGAnimatedLength radiusY; + }; + + interface SVGFEOffsetElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedNumber dx; + readonly attribute SVGAnimatedNumber dy; + }; + + interface SVGFESpecularLightingElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + readonly attribute SVGAnimatedNumber surfaceScale; + readonly attribute SVGAnimatedNumber specularConstant; + readonly attribute SVGAnimatedNumber specularExponent; + }; + + interface SVGFETileElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + readonly attribute SVGAnimatedString in1; + }; + + interface SVGFETurbulenceElement : + SVGElement, + SVGFilterPrimitiveStandardAttributes { + + // Turbulence Types + const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0; + const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1; + const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE = 2; + // Stitch Options + const unsigned short SVG_STITCHTYPE_UNKNOWN = 0; + const unsigned short SVG_STITCHTYPE_STITCH = 1; + const unsigned short SVG_STITCHTYPE_NOSTITCH = 2; + + readonly attribute SVGAnimatedNumber baseFrequencyX; + readonly attribute SVGAnimatedNumber baseFrequencyY; + readonly attribute SVGAnimatedInteger numOctaves; + readonly attribute SVGAnimatedNumber seed; + readonly attribute SVGAnimatedEnumeration stitchTiles; + readonly attribute SVGAnimatedEnumeration type; + }; + + interface SVGCursorElement : + SVGElement, + SVGURIReference, + SVGTests, + SVGExternalResourcesRequired { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + }; + + interface SVGAElement : + SVGElement, + SVGURIReference, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedString target; + }; + + interface SVGViewElement : + SVGElement, + SVGExternalResourcesRequired, + SVGFitToViewBox, + SVGZoomAndPan { + + readonly attribute SVGStringList viewTarget; + }; + + interface SVGScriptElement : + SVGElement, + SVGURIReference, + SVGExternalResourcesRequired { + + attribute DOMString type; + // raises DOMException on setting + }; + + interface SVGEvent : events::Event {}; + + interface SVGZoomEvent : events::UIEvent { + readonly attribute SVGRect zoomRectScreen; + readonly attribute float previousScale; + readonly attribute SVGPoint previousTranslate; + readonly attribute float newScale; + readonly attribute SVGPoint newTranslate; + }; + + interface SVGAnimationElement : + SVGElement, + SVGTests, + SVGExternalResourcesRequired, + smil::ElementTimeControl, + events::EventTarget { + // Animation Fill Types + const unsigned short SVG_ANIMATION_FILL_UNKNOWN = 0; + const unsigned short SVG_ANIMATION_FILL_REMOVE = 1; + const unsigned short SVG_ANIMATION_FILL_FREEZE = 2; + // Animation Additive Types + const unsigned short SVG_ANIMATION_ADDITIVE_UNKNOWN = 0; + const unsigned short SVG_ANIMATION_ADDITIVE_REPLACE = 1; + const unsigned short SVG_ANIMATION_ADDITIVE_SUM = 2; + // Animation Accumulate Types + const unsigned short SVG_ANIMATION_ACCUMULATE_UNKNOWN = 0; + const unsigned short SVG_ANIMATION_ACCUMULATE_NONE = 1; + const unsigned short SVG_ANIMATION_ACCUMULATE_SUM = 2; + + readonly attribute SVGElement targetElement; + readonly attribute DOMString attributeName; + readonly attribute float begin; + readonly attribute float dur; + readonly attribute SVGAnimatedType from; + readonly attribute SVGAnimatedType to; + readonly attribute unsigned short fill; + readonly attribute unsigned short additive; + readonly attribute unsigned short accumulate; + + float getStartTime ( ); + float getCurrentTime ( ); + float getSimpleDuration ( ) + raises( DOMException ); + }; + + interface SVGAnimateElement : SVGAnimationElement {}; + + interface SVGSetElement : SVGAnimationElement {}; + + interface SVGAnimateMotionElement : SVGAnimationElement {}; + + interface SVGMPathElement : + SVGElement, + SVGURIReference, + SVGExternalResourcesRequired {}; + + interface SVGAnimateColorElement : SVGAnimationElement {}; + + interface SVGAnimateTransformElement : SVGAnimationElement { + // Animate Transform Types + const unsigned short SVG_ANIMATETRANSFORM_TRANSLATE = 0; + const unsigned short SVG_ANIMATETRANSFORM_SCALE = 1; + const unsigned short SVG_ANIMATETRANSFORM_ROTATE = 2; + const unsigned short SVG_ANIMATETRANSFORM_SKEWX = 3; + const unsigned short SVG_ANIMATETRANSFORM_SKEWY = 4; + + readonly attribute unsigned short type; + }; + + interface SVGFontElement : + SVGElement, + SVGExternalResourcesRequired, + SVGStylable {}; + + interface SVGGlyphElement : + SVGElement, + SVGStylable {}; + + interface SVGMissingGlyphElement : + SVGElement, + SVGStylable {}; + + interface SVGHKernElement : SVGElement {}; + + interface SVGVKernElement : SVGElement {}; + + interface SVGFontFaceElement : SVGElement {}; + + interface SVGFontFaceSrcElement : SVGElement {}; + + interface SVGFontFaceUriElement : SVGElement {}; + + interface SVGFontFaceFormatElement : SVGElement {}; + + interface SVGFontFaceNameElement : SVGElement {}; + + interface SVGDefinitionSrcElement : SVGElement {}; + + interface SVGMetadataElement : SVGElement {}; + + interface SVGForeignObjectElement : + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + }; + + interface SVGVideoElement : + SVGElement, + SVGURIReference, + SVGLangSpace, + SVGStylable, + SVGTransformable { + + readonly attribute SVGAnimatedLength x; + readonly attribute SVGAnimatedLength y; + readonly attribute SVGAnimatedLength width; + readonly attribute SVGAnimatedLength height; + readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio; + + readonly attribute float begin; + readonly attribute float dur; + readonly attribute float clipBegin; + readonly attribute float clipEnd; + }; +}; + +#endif // _SVG_IDL_ diff -Nru wxsvg-1.4~dfsg/src/cairo/.cvsignore wxsvg-1.5.4/src/cairo/.cvsignore --- wxsvg-1.4~dfsg/src/cairo/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/src/cairo/.cvsignore 2006-01-08 19:57:35.000000000 +0000 @@ -0,0 +1,6 @@ +Makefile +Makefile.in +.deps +.libs +*.l* + diff -Nru wxsvg-1.4~dfsg/src/cairo/SVGCanvasCairo.cpp wxsvg-1.5.4/src/cairo/SVGCanvasCairo.cpp --- wxsvg-1.4~dfsg/src/cairo/SVGCanvasCairo.cpp 2014-05-24 13:03:49.000000000 +0000 +++ wxsvg-1.5.4/src/cairo/SVGCanvasCairo.cpp 2014-12-20 20:04:20.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Cairo render // Author: Alex Thuering // Created: 2005/05/12 -// RCS-ID: $Id: SVGCanvasCairo.cpp,v 1.29 2014/05/24 13:03:49 ntalex Exp $ +// RCS-ID: $Id: SVGCanvasCairo.cpp,v 1.32 2014/12/20 20:04:20 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -211,7 +211,7 @@ lround(patternElem->GetHeight().GetAnimVal()*scaleY)); cairo_t* cr = cairo_create(surface); wxSVGMatrix patMatrix; - patMatrix = patMatrix.Scale(scaleX); + patMatrix = patMatrix.ScaleNonUniform(scaleX, scaleY); wxCSSStyleDeclaration style; DrawMask(cr, patternElem, patMatrix, style, svgElem); m_pattern = cairo_pattern_create_for_surface(surface); @@ -219,6 +219,12 @@ if (patternElem->GetX().GetAnimVal() > 0 || patternElem->GetY().GetAnimVal() > 0) { patMatrix = patMatrix.Translate(patternElem->GetX().GetAnimVal(), patternElem->GetY().GetAnimVal()); } + if (patternElem->GetPatternTransform().GetAnimVal().size()) { + const wxSVGTransformList& transforms = patternElem->GetPatternTransform().GetAnimVal(); + for (unsigned int i = 0; i < transforms.Count(); i++) { + patMatrix = patMatrix.Multiply(transforms[i].GetMatrix().Inverse()); + } + } cairo_matrix_t mat; cairo_matrix_init(&mat, patMatrix.GetA(), patMatrix.GetB(), patMatrix.GetC(), patMatrix.GetD(), patMatrix.GetE(), patMatrix.GetF()); cairo_pattern_set_matrix(m_pattern, &mat); @@ -330,6 +336,7 @@ } /** + * Draws gaussian blur filter. * Uses code from Mozilla (nsSVGFilters.cpp) */ void gaussianBlur(cairo_surface_t* surface, int dx, int dy) { @@ -351,7 +358,7 @@ boxBlurH(buffer, tempBuffer, stride, rect, dx / 2, dx / 2, prediv); boxBlurH(tempBuffer, buffer, stride, rect, dx / 2, dx / 2, prediv); boxBlurH(buffer, tempBuffer, stride, rect, dx / 2, dx / 2, prediv); - free(prediv); + delete[] prediv; } else { // even if (dx == 0) { @@ -362,8 +369,8 @@ boxBlurH(buffer, tempBuffer, stride, rect, dx / 2, dx / 2 - 1, prediv2); boxBlurH(tempBuffer, buffer, stride, rect, dx / 2 - 1, dx / 2, prediv2); boxBlurH(buffer, tempBuffer, stride, rect, dx / 2, dx / 2, prediv); - free(prediv); - free(prediv2); + delete[] prediv; + delete[] prediv2; } } @@ -373,7 +380,7 @@ boxBlurV(tempBuffer, buffer, stride, rect, dy / 2, dy / 2, prediv); boxBlurV(buffer, tempBuffer, stride, rect, dy / 2, dy / 2, prediv); boxBlurV(tempBuffer, buffer, stride, rect, dy / 2, dy / 2, prediv); - free(prediv); + delete[] prediv; } else { // even if (dy == 0) { @@ -384,8 +391,8 @@ boxBlurV(tempBuffer, buffer, stride, rect, dy / 2, dy / 2 - 1, prediv2); boxBlurV(buffer, tempBuffer, stride, rect, dy / 2 - 1, dy / 2, prediv2); boxBlurV(tempBuffer, buffer, stride, rect, dy / 2, dy / 2, prediv); - free(prediv); - free(prediv2); + delete[] prediv; + delete[] prediv2; } } @@ -415,6 +422,17 @@ cairo_stroke(cr); cairo_path_destroy(path); } + + // marker + if (style.HasMarkerStart()) { + DrawMarker(style.GetMarkerStart().GetStringValue(), wxSVGMark::START, canvasPath, matrix, style, svgElem); + } + if (style.HasMarkerMid()) { + DrawMarker(style.GetMarkerMid().GetStringValue(), wxSVGMark::MID, canvasPath, matrix, style, svgElem); + } + if (style.HasMarkerEnd()) { + DrawMarker(style.GetMarkerEnd().GetStringValue(), wxSVGMark::END, canvasPath, matrix, style, svgElem); + } } void wxSVGCanvasCairo::DrawCanvasPath(wxSVGCanvasPathCairo& canvasPath, wxSVGMatrix& matrix, @@ -546,35 +564,119 @@ DrawMask(cr, elem, matrix, resStyle, svgElem); break; } - case wxSVG_LINE_ELEMENT: - canvasItem = doc->GetCanvas()->CreateItem((wxSVGLineElement*) elem); - resStyle.Add(((wxSVGLineElement*) elem)->GetStyle()); + case wxSVG_LINE_ELEMENT: { + wxSVGLineElement* element = (wxSVGLineElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; - case wxSVG_POLYLINE_ELEMENT: - canvasItem = doc->GetCanvas()->CreateItem((wxSVGPolylineElement*) elem); - resStyle.Add(((wxSVGPolylineElement*) elem)->GetStyle()); + } + case wxSVG_POLYLINE_ELEMENT: { + wxSVGPolylineElement* element = (wxSVGPolylineElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; - case wxSVG_POLYGON_ELEMENT: - canvasItem = doc->GetCanvas()->CreateItem((wxSVGPolygonElement*) elem); - resStyle.Add(((wxSVGPolygonElement*) elem)->GetStyle()); + } + case wxSVG_POLYGON_ELEMENT: { + wxSVGPolygonElement* element = (wxSVGPolygonElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; - case wxSVG_RECT_ELEMENT: - canvasItem = doc->GetCanvas()->CreateItem((wxSVGRectElement*) elem); - resStyle.Add(((wxSVGRectElement*) elem)->GetStyle()); + } + case wxSVG_RECT_ELEMENT: { + wxSVGRectElement* element = (wxSVGRectElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; - case wxSVG_CIRCLE_ELEMENT: - canvasItem = doc->GetCanvas()->CreateItem((wxSVGCircleElement*) elem); - resStyle.Add(((wxSVGCircleElement*) elem)->GetStyle()); + } + case wxSVG_CIRCLE_ELEMENT: { + wxSVGCircleElement* element = (wxSVGCircleElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; + } case wxSVG_ELLIPSE_ELEMENT: { - canvasItem = doc->GetCanvas()->CreateItem((wxSVGEllipseElement*) elem); - resStyle.Add(((wxSVGEllipseElement*) elem)->GetStyle()); + wxSVGEllipseElement* element = (wxSVGEllipseElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; } - case wxSVG_PATH_ELEMENT: - canvasItem = doc->GetCanvas()->CreateItem((wxSVGPathElement*) elem); - resStyle.Add(((wxSVGPathElement*) elem)->GetStyle()); + case wxSVG_PATH_ELEMENT: { + wxSVGPathElement* element = (wxSVGPathElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + canvasItem = doc->GetCanvas()->CreateItem(element); + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); break; + } + case wxSVG_USE_ELEMENT: { + wxSVGUseElement* element = (wxSVGUseElement*) elem; + if (element->GetVisibility() == wxCSS_VALUE_HIDDEN) + break; + resStyle.Add(element->GetStyle()); + resStyle.Add(element->GetAnimStyle()); + // get ref element + wxString href = element->GetHref(); + if (href.length() == 0 || href.GetChar(0) != wxT('#')) + break; + href.Remove(0, 1); + wxSVGElement* refElem = (wxSVGElement*) maskElem->GetOwnerSVGElement()->GetElementById(href); + if (!refElem) + break; + + // create shadow tree + wxSVGGElement* gElem = new wxSVGGElement(); + gElem->SetOwnerDocument(elem->GetOwnerDocument()); + gElem->SetOwnerSVGElement(maskElem->GetOwnerSVGElement()); + gElem->SetViewportElement(maskElem->GetViewportElement()); + gElem->SetStyle(element->GetStyle()); + if (element->GetX().GetAnimVal().GetUnitType() != wxSVG_LENGTHTYPE_UNKNOWN) + gElem->Translate(element->GetX().GetAnimVal(), element->GetY().GetAnimVal()); + if (refElem->GetDtd() == wxSVG_SYMBOL_ELEMENT || refElem->GetDtd() == wxSVG_SVG_ELEMENT) { + wxSVGSVGElement* svgElem; + if (refElem->GetDtd() == wxSVG_SVG_ELEMENT) + svgElem = (wxSVGSVGElement*) refElem->CloneNode(); + else { + svgElem = new wxSVGSVGElement(); + wxSvgXmlElement* child = refElem->GetChildren(); + while (child) { + svgElem->AddChild(child->CloneNode()); + child = child->GetNext(); + } + svgElem->SetViewBox(((wxSVGSymbolElement*) refElem)->GetViewBox()); + svgElem->SetPreserveAspectRatio(((wxSVGSymbolElement*) refElem)->GetPreserveAspectRatio()); + } + if (element->GetWidth().GetAnimVal().GetUnitType() != wxSVG_LENGTHTYPE_UNKNOWN) + svgElem->SetWidth(element->GetWidth().GetAnimVal()); + if (element->GetHeight().GetAnimVal().GetUnitType() != wxSVG_LENGTHTYPE_UNKNOWN) + svgElem->SetHeight(element->GetHeight().GetAnimVal()); + gElem->AddChild(svgElem); + } else + gElem->AddChild(refElem->CloneNode()); + // render + DrawMask(cr, gElem, matrix, resStyle, svgElem); + // delete shadow tree + delete gElem; + break; + } default: break; } @@ -678,3 +780,49 @@ // clean up cairo_restore(m_cr); } + +void wxSVGCanvasCairo::DrawMarker(const wxString& uri, wxSVGMark::Type type, wxSVGCanvasPathCairo& canvasPath, + const wxSVGMatrix& matrix, const wxCSSStyleDeclaration& style, wxSVGSVGElement& svgElem) { + wxSVGMarkerElement* markerElem = GetMarkerElement(svgElem, uri); + if (markerElem == NULL || markerElem->GetMarkerWidth().GetAnimVal() <= 0 + || markerElem->GetMarkerHeight().GetAnimVal() <= 0) + return; + vector markPoints = canvasPath.GetMarkPoints(); + for (vector::iterator it = markPoints.begin(); it != markPoints.end(); it++) { + if (it->type != type) + continue; + wxSVGMark& markPoint = *it; + double scaleX = matrix.GetA() * style.GetStrokeWidth(); + double scaleY = matrix.GetD() * style.GetStrokeWidth(); + markerElem->SetOwnerSVGElement(&svgElem); + markerElem->SetViewportElement(&svgElem); + cairo_surface_t* surface = cairo_image_surface_create( + CAIRO_FORMAT_ARGB32, + lround(markerElem->GetMarkerWidth().GetAnimVal() * scaleX), + lround(markerElem->GetMarkerHeight().GetAnimVal() * scaleY)); + cairo_t* cr = cairo_create(surface); + wxSVGMatrix markerMatrix; + markerMatrix = markerMatrix.ScaleNonUniform(scaleX, scaleY); + wxCSSStyleDeclaration style; + DrawMask(cr, markerElem, markerMatrix, style, svgElem); + // draw surface + cairo_save(m_cr); + double refX = markerElem->GetRefX().GetAnimVal() * style.GetStrokeWidth(); + double refY = markerElem->GetRefY().GetAnimVal() * style.GetStrokeWidth(); + wxSVGPoint point(markPoint.x - refX, markPoint.y - refY); + point = point.MatrixTransform(matrix); + wxSVGMatrix m; + m = m.Translate(point.GetX(), point.GetY()); + if (markPoint.angle != 0) { + refX = markerElem->GetRefX().GetAnimVal() * scaleX; + refY = markerElem->GetRefY().GetAnimVal() * scaleY; + m = m.Translate(refX, refY).Rotate(markPoint.angle / M_PI * 180).Translate(-refX, -refY); + } + SetMatrix(m_cr, m); + cairo_set_source_surface(m_cr, surface, 0, 0); + cairo_paint(m_cr); + cairo_restore(m_cr); + cairo_destroy(cr); + cairo_surface_destroy(surface); + } +} diff -Nru wxsvg-1.4~dfsg/src/cairo/SVGCanvasCairo.h wxsvg-1.5.4/src/cairo/SVGCanvasCairo.h --- wxsvg-1.4~dfsg/src/cairo/SVGCanvasCairo.h 2014-05-24 13:03:49.000000000 +0000 +++ wxsvg-1.5.4/src/cairo/SVGCanvasCairo.h 2014-08-09 11:16:21.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Cairo render // Author: Alex Thuering // Created: 2005/05/12 -// RCS-ID: $Id: SVGCanvasCairo.h,v 1.14 2014/05/24 13:03:49 ntalex Exp $ +// RCS-ID: $Id: SVGCanvasCairo.h,v 1.15 2014/08/09 11:16:21 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -62,6 +62,8 @@ void SetClipPath(wxSVGElement* clipPathElem, wxSVGMatrix matrix); void DrawMask(cairo_t* cr, wxSVGElement* maskElem, const wxSVGMatrix& matrix, const wxCSSStyleDeclaration& style, wxSVGSVGElement& svgElem); + void DrawMarker(const wxString& uri, wxSVGMark::Type type, wxSVGCanvasPathCairo& canvasPath, + const wxSVGMatrix& matrix, const wxCSSStyleDeclaration& style, wxSVGSVGElement& svgElem); }; #endif // WX_SVG_CANVAS_CAIRO_H diff -Nru wxsvg-1.4~dfsg/src/cairo/SVGCanvasPathCairo.cpp wxsvg-1.5.4/src/cairo/SVGCanvasPathCairo.cpp --- wxsvg-1.4~dfsg/src/cairo/SVGCanvasPathCairo.cpp 2013-05-01 07:15:41.000000000 +0000 +++ wxsvg-1.5.4/src/cairo/SVGCanvasPathCairo.cpp 2014-11-23 11:36:16.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Cairo canvas path // Author: Alex Thuering // Created: 2005/05/12 -// RCS-ID: $Id: SVGCanvasPathCairo.cpp,v 1.11 2013/05/01 07:15:41 ntalex Exp $ +// RCS-ID: $Id: SVGCanvasPathCairo.cpp,v 1.14 2014/11/23 11:36:16 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -115,5 +115,13 @@ cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER); break; } -// cairo_set_dash(cr, (double*) lengths, count, 0.0); + if (style.GetStrokeDasharray().GetLength() > 0) { + double* dashed = new double[style.GetStrokeDasharray().GetLength()]; + for (int i = 0; i < style.GetStrokeDasharray().GetLength(); i++) { + dashed[i] = style.GetStrokeDasharray().Item(i).GetFloatValue(); + } + cairo_set_dash(cr, dashed, style.GetStrokeDasharray().GetLength(), 0.0); + delete dashed; + } else + cairo_set_dash(cr, NULL, 0, 0); } diff -Nru wxsvg-1.4~dfsg/src/cairo/SVGCanvasTextCairo.cpp wxsvg-1.5.4/src/cairo/SVGCanvasTextCairo.cpp --- wxsvg-1.4~dfsg/src/cairo/SVGCanvasTextCairo.cpp 2014-03-03 17:08:26.000000000 +0000 +++ wxsvg-1.5.4/src/cairo/SVGCanvasTextCairo.cpp 2014-06-16 19:40:46.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Cairo canvas text // Author: Alex Thuering // Created: 2011/06/23 -// RCS-ID: $Id: SVGCanvasTextCairo.cpp,v 1.12 2014/03/03 17:08:26 ntalex Exp $ +// RCS-ID: $Id: SVGCanvasTextCairo.cpp,v 1.13 2014/06/16 19:40:46 ntalex Exp $ // Copyright: (c) 2011 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -20,6 +20,7 @@ #include #else #include +#include #endif wxSVGCanvasTextCairo::wxSVGCanvasTextCairo(wxSVGCanvas* canvas): wxSVGCanvasText(canvas) { @@ -131,8 +132,11 @@ double width = ((double)lwidth / PANGO_SCALE); double height = ((double)lheight / PANGO_SCALE); m_char->bbox = wxSVGRect(m_tx, m_ty, width, height); - wxSVGRect bbox = m_char->path->GetResultBBox(style); - m_tx += width > bbox.GetWidth() ? width : bbox.GetWidth(); + if (style.GetTextAnchor() == wxCSS_VALUE_MIDDLE || style.GetTextAnchor() == wxCSS_VALUE_END) { + wxSVGRect bbox = m_char->path->GetResultBBox(style); + m_tx += width > bbox.GetWidth() ? width : bbox.GetWidth(); + } else + m_tx += width; g_object_unref(layout); pango_font_description_free(font); diff -Nru wxsvg-1.4~dfsg/src/CSSStyleDeclaration.cpp wxsvg-1.5.4/src/CSSStyleDeclaration.cpp --- wxsvg-1.4~dfsg/src/CSSStyleDeclaration.cpp 2014-03-27 08:42:16.000000000 +0000 +++ wxsvg-1.5.4/src/CSSStyleDeclaration.cpp 2015-03-21 16:28:23.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/05/03 -// RCS-ID: $Id: CSSStyleDeclaration.cpp,v 1.11 2014/03/27 08:42:16 ntalex Exp $ +// RCS-ID: $Id: CSSStyleDeclaration.cpp,v 1.13 2015/03/21 16:28:23 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -16,6 +16,7 @@ wxSVGColor* wxCSSStyleDeclaration::s_emptySVGColor = new wxSVGColor; wxSVGPaint* wxCSSStyleDeclaration::s_emptySVGPaint = new wxSVGPaint; wxSVGPaint* wxCSSStyleDeclaration::s_blackSVGPaint = new wxSVGPaint(0,0,0); +wxCSSValueList* wxCSSStyleDeclaration::s_emptyValueList = new wxCSSValueList; wxCSSStyleDeclaration::~wxCSSStyleDeclaration() { for (iterator it = begin(); it != end(); ++it) @@ -223,7 +224,6 @@ break; // string case wxCSS_PROPERTY_FONT_FAMILY: - case wxCSS_PROPERTY_STROKE_DASHARRAY: if (!cssValue) cssValue = new wxCSSPrimitiveValue; ((wxCSSPrimitiveValue*) cssValue)->SetStringValue(wxCSS_STRING, value); @@ -243,6 +243,12 @@ cssValue = new wxSVGPaint; ParseSVGPaint(*(wxSVGPaint*) cssValue, value); break; + // + case wxCSS_PROPERTY_STROKE_DASHARRAY: + if (!cssValue) + cssValue = new wxCSSValueList; + ((wxCSSValueList*) cssValue)->SetCSSText(value); + break; } if (it == end()) (*this)[propertyId] = cssValue; @@ -334,11 +340,18 @@ if (!value.length() || value == wxT("none")) return wxRGBColor(); else if (value.GetChar(0) == wxT('#')) { - long r = 0, g = 0, b = 0; - value.Mid(1, 2).ToLong(&r, 16); - value.Mid(3, 2).ToLong(&g, 16); - value.Mid(5, 2).ToLong(&b, 16); - return wxRGBColor(r, g, b); + long r = 0, g = 0, b = 0, test; + if (!value.Mid(4, 1).ToLong(&test, 16)) { + value.Mid(1, 1).ToLong(&r, 16); + value.Mid(2, 1).ToLong(&g, 16); + value.Mid(3, 1).ToLong(&b, 16); + return wxRGBColor((r << 4) | r, (g << 4) | g, (b << 4) | b); + } else { + value.Mid(1, 2).ToLong(&r, 16); + value.Mid(3, 2).ToLong(&g, 16); + value.Mid(5, 2).ToLong(&b, 16); + return wxRGBColor(r, g, b); + } } else if (value.Left(3) == wxT("rgb")) { wxStringTokenizer tkz(value.Mid(3), wxT(",()")); long rgb[3] = { 0, 0, 0 }; diff -Nru wxsvg-1.4~dfsg/src/CSSValue.cpp wxsvg-1.5.4/src/CSSValue.cpp --- wxsvg-1.4~dfsg/src/CSSValue.cpp 2010-02-22 20:00:07.000000000 +0000 +++ wxsvg-1.5.4/src/CSSValue.cpp 2014-06-30 19:06:12.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/05/03 -// RCS-ID: $Id: CSSValue.cpp,v 1.12 2010/02/22 20:00:07 ntalex Exp $ +// RCS-ID: $Id: CSSValue.cpp,v 1.13 2014/06/30 19:06:12 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -191,3 +191,31 @@ delete m_color; m_primitiveType = wxCSS_UNKNOWN; } + +////////////////////////////////////////////////////////////////////////////// +///////////////////////////// wxCSSValueList //////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +wxCSSValueList::wxCSSValueList(const wxCSSValueList& src) { + m_values = src.m_values; +} + +wxString wxCSSValueList::GetCSSText() const { + wxString result; + for (std::vector::const_iterator it = m_values.begin(); it != m_values.end(); ++it) { + if (result.length()) + result += wxT(", "); + result += wxString::Format(wxT("%g"), *it); + } + return result; +} + +void wxCSSValueList::SetCSSText(const wxString& value) { + double val; + wxStringTokenizer tkz(value, wxT(", \t")); + while (tkz.HasMoreTokens()) { + wxString token = tkz.GetNextToken(); + if (token.length() && token.ToDouble(&val)) + m_values.push_back(val); + } +} diff -Nru wxsvg-1.4~dfsg/src/.cvsignore wxsvg-1.5.4/src/.cvsignore --- wxsvg-1.4~dfsg/src/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/src/.cvsignore 2006-01-08 19:52:01.000000000 +0000 @@ -0,0 +1,6 @@ +Makefile +Makefile.in +.deps +.libs +*.l* + diff -Nru wxsvg-1.4~dfsg/src/mediadec_ffmpeg.cpp wxsvg-1.5.4/src/mediadec_ffmpeg.cpp --- wxsvg-1.4~dfsg/src/mediadec_ffmpeg.cpp 2014-05-15 19:52:58.000000000 +0000 +++ wxsvg-1.5.4/src/mediadec_ffmpeg.cpp 2014-12-30 12:17:08.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: FFMPEG Media Decoder // Author: Alex Thuering // Created: 21.07.2007 -// RCS-ID: $Id: mediadec_ffmpeg.cpp,v 1.27 2014/05/15 19:52:58 ntalex Exp $ +// RCS-ID: $Id: mediadec_ffmpeg.cpp,v 1.31 2014/12/30 12:17:08 ntalex Exp $ // Copyright: (c) Alex Thuering // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -26,6 +26,11 @@ #include } +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) +#define av_frame_alloc avcodec_alloc_frame +#define av_frame_free avcodec_free_frame +#endif + wxFfmpegMediaDecoder::wxFfmpegMediaDecoder(): m_formatCtx(NULL), m_videoStream(-1), m_codecCtx(NULL), m_frame(NULL), m_width(0), m_height(0) { // nothing to do @@ -116,11 +121,11 @@ float result = -1; for (unsigned int i = 0; i < m_formatCtx->nb_streams; i++) { AVStream* st = m_formatCtx->streams[i]; - if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->r_frame_rate.num && st->r_frame_rate.den) { - if (st->r_frame_rate.num > st->r_frame_rate.den) - result = ((float) st->r_frame_rate.num) / st->r_frame_rate.den; + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->avg_frame_rate.num && st->avg_frame_rate.den) { + if (st->avg_frame_rate.num > st->avg_frame_rate.den) + result = ((float) st->avg_frame_rate.num) / st->avg_frame_rate.den; else - result = ((float) st->r_frame_rate.den) / st->r_frame_rate.num; + result = ((float) st->avg_frame_rate.den) / st->avg_frame_rate.num; break; } } @@ -216,11 +221,7 @@ m_height = w < width ? height : h; } // allocate video frame -#if LIBAVCODEC_VERSION_MAJOR >= 55 m_frame = av_frame_alloc(); -#else - m_frame = avcodec_alloc_frame(); -#endif if (!m_frame) { avcodec_close(m_codecCtx); m_codecCtx = NULL; @@ -232,11 +233,16 @@ bool wxFfmpegMediaDecoder::SetPosition(double pos, bool keyFrame) { if (m_formatCtx == NULL) return false; + if (!m_frame && !BeginDecode()) + return false; int64_t timestamp = (int64_t) (pos * AV_TIME_BASE); if (m_formatCtx->start_time != (int64_t)AV_NOPTS_VALUE) timestamp += m_formatCtx->start_time; - return av_seek_frame(m_formatCtx, -1, timestamp, + avcodec_flush_buffers(m_codecCtx); + bool res = av_seek_frame(m_formatCtx, -1, timestamp, keyFrame ? AVSEEK_FLAG_BACKWARD : AVSEEK_FLAG_ANY|AVSEEK_FLAG_BACKWARD) >= 0; + avcodec_flush_buffers(m_codecCtx); + return res; } double wxFfmpegMediaDecoder::GetPosition() { @@ -266,14 +272,17 @@ if (frameFinished) { SwsContext* imgConvertCtx = sws_getContext(m_codecCtx->width, m_codecCtx->height, m_codecCtx->pix_fmt, m_width, m_height, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL); - if (imgConvertCtx == NULL) + if (imgConvertCtx == NULL) { + av_free_packet(&packet); return wxImage(); + } wxImage img(m_width, m_height); uint8_t *rgbSrc[3] = { img.GetData(), NULL, NULL }; int rgbStride[3] = { 3 * m_width, 0, 0 }; sws_scale(imgConvertCtx, m_frame->data, m_frame->linesize, 0, m_codecCtx->height, rgbSrc, rgbStride); av_free_packet(&packet); + sws_freeContext(imgConvertCtx); return img; } } @@ -283,10 +292,7 @@ return wxImage(); } -void wxFfmpegMediaDecoder::EndDecode() -{ - if (m_frame) - av_free(m_frame); - m_frame = NULL; +void wxFfmpegMediaDecoder::EndDecode() { + av_frame_free(&m_frame); CloseVideoDecoder(); } diff -Nru wxsvg-1.4~dfsg/src/SVGCanvas.cpp wxsvg-1.5.4/src/SVGCanvas.cpp --- wxsvg-1.4~dfsg/src/SVGCanvas.cpp 2014-05-24 13:03:49.000000000 +0000 +++ wxsvg-1.5.4/src/SVGCanvas.cpp 2014-08-09 11:13:55.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: wxSVGCanvas - Base class for SVG renders (backends) // Author: Alex Thuering // Created: 2005/05/04 -// RCS-ID: $Id: SVGCanvas.cpp,v 1.25 2014/05/24 13:03:49 ntalex Exp $ +// RCS-ID: $Id: SVGCanvas.cpp,v 1.26 2014/08/09 11:13:55 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -131,6 +131,13 @@ return elem != NULL && elem->GetDtd() == wxSVG_PATTERN_ELEMENT ? (wxSVGPatternElement*) elem : NULL; } +wxSVGMarkerElement* wxSVGCanvas::GetMarkerElement(const wxSVGSVGElement& svgElem, const wxString& href) { + if (href.length() == 0 || href[0] != wxT('#') || &svgElem == NULL) + return NULL; + wxSVGElement* elem = (wxSVGElement*) svgElem.GetElementById(href.substr(1)); + return elem != NULL && elem->GetDtd() == wxSVG_MARKER_ELEMENT ? (wxSVGMarkerElement*) elem : NULL; +} + wxSVGGradientElement* wxSVGCanvas::GetGradientElement(const wxSVGSVGElement& svgElem, const wxString& href) { if (href.length() == 0 || href[0] != wxT('#') || &svgElem == NULL) return NULL; diff -Nru wxsvg-1.4~dfsg/src/SVGCanvasItem.cpp wxsvg-1.5.4/src/SVGCanvasItem.cpp --- wxsvg-1.4~dfsg/src/SVGCanvasItem.cpp 2014-03-03 17:08:26.000000000 +0000 +++ wxsvg-1.5.4/src/SVGCanvasItem.cpp 2014-08-09 11:59:41.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/05/09 -// RCS-ID: $Id: SVGCanvasItem.cpp,v 1.47 2014/03/03 17:08:26 ntalex Exp $ +// RCS-ID: $Id: SVGCanvasItem.cpp,v 1.50 2014/08/09 11:59:41 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -27,264 +27,256 @@ /////////////////////////////// wxSVGCanvasPath ////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -wxSVGCanvasPath::wxSVGCanvasPath(): wxSVGCanvasItem(wxSVG_CANVAS_ITEM_PATH) -{ - m_fill = true; - m_curx = m_cury = m_cubicx = m_cubicy = m_quadx = m_quady = 0; - m_begx = m_begy = 0; -} - -void wxSVGCanvasPath::Init(wxSVGLineElement& element) -{ - SetFill(false); - - MoveTo(element.GetX1().GetAnimVal(), element.GetY1().GetAnimVal()); - LineTo(element.GetX2().GetAnimVal(), element.GetY2().GetAnimVal()); - End(); -} - -void wxSVGCanvasPath::Init(wxSVGPolylineElement& element) -{ - SetFill(false); - - const wxSVGPointList& points = element.GetPoints(); - if (points.Count()) - MoveTo(points[0].GetX(), points[0].GetY()); - for (unsigned int i=1; i width/2) - rx = width/2; - if (ry > height/2) - ry = height/2; - MoveTo(x + rx, y); - CurveToCubic(x + rx*0.448, y, x, y + ry*0.448, x, y + ry); - if (ry < height/2) - LineTo(x, y + height - ry); - CurveToCubic(x, y + height - ry*0.448, x + rx*0.448, y + height, x + rx, y + height); - if(rx < width/2) - LineTo(x + width - rx, y + height); - CurveToCubic(x + width - rx*0.448, y + height, x + width, y + height - ry*0.448, x + width, y + height - ry); - if(ry < height/2) - LineTo(x + width, y + ry); - CurveToCubic(x + width, y + ry*0.448, x + width - rx*0.448, y, x + width - rx, y); - if(rx < width/2) - LineTo(x + rx, y); - ClosePath(); - } - End(); +void wxSVGCanvasPath::Init(wxSVGRectElement& element) { + m_element = &element; + double x = element.GetX().GetAnimVal(); + double y = element.GetY().GetAnimVal(); + double width = element.GetWidth().GetAnimVal(); + double height = element.GetHeight().GetAnimVal(); + double rx = element.GetRx().GetAnimVal(); + double ry = element.GetRy().GetAnimVal(); + + if (rx == 0 && ry == 0) { + MoveTo(x, y); + LineTo(width, 0, true); + LineTo(0, height, true); + LineTo(-width, 0, true); + ClosePath(); + } else { + if (rx == 0) + rx = ry; + if (ry == 0) + ry = rx; + if (rx > width / 2) + rx = width / 2; + if (ry > height / 2) + ry = height / 2; + MoveTo(x + rx, y); + CurveToCubic(x + rx * 0.448, y, x, y + ry * 0.448, x, y + ry); + if (ry < height / 2) + LineTo(x, y + height - ry); + CurveToCubic(x, y + height - ry * 0.448, x + rx * 0.448, y + height, + x + rx, y + height); + if (rx < width / 2) + LineTo(x + width - rx, y + height); + CurveToCubic(x + width - rx * 0.448, y + height, x + width, + y + height - ry * 0.448, x + width, y + height - ry); + if (ry < height / 2) + LineTo(x + width, y + ry); + CurveToCubic(x + width, y + ry * 0.448, x + width - rx * 0.448, y, + x + width - rx, y); + if (rx < width / 2) + LineTo(x + rx, y); + ClosePath(); + } + End(); } -void wxSVGCanvasPath::Init(wxSVGCircleElement& element) -{ - double cx = element.GetCx().GetAnimVal(); - double cy = element.GetCy().GetAnimVal(); - double r = element.GetR().GetAnimVal(); - double len = 0.55228474983079356; - double cos4[] = {1.0, 0.0, -1.0, 0.0, 1.0}; - double sin4[] = {0.0, 1.0, 0.0, -1.0, 0.0}; - - MoveTo(cx + r, cy); - - for (int i = 1; i<5; i++) - { - CurveToCubic( - cx + (cos4[i-1] + len*cos4[i])*r, - cy + (sin4[i-1] + len*sin4[i])*r, - cx + (cos4[i] + len*cos4[i-1])*r, - cy + (sin4[i] + len*sin4[i-1])*r, - cx + (cos4[i])*r, - cy + (sin4[i])*r); - } - End(); +void wxSVGCanvasPath::Init(wxSVGCircleElement& element) { + m_element = &element; + double cx = element.GetCx().GetAnimVal(); + double cy = element.GetCy().GetAnimVal(); + double r = element.GetR().GetAnimVal(); + double len = 0.55228474983079356; + double cos4[] = { 1.0, 0.0, -1.0, 0.0, 1.0 }; + double sin4[] = { 0.0, 1.0, 0.0, -1.0, 0.0 }; + + MoveTo(cx + r, cy); + + for (int i = 1; i < 5; i++) { + CurveToCubic(cx + (cos4[i - 1] + len * cos4[i]) * r, + cy + (sin4[i - 1] + len * sin4[i]) * r, + cx + (cos4[i] + len * cos4[i - 1]) * r, + cy + (sin4[i] + len * sin4[i - 1]) * r, cx + (cos4[i]) * r, + cy + (sin4[i]) * r); + } + End(); } -void wxSVGCanvasPath::Init(wxSVGEllipseElement& element) -{ - double cx = element.GetCx().GetAnimVal(); - double cy = element.GetCy().GetAnimVal(); - double rx = element.GetRx().GetAnimVal(); - double ry = element.GetRy().GetAnimVal(); - double len = 0.55228474983079356; - double cos4[] = {1.0, 0.0, -1.0, 0.0, 1.0}; - double sin4[] = {0.0, 1.0, 0.0, -1.0, 0.0}; - - MoveTo(cx + rx, cy); - - for (int i = 1; i<5; i++) - { - CurveToCubic( - cx + (cos4[i-1] + len*cos4[i])*rx, - cy + (sin4[i-1] + len*sin4[i])*ry, - cx + (cos4[i] + len*cos4[i-1])*rx, - cy + (sin4[i] + len*sin4[i-1])*ry, - cx + (cos4[i])*rx, - cy + (sin4[i])*ry); - } - End(); +void wxSVGCanvasPath::Init(wxSVGEllipseElement& element) { + m_element = &element; + double cx = element.GetCx().GetAnimVal(); + double cy = element.GetCy().GetAnimVal(); + double rx = element.GetRx().GetAnimVal(); + double ry = element.GetRy().GetAnimVal(); + double len = 0.55228474983079356; + double cos4[] = { 1.0, 0.0, -1.0, 0.0, 1.0 }; + double sin4[] = { 0.0, 1.0, 0.0, -1.0, 0.0 }; + + MoveTo(cx + rx, cy); + + for (int i = 1; i < 5; i++) { + CurveToCubic(cx + (cos4[i - 1] + len * cos4[i]) * rx, + cy + (sin4[i - 1] + len * sin4[i]) * ry, + cx + (cos4[i] + len * cos4[i - 1]) * rx, + cy + (sin4[i] + len * sin4[i - 1]) * ry, cx + (cos4[i]) * rx, + cy + (sin4[i]) * ry); + } + End(); } -void wxSVGCanvasPath::Init(wxSVGPathElement& element) -{ - const wxSVGPathSegList& segList = element.GetPathSegList(); - for (int i = 0; i < (int)segList.Count(); i++) - { - switch (segList[i].GetPathSegType()) - { - case wxPATHSEG_MOVETO_ABS: - { - wxSVGPathSegMovetoAbs& seg = (wxSVGPathSegMovetoAbs&)(segList[i]); - MoveTo(seg.GetX(), seg.GetY()); - break; - } - case wxPATHSEG_MOVETO_REL: - { - wxSVGPathSegMovetoRel& seg = (wxSVGPathSegMovetoRel&)(segList[i]); - MoveTo(seg.GetX(), seg.GetY(), true); - break; - } - case wxPATHSEG_LINETO_ABS: - { - wxSVGPathSegLinetoAbs& seg = (wxSVGPathSegLinetoAbs&)segList[i]; - LineTo(seg.GetX(), seg.GetY()); - break; - } - case wxPATHSEG_LINETO_REL: - { - wxSVGPathSegLinetoRel& seg = (wxSVGPathSegLinetoRel&)segList[i]; - LineTo(seg.GetX(), seg.GetY(), true); - break; - } - case wxPATHSEG_LINETO_HORIZONTAL_ABS: - { - wxSVGPathSegLinetoHorizontalAbs& seg = (wxSVGPathSegLinetoHorizontalAbs&)segList[i]; - LineToHorizontal(seg.GetX()); - break; - } - case wxPATHSEG_LINETO_HORIZONTAL_REL: - { - wxSVGPathSegLinetoHorizontalRel& seg = (wxSVGPathSegLinetoHorizontalRel&)segList[i]; - LineToHorizontal(seg.GetX(), true); - break; - } - case wxPATHSEG_LINETO_VERTICAL_ABS: - { - wxSVGPathSegLinetoVerticalAbs& seg = (wxSVGPathSegLinetoVerticalAbs&)segList[i]; - LineToVertical(seg.GetY()); - break; - } - case wxPATHSEG_LINETO_VERTICAL_REL: - { - wxSVGPathSegLinetoVerticalRel& seg = (wxSVGPathSegLinetoVerticalRel&)segList[i]; - LineToVertical(seg.GetY(), true); - break; - } - case wxPATHSEG_CURVETO_CUBIC_ABS: - { - wxSVGPathSegCurvetoCubicAbs& seg = (wxSVGPathSegCurvetoCubicAbs&)segList[i]; - CurveToCubic(seg.GetX1(), seg.GetY1(), seg.GetX2(), seg.GetY2(), seg.GetX(), seg.GetY()); - break; - } - case wxPATHSEG_CURVETO_CUBIC_REL: - { - wxSVGPathSegCurvetoCubicRel& seg = (wxSVGPathSegCurvetoCubicRel&)segList[i]; - CurveToCubic(seg.GetX1(), seg.GetY1(), seg.GetX2(), seg.GetY2(), seg.GetX(), seg.GetY(), true); - break; - } - case wxPATHSEG_CURVETO_CUBIC_SMOOTH_ABS: - { - wxSVGPathSegCurvetoCubicSmoothAbs& seg = (wxSVGPathSegCurvetoCubicSmoothAbs&)segList[i]; - CurveToCubicSmooth(seg.GetX2(), seg.GetY2(), seg.GetX(), seg.GetY()); - break; - } - case wxPATHSEG_CURVETO_CUBIC_SMOOTH_REL: - { - wxSVGPathSegCurvetoCubicSmoothRel& seg = (wxSVGPathSegCurvetoCubicSmoothRel&)segList[i]; - CurveToCubicSmooth(seg.GetX2(), seg.GetY2(), seg.GetX(), seg.GetY(), true); - break; - } - case wxPATHSEG_CURVETO_QUADRATIC_ABS: - { - wxSVGPathSegCurvetoQuadraticAbs& seg = (wxSVGPathSegCurvetoQuadraticAbs&)segList[i]; - CurveToQuadratic(seg.GetX1(), seg.GetY1(), seg.GetX(), seg.GetY()); - break; - } - case wxPATHSEG_CURVETO_QUADRATIC_REL: - { - wxSVGPathSegCurvetoQuadraticRel& seg = (wxSVGPathSegCurvetoQuadraticRel&)segList[i]; - CurveToQuadratic(seg.GetX1(), seg.GetY1(), seg.GetX(), seg.GetY(), true); - break; - } - case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: - { - wxSVGPathSegCurvetoQuadraticSmoothAbs& seg = (wxSVGPathSegCurvetoQuadraticSmoothAbs&)segList[i]; - CurveToQuadraticSmooth(seg.GetX(), seg.GetY()); - break; - } - case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: - { - wxSVGPathSegCurvetoQuadraticSmoothRel& seg = (wxSVGPathSegCurvetoQuadraticSmoothRel&)segList[i]; - CurveToQuadraticSmooth(seg.GetX(), seg.GetY(), true); - break; - } - case wxPATHSEG_ARC_ABS: - { - wxSVGPathSegArcAbs& seg = (wxSVGPathSegArcAbs&)segList[i]; - Arc(seg.GetX(), seg.GetY(), seg.GetR1(), seg.GetR2(), seg.GetAngle(), - seg.GetLargeArcFlag(), seg.GetSweepFlag()); - break; - } - case wxPATHSEG_ARC_REL: - { - wxSVGPathSegArcRel& seg = (wxSVGPathSegArcRel&)segList[i]; - Arc(seg.GetX(), seg.GetY(), seg.GetR1(), seg.GetR2(), seg.GetAngle(), - seg.GetLargeArcFlag(), seg.GetSweepFlag(), true); - break; - } - case wxPATHSEG_CLOSEPATH: - ClosePath(); - break; - case wxPATHSEG_UNKNOWN: - break; +void wxSVGCanvasPath::Init(wxSVGPathElement& element) { + m_element = &element; + const wxSVGPathSegList& segList = element.GetPathSegList(); + for (int i = 0; i < (int) segList.Count(); i++) { + switch (segList[i].GetPathSegType()) { + case wxPATHSEG_MOVETO_ABS: { + wxSVGPathSegMovetoAbs& seg = (wxSVGPathSegMovetoAbs&) (segList[i]); + MoveTo(seg.GetX(), seg.GetY()); + break; + } + case wxPATHSEG_MOVETO_REL: { + wxSVGPathSegMovetoRel& seg = (wxSVGPathSegMovetoRel&) (segList[i]); + MoveTo(seg.GetX(), seg.GetY(), true); + break; + } + case wxPATHSEG_LINETO_ABS: { + wxSVGPathSegLinetoAbs& seg = (wxSVGPathSegLinetoAbs&) segList[i]; + LineTo(seg.GetX(), seg.GetY()); + break; + } + case wxPATHSEG_LINETO_REL: { + wxSVGPathSegLinetoRel& seg = (wxSVGPathSegLinetoRel&) segList[i]; + LineTo(seg.GetX(), seg.GetY(), true); + break; + } + case wxPATHSEG_LINETO_HORIZONTAL_ABS: { + wxSVGPathSegLinetoHorizontalAbs& seg = + (wxSVGPathSegLinetoHorizontalAbs&) segList[i]; + LineToHorizontal(seg.GetX()); + break; + } + case wxPATHSEG_LINETO_HORIZONTAL_REL: { + wxSVGPathSegLinetoHorizontalRel& seg = + (wxSVGPathSegLinetoHorizontalRel&) segList[i]; + LineToHorizontal(seg.GetX(), true); + break; + } + case wxPATHSEG_LINETO_VERTICAL_ABS: { + wxSVGPathSegLinetoVerticalAbs& seg = + (wxSVGPathSegLinetoVerticalAbs&) segList[i]; + LineToVertical(seg.GetY()); + break; + } + case wxPATHSEG_LINETO_VERTICAL_REL: { + wxSVGPathSegLinetoVerticalRel& seg = + (wxSVGPathSegLinetoVerticalRel&) segList[i]; + LineToVertical(seg.GetY(), true); + break; + } + case wxPATHSEG_CURVETO_CUBIC_ABS: { + wxSVGPathSegCurvetoCubicAbs& seg = + (wxSVGPathSegCurvetoCubicAbs&) segList[i]; + CurveToCubic(seg.GetX1(), seg.GetY1(), seg.GetX2(), seg.GetY2(), + seg.GetX(), seg.GetY()); + break; + } + case wxPATHSEG_CURVETO_CUBIC_REL: { + wxSVGPathSegCurvetoCubicRel& seg = + (wxSVGPathSegCurvetoCubicRel&) segList[i]; + CurveToCubic(seg.GetX1(), seg.GetY1(), seg.GetX2(), seg.GetY2(), + seg.GetX(), seg.GetY(), true); + break; + } + case wxPATHSEG_CURVETO_CUBIC_SMOOTH_ABS: { + wxSVGPathSegCurvetoCubicSmoothAbs& seg = + (wxSVGPathSegCurvetoCubicSmoothAbs&) segList[i]; + CurveToCubicSmooth(seg.GetX2(), seg.GetY2(), seg.GetX(), + seg.GetY()); + break; + } + case wxPATHSEG_CURVETO_CUBIC_SMOOTH_REL: { + wxSVGPathSegCurvetoCubicSmoothRel& seg = + (wxSVGPathSegCurvetoCubicSmoothRel&) segList[i]; + CurveToCubicSmooth(seg.GetX2(), seg.GetY2(), seg.GetX(), seg.GetY(), + true); + break; + } + case wxPATHSEG_CURVETO_QUADRATIC_ABS: { + wxSVGPathSegCurvetoQuadraticAbs& seg = + (wxSVGPathSegCurvetoQuadraticAbs&) segList[i]; + CurveToQuadratic(seg.GetX1(), seg.GetY1(), seg.GetX(), seg.GetY()); + break; + } + case wxPATHSEG_CURVETO_QUADRATIC_REL: { + wxSVGPathSegCurvetoQuadraticRel& seg = + (wxSVGPathSegCurvetoQuadraticRel&) segList[i]; + CurveToQuadratic(seg.GetX1(), seg.GetY1(), seg.GetX(), seg.GetY(), + true); + break; + } + case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: { + wxSVGPathSegCurvetoQuadraticSmoothAbs& seg = + (wxSVGPathSegCurvetoQuadraticSmoothAbs&) segList[i]; + CurveToQuadraticSmooth(seg.GetX(), seg.GetY()); + break; + } + case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: { + wxSVGPathSegCurvetoQuadraticSmoothRel& seg = + (wxSVGPathSegCurvetoQuadraticSmoothRel&) segList[i]; + CurveToQuadraticSmooth(seg.GetX(), seg.GetY(), true); + break; + } + case wxPATHSEG_ARC_ABS: { + wxSVGPathSegArcAbs& seg = (wxSVGPathSegArcAbs&) segList[i]; + Arc(seg.GetX(), seg.GetY(), seg.GetR1(), seg.GetR2(), + seg.GetAngle(), seg.GetLargeArcFlag(), seg.GetSweepFlag()); + break; + } + case wxPATHSEG_ARC_REL: { + wxSVGPathSegArcRel& seg = (wxSVGPathSegArcRel&) segList[i]; + Arc(seg.GetX(), seg.GetY(), seg.GetR1(), seg.GetR2(), + seg.GetAngle(), seg.GetLargeArcFlag(), seg.GetSweepFlag(), + true); + break; + } + case wxPATHSEG_CLOSEPATH: + ClosePath(); + break; + case wxPATHSEG_UNKNOWN: + break; + } } - } - End(); + End(); } ////////////////////////////////////////////////////////////////////////////// @@ -523,6 +515,495 @@ return isClosed; } +double AngleOfVector(const wxSVGPoint& vec) { + return vec != wxSVGPoint(0.0, 0.0) ? atan2(vec.GetY(), vec.GetX()) : 0.0; +} + +bool IsMoveto(wxPATHSEG segType) { + return segType == wxPATHSEG_MOVETO_ABS || segType == wxPATHSEG_MOVETO_REL; +} + +bool IsCubicType(wxPATHSEG segType) { + return segType == wxPATHSEG_CURVETO_CUBIC_REL + || segType == wxPATHSEG_CURVETO_CUBIC_ABS + || segType == wxPATHSEG_CURVETO_CUBIC_SMOOTH_REL + || segType == wxPATHSEG_CURVETO_CUBIC_SMOOTH_ABS; +} + +bool IsQuadraticType(wxPATHSEG segType) { + return segType == wxPATHSEG_CURVETO_QUADRATIC_REL + || segType == wxPATHSEG_CURVETO_QUADRATIC_ABS + || segType == wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL + || segType == wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; +} + +double AngleBisect(float a1, float a2) { + double delta = fmod(a2 - a1, 2 * M_PI); + if (delta < 0) { + delta += 2 * M_PI; + } + /* delta is now the angle from a1 around to a2, in the range [0, 2*M_PI) */ + float r = a1 + delta / 2; + if (delta >= M_PI) { + /* the arc from a2 to a1 is smaller, so use the ray on that side */ + r += M_PI; + } + return r; +} + +void GetPolylineMarkPoints(const wxSVGPointList &points, vector& marks) { + if (!points.size()) + return; + + float px = points[0].GetX(), py = points[0].GetY(), prevAngle = 0.0; + + marks.push_back(wxSVGMark(px, py, 0, wxSVGMark::START)); + + for (unsigned int i = 1; i < points.size(); ++i) { + float x = points[i].GetX(); + float y = points[i].GetY(); + float angle = atan2(y-py, x-px); + + // Vertex marker. + if (i == 1) { + marks.begin()->angle = angle; + } else { + (marks.begin() + (marks.size() - 2))->angle = AngleBisect(prevAngle, angle); + } + + marks.push_back(wxSVGMark(x, y, 0, wxSVGMark::MID)); + + prevAngle = angle; + px = x; + py = y; + } + + marks.back().angle = prevAngle; + marks.back().type = wxSVGMark::END; +} + +void GetPathMarkPoints(const wxSVGPathSegList& segments, vector& marks) { + // This code should assume that ANY type of segment can appear at ANY index. + // It should also assume that segments such as M and Z can appear in weird + // places, and repeat multiple times consecutively. + + // info on current [sub]path (reset every M command): + wxSVGPoint pathStart(0.0, 0.0); + double pathStartAngle = 0.0f; + + // info on previous segment: + wxPATHSEG prevSegType = wxPATHSEG_UNKNOWN; + wxSVGPoint prevSegEnd(0.0, 0.0); + double prevSegEndAngle = 0.0f; + wxSVGPoint prevCP; // if prev seg was a bezier, this was its last control point + + unsigned int i = 0; + while (i < segments.size()) { + // info on current segment: + wxPATHSEG segType = segments[i].GetPathSegType(); + wxSVGPoint& segStart = prevSegEnd; + wxSVGPoint segEnd; + double segStartAngle = 0, segEndAngle = 0; + + switch (segType) { // to find segStartAngle, segEnd and segEndAngle + case wxPATHSEG_CLOSEPATH: + segEnd = pathStart; + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + + case wxPATHSEG_MOVETO_ABS: { + wxSVGPathSegMovetoAbs& seg = ((wxSVGPathSegMovetoAbs&) segments[i]); + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + pathStart = segEnd; + // If authors are going to specify multiple consecutive moveto commands + // with markers, me might as well make the angle do something useful: + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + case wxPATHSEG_MOVETO_REL: { + wxSVGPathSegMovetoRel& seg = ((wxSVGPathSegMovetoRel&) segments[i]); + segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + pathStart = segEnd; + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + case wxPATHSEG_LINETO_ABS: { + wxSVGPathSegLinetoAbs& seg = ((wxSVGPathSegLinetoAbs&) segments[i]); + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + case wxPATHSEG_LINETO_REL: { + wxSVGPathSegLinetoRel& seg = ((wxSVGPathSegLinetoRel&) segments[i]); + segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + case wxPATHSEG_CURVETO_CUBIC_ABS: { + wxSVGPathSegCurvetoCubicAbs& seg = ((wxSVGPathSegCurvetoCubicAbs&) segments[i]); + wxSVGPoint cp1 = wxSVGPoint(seg.GetX1(), seg.GetY1()); + wxSVGPoint cp2 = wxSVGPoint(seg.GetX2(), seg.GetY2()); + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp2; + if (cp1 == segStart) { + cp1 = cp2; + } + if (cp2 == segEnd) { + cp2 = cp1; + } + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp2); + break; + } + case wxPATHSEG_CURVETO_CUBIC_REL: { + wxSVGPathSegCurvetoCubicRel& seg = ((wxSVGPathSegCurvetoCubicRel&) segments[i]); + wxSVGPoint cp1 = segStart + wxSVGPoint(seg.GetX1(), seg.GetY1()); + wxSVGPoint cp2 = segStart + wxSVGPoint(seg.GetX2(), seg.GetY2()); + segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp2; + if (cp1 == segStart) { + cp1 = cp2; + } + if (cp2 == segEnd) { + cp2 = cp1; + } + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp2); + break; + } + + case wxPATHSEG_CURVETO_QUADRATIC_ABS: { + wxSVGPathSegCurvetoQuadraticAbs& seg = ((wxSVGPathSegCurvetoQuadraticAbs&) segments[i]); + wxSVGPoint cp1 = wxSVGPoint(seg.GetX1(), seg.GetY1()); + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp1; + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp1); + break; + } + case wxPATHSEG_CURVETO_QUADRATIC_REL: { + wxSVGPathSegCurvetoQuadraticRel& seg = ((wxSVGPathSegCurvetoQuadraticRel&) segments[i]); + wxSVGPoint cp1 = segStart + wxSVGPoint(seg.GetX1(), seg.GetY1()); + wxSVGPoint segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp1; + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp1); + break; + } + + case wxPATHSEG_ARC_ABS: { + wxSVGPathSegArcAbs& seg = ((wxSVGPathSegArcAbs&) segments[i]); + double rx = seg.GetR1(); + double ry = seg.GetR2(); + double angle = seg.GetAngle(); + bool largeArcFlag = seg.GetLargeArcFlag(); + bool sweepFlag = seg.GetSweepFlag(); + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + + if (segStart == segEnd) { + i++; + continue; + } + + if (rx == 0.0 || ry == 0.0) { + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + rx = fabs(rx); + ry = fabs(ry); + + angle = angle * M_PI / 180.0; + double x1p = cos(angle) * (segStart.GetX() - segEnd.GetX()) / 2.0 + + sin(angle) * (segStart.GetY() - segEnd.GetY()) / 2.0; + double y1p = -sin(angle) * (segStart.GetX() - segEnd.GetX()) / 2.0 + + cos(angle) * (segStart.GetY() - segEnd.GetY()) / 2.0; + + double root; + double numerator = rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p; + + if (numerator >= 0.0) { + root = sqrt(numerator / (rx * rx * y1p * y1p + ry * ry * x1p * x1p)); + if (largeArcFlag == sweepFlag) + root = -root; + } else { + double lamedh = 1.0 - numerator / (rx * rx * ry * ry); + double s = sqrt(lamedh); + rx *= s; + ry *= s; + root = 0.0; + } + + double cxp = root * rx * y1p / ry; + double cyp = -root * ry * x1p / rx; + + double theta, delta; + theta = AngleOfVector(wxSVGPoint((x1p - cxp) / rx, (y1p - cyp) / ry)); + delta = AngleOfVector(wxSVGPoint((-x1p - cxp) / rx, (-y1p - cyp) / ry)) - theta; + if (!sweepFlag && delta > 0) + delta -= 2.0 * M_PI; + else if (sweepFlag && delta < 0) + delta += 2.0 * M_PI; + + double tx1, ty1, tx2, ty2; + tx1 = -cos(angle) * rx * sin(theta) - sin(angle) * ry * cos(theta); + ty1 = -sin(angle) * rx * sin(theta) + cos(angle) * ry * cos(theta); + tx2 = -cos(angle) * rx * sin(theta + delta) - sin(angle) * ry * cos(theta + delta); + ty2 = -sin(angle) * rx * sin(theta + delta) + cos(angle) * ry * cos(theta + delta); + + if (delta < 0.0f) { + tx1 = -tx1; + ty1 = -ty1; + tx2 = -tx2; + ty2 = -ty2; + } + + segStartAngle = atan2(ty1, tx1); + segEndAngle = atan2(ty2, tx2); + break; + } + case wxPATHSEG_ARC_REL: { + wxSVGPathSegArcRel& seg = ((wxSVGPathSegArcRel&) segments[i]); + double rx = seg.GetR1(); + double ry = seg.GetR2(); + double angle = seg.GetAngle(); + bool largeArcFlag = seg.GetLargeArcFlag(); + bool sweepFlag = seg.GetSweepFlag(); + segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + + if (segStart == segEnd) { + i++; + continue; + } + + if (rx == 0.0 || ry == 0.0) { + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + rx = fabs(rx); + ry = fabs(ry); + + angle = angle * M_PI / 180.0; + double x1p = cos(angle) * (segStart.GetX() - segEnd.GetX()) / 2.0 + + sin(angle) * (segStart.GetY() - segEnd.GetY()) / 2.0; + double y1p = -sin(angle) * (segStart.GetX() - segEnd.GetX()) / 2.0 + + cos(angle) * (segStart.GetY() - segEnd.GetY()) / 2.0; + + double root; + double numerator = rx * rx * ry * ry - rx * rx * y1p * y1p - ry * ry * x1p * x1p; + + if (numerator >= 0.0) { + root = sqrt(numerator / (rx * rx * y1p * y1p + ry * ry * x1p * x1p)); + if (largeArcFlag == sweepFlag) + root = -root; + } else { + double lamedh = 1.0 - numerator / (rx * rx * ry * ry); + double s = sqrt(lamedh); + rx *= s; + ry *= s; + root = 0.0; + } + + double cxp = root * rx * y1p / ry; + double cyp = -root * ry * x1p / rx; + + double theta, delta; + theta = AngleOfVector(wxSVGPoint((x1p - cxp) / rx, (y1p - cyp) / ry)); + delta = AngleOfVector(wxSVGPoint((-x1p - cxp) / rx, (-y1p - cyp) / ry)) - theta; + if (!sweepFlag && delta > 0) + delta -= 2.0 * M_PI; + else if (sweepFlag && delta < 0) + delta += 2.0 * M_PI; + + double tx1, ty1, tx2, ty2; + tx1 = -cos(angle) * rx * sin(theta) - sin(angle) * ry * cos(theta); + ty1 = -sin(angle) * rx * sin(theta) + cos(angle) * ry * cos(theta); + tx2 = -cos(angle) * rx * sin(theta + delta) - sin(angle) * ry * cos(theta + delta); + ty2 = -sin(angle) * rx * sin(theta + delta) + cos(angle) * ry * cos(theta + delta); + + if (delta < 0.0f) { + tx1 = -tx1; + ty1 = -ty1; + tx2 = -tx2; + ty2 = -ty2; + } + + segStartAngle = atan2(ty1, tx1); + segEndAngle = atan2(ty2, tx2); + break; + } + + case wxPATHSEG_LINETO_HORIZONTAL_ABS: { + wxSVGPathSegLinetoHorizontalAbs& seg = ((wxSVGPathSegLinetoHorizontalAbs&) segments[i]); + segEnd = wxSVGPoint(seg.GetX(), segStart.GetY()); + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + case wxPATHSEG_LINETO_HORIZONTAL_REL: { + wxSVGPathSegLinetoHorizontalRel& seg = ((wxSVGPathSegLinetoHorizontalRel&) segments[i]); + segEnd = segStart + wxSVGPoint(seg.GetX(), 0.0f); + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + + case wxPATHSEG_LINETO_VERTICAL_ABS: { + wxSVGPathSegLinetoVerticalAbs& seg = ((wxSVGPathSegLinetoVerticalAbs&) segments[i]); + segEnd = wxSVGPoint(segStart.GetX(), seg.GetY()); + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + case wxPATHSEG_LINETO_VERTICAL_REL: { + wxSVGPathSegLinetoVerticalRel& seg = ((wxSVGPathSegLinetoVerticalRel&) segments[i]); + segEnd = segStart + wxSVGPoint(0.0f, seg.GetY()); + segStartAngle = segEndAngle = AngleOfVector(segEnd - segStart); + break; + } + + case wxPATHSEG_CURVETO_CUBIC_SMOOTH_ABS: { + wxSVGPathSegCurvetoCubicSmoothAbs& seg = ((wxSVGPathSegCurvetoCubicSmoothAbs&) segments[i]); + wxSVGPoint cp1 = IsCubicType(prevSegType) ? segStart * 2 - prevCP : segStart; + wxSVGPoint cp2 = wxSVGPoint(seg.GetX2(), seg.GetY2()); + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp2; + if (cp1 == segStart) { + cp1 = cp2; + } + if (cp2 == segEnd) { + cp2 = cp1; + } + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp2); + break; + } + case wxPATHSEG_CURVETO_CUBIC_SMOOTH_REL: { + wxSVGPathSegCurvetoCubicSmoothRel& seg = ((wxSVGPathSegCurvetoCubicSmoothRel&) segments[i]); + wxSVGPoint cp1 = IsCubicType(prevSegType) ? segStart * 2 - prevCP : segStart; + wxSVGPoint cp2 = segStart + wxSVGPoint(seg.GetX2(), seg.GetY2()); + segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp2; + if (cp1 == segStart) { + cp1 = cp2; + } + if (cp2 == segEnd) { + cp2 = cp1; + } + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp2); + break; + } + + case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: { + wxSVGPathSegCurvetoQuadraticAbs& seg = ((wxSVGPathSegCurvetoQuadraticAbs&) segments[i]); + wxSVGPoint cp1 = IsQuadraticType(prevSegType) ? segStart * 2 - prevCP : segStart; + segEnd = wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp1; + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp1); + break; + } + case wxPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: { + wxSVGPathSegCurvetoQuadraticRel& seg = ((wxSVGPathSegCurvetoQuadraticRel&) segments[i]); + wxSVGPoint cp1 = IsQuadraticType(prevSegType) ? segStart * 2 - prevCP : segStart; + segEnd = segStart + wxSVGPoint(seg.GetX(), seg.GetY()); + prevCP = cp1; + segStartAngle = AngleOfVector(cp1 - segStart); + segEndAngle = AngleOfVector(segEnd - cp1); + break; + } + + case wxPATHSEG_UNKNOWN: + default: + break; + } + i++; + + // Set the angle of the mark at the start of this segment: + if (marks.size()) { + wxSVGMark &mark = marks.back(); + if (!IsMoveto(segType) && IsMoveto(prevSegType)) { + // start of new subpath + pathStartAngle = mark.angle = segStartAngle; + } else if (IsMoveto(segType) && !IsMoveto(prevSegType)) { + // end of a subpath + if (prevSegType != wxPATHSEG_CLOSEPATH) + mark.angle = prevSegEndAngle; + } else { + if (!(segType == wxPATHSEG_CLOSEPATH && prevSegType == wxPATHSEG_CLOSEPATH)) + mark.angle = AngleBisect(prevSegEndAngle, segStartAngle); + } + } + + // Add the mark at the end of this segment, and set its position: + marks.push_back(wxSVGMark(segEnd.GetX(), segEnd.GetY(), 0.0f, wxSVGMark::MID)); + + if (segType == wxPATHSEG_CLOSEPATH && prevSegType != wxPATHSEG_CLOSEPATH) { + marks.back().angle = AngleBisect(segEndAngle, pathStartAngle); + } + + prevSegType = segType; + prevSegEnd = segEnd; + prevSegEndAngle = segEndAngle; + } + + if (marks.size()) { + if (prevSegType != wxPATHSEG_CLOSEPATH) { + marks.back().angle = prevSegEndAngle; + } + marks.back().type = wxSVGMark::END; + marks.begin()->type = wxSVGMark::START; + } +} + +/** Returns the marker points. + * Adopted from mozilla code. + */ +vector wxSVGCanvasPath::GetMarkPoints() { + vector marks; + if (m_element == NULL) + return marks; + switch (m_element->GetDtd()) { + case wxSVG_POLYLINE_ELEMENT: { + wxSVGPolylineElement* elem = ((wxSVGPolylineElement*) m_element); + GetPolylineMarkPoints(elem->GetPoints(), marks); + break; + } + case wxSVG_POLYGON_ELEMENT: { + wxSVGPolygonElement* elem = ((wxSVGPolygonElement*) m_element); + GetPolylineMarkPoints(elem->GetPoints(), marks); + if (marks.size() == 0 || marks.back().type != wxSVGMark::END) { + break; + } + + wxSVGMark& endMark = marks.back(); + wxSVGMark& startMark = *marks.begin(); + float angle = atan2(startMark.y - endMark.y, startMark.x - endMark.x); + + endMark.type = wxSVGMark::MID; + endMark.angle = AngleBisect(angle, endMark.angle); + startMark.angle = AngleBisect(angle, startMark.angle); + // for a polygon (as opposed to a polyline) there's an implicit extra point co-located with the start point + // that GetPolylineMarkPoints doesn't return + marks.push_back(wxSVGMark(startMark.x, startMark.y, startMark.angle, wxSVGMark::END)); + break; + } + case wxSVG_LINE_ELEMENT: { + wxSVGLineElement* elem = ((wxSVGLineElement*) m_element); + double angle = atan2(elem->GetY2().GetAnimVal() - elem->GetY1().GetAnimVal(), + elem->GetX2().GetAnimVal() - elem->GetX1().GetAnimVal()); + + marks.push_back(wxSVGMark(elem->GetX1().GetAnimVal(), elem->GetY1().GetAnimVal(), angle, wxSVGMark::START)); + marks.push_back(wxSVGMark(elem->GetX2().GetAnimVal(), elem->GetY2().GetAnimVal(), angle, wxSVGMark::END)); + break; + } + case wxSVG_PATH_ELEMENT: { + GetPathMarkPoints(((wxSVGPathElement*) m_element)->GetPathSegList(), marks); + break; + } + default: + break; + } + return marks; +} + ////////////////////////////////////////////////////////////////////////////// /////////////////////////////// wxSVGCanvasText ////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -582,11 +1063,21 @@ t[i] = wxT('\t'); text += t; } else { + if (elem->GetPreviousSibling() != NULL) { + wxChar ch = elem->GetContent().GetChar(0); + if (ch == wxT(' ') || ch == wxT('\t') || ch == wxT('\n') || ch == wxT('\r')) + text += wxT(' '); + } wxStringTokenizer tokenizer(elem->GetContent()); while (tokenizer.HasMoreTokens()) { text += tokenizer.GetNextToken(); - if (tokenizer.HasMoreTokens()) - text += wxT(" "); + if (tokenizer.HasMoreTokens()) { + text += wxT(' '); + } else if (elem->GetNext() != NULL) { + wxChar ch = elem->GetContent().Last(); + if (ch == wxT(' ') || ch == wxT('\t') || ch == wxT('\n') || ch == wxT('\r')) + text += wxT(' '); + } } } } else if (elem->GetType() == wxSVGXML_ELEMENT_NODE && elem->GetDtd() == wxSVG_TBREAK_ELEMENT) { diff -Nru wxsvg-1.4~dfsg/src/SVGFitToViewBox.cpp wxsvg-1.5.4/src/SVGFitToViewBox.cpp --- wxsvg-1.4~dfsg/src/SVGFitToViewBox.cpp 2006-01-08 12:26:03.000000000 +0000 +++ wxsvg-1.5.4/src/SVGFitToViewBox.cpp 2014-07-06 15:20:38.000000000 +0000 @@ -3,62 +3,58 @@ // Purpose: // Author: Alex Thuering // Created: 2006/01/07 -// RCS-ID: $Id: SVGFitToViewBox.cpp,v 1.1 2006/01/08 12:26:03 ntalex Exp $ +// RCS-ID: $Id: SVGFitToViewBox.cpp,v 1.2 2014/07/06 15:20:38 ntalex Exp $ // Copyright: (c) 2006 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// #include "SVGFitToViewBox.h" -void wxSVGFitToViewBox::UpdateMatrix(wxSVGMatrix& matrix, - const wxSVGLength& width, const wxSVGLength& height) -{ - // view box - wxSVGRect viewbox = GetViewBox().GetAnimVal(); - if (viewbox.GetWidth()<=0 || viewbox.GetHeight()<=0) // FIX IsEmpty - return; - wxSVG_PRESERVEASPECTRATIO align = - GetPreserveAspectRatio().GetAnimVal().GetAlign(); - if (align == wxSVG_PRESERVEASPECTRATIO_UNKNOWN) - align = wxSVG_PRESERVEASPECTRATIO_XMIDYMID; - if (align == wxSVG_PRESERVEASPECTRATIO_NONE) - { - matrix = matrix.ScaleNonUniform( - width/viewbox.GetWidth(), height/viewbox.GetHeight()); - } - else - { - double scale = 1; - scale = width/viewbox.GetWidth(); - if (scale>height/viewbox.GetHeight()) - scale = height/viewbox.GetHeight(); - - double x = 0; - if (align == wxSVG_PRESERVEASPECTRATIO_XMIDYMIN || - align == wxSVG_PRESERVEASPECTRATIO_XMIDYMID || - align == wxSVG_PRESERVEASPECTRATIO_XMIDYMAX) - x = (width - viewbox.GetWidth()*scale)/2; - else if (align == wxSVG_PRESERVEASPECTRATIO_XMAXYMIN || - align == wxSVG_PRESERVEASPECTRATIO_XMAXYMID || - align == wxSVG_PRESERVEASPECTRATIO_XMAXYMAX) - x = width - viewbox.GetWidth()*scale; - - double y = 0; - if (align == wxSVG_PRESERVEASPECTRATIO_XMINYMID || - align == wxSVG_PRESERVEASPECTRATIO_XMIDYMID || - align == wxSVG_PRESERVEASPECTRATIO_XMAXYMID) - y = (height - viewbox.GetHeight()*scale)/2; - else if (align == wxSVG_PRESERVEASPECTRATIO_XMINYMAX || - align == wxSVG_PRESERVEASPECTRATIO_XMIDYMAX || - align == wxSVG_PRESERVEASPECTRATIO_XMAXYMAX) - y = height - viewbox.GetHeight()*scale; - - if (x !=0 || y !=0) - matrix = matrix.Translate(x, y); - - matrix = matrix.Scale(scale); - if (viewbox.GetX() !=0 || viewbox.GetY() !=0) - matrix = matrix.Translate(-viewbox.GetX(), -viewbox.GetY()); - } +void wxSVGFitToViewBox::UpdateMatrix(wxSVGMatrix& matrix, const wxSVGLength& width, const wxSVGLength& height) { + // view box + wxSVGRect viewbox = GetViewBox().GetAnimVal(); + if (viewbox.GetWidth() <= 0 || viewbox.GetHeight() <= 0) + return; + + wxSVG_PRESERVEASPECTRATIO align = GetPreserveAspectRatio().GetAnimVal().GetAlign(); + if (align == wxSVG_PRESERVEASPECTRATIO_UNKNOWN) { + align = wxSVG_PRESERVEASPECTRATIO_XMIDYMID; + } + + if (align == wxSVG_PRESERVEASPECTRATIO_NONE) { + matrix = matrix.ScaleNonUniform(width / viewbox.GetWidth(), height / viewbox.GetHeight()); + } else { + double scale = 1; + scale = width / viewbox.GetWidth(); + if (scale > height / viewbox.GetHeight()) + scale = height / viewbox.GetHeight(); + + double x = 0; + if (align == wxSVG_PRESERVEASPECTRATIO_XMIDYMIN + || align == wxSVG_PRESERVEASPECTRATIO_XMIDYMID + || align == wxSVG_PRESERVEASPECTRATIO_XMIDYMAX) + x = (width - viewbox.GetWidth() * scale) / 2; + else if (align == wxSVG_PRESERVEASPECTRATIO_XMAXYMIN + || align == wxSVG_PRESERVEASPECTRATIO_XMAXYMID + || align == wxSVG_PRESERVEASPECTRATIO_XMAXYMAX) + x = width - viewbox.GetWidth() * scale; + + double y = 0; + if (align == wxSVG_PRESERVEASPECTRATIO_XMINYMID + || align == wxSVG_PRESERVEASPECTRATIO_XMIDYMID + || align == wxSVG_PRESERVEASPECTRATIO_XMAXYMID) + y = (height - viewbox.GetHeight() * scale) / 2; + else if (align == wxSVG_PRESERVEASPECTRATIO_XMINYMAX + || align == wxSVG_PRESERVEASPECTRATIO_XMIDYMAX + || align == wxSVG_PRESERVEASPECTRATIO_XMAXYMAX) + y = height - viewbox.GetHeight() * scale; + + if (x != 0 || y != 0) + matrix = matrix.Translate(x, y); + + matrix = matrix.Scale(scale); + } + if (viewbox.GetX() != 0 || viewbox.GetY() != 0) + matrix = matrix.Translate(-viewbox.GetX(), -viewbox.GetY()); } diff -Nru wxsvg-1.4~dfsg/src/SVGLocatable.cpp wxsvg-1.5.4/src/SVGLocatable.cpp --- wxsvg-1.4~dfsg/src/SVGLocatable.cpp 2014-03-24 21:16:35.000000000 +0000 +++ wxsvg-1.5.4/src/SVGLocatable.cpp 2014-08-09 11:13:02.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Implementation of wxSVGLocatable // Author: Alex Thuering // Created: 2005/05/10 -// RCS-ID: $Id: SVGLocatable.cpp,v 1.12 2014/03/24 21:16:35 ntalex Exp $ +// RCS-ID: $Id: SVGLocatable.cpp,v 1.13 2014/08/09 11:13:02 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -151,7 +151,7 @@ return matrix; } -wxSVGMatrix wxSVGLocatable::GetTransformToElement(const wxSVGElement& element) { +wxSVGMatrix wxSVGLocatable::GetTransformToElement(const wxSVGElement& element) const { wxSVGMatrix res; return res; } diff -Nru wxsvg-1.4~dfsg/src/SVGMatrix.cpp wxsvg-1.5.4/src/SVGMatrix.cpp --- wxsvg-1.4~dfsg/src/SVGMatrix.cpp 2013-10-19 10:54:44.000000000 +0000 +++ wxsvg-1.5.4/src/SVGMatrix.cpp 2014-08-09 11:13:02.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/05/05 -// RCS-ID: $Id: SVGMatrix.cpp,v 1.5 2013/10/19 10:54:44 ntalex Exp $ +// RCS-ID: $Id: SVGMatrix.cpp,v 1.6 2014/08/09 11:13:02 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -11,75 +11,63 @@ #include "SVGMatrix.h" #include -wxSVGMatrix wxSVGMatrix::Multiply(const wxSVGMatrix& secondMatrix) -{ - wxSVGMatrix res; - res.SetA(GetA()*secondMatrix.GetA() + GetC()*secondMatrix.GetB()); - res.SetB(GetB()*secondMatrix.GetA() + GetD()*secondMatrix.GetB()); - res.SetC(GetA()*secondMatrix.GetC() + GetC()*secondMatrix.GetD()); - res.SetD(GetB()*secondMatrix.GetC() + GetD()*secondMatrix.GetD()); - res.SetE(GetA()*secondMatrix.GetE() + GetC()*secondMatrix.GetF() + GetE()); - res.SetF(GetB()*secondMatrix.GetE() + GetD()*secondMatrix.GetF() + GetF()); - return res; +wxSVGMatrix wxSVGMatrix::Multiply(const wxSVGMatrix& secondMatrix) const { + wxSVGMatrix res; + res.SetA(GetA() * secondMatrix.GetA() + GetC() * secondMatrix.GetB()); + res.SetB(GetB() * secondMatrix.GetA() + GetD() * secondMatrix.GetB()); + res.SetC(GetA() * secondMatrix.GetC() + GetC() * secondMatrix.GetD()); + res.SetD(GetB() * secondMatrix.GetC() + GetD() * secondMatrix.GetD()); + res.SetE(GetA() * secondMatrix.GetE() + GetC() * secondMatrix.GetF() + GetE()); + res.SetF(GetB() * secondMatrix.GetE() + GetD() * secondMatrix.GetF() + GetF()); + return res; } -wxSVGMatrix wxSVGMatrix::Inverse() -{ - wxSVGMatrix res; - double d = 1.0/(GetA()*GetD() - GetB()*GetC()); - res.SetA(GetD()*d); - res.SetB(-GetB()*d); - res.SetC(-GetC()*d); - res.SetD(GetA()*d); - res.SetE(-GetE()*res.GetA() - GetF()*res.GetC()); - res.SetF(-GetE()*res.GetB() - GetF()*res.GetD()); - - return res; +wxSVGMatrix wxSVGMatrix::Inverse() const { + wxSVGMatrix res; + double d = 1.0 / (GetA() * GetD() - GetB() * GetC()); + res.SetA(GetD() * d); + res.SetB(-GetB() * d); + res.SetC(-GetC() * d); + res.SetD(GetA() * d); + res.SetE(-GetE() * res.GetA() - GetF() * res.GetC()); + res.SetF(-GetE() * res.GetB() - GetF() * res.GetD()); + return res; } -wxSVGMatrix wxSVGMatrix::Translate(double x, double y) -{ - return Multiply(wxSVGMatrix(1, 0, 0, 1, x, y)); +wxSVGMatrix wxSVGMatrix::Translate(double x, double y) const { + return Multiply(wxSVGMatrix(1, 0, 0, 1, x, y)); } -wxSVGMatrix wxSVGMatrix::Scale(double scaleFactor) -{ - return Multiply(wxSVGMatrix(scaleFactor, 0, 0, scaleFactor, 0, 0)); +wxSVGMatrix wxSVGMatrix::Scale(double scaleFactor) const { + return Multiply(wxSVGMatrix(scaleFactor, 0, 0, scaleFactor, 0, 0)); } -wxSVGMatrix wxSVGMatrix::ScaleNonUniform(double scaleFactorX, double scaleFactorY) -{ - return Multiply(wxSVGMatrix(scaleFactorX, 0, 0, scaleFactorY, 0, 0)); +wxSVGMatrix wxSVGMatrix::ScaleNonUniform(double scaleFactorX, double scaleFactorY) const { + return Multiply(wxSVGMatrix(scaleFactorX, 0, 0, scaleFactorY, 0, 0)); } -wxSVGMatrix wxSVGMatrix::Rotate(double angle) -{ - angle = angle*M_PI/180; - return Multiply(wxSVGMatrix(cos(angle), sin(angle), -sin(angle), cos(angle), 0, 0)); +wxSVGMatrix wxSVGMatrix::Rotate(double angle) const { + angle = angle * M_PI / 180; + return Multiply(wxSVGMatrix(cos(angle), sin(angle), -sin(angle), cos(angle), 0, 0)); } -wxSVGMatrix wxSVGMatrix::RotateFromVector(double x, double y) -{ - return Multiply(wxSVGMatrix(1, 0, 0, 1, 0, 0)); +wxSVGMatrix wxSVGMatrix::RotateFromVector(double x, double y) const { + return Multiply(wxSVGMatrix(1, 0, 0, 1, 0, 0)); } -wxSVGMatrix wxSVGMatrix::FlipX() -{ - return Multiply(wxSVGMatrix(-1, 0, 0, 1, 0, 0)); +wxSVGMatrix wxSVGMatrix::FlipX() const { + return Multiply(wxSVGMatrix(-1, 0, 0, 1, 0, 0)); } -wxSVGMatrix wxSVGMatrix::FlipY() -{ - return Multiply(wxSVGMatrix(1, 0, 0, -1, 0, 0)); +wxSVGMatrix wxSVGMatrix::FlipY() const { + return Multiply(wxSVGMatrix(1, 0, 0, -1, 0, 0)); } -wxSVGMatrix wxSVGMatrix::SkewX(double angle) -{ - return Multiply(wxSVGMatrix(1, 0, tan(angle*M_PI/180), 1, 0, 0)); +wxSVGMatrix wxSVGMatrix::SkewX(double angle) const { + return Multiply(wxSVGMatrix(1, 0, tan(angle * M_PI / 180), 1, 0, 0)); } -wxSVGMatrix wxSVGMatrix::SkewY(double angle) -{ - return Multiply(wxSVGMatrix(1, tan(angle*M_PI/180), 0, 1, 0, 0)); +wxSVGMatrix wxSVGMatrix::SkewY(double angle) const { + return Multiply(wxSVGMatrix(1, tan(angle * M_PI / 180), 0, 1, 0, 0)); } diff -Nru wxsvg-1.4~dfsg/src/SVGPathElement.cpp wxsvg-1.5.4/src/SVGPathElement.cpp --- wxsvg-1.4~dfsg/src/SVGPathElement.cpp 2014-03-24 21:16:35.000000000 +0000 +++ wxsvg-1.5.4/src/SVGPathElement.cpp 2014-08-09 11:13:02.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: Implementation of wxSVGPathElement // Author: Alex Thuering // Created: 2005/05/10 -// RCS-ID: $Id: SVGPathElement.cpp,v 1.6 2014/03/24 21:16:35 ntalex Exp $ +// RCS-ID: $Id: SVGPathElement.cpp,v 1.7 2014/08/09 11:13:02 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -52,115 +52,107 @@ return res; } -wxSVGPathSegClosePath wxSVGPathElement::CreateSVGPathSegClosePath() { +wxSVGPathSegClosePath wxSVGPathElement::CreateSVGPathSegClosePath() const { wxSVGPathSegClosePath res; return res; } -wxSVGPathSegMovetoAbs wxSVGPathElement::CreateSVGPathSegMovetoAbs(double x, - double y) { +wxSVGPathSegMovetoAbs wxSVGPathElement::CreateSVGPathSegMovetoAbs(double x, double y) const { wxSVGPathSegMovetoAbs res; return res; } -wxSVGPathSegMovetoRel wxSVGPathElement::CreateSVGPathSegMovetoRel(double x, - double y) { +wxSVGPathSegMovetoRel wxSVGPathElement::CreateSVGPathSegMovetoRel(double x, double y) const { wxSVGPathSegMovetoRel res; return res; } -wxSVGPathSegLinetoAbs wxSVGPathElement::CreateSVGPathSegLinetoAbs(double x, - double y) { +wxSVGPathSegLinetoAbs wxSVGPathElement::CreateSVGPathSegLinetoAbs(double x, double y) const { wxSVGPathSegLinetoAbs res; return res; } -wxSVGPathSegLinetoRel wxSVGPathElement::CreateSVGPathSegLinetoRel(double x, - double y) { +wxSVGPathSegLinetoRel wxSVGPathElement::CreateSVGPathSegLinetoRel(double x, double y) const { wxSVGPathSegLinetoRel res; return res; } wxSVGPathSegCurvetoCubicAbs wxSVGPathElement::CreateSVGPathSegCurvetoCubicAbs( - double x, double y, double x1, double y1, double x2, double y2) { + double x, double y, double x1, double y1, double x2, double y2) const { wxSVGPathSegCurvetoCubicAbs res; return res; } wxSVGPathSegCurvetoCubicRel wxSVGPathElement::CreateSVGPathSegCurvetoCubicRel( - double x, double y, double x1, double y1, double x2, double y2) { + double x, double y, double x1, double y1, double x2, double y2) const { wxSVGPathSegCurvetoCubicRel res; return res; } wxSVGPathSegCurvetoQuadraticAbs wxSVGPathElement::CreateSVGPathSegCurvetoQuadraticAbs( - double x, double y, double x1, double y1) { + double x, double y, double x1, double y1) const { wxSVGPathSegCurvetoQuadraticAbs res; return res; } wxSVGPathSegCurvetoQuadraticRel wxSVGPathElement::CreateSVGPathSegCurvetoQuadraticRel( - double x, double y, double x1, double y1) { + double x, double y, double x1, double y1) const { wxSVGPathSegCurvetoQuadraticRel res; return res; } wxSVGPathSegArcAbs wxSVGPathElement::CreateSVGPathSegArcAbs(double x, double y, - double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag) { + double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag) const { wxSVGPathSegArcAbs res; return res; } wxSVGPathSegArcRel wxSVGPathElement::CreateSVGPathSegArcRel(double x, double y, - double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag) { + double r1, double r2, double angle, bool largeArcFlag, bool sweepFlag) const { wxSVGPathSegArcRel res; return res; } -wxSVGPathSegLinetoHorizontalAbs wxSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs( - double x) { +wxSVGPathSegLinetoHorizontalAbs wxSVGPathElement::CreateSVGPathSegLinetoHorizontalAbs(double x) const { wxSVGPathSegLinetoHorizontalAbs res; return res; } -wxSVGPathSegLinetoHorizontalRel wxSVGPathElement::CreateSVGPathSegLinetoHorizontalRel( - double x) { +wxSVGPathSegLinetoHorizontalRel wxSVGPathElement::CreateSVGPathSegLinetoHorizontalRel(double x) const { wxSVGPathSegLinetoHorizontalRel res; return res; } -wxSVGPathSegLinetoVerticalAbs wxSVGPathElement::CreateSVGPathSegLinetoVerticalAbs( - double y) { +wxSVGPathSegLinetoVerticalAbs wxSVGPathElement::CreateSVGPathSegLinetoVerticalAbs(double y) const { wxSVGPathSegLinetoVerticalAbs res; return res; } -wxSVGPathSegLinetoVerticalRel wxSVGPathElement::CreateSVGPathSegLinetoVerticalRel( - double y) { +wxSVGPathSegLinetoVerticalRel wxSVGPathElement::CreateSVGPathSegLinetoVerticalRel(double y) const { wxSVGPathSegLinetoVerticalRel res; return res; } wxSVGPathSegCurvetoCubicSmoothAbs wxSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothAbs( - double x, double y, double x2, double y2) { + double x, double y, double x2, double y2) const { wxSVGPathSegCurvetoCubicSmoothAbs res; return res; } wxSVGPathSegCurvetoCubicSmoothRel wxSVGPathElement::CreateSVGPathSegCurvetoCubicSmoothRel( - double x, double y, double x2, double y2) { + double x, double y, double x2, double y2) const { wxSVGPathSegCurvetoCubicSmoothRel res; return res; } wxSVGPathSegCurvetoQuadraticSmoothAbs wxSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothAbs( - double x, double y) { + double x, double y) const { wxSVGPathSegCurvetoQuadraticSmoothAbs res; return res; } wxSVGPathSegCurvetoQuadraticSmoothRel wxSVGPathElement::CreateSVGPathSegCurvetoQuadraticSmoothRel( - double x, double y) { + double x, double y) const { wxSVGPathSegCurvetoQuadraticSmoothRel res; return res; } diff -Nru wxsvg-1.4~dfsg/src/SVGSVGElement.cpp wxsvg-1.5.4/src/SVGSVGElement.cpp --- wxsvg-1.4~dfsg/src/SVGSVGElement.cpp 2007-05-24 08:59:09.000000000 +0000 +++ wxsvg-1.5.4/src/SVGSVGElement.cpp 2014-08-09 11:13:02.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/05/10 -// RCS-ID: $Id: SVGSVGElement.cpp,v 1.11 2007/05/24 08:59:09 etisserant Exp $ +// RCS-ID: $Id: SVGSVGElement.cpp,v 1.12 2014/08/09 11:13:02 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -11,166 +11,135 @@ #include "SVGSVGElement.h" #include -unsigned long wxSVGSVGElement::SuspendRedraw(unsigned long max_wait_milliseconds) -{ - return 0; +unsigned long wxSVGSVGElement::SuspendRedraw(unsigned long max_wait_milliseconds) { + return 0; } -void wxSVGSVGElement::UnsuspendRedraw(unsigned long suspend_handle_id) -{ +void wxSVGSVGElement::UnsuspendRedraw(unsigned long suspend_handle_id) { } -void wxSVGSVGElement::UnsuspendRedrawAll() -{ +void wxSVGSVGElement::UnsuspendRedrawAll() { } -void wxSVGSVGElement::ForceRedraw() -{ +void wxSVGSVGElement::ForceRedraw() { } -void wxSVGSVGElement::PauseAnimations() -{ +void wxSVGSVGElement::PauseAnimations() { } -void wxSVGSVGElement::UnpauseAnimations() -{ +void wxSVGSVGElement::UnpauseAnimations() { } -bool wxSVGSVGElement::AnimationsPaused() -{ - return false; +bool wxSVGSVGElement::AnimationsPaused() { + return false; } -double wxSVGSVGElement::GetCurrentTime() -{ - return 0; +double wxSVGSVGElement::GetCurrentTime() { + return 0; } -void wxSVGSVGElement::SetCurrentTime(double seconds) -{ +void wxSVGSVGElement::SetCurrentTime(double seconds) { } -void RecurseIntersectionList(const wxSVGSVGElement& root, const wxSVGElement& element, const wxSVGRect& rect, wxNodeList& res) -{ - if (((wxSVGSVGElement*)&root)->CheckIntersection(element, rect)) - { - res.Add((wxSVGElement*)&element); - wxSVGElement* n = (wxSVGElement*)element.GetChildren(); - while (n && n->GetType() == wxSVGXML_ELEMENT_NODE) - { - RecurseIntersectionList(root, *n, rect, res); - n = (wxSVGElement*)n->GetNext(); - } - } +void RecurseIntersectionList(const wxSVGSVGElement& root, const wxSVGElement& element, + const wxSVGRect& rect, wxNodeList& res) { + if (((wxSVGSVGElement*) &root)->CheckIntersection(element, rect)) { + res.Add((wxSVGElement*) &element); + wxSVGElement* n = (wxSVGElement*) element.GetChildren(); + while (n && n->GetType() == wxSVGXML_ELEMENT_NODE) { + RecurseIntersectionList(root, *n, rect, res); + n = (wxSVGElement*) n->GetNext(); + } + } } -wxNodeList wxSVGSVGElement::GetIntersectionList(const wxSVGRect& rect, const wxSVGElement& referenceElement) -{ - wxNodeList res; - RecurseIntersectionList(*this, referenceElement, rect, res); - return res; +wxNodeList wxSVGSVGElement::GetIntersectionList(const wxSVGRect& rect, const wxSVGElement& referenceElement) { + wxNodeList res; + RecurseIntersectionList(*this, referenceElement, rect, res); + return res; } -wxNodeList wxSVGSVGElement::GetEnclosureList(const wxSVGRect& rect, const wxSVGElement& referenceElement) -{ - wxNodeList res; - return res; +wxNodeList wxSVGSVGElement::GetEnclosureList(const wxSVGRect& rect, const wxSVGElement& referenceElement) { + wxNodeList res; + return res; } -bool wxSVGSVGElement::CheckIntersection(const wxSVGElement& element, const wxSVGRect& rect) -{ - wxSVGRect elemBBox = GetElementResultBBox(&element, wxSVG_COORDINATES_VIEWPORT); - return elemBBox.GetX() + elemBBox.GetWidth() > rect.GetX() && - elemBBox.GetX() < rect.GetX() + rect.GetWidth() && - elemBBox.GetY() + elemBBox.GetHeight() > rect.GetY() && - elemBBox.GetY() < rect.GetY() + rect.GetHeight(); +bool wxSVGSVGElement::CheckIntersection(const wxSVGElement& element, const wxSVGRect& rect) { + wxSVGRect elemBBox = GetElementResultBBox(&element, wxSVG_COORDINATES_VIEWPORT); + return elemBBox.GetX() + elemBBox.GetWidth() > rect.GetX() + && elemBBox.GetX() < rect.GetX() + rect.GetWidth() + && elemBBox.GetY() + elemBBox.GetHeight() > rect.GetY() + && elemBBox.GetY() < rect.GetY() + rect.GetHeight(); } -bool wxSVGSVGElement::CheckEnclosure(const wxSVGElement& element, const wxSVGRect& rect) -{ - bool res = 0; - return res; +bool wxSVGSVGElement::CheckEnclosure(const wxSVGElement& element, const wxSVGRect& rect) { + bool res = 0; + return res; } -void wxSVGSVGElement::DeselectAll() -{ +void wxSVGSVGElement::DeselectAll() { } -wxSVGNumber wxSVGSVGElement::CreateSVGNumber() -{ - return wxSVGNumber(); +wxSVGNumber wxSVGSVGElement::CreateSVGNumber() const { + return wxSVGNumber(); } -wxSVGLength wxSVGSVGElement::CreateSVGLength() -{ - return wxSVGLength(); +wxSVGLength wxSVGSVGElement::CreateSVGLength() const { + return wxSVGLength(); } -wxSVGAngle wxSVGSVGElement::CreateSVGAngle() -{ - return wxSVGAngle(); +wxSVGAngle wxSVGSVGElement::CreateSVGAngle() const { + return wxSVGAngle(); } -wxSVGPoint wxSVGSVGElement::CreateSVGPoint() -{ - return wxSVGPoint(); +wxSVGPoint wxSVGSVGElement::CreateSVGPoint() const { + return wxSVGPoint(); } -wxSVGMatrix wxSVGSVGElement::CreateSVGMatrix() -{ - return wxSVGMatrix(); +wxSVGMatrix wxSVGSVGElement::CreateSVGMatrix() const { + return wxSVGMatrix(); } -wxSVGRect wxSVGSVGElement::CreateSVGRect() -{ - return wxSVGRect(); +wxSVGRect wxSVGSVGElement::CreateSVGRect() const { + return wxSVGRect(); } -wxSVGTransform wxSVGSVGElement::CreateSVGTransform() -{ - return wxSVGTransform(); +wxSVGTransform wxSVGSVGElement::CreateSVGTransform() const { + return wxSVGTransform(); } -wxSVGTransform wxSVGSVGElement::CreateSVGTransformFromMatrix(const wxSVGMatrix& matrix) -{ - return wxSVGTransform(matrix); +wxSVGTransform wxSVGSVGElement::CreateSVGTransformFromMatrix(const wxSVGMatrix& matrix) const { + return wxSVGTransform(matrix); } -wxSVGElement* RecurseElementId(wxSVGElement* root, const wxString& elementId) -{ - if (root->GetId() == elementId) - return root; - // check childs - wxSVGElement* child = (wxSVGElement*)root->GetChildren(); - while (child) - { - if (child->GetType() == wxSVGXML_ELEMENT_NODE) - { - if (child->GetDtd() == wxSVG_SVG_ELEMENT) - { - if (child->GetId() == elementId) - return child; - } - else - { - wxSVGElement* res = RecurseElementId(child, elementId); - if (res) - return res; - } - } - child = (wxSVGElement*)child->GetNext(); - } - return NULL; +wxSVGElement* RecurseElementId(wxSVGElement* root, const wxString& elementId) { + if (root->GetId() == elementId) + return root; + // check childs + wxSVGElement* child = (wxSVGElement*) root->GetChildren(); + while (child) { + if (child->GetType() == wxSVGXML_ELEMENT_NODE) { + if (child->GetDtd() == wxSVG_SVG_ELEMENT) { + if (child->GetId() == elementId) + return child; + } else { + wxSVGElement* res = RecurseElementId(child, elementId); + if (res) + return res; + } + } + child = (wxSVGElement*) child->GetNext(); + } + return NULL; } -wxSvgXmlElement* wxSVGSVGElement::GetElementById(const wxString& elementId) const -{ - return RecurseElementId((wxSVGElement*)this,elementId); +wxSvgXmlElement* wxSVGSVGElement::GetElementById(const wxString& elementId) const { + return RecurseElementId((wxSVGElement*) this, elementId); } diff -Nru wxsvg-1.4~dfsg/src/SVGTransform.cpp wxsvg-1.5.4/src/SVGTransform.cpp --- wxsvg-1.4~dfsg/src/SVGTransform.cpp 2013-10-19 10:54:45.000000000 +0000 +++ wxsvg-1.5.4/src/SVGTransform.cpp 2015-03-21 18:20:28.000000000 +0000 @@ -3,7 +3,7 @@ // Purpose: // Author: Alex Thuering // Created: 2005/04/29 -// RCS-ID: $Id: SVGTransform.cpp,v 1.7 2013/10/19 10:54:45 ntalex Exp $ +// RCS-ID: $Id: SVGTransform.cpp,v 1.8 2015/03/21 18:20:28 ntalex Exp $ // Copyright: (c) 2005 Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// @@ -12,78 +12,68 @@ #include #include -void wxSVGTransform::SetTranslate(double tx, double ty) -{ - m_type = wxSVG_TRANSFORM_TRANSLATE; - m_angle = 0; - m_matrix = wxSVGMatrix(1, 0, 0, 1, tx, ty); -} - -void wxSVGTransform::SetScale(double sx, double sy) -{ - m_type = wxSVG_TRANSFORM_SCALE; - m_angle = 0; - m_matrix = wxSVGMatrix(sx, 0, 0, sy, 0, 0); -} - -void wxSVGTransform::SetRotate(double angle, double cx, double cy) -{ - m_type = wxSVG_TRANSFORM_ROTATE; - m_angle = angle; - m_cx = cx; - m_cy = cy; - if (cx == 0 && cy == 0) - { - angle = angle*M_PI/180; - m_matrix = wxSVGMatrix(cos(angle), sin(angle), -sin(angle), cos(angle), 0, 0); - } - else - { - angle = angle*M_PI/180; - m_matrix = wxSVGMatrix(cos(angle), sin(angle), -sin(angle), cos(angle), cx, cy); - m_matrix = m_matrix.Translate(-cx, -cy); - } -} - -void wxSVGTransform::SetSkewX(double angle) -{ - m_type = wxSVG_TRANSFORM_SKEWX; - m_angle = angle; - m_matrix = wxSVGMatrix(1, 0, tan(angle*M_PI/180), 1, 0, 0); -} - -void wxSVGTransform::SetSkewY(double angle) -{ - m_type = wxSVG_TRANSFORM_SKEWY; - m_angle = angle; - m_matrix = wxSVGMatrix(1, tan(angle*M_PI/180), 0, 1, 0, 0); -} - -wxString wxSVGTransform::GetValueAsString() const -{ - wxString value; - switch (m_type) - { - case wxSVG_TRANSFORM_UNKNOWN: - break; - case wxSVG_TRANSFORM_MATRIX: - value = wxString::Format(wxT("matrix(%g,%g,%g,%g,%g,%g)"), - m_matrix.GetA(), m_matrix.GetB(), m_matrix.GetC(), - m_matrix.GetD(), m_matrix.GetE(), m_matrix.GetF()); - break; - case wxSVG_TRANSFORM_TRANSLATE: - value = wxString::Format(wxT("translate(%g,%g)"), m_matrix.GetE(), m_matrix.GetF()); - break; - case wxSVG_TRANSFORM_SCALE: - if (m_matrix.GetA() == m_matrix.GetD()) - value = wxString::Format(wxT("scale(%g)"), m_matrix.GetA()); - else - value = wxString::Format(wxT("scale(%g,%g)"), m_matrix.GetA(), m_matrix.GetD()); - break; - case wxSVG_TRANSFORM_ROTATE: - if (m_cx == 0 && m_cy == 0) - value = wxString::Format(wxT("rotate(%g)"), m_angle); - else +void wxSVGTransform::SetTranslate(double tx, double ty) { + m_type = wxSVG_TRANSFORM_TRANSLATE; + m_angle = 0; + m_matrix = wxSVGMatrix(1, 0, 0, 1, tx, ty); +} + +void wxSVGTransform::SetScale(double sx, double sy) { + m_type = wxSVG_TRANSFORM_SCALE; + m_angle = 0; + m_matrix = wxSVGMatrix(sx, 0, 0, sy, 0, 0); +} + +void wxSVGTransform::SetRotate(double angle, double cx, double cy) { + m_type = wxSVG_TRANSFORM_ROTATE; + m_angle = angle; + m_cx = cx; + m_cy = cy; + if (cx == 0 && cy == 0) { + angle = angle * M_PI / 180; + m_matrix = wxSVGMatrix(cos(angle), sin(angle), -sin(angle), cos(angle), 0, 0); + } else { + angle = angle * M_PI / 180; + m_matrix = wxSVGMatrix(cos(angle), sin(angle), -sin(angle), cos(angle), cx, cy); + m_matrix = m_matrix.Translate(-cx, -cy); + } +} + +void wxSVGTransform::SetSkewX(double angle) { + m_type = wxSVG_TRANSFORM_SKEWX; + m_angle = angle; + m_matrix = wxSVGMatrix(1, 0, tan(angle * M_PI / 180), 1, 0, 0); +} + +void wxSVGTransform::SetSkewY(double angle) { + m_type = wxSVG_TRANSFORM_SKEWY; + m_angle = angle; + m_matrix = wxSVGMatrix(1, tan(angle * M_PI / 180), 0, 1, 0, 0); +} + +wxString wxSVGTransform::GetValueAsString() const { + wxString value; + switch (m_type) { + case wxSVG_TRANSFORM_UNKNOWN: + break; + case wxSVG_TRANSFORM_MATRIX: + value = wxString::Format(wxT("matrix(%g,%g,%g,%g,%g,%g)"), + m_matrix.GetA(), m_matrix.GetB(), m_matrix.GetC(), + m_matrix.GetD(), m_matrix.GetE(), m_matrix.GetF()); + break; + case wxSVG_TRANSFORM_TRANSLATE: + value = wxString::Format(wxT("translate(%g,%g)"), m_matrix.GetE(), m_matrix.GetF()); + break; + case wxSVG_TRANSFORM_SCALE: + if (m_matrix.GetA() == m_matrix.GetD()) + value = wxString::Format(wxT("scale(%g)"), m_matrix.GetA()); + else + value = wxString::Format(wxT("scale(%g,%g)"), m_matrix.GetA(), m_matrix.GetD()); + break; + case wxSVG_TRANSFORM_ROTATE: + if (m_cx == 0 && m_cy == 0) + value = wxString::Format(wxT("rotate(%g)"), m_angle); + else // double a = m_angle*M_PI/180; // double cosa = cos(a); // double sina = sin(a); @@ -91,42 +81,41 @@ // double f = m_matrix.GetF(); // double cx = cosa != 1 ? (e*(1-cosa) - f*sina)/(1-cosa)/2 : 0; // double cy = cosa != 1 ? e*sina/(1-cosa)/2 + f/2 : 0; - value = wxString::Format(wxT("rotate(%g,%g,%g)"), m_angle, m_cx, m_cy); - break; - case wxSVG_TRANSFORM_SKEWX: - value = wxString::Format(wxT("skewX(%g)"), m_angle); - break; - case wxSVG_TRANSFORM_SKEWY: - value = wxString::Format(wxT("skewY(%g)"), m_angle); - break; - } - return value; -} - -void wxSVGTransform::SetValueAsString(const wxString& value) -{ - if (value.length() == 0) - return; - double params[6] = { 0, 0, 0, 0, 0, 0 }; - wxStringTokenizer tkz(value.AfterFirst(wxT('(')).BeforeLast(wxT(')')), wxT(",")); - int pi = 0; - while (tkz.HasMoreTokens()) - { - tkz.GetNextToken().ToDouble(¶ms[pi]); - pi++; - } - if (pi == 0) - return; - if (value.substr(0,9) == wxT("translate")) - SetTranslate(params[0],params[1]); - else if (value.substr(0,5) == wxT("scale")) - SetScale(params[0], pi == 1 ? params[0] : params[1]); - else if (value.substr(0,6) == wxT("rotate")) - SetRotate(params[0], params[1], params[2]); - else if (value.substr(0,5) == wxT("skewX")) - SetSkewX(params[0]); - else if (value.substr(0,5) == wxT("skewY")) - SetSkewY(params[0]); - else if (value.substr(0,6) == wxT("matrix")) - SetMatrix(wxSVGMatrix(params[0], params[1], params[2], params[3], params[4], params[5])); + value = wxString::Format(wxT("rotate(%g,%g,%g)"), m_angle, m_cx, m_cy); + break; + case wxSVG_TRANSFORM_SKEWX: + value = wxString::Format(wxT("skewX(%g)"), m_angle); + break; + case wxSVG_TRANSFORM_SKEWY: + value = wxString::Format(wxT("skewY(%g)"), m_angle); + break; + } + return value; +} + +void wxSVGTransform::SetValueAsString(const wxString& value) { + if (value.length() == 0) + return; + double params[6] = { 0, 0, 0, 0, 0, 0 }; + wxStringTokenizer tkz(value.AfterFirst(wxT('(')).BeforeLast(wxT(')')), + wxT(",")); + int pi = 0; + while (tkz.HasMoreTokens() && pi < 6) { + tkz.GetNextToken().ToDouble(¶ms[pi]); + pi++; + } + if (pi == 0) + return; + if (value.substr(0, 9) == wxT("translate")) + SetTranslate(params[0], params[1]); + else if (value.substr(0, 5) == wxT("scale")) + SetScale(params[0], pi == 1 ? params[0] : params[1]); + else if (value.substr(0, 6) == wxT("rotate")) + SetRotate(params[0], params[1], params[2]); + else if (value.substr(0, 5) == wxT("skewX")) + SetSkewX(params[0]); + else if (value.substr(0, 5) == wxT("skewY")) + SetSkewY(params[0]); + else if (value.substr(0, 6) == wxT("matrix")) + SetMatrix(wxSVGMatrix(params[0], params[1], params[2], params[3], params[4], params[5])); } diff -Nru wxsvg-1.4~dfsg/src/svgxml/.cvsignore wxsvg-1.5.4/src/svgxml/.cvsignore --- wxsvg-1.4~dfsg/src/svgxml/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/src/svgxml/.cvsignore 2007-05-24 08:59:09.000000000 +0000 @@ -0,0 +1,6 @@ +Makefile +Makefile.in +.deps +.libs +*.l* + diff -Nru wxsvg-1.4~dfsg/svgview/.cvsignore wxsvg-1.5.4/svgview/.cvsignore --- wxsvg-1.4~dfsg/svgview/.cvsignore 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/svgview/.cvsignore 2015-03-21 18:22:43.000000000 +0000 @@ -0,0 +1,12 @@ +Makefile +Makefile.in +.deps +.libs +*.l* +svgview +*.exe +svg +*.svg +*.jpg +*.dll +*.res diff -Nru wxsvg-1.4~dfsg/svgview/svgview.cpp wxsvg-1.5.4/svgview/svgview.cpp --- wxsvg-1.4~dfsg/svgview/svgview.cpp 2012-04-01 20:37:00.000000000 +0000 +++ wxsvg-1.5.4/svgview/svgview.cpp 2015-03-21 19:27:52.000000000 +0000 @@ -3,36 +3,32 @@ // Purpose: // Author: Alex Thuering // Created: 15/01/2005 -// RCS-ID: $Id: svgview.cpp,v 1.14 2012/04/01 20:37:00 ntalex Exp $ +// RCS-ID: $Id: svgview.cpp,v 1.16 2015/03/21 19:27:52 ntalex Exp $ // Copyright: (c) Alex Thuering // Licence: wxWindows licence ////////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma implementation -#pragma interface -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -#ifndef __WXWINCE__ -#include -#endif - #include "svgview.h" +#include "wx/wx.h" +#include #include #ifdef USE_LIBAV #include #endif +#include "wxsvg.png.h" + +#define wxICON_FROM_MEMORY(name) wxGetIconFromMemory(name##_png, sizeof(name##_png)) + +inline wxBitmap wxGetBitmapFromMemory(const unsigned char *data, int length) { + wxMemoryInputStream is(data, length); + return wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1); +} + +inline wxIcon wxGetIconFromMemory(const unsigned char *data, int length) { + wxIcon icon; + icon.CopyFromBitmap(wxGetBitmapFromMemory(data, length)); + return icon; +} ////////////////////////////////////////////////////////////////////////////// /////////////////////////////// Application ///////////////////////////////// @@ -40,8 +36,8 @@ IMPLEMENT_APP(SVGViewApp) -bool SVGViewApp::OnInit() -{ +bool SVGViewApp::OnInit() { + wxGetApp(); #ifndef __WXWINCE__ setlocale(LC_NUMERIC, "C"); #endif @@ -51,8 +47,9 @@ wxFfmpegMediaDecoder::Init(); #endif - new MainFrame(NULL, wxT("SVG Viewer"), - wxDefaultPosition, wxSize(500, 400)); + MainFrame* mainFrame = new MainFrame(NULL, wxT("SVG Viewer"), wxDefaultPosition, wxSize(500, 400)); + SetTopWindow(mainFrame); + return true; } @@ -94,6 +91,12 @@ menuBar->Append(fileMenu, _T("&File")); SetMenuBar(menuBar); +#ifndef __WXMSW__ + SetIcon(wxICON_FROM_MEMORY(wxsvg)); +#else + SetIcon(wxICON(wxsvg)); +#endif + m_svgCtrl = new MySVGCanvas(this); if (wxTheApp->argc > 1) m_svgCtrl->Load(wxTheApp->argv[1]); diff -Nru wxsvg-1.4~dfsg/svgview/svgview.rc wxsvg-1.5.4/svgview/svgview.rc --- wxsvg-1.4~dfsg/svgview/svgview.rc 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/svgview/svgview.rc 2015-03-21 18:22:31.000000000 +0000 @@ -0,0 +1,3 @@ +#include + +svgview ICON "svgview/wxsvg.ico" Binary files /tmp/yBJZ9dd2uD/wxsvg-1.4~dfsg/svgview/wxsvg.ico and /tmp/BbCiT7txs3/wxsvg-1.5.4/svgview/wxsvg.ico differ Binary files /tmp/yBJZ9dd2uD/wxsvg-1.4~dfsg/svgview/wxsvg.png and /tmp/BbCiT7txs3/wxsvg-1.5.4/svgview/wxsvg.png differ diff -Nru wxsvg-1.4~dfsg/svgview/wxsvg.png.h wxsvg-1.5.4/svgview/wxsvg.png.h --- wxsvg-1.4~dfsg/svgview/wxsvg.png.h 1970-01-01 00:00:00.000000000 +0000 +++ wxsvg-1.5.4/svgview/wxsvg.png.h 2015-03-21 18:22:31.000000000 +0000 @@ -0,0 +1,154 @@ +/* wxsvg.png - 2402 bytes */ +static const unsigned char wxsvg_png[] = { +0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, +0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x30,0x08,0x02,0x00,0x00,0x00,0xd8,0x60,0x6e, +0xd0,0x00,0x00,0x00,0x06,0x74,0x52,0x4e,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x6e, +0xa6,0x07,0x91,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0d,0xd7,0x00, +0x00,0x0d,0xd7,0x01,0x42,0x28,0x9b,0x78,0x00,0x00,0x09,0x02,0x49,0x44,0x41,0x54, +0x78,0x9c,0xed,0x58,0xed,0x6f,0x5b,0xd5,0x1d,0x7e,0xce,0xf5,0xbd,0x7e,0x8b,0x1d, +0xc7,0x89,0x53,0xc7,0x79,0x6b,0xd2,0x10,0x68,0x1c,0x37,0xa8,0xad,0x28,0x95,0x68, +0x19,0xa5,0x9d,0xe8,0x06,0x64,0x84,0xb1,0x89,0x69,0x12,0x15,0x93,0xf8,0xca,0xd4, +0x6f,0xfb,0x34,0xed,0x0f,0xe0,0x2b,0x12,0x1a,0x08,0xa9,0xe3,0xc3,0x10,0x1a,0x12, +0x68,0x03,0xb5,0xa5,0x5b,0x17,0x34,0xda,0x88,0x36,0x0d,0x6b,0x93,0xbe,0x40,0x68, +0x5e,0x6a,0x2f,0x76,0x5e,0xec,0xc4,0xbe,0xb6,0xcf,0x3d,0x2f,0xf7,0xec,0xc3,0xb5, +0x1d,0x37,0x69,0x51,0x60,0xf0,0x69,0xf9,0xe9,0xe8,0xe8,0x77,0x8f,0x8e,0x7c,0x9e, +0xfb,0xfc,0x5e,0x9e,0x73,0x0d,0x6c,0xdb,0xb6,0x6d,0xdb,0xff,0x99,0x91,0xad,0x6f, +0x75,0xb9,0xf4,0x78,0xfc,0xc7,0xf1,0xf8,0x53,0x3e,0x5f,0xab,0x52,0x9a,0x6d,0x63, +0xf3,0x50,0xaa,0xe2,0x48,0xc9,0x32,0x99,0x89,0xaf,0xbe,0xfa,0x4b,0xa1,0x90,0xfc, +0x41,0x00,0xb9,0x5c,0xc6,0xd1,0xa3,0xaf,0x26,0x12,0xcf,0xf6,0xf6,0xb6,0x46,0x22, +0x8d,0x80,0x4b,0x4a,0x08,0x01,0x21,0xe0,0x38,0x52,0xa2,0xb6,0x22,0x84,0x2a,0x16, +0xd9,0xdc,0x5c,0x66,0x69,0x69,0x7e,0x7c,0xfc,0xf7,0xb9,0xdc,0xcd,0xad,0x03,0xd2, +0xb7,0xb8,0xef,0xa1,0x87,0x9e,0x8c,0xc7,0x9f,0x7d,0xea,0xa9,0xa1,0xce,0xce,0xb0, +0x94,0x28,0x97,0xc1,0x39,0x84,0xa8,0xcc,0x8e,0x53,0xbf,0xc2,0x39,0xa2,0xd1,0xae, +0xf1,0x71,0x7f,0x3c,0xfe,0xbb,0x0b,0x17,0x7e,0xa3,0x94,0xbd,0xc5,0x83,0xb4,0x2d, +0xee,0xdb,0xbd,0xfb,0x27,0x5d,0x5d,0x3b,0x62,0xb1,0x70,0x63,0x23,0x0c,0x03,0x52, +0x82,0x52,0x94,0xcb,0x95,0xd9,0x19,0xf5,0x2b,0x94,0x82,0x73,0x57,0x77,0x77,0xaf, +0xc7,0xd3,0x1b,0x0a,0xc5,0xb7,0x78,0x0a,0xb6,0xce,0x90,0xc7,0xd3,0x1a,0x0a,0x05, +0x01,0x28,0x05,0xce,0x2b,0xa7,0x6e,0xa0,0x64,0x03,0x55,0x42,0x40,0x29,0x2f,0x21, +0x86,0x61,0xb4,0x01,0x93,0xdf,0x33,0x20,0x21,0x08,0xe7,0xc4,0xb2,0x20,0x04,0x18, +0xc3,0x67,0x9f,0x7d,0x35,0x39,0xf9,0x1f,0x29,0x95,0xc7,0xe3,0x3d,0x70,0xe0,0x61, +0x8f,0xc7,0x37,0x35,0x75,0xfb,0xeb,0xaf,0x93,0x42,0xd8,0x2e,0x97,0x3b,0x91,0x18, +0xf2,0x7a,0x03,0x9c,0xc3,0xb2,0x20,0x04,0x51,0xea,0x5b,0x94,0xce,0x56,0x01,0x49, +0x09,0xc6,0x50,0x03,0xf4,0xe1,0x87,0x17,0xaf,0x5c,0x99,0xb5,0x6d,0xe5,0xf5,0x7a, +0x22,0x91,0x58,0x4f,0xcf,0xce,0xb3,0x67,0x2f,0x4e,0x4f,0xcf,0x48,0x29,0x75,0xdd, +0xf0,0x78,0xc2,0xfd,0xfd,0x03,0x0e,0x91,0x9c,0x43,0xa9,0xad,0xe3,0xd9,0x72,0x0e, +0x09,0x01,0xcb,0x02,0x63,0x15,0x64,0xaf,0xbc,0xf2,0x42,0x3c,0xde,0x07,0xe0,0xc4, +0x89,0x5f,0xb4,0xb7,0x77,0x53,0x8a,0x91,0x91,0x91,0x81,0x81,0x38,0x80,0xe1,0xe1, +0x17,0xdb,0xda,0x1e,0x5a,0x5d,0x45,0xa1,0x50,0x01,0x64,0x6f,0x35,0xa1,0xbf,0x25, +0x20,0x4a,0x61,0x59,0xe0,0x1c,0x8c,0xc1,0x30,0xfc,0x87,0x0e,0x1d,0x24,0x84,0x4c, +0x4d,0x7d,0x4d,0x29,0x29,0x95,0x40,0x29,0x99,0x9b,0x9b,0xdd,0xb1,0xa3,0x57,0xa9, +0x5d,0xa9,0x94,0x96,0x4a,0xe1,0xce,0x1d,0xcc,0xcf,0xc3,0x34,0x21,0xe5,0x0f,0x10, +0x32,0x87,0xa1,0x5a,0xc8,0x28,0x45,0x2c,0xd6,0x1d,0x8d,0x46,0xaf,0x5e,0x9d,0xda, +0xbf,0xff,0x90,0xdb,0xed,0xbf,0x76,0xed,0x86,0x69,0x16,0x1f,0x7c,0xf0,0xb8,0x65, +0x55,0x1a,0x92,0x61,0x58,0xd1,0x68,0xa6,0xa5,0x65,0xa9,0xbb,0xbb,0xd9,0xb2,0x76, +0x03,0xea,0xee,0x01,0xc7,0x11,0x42,0x2e,0x2c,0x14,0x92,0xc9,0x82,0x65,0x89,0xef, +0x02,0x48,0x4a,0x38,0xd9,0x2a,0xa5,0x91,0x48,0x0c,0x9d,0x3b,0x77,0xf6,0xfa,0xf5, +0x5b,0x5d,0x5d,0x7b,0xc7,0xc7,0x2f,0xfb,0x7c,0x4d,0x4d,0x4d,0x0f,0x58,0x16,0x6c, +0x1b,0x89,0xc4,0xd4,0x91,0x23,0x7f,0x0d,0x87,0x33,0x80,0x04,0x5a,0x80,0x23,0x80, +0x0d,0x48,0xc0,0xae,0x1b,0x95,0x47,0xa5,0xec,0x9b,0x37,0xb3,0xaf,0xbf,0x7e,0x75, +0x6a,0x6a,0x65,0xab,0x80,0x72,0x39,0x62,0x9a,0x60,0xac,0x82,0xc6,0x29,0xfb,0xfe, +0xfe,0xbd,0xa3,0xa3,0xff,0xbc,0x7c,0xf9,0x52,0x3e,0xdf,0xb4,0xba,0xba,0xd0,0xd7, +0x77,0x4c,0x4a,0xb7,0x94,0x48,0x24,0xae,0x8d,0x8c,0xfc,0xa9,0xab,0x6b,0x77,0x47, +0xc7,0x13,0x3e,0x9f,0x0f,0x90,0x80,0x00,0xf8,0xa6,0x59,0x00,0x5c,0x29,0x56,0x2c, +0x66,0x23,0x91,0xa9,0xce,0x4e,0xe3,0xe4,0xc9,0x31,0xd7,0x16,0x01,0x45,0x22,0x2f, +0xe8,0xfa,0xce,0x68,0xb4,0x31,0x1a,0x45,0x2e,0x87,0xc5,0x45,0xe4,0xf3,0xe0,0x5c, +0x5f,0x59,0x59,0xcd,0x64,0x6e,0xe7,0x72,0x49,0xa5,0xd4,0xae,0x5d,0x3f,0x55,0xca, +0x4b,0x08,0x7f,0xf1,0xc5,0x53,0xfd,0xfd,0xb1,0xfe,0xfe,0xc7,0x0c,0x23,0x04,0x08, +0xa0,0x04,0x58,0x00,0xab,0xce,0xb5,0x61,0x01,0x8c,0x10,0xe6,0x76,0x6b,0x91,0x48, +0xb8,0x5c,0x5e,0xf6,0xf9,0x6c,0x1d,0x80,0x46,0xc8,0xa3,0x7d,0x7d,0xc7,0x06,0x06, +0xc2,0x6e,0x37,0xa9,0xc9,0x63,0xcd,0xb1,0x6d,0x28,0xf5,0xfe,0xb2,0x8f,0x31,0xe4, +0x72,0x28,0x14,0x90,0xcb,0x61,0x79,0x19,0xe9,0x34,0x4a,0x25,0x34,0x37,0xef,0x9d, +0x9d,0xbd,0x5a,0x2c,0x2e,0x47,0x22,0x0f,0x13,0xd2,0xc8,0x18,0xda,0xdb,0x97,0x22, +0x91,0xc5,0x58,0x6c,0x2f,0xe0,0x07,0x34,0xc0,0xae,0xe2,0xe0,0xf5,0xc4,0x6c,0xe0, +0xc9,0xe5,0xe2,0xd1,0x68,0xcb,0x23,0x8f,0x34,0xea,0x6e,0x5d,0x7f,0xf5,0xc9,0x27, +0x9f,0x49,0x24,0xc2,0xb1,0x98,0x3f,0x18,0x24,0x4e,0xbe,0x38,0x52,0x59,0x13,0x4c, +0x29,0xff,0xf6,0xb1,0xc7,0x89,0x17,0x63,0x30,0x4d,0xe4,0x72,0x58,0x5b,0x83,0x10, +0xf0,0x7a,0x3b,0x9a,0x9a,0xfa,0x4c,0x33,0x1d,0x89,0x1c,0xb0,0x2c,0x22,0x25,0x80, +0xb2,0xae,0x73,0xc3,0x40,0x35,0x4b,0x2c,0x80,0x02,0x14,0x10,0x52,0x52,0xd3,0x5c, +0x01,0x78,0x20,0xe0,0x97,0x92,0x02,0xc2,0xed,0x76,0xd5,0xc0,0x79,0xbd,0xf0,0xf9, +0xa4,0xfe,0xf4,0x9e,0x3d,0xcf,0xee,0xd9,0x33,0xf0,0xc4,0x13,0x91,0x9e,0x1e,0xe2, +0x34,0x99,0xcd,0x8a,0xc0,0xb9,0x76,0xda,0x4d,0x79,0xa5,0xa9,0x38,0x85,0x56,0xad, +0x26,0xb2,0x73,0xe7,0xcf,0x39,0x97,0x80,0xd7,0xe9,0x52,0x9c,0x2b,0x80,0x3b,0x08, +0x00,0x05,0x30,0xa0,0x2c,0xa5,0xf9,0xc5,0x17,0xa3,0x63,0x63,0xa7,0x8b,0xc5,0x35, +0xa5,0x54,0x43,0x43,0xc0,0x30,0xdc,0xb1,0x58,0xdb,0xf0,0xf0,0x70,0x1d,0x55,0x16, +0x20,0xf4,0xe7,0x12,0x89,0x58,0x5f,0x5f,0x6b,0x4f,0x0f,0x9a,0x9a,0x50,0x28,0xa0, +0x58,0x44,0xb9,0xbc,0x2e,0x4b,0xd5,0xd9,0x20,0x6a,0x95,0xf2,0x7c,0xbe,0xb2,0xc0, +0x18,0x18,0xab,0xdd,0x3d,0x0c,0x29,0x8d,0xda,0x25,0x84,0x73,0x05,0x08,0xa0,0x0c, +0x70,0x40,0x39,0x0c,0xfd,0xe3,0x1f,0xef,0x5e,0xbc,0x78,0xba,0xb9,0xb9,0x75,0x68, +0x68,0x1f,0x60,0xcf,0xcc,0x4c,0xa7,0xd3,0x49,0xbf,0xdf,0x00,0xca,0x75,0x41,0xa4, +0x00,0xd7,0x3b,0x7d,0xbe,0x70,0x4b,0x0b,0x0c,0x03,0xb6,0x5d,0xe9,0x30,0xf5,0x80, +0xaa,0x3a,0x79,0xb0,0xdd,0x7c,0xe7,0xdf,0x99,0x9b,0x37,0xbb,0xfc,0x7e,0x97,0x65, +0x21,0x9b,0x05,0xa5,0x1b,0xa2,0x5a,0x0f,0xa8,0xf2,0xeb,0x0e,0x43,0xc9,0xe4,0xf5, +0xcf,0x3f,0x3f,0x17,0x8f,0x0f,0x3d,0xff,0xfc,0xaf,0x34,0xcd,0x06,0x84,0x10,0x8f, +0xbf,0xf9,0xe6,0x5b,0xba,0x8e,0x72,0x39,0x6d,0xdb,0x16,0x21,0x52,0xd3,0x20,0x65, +0x11,0xe0,0xba,0x26,0xa5,0xe6,0xf4,0x16,0xc3,0xa8,0x44,0x82,0x52,0x49,0xe9,0x9d, +0x1b,0x37,0x66,0xa6,0xa6,0x14,0xe7,0x6d,0xb1,0x18,0x2b,0x97,0x8f,0x36,0x74,0x7e, +0xa4,0x1f,0x4b,0xa5,0xa6,0x56,0x57,0x77,0x11,0xe2,0xad,0xbf,0x91,0xd5,0x1c,0xdb, +0x76,0x00,0x89,0x3a,0x40,0x00,0xac,0xe9,0xe9,0xab,0x84,0xe0,0xf0,0xe1,0xc7,0x35, +0x8d,0x39,0x64,0x68,0x1a,0x7d,0xe6,0x99,0x83,0x4a,0x31,0xcb,0x5a,0x06,0xa4,0x33, +0x4a,0xa5,0x02,0x63,0xa6,0x5e,0xb9,0x4c,0x30,0x56,0x01,0x54,0x2e,0xdb,0xc5,0xe2, +0xe9,0x53,0xa7,0xae,0x8c,0x8e,0xda,0x55,0x11,0x22,0x9a,0xb6,0x6f,0xdf,0xbe,0x3f, +0x1e,0x89,0xfe,0xf6,0x3c,0xbf,0x9e,0xce,0x11,0xe2,0xb6,0x6d,0xb2,0xb9,0x16,0x9d, +0x41,0x69,0x6a,0x03,0xa0,0x7c,0x7e,0xc5,0xed,0x76,0x07,0x02,0x6e,0x67,0x51,0xca, +0x72,0xb1,0x98,0x0e,0x06,0x09,0xa0,0x03,0xac,0xda,0xa5,0xa4,0x52,0xdc,0xb6,0x79, +0x15,0x90,0x65,0xc1,0xe3,0x71,0xe8,0x99,0x99,0x98,0xb8,0x32,0x3a,0xda,0x1f,0x8f, +0x1f,0x3d,0x7e,0xdc,0xad,0x69,0x13,0x97,0x2e,0x8d,0x9e,0x3f,0x6f,0x33,0x36,0xe4, +0x5f,0xf8,0xfb,0xd1,0xd9,0xcb,0xe9,0xe6,0xf9,0x82,0x87,0x5a,0xfc,0x76,0x2a,0x75, +0x6a,0x21,0x3d,0x4f,0x2d,0x00,0x4a,0x55,0x24,0x5d,0x29,0x48,0x09,0xa5,0xf4,0x6a, +0x0e,0xc1,0x49,0x55,0x40,0x01,0x14,0x90,0x97,0x2e,0x7d,0xf1,0xc9,0x27,0xff,0x72, +0x5e,0xd5,0xe5,0xd2,0x9e,0x7e,0x7a,0xb0,0xbb,0xbb,0xb1,0x8a,0xc9,0x02,0x84,0x5e, +0x11,0x05,0x27,0x5d,0x18,0x03,0xa5,0x85,0xa5,0x25,0xdb,0xb6,0x07,0x06,0x06,0x5a, +0x43,0x21,0x70,0xfe,0xa3,0x83,0x07,0xbf,0x9c,0x9c,0x8c,0x68,0x1a,0xe6,0xe6,0x34, +0xce,0x0f,0x88,0x99,0x03,0x2e,0x9b,0x1a,0xfc,0x92,0x9e,0x7c,0xdf,0x9e,0x13,0xa2, +0xb4,0xa1,0x85,0x2a,0xd5,0xc8,0x58,0x82,0xf3,0xac,0xd7,0xcb,0x01,0x02,0xf0,0x60, +0xd0,0xc7,0x18,0xcb,0xe7,0x97,0xdc,0x6e,0x5f,0x20,0xc0,0xfb,0xfa,0x5a,0x95,0xb2, +0x6f,0xdf,0x5e,0x76,0xbb,0xb5,0x50,0x48,0x03,0x9c,0x38,0x4a,0x80,0x03,0x52,0x5f, +0xd7,0x71,0xa7,0x9a,0xcb,0xe5,0xae,0x58,0xcc,0xeb,0xf5,0x9e,0xfd,0xe8,0xa3,0xf9, +0xe9,0xe9,0xee,0xf6,0xf6,0x8e,0x50,0xe8,0xe5,0xc7,0x1e,0x73,0x49,0x89,0x52,0x69, +0x3d,0x65,0x28,0x45,0xa9,0xe4,0xb4,0x9d,0x4d,0xa6,0x94,0x62,0xa5,0x52,0xca,0xe3, +0x59,0x35,0x0c,0x1f,0x21,0xf4,0x81,0x07,0x3a,0x2e,0x5c,0x50,0x67,0xce,0x8c,0x1e, +0x3b,0x36,0x10,0x8b,0xf9,0x62,0xb1,0xdd,0x8c,0xd1,0x64,0x32,0xd7,0xdc,0xec,0x0d, +0x85,0xb4,0x2a,0x85,0x35,0x40,0x4e,0x65,0x39,0x45,0xcc,0x18,0x2c,0xab,0xa5,0xa1, +0xe1,0x97,0x23,0x23,0xe7,0x3f,0xfd,0xf4,0xea,0xb5,0x6b,0x57,0x26,0x26,0x00,0x74, +0x85,0xc3,0x3f,0x1b,0x1c,0x6c,0xf1,0x7a,0xd7,0xd3,0xd8,0xd9,0x7f,0x6f,0x73,0xca, +0xde,0x92,0xb2,0x6c,0xdb,0x96,0x94,0xe9,0x50,0x88,0x3d,0xfa,0x68,0xdf,0xd8,0xd8, +0xf4,0xdb,0x6f,0x2f,0x06,0x02,0x1e,0x42,0x60,0x9a,0x96,0x6d,0xab,0x8e,0x0e,0x3f, +0x60,0x55,0x93,0x5a,0x38,0xf9,0xa4,0x63,0x75,0xb5,0x72,0x3d,0xae,0x86,0x8c,0xe5, +0xf3,0xb1,0x70,0xf8,0xc4,0xf0,0xb0,0xb9,0xb0,0xb0,0x9c,0x4a,0xdd,0x4a,0xa7,0xc7, +0x93,0xc9,0xd3,0xd7,0xaf,0xff,0x7a,0x70,0x70,0xbd,0xd0,0x9d,0x26,0x78,0xef,0xbb, +0xa0,0x02,0x64,0x35,0x5b,0x6d,0xa5,0x98,0x52,0x74,0xff,0xfe,0xf6,0x58,0xcc,0x7b, +0xeb,0x56,0x26,0x97,0x2b,0xd9,0xb6,0xdd,0xde,0x1e,0xea,0xed,0x0d,0xf4,0xf4,0x34, +0xd4,0x27,0xb5,0x13,0x3b,0x1d,0x94,0xe2,0xce,0x1d,0x0c,0x0e,0xa2,0xa9,0xc9,0x49, +0xea,0x8f,0xcf,0x9c,0xc9,0x66,0xb3,0x27,0x0e,0x1f,0x0e,0x51,0x1a,0x0a,0x85,0xfa, +0x02,0x81,0x64,0x2e,0xb7,0x68,0x9a,0x82,0x52,0xdd,0xa9,0xec,0x1a,0x43,0xf7,0x02, +0xa4,0x94,0x52,0x4a,0x28,0x65,0x01,0x1c,0x70,0x94,0xc1,0x22,0x84,0x75,0x74,0xf8, +0x3a,0x3a,0x3a,0xeb,0xf8,0x90,0xd5,0x96,0x58,0x59,0x51,0x8a,0x29,0xe5,0xe4,0x50, +0xa9,0x84,0x95,0x15,0x84,0x42,0xc8,0xe7,0x91,0xcd,0xe6,0xb3,0xd9,0x3b,0x99,0xcc, +0x9f,0xcf,0x9f,0x1f,0x8a,0x46,0x5d,0x4a,0xcd,0xe4,0x72,0x0b,0xa6,0xd9,0xdf,0xd8, +0xa8,0x73,0x5e,0xdf,0xfe,0xee,0xc7,0x90,0x69,0x4a,0x4a,0x19,0xa5,0xc5,0x60,0xf0, +0xb6,0xcb,0xd5,0x53,0x6d,0x01,0xd6,0x26,0x28,0xf2,0x6e,0x47,0x96,0x4a,0x2c,0x9f, +0x97,0xfa,0xfa,0xeb,0x5a,0x16,0xd6,0xd6,0xb0,0xb4,0x14,0xd6,0xf5,0x35,0x9f,0x2f, +0x53,0x28,0x7c,0xb0,0xb2,0xa2,0x00,0x17,0x21,0xdd,0x0d,0x0d,0xc7,0xdb,0xda,0xd6, +0xc5,0xe2,0x1b,0x19,0x9a,0x9f,0x67,0x37,0x6e,0x94,0x9a,0x9b,0x97,0x82,0xc1,0xcf, +0x0c,0x63,0x1a,0x58,0x53,0xca,0xbc,0x0f,0x8e,0x75,0x34,0xe5,0x32,0xcf,0x64,0xc4, +0xb9,0x73,0x76,0x15,0x90,0xf3,0xc6,0x9c,0x83,0xb1,0xe3,0x3d,0x3d,0xaa,0xb3,0x93, +0x73,0x9e,0x29,0x14,0x38,0xe7,0x01,0x97,0xab,0xcd,0xed,0x76,0x49,0x59,0x93,0xd3, +0x6f,0x66,0xc8,0xb6,0xd5,0x1b,0x6f,0xac,0x74,0x75,0x41,0x29,0x16,0x89,0x2c,0x7a, +0x3c,0xa8,0x9e,0x6a,0xd7,0x8e,0xaf,0x7f,0x54,0x4a,0x52,0x2a,0x33,0x19,0x39,0x39, +0xa9,0xde,0x7b,0x0f,0xba,0x14,0x42,0x50,0x0a,0xd3,0xac,0xc9,0xa6,0x21,0x04,0xa4, +0x74,0x2b,0xb5,0xcb,0xeb,0x85,0x61,0x54,0xaa,0xef,0x6e,0x99,0x90,0x42,0x48,0x21, +0xc4,0x7d,0x3e,0x70,0x66,0x67,0xd9,0xc9,0x93,0x8b,0x2f,0xbd,0x14,0x48,0x24,0xf4, +0x40,0x00,0xd5,0x0b,0xab,0xba,0xa7,0xa3,0x94,0xca,0xe5,0xd4,0xd8,0x18,0xde,0x7d, +0x17,0xa5,0x12,0xf4,0x2f,0xcb,0xe5,0xd8,0xea,0x6a,0xeb,0xc4,0x04,0x09,0x06,0x61, +0x9a,0x28,0x14,0xee,0x0a,0xcd,0x7d,0x9c,0x15,0xce,0xb3,0x42,0xa4,0xee,0xff,0xc5, +0xb5,0xb8,0x28,0x5f,0x7b,0x6d,0xad,0xa1,0x81,0x78,0x3c,0xf5,0x9f,0x1c,0x1b,0xf6, +0x2b,0x00,0x4a,0x55,0x04,0xdd,0x31,0x72,0xc8,0xef,0xff,0x43,0x4b,0xcb,0xae,0x60, +0xb0,0xc7,0xef,0x27,0x4a,0x55,0xc8,0xd8,0x0c,0xa5,0xfa,0xa8,0x84,0x58,0x92,0xf2, +0x96,0x10,0x6f,0x2a,0xf5,0xce,0xfd,0xe0,0xfc,0x0f,0x46,0x00,0x3c,0x17,0x08,0xbc, +0xec,0xf7,0x37,0x6b,0x9a,0x97,0x10,0x52,0xff,0x57,0x8f,0x94,0x9b,0xff,0x02,0xb2, +0x6c,0xdb,0x54,0xea,0x03,0xe0,0xad,0xaa,0x56,0x7d,0xff,0x80,0x08,0xb0,0xc3,0xe5, +0x3a,0xec,0xf1,0x04,0x80,0xca,0x67,0xa6,0xa3,0x96,0xb5,0x51,0xb7,0x62,0x01,0x97, +0x81,0xe9,0x4d,0xec,0x6f,0xdb,0xb6,0x6d,0xdb,0xb6,0x7d,0x47,0xfb,0x2f,0xf0,0x55, +0xfe,0x33,0xd2,0x11,0xa4,0x5b,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42, +0x60,0x82}; +/* End Of File */