diff -Nru swftools-0.9.0/ChangeLog swftools-0.9.2/ChangeLog --- swftools-0.9.0/ChangeLog 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/ChangeLog 2011-12-12 21:29:27.000000000 +0000 @@ -287,3 +287,11 @@ * lib/python/gfx: New python module for accessing pdf2swf functionality * as3compile: New tool, for compiling ActionScript 3.0 * swfc: added AS3.0 support + * swfc: added font glyphs selection + +0.9.1: + * pdf2swf: bugfixes, speedups + * pdf2swf: improved font quality (FlashType) + * librfxswf: support for fontalignzones + * gpdf2swf: completely reworked pdf2swf GUI (Ricardo Pedroso) + * as3compile: many bugfixes, support for swc libraries diff -Nru swftools-0.9.0/config.guess swftools-0.9.2/config.guess --- swftools-0.9.0/config.guess 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1545 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. - -timestamp='2008-01-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 -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 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." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -if [ "${UNAME_SYSTEM}" = "Linux" ] ; then - eval $set_cc_for_build - cat << EOF > $dummy.c - #include - #ifdef __UCLIBC__ - # ifdef __UCLIBC_CONFIG_VERSION__ - LIBC=uclibc __UCLIBC_CONFIG_VERSION__ - # else - LIBC=uclibc - # endif - #else - LIBC=gnu - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` -fi - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[456]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" - exit ;; - esac - # This should get integrated into the C code below, but now we hack - if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -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 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru swftools-0.9.0/config.h.in swftools-0.9.2/config.h.in --- swftools-0.9.0/config.h.in 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/config.h.in 2012-04-08 17:25:26.000000000 +0000 @@ -55,12 +55,12 @@ #undef HAVE_WCSCHR #undef HAVE_WCSDUP +/* Define if you have the open64 function. */ +#undef HAVE_OPEN64 + /* Define if you have the lrand48 function. */ #undef HAVE_LRAND48 -/* Define if you have the mkstemp function. */ -#undef HAVE_MKSTEMP - /* Define if you have the popen function. */ #undef HAVE_POPEN @@ -79,6 +79,9 @@ /* Define if you have the srand48 function. */ #undef HAVE_SRAND48 +/* Define if you have the calloc function. */ +#undef HAVE_CALLOC + /* Define if you have the stat function. */ #undef HAVE_STAT @@ -130,6 +133,12 @@ /* Define if you have the header file. */ #undef HAVE_ZLIB_H +/* Define if you have the header file. */ +#undef HAVE_ZZIP_LIB_H + +/* Define if you have the header file. */ +#undef HAVE_PDFLIB_H + /* Define if you have the header file. */ #undef HAVE_AVIFILE_VERSION_H @@ -161,9 +170,14 @@ #undef HAVE_OUTPUTDEV_H /* Define if you have the jpeg library (-ljpeg). */ -/* Define if you have the jpeg library (-ljpeg). */ #undef HAVE_LIBJPEG +/* Define if you have the pdf library (-lpdf). */ +#undef HAVE_LIBPDF + +/* Define if you have the zzip library (-lzzip). */ +#undef HAVE_LIBZZIP + /* Define if you have the m library (-lm). */ #undef HAVE_LIBM @@ -173,15 +187,6 @@ /* Define if you have the z library (-lz). */ #undef HAVE_LIBZ -/* use internal libart library */ -#undef INTERNAL_LIBART - -/* Define to 1 if you have the `art_lgpl_2' library (-lart_lgpl_2). */ -#undef HAVE_LIBART_LGPL_2 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBART_LGPL_LIBART_H - /* Name of package */ #undef PACKAGE @@ -207,6 +212,10 @@ #undef HAVE_FONTCONFIG_H #undef HAVE_FONTCONFIG +#undef HAVE_FFTW3_H + +#undef HAVE_FFTW3 + /* have/use internal l.a.m.e. mp3 library */ #undef HAVE_LAME @@ -219,6 +228,8 @@ /* Define to 1 if this machine has network byte order*/ #undef WORDS_BIGENDIAN +#undef LOWERCASE_UPPERCASE + /* Define to 0 on non-windows systems */ #undef O_BINARY @@ -257,4 +268,19 @@ #define GHash GooHash #endif +#ifdef HAVE_ZZIP_LIB_H +#ifdef HAVE_LIBZZIP +#define HAVE_ZZIP 1 +#endif +#endif + +//#ifdef HAVE_BUILTIN_EXPECT +#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) +# define likely(x) __builtin_expect((x), 1) +# define unlikely(x) __builtin_expect((x), 0) +#else +# define likely(x) (x) +# define unlikely(x) (x) +#endif + #endif diff -Nru swftools-0.9.0/config.sub swftools-0.9.2/config.sub --- swftools-0.9.0/config.sub 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/config.sub 1970-01-01 00:00:00.000000000 +0000 @@ -1,1676 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. - -timestamp='2008-01-16' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# 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 -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 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." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx | dvp \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mipsEE* | ee | ps2) - basic_machine=mips64r5900el-scei - case $os in - -linux*) - ;; - *) - os=-elf - ;; - esac - ;; - iop) - basic_machine=mipsel-scei - os=-irx - ;; - dvp) - basic_machine=dvp-scei - os=-elf - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru swftools-0.9.0/configure swftools-0.9.2/configure --- swftools-0.9.0/configure 2009-04-17 15:40:10.000000000 +0000 +++ swftools-0.9.2/configure 2012-04-19 11:31:50.000000000 +0000 @@ -1,18 +1,22 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63. +# Generated by GNU Autoconf 2.65. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -20,23 +24,15 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +40,13 @@ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -55,7 +57,7 @@ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +80,6 @@ } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -94,15 +89,15 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -114,12 +109,16 @@ fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -131,330 +130,299 @@ LANGUAGE=C export LANGUAGE -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 fi - - fi - fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append -exitcode=0 -if as_func_success; then - : +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' else - exitcode=1 - echo as_func_success failed. -fi + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi -if as_func_ret_success; then - : +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_ret_success failed. + as_expr=false fi -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -471,8 +439,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the @@ -482,29 +449,18 @@ exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -534,7 +490,7 @@ rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -553,10 +509,10 @@ if test -d "$1"; then test -d "$1/."; else - case $1 in + case $1 in #( -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -570,8 +526,8 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, @@ -589,7 +545,6 @@ subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= @@ -597,6 +552,7 @@ PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= +PACKAGE_URL= ac_unique_file="src/" # Factoring default headers for most tests. @@ -640,23 +596,28 @@ PNG2SWF GIF2SWF JPEG2SWF +PDF2PDF +DEVICE_PDF LIBPDF PDF2SWF HAVE_PYTHON_IMAGING +PYTHON_INSTALL_PATH PYTHON_INCLUDES PYTHON_LIB +PYTHON_EXECUTABLE +RUBY_INSTALLDIR +RUBY_LDFLAGS +RUBY_CPPFLAGS +RUBY_LIBS +RUBY USE_GZIP VIDEO_CFLAGS VIDEO_LIBS AVIFILE_CONFIG +xpdf_include splash_in_source xpdf_in_source CXXCPP -POPPLER_LIBS -POPPLER_CFLAGS -art_in_source -LIBART_LIBS -LIBART_CFLAGS lame_in_source DEVICE_OPENGL FREETYPE_CONFIG @@ -676,7 +637,6 @@ SLEXT AR AREXT -PKG_CONFIG UNCOMPRESS LN_S INSTALL_DATA @@ -734,6 +694,7 @@ program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -749,9 +710,8 @@ enable_profiling enable_warnings enable_optimizations +enable_poppler enable_lame -with_external_libart -with_poppler ' ac_precious_vars='build_alias host_alias @@ -765,11 +725,6 @@ CXXFLAGS CCC CPP -PKG_CONFIG -LIBART_CFLAGS -LIBART_LIBS -POPPLER_CFLAGS -POPPLER_LIBS CXXCPP' @@ -879,8 +834,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -906,8 +860,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1111,8 +1064,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1128,8 +1080,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1159,17 +1110,17 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1186,15 +1137,13 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1217,8 +1166,7 @@ [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1248,11 +1196,9 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1291,13 +1237,11 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1405,13 +1349,8 @@ --enable-profiling turn on profiling --enable-warnings turn on compiler warnings --enable-optimizations turn on compiler optimizations (recommended for avi2swf) - --disable-lame don't compile any L.A.M.E. mp3 encoding code in - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-external-libart use external libart library (currently broken) - --with-poppler use poppler instead of internal xpdf (currently broken) + --enable-poppler link againist libpoppler + --disable-lame "don't compile any L.A.M.E. mp3 encoding code in" Some influential environment variables: CC C compiler command @@ -1419,24 +1358,17 @@ LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor - PKG_CONFIG path to pkg-config utility - LIBART_CFLAGS - C compiler flags for LIBART, overriding pkg-config - LIBART_LIBS linker flags for LIBART, overriding pkg-config - POPPLER_CFLAGS - C compiler flags for POPPLER, overriding pkg-config - POPPLER_LIBS - linker flags for POPPLER, overriding pkg-config CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to the package provider. _ACEOF ac_status=$? fi @@ -1500,1770 +1432,1916 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.63 +generated by GNU Autoconf 2.65 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -It was created by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - $ $0 $@ + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -_ACEOF -exec 5>>config.log +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +} # ac_fn_cxx_try_compile -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ASUNAME + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS +} # ac_fn_c_try_cpp -} >&5 +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >&5 <<_ACEOF + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_c_try_link -## ----------- ## -## Core tests. ## -## ----------- ## +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ACEOF + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_c_try_run -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_header_mongrel -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_header_compile -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} _ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + eval "$3=yes" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_type +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -# Check whether --enable-checkmem was given. -if test "${enable_checkmem+set}" = set; then - enableval=$enable_checkmem; CHECKMEM=true -fi - -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then - enableval=$enable_debug; DEBUG=true -fi - -# Check whether --enable-profiling was given. -if test "${enable_profiling+set}" = set; then - enableval=$enable_profiling; PROFILING=true -fi - -# Check whether --enable-warnings was given. -if test "${enable_warnings+set}" = set; then - enableval=$enable_warnings; ENABLE_WARNINGS=true -fi - -# Check whether --enable-optimizations was given. -if test "${enable_optimizations+set}" = set; then - enableval=$enable_optimizations; OPTIMIZE=true +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" fi - -# Check whether --enable-lame was given. -if test "${enable_lame+set}" = set; then - enableval=$enable_lame; DISABLE_LAME=true +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_c_check_func -# Check whether --with-external-libart was given. -if test "${with_external_libart+set}" = set; then - withval=$with_external_libart; EXTERNAL_LIBART=true -fi +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 -# Check whether --with-poppler was given. -if test "${with_poppler+set}" = set; then - withval=$with_poppler; USE_POPPLER=true -fi - - -PACKAGE=swftools -VERSION=0.9.0 - - -# ------------------------------------------------------------------ - -if test "x${srcdir}" != "x."; then - echo "--srcdir is not supported" - exit 1 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 -WARNINGS="-Wparentheses -Wimplicit -Wreturn-type" -if test "x$ENABLE_WARNINGS" '!=' "x";then - WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -D_FORTIFY_SOURCE=2 " -fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 -if test "x$CHECKMEM" '!=' "x";then - DEBUG=yes -fi -if test "x$PROFILING" '!=' "x";then - DEBUG=yes + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -if test "x$DEBUG" '!=' "x";then - if test "x$PROFILING" = "x";then - CFLAGS="$WARNINGS -O2 -g $CFLAGS" - CXXFLAGS="$WARNINGS -O2 -g $CXXFLAGS" - LDFLAGS="-g $LIBS" - else - CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS" - CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS" - LDFLAGS="-g -pg $LIBS" - fi -else if test "x$OPTIMIZE" '!=' "x"; then - CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS" - CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS" - CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS" + ac_lo= ac_hi= fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 -CFLAGS="-fPIC $CFLAGS" -CXXFLAGS="-fPIC $CFLAGS" - -#OLDGCC=1 -#if test "x$OLDGCC" '!=' "x";then -# #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic" -# #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic" -# CFLAGS="$CFLAGS -ansi -pendantic" -# CXXFLAGS="$CXXFLAGS -ansi -pendantic" -#fi - -export PACKAGE VERSION CFLAGS CXXFLAGS + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 /dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } +} # ac_fn_c_compute_int -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_cxx_try_cpp -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } + ac_header_compiler=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +} # ac_fn_cxx_check_header_mongrel -SHARED="-shared" -MACOSX= -case $host_os in - *darwin* ) - MACOSX=yes - CFLAGS="$CFLAGS" - CXXFLAGS="$CXXFLAGS -fno-rtti" - SHARED="-bundle" - # Use fink packages if available. - #if test -d /sw/include && test -d /sw/lib; then - # CPPFLAGS="${CPPFLAGS} -I/sw/include" - # LDFLAGS="${LDFLAGS} -L/sw/lib" - #fi - ;; +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval +} # ac_fn_cxx_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +It was created by $as_me, which was +generated by GNU Autoconf 2.65. Invocation command line was -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi + $ $0 $@ - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done + $as_echo "PATH: $as_dir" + done IFS=$as_save_IFS -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +} >&5 +cat >&5 <<_ACEOF -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +## ----------- ## +## Core tests. ## +## ----------- ## +_ACEOF - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done done -IFS=$as_save_IFS +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo - test -n "$ac_ct_CC" && break + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done +ac_signal=0 - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h -fi +$as_echo "/* confdefs.h */" > confdefs.h +# Predefined preprocessor variables. -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF -# Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF -ac_rmfiles= -for ac_file in $ac_files + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi done -rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } -fi -ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +# ------------------- option parsing ------------------------------- -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +DEBUG= +CHECKMEM= +PROFILING= +ENABLE_WARNINGS= +OPTIMIZE= +USE_POPPLER= +DISABLE_LAME= + +# Check whether --enable-checkmem was given. +if test "${enable_checkmem+set}" = set; then : + enableval=$enable_checkmem; CHECKMEM=true fi -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; DEBUG=true +fi -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Check whether --enable-profiling was given. +if test "${enable_profiling+set}" = set; then : + enableval=$enable_profiling; PROFILING=true +fi -int -main () -{ +# Check whether --enable-warnings was given. +if test "${enable_warnings+set}" = set; then : + enableval=$enable_warnings; ENABLE_WARNINGS=true +fi - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Check whether --enable-optimizations was given. +if test "${enable_optimizations+set}" = set; then : + enableval=$enable_optimizations; OPTIMIZE=true +fi -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +# Check whether --enable-poppler was given. +if test "${enable_poppler+set}" = set; then : + enableval=$enable_poppler; USE_POPPLER=true fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +# Check whether --enable-lame was given. +if test "${enable_lame+set}" = set; then : + enableval=$enable_lame; if test "x$enable_lame" = "xno";then + DISABLE_LAME=yes fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + DISABLE_LAME= +fi -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +PACKAGE=swftools +VERSION=0.9.2 + +# ------------------------------------------------------------------ - ac_compiler_gnu=no +if test "x${srcdir}" != "x."; then + echo "--srcdir is not supported" + exit 1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu +WARNINGS="-Wimplicit -Wreturn-type -Wno-write-strings -Wformat" +if test "x$ENABLE_WARNINGS" '!=' "x";then + WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -Wno-write-strings -D_FORTIFY_SOURCE=2 " +fi +if test "x$CHECKMEM" '!=' "x";then + DEBUG=yes fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= +if test "x$PROFILING" '!=' "x";then + DEBUG=yes fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 +if test "x$DEBUG" '!=' "x";then + if test "x$PROFILING" = "x";then + CFLAGS="$WARNINGS -O2 -g $CFLAGS" + CXXFLAGS="$WARNINGS -O2 -g $CXXFLAGS" + LDFLAGS="-g $LDFLAGS" + else + CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS" + CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS" + LDFLAGS="-g -pg $LDFLAGS" + fi +else if test "x$OPTIMIZE" '!=' "x"; then + CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS" + CXXFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CXXFLAGS" else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ + CFLAGS="$WARNINGS -O -fomit-frame-pointer $CFLAGS" + CXXFLAGS="$WARNINGS -O -fomit-frame-pointer $CXXFLAGS" +fi +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +CFLAGS="-fPIC $CFLAGS" +CXXFLAGS="-fPIC $CFLAGS" - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +#OLDGCC=1 +#if test "x$OLDGCC" '!=' "x";then +# #CFLAGS="$CFLAGS --std=c89 -ansi -pendantic" +# #CXXFLAGS="$CXXFLAGS --std=c89 -ansi -pendantic" +# CFLAGS="$CFLAGS -ansi -pendantic" +# CXXFLAGS="$CXXFLAGS -ansi -pendantic" +#fi -int -main () -{ +export PACKAGE VERSION CFLAGS CXXFLAGS - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi -int -main () -{ +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC +SLEXT="so" +SHARED="-shared" +MACOSX= +case $host_os in + *darwin* ) + MACOSX=yes + CFLAGS="$CFLAGS" + CXXFLAGS="$CXXFLAGS -fno-rtti" + SHARED="-bundle" + SLEXT="bundle" + if test -d /opt/local/include && test -d /opt/local/lib; then + CPPFLAGS="${CPPFLAGS} -I/opt/local/include" + LDFLAGS="${LDFLAGS} -L/opt/local/lib" + fi + # Use fink packages if available. + #if test -d /sw/include && test -d /sw/lib; then + # CPPFLAGS="${CPPFLAGS} -I/sw/include" + # LDFLAGS="${LDFLAGS} -L/sw/lib" + #fi + ;; +esac + + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:$LINENO: result: $CXX" >&5 -$as_echo "$CXX" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CXX" && break + test -n "$CC" && break done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_CXX" && break + test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CXX" = x; then - CXX="g++" + if test "x$ac_ct_CC" = x; then + CC="" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CXX=$ac_ct_CXX + CC=$ac_ct_CC fi fi - fi fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int main () { -#ifndef __GNUC__ - choke me -#endif +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3274,75 +3352,103 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { +#ifndef __GNUC__ + choke me +#endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3353,5778 +3459,2407 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes +if ac_fn_c_try_compile "$LINENO"; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" else - CXXFLAGS="-g" + CFLAGS="-g" fi else - if test "$GXX" = yes; then - CXXFLAGS="-O2" + if test "$GCC" = yes; then + CFLAGS="-O2" else - CXXFLAGS= + CFLAGS= fi fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -{ $as_echo "$as_me:$LINENO: checking whether gcc supports lazy variable declaration" >&5 -$as_echo_n "checking whether gcc supports lazy variable declaration... " >&6; } +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -cat > conftest.c << EOF -#include -#include +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; -int main (int argc, char*argv) +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () { - int a,b; - b=3; - int c; - c=4; - return 0; +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; } -EOF - -testprog_link='$CC $CPPFLAGS $CFLAGS conftest.c -o conftest${ac_exeext}' -if { (eval echo gcc.2.95.m4:19: \"$testprog_link\") 1>&5; (eval $testprog_link) 2>&5; } && test -s conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - GCC_IS_OK=true - export GCC_IS_OK -else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC -if test "x$GCC_IS_OK" '=' "x";then - echo "***************************************************" - echo "* Your gcc is too old to compile this!" - echo "* " - echo "* The last version compilable by this compiler is " - echo "* swftools 0.7.0, which you can download from " - echo "* http://www.swftools.org/swftools-0.7.0.tar.gz " - echo "* ." - echo "* Newer versions require at least gcc 3.0.0 " - echo "***************************************************" - exit 1 fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -if test "x$CHECKMEM" '!=' "x";then - CC="ccmalloc $CC" - CXX="ccmalloc $CXX" - #echo running again - #unset ac_cv_prog_CC - #unset ac_cv_prog_CXX - #AC_PROG_CC - #AC_PROG_CXX fi - ac_ext=c + +ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - # Broken: fails on valid input. -continue fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break + test -n "$CXX" && break + done fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + test -n "$ac_ct_CXX" && break done -IFS=$as_save_IFS -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_CXX" = x; then + CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + CXX=$ac_ct_CXX fi -else - RANLIB="$ac_cv_prog_RANLIB" fi - { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" + ac_compiler_gnu=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +int +main () +{ -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' +int +main () +{ -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : - { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - for ac_prog in gzip uncompress compress -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_UNCOMPRESS+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$UNCOMPRESS"; then - ac_cv_prog_UNCOMPRESS="$UNCOMPRESS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_UNCOMPRESS="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -UNCOMPRESS=$ac_cv_prog_UNCOMPRESS -if test -n "$UNCOMPRESS"; then - { $as_echo "$as_me:$LINENO: result: $UNCOMPRESS" >&5 -$as_echo "$UNCOMPRESS" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - test -n "$UNCOMPRESS" && break -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports lazy variable declaration" >&5 +$as_echo_n "checking whether gcc supports lazy variable declaration... " >&6; } +cat > conftest.c << EOF +#include +#include -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +int main () +{ + int a,b; + b=3; + int c; + c=4; + return 0; +} +EOF - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } +testprog_link='$CC $CPPFLAGS $CFLAGS conftest.c -o conftest${ac_exeext}' +if { (eval echo gcc.2.95.m4:19: \"$testprog_link\") 1>&5; (eval $testprog_link) 2>&5; } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + GCC_IS_OK=true + export GCC_IS_OK else - { $as_echo "$as_me:$LINENO: result: no" >&5 + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi +rm -f conftest* + +if test "x$GCC_IS_OK" '=' "x";then + echo "***************************************************" + echo "* Your gcc is too old to compile this!" + echo "* " + echo "* The last version compileable by this compiler is " + echo "* swftools 0.7.0, which you can download from " + echo "* http://www.swftools.org/swftools-0.7.0.tar.gz " + echo "* ." + echo "* Newer versions require at least gcc 3.0.0 " + echo "***************************************************" + exit 1 +fi +if test "x$CHECKMEM" '!=' "x";then + CC="ccmalloc $CC" + CXX="ccmalloc $CXX" + #echo running again + #unset ac_cv_prog_CC + #unset ac_cv_prog_CXX + #AC_PROG_CC + #AC_PROG_CXX fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.$ac_ext - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi - -fi - -OBJEXT="o" -AREXT=".a" -CXXLIBS="-lstdc++" - + done + ac_cv_prog_CPP=$CPP -if test "x$EXEEXT" = "x.exe";then - OBJEXT="obj" - AREXT=".lib" - CXXLIBS="" fi - - - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build + CPP=$ac_cv_prog_CPP else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - - -{ $as_echo "$as_me:$LINENO: checking for target system" >&5 -$as_echo_n "checking for target system... " >&6; } -CYGWIN= -MINGW= -case $host_os in - *cygwin* ) CYGWIN=yes;; - *mingw* ) MINGW=yes;; -esac - -AR=ar -if test "x$MINGW" = "xyes"; then - #fix for the debian distribution of mingw - if test -x "/usr/i586-mingw32msvc/bin/ar";then - AR="/usr/i586-mingw32msvc/bin/ar" - fi - if test -x "/usr/i586-mingw32msvc/bin/ranlib";then - RANLIB="/usr/i586-mingw32msvc/bin/ranlib" - fi - #fix for the gentoo distribution of mingw - if test -x "/opt/xmingw/bin/i386-mingw32msvc-ar";then - AR="/opt/xmingw/bin/i386-mingw32msvc-ar" - fi - if test -x "/opt/xmingw/bin/i386-mingw32msvc-ranlib";then - RANLIB="/opt/xmingw/bin/i386-mingw32msvc-ranlib" - fi - if test -x "/opt/xmingw/bin/i386-mingw32msvc-strip";then - STRIP="/opt/xmingw/bin/i386-mingw32msvc-strip" - fi + ac_cv_prog_CPP=$CPP fi - - - -if test "x${CYGWIN}" = "xyes"; then - -cat >>confdefs.h <<\_ACEOF -#define CYGWIN 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : - { $as_echo "$as_me:$LINENO: result: cygwin" >&5 -$as_echo "cygwin" >&6; } else - if test "x${MINGW}" = "xyes"; then - -cat >>confdefs.h <<\_ACEOF -#define MINGW 1 -_ACEOF - - WIN32=1 - -cat >>confdefs.h <<\_ACEOF -#define WIN32 1 -_ACEOF - - LIBS="$LIBS -lws2_32 -lgdi32" - { $as_echo "$as_me:$LINENO: result: mingw" >&5 -$as_echo "mingw" >&6; } - else - LINUX=1 - export LINUX - -cat >>confdefs.h <<\_ACEOF -#define LINUX 1 -_ACEOF - - { $as_echo "$as_me:$LINENO: result: " >&5 -$as_echo "" >&6; } - fi + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.$ac_ext - -SLEXT="so" -if test "x${MINGW}" != "xyes"; then - # no mingW - -cat >>confdefs.h <<\_ACEOF -#define O_BINARY 0 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include _ACEOF - +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - # mingW - SLEXT="dll" - CXXLIBS="" -fi -export SLEXT - - - -# The following tries to make use of includes and libraries in -# /usr/local, too. Notice: A -I/usr/local/include might break -# things (MingW, cross-compiling etc.) in the same way as -I/usr/include, -# especially on systems which link /usr/local to /usr, so it has yet -# to be seen how useful this is. -if test -d /usr/local/lib; then - LDFLAGS="$LDFLAGS -L/usr/local/lib" -fi -if test -d /usr/local/include; then -# Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo. -# CPPFLAGS="$CPPFLAGS -I/usr/local/include" - echo > /dev/null -fi -if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then - # if the user has a special prefix (like /opt), there might also be $prefix/lib - # and $prefix/include, which should be included in our search paths for libraries - # and includes. - LDFLAGS="$LDFLAGS -L${libdir}" - CPPFLAGS="$CPPFLAGS -I${includedir}" - # TODO- test whether gcc still works after this + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.$ac_ext -#Mac OS: -#LDFLAGS "-L/sw/lib" ; CPPFLAGS "-I/sw/include -I/sw/include/lame" - - -# this must be done after (I believe) AC_PROG_MAKE_SET -if test "x$DEBUG" '!=' "x" -o "x$STRIP" = "x";then - STRIP="@echo debug enabled, not stripping " - export STRIP +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for sin in -lm" >&5 -$as_echo_n "checking for sin in -lm... " >&6; } -if test "${ac_cv_lib_m_sin+set}" = set; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sin (); -int -main () -{ -return sin (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_m_sin=yes + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ac_cv_lib_m_sin=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5 -$as_echo "$ac_cv_lib_m_sin" >&6; } -if test "x$ac_cv_lib_m_sin" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - echo "Error: Math library not found."; - exit; - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:$LINENO: checking for deflate in -lz" >&5 -$as_echo_n "checking for deflate in -lz... " >&6; } -if test "${ac_cv_lib_z_deflate+set}" = set; then +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char deflate (); -int -main () -{ -return deflate (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_z_deflate=yes + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ac_cv_lib_z_deflate=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 -$as_echo "$ac_cv_lib_z_deflate" >&6; } -if test "x$ac_cv_lib_z_deflate" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBZ 1 -_ACEOF - - LIBS="-lz $LIBS" - +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - ZLIBMISSING=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - -if test "x$ZLIBMISSING" = "xtrue";then - echo - echo "ERROR:" - echo "You need zlib to compile swftools" - echo - exit + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" fi - -{ $as_echo "$as_me:$LINENO: checking for jpeg_write_raw_data in -ljpeg" >&5 -$as_echo_n "checking for jpeg_write_raw_data in -ljpeg... " >&6; } -if test "${ac_cv_lib_jpeg_jpeg_write_raw_data+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ljpeg $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char jpeg_write_raw_data (); -int -main () -{ -return jpeg_write_raw_data (); - ; - return 0; -} + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_jpeg_jpeg_write_raw_data=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_jpeg_jpeg_write_raw_data=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f conftest.make fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_write_raw_data" >&5 -$as_echo "$ac_cv_lib_jpeg_jpeg_write_raw_data" >&6; } -if test "x$ac_cv_lib_jpeg_jpeg_write_raw_data" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBJPEG 1 -_ACEOF - - LIBS="-ljpeg $LIBS" - +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= else - JPEGLIBMISSING=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" fi - -{ $as_echo "$as_me:$LINENO: checking for DGifOpen in -lungif" >&5 -$as_echo_n "checking for DGifOpen in -lungif... " >&6; } -if test "${ac_cv_lib_ungif_DGifOpen+set}" = set; then + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lungif $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char DGifOpen (); -int -main () -{ -return DGifOpen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_ungif_DGifOpen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ungif_DGifOpen=no -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_DGifOpen" >&5 -$as_echo "$ac_cv_lib_ungif_DGifOpen" >&6; } -if test "x$ac_cv_lib_ungif_DGifOpen" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUNGIF 1 -_ACEOF + done +IFS=$as_save_IFS - LIBS="-lungif $LIBS" +rm -rf conftest.one conftest.two conftest.dir -else - UNGIFMISSING=true fi - -if test "$UNGIFMISSING";then - UNGIFMISSING= - -{ $as_echo "$as_me:$LINENO: checking for DGifOpen in -lgif" >&5 -$as_echo_n "checking for DGifOpen in -lgif... " >&6; } -if test "${ac_cv_lib_gif_DGifOpen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgif $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char DGifOpen (); -int -main () -{ -return DGifOpen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_gif_DGifOpen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_gif_DGifOpen=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gif_DGifOpen" >&5 -$as_echo "$ac_cv_lib_gif_DGifOpen" >&6; } -if test "x$ac_cv_lib_gif_DGifOpen" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGIF 1 -_ACEOF - - LIBS="-lgif $LIBS" - -else - UNGIFMISSING=true -fi - -fi - - -{ $as_echo "$as_me:$LINENO: checking for byte order" >&5 -$as_echo_n "checking for byte order... " >&6; } -if test "$cross_compiling" = yes; then - CROSSCOMPILE=1 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int main (int argc, char *argv[]) -{ - int i = 1; - return *(char*)&i; -} - -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - BIGENDIAN=1 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -LITTLEENDIAN=1 -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -export CROSSCOMPILE - -if test "x${CROSSCOMPILE}" = "x1"; then - { $as_echo "$as_me:$LINENO: result: we are cross compiling- trying to guess from system type" >&5 -$as_echo "we are cross compiling- trying to guess from system type" >&6; } - { $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - { $as_echo "$as_me:$LINENO: checking for byte order, try 2" >&5 -$as_echo_n "checking for byte order, try 2... " >&6; } - case "${target}" in - *86* | *-pc-* ) - LITTLEENDIAN=1 - ;; - *sparc* | *68* | *88k* | *mac* | *Mac* | *sun* | *Sun* | *Amiga* | *amiga* ) - BIGENDIAN=1 - ;; - esac -fi - -export LITTLEENDIAN -if test "x${LITTLEENDIAN}" = "x1"; then -{ $as_echo "$as_me:$LINENO: result: little endian" >&5 -$as_echo "little endian" >&6; } -BYTEORDERCHECKOK=1 -fi -export BIGENDIAN -if test "x${BIGENDIAN}" = "x1"; then -{ $as_echo "$as_me:$LINENO: result: big endian" >&5 -$as_echo "big endian" >&6; } -BYTEORDERCHECKOK=1 -WORDS_BIGENDIAN=1 -export WORDS_BIGENDIAN - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - -fi -if test "x${BYTEORDERCHECKOK}" != "x1"; then -{ $as_echo "$as_me:$LINENO: result: unknown" >&5 -$as_echo "unknown" >&6; } -echo Byte order could not determined. -exit 1 -fi - - - -{ $as_echo "$as_me:$LINENO: checking whether system() can handle command substitution" >&5 -$as_echo_n "checking whether system() can handle command substitution... " >&6; } -if test "$cross_compiling" = yes; then - CROSSCOMPILE=1 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include "stdlib.h" -int main (int argc, char*argv[]) -{ - return system("test `touch config.tmp2`"); -} - -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - OK=OK -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - -if test "x${OK}" = "xOK";then - test -f config.tmp2 || OK= -fi - -if test "x${CROSSCOMPILE}" = "x1";then - OK=no; -fi -if test "x${OK}" = "xOK";then -rm -f config.tmp2 -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -SYSTEM_BACKTICKS=1 -export SYSTEM_BACKTICKS - -cat >>confdefs.h <<\_ACEOF -#define SYSTEM_BACKTICKS 1 -_ACEOF - -else -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - - - ac_config_headers="$ac_config_headers config.h" - - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_opendir=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_opendir=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - - -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - - # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - - - - - - - - - - - -for ac_header in zlib.h gif_lib.h io.h wchar.h jpeglib.h assert.h signal.h pthread.h sys/stat.h sys/mman.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h sys/time.h sys/resource.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - - - - - - - - { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_const=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_const=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const /**/ -_ACEOF - -fi - - { $as_echo "$as_me:$LINENO: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - - { $as_echo "$as_me:$LINENO: checking for off_t" >&5 -$as_echo_n "checking for off_t... " >&6; } -if test "${ac_cv_type_off_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_off_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((off_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_off_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -$as_echo "$ac_cv_type_off_t" >&6; } -if test "x$ac_cv_type_off_t" = x""yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF - -fi - - { $as_echo "$as_me:$LINENO: checking for size_t" >&5 -$as_echo_n "checking for size_t... " >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_size_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((size_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -$as_echo "$ac_cv_type_size_t" >&6; } -if test "x$ac_cv_type_size_t" = x""yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - - { $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_struct_tm=time.h -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_struct_tm=sys/time.h -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF - -fi - - { $as_echo "$as_me:$LINENO: checking for boolean" >&5 -$as_echo_n "checking for boolean... " >&6; } -if test "${ac_cv_type_boolean+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_boolean=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (boolean)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((boolean))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_boolean=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_boolean" >&5 -$as_echo "$ac_cv_type_boolean" >&6; } -if test "x$ac_cv_type_boolean" = x""yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define boolean int -_ACEOF - -fi - #needed for jpeglib - - - - - - - - - - - - - - - -for ac_func in popen wcschr wcsdup mkstemp stat mmap lrand48 rand srand48 srand bcopy bzero time getrusage mallinfo -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of signed char" >&5 -$as_echo_n "checking size of signed char... " >&6; } -if test "${ac_cv_sizeof_signed_char+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed char))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed char))) < 0)]; -test_array [0] = 0 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed char))) >= $ac_mid)]; -test_array [0] = 0 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done + for ac_prog in gzip uncompress compress +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_UNCOMPRESS+set}" = set; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid + if test -n "$UNCOMPRESS"; then + ac_cv_prog_UNCOMPRESS="$UNCOMPRESS" # Let the user override the test. else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_UNCOMPRESS="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -case $ac_lo in -?*) ac_cv_sizeof_signed_char=$ac_lo;; -'') if test "$ac_cv_type_signed_char" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed char) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed char) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed_char=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (signed char)); } -static unsigned long int ulongval () { return (long int) (sizeof (signed char)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (signed char))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (signed char)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (signed char)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_signed_char=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + done +IFS=$as_save_IFS -( exit $ac_status ) -if test "$ac_cv_type_signed_char" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed char) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed char) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed_char=0 - fi fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.val +UNCOMPRESS=$ac_cv_prog_UNCOMPRESS +if test -n "$UNCOMPRESS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNCOMPRESS" >&5 +$as_echo "$UNCOMPRESS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_char" >&5 -$as_echo "$ac_cv_sizeof_signed_char" >&6; } + test -n "$UNCOMPRESS" && break +done -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char -_ACEOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of signed short" >&5 -$as_echo_n "checking size of signed short... " >&6; } -if test "${ac_cv_sizeof_signed_short+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed short))) >= 0)]; -test_array [0] = 0 +OBJEXT="o" +AREXT=".a" +CXXLIBS="-lstdc++" - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed short))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +if test "x$EXEEXT" = "x.exe";then + OBJEXT="obj" + AREXT=".lib" + CXXLIBS="" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed short))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed short))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target system" >&5 +$as_echo_n "checking for target system... " >&6; } +CYGWIN= +MINGW= +case $host_os in + *cygwin* ) CYGWIN=yes;; + *mingw* ) MINGW=yes;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +AR=ar +if test "x$MINGW" = "xyes"; then + #fix for the debian distribution of mingw + if test -x "/usr/i586-mingw32msvc/bin/ar";then + AR="/usr/i586-mingw32msvc/bin/ar" + fi + if test -x "/usr/i586-mingw32msvc/bin/ranlib";then + RANLIB="/usr/i586-mingw32msvc/bin/ranlib" + fi + #fix for the gentoo distribution of mingw + if test -x "/opt/xmingw/bin/i386-mingw32msvc-ar";then + AR="/opt/xmingw/bin/i386-mingw32msvc-ar" + fi + if test -x "/opt/xmingw/bin/i386-mingw32msvc-ranlib";then + RANLIB="/opt/xmingw/bin/i386-mingw32msvc-ranlib" + fi + if test -x "/opt/xmingw/bin/i386-mingw32msvc-strip";then + STRIP="/opt/xmingw/bin/i386-mingw32msvc-strip" + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi +if test "x${CYGWIN}" = "xyes"; then -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed short))) <= $ac_mid)]; -test_array [0] = 0 +$as_echo "#define CYGWIN 1" >>confdefs.h - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cygwin" >&5 +$as_echo "cygwin" >&6; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "x${MINGW}" = "xyes"; then + +$as_echo "#define MINGW 1" >>confdefs.h + + WIN32=1 + +$as_echo "#define WIN32 1" >>confdefs.h + + LIBS="$LIBS -lws2_32 -lgdi32" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: mingw" >&5 +$as_echo "mingw" >&6; } + else + LINUX=1 + export LINUX + +$as_echo "#define LINUX 1" >>confdefs.h - ac_lo=`expr '(' $ac_mid ')' + 1` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 +$as_echo "" >&6; } + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_signed_short=$ac_lo;; -'') if test "$ac_cv_type_signed_short" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed short) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed short) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed_short=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (signed short)); } -static unsigned long int ulongval () { return (long int) (sizeof (signed short)); } -#include -#include -int -main () -{ - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (signed short))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (signed short)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (signed short)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; +if test "x${MINGW}" != "xyes"; then + # no mingW - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_signed_short=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define O_BINARY 0" >>confdefs.h -( exit $ac_status ) -if test "$ac_cv_type_signed_short" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed short) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed short) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed_short=0 - fi +else + # mingW + SLEXT="dll" + CXXLIBS="" +fi +export SLEXT + + + +# The following tries to make use of includes and libraries in +# /usr/local, too. Notice: A -I/usr/local/include might break +# things (MingW, cross-compiling etc.) in the same way as -I/usr/include, +# especially on systems which link /usr/local to /usr, so it has yet +# to be seen how useful this is. +if test -d /usr/local/lib; then + LDFLAGS="$LDFLAGS -L/usr/local/lib" fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +if test -d /usr/local/include; then +# Leave that alone. It's causing trouble e.g. with gcc 3.2 on gentoo. +# CPPFLAGS="$CPPFLAGS -I/usr/local/include" + echo > /dev/null fi -rm -f conftest.val +if test "$prefix" != "NONE" -a "$prefix" != "/usr/local" -a "$prefix" != "/usr/local/"; then + # if the user has a special prefix (like /opt), there might also be $prefix/lib + # and $prefix/include, which should be included in our search paths for libraries + # and includes. + LDFLAGS="$LDFLAGS -L${libdir}" + CPPFLAGS="$CPPFLAGS -I${includedir}" + # TODO- test whether gcc still works after this fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_short" >&5 -$as_echo "$ac_cv_sizeof_signed_short" >&6; } +#Mac OS: +#LDFLAGS "-L/sw/lib" ; CPPFLAGS "-I/sw/include -I/sw/include/lame" -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIGNED_SHORT $ac_cv_sizeof_signed_short -_ACEOF +# this must be done after (I believe) AC_PROG_MAKE_SET +if test "x$DEBUG" '!=' "x" -o "x$STRIP" = "x";then + if test "$MACOSX";then + STRIP=dsymutil + else + STRIP="@echo debug enabled, not stripping " + fi + export STRIP +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of signed" >&5 -$as_echo_n "checking size of signed... " >&6; } -if test "${ac_cv_sizeof_signed+set}" = set; then + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 +$as_echo_n "checking for sin in -lm... " >&6; } +if test "${ac_cv_lib_m_sin+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sin (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (signed))) >= 0)]; -test_array [0] = 0 - +return sin (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_sin=yes +else + ac_cv_lib_m_sin=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 +$as_echo "$ac_cv_lib_m_sin" >&6; } +if test "x$ac_cv_lib_m_sin" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break + LIBS="-lm $LIBS" + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + echo "Error: Math library not found."; + exit; - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 +$as_echo_n "checking for deflate in -lz... " >&6; } +if test "${ac_cv_lib_z_deflate+set}" = set; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char deflate (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (signed))) >= $ac_mid)]; -test_array [0] = 0 - +return deflate (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_deflate=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= + ac_cv_lib_z_deflate=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 +$as_echo "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid + LIBS="-lz $LIBS" + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ZLIBMISSING=true +fi - ac_lo=`expr '(' $ac_mid ')' + 1` + +if test "x$ZLIBMISSING" = "xtrue";then + echo + echo "ERROR:" + echo "You need zlib to compile swftools" + echo + exit fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_signed=$ac_lo;; -'') if test "$ac_cv_type_signed" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed=0 - fi ;; -esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PDF_open_file in -lpdf" >&5 +$as_echo_n "checking for PDF_open_file in -lpdf... " >&6; } +if test "${ac_cv_lib_pdf_PDF_open_file+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpdf $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (signed)); } -static unsigned long int ulongval () { return (long int) (sizeof (signed)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (signed))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (signed)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (signed)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_signed=`cat conftest.val` +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char PDF_open_file (); +int +main () +{ +return PDF_open_file (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pdf_PDF_open_file=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_signed" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + ac_cv_lib_pdf_PDF_open_file=no fi -rm -f conftest.val +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed" >&5 -$as_echo "$ac_cv_sizeof_signed" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIGNED $ac_cv_sizeof_signed +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pdf_PDF_open_file" >&5 +$as_echo "$ac_cv_lib_pdf_PDF_open_file" >&6; } +if test "x$ac_cv_lib_pdf_PDF_open_file" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPDF 1 _ACEOF + LIBS="-lpdf $LIBS" -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of signed long long" >&5 -$as_echo_n "checking size of signed long long... " >&6; } -if test "${ac_cv_sizeof_signed_long_long+set}" = set; then +else + PDFLIBMISSING=true +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_write_raw_data in -ljpeg" >&5 +$as_echo_n "checking for jpeg_write_raw_data in -ljpeg... " >&6; } +if test "${ac_cv_lib_jpeg_jpeg_write_raw_data+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char jpeg_write_raw_data (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (signed long long))) >= 0)]; -test_array [0] = 0 - +return jpeg_write_raw_data (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_jpeg_jpeg_write_raw_data=yes +else + ac_cv_lib_jpeg_jpeg_write_raw_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_write_raw_data" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_write_raw_data" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_write_raw_data" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBJPEG 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + LIBS="-ljpeg $LIBS" + +else + JPEGLIBMISSING=true +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lungif" >&5 +$as_echo_n "checking for DGifOpen in -lungif... " >&6; } +if test "${ac_cv_lib_ungif_DGifOpen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lungif $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char DGifOpen (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (signed long long))) <= $ac_mid)]; -test_array [0] = 0 - +return DGifOpen (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ungif_DGifOpen=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_cv_lib_ungif_DGifOpen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifOpen" >&5 +$as_echo "$ac_cv_lib_ungif_DGifOpen" >&6; } +if test "x$ac_cv_lib_ungif_DGifOpen" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUNGIF 1 +_ACEOF + + LIBS="-lungif $LIBS" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + UNGIFMISSING=true +fi - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if test "$UNGIFMISSING";then + UNGIFMISSING= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lgif" >&5 +$as_echo_n "checking for DGifOpen in -lgif... " >&6; } +if test "${ac_cv_lib_gif_DGifOpen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgif $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char DGifOpen (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (signed long long))) < 0)]; -test_array [0] = 0 - +return DGifOpen (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gif_DGifOpen=yes +else + ac_cv_lib_gif_DGifOpen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifOpen" >&5 +$as_echo "$ac_cv_lib_gif_DGifOpen" >&6; } +if test "x$ac_cv_lib_gif_DGifOpen" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGIF 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + + LIBS="-lgif $LIBS" + +else + UNGIFMISSING=true +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzip_file_open in -lzzip" >&5 +$as_echo_n "checking for zzip_file_open in -lzzip... " >&6; } +if test "${ac_cv_lib_zzip_zzip_file_open+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lzzip $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zzip_file_open (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (signed long long))) >= $ac_mid)]; -test_array [0] = 0 - +return zzip_file_open (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_zzip_zzip_file_open=yes +else + ac_cv_lib_zzip_zzip_file_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zzip_zzip_file_open" >&5 +$as_echo "$ac_cv_lib_zzip_zzip_file_open" >&6; } +if test "x$ac_cv_lib_zzip_zzip_file_open" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZZIP 1 +_ACEOF + + LIBS="-lzzip $LIBS" + +else + ZZIPMISSING=true +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for byte order" >&5 +$as_echo_n "checking for byte order... " >&6; } +if test "$cross_compiling" = yes; then : + CROSSCOMPILE=1 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int main (int argc, char *argv[]) +{ + int i = 1; + return *(char*)&i; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + BIGENDIAN=1 +else + LITTLEENDIAN=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +export CROSSCOMPILE + +if test "x${CROSSCOMPILE}" = "x1"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: we are cross compiling- trying to guess from system type" >&5 +$as_echo "we are cross compiling- trying to guess from system type" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for byte order, try 2" >&5 +$as_echo_n "checking for byte order, try 2... " >&6; } + case "${target}" in + *86* | *-pc-* ) + LITTLEENDIAN=1 + ;; + *sparc* | *68* | *88k* | *mac* | *Mac* | *sun* | *Sun* | *Amiga* | *amiga* ) + BIGENDIAN=1 + ;; + esac +fi - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +export LITTLEENDIAN +if test "x${LITTLEENDIAN}" = "x1"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: little endian" >&5 +$as_echo "little endian" >&6; } +BYTEORDERCHECKOK=1 fi +export BIGENDIAN +if test "x${BIGENDIAN}" = "x1"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: big endian" >&5 +$as_echo "big endian" >&6; } +BYTEORDERCHECKOK=1 +WORDS_BIGENDIAN=1 +export WORDS_BIGENDIAN -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h - ac_lo= ac_hi= fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x${BYTEORDERCHECKOK}" != "x1"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } +echo Byte order could not determined. +exit 1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (signed long long))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_signed_long_long=$ac_lo;; -'') if test "$ac_cv_type_signed_long_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed long long) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed long long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed_long_long=0 - fi ;; -esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system() can handle command substitution" >&5 +$as_echo_n "checking whether system() can handle command substitution... " >&6; } +if test "$cross_compiling" = yes; then : + CROSSCOMPILE=1 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (signed long long)); } -static unsigned long int ulongval () { return (long int) (sizeof (signed long long)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (signed long long))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (signed long long)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (signed long long)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - ; - return 0; +#include "stdlib.h" +int main (int argc, char*argv[]) +{ + return system("test `touch config.tmp2`"); } + _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_signed_long_long=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : + OK=OK +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -( exit $ac_status ) -if test "$ac_cv_type_signed_long_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (signed long long) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (signed long long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_signed_long_long=0 - fi + +if test "x${OK}" = "xOK";then + test -f config.tmp2 || OK= fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + +if test "x${CROSSCOMPILE}" = "x1";then + OK=no; fi -rm -f conftest.val +if test "x${OK}" = "xOK";then +rm -f config.tmp2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +SYSTEM_BACKTICKS=1 +export SYSTEM_BACKTICKS + +$as_echo "#define SYSTEM_BACKTICKS 1" >>confdefs.h + +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_signed_long_long" >&5 -$as_echo "$ac_cv_sizeof_signed_long_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIGNED_LONG_LONG $ac_cv_sizeof_signed_long_long -_ACEOF +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of void*" >&5 -$as_echo_n "checking size of void*... " >&6; } -if test "${ac_cv_sizeof_voidp+set}" = set; then + ac_config_headers="$ac_config_headers config.h" + + ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) >= 0)]; -test_array [0] = 0 +#include +#include <$ac_hdr> - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) <= $ac_mid)]; -test_array [0] = 0 - +if ((DIR *) 0) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +ac_header_dirent=$ac_hdr; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) < 0)]; -test_array [0] = 0 - +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then : + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) >= $ac_mid)]; -test_array [0] = 0 - +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then : + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then : -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_path_GREP=$GREP +fi - ac_lo=`expr '(' $ac_mid ')' + 1` fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_voidp=$ac_lo;; -'') if test "$ac_cv_type_voidp" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" else - ac_cv_sizeof_voidp=0 - fi ;; + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (void*)); } -static unsigned long int ulongval () { return (long int) (sizeof (void*)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (void*))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (void*)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (void*)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_voidp=`cat conftest.val` + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_path_EGREP=$EGREP +fi -( exit $ac_status ) -if test "$ac_cv_type_voidp" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_voidp=0 fi fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5 -$as_echo "$ac_cv_sizeof_voidp" >&6; } - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOIDP $ac_cv_sizeof_voidp -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : -# Extract the first word of "freetype-config", so it can be a program name with args. -set dummy freetype-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_FREETYPE_CONFIG+set}" = set; then - $as_echo_n "(cached) " >&6 else - case $FREETYPE_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy=""$PATH:/usr/local/bin:/sw/bin:/opt/local/bin"" -for as_dir in $as_dummy -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_FREETYPE_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac + ac_cv_header_stdc=no fi -FREETYPE_CONFIG=$ac_cv_path_FREETYPE_CONFIG -if test -n "$FREETYPE_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $FREETYPE_CONFIG" >&5 -$as_echo "$FREETYPE_CONFIG" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +rm -f conftest* + fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : -OLDCPPFLAGS="${CPPFLAGS}" -OLDLIBS="${LIBS}" -if test "x${FREETYPE_CONFIG}" '!=' "x"; then - CPPFLAGS="$CPPFLAGS "`$FREETYPE_CONFIG --cflags` -else if test -d /usr/include/freetype2; then - CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2" -else if test -d /usr/local/include/freetype2; then - CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2" -fi +else + ac_cv_header_stdc=no fi +rm -f conftest* + fi -if test "x${FREETYPE_CONFIG}" '=' "x";then - # if we didn't find the freetype-config program, we won't - # know where the libs are expected to be. So just blindly - # try to link against them. - { $as_echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5 -$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } -if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then - $as_echo_n "(cached) " >&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfreetype $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif -char FT_Init_FreeType (); + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { -return FT_Init_FreeType (); - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_freetype_FT_Init_FreeType=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : - ac_cv_lib_freetype_FT_Init_FreeType=no +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 -$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } -if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then - HAVE_LIB_FREETYPE=1 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -for ac_header in ft2build.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + # On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + +fi + +done + + +for ac_header in zlib.h gif_lib.h io.h wchar.h jpeglib.h assert.h signal.h pthread.h sys/stat.h sys/mman.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h sys/time.h sys/resource.h pdflib.h zzip/lib.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +done -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - HAVE_FT2BUILD_H=1 -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -done +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; -if test "x${HAVE_FT2BUILD_H}" '=' "x";then + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif -for ac_header in freetype/freetype.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + ac_cv_c_const=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +$as_echo "#define const /**/" >>confdefs.h -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - HAVE_FREETYPE_FREETYPE_H=1 +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } -if test "x${HAVE_LIB_FREETYPE}" '!=' "x" -o \ - "x${FREETYPE_CONFIG}" '!=' "x";then - if test "x${HAVE_FREETYPE_FREETYPE_H}" '!=' "x";then - HAVE_FREETYPE=1 - fi - if test "x${HAVE_FT2BUILD_H}" '!=' "x";then - HAVE_FREETYPE=1 - fi -fi - -if test "x${HAVE_FREETYPE}" = "x1"; then - if test "x${FREETYPE_CONFIG}" '!=' "x"; then - LIBS="$LIBS "`$FREETYPE_CONFIG --libs` - else - LIBS="$LIBS -lfreetype" - fi - - if test "x${HAVE_FT2BUILD_H}" = "x1"; then - HAVE_FT2BUILD_H_DEFINE='#define HAVE_FT2BUILD_H' - fi - - { $as_echo "$as_me:$LINENO: checking whether we can compile the freetype test program" >&5 -$as_echo_n "checking whether we can compile the freetype test program... " >&6; } - - cat > conftest.c << EOF -$HAVE_FT2BUILD_H_DEFINE - -#ifdef HAVE_FT2BUILD_H -#include -#include FT_FREETYPE_H -#include FT_GLYPH_H -#include FT_SIZES_H -#include FT_SFNT_NAMES_H -#include FT_TRUETYPE_IDS_H -#include FT_OUTLINE_H -#else -#include -#include -#include -#include -#include -#include +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val #endif - -int main() -{ - FT_Library ftlibrary; - FT_Face face; - FT_Error error; - FT_ULong charcode; - FT_UInt gindex; - FT_Glyph glyph; - FT_BBox bbox; - FT_Matrix matrix; - FT_UInt i; - char* name = 0; - char italic, bold; - - FT_Init_FreeType(&ftlibrary); - FT_New_Face(ftlibrary, "filename", 0, &face); - i = face->num_glyphs - 1; - italic = face->style_flags&FT_STYLE_FLAG_ITALIC; - bold = face->style_flags&FT_STYLE_FLAG_BOLD; - FT_Get_Postscript_Name(face); - FT_Get_Char_Index(face, 33); - FT_Get_First_Char(face, &i); - FT_Get_Next_Char(face, 33, &i); - if(FT_HAS_GLYPH_NAMES(face)) { - FT_Get_Glyph_Name(face, 33, name, 127); - } - FT_Load_Glyph(face, 33, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE); - FT_Get_Glyph(face->glyph, &glyph); - FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &bbox); - FT_Done_Glyph(glyph); - FT_Done_Face(face); - FT_Done_FreeType(ftlibrary); - return 0; -} -EOF - - ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}' - if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FREETYPE 1 _ACEOF + ;; +esac + ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = x""yes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_FREETYPE_FREETYPE_H 1 -_ACEOF - +else -cat >>confdefs.h <<\_ACEOF -#define USE_FREETYPE 1 +cat >>confdefs.h <<_ACEOF +#define off_t long int _ACEOF - # for ttf2tp1 - else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 - HAVE_FREETYPE=0 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - fi - rm -f conftest* -fi -# if the above didn't work out, reset all changes to the compiler variables. -if test "x${HAVE_FREETYPE}" '!=' "x1"; then - CPPFLAGS=$OLDCPPFLAGS - LIBS=$OLDLIBS fi + ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : +else -OLDCPPFLAGS="${CPPFLAGS}" -OLDLIBS="${LIBS}" +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF -if test -d /usr/include/fontconfig; then - CPPFLAGS="$CPPFLAGS -I/usr/include/fontconfig" fi -{ $as_echo "$as_me:$LINENO: checking for FcInit in -lfontconfig" >&5 -$as_echo_n "checking for FcInit in -lfontconfig... " >&6; } -if test "${ac_cv_lib_fontconfig_FcInit+set}" = set; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test "${ac_cv_struct_tm+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfontconfig $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char FcInit (); int main () { -return FcInit (); +struct tm tm; + int *p = &tm.tm_sec; + return !p; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_fontconfig_FcInit=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + + ac_fn_c_check_type "$LINENO" "boolean" "ac_cv_type_boolean" "$ac_includes_default" +if test "x$ac_cv_type_boolean" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define boolean int +_ACEOF - ac_cv_lib_fontconfig_FcInit=no fi + #needed for jpeglib + for ac_func in popen wcschr wcsdup mkstemp stat mmap lrand48 rand srand48 srand bcopy bzero time getrusage mallinfo open64 calloc +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcInit" >&5 -$as_echo "$ac_cv_lib_fontconfig_FcInit" >&6; } -if test "x$ac_cv_lib_fontconfig_FcInit" = x""yes; then - HAVE_LIB_FONTCONFIG=1 fi +done -for ac_header in fontconfig.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed char" >&5 +$as_echo_n "checking size of signed char... " >&6; } +if test "${ac_cv_sizeof_signed_char+set}" = set; then : $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed char))" "ac_cv_sizeof_signed_char" "$ac_includes_default"; then : - ac_header_compiler=no +else + if test "$ac_cv_type_signed_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (signed char) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_signed_char=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_char" >&5 +$as_echo "$ac_cv_sizeof_signed_char" >&6; } -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char +_ACEOF -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed short" >&5 +$as_echo_n "checking size of signed short... " >&6; } +if test "${ac_cv_sizeof_signed_short+set}" = set; then : $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed short))" "ac_cv_sizeof_signed_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_signed_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (signed short) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_signed_short=0 + fi fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_short" >&5 +$as_echo "$ac_cv_sizeof_signed_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_SHORT $ac_cv_sizeof_signed_short _ACEOF - HAVE_FONTCONFIG_H=1 -fi -done +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed" >&5 +$as_echo_n "checking size of signed... " >&6; } +if test "${ac_cv_sizeof_signed+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed))" "ac_cv_sizeof_signed" "$ac_includes_default"; then : -if test "x${HAVE_LIB_FONTCONFIG}" != "x";then -if test "x${HAVE_FONTCONFIG_H}" != "x";then - HAVE_FONTCONFIG=1 +else + if test "$ac_cv_type_signed" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (signed) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_signed=0 + fi fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed" >&5 +$as_echo "$ac_cv_sizeof_signed" >&6; } -if test "x${HAVE_FONTCONFIG}" = "x1"; then - LIBS="$LIBS -lfontconfig" -{ $as_echo "$as_me:$LINENO: checking whether we can compile the fontconfig test program" >&5 -$as_echo_n "checking whether we can compile the fontconfig test program... " >&6; } -if (echo $LIBS | grep lfreetype >/dev/null 2>&1); then - #move freetype library to the end of libraries, otherwise fontconfig - #won't compile. - LIBS=`echo $LIBS | sed -e 's/-lfreetype//g' -e 's/$/ -lfreetype/'` -fi -cat > conftest.c << EOF -#include -#include +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED $ac_cv_sizeof_signed +_ACEOF -int main() -{ - FcPattern *pattern, *match; - FcResult result; - FcChar8 *v; - char*s1="abc",*s2="ABC"; - strcasecmp(s1,s2); - FcInit(); - pattern = FcPatternBuild(0, FC_FAMILY, FcTypeString, "", 0); - FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); - FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); - FcConfig*c = FcConfigCreate(); - FcConfigParseAndLoad(c, (FcChar8*)"", 1); - FcConfigBuildFonts(c); - FcConfigSetCurrent(c); +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed long long" >&5 +$as_echo_n "checking size of signed long long... " >&6; } +if test "${ac_cv_sizeof_signed_long_long+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed long long))" "ac_cv_sizeof_signed_long_long" "$ac_includes_default"; then : - FcFontSet * set = FcConfigGetFonts(c, FcSetSystem); - FcFontSetDestroy(set); +else + if test "$ac_cv_type_signed_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (signed long long) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_signed_long_long=0 + fi +fi - FcConfigSubstitute(0, pattern, FcMatchPattern); - FcDefaultSubstitute(pattern); - match = FcFontMatch(0, pattern, &result); - FcPatternGetString(match, "family", 0, &v) == FcResultMatch; - FcPatternGetBool(match, "family", 0, &v) == FcResultMatch; - FcPatternPrint(pattern); - FcPatternDestroy(pattern); - FcPatternDestroy(match); - FcFini(); - return 0; -} -EOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_long_long" >&5 +$as_echo "$ac_cv_sizeof_signed_long_long" >&6; } - ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}' - if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define HAVE_FONTCONFIG 1 + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIGNED_LONG_LONG $ac_cv_sizeof_signed_long_long _ACEOF - else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 - HAVE_FONTCONFIG=0 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - fi - rm -f conftest* + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 +$as_echo_n "checking size of void*... " >&6; } +if test "${ac_cv_sizeof_voidp+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_voidp" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (void*) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_voidp=0 + fi fi -# if the above didn't work out, reset all changes to the compiler variables. -if test "x${HAVE_FONTCONFIG}" "!=" "x1"; then - CPPFLAGS=$OLDCPPFLAGS - LIBS=$OLDLIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 +$as_echo "$ac_cv_sizeof_voidp" >&6; } -OLDCPPFLAGS="${CPPFLAGS}" -OLDLIBS="${LIBS}" +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOIDP $ac_cv_sizeof_voidp +_ACEOF + + -{ $as_echo "$as_me:$LINENO: checking for glBegin in -lGL" >&5 -$as_echo_n "checking for glBegin in -lGL... " >&6; } -if test "${ac_cv_lib_GL_glBegin+set}" = set; then + +# Extract the first word of "freetype-config", so it can be a program name with args. +set dummy freetype-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_FREETYPE_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lGL $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + case $FREETYPE_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy=""$PATH:/usr/local/bin:/sw/bin:/opt/local/bin"" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_FREETYPE_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char glBegin (); -int -main () -{ -return glBegin (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + ;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_GL_glBegin=yes +fi +FREETYPE_CONFIG=$ac_cv_path_FREETYPE_CONFIG +if test -n "$FREETYPE_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_CONFIG" >&5 +$as_echo "$FREETYPE_CONFIG" >&6; } else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_GL_glBegin=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glBegin" >&5 -$as_echo "$ac_cv_lib_GL_glBegin" >&6; } -if test "x$ac_cv_lib_GL_glBegin" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGL 1 -_ACEOF - LIBS="-lGL $LIBS" +OLDCPPFLAGS="${CPPFLAGS}" +OLDLIBS="${LIBS}" +if test "x${FREETYPE_CONFIG}" '!=' "x"; then + CPPFLAGS="$CPPFLAGS "`$FREETYPE_CONFIG --cflags` +else if test -d /usr/include/freetype2; then + CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2" +else if test -d /usr/local/include/freetype2; then + CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2" +fi +fi fi - -{ $as_echo "$as_me:$LINENO: checking for gluBeginSurface in -lGLU" >&5 -$as_echo_n "checking for gluBeginSurface in -lGLU... " >&6; } -if test "${ac_cv_lib_GLU_gluBeginSurface+set}" = set; then +if test "x${FREETYPE_CONFIG}" '=' "x";then + # if we didn't find the freetype-config program, we won't + # know where the libs are expected to be. So just blindly + # try to link against them. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 +$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } +if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lGLU $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-lfreetype $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -9133,375 +5868,185 @@ #ifdef __cplusplus extern "C" #endif -char gluBeginSurface (); +char FT_Init_FreeType (); int main () { -return gluBeginSurface (); +return FT_Init_FreeType (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_GLU_gluBeginSurface=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_freetype_FT_Init_FreeType=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_GLU_gluBeginSurface=no + ac_cv_lib_freetype_FT_Init_FreeType=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluBeginSurface" >&5 -$as_echo "$ac_cv_lib_GLU_gluBeginSurface" >&6; } -if test "x$ac_cv_lib_GLU_gluBeginSurface" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGLU 1 -_ACEOF - - LIBS="-lGLU $LIBS" - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 +$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } +if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then : + HAVE_LIB_FREETYPE=1 fi - -{ $as_echo "$as_me:$LINENO: checking for glutInit in -lglut" >&5 -$as_echo_n "checking for glutInit in -lglut... " >&6; } -if test "${ac_cv_lib_glut_glutInit+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lglut $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char glutInit (); -int -main () -{ -return glutInit (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_glut_glutInit=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_glut_glutInit=no fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_glut_glutInit" >&5 -$as_echo "$ac_cv_lib_glut_glutInit" >&6; } -if test "x$ac_cv_lib_glut_glutInit" = x""yes; then +for ac_header in ft2build.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default" +if test "x$ac_cv_header_ft2build_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGLUT 1 +#define HAVE_FT2BUILD_H 1 _ACEOF - - LIBS="-lglut $LIBS" - + HAVE_FT2BUILD_H=1 fi +done - -for ac_header in GL/gl.h GL/glut.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +if test "x${HAVE_FT2BUILD_H}" '=' "x";then + for ac_header in freetype/freetype.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "freetype/freetype.h" "ac_cv_header_freetype_freetype_h" "$ac_includes_default" +if test "x$ac_cv_header_freetype_freetype_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FREETYPE_FREETYPE_H 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no + HAVE_FREETYPE_FREETYPE_H=1 fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +done - ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +if test "x${HAVE_LIB_FREETYPE}" '!=' "x" -o \ + "x${FREETYPE_CONFIG}" '!=' "x";then + if test "x${HAVE_FREETYPE_FREETYPE_H}" '!=' "x";then + HAVE_FREETYPE=1 + fi + if test "x${HAVE_FT2BUILD_H}" '!=' "x";then + HAVE_FREETYPE=1 + fi +fi -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +if test "x${HAVE_FREETYPE}" = "x1"; then + if test "x${FREETYPE_CONFIG}" '!=' "x"; then + LIBS="$LIBS "`$FREETYPE_CONFIG --libs` + else + LIBS="$LIBS -lfreetype" + fi - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + if test "x${HAVE_FT2BUILD_H}" = "x1"; then + HAVE_FT2BUILD_H_DEFINE='#define HAVE_FT2BUILD_H' + fi -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the freetype test program" >&5 +$as_echo_n "checking whether we can compile the freetype test program... " >&6; } -fi + cat > conftest.c << EOF +$HAVE_FT2BUILD_H_DEFINE -done +#ifdef HAVE_FT2BUILD_H +#include +#include FT_FREETYPE_H +#include FT_GLYPH_H +#include FT_SIZES_H +#include FT_SFNT_NAMES_H +#include FT_TRUETYPE_IDS_H +#include FT_OUTLINE_H +#else +#include +#include +#include +#include +#include +#include +#endif +int main() +{ + FT_Library ftlibrary; + FT_Face face; + FT_Error error; + FT_ULong charcode; + FT_UInt gindex; + FT_Glyph glyph; + FT_BBox bbox; + FT_Matrix matrix; + FT_UInt i; + char* name = 0; + char italic, bold; -cat > conftest.c << EOF -#include -#include -#include - -int main(int argc, char*argv) -{ - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); - glutInitWindowSize(320,200); - glutInitWindowPosition(0,0); - glutCreateWindow("main"); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glShadeModel(GL_SMOOTH); - glEnable (GL_LINE_SMOOTH); - glEnable (GL_POLYGON_SMOOTH); - glEnable (GL_BLEND); - glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE); - glHint (GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE); + FT_Init_FreeType(&ftlibrary); + FT_New_Face(ftlibrary, "filename", 0, &face); + i = face->num_glyphs - 1; + italic = face->style_flags&FT_STYLE_FLAG_ITALIC; + bold = face->style_flags&FT_STYLE_FLAG_BOLD; + FT_Get_Postscript_Name(face); + FT_Get_Char_Index(face, 33); + FT_Get_First_Char(face, &i); + FT_Get_Next_Char(face, 33, &i); + if(FT_HAS_GLYPH_NAMES(face)) { + FT_Get_Glyph_Name(face, 33, name, 127); + } + FT_Load_Glyph(face, 33, FT_LOAD_NO_BITMAP|FT_LOAD_NO_SCALE); + FT_Get_Glyph(face->glyph, &glyph); + FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_unscaled, &bbox); + FT_Done_Glyph(glyph); + FT_Done_Face(face); + FT_Done_FreeType(ftlibrary); + return 0; } EOF -{ $as_echo "$as_me:$LINENO: checking whether we can compile the opengl test program" >&5 -$as_echo_n "checking whether we can compile the opengl test program... " >&6; } - -ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}' -if { (eval echo opengl.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}' + if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - HAVE_OPENGL=1 - -cat >>confdefs.h <<\_ACEOF -#define HAVE_OPENGL 1 -_ACEOF -else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 - HAVE_OPENGL= - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f conftest* +$as_echo "#define HAVE_FREETYPE 1" >>confdefs.h -# if the above didn't work out, reset all changes to the compiler variables. -if test "x${HAVE_OPENGL}" "!=" "x1"; then - CPPFLAGS=$OLDCPPFLAGS - LIBS=$OLDLIBS -fi -if test "$HAVE_OPENGL";then - DEVICE_OPENGL='devices/opengl.$(O)' +$as_echo "#define HAVE_FREETYPE_FREETYPE_H 1" >>confdefs.h -fi -lame_in_source= -lame_makefile= -if test "x${DISABLE_LAME}" = "xtrue"; then - echo "*" Disabling lame support... -else - # old lame code at lib/lame - if test -f lib/lame/Makefile.in; then - lame_in_source='$(lame_objects)' - lame_makefile="lib/lame/Makefile" - CPPFLAGS="$CPPFLAGS -Ilame -Ilib/lame" +$as_echo "#define USE_FREETYPE 1" >>confdefs.h + # for ttf2tp1 + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + HAVE_FREETYPE=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + rm -f conftest* +fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_LAME 1 -_ACEOF +# if the above didn't work out, reset all changes to the compiler variables. +if test "x${HAVE_FREETYPE}" '!=' "x1"; then + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS +fi - else - if test -d /usr/include/lame; then - CPPFLAGS="$CPPFLAGS -I /usr/include/lame" - else - if test -d /usr/local/include/lame; then - CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame" - fi - fi -{ $as_echo "$as_me:$LINENO: checking for lame_init in -lmp3lame" >&5 -$as_echo_n "checking for lame_init in -lmp3lame... " >&6; } -if test "${ac_cv_lib_mp3lame_lame_init+set}" = set; then + +OLDCPPFLAGS="${CPPFLAGS}" +OLDLIBS="${LIBS}" + +if test -d /usr/include/fontconfig; then + CPPFLAGS="$CPPFLAGS -I/usr/include/fontconfig" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcInit in -lfontconfig" >&5 +$as_echo_n "checking for FcInit in -lfontconfig... " >&6; } +if test "${ac_cv_lib_fontconfig_FcInit+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lmp3lame $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-lfontconfig $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -9510,455 +6055,133 @@ #ifdef __cplusplus extern "C" #endif -char lame_init (); +char FcInit (); int main () { -return lame_init (); +return FcInit (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_mp3lame_lame_init=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_fontconfig_FcInit=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_mp3lame_lame_init=no + ac_cv_lib_fontconfig_FcInit=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mp3lame_lame_init" >&5 -$as_echo "$ac_cv_lib_mp3lame_lame_init" >&6; } -if test "x$ac_cv_lib_mp3lame_lame_init" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMP3LAME 1 -_ACEOF - - LIBS="-lmp3lame $LIBS" - -else - NO_LIBMP3LAME=1 -fi - - HASLAMEHEADER= - -for ac_header in lame.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fontconfig_FcInit" >&5 +$as_echo "$ac_cv_lib_fontconfig_FcInit" >&6; } +if test "x$ac_cv_lib_fontconfig_FcInit" = x""yes; then : + HAVE_LIB_FONTCONFIG=1 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +for ac_header in fontconfig.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fontconfig.h" "ac_cv_header_fontconfig_h" "$ac_includes_default" +if test "x$ac_cv_header_fontconfig_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_FONTCONFIG_H 1 _ACEOF - HASLAMEHEADER=1 + HAVE_FONTCONFIG_H=1 fi done - if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$HASLAMEHEADER" '!=' "x";then - cat >>confdefs.h <<\_ACEOF -#define HAVE_LAME 1 -_ACEOF - - fi - fi -fi - - -art_in_source='$(art_objects)' - -cat >>confdefs.h <<\_ACEOF -#define INTERNAL_LIBART 1 -_ACEOF - - -if test "x$EXTERNAL_LIBART" = "xtrue"; then - art_in_source= -pkg_failed=no -{ $as_echo "$as_me:$LINENO: checking for LIBART" >&5 -$as_echo_n "checking for LIBART... " >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$LIBART_CFLAGS"; then - pkg_cv_LIBART_CFLAGS="$LIBART_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libart-2.0\"") >&5 - ($PKG_CONFIG --exists --print-errors "libart-2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_LIBART_CFLAGS=`$PKG_CONFIG --cflags "libart-2.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$LIBART_LIBS"; then - pkg_cv_LIBART_LIBS="$LIBART_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libart-2.0\"") >&5 - ($PKG_CONFIG --exists --print-errors "libart-2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_LIBART_LIBS=`$PKG_CONFIG --libs "libart-2.0" 2>/dev/null` -else - pkg_failed=yes +if test "x${HAVE_LIB_FONTCONFIG}" != "x";then +if test "x${HAVE_FONTCONFIG_H}" != "x";then + HAVE_FONTCONFIG=1 fi - fi -else - pkg_failed=untried fi +if test "x${HAVE_FONTCONFIG}" = "x1"; then + LIBS="$LIBS -lfontconfig" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the fontconfig test program" >&5 +$as_echo_n "checking whether we can compile the fontconfig test program... " >&6; } - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LIBART_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libart-2.0"` - else - LIBART_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libart-2.0"` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBART_PKG_ERRORS" >&5 - - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - libart_pkgconfig_libart=no -elif test $pkg_failed = untried; then - libart_pkgconfig_libart=no -else - LIBART_CFLAGS=$pkg_cv_LIBART_CFLAGS - LIBART_LIBS=$pkg_cv_LIBART_LIBS - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - : +if (echo $LIBS | grep lfreetype >/dev/null 2>&1); then + #move freetype library to the end of libraries, otherwise fontconfig + #won't compile. + LIBS=`echo $LIBS | sed -e 's/-lfreetype//g' -e 's/$/ -lfreetype/'` fi - if test "x$libart_pkgconfig_libart" = "xno"; then -for ac_header in libart_lgpl/libart.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat > conftest.c << EOF +#include +#include - ac_header_compiler=no -fi +int main() +{ + FcPattern *pattern, *match; + FcResult result; + FcChar8 *v; + char*s1="abc",*s2="ABC"; + strcasecmp(s1,s2); + FcInit(); + pattern = FcPatternBuild(0, FC_FAMILY, FcTypeString, "", 0); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); + FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } + FcConfig*c = FcConfigCreate(); + FcConfigParseAndLoad(c, (FcChar8*)"", 1); + FcConfigBuildFonts(c); + FcConfigSetCurrent(c); -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + FcFontSet * set = FcConfigGetFonts(c, FcSetSystem); + FcFontSetDestroy(set); - ac_header_preproc=no -fi + FcConfigSubstitute(0, pattern, FcMatchPattern); + FcDefaultSubstitute(pattern); + match = FcFontMatch(0, pattern, &result); + FcPatternGetString(match, "family", 0, &v) == FcResultMatch; + FcPatternGetBool(match, "family", 0, &v) == FcResultMatch; + FcPatternPrint(pattern); + FcPatternDestroy(pattern); + FcPatternDestroy(match); + FcFini(); + return 0; +} +EOF -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } + ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}' + if { (eval echo freetype.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +$as_echo "#define HAVE_FONTCONFIG 1" >>confdefs.h - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + HAVE_FONTCONFIG=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + rm -f conftest* fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +# if the above didn't work out, reset all changes to the compiler variables. +if test "x${HAVE_FONTCONFIG}" "!=" "x1"; then + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -{ $as_echo "$as_me:$LINENO: checking for art_new in -lart_lgpl_2" >&5 -$as_echo_n "checking for art_new in -lart_lgpl_2... " >&6; } -if test "${ac_cv_lib_art_lgpl_2_art_new+set}" = set; then + + OLDCPPFLAGS="${CPPFLAGS}" + OLDLIBS="${LIBS}" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftwf_plan_dft_r2c_2d in -lfftw3f" >&5 +$as_echo_n "checking for fftwf_plan_dft_r2c_2d in -lfftw3f... " >&6; } +if test "${ac_cv_lib_fftw3f_fftwf_plan_dft_r2c_2d+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lart_lgpl_2 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +LIBS="-lfftw3f $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -9967,162 +6190,197 @@ #ifdef __cplusplus extern "C" #endif -char art_new (); +char fftwf_plan_dft_r2c_2d (); int main () { -return art_new (); +return fftwf_plan_dft_r2c_2d (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_art_lgpl_2_art_new=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_fftw3f_fftwf_plan_dft_r2c_2d=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_art_lgpl_2_art_new=no + ac_cv_lib_fftw3f_fftwf_plan_dft_r2c_2d=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_art_lgpl_2_art_new" >&5 -$as_echo "$ac_cv_lib_art_lgpl_2_art_new" >&6; } -if test "x$ac_cv_lib_art_lgpl_2_art_new" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3f_fftwf_plan_dft_r2c_2d" >&5 +$as_echo "$ac_cv_lib_fftw3f_fftwf_plan_dft_r2c_2d" >&6; } +if test "x$ac_cv_lib_fftw3f_fftwf_plan_dft_r2c_2d" = x""yes; then : + HAVE_LIBFFTW3=1 +fi + + for ac_header in fftw3.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" +if test "x$ac_cv_header_fftw3_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_LIBART_LGPL_2 1 +#define HAVE_FFTW3_H 1 _ACEOF + HAVE_FFTW3_H=1 +fi - LIBS="-lart_lgpl_2 $LIBS" +done -fi + if test "x${HAVE_LIBFFTW3}" != "x";then + if test "x${HAVE_FFTW3_H}" != "x";then + HAVE_FFTW3=1 + fi + fi -else - { { $as_echo "$as_me:$LINENO: error: No libart library found. This library is required." >&5 -$as_echo "$as_me: error: No libart library found. This library is required." >&2;} - { (exit 1); exit 1; }; } -fi + if test "x${HAVE_FFTW3}" = "x1"; then + LIBS="$LIBS -lfftw3f" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the fftw3 test program" >&5 +$as_echo_n "checking whether we can compile the fftw3 test program... " >&6; } -done + cat > conftest.c << EOF + #include - else - CPPFLAGS="$CPPFLAGS $LIBART_CFLAGS" - cat >>confdefs.h <<\_ACEOF -#define INTERNAL_LIBART 0 -_ACEOF + int main() + { + char*data = fftw_malloc(sizeof(fftwf_complex)*600*800); + fftwf_plan plan = fftwf_plan_dft_2d(600, 800, (fftwf_complex*)data, (fftwf_complex*)data, FFTW_FORWARD, FFTW_ESTIMATE); + plan = fftwf_plan_dft_r2c_2d(600, 800, (float*)data, (fftwf_complex*)data, FFTW_ESTIMATE); + plan = fftwf_plan_dft_c2r_2d(600, 800, (fftwf_complex*)data, (float*)data, FFTW_ESTIMATE); + fftwf_execute(plan); + fftwf_destroy_plan(plan); + } +EOF + + ac_link='$CC $CPPFLAGS $CFLAGS conftest.c $LDFLAGS $LIBS -o conftest${ac_exeext}' + if { (eval echo fftw3.m4:71: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } - LIBS="$LIBS $LIBART_LIBS" +$as_echo "#define HAVE_FFTW3 1" >>confdefs.h + + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + HAVE_FFTW3=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -fi + rm -f conftest* + fi + # if the above didn't work out, reset all changes to the compiler variables. + if test "x${HAVE_FFTW3}" "!=" "x1"; then + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi -xpdf_in_source='$(xpdf_objects)' -splash_in_source='$(splash_objects)' -if test "x$USE_POPPLER" = "xtrue"; then - xpdf_in_source= - splash_in_source= +# RFX_CHECK_OPENGL +# if test "$HAVE_OPENGL";then +# DEVICE_OPENGL='devices/opengl.$(O)' +# AC_SUBST(DEVICE_OPENGL) +# fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_POPPLER 1 -_ACEOF +lame_in_source= +lame_makefile= +if test "x${DISABLE_LAME}" = "xtrue"; then + echo "*" Disabling lame support... +else + # old lame code at lib/lame + if test -f lib/lame/Makefile.in; then + lame_in_source='$(lame_objects)' + lame_makefile="lib/lame/Makefile" + CPPFLAGS="$CPPFLAGS -Ilame -Ilib/lame" -pkg_failed=no -{ $as_echo "$as_me:$LINENO: checking for POPPLER" >&5 -$as_echo_n "checking for POPPLER... " >&6; } +$as_echo "#define HAVE_LAME 1" >>confdefs.h -if test -n "$PKG_CONFIG"; then - if test -n "$POPPLER_CFLAGS"; then - pkg_cv_POPPLER_CFLAGS="$POPPLER_CFLAGS" else - if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler poppler-splash\"") >&5 - ($PKG_CONFIG --exists --print-errors "poppler poppler-splash") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler poppler-splash" 2>/dev/null` + if test -d /usr/include/lame; then + CPPFLAGS="$CPPFLAGS -I /usr/include/lame" + else + if test -d /usr/local/include/lame; then + CPPFLAGS="$CPPFLAGS -I /usr/local/include/lame" + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lame_init in -lmp3lame" >&5 +$as_echo_n "checking for lame_init in -lmp3lame... " >&6; } +if test "${ac_cv_lib_mp3lame_lame_init+set}" = set; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - fi + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmp3lame $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lame_init (); +int +main () +{ +return lame_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mp3lame_lame_init=yes else - pkg_failed=untried + ac_cv_lib_mp3lame_lame_init=no fi -if test -n "$PKG_CONFIG"; then - if test -n "$POPPLER_LIBS"; then - pkg_cv_POPPLER_LIBS="$POPPLER_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"poppler poppler-splash\"") >&5 - ($PKG_CONFIG --exists --print-errors "poppler poppler-splash") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_POPPLER_LIBS=`$PKG_CONFIG --libs "poppler poppler-splash" 2>/dev/null` -else - pkg_failed=yes +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mp3lame_lame_init" >&5 +$as_echo "$ac_cv_lib_mp3lame_lame_init" >&6; } +if test "x$ac_cv_lib_mp3lame_lame_init" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMP3LAME 1 +_ACEOF + + LIBS="-lmp3lame $LIBS" + else - pkg_failed=untried + NO_LIBMP3LAME=1 fi + HASLAMEHEADER= + for ac_header in lame.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "lame.h" "ac_cv_header_lame_h" "$ac_includes_default" +if test "x$ac_cv_header_lame_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LAME_H 1 +_ACEOF + HASLAMEHEADER=1 +fi +done -if test $pkg_failed = yes; then + if test "x$NO_LIBMP3LAME" "!=" "x1" -a "x$HASLAMEHEADER" '!=' "x";then + $as_echo "#define HAVE_LAME 1" >>confdefs.h -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no + fi + fi fi - if test $_pkg_short_errors_supported = yes; then - POPPLER_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "poppler poppler-splash"` - else - POPPLER_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "poppler poppler-splash"` - fi - # Put the nasty error message in config.log where it belongs - echo "$POPPLER_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - poppler_pkgconfig=no -elif test $pkg_failed = untried; then - poppler_pkgconfig=no -else - POPPLER_CFLAGS=$pkg_cv_POPPLER_CFLAGS - POPPLER_LIBS=$pkg_cv_POPPLER_LIBS - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - : -fi + +xpdf_in_source= +splash_in_source= +xpdf_include= + +if test "x$USE_POPPLER" = "xtrue"; then + +$as_echo "#define HAVE_POPPLER 1" >>confdefs.h + + #PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no]) if test "x$poppler_pkgconfig" = "xno"; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -10136,10 +6394,10 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded @@ -10154,11 +6412,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -10167,78 +6421,34 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +if $ac_preproc_ok; then : break fi @@ -10250,7 +6460,7 @@ else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes @@ -10261,11 +6471,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -10274,251 +6480,65 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -for ac_header in OutputDev.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=\$ac_header_preproc" + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +for ac_header in OutputDev.h +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "OutputDev.h" "ac_cv_header_OutputDev_h" "$ac_includes_default" +if test "x$ac_cv_header_OutputDev_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_OUTPUTDEV_H 1 _ACEOF - -{ $as_echo "$as_me:$LINENO: checking for main in -lpoppler" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpoppler" >&5 $as_echo_n "checking for main in -lpoppler... " >&6; } -if test "${ac_cv_lib_poppler_main+set}" = set; then +if test "${ac_cv_lib_poppler_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpoppler $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10530,43 +6550,18 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_poppler_main=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_poppler_main=no + ac_cv_lib_poppler_main=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_poppler_main" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_poppler_main" >&5 $as_echo "$ac_cv_lib_poppler_main" >&6; } -if test "x$ac_cv_lib_poppler_main" = x""yes; then +if test "x$ac_cv_lib_poppler_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPOPPLER 1 _ACEOF @@ -10577,9 +6572,7 @@ else - { { $as_echo "$as_me:$LINENO: error: No poppler library found. This library is required." >&5 -$as_echo "$as_me: error: No poppler library found. This library is required." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "No poppler library found. This library is required." "$LINENO" 5 fi done @@ -10591,28 +6584,52 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS" - cat >>confdefs.h <<\_ACEOF -#define HAVE_POPPLER 1 -_ACEOF - + CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS" LIBS="$LIBS $POPPLER_LIBS" + $as_echo "#define HAVE_POPPLER 1" >>confdefs.h + fi +else + splash_in_source='$(splash_objects)' + xpdf_in_source='$(xpdf_objects)' + xpdf_include=' -I xpdf ' fi + + # ------------------------------------------------------------------ +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the filesystem normalizes file names" >&5 +$as_echo_n "checking whether the filesystem normalizes file names... " >&6; } + +echo test1 > __abcdefghijklmnopqrstuvwxyz.txt +echo test2 > __ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt +if test `cat __abcdefghijklmnopqrstuvwxyz.txt` = "test2";then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define LOWERCASE_UPPERCASE 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +rm -f __abcdefghijklmnopqrstuvwxyz.txt +rm -f __ABCDEFGHIJKLMNOPQRSTUVWXYZ.txt + + for ac_prog in avifile-config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AVIFILE_CONFIG+set}" = set; then +if test "${ac_cv_prog_AVIFILE_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AVIFILE_CONFIG"; then @@ -10623,24 +6640,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do + for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AVIFILE_CONFIG="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi AVIFILE_CONFIG=$ac_cv_prog_AVIFILE_CONFIG if test -n "$AVIFILE_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $AVIFILE_CONFIG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AVIFILE_CONFIG" >&5 $as_echo "$AVIFILE_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -10653,145 +6670,12 @@ OLDCPPFLAGS="$CPPFLAGS" # temporarily add avifile paths to CPPFLAGS... CPPFLAGS="$CPPFLAGS $CXXFLAGS "`$AVIFILE_CONFIG --cflags` - - -for ac_header in avifile/version.h version.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then + for ac_header in avifile/version.h version.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -10804,7 +6688,7 @@ CPPFLAGS="$OLDCPPFLAGS" fi -{ $as_echo "$as_me:$LINENO: checking whether we can compile the avifile test program" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the avifile test program" >&5 $as_echo_n "checking whether we can compile the avifile test program... " >&6; } if test "x${ac_cv_header_version_h}" '=' "xyes";then @@ -10899,23 +6783,21 @@ AVIFILE_CFLAGS=`$AVIFILE_CONFIG --cflags` avifile_link='$CXX $CPPFLAGS $CXXFLAGS $AVIFILE_CFLAGS conftest.cpp $AVIFILE_LIBS -o conftest${ac_exeext}' if { (eval echo avi2swf.m4:71: \"$avifile_link\") 1>&5; (eval $avifile_link) 2>&5; } && test -s conftest${ac_exeext} && ./conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } AVIFILE=true export AVIFILE -cat >>confdefs.h <<\_ACEOF -#define AVIFILE true -_ACEOF +$as_echo "#define AVIFILE true" >>confdefs.h else echo "configure: failed program was:" >&5 cat conftest.cpp >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* @@ -10924,9 +6806,7 @@ VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS" VIDEO_CFLAGS="$VIDEO_CFLAGS $AVIFILE_CFLAGS" -cat >>confdefs.h <<\_ACEOF -#define HAVE_AVIFILE 1 -_ACEOF +$as_echo "#define HAVE_AVIFILE 1" >>confdefs.h fi @@ -10945,210 +6825,443 @@ if test "x${UNCOMPRESS}" = "xgzip"; then -cat >>confdefs.h <<\_ACEOF -#define USE_GZIP 1 +$as_echo "#define USE_GZIP 1" >>confdefs.h + +fi + + +# ------------------------------------------------------------------ + + +# Extract the first word of "ruby", so it can be a program name with args. +set dummy ruby; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_RUBY+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $RUBY in + [\\/]* | ?:[\\/]*) + ac_cv_path_RUBY="$RUBY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +RUBY=$ac_cv_path_RUBY +if test -n "$RUBY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY" >&5 +$as_echo "$RUBY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +RUBY_CPPFLAGS="" +RUBY_LDFLAGS="" +RUBY_LIBS="" + +rubylib=ruby18 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby's include directory" >&5 +$as_echo_n "checking for ruby's include directory... " >&6; } +if test "x$RUBY" '!=' "x";then + rubyinc=`$RUBY -e 'require "rbconfig";puts Config::expand(Config::CONFIG.send("\x5b\x5d", "archdir"))' 2>/dev/null` + if test -d $rubyinc;then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rubyinc" >&5 +$as_echo "$rubyinc" >&6; } + + # If we got a sensible archdir, we also ask ruby to supply us with CPPFLAGS + # and LDFLAGS. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby's cpp flags" >&5 +$as_echo_n "checking for ruby's cpp flags... " >&6; } + rubycpp=`$RUBY -e 'require "rbconfig";puts Config::expand(Config::CONFIG.send("\x5b\x5d", "CPPFLAGS"))' 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rubycpp" >&5 +$as_echo "$rubycpp" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby's ld flags" >&5 +$as_echo_n "checking for ruby's ld flags... " >&6; } + rubyld=`$RUBY -e 'require "rbconfig";puts Config::expand(Config::CONFIG.send("\x5b\x5d", "LIBRUBYARG_SHARED"))' 2>/dev/null` + rubyld2=`$RUBY -e 'require "rbconfig";v=Config::expand(Config::CONFIG.send("\x5b\x5d", "LIBRUBY_LDSHARED"));puts v.gsub(/^g?cc/,"")' 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$rubyld $rubyld2\"" >&5 +$as_echo "\"$rubyld $rubyld2\"" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ruby library name" >&5 +$as_echo_n "checking for ruby library name... " >&6; } + rubylib=`$RUBY -e 'require "rbconfig";puts Config::expand(Config::CONFIG.send("\x5b\x5d", "RUBY_SO_NAME"))' 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $rubylib" >&5 +$as_echo "$rubylib" >&6; } + + RUBY_CPPFLAGS="$rubycpp -I$rubyinc $RUBY_CPPFLAGS" + RUBY_LDFLAGS="$rubyld $rubyld2 $RUBY_LDFLAGS" + RUBY_INSTALLDIR="$rubyinc" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: 'unknown'" >&5 +$as_echo "'unknown'" >&6; } + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: 'unknown'" >&5 +$as_echo "'unknown'" >&6; } +fi + +#OLDLDFLAGS="$LDFLAGS" +#LDFLAGS="$LDFLAGS $RUBY_LDFLAGS" +#AC_CHECK_LIB($rubylib, rb_define_method, HAVE_RUBY_LIB=1,) +#LDFLAGS="$OLDLDFLAGS" + +OLDCPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $RUBY_CPPFLAGS" +for ac_header in ruby.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ruby.h" "ac_cv_header_ruby_h" "$ac_includes_default" +if test "x$ac_cv_header_ruby_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_RUBY_H 1 _ACEOF + HAVE_RUBY_H=1 +fi + +done + +CPPFLAGS="$OLDCPPFLAGS" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we should compile the ruby module" >&5 +$as_echo_n "checking whether we should compile the ruby module... " >&6; } +if test "x${HAVE_RUBY_H}" '!=' "x";then + #RUBY_LIBS="$RUBY_LIBS -l$rubylib" + + cat > conftest.c << EOF +#include +static VALUE foobar; +VALUE foobar_set_foo(VALUE module, VALUE _key, VALUE _value) +{ + return Qnil; +} +int Init_foobar() +{ + foobar = rb_define_module("foobar"); + rb_define_module_function(foobar, "set_foo", foobar_set_foo, 2); + return 0; +} +int main() {return 0;} +EOF + ac_link='$CC $SHARED $CPPFLAGS $RUBY_CPPFLAGS $CFLAGS conftest.c $LDFLAGS $RUBY_LDFLAGS $LIBS $RUBY_LIBS -o conftest${SLEXT}' + if { (eval echo ruby.m4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${SLEXT}; then + RUBY_OK=yes + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + fi + rm -f conftest* +fi + +if test "x${RUBY_OK}" '=' "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + + + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + RUBY_CPPFLAGS="" + RUBY_LDFLAGS="" + RUBY_LIBS="" + RUBY_INSTALLDIR="" +fi + + +if test "x$RUBY_OK" '!=' "xyes";then + if test -d "lib/ruby/";then + echo all install uninstall clean: > lib/ruby/Makefile + fi + # fail silently- the most users won't have any need for the + # ruby interface anyway +else + if test -f "lib/ruby/Makefile.in";then + rubygfx="lib/ruby/Makefile" + fi +fi + +# ------------------------------------------------------------------ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for missing libraries" >&5 +$as_echo_n "checking for missing libraries... " >&6; } + +if test "x$ZLIBMISSING" = "xtrue";then + MISSINGLIBS="${MISSINGLIBS} zlib" + DISABLEPNG2SWF=true + PARTIAL=true +fi +if test "x$JPEGLIBMISSING" = "xtrue";then + MISSINGLIBS="${MISSINGLIBS} jpeglib" + DISABLEPDF2SWF=true + DISABLEJPEG2SWF=true + PARTIAL=true +fi +if test "x$PDFLIBMISSING" = "xtrue";then + DISABLEPDF2PDF=true; +fi +#if test "x$T1LIBMISSING" = "xtrue";then +# MISSINGLIBS="${MISSINGLIBS} t1lib" +#fi +if test "x$UNGIFMISSING" = "xtrue";then + DISABLEGIF2SWF=true + MISSINGLIBS="${MISSINGLIBS} ungif" + PARTIAL=true +fi +if test "x${ac_cv_header_pdflib_h}" '!=' "xyes";then + DISABLEPDF2PDF=true; +fi +if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then + DISABLEPDF2SWF=true; + DISABLEJPEG2SWF=true; + MISSINGLIBS="${MISSINGLIBS} jpeglib.h" + PARTIAL=true +fi +if test "x$HAVE_FREETYPE" '!=' "x1"; then + DISABLEPDF2SWF=true; + MISSINGLIBS="${MISSINGLIBS} freetype" + PARTIAL=true +fi +#if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then +# MISSINGLIBS="${MISSINGLIBS} t1lib.h" +#fi +if test "x${ac_cv_header_gif_lib_h}" '!=' "xyes"; then + DISABLEGIF2SWF=true + MISSINGLIBS="${MISSINGLIBS} gif_lib.h" + PARTIAL=true +fi +if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then + DISABLEPNG2SWF=true; + MISSINGLIBS="${MISSINGLIBS} zlib.h" + PARTIAL=true fi +#if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then +# MISSINGLIBS="${MISSINGLIBS} avifile" +#fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${MISSINGLIBS}" >&5 +$as_echo "${MISSINGLIBS}" >&6; } # ------------------------------------------------------------------ -{ $as_echo "$as_me:$LINENO: checking for Python.h" >&5 -$as_echo_n "checking for Python.h... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python version" >&5 +$as_echo_n "checking for Python version... " >&6; } if test "x$PYTHON_LIB" '!=' "x" -a "x$PYTHON_INCLUDES" '!=' "x";then - PY_VERSION=unknown + # you can override the python detection by putting PYTHON_LIB + # and PYTHON_INCLUDES into the environment + case "$PYTHON_INCLUDES" in + *python2.4*) PY_VERSION=2.4 + ;; + *python2.5*) PY_VERSION=2.5 + ;; + *python2.6*) PY_VERSION=2.6 + ;; + *python2.7*) PY_VERSION=2.7 + ;; + *python3.0*) PY_VERSION=3.0 + ;; + *python3.1*) PY_VERSION=3.1 + ;; + *python3.2*) PY_VERSION=3.2 + ;; + *python3.3*) PY_VERSION=3.3 + ;; + *) PY_VERSION=unknown + ;; + esac else if test "x$PYTHON_LIB" '!=' "x" -o "x$PYTHON_INCLUDES" '!=' "x";then echo "Set both PYTHON_LIB and PYTHON_INCLUDES, or none at all" fi - # iterate through version 2.2 to 2.6 - for v in 2 3 4 5 6; do + # iterate through version 2.4 to 3.3 + VERSIONS="2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3" + case "$PYTHON" in + 2*) VERSIONS="2.4 2.5 2.6 2.7 $PYTHON" + ;; + 3*) VERSIONS="3.0 3.1 3.2 3.3 $PYTHON" + ;; + esac + for v in $VERSIONS; do # Linux - if test -f "/usr/include/python2.$v/Python.h";then - PY_VERSION=2.$v + if test -f "/usr/include/python$v/Python.h";then + PY_VERSION=$v PYTHON_LIB="-lpython$PY_VERSION" - if test -f "/usr/lib/python2.$v/site-packages/PIL/_imaging.so";then - PYTHON_LIB2="$PYTHON_LIB /usr/lib/python2.$v/site-packages/PIL/_imaging.so" + if test -f "/usr/lib/python$v/site-packages/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /usr/lib/python$v/site-packages/PIL/_imaging.so" HAVE_PYTHON_IMAGING_LIB=1 else PYTHON_LIB2="$PYTHON_LIB" fi PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION" # Mac OS X - elif test -f "/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/Python.h";then - PY_VERSION=2.$v + elif test -f "/Library/Frameworks/Python.framework/Versions/$v/include/python$v/Python.h";then + PY_VERSION=$v PYTHON_LIB="-framework Python" - if test -f "/Library/Frameworks/Python.framework/Versions/2.$v/site-packages/PIL/_imaging.so";then - PYTHON_LIB2="$PYTHON_LIB /Library/Python/2.$v/PIL/_imaging.so" + if test -f "/Library/Frameworks/Python.framework/Versions/$v/site-packages/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /Library/Python/$v/PIL/_imaging.so" HAVE_PYTHON_IMAGING_LIB=1 else PYTHON_LIB2="$PYTHON_LIB" fi - PYTHON_INCLUDES="-I/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/" + PYTHON_INCLUDES="-I/Library/Frameworks/Python.framework/Versions/$v/include/python$v/" # Mac OS X [Fink]: - elif test "(" -f "/sw/lib/python2.$v/config/libpython2.$v.dylib" \ - -o -f "/sw/lib/python2.$v/config/libpython2.$v.a" \ - -o -f "/sw/lib/python2.$v/config/libpython2.$v.so" \ + elif test "(" -f "/sw/lib/python$v/config/libpython$v.dylib" \ + -o -f "/sw/lib/python$v/config/libpython$v.a" \ + -o -f "/sw/lib/python$v/config/libpython$v.so" \ ")" \ - -a -f "/sw/include/python2.$v/Python.h"; then - PY_VERSION=2.$v - PYTHON_LIB="-L /sw/lib/python2.$v/config/ -lpython$PY_VERSION /sw/lib/python2.$v/site-packages/PIL/_imaging.so" - if test -f "/sw/lib/python2.$v/site-packages/PIL/_imaging.so";then - PYTHON_LIB2="$PYTHON_LIB /sw/lib/python2.$v/site-packages/PIL/_imaging.so" + -a -f "/sw/include/python$v/Python.h"; then + PY_VERSION=$v + PYTHON_LIB="-L /sw/lib/python$v/config/ -lpython$PY_VERSION /sw/lib/python$v/site-packages/PIL/_imaging.so" + if test -f "/sw/lib/python$v/site-packages/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /sw/lib/python$v/site-packages/PIL/_imaging.so" HAVE_PYTHON_IMAGING_LIB=1 else PYTHON_LIB2="$PYTHON_LIB" fi - PYTHON_INCLUDES="-I /sw/include/python2.$v/" + PYTHON_INCLUDES="-I /sw/include/python$v/" fi done fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY_VERSION" >&5 +$as_echo "$PY_VERSION" >&6; } + +if test "x$PY_VERSION" "!=" "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python executable" >&5 +$as_echo_n "checking for Python executable... " >&6; } + if python$PY_VERSION -V 2>&5;then + PYTHON_EXECUTABLE=python$PY_VERSION + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXECUTABLE" >&5 +$as_echo "$PYTHON_EXECUTABLE" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } + fi +fi -if test "x$PY_VERSION" "!=" "x"; then - { $as_echo "$as_me:$LINENO: result: $PY_VERSION" >&5 -$as_echo "$PY_VERSION" >&6; } +if test "x$PY_VERSION" "!=" "x" -a "x$PYTHON_EXECUTABLE" "!=" "x"; then export PYTHON_INCLUDES PYTHON_LIB - { $as_echo "$as_me:$LINENO: checking whether we can compile the python test program" >&5 -$as_echo_n "checking whether we can compile the python test program... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compile the Python test program" >&5 +$as_echo_n "checking whether we can compile the Python test program... " >&6; } cat > conftest.c << EOF -#include +# include -int main() -{ - int ret; - ret = Py_Main(0, 0); - int x; // check also for gcc 2.95.x incompatibilities - return ret; -} + int main() + { + int ret; + ret = Py_Main(0, 0); + int x; // check also for gcc 2.95.x incompatibilities + return ret; + } EOF ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS $PYTHON_LIB $LIBS -o conftest${ac_exeext}' if { (eval echo python.m4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PYTHON_OK=yes else echo "configure: failed program was:" >&5 cat conftest.c >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python install path" >&5 +$as_echo_n "checking for Python install path... " >&6; } +cat > _pypath.py << EOF +import distutils +import distutils.sysconfig +import sys +sys.stdout.write(distutils.sysconfig.get_python_lib(plat_specific=0,standard_lib=0)) +EOF + echo $PYTHON_EXECUTABLE _pypath.py 1>&5 + if $PYTHON_EXECUTABLE _pypath.py >_pypath.txt 2>&5;then + PYTHON_INSTALL_PATH=`cat _pypath.txt` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_INSTALL_PATH" >&5 +$as_echo "$PYTHON_INSTALL_PATH" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } + fi + #rm -f _pypath.txt _pypath.py + if test "x$PYTHON_OK" = "xyes";then - { $as_echo "$as_me:$LINENO: checking for Python-Imaging" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python-Imaging" >&5 $as_echo_n "checking for Python-Imaging... " >&6; } cat > conftest.c << EOF -#include -#include +# include +# include -int main() -{ - Py_Main(0, 0); - return 0; -} + int main() + { + Py_Main(0, 0); + return 0; + } EOF if test "$HAVE_PYTHON_IMAGING_LIB"; then ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS ${PYTHON_LIB2} $LIBS -o conftest${ac_exeext}' if { (eval echo python.m4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then PYTHON_LIB="${PYTHON_LIB2}" -cat >>confdefs.h <<\_ACEOF -#define HAVE_PYTHON_IMAGING 1 -_ACEOF +$as_echo "#define HAVE_PYTHON_IMAGING 1" >>confdefs.h HAVE_PYTHON_IMAGING=yes export HAVE_PYTHON_IMAGING - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else echo "configure: failed program was:" >&5 cat conftest.c >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else echo "(didn't find the Python-Imaging libraries)" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi rm -f conftest* -else - { $as_echo "$as_me:$LINENO: result: nope" >&5 -$as_echo "nope" >&6; } fi -if test "x$PYTHON_OK" '!=' "xyes";then +if test "x$PYTHON_OK" '!=' "xyes" -o "$DISABLEPDF2SWF";then echo all install uninstall clean: > lib/python/Makefile # fail silently- the most users won't have any need for the # python interface anyway else - pythonrfxswf="lib/python/Makefile" -fi - -# ------------------------------------------------------------------ - -{ $as_echo "$as_me:$LINENO: checking for missing libraries" >&5 -$as_echo_n "checking for missing libraries... " >&6; } - -if test "x$ZLIBMISSING" = "xtrue";then - MISSINGLIBS="${MISSINGLIBS} zlib" - DISABLEPNG2SWF=true - PARTIAL=true -fi -if test "x$JPEGLIBMISSING" = "xtrue";then - MISSINGLIBS="${MISSINGLIBS} jpeglib" - DISABLEPDF2SWF=true - DISABLEJPEG2SWF=true - PARTIAL=true -fi -#if test "x$T1LIBMISSING" = "xtrue";then -# MISSINGLIBS="${MISSINGLIBS} t1lib" -#fi -if test "x$UNGIFMISSING" = "xtrue";then - DISABLEGIF2SWF=true - MISSINGLIBS="${MISSINGLIBS} ungif" - PARTIAL=true -fi - -if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then - DISABLEPDF2SWF=true; - DISABLEJPEG2SWF=true; - MISSINGLIBS="${MISSINGLIBS} jpeglib.h" - PARTIAL=true -fi -if test "x$HAVE_FREETYPE" '!=' "x1"; then - DISABLEPDF2SWF=true; - MISSINGLIBS="${MISSINGLIBS} freetype" - PARTIAL=true -fi -#if test "x${ac_cv_header_t1lib_h}" '!=' "xyes"; then -# MISSINGLIBS="${MISSINGLIBS} t1lib.h" -#fi -if test "x${ac_cv_header_gif_lib_h}" '!=' "xyes"; then - DISABLEGIF2SWF=true - MISSINGLIBS="${MISSINGLIBS} gif_lib.h" - PARTIAL=true -fi -if test "x${ac_cv_header_zlib_h}" '!=' "xyes"; then - DISABLEPNG2SWF=true; - MISSINGLIBS="${MISSINGLIBS} zlib.h" - PARTIAL=true + pythongfx="lib/python/Makefile" fi -#if test "x${AVIFILE}" '!=' "xtrue" -a "x${AVIFIL32}" '!=' "xtrue"; then -# MISSINGLIBS="${MISSINGLIBS} avifile" -#fi - -{ $as_echo "$as_me:$LINENO: result: ${MISSINGLIBS}" >&5 -$as_echo "${MISSINGLIBS}" >&6; } # ------------------------------------------------------------------ @@ -11172,7 +7285,7 @@ if test "x${DISABLEPDF2SWF}" = "xtrue"; then echo "* Disabling pdf2swf tool..." rm -f lib/pdf/Makefile - echo all install uninstall clean libpdf: > lib/pdf/Makefile + echo all install uninstall clean libpdf libgfxpdf: > lib/pdf/Makefile pdf2swf_makefile="" PDF2SWF= LIBPDF= @@ -11180,6 +7293,16 @@ +PDF2PDF='pdf2pdf$(E)' +DEVICE_PDF='devices/pdf.$(O)' +if test "x${DISABLEPDF2PDF}" = "xtrue"; then + #echo "* Disabling pdf2pdf tool..." + PDF2PDF= + DEVICE_PDF= +fi + + + if test "x${ZLIBMISSING}" = "xtrue"; then echo echo "* Warning! Without zlib, you will not be able to read" @@ -11223,11 +7346,9 @@ - - if test -f "release.in"; then release_in="./release"; fi if test -f "Makefile.new.in"; then mk_in="./Makefile.new"; fi -FILES="$release_in $mk_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile lib/readers/Makefile" +FILES="$release_in $mk_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythongfx} ${rubygfx} ${lame_makefile} lib/readers/Makefile" ac_config_files="$ac_config_files ${FILES}" cat >confcache <<\_ACEOF @@ -11257,13 +7378,13 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -11271,8 +7392,8 @@ (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -11295,11 +7416,11 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -11319,8 +7440,8 @@ ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -11332,9 +7453,10 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -11344,17 +7466,18 @@ debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -11362,23 +7485,15 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -11386,7 +7501,13 @@ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -11397,7 +7518,7 @@ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -11420,13 +7541,6 @@ } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -11436,15 +7550,15 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -11456,12 +7570,16 @@ fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -11473,7 +7591,89 @@ LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -11487,8 +7687,12 @@ as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -11508,76 +7712,25 @@ } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -11606,8 +7759,56 @@ rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false @@ -11626,10 +7827,10 @@ if test -d "$1"; then test -d "$1/."; else - case $1 in + case $1 in #( -*)set "./$1";; esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' @@ -11644,13 +7845,19 @@ exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -11681,13 +7888,15 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -11703,16 +7912,17 @@ Configuration headers: $config_headers -Report bugs to ." +Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -11746,6 +7956,8 @@ ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) @@ -11753,20 +7965,19 @@ case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -11774,11 +7985,10 @@ ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -11827,9 +8037,7 @@ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "${FILES}") CONFIG_FILES="$CONFIG_FILES ${FILES}" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -11855,7 +8063,7 @@ trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. @@ -11866,11 +8074,7 @@ { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -11878,10 +8082,16 @@ if test -n "$CONFIG_FILES"; then -ac_cr=' ' +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' + ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi @@ -11895,24 +8105,18 @@ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -11934,7 +8138,7 @@ t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -11948,7 +8152,7 @@ t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -12001,9 +8205,7 @@ else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), @@ -12044,9 +8246,7 @@ if test -z "$ac_t"; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -12131,9 +8331,7 @@ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -12146,9 +8344,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -12176,12 +8372,10 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -12192,7 +8386,7 @@ `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -12205,9 +8399,7 @@ case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -12235,47 +8427,7 @@ q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -12327,7 +8479,6 @@ # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - ac_sed_dataroot=' /datarootdir/ { p @@ -12337,12 +8488,11 @@ /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -12352,7 +8502,7 @@ s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -12380,14 +8530,12 @@ $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} @@ -12397,9 +8545,7 @@ -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -12410,25 +8556,19 @@ $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error "could not create -" "$LINENO" 5 fi ;; @@ -12438,15 +8578,12 @@ done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -12467,10 +8604,10 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit $? fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff -Nru swftools-0.9.0/configure.in swftools-0.9.2/configure.in --- swftools-0.9.0/configure.in 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/configure.in 2012-04-08 17:25:26.000000000 +0000 @@ -7,6 +7,16 @@ dnl AC_INIT dnl AC_CONFIG_SRCDIR([src/]) +# ------------------- option parsing ------------------------------- + +DEBUG= +CHECKMEM= +PROFILING= +ENABLE_WARNINGS= +OPTIMIZE= +USE_POPPLER= +DISABLE_LAME= + AC_ARG_ENABLE(checkmem, [ --enable-checkmem turn on ccmalloc debugging], CHECKMEM=true) AC_ARG_ENABLE(debug, @@ -17,16 +27,17 @@ [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true) AC_ARG_ENABLE(optimizations, [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true) +AC_ARG_ENABLE(poppler, +[ --enable-poppler link againist libpoppler], USE_POPPLER=true) AC_ARG_ENABLE(lame, -[ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true) -AC_ARG_WITH([external-libart], -[ --with-external-libart use external libart library (currently broken)], [EXTERNAL_LIBART=true]) -AC_ARG_WITH([poppler], -[ --with-poppler use poppler instead of internal xpdf (currently broken)], [USE_POPPLER=true]) +[ --disable-lame "don't compile any L.A.M.E. mp3 encoding code in"], -PACKAGE=swftools -VERSION=0.9.0 +if test "x$enable_lame" = "xno";then + DISABLE_LAME=yes +fi,DISABLE_LAME=) +PACKAGE=swftools +VERSION=0.9.2 # ------------------------------------------------------------------ @@ -35,9 +46,9 @@ exit 1 fi -WARNINGS="-Wparentheses -Wimplicit -Wreturn-type" +WARNINGS="-Wimplicit -Wreturn-type -Wno-write-strings -Wformat" if test "x$ENABLE_WARNINGS" '!=' "x";then - WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -D_FORTIFY_SOURCE=2 " + WARNINGS="-Wall -Wno-unused -Wno-format -Wno-redundant-decls -Wno-write-strings -D_FORTIFY_SOURCE=2 " fi if test "x$CHECKMEM" '!=' "x";then @@ -50,11 +61,11 @@ if test "x$PROFILING" = "x";then CFLAGS="$WARNINGS -O2 -g $CFLAGS" CXXFLAGS="$WARNINGS -O2 -g $CXXFLAGS" - LDFLAGS="-g $LIBS" + LDFLAGS="-g $LDFLAGS" else CFLAGS="$WARNINGS -O2 -g -pg $CFLAGS" CXXFLAGS="$WARNINGS -O2 -g -pg $CXXFLAGS" - LDFLAGS="-g -pg $LIBS" + LDFLAGS="-g -pg $LDFLAGS" fi else if test "x$OPTIMIZE" '!=' "x"; then CFLAGS="$WARNINGS -O3 -fomit-frame-pointer -Winline $CFLAGS" @@ -82,6 +93,7 @@ AC_CANONICAL_HOST +SLEXT="so" SHARED="-shared" MACOSX= case $host_os in @@ -90,6 +102,11 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS -fno-rtti" SHARED="-bundle" + SLEXT="bundle" + if test -d /opt/local/include && test -d /opt/local/lib; then + CPPFLAGS="${CPPFLAGS} -I/opt/local/include" + LDFLAGS="${LDFLAGS} -L/opt/local/lib" + fi # Use fink packages if available. #if test -d /sw/include && test -d /sw/lib; then # CPPFLAGS="${CPPFLAGS} -I/sw/include" @@ -111,7 +128,7 @@ echo "***************************************************" echo "* Your gcc is too old to compile this!" echo "* " - echo "* The last version compilable by this compiler is " + echo "* The last version compileable by this compiler is " echo "* swftools 0.7.0, which you can download from " echo "* http://www.swftools.org/swftools-0.7.0.tar.gz " echo "* ." @@ -137,7 +154,7 @@ AC_PROG_LN_S AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, ) -PKG_PROG_PKG_CONFIG +dnl PKG_PROG_PKG_CONFIG dnl Checks for system services OBJEXT="o" @@ -156,7 +173,6 @@ RFX_CHECK_MING -SLEXT="so" if test "x${MINGW}" != "xyes"; then # no mingW AC_DEFINE([O_BINARY], [0], [Not defined on mingw]) @@ -197,7 +213,11 @@ # this must be done after (I believe) AC_PROG_MAKE_SET if test "x$DEBUG" '!=' "x" -o "x$STRIP" = "x";then - STRIP="@echo debug enabled, not stripping " + if test "$MACOSX";then + STRIP=dsymutil + else + STRIP="@echo debug enabled, not stripping " + fi export STRIP AC_SUBST(STRIP) fi @@ -216,13 +236,15 @@ echo exit fi - + +AC_CHECK_LIB(pdf, PDF_open_file,, PDFLIBMISSING=true) AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, JPEGLIBMISSING=true) AC_CHECK_LIB(ungif, DGifOpen,, UNGIFMISSING=true) if test "$UNGIFMISSING";then UNGIFMISSING= AC_CHECK_LIB(gif, DGifOpen,, UNGIFMISSING=true) fi +AC_CHECK_LIB(zzip, zzip_file_open,, ZZIPMISSING=true) RFX_CHECK_BYTEORDER AC_SUBST(WORDS_BIGENDIAN) @@ -236,7 +258,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC - AC_CHECK_HEADERS(zlib.h gif_lib.h io.h wchar.h jpeglib.h assert.h signal.h pthread.h sys/stat.h sys/mman.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h sys/time.h sys/resource.h) + AC_CHECK_HEADERS(zlib.h gif_lib.h io.h wchar.h jpeglib.h assert.h signal.h pthread.h sys/stat.h sys/mman.h sys/types.h dirent.h sys/bsdtypes.h sys/ndir.h sys/dir.h ndir.h time.h sys/time.h sys/resource.h pdflib.h zzip/lib.h) AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package]) @@ -253,7 +275,7 @@ AC_TYPE_SIZE_T AC_STRUCT_TM AC_CHECK_TYPE(boolean,int) #needed for jpeglib - AC_CHECK_FUNCS(popen wcschr wcsdup mkstemp stat mmap lrand48 rand srand48 srand bcopy bzero time getrusage mallinfo) + AC_CHECK_FUNCS(popen wcschr wcsdup mkstemp stat mmap lrand48 rand srand48 srand bcopy bzero time getrusage mallinfo open64 calloc) AC_CHECK_SIZEOF([signed char]) AC_CHECK_SIZEOF([signed short]) @@ -265,11 +287,14 @@ RFX_CHECK_FONTCONFIG -RFX_CHECK_OPENGL -if test "$HAVE_OPENGL";then - DEVICE_OPENGL='devices/opengl.$(O)' - AC_SUBST(DEVICE_OPENGL) -fi +RFX_CHECK_FFTW + +# RFX_CHECK_OPENGL +# if test "$HAVE_OPENGL";then +# DEVICE_OPENGL='devices/opengl.$(O)' +# AC_SUBST(DEVICE_OPENGL) +# fi +AC_SUBST(DEVICE_OPENGL) lame_in_source= lame_makefile= @@ -300,32 +325,13 @@ fi AC_SUBST(lame_in_source) -art_in_source='$(art_objects)' -AC_DEFINE([INTERNAL_LIBART], [1], [use internal libart library]) - -if test "x$EXTERNAL_LIBART" = "xtrue"; then - art_in_source= - PKG_CHECK_MODULES([LIBART],[libart-2.0],,[libart_pkgconfig_libart=no]) - if test "x$libart_pkgconfig_libart" = "xno"; then - AC_CHECK_HEADERS([libart_lgpl/libart.h],[ - AC_CHECK_LIB([art_lgpl_2],[art_new],,[]) - ],[AC_MSG_ERROR([No libart library found. This library is required.])]) - else - CPPFLAGS="$CPPFLAGS $LIBART_CFLAGS" - AC_DEFINE([INTERNAL_LIBART], [0]) - LIBS="$LIBS $LIBART_LIBS" - fi -fi -AC_SUBST([art_in_source]) - -xpdf_in_source='$(xpdf_objects)' -splash_in_source='$(splash_objects)' +xpdf_in_source= +splash_in_source= +xpdf_include= if test "x$USE_POPPLER" = "xtrue"; then - xpdf_in_source= - splash_in_source= AC_DEFINE([HAVE_POPPLER],[1],[use poppler]) - PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no]) + #PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no]) if test "x$poppler_pkgconfig" = "xno"; then AC_LANG_PUSH([C++]) AC_CHECK_HEADERS([OutputDev.h],[ @@ -333,16 +339,23 @@ ],[AC_MSG_ERROR([No poppler library found. This library is required.])]) AC_LANG_POP else - CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS" - AC_DEFINE([HAVE_POPPLER], [1]) + CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS" LIBS="$LIBS $POPPLER_LIBS" + AC_DEFINE([HAVE_POPPLER], [1]) fi +else + splash_in_source='$(splash_objects)' + xpdf_in_source='$(xpdf_objects)' + xpdf_include=' -I xpdf ' fi + AC_SUBST([xpdf_in_source]) AC_SUBST([splash_in_source]) +AC_SUBST([xpdf_include]) # ------------------------------------------------------------------ - + +RFX_CHECK_LOWERCASE_UPPERCASE RFX_CHECK_AVI2SWF if test "x${AVIFILE}" = "xtrue"; then VIDEO_LIBS="$VIDEO_LIBS $AVIFILE_LIBS" @@ -370,14 +383,18 @@ # ------------------------------------------------------------------ -RFX_CHECK_PYTHON +RFX_CHECK_RUBY -if test "x$PYTHON_OK" '!=' "xyes";then - echo all install uninstall clean: > lib/python/Makefile +if test "x$RUBY_OK" '!=' "xyes";then + if test -d "lib/ruby/";then + echo all install uninstall clean: > lib/ruby/Makefile + fi # fail silently- the most users won't have any need for the - # python interface anyway + # ruby interface anyway else - pythonrfxswf="lib/python/Makefile" + if test -f "lib/ruby/Makefile.in";then + rubygfx="lib/ruby/Makefile" + fi fi # ------------------------------------------------------------------ @@ -395,6 +412,9 @@ DISABLEJPEG2SWF=true PARTIAL=true fi +if test "x$PDFLIBMISSING" = "xtrue";then + DISABLEPDF2PDF=true; +fi #if test "x$T1LIBMISSING" = "xtrue";then # MISSINGLIBS="${MISSINGLIBS} t1lib" #fi @@ -404,6 +424,9 @@ PARTIAL=true fi +if test "x${ac_cv_header_pdflib_h}" '!=' "xyes";then + DISABLEPDF2PDF=true; +fi if test "x${ac_cv_header_jpeglib_h}" '!=' "xyes"; then DISABLEPDF2SWF=true; DISABLEJPEG2SWF=true; @@ -436,6 +459,18 @@ # ------------------------------------------------------------------ +RFX_CHECK_PYTHON + +if test "x$PYTHON_OK" '!=' "xyes" -o "$DISABLEPDF2SWF";then + echo all install uninstall clean: > lib/python/Makefile + # fail silently- the most users won't have any need for the + # python interface anyway +else + pythongfx="lib/python/Makefile" +fi + +# ------------------------------------------------------------------ + if test "x${MISSINGLIBS}" '!=' "x"; then echo "***************************************************" echo "* The following headers/libraries are missing: " ${MISSINGLIBS} @@ -456,7 +491,7 @@ if test "x${DISABLEPDF2SWF}" = "xtrue"; then echo "* Disabling pdf2swf tool..." rm -f lib/pdf/Makefile - echo all install uninstall clean libpdf: > lib/pdf/Makefile + echo all install uninstall clean libpdf libgfxpdf: > lib/pdf/Makefile pdf2swf_makefile="" PDF2SWF= LIBPDF= @@ -464,6 +499,16 @@ AC_SUBST(PDF2SWF) AC_SUBST(LIBPDF) +PDF2PDF='pdf2pdf$(E)' +DEVICE_PDF='devices/pdf.$(O)' +if test "x${DISABLEPDF2PDF}" = "xtrue"; then + #echo "* Disabling pdf2pdf tool..." + PDF2PDF= + DEVICE_PDF= +fi +AC_SUBST(DEVICE_PDF) +AC_SUBST(PDF2PDF) + if test "x${ZLIBMISSING}" = "xtrue"; then echo echo "* Warning! Without zlib, you will not be able to read" @@ -536,6 +581,18 @@ #ifdef HAVE_POPPLER #define GString GooString #define GHash GooHash +#define GHashIter GooHashIter +#endif + +#ifdef HAVE_ZZIP_LIB_H +#ifdef HAVE_LIBZZIP +#define HAVE_ZZIP 1 +#endif +#endif + +// supply a substitute calloc function if necessary +#ifndef HAVE_CALLOC +#define calloc rfx_calloc_replacement #endif #endif // __config_h__ @@ -543,7 +600,7 @@ if test -f "release.in"; then release_in="./release"; fi if test -f "Makefile.new.in"; then mk_in="./Makefile.new"; fi -FILES="$release_in $mk_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythonrfxswf} ${lame_makefile} lib/art/Makefile lib/readers/Makefile" +FILES="$release_in $mk_in Makefile.common ${avi2swf} Makefile lib/Makefile lib/action/Makefile src/Makefile ${pdf2swf_makefile} swfs/Makefile ${pythongfx} ${rubygfx} ${lame_makefile} lib/readers/Makefile" AC_OUTPUT(${FILES}) dnl new autoconf diff -Nru swftools-0.9.0/debian/changelog swftools-0.9.2/debian/changelog --- swftools-0.9.0/debian/changelog 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/changelog 2012-04-17 15:51:13.000000000 +0000 @@ -1,3 +1,23 @@ +swftools (0.9.2-0ubuntu1~blubolt1) lucid; urgency=low + + * New upstream release + + -- Trevor North Tue, 17 Apr 2012 16:50:15 +0100 + +swftools (0.9.0-0ubuntu2) lucid; urgency=low + + * Initial release for Lucid + - patches/05_xpdf-pl4.patch: added pl4 patch to embdded copy of xpdf + * Fixed spelling error description + * Updated standards version + * Added README.source + * Added misc:Depends + * Manually purged more files left behind after a make clean + * Added debian/format + * Took over as maintainer as this will now reside in partner + + -- Brian Thomason Tue, 06 Apr 2010 17:10:53 -0400 + swftools (0.9.0-0ubuntu1) karmic; urgency=low * New upstream release (LP: #369931) diff -Nru swftools-0.9.0/debian/control swftools-0.9.2/debian/control --- swftools-0.9.0/debian/control 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/control 2012-04-19 11:18:42.000000000 +0000 @@ -1,14 +1,14 @@ Source: swftools -Section: utils +Section: partner/utils Priority: extra -Maintainer: Ubuntu MOTU Developers +Maintainer: Trevor North XSBC-Original-Maintainer: Simo Kauppi Build-Depends: debhelper (>= 5.0.0), autotools-dev, dpatch (>= 2.0.21), libfontconfig1-dev (>= 2.4.2), libfreetype6-dev (>= 2.2.1), libjpeg62-dev (>= 6b-13), libt1-dev (>= 5.1.0), libgif-dev (>= 4.1.4), zlib1g-dev (>= 1:1.2.3), libart-2.0-dev (>= 2.3.17), python-all-dev (>= 2.3.5), python-imaging (>= 1.1.5), python-support (>= 0.5.3) -Standards-Version: 3.8.0 +Standards-Version: 3.8.4 Homepage: http://www.swftools.org/ Package: swftools -Section: utils +Section: partner/utils Architecture: any Replaces: libming-util (<= 1:0.3.0-11.1) Conflicts: libming-util (<= 1:0.3.0-11.1) @@ -33,13 +33,13 @@ E.g. for including the pdf2swf SWFs into some sort of Browsing-SWF. * swfextract allows to extract Movieclips, Sounds, Images etc. from SWF files. - * swfdump prints out various informations about SWFs. + * swfdump prints out various information about SWFs. * swfstrings scans SWFs for text data. * swfbbox allows to readjust SWF bounding boxes. * swfc is a tool for creating SWF files from simple script files. Package: python-rfxswf -Section: python +Section: partner/python Architecture: any Provides: ${python:Provides} Replaces: python2.4-rfxswf (<< 0.8.1-2) @@ -53,9 +53,9 @@ language. The rfxswf library is in the librfxswf-dev package. Package: librfxswf-dev -Section: libdevel +Section: partner/libdevel Architecture: any -Depends: libfontconfig1-dev (>= 2.4.2), libfreetype6-dev (>= 2.2.1), libjpeg62-dev (>= 6b-13), libgif-dev (>= 4.1.4), libt1-dev (>= 5.1.0), zlib1g-dev (>= 1:1.2.3) +Depends: ${misc:Depends}, libfontconfig1-dev (>= 2.4.2), libfreetype6-dev (>= 2.2.1), libjpeg62-dev (>= 6b-13), libgif-dev (>= 4.1.4), libt1-dev (>= 5.1.0), zlib1g-dev (>= 1:1.2.3) Description: RFXSWF library for SWF (Flash) generation RFXSWF library is a fully featured library which can be used for standalone SWF generation. It includes support for Bitmaps, Buttons, Shapes, Text, Fonts, diff -Nru swftools-0.9.0/debian/patches/00list swftools-0.9.2/debian/patches/00list --- swftools-0.9.0/debian/patches/00list 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/patches/00list 2012-04-19 08:43:59.000000000 +0000 @@ -1,14 +1,4 @@ #------------------------------------------------------------------------ -# Manpage fixes -# - Replaced 'ö' with '\[:o]' -# - Escapes the minus sings -01_manpages.dpatch -#------------------------------------------------------------------------ -# FAQ -# - Removed the compilation and installation related questions until -# the FAQ is split in to two seaprate FAQs. -02_faq.dpatch -#------------------------------------------------------------------------ # Configure # - Ran aclocal and autoconf from automake 1.10 and autoconf 2.61 03_configure.dpatch @@ -19,3 +9,11 @@ # - Added LDFLAGS to Makefile.common.in 04_makefile.dpatch #------------------------------------------------------------------------ +# xpdf security fixes +# - Added pl4 patch to embedded copy of xpdf +05_xpdf-pl4.dpatch +#------------------------------------------------------------------------ +# String formatting fixes +# - fixed a few string formatting issues +06_format-errors.dpatch +#------------------------------------------------------------------------ diff -Nru swftools-0.9.0/debian/patches/01_manpages.dpatch swftools-0.9.2/debian/patches/01_manpages.dpatch --- swftools-0.9.0/debian/patches/01_manpages.dpatch 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/patches/01_manpages.dpatch 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 01-manpages.dpatch by Simo Kauppi -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: This patch fixes the jpg2swf.1 and swfstrings.1 manpages, which -## DP: have the letter 'ö' in the author's name. -## DP: Fixes also the minus signs in swfextract.1, swfdump.1, swfbbox.1, -## DP: font2swf.1, pdf2swf.1, wav2swf.1 and swfcombine.1 manpages. - -@DPATCH@ -diff -urNad swftools-0.9.0~/src/font2swf.1 swftools-0.9.0/src/font2swf.1 ---- swftools-0.9.0~/src/font2swf.1 2009-04-17 15:39:51.000000000 +0000 -+++ swftools-0.9.0/src/font2swf.1 2009-05-06 03:25:58.000000000 +0000 -@@ -20,7 +20,7 @@ - Print short help message and exit - .TP - \fB\-v\fR, \fB\-\-verbose\fR -- Be verbose. Use more than one -v for greater effect. -+ Be verbose. Use more than one \-v for greater effect. - .TP - \fB\-o\fR, \fB\-\-output\fR \fIfilename\fR - Write output to file \fIfilename\fR. (If not given, the output will go -diff -urNad swftools-0.9.0~/src/jpeg2swf.1 swftools-0.9.0/src/jpeg2swf.1 ---- swftools-0.9.0~/src/jpeg2swf.1 2009-04-17 15:39:51.000000000 +0000 -+++ swftools-0.9.0/src/jpeg2swf.1 2009-05-06 03:25:58.000000000 +0000 -@@ -57,6 +57,6 @@ - Make importable as asset with \fIassetname\fR - .SH AUTHORS - --Rainer Böhme -+Rainer B\[:o]hme - .TP - Matthias Kramm -diff -urNad swftools-0.9.0~/src/pdf2swf.1 swftools-0.9.0/src/pdf2swf.1 ---- swftools-0.9.0~/src/pdf2swf.1 2009-05-06 03:25:50.000000000 +0000 -+++ swftools-0.9.0/src/pdf2swf.1 2009-05-06 03:26:54.000000000 +0000 -@@ -3,7 +3,7 @@ - pdf2swf - Converts Acrobat PDF files into Flash SWF Animation files. - - .SH Synopsis --.B pdf2swf [-options] file.pdf -o file.swf -+.B pdf2swf [-options] file.pdf /-o file.swf - - .SH DESCRIPTION - Converts a PDF file to a SWF file. -@@ -26,7 +26,7 @@ - Use password for deciphering the pdf. - .TP - \fB\-v\fR, \fB\-\-verbose\fR -- Be verbose. Use more than one -v for greater effect. -+ Be verbose. Use more than one /-v for greater effect. - .TP - \fB\-z\fR, \fB\-\-zlib\fR - The resulting SWF will not be playable in browsers with Flash Plugins 5 and below! -diff -urNad swftools-0.9.0~/src/swfbbox.1 swftools-0.9.0/src/swfbbox.1 ---- swftools-0.9.0~/src/swfbbox.1 2009-04-17 15:39:51.000000000 +0000 -+++ swftools-0.9.0/src/swfbbox.1 2009-05-06 03:25:58.000000000 +0000 -@@ -35,7 +35,7 @@ - Clip bounding boxes to movie size - .TP - \fB\-o\fR, \fB\-\-output\fR \fIfilename\fR -- Set output filename to \fIfilename\fR (for -O) -+ Set output filename to \fIfilename\fR (for \-O) - .TP - \fB\-v\fR, \fB\-\-verbose\fR - Be more verbose -diff -urNad swftools-0.9.0~/src/swfcombine.1 swftools-0.9.0/src/swfcombine.1 ---- swftools-0.9.0~/src/swfcombine.1 2009-04-17 15:39:51.000000000 +0000 -+++ swftools-0.9.0/src/swfcombine.1 2009-05-06 03:25:58.000000000 +0000 -@@ -47,7 +47,7 @@ - Clip the slave objects by the corresponding master objects - .TP - \fB\-v\fR, \fB\-\-verbose\fR -- Be verbose. Use more than one -v for greater effect -+ Be verbose. Use more than one \-v for greater effect - .TP - \fB\-d\fR, \fB\-\-dummy\fR - Don't require the presence of slave objects. Usually used together with \fB\-X\fR, \fB\-Y\fR or \fB\-r\fR. -@@ -69,10 +69,10 @@ - Force the output to have the framerate \fIfps\fR. (Otherwise, the framerate of the master file will be used) - .TP - \fB\-X\fR, \fB\-\-width\fR \fIwidth\fR -- Force movie bbox width to \fIwidth\fR (default: use master width (not with -t)) -+ Force movie bbox width to \fIwidth\fR (default: use master width (not with \-t)) - .TP - \fB\-Y\fR, \fB\-\-height\fR \fIheight\fR -- Force movie bbox height to \fIheight\fR (default: use master height (not with -t)) -+ Force movie bbox height to \fIheight\fR (default: use master height (not with \-t)) - .TP - \fB\-N\fR, \fB\-\-local-with-networking\fR - Make output file "local-with-networking" -@@ -111,7 +111,7 @@ - Create two flash movies. Insert some rectangle into one of them, and give - it a name. (E.g. "foo") Now call - --swfcombine -o combined.swf master.swf foo=slave.swf -+swfcombine \-o combined.swf master.swf foo=slave.swf - - As a result, the slave movie should be visible inside the master movie - at the position where the rectangle used to be. -diff -urNad swftools-0.9.0~/src/swfdump.1 swftools-0.9.0/src/swfdump.1 ---- swftools-0.9.0~/src/swfdump.1 2009-04-17 15:39:51.000000000 +0000 -+++ swftools-0.9.0/src/swfdump.1 2009-05-06 03:25:58.000000000 +0000 -@@ -18,7 +18,7 @@ - Print short help message and exit - .TP - \fB\-D\fR, \fB\-\-full\fR -- Show everything. Same as -atp -+ Show everything. Same as \-atp - .TP - \fB\-V\fR, \fB\-\-version\fR - Print version info and exit -@@ -51,16 +51,16 @@ - Print tag's bounding boxes - .TP - \fB\-X\fR, \fB\-\-width\fR -- Print out the horizontal dimension of the movie, in a string of the form "-X width" -+ Print out the horizontal dimension of the movie, in a string of the form "\-X width" - .TP - \fB\-Y\fR, \fB\-\-height\fR -- Print out the vertical dimension of the movie, in a string of the form "-Y height" -+ Print out the vertical dimension of the movie, in a string of the form "\-Y height" - .TP - \fB\-r\fR, \fB\-\-rate\fR -- Print out the frame rate of the movie, in a string of the form "-r rate". -+ Print out the frame rate of the movie, in a string of the form "\-r rate". - .TP - \fB\-f\fR, \fB\-\-frames\fR -- Print out the number of frames in the movie, in a string of the form "-f frames" -+ Print out the number of frames in the movie, in a string of the form "\-f frames" - .TP - \fB\-d\fR, \fB\-\-hex\fR - Print hex output of tag data, too. -diff -urNad swftools-0.9.0~/src/swfextract.1 swftools-0.9.0/src/swfextract.1 ---- swftools-0.9.0~/src/swfextract.1 2009-01-27 17:18:37.000000000 +0000 -+++ swftools-0.9.0/src/swfextract.1 2009-05-06 03:25:58.000000000 +0000 -@@ -27,7 +27,7 @@ - \fIids\fR is a range of JPEG IDs to extract. E.g. 1-2,3,14- - .TP - \fB\-p\fR, \fB\-\-pngs\fR \fIids\fR --\fIids\fR is a range of PNG IDs to extract. E.g. -10,20-30 -+\fIids\fR is a range of PNG IDs to extract. E.g. \-10,20\-30 - .TP - \fB\-f\fR, \fB\-\-frame\fR \fIframes\fR - \fIframes\fR is a range of frames to extract. E.g. 1-10,20-30,40- -@@ -40,7 +40,7 @@ - .TP - \fB\-P\fR, \fB\-\-placeobject\fR - Copy original placeobject tag for the given object into the --output file (Use with -i). This means that the object is -+output file (Use with \-i). This means that the object is - at the same position in the generated movie as in the - original movie. - .TP -diff -urNad swftools-0.9.0~/src/swfstrings.1 swftools-0.9.0/src/swfstrings.1 ---- swftools-0.9.0~/src/swfstrings.1 2009-01-27 17:18:37.000000000 +0000 -+++ swftools-0.9.0/src/swfstrings.1 2009-05-06 03:25:58.000000000 +0000 -@@ -20,5 +20,5 @@ - - .SH AUTHOR - --Rainer Böhme -+Rainer B\[:o]hme - -diff -urNad swftools-0.9.0~/src/wav2swf.1 swftools-0.9.0/src/wav2swf.1 ---- swftools-0.9.0~/src/wav2swf.1 2009-05-06 03:25:44.000000000 +0000 -+++ swftools-0.9.0/src/wav2swf.1 2009-05-06 03:26:32.000000000 +0000 -@@ -47,7 +47,7 @@ - Set mp3 bitrate to \fIbps\fR (default: 32) - .TP - \fB\-v\fR, \fB\-\-verbose\fR -- Be more verbose. (Use more than one -v for greater effect) -+ Be more verbose. (Use more than one /-v for greater effect) - .SH AUTHOR - - Matthias Kramm diff -Nru swftools-0.9.0/debian/patches/02_faq.dpatch swftools-0.9.2/debian/patches/02_faq.dpatch --- swftools-0.9.0/debian/patches/02_faq.dpatch 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/patches/02_faq.dpatch 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 02_faq.dpatch by Simo Kauppi -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: This patch removes the compilation and installation related -## DP: questions from the FAQ file. - -@DPATCH@ -diff -urNad swftools-0.9.0~/FAQ swftools-0.9.0/FAQ ---- swftools-0.9.0~/FAQ 2009-05-06 03:21:46.000000000 +0000 -+++ swftools-0.9.0/FAQ 2009-05-06 03:25:03.000000000 +0000 -@@ -9,81 +9,7 @@ - on http://www.swftools.org/donate.html - . - --3.) How to compile/link swftools on Unix/Linux/BSD? -- -- Download swftools-0.x.x.tar.gz. Then type, on the -- command-line: -- -- tar -zvxf swftools-0.x.x.tar -- cd swftools-0.x.x -- ./configure -- make -- make install -- -- (you will have to be root for the last step) -- --4.) What libraries do I need to compile swftools on Unix/Linux/BSD? -- -- You need freetype and jpeglib to compile pdf2swf. -- Links: -- freetype: -- http://www.freetype.org -- jpeglib: -- http://www.ijg.org/files/jpegsrc.v6b.tar.gz -- --5.) when compiling the sourcecode version, configure doesn't find my jpeglib! -- -- In case some of your libraries/include files are installed in /usr/local, -- try the following: -- -- rm -f config.cache -- LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure -- -- Furthermore, a new installation of jpeglib (the following assumes it's in -- /usr/local/lib) often requires doing a -- -- ranlib /usr/local/lib/libjpeg.a -- ldconfig /usr/local/lib -- -- In order to install jpeglib, it's furthermore been remarked that you need -- to do -- make install-lib -- make install-headers -- . -- -- If it still doesn't work, try removing the file "config.cache" -- before running configure again. -- --6.) There are problems during compilation: -- Error messages complain about "undefined reference to `operator new(unsigned)'" -- as well as "undefined reference to `__gxx_personality_v0'". -- -- Try running configure as -- -- LDFLAGS=-lstdc++ ./configure -- --7.) How do I compile swftools on Mac OS X? -- -- You need to get fink (http://fink.sourceforge.net), and install it. -- After this, you need to install all the required libs (jpeg, freetype, lame): -- -- fink install libjpeg libjpeg-shlibs freetype2 freetype2-shlibs lame lame-shlibs -- -- Then, you have to inform configure of where they are: -- -- LDFLAGS="-L/sw/lib" CPPFLAGS="-I/sw/include -I/sw/include/lame" ./configure -- make -- sudo make install -- -- If this doesn't work, especially if you want to use the python library and -- get weird exceptions, try to remove all versions of jpeglib, freetype and -- lame from /usr/lib and /usr/local/lib, and then run configure / make / make install -- again. -- -- If you also want to use the python interface, you may have to copy the -- Imaging headers (Imaging.h, ImPlatform.h, ImConfig.h) to -- /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/ -- before running configure. -+3.-7.) Install/compile related FAQs are removed from the Debian package. - - 8.) Is there a pdf2swf/avi2swf for Windows? - diff -Nru swftools-0.9.0/debian/patches/04_makefile.dpatch swftools-0.9.2/debian/patches/04_makefile.dpatch --- swftools-0.9.0/debian/patches/04_makefile.dpatch 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/patches/04_makefile.dpatch 2012-04-19 11:11:49.000000000 +0000 @@ -9,9 +9,9 @@ ## DP: one included in the upstream tar ball. @DPATCH@ -diff -urNad swftools-0.9.0~/Makefile.common.in swftools-0.9.0/Makefile.common.in ---- swftools-0.9.0~/Makefile.common.in 2009-04-12 23:27:16.000000000 +0000 -+++ swftools-0.9.0/Makefile.common.in 2009-05-06 03:38:30.000000000 +0000 +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' swftools-0.9.2~/Makefile.common.in swftools-0.9.2/Makefile.common.in +--- swftools-0.9.2~/Makefile.common.in 2012-04-19 12:10:12.000000000 +0100 ++++ swftools-0.9.2/Makefile.common.in 2012-04-19 12:11:14.000000000 +0100 @@ -11,8 +11,8 @@ DEP=@CC@ -MM $(DEFS) $(INCLUDES) @CPPFLAGS@ C=@CC@ -c $(DEFS) $(INCLUDES) @CPPFLAGS@ @CFLAGS@ @@ -23,3 +23,21 @@ AR=@AR@ LIBTOOL=@LIBTOOL@ SC=$(LIBTOOL) @CC@ -c $(DEFS) $(INCLUDES) @CPPFLAGS@ @CFLAGS@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' swftools-0.9.2~/swfs/Makefile.in swftools-0.9.2/swfs/Makefile.in +--- swftools-0.9.2~/swfs/Makefile.in 2012-04-08 18:25:26.000000000 +0100 ++++ swftools-0.9.2/swfs/Makefile.in 2012-04-19 12:11:47.000000000 +0100 +@@ -41,10 +41,10 @@ + $(INSTALL_DATA) ./PreLoaderTemplate.swf $(pkgdatadir)/swfs/PreLoaderTemplate.swf + $(INSTALL_DATA) ./tessel_loader.swf $(pkgdatadir)/swfs/tessel_loader.swf + $(INSTALL_DATA) ./swft_loader.swf $(pkgdatadir)/swfs/swft_loader.swf +- rm -f $(pkgdatadir)/swfs/default_viewer.swf -o -L $(pkgdatadir)/swfs/default_viewer.swf +- $(LN_S) $(pkgdatadir)/swfs/simple_viewer.swf $(pkgdatadir)/swfs/default_viewer.swf +- rm -f $(pkgdatadir)/swfs/default_loader.swf -o -L $(pkgdatadir)/swfs/default_loader.swf +- $(LN_S) $(pkgdatadir)/swfs/tessel_loader.swf $(pkgdatadir)/swfs/default_loader.swf ++ #rm -f $(pkgdatadir)/swfs/default_viewer.swf -o -L $(pkgdatadir)/swfs/default_viewer.swf ++ #$(LN_S) $(pkgdatadir)/swfs/simple_viewer.swf $(pkgdatadir)/swfs/default_viewer.swf ++ #rm -f $(pkgdatadir)/swfs/default_loader.swf -o -L $(pkgdatadir)/swfs/default_loader.swf ++ #$(LN_S) $(pkgdatadir)/swfs/tessel_loader.swf $(pkgdatadir)/swfs/default_loader.swf + + uninstall: + $(UNINSTALL_DATA) $(pkgdatadir)/swfs/simple_viewer.swf diff -Nru swftools-0.9.0/debian/patches/05_xpdf-pl4.dpatch swftools-0.9.2/debian/patches/05_xpdf-pl4.dpatch --- swftools-0.9.0/debian/patches/05_xpdf-pl4.dpatch 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/debian/patches/05_xpdf-pl4.dpatch 2012-04-17 15:37:59.000000000 +0000 @@ -0,0 +1,203 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 05_xpdf-pl4.dpatch by Brian Thomason +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: swftools embeds a copy of xpdf +## DP: This patch applies security update pl4 to the embedded xpdf + +diff -Nur swftools-0.9.0~/lib/pdf/xpdf/SplashBitmap.cc swftools-0.9.0/lib/pdf/xpdf.bak/SplashBitmap.cc +--- swftools-0.9.0~/lib/pdf/xpdf/SplashBitmap.cc 2007-02-27 17:05:52.000000000 -0500 ++++ swftools-0.9.0/lib/pdf/xpdf.bak/SplashBitmap.cc 2010-04-06 16:56:46.272911337 -0400 +@@ -11,6 +11,7 @@ + #endif + + #include ++#include + #include "gmem.h" + #include "SplashErrorCodes.h" + #include "SplashBitmap.h" +@@ -27,30 +28,48 @@ + mode = modeA; + switch (mode) { + case splashModeMono1: +- rowSize = (width + 7) >> 3; ++ if (width > 0) { ++ rowSize = (width + 7) >> 3; ++ } else { ++ rowSize = -1; ++ } + break; + case splashModeMono8: +- rowSize = width; ++ if (width > 0) { ++ rowSize = width; ++ } else { ++ rowSize = -1; ++ } + break; + case splashModeRGB8: + case splashModeBGR8: +- rowSize = width * 3; ++ if (width > 0 && width <= INT_MAX / 3) { ++ rowSize = width * 3; ++ } else { ++ rowSize = -1; ++ } + break; + #if SPLASH_CMYK + case splashModeCMYK8: +- rowSize = width * 4; ++ if (width > 0 && width <= INT_MAX / 4) { ++ rowSize = width * 4; ++ } else { ++ rowSize = -1; ++ } + break; + #endif + } +- rowSize += rowPad - 1; +- rowSize -= rowSize % rowPad; +- data = (SplashColorPtr)gmalloc(rowSize * height); ++ if (rowSize > 0) { ++ rowSize += rowPad - 1; ++ rowSize -= rowSize % rowPad; ++ } ++ data = (SplashColorPtr)gmallocn(height, rowSize); + if (!topDown) { + data += (height - 1) * rowSize; + rowSize = -rowSize; + } + if (alphaA) { +- alpha = (Guchar *)gmalloc(width * height); ++ alpha = (Guchar *)gmallocn(width, height); + } else { + alpha = NULL; + } +diff -Nur swftools-0.9.0~/lib/pdf/xpdf/Splash.cc swftools-0.9.0/lib/pdf/xpdf.bak/Splash.cc +--- swftools-0.9.0~/lib/pdf/xpdf/Splash.cc 2007-02-27 17:05:52.000000000 -0500 ++++ swftools-0.9.0/lib/pdf/xpdf.bak/Splash.cc 2010-04-06 16:56:46.264906761 -0400 +@@ -12,6 +12,7 @@ + + #include + #include ++#include + #include "gmem.h" + #include "SplashErrorCodes.h" + #include "SplashMath.h" +@@ -1912,7 +1913,10 @@ + xq = w % scaledWidth; + + // allocate pixel buffer +- pixBuf = (SplashColorPtr)gmalloc((yp + 1) * w); ++ if (yp < 0 || yp > INT_MAX - 1) { ++ return splashErrBadArg; ++ } ++ pixBuf = (SplashColorPtr)gmallocn(yp + 1, w); + + // initialize the pixel pipe + pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha, +@@ -2208,9 +2212,12 @@ + xq = w % scaledWidth; + + // allocate pixel buffers +- colorBuf = (SplashColorPtr)gmalloc((yp + 1) * w * nComps); ++ if (yp < 0 || yp > INT_MAX - 1 || w > INT_MAX / nComps) { ++ return splashErrBadArg; ++ } ++ colorBuf = (SplashColorPtr)gmallocn(yp + 1, w * nComps); + if (srcAlpha) { +- alphaBuf = (Guchar *)gmalloc((yp + 1) * w); ++ alphaBuf = (Guchar *)gmallocn(yp + 1, w); + } else { + alphaBuf = NULL; + } +diff -Nur swftools-0.9.0~/lib/pdf/xpdf/SplashErrorCodes.h swftools-0.9.0/lib/pdf/xpdf.bak/SplashErrorCodes.h +--- swftools-0.9.0~/lib/pdf/xpdf/SplashErrorCodes.h 2007-02-27 17:05:52.000000000 -0500 ++++ swftools-0.9.0/lib/pdf/xpdf.bak/SplashErrorCodes.h 2010-04-06 16:56:46.264906761 -0400 +@@ -29,4 +29,6 @@ + + #define splashErrSingularMatrix 8 // matrix is singular + ++#define splashErrBadArg 9 // bad argument ++ + #endif +diff -Nur swftools-0.9.0~/lib/pdf/xpdf/Stream.cc swftools-0.9.0/lib/pdf/xpdf.bak/Stream.cc +--- swftools-0.9.0~/lib/pdf/xpdf/Stream.cc 2009-04-17 11:57:11.000000000 -0400 ++++ swftools-0.9.0/lib/pdf/xpdf.bak/Stream.cc 2010-04-06 16:56:46.264906761 -0400 +@@ -325,6 +325,10 @@ + } else { + imgLineSize = nVals; + } ++ if (width > INT_MAX / nComps) { ++ // force a call to gmallocn(-1,...), which will throw an exception ++ imgLineSize = -1; ++ } + imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar)); + imgIdx = nVals; + } +diff -Nur swftools-0.9.0~/lib/pdf/xpdf/XRef.cc swftools-0.9.0/lib/pdf/xpdf.bak/XRef.cc +--- swftools-0.9.0~/lib/pdf/xpdf/XRef.cc 2007-02-27 17:05:52.000000000 -0500 ++++ swftools-0.9.0/lib/pdf/xpdf.bak/XRef.cc 2010-04-06 16:56:46.272911337 -0400 +@@ -52,6 +52,8 @@ + // generation 0. + ObjectStream(XRef *xref, int objStrNumA); + ++ GBool isOk() { return ok; } ++ + ~ObjectStream(); + + // Return the object number of this object stream. +@@ -67,6 +69,7 @@ + int nObjects; // number of objects in the stream + Object *objs; // the objects (length = nObjects) + int *objNums; // the object numbers (length = nObjects) ++ GBool ok; + }; + + ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { +@@ -80,6 +83,7 @@ + nObjects = 0; + objs = NULL; + objNums = NULL; ++ ok = gFalse; + + if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { + goto err1; +@@ -105,6 +109,13 @@ + goto err1; + } + ++ // this is an arbitrary limit to avoid integer overflow problems ++ // in the 'new Object[nObjects]' call (Acrobat apparently limits ++ // object streams to 100-200 objects) ++ if (nObjects > 1000000) { ++ error(-1, "Too many objects in an object stream"); ++ goto err1; ++ } + objs = new Object[nObjects]; + objNums = (int *)gmallocn(nObjects, sizeof(int)); + offsets = (int *)gmallocn(nObjects, sizeof(int)); +@@ -161,10 +172,10 @@ + } + + gfree(offsets); ++ ok = gTrue; + + err1: + objStr.free(); +- return; + } + + ObjectStream::~ObjectStream() { +@@ -837,6 +848,11 @@ + delete objStr; + } + objStr = new ObjectStream(this, e->offset); ++ if (!objStr->isOk()) { ++ delete objStr; ++ objStr = NULL; ++ goto err; ++ } + } + objStr->getObject(e->gen, num, obj); + break; diff -Nru swftools-0.9.0/debian/patches/06_format-errors.dpatch swftools-0.9.2/debian/patches/06_format-errors.dpatch --- swftools-0.9.0/debian/patches/06_format-errors.dpatch 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/debian/patches/06_format-errors.dpatch 2012-04-17 15:49:26.000000000 +0000 @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 06_format-errors.dpatch by Brian Thomason +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fix some string formatting issues + +--- swftools-0.9.2.bak/lib/pdf/CharOutputDev.cc 2011-12-12 21:29:27.000000000 +0000 ++++ swftools-0.9.2/lib/pdf/CharOutputDev.cc 2012-04-17 16:48:20.000000000 +0100 +@@ -1246,8 +1246,8 @@ + memset(f, 0, sizeof(fontfile_t)); + f->filename = filename; + int len = strlen(filename); +- char*r1 = strrchr((char*)filename, '/'); +- char*r2 = strrchr((char*)filename, '\\'); ++ const char*r1 = strrchr((char*)filename, '/'); ++ const char*r2 = strrchr((char*)filename, '\\'); + if(r2>r1) + r1 = r2; + if(r1) { diff -Nru swftools-0.9.0/debian/python-rfxswf.install swftools-0.9.2/debian/python-rfxswf.install --- swftools-0.9.0/debian/python-rfxswf.install 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/python-rfxswf.install 2012-04-19 10:57:20.000000000 +0000 @@ -1 +1 @@ -usr/lib/python*/*-packages/SWF.so +usr/lib/python*/*-packages/gfx.so diff -Nru swftools-0.9.0/debian/README.source swftools-0.9.2/debian/README.source --- swftools-0.9.0/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/debian/README.source 2012-04-17 15:37:59.000000000 +0000 @@ -0,0 +1,4 @@ +This package uses dpatch. Please refer to its README file below before +modifying this package. + +/usr/share/doc/dpatch/README.source.gz diff -Nru swftools-0.9.0/debian/rules swftools-0.9.2/debian/rules --- swftools-0.9.0/debian/rules 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/rules 2012-04-19 09:44:34.000000000 +0000 @@ -89,11 +89,13 @@ # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) distclean - # lib/h.263 and lib/devices should be cleaned from the lib/Makefile + # lib/h.263, lib/devices, lib/gocr, and lib/readers should be cleaned from the lib/Makefile rm -f lib/h.263/*.o rm -f lib/devices/*.o + rm -f lib/gocr/*.o + rm -f lib/readers/*.o # These should be cleaned by the main Makefile - rm -f config.log lib/action/Makefile lib/art/Makefile swfs/Makefile lib/pdf/Makefile lib/swf/Makefile + rm -f config.log lib/readers/Makefile lib/action/Makefile lib/art/Makefile swfs/Makefile lib/pdf/Makefile lib/swf/Makefile src/swfrender # Remove our own stuff rm -rf lib/python/usr rm -f config.guess config.sub @@ -103,16 +105,11 @@ $(python_targets): $(MAKE) -C lib/python clean - # Fix the PYHTON_LIB and PYTHON_INCLUDES in the Makefile.common - cp Makefile.common Makefile.common.bak - sed -i s,"^PYTHON_LIB=.*","PYTHON_LIB=/usr/lib/$@/$(call py_sitename_sh, $@)/PIL/_imaging.so", Makefile.common - sed -i s,"^PYTHON_INCLUDES=.*","PYTHON_INCLUDES=-I/usr/include/$@", Makefile.common # Make the module $(MAKE) -C lib/python # Copy the module to safe, so we can compile another one mkdir -p lib/python/usr/lib/$@/$(call py_sitename_sh, $@) - /usr/bin/install -m 644 lib/python/SWF.so lib/python/usr/lib/$@/$(call py_sitename_sh, $@)/SWF.so - mv Makefile.common.bak Makefile.common + /usr/bin/install -m 644 lib/python/gfx.so lib/python/usr/lib/$@/$(call py_sitename_sh, $@)/gfx.so touch $@-stamp install: build $(python_targets) diff -Nru swftools-0.9.0/debian/source/format swftools-0.9.2/debian/source/format --- swftools-0.9.0/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/debian/source/format 2012-04-17 15:37:59.000000000 +0000 @@ -0,0 +1 @@ +1.0 diff -Nru swftools-0.9.0/debian/swftools.docs swftools-0.9.2/debian/swftools.docs --- swftools-0.9.0/debian/swftools.docs 2012-04-19 11:37:50.000000000 +0000 +++ swftools-0.9.2/debian/swftools.docs 2012-04-19 11:14:28.000000000 +0000 @@ -1,2 +1 @@ -FAQ AUTHORS diff -Nru swftools-0.9.0/FAQ swftools-0.9.2/FAQ --- swftools-0.9.0/FAQ 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/FAQ 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -1.) What's the price of swftools? - - SWFTools is free of charge (donations are welcome, though), and is - released under the GPL (http://www.gnu.org/licenses/gpl.html). - -2.) Where can I donate? - - You can donate via PayPal by clicking on the "donate" button - on http://www.swftools.org/donate.html - . - -3.) How to compile/link swftools on Unix/Linux/BSD? - - Download swftools-0.x.x.tar.gz. Then type, on the - command-line: - - tar -zvxf swftools-0.x.x.tar - cd swftools-0.x.x - ./configure - make - make install - - (you will have to be root for the last step) - -4.) What libraries do I need to compile swftools on Unix/Linux/BSD? - - You need freetype and jpeglib to compile pdf2swf. - Links: - freetype: - http://www.freetype.org - jpeglib: - http://www.ijg.org/files/jpegsrc.v6b.tar.gz - -5.) when compiling the sourcecode version, configure doesn't find my jpeglib! - - In case some of your libraries/include files are installed in /usr/local, - try the following: - - rm -f config.cache - LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure - - Furthermore, a new installation of jpeglib (the following assumes it's in - /usr/local/lib) often requires doing a - - ranlib /usr/local/lib/libjpeg.a - ldconfig /usr/local/lib - - In order to install jpeglib, it's furthermore been remarked that you need - to do - make install-lib - make install-headers - . - - If it still doesn't work, try removing the file "config.cache" - before running configure again. - -6.) There are problems during compilation: - Error messages complain about "undefined reference to `operator new(unsigned)'" - as well as "undefined reference to `__gxx_personality_v0'". - - Try running configure as - - LDFLAGS=-lstdc++ ./configure - -7.) How do I compile swftools on Mac OS X? - - You need to get fink (http://fink.sourceforge.net), and install it. - After this, you need to install all the required libs (jpeg, freetype, lame): - - fink install libjpeg libjpeg-shlibs freetype2 freetype2-shlibs lame lame-shlibs - - Then, you have to inform configure of where they are: - - LDFLAGS="-L/sw/lib" CPPFLAGS="-I/sw/include -I/sw/include/lame" ./configure - make - sudo make install - - If this doesn't work, especially if you want to use the python library and - get weird exceptions, try to remove all versions of jpeglib, freetype and - lame from /usr/lib and /usr/local/lib, and then run configure / make / make install - again. - - If you also want to use the python interface, you may have to copy the - Imaging headers (Imaging.h, ImPlatform.h, ImConfig.h) to - /System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/ - before running configure. - -8.) Is there a pdf2swf/avi2swf for Windows? - - Windows versions of all SWF utilities are downloadable from - http://www.quiss.org/swftools/download.html - . - (There's a self-extracting .exe version of all versions since 0.6.1, - and a .zip or .rar archive of the newest development snapshot) - -9.) Where's the source code of the Windows version? - - It's the same as the Unix source code. If you want to compile - under Windows, it's recommended that you get the CVS version - of the sources. - You need MingW (http://www.mingw.org) to compile it. - When cross-compiling under Linux, e.g. the following generates the Windows .exe files: - - CXX=i386-mingw32msvc-g++ CPP=i386-mingw32msvc-cpp CC=i386-mingw32msvc-gcc \ - ./configure --host=i586-mingw32msvc && make - - For compiling on Windows itself, there's a HOWTO from Daichi Shinozaki: - http://lists.gnu.org/archive/html/swftools-common/2005-02/msg00023.html - -10.) The fonts in the SWFs generated by pdf2swf are wrong! - - Watch the output of pdf2swf closely. - You should see something like: - - WARNING Font Myriad-Roman could not be loaded. - WARNING Try putting a TTF version of that font (named "Myriad-Roman.ttf") into /swftools/fonts - - Provided you actually own the font in question (here: Myriad-Roman.ttf), - you can copy that fonts into your current directory and pass - the "-F ./" (--fontpath ./) option to pdf2swf. - If you use a font in several PDFs, you can also simply copy it - to (on Windows) C:\SWFTools\Fonts\, or (on Unix) /usr/local/share/swftools/fonts - to make it work all the time. - -11.) Can png2swf handle transparency? - - Yes. It supports PNG mode 2 transparency (256 color palettes with alpha) since version 0.4.2. - Mode 6 (32 bit RGBA truecolor) is also supported since version 0.4.4. - -12.) How to do Flash MX compression with SWFTools? - - Most tools support the -z flag for outputting compressed SWF. - Furthermore you can compress/uncompress SWF files using swfcombine: - - swfcombine -dz file.swf -o file_new.swf - - compresses, while - - swfcombine -d file.swf -o file_new.swf - - decompresses. - -13.) avi2swf converts my avi files upside down! - - Try using the -p (--flip) switch. - -14.) How to extract images/sounds from myfile.swf using swfextract? - - First list all extractable items: - - swfextract myfile.swf - - The result is something like: - - Objects in file myfile.swf: - [-i] 3 Shapes: ID(s) 1-3 - [-i] 5 MovieClips: ID(s) 4, 5, 8, 10, 12 - [-j] 3 JPEGs: ID(s) 69, 116, 447 - [-p] 1 PNG: ID(s) 318 - [-s] 3 Sounds: ID(s) 28-30 - [-f] 10 Frames: ID(s) 0-10 - - Now you can extract a shape using - - swfextract -i 2 myfile.swf -o shape.swf - - a sound using - - swfextract -s 28 myfile.swf -o sound.wav - - a PNG image file using - - swfextract -p 318 myfile.swf -o file.png - - etc. - -15.) Is there a mailing list for SWFTools? - - Yes there is. You can subscribe by going to - - http://mail.nongnu.org/mailman/listinfo/swftools-common - -16.) Why didn't Matthias answer my swftools-related mail? - - Currently, Matthias is getting much more mails than he can answer. It's frustrating, - but it's true. - He tries his best to at least *read* all mails he receives. - If you need an answer to something, it's usually more effective to post it on the - mailing list, though, as there are a lot of friendly users around there which may - have the one or other helpful tip concerning your problem. - -16.) When will feature/bugfix/enhancement XY be implemented? - - Setting deadlines in a non-commercial, spare-time project like swftools tools is hard, - and keeping them is even harder, if not impossible. - - Therefore, do not ask about deadlines, and you won't get fuzzy, or even wrong, answers. - -17.) How to compile avi2swf? - - avi2swf isn't part of the swftools distribution anymore. If you want to convert avi files - to swf, please use either mencoder or ffmpeg: - - mencoder file.avi -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames \ - -ffourcc FLV1 -oac mp3lame -of lavf -ovc lavc \ - -lavcopts vcodec=flv:acodec=mp3:vbitrate=500:abitrate=56 -srate 22050 \ - -o file.swf - - or - - ffmpeg -i video.mpg -b -s y -pass 1 -passlogfile log_file video.flv - ffmpeg -i video.mpg -b -s y -pass 2 -passlogfile log_file video.flv - flvtool2 -UP video.flv - -18.) How can I create transparent SWFs from PDFs? - - Run pdf2swf as usual, and then, on the resulting file, execute: - - swfextract -i 3- file.swf -o file.swf - -19.) How can I convert SWF frames to bitmap? - - There's a "swfrender" utility in the CVS, which isn't finished yet, - and will only work for *very* simple SWF files. (No Actionscript, no - gradient fills, no morph shapes, no blending modes, no filters, etc.) - Probably other Flash Open-Source projects (like Gnash) have some - more sophisticated utilities for this. (One user reported that - swfdec (http://swfdec.freedesktop.org/wiki/) and pyswfdec - (http://www.gnome.org/~gianmt) work good) - If you find other tools that work, I'd like to know about it. - Please mail me at kramm@quiss.org. diff -Nru swftools-0.9.0/lib/action/lex.swf5.c swftools-0.9.2/lib/action/lex.swf5.c --- swftools-0.9.0/lib/action/lex.swf5.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/action/lex.swf5.c 2011-12-12 21:29:27.000000000 +0000 @@ -5,10 +5,29 @@ /* A lexical scanner generated by flex */ +#define yy_create_buffer swf5_create_buffer +#define yy_delete_buffer swf5_delete_buffer +#define yy_flex_debug swf5_flex_debug +#define yy_init_buffer swf5_init_buffer +#define yy_flush_buffer swf5_flush_buffer +#define yy_load_buffer_state swf5_load_buffer_state +#define yy_switch_to_buffer swf5_switch_to_buffer +#define yyin swf5in +#define yyleng swf5leng +#define yylex swf5lex +#define yylineno swf5lineno +#define yyout swf5out +#define yyrestart swf5restart +#define yytext swf5text +#define yywrap swf5wrap +#define yyalloc swf5alloc +#define yyrealloc swf5realloc +#define yyfree swf5free + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -30,7 +49,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -93,11 +112,12 @@ #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -177,14 +197,9 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -377,9 +392,9 @@ 0, 0, 0, 0, 167, 165, 119, 164, 165, 152, 165, 151, 146, 165, 153, 154, 149, 144, 159, 145, 160, 150, 3, 3, 162, 142, 140, 143, 141, 161, - 155, 156, 148, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 157, 147, 158, 163, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 155, 156, + 148, 157, 147, 158, 163, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 164, 125, 0, 115, 113, 0, 126, 132, 0, 116, 114, 0, 128, 120, 130, 121, 131, 117, 118, 129, @@ -455,14 +470,14 @@ 1, 2, 5, 6, 1, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, 22, 22, 23, 24, 25, - 26, 27, 28, 1, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 33, - 29, 30, 31, 32, 33, 1, 34, 35, 36, 37, - - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 33, 59, 60, 61, 62, 1, 1, 1, 1, + 26, 27, 28, 1, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 54, 1, 59, 60, 61, 62, + + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 54, 84, 85, 86, 87, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -479,91 +494,93 @@ 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[63] = +static yyconst flex_int32_t yy_meta[88] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 2, 2, 2, 2, 2, 2, 3, + 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, - 1, 1 + 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 1, 1, 1, 1 } ; static yyconst flex_int16_t yy_base[654] = { 0, - 0, 0, 29, 0, 741, 742, 742, 742, 737, 713, - 67, 742, 64, 76, 742, 742, 712, 67, 742, 68, - 742, 70, 82, 89, 742, 742, 63, 711, 65, 742, - 742, 742, 742, 0, 684, 684, 78, 75, 69, 82, - 77, 81, 79, 80, 683, 86, 109, 95, 87, 699, - 80, 742, 114, 742, 742, 105, 681, 112, 116, 116, - 117, 120, 124, 121, 130, 99, 128, 139, 697, 682, - 742, 742, 180, 182, 742, 726, 742, 742, 178, 187, - 742, 725, 742, 742, 742, 742, 742, 742, 742, 742, - 179, 200, 207, 0, 701, 742, 742, 742, 176, 0, - - 680, 687, 159, 673, 676, 168, 0, 673, 669, 686, - 674, 667, 670, 663, 662, 0, 153, 667, 679, 158, - 667, 674, 676, 671, 212, 661, 189, 654, 658, 670, - 662, 663, 155, 653, 650, 658, 646, 742, 742, 661, - 660, 61, 191, 201, 641, 646, 187, 640, 640, 202, - 198, 213, 212, 655, 646, 195, 637, 652, 651, 142, - 635, 633, 643, 215, 649, 225, 632, 631, 250, 0, - 742, 742, 655, 0, 646, 634, 640, 0, 203, 643, - 638, 630, 636, 628, 620, 0, 635, 208, 622, 616, - 0, 628, 630, 0, 613, 620, 0, 606, 608, 255, - - 625, 613, 606, 606, 609, 605, 603, 615, 618, 615, - 614, 0, 606, 609, 0, 0, 602, 603, 0, 605, - 601, 0, 599, 610, 232, 0, 590, 590, 599, 599, - 601, 587, 583, 582, 582, 245, 0, 246, 0, 581, - 592, 242, 593, 580, 581, 587, 229, 579, 589, 0, - 742, 582, 586, 0, 590, 581, 568, 568, 578, 0, - 0, 581, 565, 575, 565, 576, 580, 560, 243, 573, - 0, 0, 572, 562, 554, 557, 573, 554, 552, 568, - 558, 564, 0, 553, 562, 0, 563, 219, 561, 559, - 551, 557, 560, 258, 540, 556, 540, 543, 552, 553, - - 542, 544, 548, 534, 545, 545, 531, 542, 0, 0, - 541, 540, 543, 542, 522, 521, 257, 526, 519, 520, - 0, 520, 0, 518, 515, 520, 521, 527, 528, 0, - 521, 516, 516, 509, 512, 517, 509, 522, 504, 503, - 507, 514, 504, 499, 501, 497, 506, 508, 0, 506, - 0, 503, 245, 505, 504, 490, 488, 493, 487, 486, - 501, 494, 500, 0, 493, 0, 480, 483, 481, 492, - 474, 475, 489, 471, 472, 477, 482, 470, 469, 256, - 482, 467, 477, 465, 481, 460, 479, 0, 458, 458, - 0, 476, 461, 470, 488, 472, 469, 0, 449, 452, - - 468, 467, 0, 454, 0, 459, 444, 0, 0, 447, - 0, 266, 449, 442, 0, 460, 0, 458, 450, 440, - 447, 455, 443, 434, 433, 0, 440, 0, 450, 431, - 0, 448, 429, 445, 437, 438, 435, 438, 433, 423, - 439, 265, 430, 435, 436, 423, 430, 0, 414, 419, - 414, 0, 418, 425, 420, 419, 414, 413, 410, 419, - 409, 401, 409, 414, 416, 410, 397, 411, 414, 413, - 408, 398, 268, 403, 392, 384, 396, 387, 394, 385, - 399, 384, 397, 400, 394, 392, 397, 390, 379, 390, - 380, 373, 380, 386, 0, 385, 0, 0, 384, 373, - - 382, 385, 380, 379, 361, 362, 377, 379, 356, 358, - 357, 361, 370, 356, 371, 347, 368, 0, 356, 351, - 0, 359, 0, 348, 358, 346, 356, 345, 342, 341, - 358, 339, 350, 350, 0, 0, 265, 349, 0, 336, - 0, 341, 0, 347, 338, 349, 0, 0, 341, 0, - 330, 336, 346, 328, 336, 340, 0, 0, 331, 0, - 322, 337, 0, 326, 0, 338, 0, 337, 0, 332, - 331, 323, 0, 314, 0, 326, 313, 0, 0, 316, - 0, 309, 317, 323, 0, 318, 301, 304, 309, 0, - 318, 0, 0, 315, 307, 306, 301, 294, 312, 329, - - 295, 294, 291, 299, 306, 307, 289, 289, 302, 292, - 0, 0, 0, 0, 0, 289, 0, 0, 296, 295, - 293, 0, 282, 288, 274, 0, 0, 0, 280, 0, - 296, 291, 281, 285, 0, 0, 279, 279, 260, 264, - 0, 266, 259, 0, 262, 0, 92, 0, 742, 317, - 320, 322, 66 + 0, 0, 59, 0, 322, 1377, 1377, 1377, 317, 275, + 92, 1377, 89, 101, 1377, 1377, 259, 99, 1377, 90, + 1377, 111, 124, 131, 1377, 1377, 82, 212, 87, 1377, + 87, 89, 125, 123, 119, 131, 130, 0, 128, 134, + 122, 112, 135, 185, 176, 169, 154, 180, 1377, 1377, + 1377, 1377, 152, 1377, 1377, 187, 174, 192, 223, 228, + 190, 227, 234, 232, 246, 234, 272, 280, 212, 233, + 1377, 1377, 176, 237, 1377, 228, 1377, 1377, 227, 279, + 1377, 223, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 318, 334, 344, 0, 161, 1377, 1377, 1377, 168, 0, + + 243, 254, 327, 248, 285, 307, 0, 305, 321, 340, + 330, 326, 331, 327, 328, 0, 333, 336, 353, 332, + 345, 354, 358, 355, 371, 352, 378, 347, 358, 377, + 372, 385, 392, 378, 377, 390, 380, 1377, 1377, 397, + 398, 403, 393, 404, 384, 398, 429, 394, 397, 445, + 437, 448, 454, 437, 440, 435, 433, 456, 457, 451, + 443, 448, 463, 492, 472, 500, 457, 458, 521, 0, + 1377, 1377, 112, 0, 507, 504, 512, 0, 515, 518, + 515, 509, 517, 512, 506, 0, 523, 507, 514, 510, + 0, 525, 529, 0, 514, 524, 0, 516, 520, 583, + + 549, 546, 546, 548, 553, 551, 558, 572, 577, 576, + 577, 0, 572, 577, 0, 0, 572, 575, 0, 579, + 577, 0, 577, 591, 581, 0, 573, 576, 587, 596, + 600, 588, 586, 592, 601, 637, 0, 640, 0, 607, + 620, 626, 623, 612, 624, 638, 634, 634, 650, 0, + 1377, 645, 655, 0, 661, 654, 643, 645, 657, 0, + 0, 662, 653, 672, 669, 682, 688, 670, 685, 693, + 0, 0, 694, 686, 680, 686, 704, 687, 688, 706, + 698, 707, 0, 698, 709, 0, 712, 710, 717, 717, + 712, 720, 725, 726, 713, 744, 730, 735, 746, 756, + + 747, 751, 757, 745, 759, 761, 749, 762, 0, 0, + 763, 764, 769, 771, 753, 754, 782, 761, 756, 763, + 0, 765, 0, 765, 764, 771, 775, 788, 804, 0, + 799, 796, 798, 800, 805, 812, 806, 821, 806, 807, + 813, 822, 814, 811, 815, 814, 825, 829, 0, 829, + 0, 828, 823, 837, 838, 827, 827, 834, 835, 843, + 865, 860, 868, 0, 863, 0, 859, 864, 864, 877, + 861, 865, 881, 865, 868, 875, 882, 872, 874, 883, + 889, 876, 889, 884, 902, 883, 904, 0, 885, 887, + 0, 912, 906, 922, 108, 927, 926, 0, 908, 920, + + 938, 939, 0, 928, 0, 935, 923, 0, 0, 928, + 0, 945, 933, 928, 0, 948, 0, 948, 943, 935, + 945, 955, 949, 942, 943, 0, 952, 0, 964, 947, + 0, 966, 954, 979, 978, 981, 980, 985, 989, 981, + 999, 996, 993, 1001, 1004, 993, 1002, 0, 989, 996, + 994, 0, 1000, 1009, 1006, 1007, 1008, 1009, 1008, 1019, + 1011, 1005, 1015, 1027, 1038, 1039, 1028, 1044, 1049, 1057, + 1054, 1046, 1060, 1054, 1046, 1040, 1054, 1047, 1056, 1049, + 1065, 1053, 1068, 1073, 1070, 1074, 1081, 1076, 1067, 1080, + 1072, 1067, 1081, 1096, 0, 1102, 0, 0, 1103, 1094, + + 1105, 1117, 1114, 1115, 1099, 1102, 1120, 1124, 1103, 1107, + 1108, 1114, 1125, 1114, 1131, 1109, 1132, 0, 1122, 1123, + 0, 1133, 0, 1124, 1136, 1126, 1138, 1129, 1133, 1141, + 1165, 1148, 1161, 1163, 0, 0, 1165, 1171, 0, 1161, + 0, 1168, 0, 1176, 1171, 1184, 0, 0, 1178, 0, + 1169, 1177, 1189, 1174, 1184, 1190, 0, 0, 1183, 0, + 1176, 1197, 0, 1188, 0, 1202, 0, 1203, 0, 1200, + 1201, 1195, 0, 1193, 0, 1214, 1208, 0, 0, 1213, + 0, 1208, 1218, 1233, 0, 1230, 1215, 1220, 1227, 0, + 1239, 0, 0, 1238, 1232, 1233, 1230, 1225, 1245, 97, + + 1232, 1233, 1232, 1242, 1251, 1258, 1242, 1244, 1259, 1251, + 0, 0, 0, 0, 0, 1250, 0, 0, 1259, 1265, + 1272, 0, 1268, 1276, 1264, 0, 0, 0, 1272, 0, + 1297, 1294, 1286, 1292, 0, 0, 1288, 1301, 1284, 1290, + 0, 1295, 1295, 0, 1300, 0, 1294, 0, 1377, 1368, + 1371, 1373, 91 } ; static yyconst flex_int16_t yy_def[654] = @@ -571,9 +588,9 @@ 649, 1, 1, 3, 649, 649, 649, 649, 649, 649, 650, 649, 649, 651, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, - 652, 649, 649, 649, 649, 652, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 652, 649, 649, + 649, 649, 649, 649, 649, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 649, 649, 650, 650, 649, 650, 649, 649, 651, 651, 649, 651, 649, 649, 649, 649, 649, 649, 649, 649, @@ -642,100 +659,172 @@ 649, 649, 649 } ; -static yyconst flex_int16_t yy_nxt[805] = +static yyconst flex_int16_t yy_nxt[1465] = { 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 24, - 24, 24, 25, 26, 27, 28, 29, 30, 31, 6, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 34, 42, 34, 34, 43, 34, 44, 45, 46, 34, - 47, 48, 49, 34, 50, 51, 34, 34, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 170, 61, 74, - 62, 77, 75, 63, 64, 65, 66, 67, 80, 84, - 68, 88, 86, 69, 81, 70, 89, 95, 96, 78, - 98, 99, 85, 87, 217, 90, 76, 91, 175, 92, - - 92, 92, 92, 93, 91, 82, 93, 93, 93, 93, - 93, 103, 106, 109, 114, 111, 118, 120, 104, 116, - 136, 137, 107, 110, 115, 105, 119, 117, 108, 112, - 123, 125, 128, 121, 132, 113, 124, 133, 94, 138, - 648, 140, 126, 158, 134, 143, 127, 129, 130, 159, - 131, 141, 104, 144, 149, 153, 101, 145, 116, 105, - 109, 151, 147, 107, 115, 148, 150, 156, 154, 146, - 110, 152, 123, 139, 155, 160, 162, 157, 124, 163, - 80, 161, 74, 121, 74, 75, 81, 75, 209, 80, - 239, 164, 165, 240, 166, 81, 169, 169, 169, 169, - - 169, 172, 173, 176, 190, 191, 180, 82, 210, 76, - 177, 76, 181, 194, 195, 91, 82, 92, 92, 92, - 92, 93, 91, 222, 93, 93, 93, 93, 93, 200, - 200, 200, 200, 200, 202, 218, 219, 226, 255, 180, - 223, 203, 177, 227, 192, 181, 193, 230, 244, 228, - 236, 195, 229, 190, 191, 256, 231, 353, 248, 232, - 264, 265, 245, 233, 354, 246, 207, 169, 169, 169, - 169, 169, 200, 200, 200, 200, 200, 292, 303, 306, - 319, 320, 304, 307, 264, 265, 293, 311, 337, 305, - 308, 360, 312, 382, 313, 387, 314, 338, 413, 463, - - 438, 519, 489, 647, 646, 361, 439, 464, 345, 490, - 645, 576, 644, 643, 642, 520, 577, 73, 73, 73, - 79, 79, 79, 100, 100, 641, 640, 639, 638, 637, - 636, 635, 634, 633, 632, 631, 630, 629, 628, 627, - 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, - 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, - 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, - 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 578, 575, - 574, 573, 572, 571, 570, 569, 568, 567, 566, 565, - - 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, - 554, 553, 552, 551, 550, 549, 548, 547, 546, 545, - 544, 543, 542, 541, 540, 539, 538, 537, 536, 535, - 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, - 524, 523, 522, 521, 518, 517, 516, 515, 514, 513, - 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 488, 487, 486, 485, 484, 483, 482, 481, - 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, - 470, 469, 468, 467, 466, 465, 462, 461, 460, 459, - - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 437, - 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 412, 411, 410, 409, 408, 407, 406, - 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, - 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, - 385, 384, 383, 381, 380, 379, 378, 377, 376, 375, - 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, - 364, 363, 362, 359, 358, 357, 356, 355, 352, 351, - - 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, - 340, 339, 336, 335, 334, 333, 332, 331, 330, 329, - 328, 327, 326, 325, 324, 323, 322, 321, 318, 317, - 316, 315, 310, 309, 302, 301, 300, 299, 298, 297, - 296, 295, 294, 291, 290, 259, 289, 288, 287, 286, - 285, 284, 283, 282, 281, 280, 279, 278, 277, 276, - 275, 274, 273, 272, 271, 270, 269, 268, 267, 266, - 263, 262, 261, 260, 259, 258, 257, 254, 253, 252, - 251, 250, 249, 247, 243, 242, 241, 197, 238, 237, - 235, 234, 225, 224, 221, 220, 216, 215, 214, 213, - - 212, 211, 208, 207, 206, 205, 204, 201, 199, 198, - 197, 196, 193, 192, 189, 188, 187, 186, 185, 184, - 183, 182, 179, 178, 175, 174, 171, 649, 649, 168, - 167, 142, 135, 122, 102, 101, 97, 83, 72, 71, - 649, 5, 649, 649, 649, 649, 649, 649, 649, 649, + 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 38, 38, 40, + 38, 41, 42, 43, 38, 44, 45, 46, 38, 47, + 48, 38, 38, 38, 49, 6, 50, 51, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 38, 38, 40, + 38, 41, 42, 43, 38, 44, 45, 46, 38, 47, + 48, 38, 38, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 170, 61, 74, 62, 77, 75, 63, 64, + + 65, 66, 67, 80, 86, 68, 95, 96, 69, 81, + 70, 84, 98, 99, 78, 87, 618, 56, 57, 58, + 59, 60, 88, 61, 85, 62, 452, 89, 63, 64, + 65, 66, 67, 101, 102, 68, 90, 251, 69, 91, + 70, 92, 92, 92, 92, 93, 91, 76, 93, 93, + 93, 93, 93, 103, 120, 106, 82, 122, 109, 111, + 104, 116, 114, 101, 102, 107, 118, 105, 110, 117, + 121, 108, 115, 112, 123, 94, 119, 138, 74, 113, + 124, 75, 135, 103, 120, 106, 171, 122, 109, 111, + 104, 116, 114, 172, 173, 107, 118, 105, 110, 117, + + 121, 108, 115, 112, 123, 94, 119, 125, 128, 113, + 124, 132, 135, 126, 133, 136, 137, 127, 140, 142, + 143, 134, 149, 129, 130, 649, 131, 104, 141, 80, + 649, 76, 115, 101, 105, 81, 139, 97, 128, 74, + 167, 132, 75, 126, 133, 136, 137, 127, 140, 142, + 143, 134, 149, 129, 130, 144, 131, 104, 141, 145, + 116, 153, 115, 101, 105, 107, 151, 109, 150, 147, + 167, 146, 148, 158, 154, 168, 152, 110, 156, 159, + 155, 80, 82, 174, 83, 144, 175, 81, 157, 145, + 116, 153, 76, 178, 121, 107, 151, 109, 150, 147, + + 72, 146, 148, 158, 154, 168, 152, 110, 156, 159, + 155, 123, 162, 174, 160, 163, 175, 124, 157, 71, + 161, 649, 649, 178, 121, 649, 179, 164, 165, 649, + 166, 649, 649, 649, 82, 169, 169, 169, 169, 169, + 180, 123, 162, 649, 160, 163, 181, 124, 182, 91, + 161, 92, 92, 92, 92, 93, 179, 164, 165, 91, + 166, 93, 93, 93, 93, 93, 176, 183, 184, 185, + 180, 186, 187, 177, 188, 189, 181, 192, 182, 190, + 191, 193, 194, 195, 196, 197, 198, 199, 200, 200, + 200, 200, 200, 201, 204, 649, 176, 183, 184, 185, + + 205, 186, 187, 177, 188, 189, 206, 192, 207, 190, + 191, 193, 194, 195, 196, 197, 198, 199, 202, 208, + 209, 211, 212, 201, 204, 203, 213, 214, 215, 216, + 205, 217, 218, 220, 219, 175, 206, 180, 207, 177, + 210, 221, 224, 181, 225, 649, 649, 649, 202, 208, + 209, 211, 212, 649, 649, 203, 213, 214, 215, 216, + 222, 217, 218, 220, 219, 175, 649, 180, 234, 177, + 210, 221, 224, 181, 225, 226, 193, 223, 192, 235, + 237, 227, 229, 228, 230, 236, 195, 238, 197, 241, + 222, 190, 191, 231, 239, 242, 232, 240, 234, 243, + + 233, 247, 249, 250, 649, 226, 193, 223, 192, 235, + 237, 227, 229, 228, 230, 236, 195, 238, 197, 241, + 244, 190, 191, 231, 239, 242, 232, 240, 248, 243, + 233, 247, 249, 250, 245, 252, 207, 246, 169, 169, + 169, 169, 169, 253, 254, 255, 257, 258, 259, 260, + 244, 261, 262, 263, 264, 265, 266, 267, 248, 268, + 269, 270, 256, 271, 245, 252, 207, 246, 272, 273, + 649, 649, 649, 253, 254, 255, 257, 258, 259, 260, + 274, 261, 262, 263, 264, 265, 266, 267, 275, 268, + 269, 270, 256, 271, 276, 277, 278, 279, 272, 273, + + 200, 200, 200, 200, 200, 280, 281, 282, 283, 284, + 274, 285, 286, 287, 288, 289, 259, 290, 275, 291, + 294, 292, 295, 296, 276, 277, 278, 279, 264, 265, + 293, 297, 298, 299, 300, 280, 281, 282, 283, 284, + 301, 285, 286, 287, 288, 289, 259, 290, 302, 291, + 294, 292, 295, 296, 309, 310, 315, 316, 264, 265, + 293, 297, 298, 299, 300, 303, 311, 317, 306, 304, + 301, 312, 307, 313, 318, 314, 305, 321, 302, 308, + 319, 320, 322, 323, 309, 310, 315, 316, 324, 325, + 326, 327, 328, 329, 330, 303, 311, 317, 306, 304, + + 331, 312, 307, 313, 318, 314, 305, 321, 332, 308, + 319, 320, 322, 323, 333, 334, 335, 336, 324, 325, + 326, 327, 328, 329, 330, 337, 339, 340, 341, 342, + 331, 343, 344, 345, 338, 346, 347, 348, 332, 349, + 350, 351, 352, 353, 333, 334, 335, 336, 355, 356, + 354, 357, 358, 359, 360, 337, 339, 340, 341, 342, + 362, 343, 344, 345, 338, 346, 347, 348, 361, 349, + 350, 351, 352, 353, 363, 364, 365, 366, 355, 356, + 354, 357, 358, 359, 360, 367, 368, 369, 370, 371, + 362, 372, 373, 374, 375, 376, 377, 378, 361, 379, + + 380, 381, 383, 384, 363, 364, 365, 366, 385, 386, + 387, 388, 389, 382, 390, 367, 368, 369, 370, 371, + 391, 372, 373, 374, 375, 376, 377, 378, 345, 379, + 380, 381, 383, 384, 392, 393, 394, 395, 385, 386, + 387, 388, 389, 382, 390, 396, 397, 398, 399, 400, + 391, 401, 402, 403, 404, 405, 406, 407, 345, 408, + 409, 410, 411, 412, 392, 393, 394, 395, 387, 414, + 415, 413, 416, 417, 418, 396, 397, 398, 399, 400, + 419, 401, 402, 403, 404, 405, 406, 407, 420, 408, + 409, 410, 411, 412, 421, 422, 423, 424, 387, 414, + + 415, 413, 416, 417, 418, 425, 426, 427, 428, 429, + 419, 430, 431, 432, 433, 434, 435, 436, 420, 437, + 440, 441, 438, 442, 421, 422, 423, 424, 439, 443, + 444, 445, 446, 447, 448, 425, 426, 427, 428, 429, + 449, 430, 431, 432, 433, 434, 435, 436, 450, 437, + 440, 441, 438, 442, 451, 453, 454, 455, 439, 443, + 444, 445, 446, 447, 448, 456, 457, 458, 459, 460, + 449, 461, 462, 463, 465, 466, 467, 468, 450, 469, + 470, 464, 471, 472, 451, 453, 454, 455, 473, 474, + 475, 476, 477, 478, 479, 456, 457, 458, 459, 460, + + 480, 461, 462, 463, 465, 466, 467, 468, 481, 469, + 470, 464, 471, 472, 482, 483, 484, 485, 473, 474, + 475, 476, 477, 478, 479, 486, 487, 488, 489, 491, + 480, 492, 493, 494, 495, 490, 496, 497, 481, 498, + 499, 500, 501, 502, 482, 483, 484, 485, 503, 504, + 505, 506, 507, 508, 509, 486, 487, 488, 489, 491, + 510, 492, 493, 494, 495, 490, 496, 497, 511, 498, + 499, 500, 501, 502, 512, 513, 514, 515, 503, 504, + 505, 506, 507, 508, 509, 516, 517, 518, 519, 521, + 510, 522, 523, 524, 525, 526, 527, 528, 511, 529, + + 530, 531, 520, 532, 512, 513, 514, 515, 533, 534, + 535, 536, 537, 538, 539, 516, 517, 518, 519, 521, + 540, 522, 523, 524, 525, 526, 527, 528, 541, 529, + 530, 531, 520, 532, 542, 543, 544, 545, 533, 534, + 535, 536, 537, 538, 539, 546, 547, 548, 549, 550, + 540, 551, 552, 553, 554, 555, 556, 557, 541, 558, + 559, 560, 561, 562, 542, 543, 544, 545, 563, 564, + 565, 566, 567, 568, 569, 546, 547, 548, 549, 550, + 570, 551, 552, 553, 554, 555, 556, 557, 571, 558, + 559, 560, 561, 562, 572, 573, 574, 575, 563, 564, + + 565, 566, 567, 568, 569, 578, 576, 579, 580, 581, + 570, 577, 582, 583, 584, 585, 586, 587, 571, 588, + 589, 590, 591, 592, 572, 573, 574, 575, 593, 594, + 595, 596, 597, 598, 599, 578, 576, 579, 580, 581, + 600, 577, 582, 583, 584, 585, 586, 587, 601, 588, + 589, 590, 591, 592, 602, 603, 604, 605, 593, 594, + 595, 596, 597, 598, 599, 606, 607, 608, 609, 610, + 600, 611, 612, 613, 614, 615, 616, 617, 601, 619, + 620, 621, 622, 623, 602, 603, 604, 605, 624, 625, + 626, 627, 628, 629, 630, 606, 607, 608, 609, 610, + + 631, 611, 612, 613, 614, 615, 616, 617, 632, 619, + 620, 621, 622, 623, 633, 634, 635, 636, 624, 625, + 626, 627, 628, 629, 630, 637, 638, 639, 640, 641, + 631, 642, 643, 644, 645, 646, 647, 648, 632, 649, + 649, 649, 649, 649, 633, 634, 635, 636, 649, 649, + 649, 649, 649, 649, 649, 637, 638, 639, 640, 641, + 649, 642, 643, 644, 645, 646, 647, 648, 73, 73, + 73, 79, 79, 79, 100, 100, 5, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, + + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649 } ; -static yyconst flex_int16_t yy_chk[805] = +static yyconst flex_int16_t yy_chk[1465] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -743,88 +832,160 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 3, 3, 3, 653, 3, 11, - 3, 13, 11, 3, 3, 3, 3, 3, 14, 18, - 3, 22, 20, 3, 14, 3, 22, 27, 27, 13, - 29, 29, 18, 20, 142, 22, 11, 23, 142, 23, - - 23, 23, 23, 23, 24, 14, 24, 24, 24, 24, - 24, 37, 38, 39, 41, 40, 43, 44, 37, 42, - 51, 51, 38, 39, 41, 37, 43, 42, 38, 40, - 46, 47, 48, 44, 49, 40, 46, 49, 23, 53, - 647, 56, 47, 66, 49, 58, 47, 48, 48, 66, - 48, 56, 58, 59, 61, 64, 56, 59, 62, 58, - 60, 63, 60, 59, 61, 60, 62, 65, 64, 59, - 60, 63, 67, 53, 64, 67, 68, 65, 67, 68, - 79, 67, 73, 65, 74, 73, 79, 74, 133, 80, - 160, 68, 68, 160, 68, 80, 91, 91, 91, 91, - - 91, 99, 99, 103, 117, 117, 106, 79, 133, 73, - 103, 74, 106, 120, 120, 92, 80, 92, 92, 92, - 92, 92, 93, 147, 93, 93, 93, 93, 93, 125, - 125, 125, 125, 125, 127, 143, 144, 150, 179, 144, - 147, 127, 143, 150, 151, 144, 152, 153, 164, 151, - 156, 156, 152, 150, 150, 179, 153, 288, 166, 153, - 188, 188, 164, 153, 288, 164, 166, 169, 169, 169, - 169, 169, 200, 200, 200, 200, 200, 225, 236, 238, - 247, 247, 236, 238, 225, 225, 225, 242, 269, 236, - 238, 294, 242, 317, 242, 353, 242, 269, 353, 412, - - 380, 473, 442, 645, 643, 294, 380, 412, 317, 442, - 642, 537, 640, 639, 638, 473, 537, 650, 650, 650, - 651, 651, 651, 652, 652, 637, 634, 633, 632, 631, - 629, 625, 624, 623, 621, 620, 619, 616, 610, 609, - 608, 607, 606, 605, 604, 603, 602, 601, 600, 599, - 598, 597, 596, 595, 594, 591, 589, 588, 587, 586, - 584, 583, 582, 580, 577, 576, 574, 572, 571, 570, - 568, 566, 564, 562, 561, 559, 556, 555, 554, 553, - 552, 551, 549, 546, 545, 544, 542, 540, 538, 534, - 533, 532, 531, 530, 529, 528, 527, 526, 525, 524, - - 522, 520, 519, 517, 516, 515, 514, 513, 512, 511, - 510, 509, 508, 507, 506, 505, 504, 503, 502, 501, - 500, 499, 496, 494, 493, 492, 491, 490, 489, 488, - 487, 486, 485, 484, 483, 482, 481, 480, 479, 478, - 477, 476, 475, 474, 472, 471, 470, 469, 468, 467, - 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 451, 450, 449, 447, 446, 445, - 444, 443, 441, 440, 439, 438, 437, 436, 435, 434, - 433, 432, 430, 429, 427, 425, 424, 423, 422, 421, - 420, 419, 418, 416, 414, 413, 410, 407, 406, 404, - - 402, 401, 400, 399, 397, 396, 395, 394, 393, 392, - 390, 389, 387, 386, 385, 384, 383, 382, 381, 379, - 378, 377, 376, 375, 374, 373, 372, 371, 370, 369, - 368, 367, 365, 363, 362, 361, 360, 359, 358, 357, - 356, 355, 354, 352, 350, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - 333, 332, 331, 329, 328, 327, 326, 325, 324, 322, - 320, 319, 318, 316, 315, 314, 313, 312, 311, 308, - 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, - 297, 296, 295, 293, 292, 291, 290, 289, 287, 285, - - 284, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 270, 268, 267, 266, 265, 264, 263, 262, 259, - 258, 257, 256, 255, 253, 252, 249, 248, 246, 245, - 244, 243, 241, 240, 235, 234, 233, 232, 231, 230, - 229, 228, 227, 224, 223, 221, 220, 218, 217, 214, - 213, 211, 210, 209, 208, 207, 206, 205, 204, 203, - 202, 201, 199, 198, 196, 195, 193, 192, 190, 189, - 187, 185, 184, 183, 182, 181, 180, 177, 176, 175, - 173, 168, 167, 165, 163, 162, 161, 159, 158, 157, - 155, 154, 149, 148, 146, 145, 141, 140, 137, 136, - - 135, 134, 132, 131, 130, 129, 128, 126, 124, 123, - 122, 121, 119, 118, 115, 114, 113, 112, 111, 110, - 109, 108, 105, 104, 102, 101, 95, 82, 76, 70, - 69, 57, 50, 45, 36, 35, 28, 17, 10, 9, - 5, 649, 649, 649, 649, 649, 649, 649, 649, 649, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 3, 3, 653, 3, 11, 3, 13, 11, 3, 3, + + 3, 3, 3, 14, 20, 3, 27, 27, 3, 14, + 3, 18, 29, 29, 13, 20, 600, 3, 3, 3, + 3, 3, 22, 3, 18, 3, 395, 22, 3, 3, + 3, 3, 3, 31, 32, 3, 22, 173, 3, 23, + 3, 23, 23, 23, 23, 23, 24, 11, 24, 24, + 24, 24, 24, 33, 41, 34, 14, 42, 35, 36, + 33, 39, 37, 31, 32, 34, 40, 33, 35, 39, + 41, 34, 37, 36, 43, 23, 40, 53, 73, 36, + 43, 73, 47, 33, 41, 34, 95, 42, 35, 36, + 33, 39, 37, 99, 99, 34, 40, 33, 35, 39, + + 41, 34, 37, 36, 43, 23, 40, 44, 45, 36, + 43, 46, 47, 44, 46, 48, 48, 44, 56, 57, + 58, 46, 61, 45, 45, 82, 45, 58, 56, 79, + 76, 73, 61, 56, 58, 79, 53, 28, 45, 74, + 69, 46, 74, 44, 46, 48, 48, 44, 56, 57, + 58, 46, 61, 45, 45, 59, 45, 58, 56, 59, + 62, 64, 61, 56, 58, 59, 63, 60, 62, 60, + 69, 59, 60, 66, 64, 70, 63, 60, 65, 66, + 64, 80, 79, 101, 17, 59, 102, 80, 65, 59, + 62, 64, 74, 104, 65, 59, 63, 60, 62, 60, + + 10, 59, 60, 66, 64, 70, 63, 60, 65, 66, + 64, 67, 68, 101, 67, 68, 102, 67, 65, 9, + 67, 5, 0, 104, 65, 0, 105, 68, 68, 0, + 68, 0, 0, 0, 80, 91, 91, 91, 91, 91, + 106, 67, 68, 0, 67, 68, 106, 67, 108, 92, + 67, 92, 92, 92, 92, 92, 105, 68, 68, 93, + 68, 93, 93, 93, 93, 93, 103, 109, 110, 111, + 106, 112, 113, 103, 114, 115, 106, 118, 108, 117, + 117, 119, 120, 120, 121, 122, 123, 124, 125, 125, + 125, 125, 125, 126, 128, 0, 103, 109, 110, 111, + + 129, 112, 113, 103, 114, 115, 130, 118, 131, 117, + 117, 119, 120, 120, 121, 122, 123, 124, 127, 132, + 133, 134, 135, 126, 128, 127, 136, 137, 140, 141, + 129, 142, 143, 145, 144, 142, 130, 144, 131, 143, + 133, 146, 148, 144, 149, 0, 0, 0, 127, 132, + 133, 134, 135, 0, 0, 127, 136, 137, 140, 141, + 147, 142, 143, 145, 144, 142, 0, 144, 154, 143, + 133, 146, 148, 144, 149, 150, 152, 147, 151, 155, + 157, 150, 152, 151, 153, 156, 156, 158, 159, 161, + 147, 150, 150, 153, 160, 162, 153, 160, 154, 163, + + 153, 165, 167, 168, 0, 150, 152, 147, 151, 155, + 157, 150, 152, 151, 153, 156, 156, 158, 159, 161, + 164, 150, 150, 153, 160, 162, 153, 160, 166, 163, + 153, 165, 167, 168, 164, 175, 166, 164, 169, 169, + 169, 169, 169, 176, 177, 179, 180, 181, 182, 183, + 164, 184, 185, 187, 188, 188, 189, 190, 166, 192, + 193, 195, 179, 196, 164, 175, 166, 164, 198, 199, + 0, 0, 0, 176, 177, 179, 180, 181, 182, 183, + 201, 184, 185, 187, 188, 188, 189, 190, 202, 192, + 193, 195, 179, 196, 203, 204, 205, 206, 198, 199, + + 200, 200, 200, 200, 200, 207, 208, 209, 210, 211, + 201, 213, 214, 217, 218, 220, 221, 223, 202, 224, + 227, 225, 228, 229, 203, 204, 205, 206, 225, 225, + 225, 230, 231, 232, 233, 207, 208, 209, 210, 211, + 234, 213, 214, 217, 218, 220, 221, 223, 235, 224, + 227, 225, 228, 229, 240, 241, 243, 244, 225, 225, + 225, 230, 231, 232, 233, 236, 242, 245, 238, 236, + 234, 242, 238, 242, 246, 242, 236, 248, 235, 238, + 247, 247, 249, 252, 240, 241, 243, 244, 253, 255, + 256, 257, 258, 259, 262, 236, 242, 245, 238, 236, + + 263, 242, 238, 242, 246, 242, 236, 248, 264, 238, + 247, 247, 249, 252, 265, 266, 267, 268, 253, 255, + 256, 257, 258, 259, 262, 269, 270, 273, 274, 275, + 263, 276, 277, 278, 269, 279, 280, 281, 264, 282, + 284, 285, 287, 288, 265, 266, 267, 268, 289, 290, + 288, 291, 292, 293, 294, 269, 270, 273, 274, 275, + 295, 276, 277, 278, 269, 279, 280, 281, 294, 282, + 284, 285, 287, 288, 296, 297, 298, 299, 289, 290, + 288, 291, 292, 293, 294, 300, 301, 302, 303, 304, + 295, 305, 306, 307, 308, 311, 312, 313, 294, 314, + + 315, 316, 318, 319, 296, 297, 298, 299, 320, 322, + 324, 325, 326, 317, 327, 300, 301, 302, 303, 304, + 328, 305, 306, 307, 308, 311, 312, 313, 317, 314, + 315, 316, 318, 319, 329, 331, 332, 333, 320, 322, + 324, 325, 326, 317, 327, 334, 335, 336, 337, 338, + 328, 339, 340, 341, 342, 343, 344, 345, 317, 346, + 347, 348, 350, 352, 329, 331, 332, 333, 353, 354, + 355, 353, 356, 357, 358, 334, 335, 336, 337, 338, + 359, 339, 340, 341, 342, 343, 344, 345, 360, 346, + 347, 348, 350, 352, 361, 362, 363, 365, 353, 354, + + 355, 353, 356, 357, 358, 367, 368, 369, 370, 371, + 359, 372, 373, 374, 375, 376, 377, 378, 360, 379, + 381, 382, 380, 383, 361, 362, 363, 365, 380, 384, + 385, 386, 387, 389, 390, 367, 368, 369, 370, 371, + 392, 372, 373, 374, 375, 376, 377, 378, 393, 379, + 381, 382, 380, 383, 394, 396, 397, 399, 380, 384, + 385, 386, 387, 389, 390, 400, 401, 402, 404, 406, + 392, 407, 410, 412, 413, 414, 416, 418, 393, 419, + 420, 412, 421, 422, 394, 396, 397, 399, 423, 424, + 425, 427, 429, 430, 432, 400, 401, 402, 404, 406, + + 433, 407, 410, 412, 413, 414, 416, 418, 434, 419, + 420, 412, 421, 422, 435, 436, 437, 438, 423, 424, + 425, 427, 429, 430, 432, 439, 440, 441, 442, 443, + 433, 444, 445, 446, 447, 442, 449, 450, 434, 451, + 453, 454, 455, 456, 435, 436, 437, 438, 457, 458, + 459, 460, 461, 462, 463, 439, 440, 441, 442, 443, + 464, 444, 445, 446, 447, 442, 449, 450, 465, 451, + 453, 454, 455, 456, 466, 467, 468, 469, 457, 458, + 459, 460, 461, 462, 463, 470, 471, 472, 473, 474, + 464, 475, 476, 477, 478, 479, 480, 481, 465, 482, + + 483, 484, 473, 485, 466, 467, 468, 469, 486, 487, + 488, 489, 490, 491, 492, 470, 471, 472, 473, 474, + 493, 475, 476, 477, 478, 479, 480, 481, 494, 482, + 483, 484, 473, 485, 496, 499, 500, 501, 486, 487, + 488, 489, 490, 491, 492, 502, 503, 504, 505, 506, + 493, 507, 508, 509, 510, 511, 512, 513, 494, 514, + 515, 516, 517, 519, 496, 499, 500, 501, 520, 522, + 524, 525, 526, 527, 528, 502, 503, 504, 505, 506, + 529, 507, 508, 509, 510, 511, 512, 513, 530, 514, + 515, 516, 517, 519, 531, 532, 533, 534, 520, 522, + + 524, 525, 526, 527, 528, 538, 537, 540, 542, 544, + 529, 537, 545, 546, 549, 551, 552, 553, 530, 554, + 555, 556, 559, 561, 531, 532, 533, 534, 562, 564, + 566, 568, 570, 571, 572, 538, 537, 540, 542, 544, + 574, 537, 545, 546, 549, 551, 552, 553, 576, 554, + 555, 556, 559, 561, 577, 580, 582, 583, 562, 564, + 566, 568, 570, 571, 572, 584, 586, 587, 588, 589, + 574, 591, 594, 595, 596, 597, 598, 599, 576, 601, + 602, 603, 604, 605, 577, 580, 582, 583, 606, 607, + 608, 609, 610, 616, 619, 584, 586, 587, 588, 589, + + 620, 591, 594, 595, 596, 597, 598, 599, 621, 601, + 602, 603, 604, 605, 623, 624, 625, 629, 606, 607, + 608, 609, 610, 616, 619, 631, 632, 633, 634, 637, + 620, 638, 639, 640, 642, 643, 645, 647, 621, 0, + 0, 0, 0, 0, 623, 624, 625, 629, 0, 0, + 0, 0, 0, 0, 0, 631, 632, 633, 634, 637, + 0, 638, 639, 640, 642, 643, 645, 647, 650, 650, + 650, 651, 651, 651, 652, 652, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, + + 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649 } ; @@ -888,21 +1049,27 @@ /* very inefficient method of unescaping strings */ static void unescape(char *buf) { - char *p, *p1; + char *p, *n; - for (p1=buf; (p=strchr(p1, '\\')) != 0; p1 = p+1) { - switch(p[1]) - { - case 'b' : p[1] = '\b'; break; - case 'f' : p[1] = '\f'; break; - case 'n' : p[1] = '\n'; break; - case 'r' : p[1] = '\r'; break; - case 't' : p[1] = '\t'; break; - case 'x' : - case 'u' : warning("unsupported escape sequence"); + n = p = buf; + while(*p) { + if(*p == '\\') { + switch(p[1]) + { + case 'b' : *n++ = '\b'; break; + case 'f' : *n++ = '\f'; break; + case 'n' : *n++ = '\n'; break; + case 'r' : *n++ = '\r'; break; + case 't' : *n++ = '\t'; break; + case 'x' : + case 'u' : warning("unsupported escape sequence"); + } + p+=2; + } else { + *n++ = *p++; } - strcpy(p, p+1); } + *n = 0; } void swf5ParseInit(const char *script, int debug) @@ -920,7 +1087,7 @@ } -#line 82 "swf5compiler.flex" +#line 88 "swf5compiler.flex" // forward declaration needed by the following function #ifndef YY_PROTO #ifdef YY_USE_PROTOS @@ -932,7 +1099,7 @@ static void yyunput YY_PROTO(( int c, char *buf_ptr )); void do_unput5(const char c) { unput(c); } -#line 936 "lex.swf5.c" +#line 1103 "lex.swf5.c" #define INITIAL 0 #define asm 1 @@ -951,6 +1118,35 @@ static int yy_init_globals (void ); +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int swf5lex_destroy (void ); + +int swf5get_debug (void ); + +void swf5set_debug (int debug_flag ); + +YY_EXTRA_TYPE swf5get_extra (void ); + +void swf5set_extra (YY_EXTRA_TYPE user_defined ); + +FILE *swf5get_in (void ); + +void swf5set_in (FILE * in_str ); + +FILE *swf5get_out (void ); + +void swf5set_out (FILE * out_str ); + +int swf5get_leng (void ); + +char *swf5get_text (void ); + +int swf5get_lineno (void ); + +void swf5set_lineno (int line_number ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -993,7 +1189,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( swf5text, swf5leng, 1, swf5out ) +#define ECHO fwrite( swf5text, swf5leng, 1, swf5out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1004,7 +1200,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( swf5in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1086,10 +1282,10 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 98 "swf5compiler.flex" +#line 104 "swf5compiler.flex" -#line 1093 "lex.swf5.c" +#line 1289 "lex.swf5.c" if ( !(yy_init) ) { @@ -1148,7 +1344,7 @@ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 742 ); + while ( yy_base[yy_current_state] != 1377 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1174,580 +1370,580 @@ case 1: YY_RULE_SETUP -#line 100 "swf5compiler.flex" +#line 106 "swf5compiler.flex" { count(); swf5lval.intVal = strtoul(swf5text, NULL, 0); return INTEGER; } YY_BREAK case 2: YY_RULE_SETUP -#line 102 "swf5compiler.flex" +#line 108 "swf5compiler.flex" { count(); swf5lval.intVal = strtoul(swf5text, NULL, 0); return INTEGER; } YY_BREAK case 3: YY_RULE_SETUP -#line 104 "swf5compiler.flex" +#line 110 "swf5compiler.flex" { count(); swf5lval.intVal = atoi(swf5text); return INTEGER; } YY_BREAK case 4: YY_RULE_SETUP -#line 106 "swf5compiler.flex" +#line 112 "swf5compiler.flex" { count(); swf5lval.doubleVal = atof(swf5text); return DOUBLE; } YY_BREAK case 5: YY_RULE_SETUP -#line 108 "swf5compiler.flex" +#line 114 "swf5compiler.flex" { count(); swf5lval.intVal = 1; return BOOLEAN; } YY_BREAK case 6: YY_RULE_SETUP -#line 110 "swf5compiler.flex" +#line 116 "swf5compiler.flex" { count(); swf5lval.intVal = 0; return BOOLEAN; } YY_BREAK case 7: YY_RULE_SETUP -#line 112 "swf5compiler.flex" +#line 118 "swf5compiler.flex" { count(); return NULLVAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 113 "swf5compiler.flex" +#line 119 "swf5compiler.flex" { count(); return BREAK; } YY_BREAK case 9: YY_RULE_SETUP -#line 114 "swf5compiler.flex" +#line 120 "swf5compiler.flex" { count(); return CONTINUE; } YY_BREAK case 10: YY_RULE_SETUP -#line 115 "swf5compiler.flex" +#line 121 "swf5compiler.flex" { count(); return FUNCTION; } YY_BREAK case 11: YY_RULE_SETUP -#line 116 "swf5compiler.flex" +#line 122 "swf5compiler.flex" { count(); return ELSE; } YY_BREAK case 12: YY_RULE_SETUP -#line 117 "swf5compiler.flex" +#line 123 "swf5compiler.flex" { count(); return SWITCH; } YY_BREAK case 13: YY_RULE_SETUP -#line 118 "swf5compiler.flex" +#line 124 "swf5compiler.flex" { count(); return CASE; } YY_BREAK case 14: YY_RULE_SETUP -#line 119 "swf5compiler.flex" +#line 125 "swf5compiler.flex" { count(); return DEFAULT; } YY_BREAK case 15: YY_RULE_SETUP -#line 120 "swf5compiler.flex" +#line 126 "swf5compiler.flex" { count(); return FOR; } YY_BREAK case 16: YY_RULE_SETUP -#line 121 "swf5compiler.flex" +#line 127 "swf5compiler.flex" { count(); return IN; } YY_BREAK case 17: YY_RULE_SETUP -#line 122 "swf5compiler.flex" +#line 128 "swf5compiler.flex" { count(); return IF; } YY_BREAK case 18: YY_RULE_SETUP -#line 123 "swf5compiler.flex" +#line 129 "swf5compiler.flex" { count(); return WHILE; } YY_BREAK case 19: YY_RULE_SETUP -#line 124 "swf5compiler.flex" +#line 130 "swf5compiler.flex" { count(); return DO; } YY_BREAK case 20: YY_RULE_SETUP -#line 125 "swf5compiler.flex" +#line 131 "swf5compiler.flex" { count(); return VAR; } YY_BREAK case 21: YY_RULE_SETUP -#line 126 "swf5compiler.flex" +#line 132 "swf5compiler.flex" { count(); return NEW; } YY_BREAK case 22: YY_RULE_SETUP -#line 127 "swf5compiler.flex" +#line 133 "swf5compiler.flex" { count(); return DELETE; } YY_BREAK case 23: YY_RULE_SETUP -#line 128 "swf5compiler.flex" +#line 134 "swf5compiler.flex" { count(); return RETURN; } YY_BREAK case 24: YY_RULE_SETUP -#line 129 "swf5compiler.flex" +#line 135 "swf5compiler.flex" { count(); return WITH; } YY_BREAK case 25: YY_RULE_SETUP -#line 130 "swf5compiler.flex" +#line 136 "swf5compiler.flex" { count(); BEGIN(asm); return ASM; } YY_BREAK case 26: YY_RULE_SETUP -#line 131 "swf5compiler.flex" +#line 137 "swf5compiler.flex" { count(); return EVAL; } YY_BREAK case 27: YY_RULE_SETUP -#line 132 "swf5compiler.flex" +#line 138 "swf5compiler.flex" { count(); return TYPEOF; } YY_BREAK case 28: YY_RULE_SETUP -#line 133 "swf5compiler.flex" +#line 139 "swf5compiler.flex" { count(); return INSTANCEOF; } YY_BREAK /* legacy functions */ case 29: YY_RULE_SETUP -#line 136 "swf5compiler.flex" +#line 142 "swf5compiler.flex" { count(); return RANDOM; } YY_BREAK case 30: YY_RULE_SETUP -#line 137 "swf5compiler.flex" +#line 143 "swf5compiler.flex" { count(); return GETTIMER; } YY_BREAK case 31: YY_RULE_SETUP -#line 138 "swf5compiler.flex" +#line 144 "swf5compiler.flex" { count(); return LENGTH; } YY_BREAK case 32: YY_RULE_SETUP -#line 139 "swf5compiler.flex" +#line 145 "swf5compiler.flex" { count(); return CONCAT; } YY_BREAK case 33: YY_RULE_SETUP -#line 140 "swf5compiler.flex" +#line 146 "swf5compiler.flex" { count(); return SUBSTR; } YY_BREAK case 34: YY_RULE_SETUP -#line 141 "swf5compiler.flex" +#line 147 "swf5compiler.flex" { count(); return TRACE; } YY_BREAK case 35: YY_RULE_SETUP -#line 142 "swf5compiler.flex" +#line 148 "swf5compiler.flex" { count(); return INT; } YY_BREAK case 36: YY_RULE_SETUP -#line 143 "swf5compiler.flex" +#line 149 "swf5compiler.flex" { count(); return ORD; } YY_BREAK case 37: YY_RULE_SETUP -#line 144 "swf5compiler.flex" +#line 150 "swf5compiler.flex" { count(); return CHR; } YY_BREAK case 38: YY_RULE_SETUP -#line 145 "swf5compiler.flex" +#line 151 "swf5compiler.flex" { count(); return GETURL; } YY_BREAK case 39: YY_RULE_SETUP -#line 146 "swf5compiler.flex" +#line 152 "swf5compiler.flex" { count(); return GETURL1; } YY_BREAK case 40: YY_RULE_SETUP -#line 147 "swf5compiler.flex" +#line 153 "swf5compiler.flex" { count(); return NEXTFRAME; } YY_BREAK case 41: YY_RULE_SETUP -#line 148 "swf5compiler.flex" +#line 154 "swf5compiler.flex" { count(); return PREVFRAME; } YY_BREAK case 42: YY_RULE_SETUP -#line 149 "swf5compiler.flex" +#line 155 "swf5compiler.flex" { count(); return PLAY; } YY_BREAK case 43: YY_RULE_SETUP -#line 150 "swf5compiler.flex" +#line 156 "swf5compiler.flex" { count(); return STOP; } YY_BREAK case 44: YY_RULE_SETUP -#line 151 "swf5compiler.flex" +#line 157 "swf5compiler.flex" { count(); return TOGGLEQUALITY; } YY_BREAK case 45: YY_RULE_SETUP -#line 152 "swf5compiler.flex" +#line 158 "swf5compiler.flex" { count(); return STOPSOUNDS; } YY_BREAK case 46: YY_RULE_SETUP -#line 153 "swf5compiler.flex" +#line 159 "swf5compiler.flex" { count(); return CALLFRAME; } YY_BREAK case 47: YY_RULE_SETUP -#line 154 "swf5compiler.flex" +#line 160 "swf5compiler.flex" { count(); return GOTOFRAME; } YY_BREAK case 48: YY_RULE_SETUP -#line 155 "swf5compiler.flex" +#line 161 "swf5compiler.flex" { count(); return SETTARGET; } YY_BREAK case 49: YY_RULE_SETUP -#line 156 "swf5compiler.flex" +#line 162 "swf5compiler.flex" { count(); return LOADVARIABLES; } YY_BREAK case 50: YY_RULE_SETUP -#line 157 "swf5compiler.flex" +#line 163 "swf5compiler.flex" { count(); return LOADMOVIE; } YY_BREAK case 51: YY_RULE_SETUP -#line 158 "swf5compiler.flex" +#line 164 "swf5compiler.flex" { count(); return LOADVARIABLESNUM; } YY_BREAK case 52: YY_RULE_SETUP -#line 159 "swf5compiler.flex" +#line 165 "swf5compiler.flex" { count(); return LOADMOVIENUM; } YY_BREAK case 53: YY_RULE_SETUP -#line 160 "swf5compiler.flex" +#line 166 "swf5compiler.flex" { count(); return DUPLICATEMOVIECLIP; } YY_BREAK case 54: YY_RULE_SETUP -#line 161 "swf5compiler.flex" +#line 167 "swf5compiler.flex" { count(); return REMOVEMOVIECLIP; } YY_BREAK /* assembler ops */ case 55: YY_RULE_SETUP -#line 165 "swf5compiler.flex" +#line 171 "swf5compiler.flex" { count(); return DUP; } YY_BREAK case 56: YY_RULE_SETUP -#line 166 "swf5compiler.flex" +#line 172 "swf5compiler.flex" { count(); return SWAP; } YY_BREAK case 57: YY_RULE_SETUP -#line 167 "swf5compiler.flex" +#line 173 "swf5compiler.flex" { count(); return POP; } YY_BREAK case 58: YY_RULE_SETUP -#line 168 "swf5compiler.flex" +#line 174 "swf5compiler.flex" { count(); return PUSH; } YY_BREAK case 59: YY_RULE_SETUP -#line 169 "swf5compiler.flex" +#line 175 "swf5compiler.flex" { count(); return SETREGISTER; } YY_BREAK case 60: YY_RULE_SETUP -#line 170 "swf5compiler.flex" +#line 176 "swf5compiler.flex" { count(); return CALLFUNCTION; } YY_BREAK case 61: YY_RULE_SETUP -#line 171 "swf5compiler.flex" +#line 177 "swf5compiler.flex" { count(); return CALLMETHOD; } YY_BREAK case 62: YY_RULE_SETUP -#line 172 "swf5compiler.flex" +#line 178 "swf5compiler.flex" { count(); return AND; } YY_BREAK case 63: YY_RULE_SETUP -#line 173 "swf5compiler.flex" +#line 179 "swf5compiler.flex" { count(); return OR; } YY_BREAK case 64: YY_RULE_SETUP -#line 174 "swf5compiler.flex" +#line 180 "swf5compiler.flex" { count(); return XOR; } YY_BREAK case 65: YY_RULE_SETUP -#line 175 "swf5compiler.flex" +#line 181 "swf5compiler.flex" { count(); return MODULO; } YY_BREAK case 66: YY_RULE_SETUP -#line 176 "swf5compiler.flex" +#line 182 "swf5compiler.flex" { count(); return ADD; } YY_BREAK case 67: YY_RULE_SETUP -#line 177 "swf5compiler.flex" +#line 183 "swf5compiler.flex" { count(); return ADD; } YY_BREAK case 68: YY_RULE_SETUP -#line 178 "swf5compiler.flex" +#line 184 "swf5compiler.flex" { count(); return LESSTHAN; } YY_BREAK case 69: YY_RULE_SETUP -#line 179 "swf5compiler.flex" +#line 185 "swf5compiler.flex" { count(); return LESSTHAN; } YY_BREAK case 70: YY_RULE_SETUP -#line 180 "swf5compiler.flex" +#line 186 "swf5compiler.flex" { count(); return EQUALS; } YY_BREAK case 71: YY_RULE_SETUP -#line 181 "swf5compiler.flex" +#line 187 "swf5compiler.flex" { count(); return EQUALS; } YY_BREAK case 72: YY_RULE_SETUP -#line 182 "swf5compiler.flex" +#line 188 "swf5compiler.flex" { count(); return INC; } YY_BREAK case 73: YY_RULE_SETUP -#line 183 "swf5compiler.flex" +#line 189 "swf5compiler.flex" { count(); return DEC; } YY_BREAK case 74: YY_RULE_SETUP -#line 184 "swf5compiler.flex" +#line 190 "swf5compiler.flex" { count(); return ENUMERATE; } YY_BREAK case 75: YY_RULE_SETUP -#line 185 "swf5compiler.flex" +#line 191 "swf5compiler.flex" { count(); return INITOBJECT; } YY_BREAK case 76: YY_RULE_SETUP -#line 186 "swf5compiler.flex" +#line 192 "swf5compiler.flex" { count(); return INITARRAY; } YY_BREAK case 77: YY_RULE_SETUP -#line 187 "swf5compiler.flex" +#line 193 "swf5compiler.flex" { count(); return GETMEMBER; } YY_BREAK case 78: YY_RULE_SETUP -#line 188 "swf5compiler.flex" +#line 194 "swf5compiler.flex" { count(); return SETMEMBER; } YY_BREAK case 79: YY_RULE_SETUP -#line 189 "swf5compiler.flex" +#line 195 "swf5compiler.flex" { count(); return SHIFTLEFT; } YY_BREAK case 80: YY_RULE_SETUP -#line 190 "swf5compiler.flex" +#line 196 "swf5compiler.flex" { count(); return SHIFTRIGHT; } YY_BREAK case 81: YY_RULE_SETUP -#line 191 "swf5compiler.flex" +#line 197 "swf5compiler.flex" { count(); return SHIFTRIGHT2; } YY_BREAK case 82: YY_RULE_SETUP -#line 192 "swf5compiler.flex" +#line 198 "swf5compiler.flex" { count(); return VAREQUALS; } YY_BREAK case 83: YY_RULE_SETUP -#line 193 "swf5compiler.flex" +#line 199 "swf5compiler.flex" { count(); return OLDADD; } YY_BREAK case 84: YY_RULE_SETUP -#line 194 "swf5compiler.flex" +#line 200 "swf5compiler.flex" { count(); return SUBTRACT; } YY_BREAK case 85: YY_RULE_SETUP -#line 195 "swf5compiler.flex" +#line 201 "swf5compiler.flex" { count(); return MULTIPLY; } YY_BREAK case 86: YY_RULE_SETUP -#line 196 "swf5compiler.flex" +#line 202 "swf5compiler.flex" { count(); return DIVIDE; } YY_BREAK case 87: YY_RULE_SETUP -#line 197 "swf5compiler.flex" +#line 203 "swf5compiler.flex" { count(); return OLDEQUALS; } YY_BREAK case 88: YY_RULE_SETUP -#line 198 "swf5compiler.flex" +#line 204 "swf5compiler.flex" { count(); return OLDLESSTHAN; } YY_BREAK case 89: YY_RULE_SETUP -#line 199 "swf5compiler.flex" +#line 205 "swf5compiler.flex" { count(); return LOGICALAND; } YY_BREAK case 90: YY_RULE_SETUP -#line 200 "swf5compiler.flex" +#line 206 "swf5compiler.flex" { count(); return LOGICALOR; } YY_BREAK case 91: YY_RULE_SETUP -#line 201 "swf5compiler.flex" +#line 207 "swf5compiler.flex" { count(); return NOT; } YY_BREAK case 92: YY_RULE_SETUP -#line 202 "swf5compiler.flex" +#line 208 "swf5compiler.flex" { count(); return STRINGEQ; } YY_BREAK case 93: YY_RULE_SETUP -#line 203 "swf5compiler.flex" +#line 209 "swf5compiler.flex" { count(); return STRINGLENGTH; } YY_BREAK case 94: YY_RULE_SETUP -#line 204 "swf5compiler.flex" +#line 210 "swf5compiler.flex" { count(); return SUBSTRING; } YY_BREAK case 95: YY_RULE_SETUP -#line 205 "swf5compiler.flex" +#line 211 "swf5compiler.flex" { count(); return GETVARIABLE; } YY_BREAK case 96: YY_RULE_SETUP -#line 206 "swf5compiler.flex" +#line 212 "swf5compiler.flex" { count(); return SETVARIABLE; } YY_BREAK case 97: YY_RULE_SETUP -#line 207 "swf5compiler.flex" +#line 213 "swf5compiler.flex" { count(); return SETTARGETEXPRESSION; } YY_BREAK case 98: YY_RULE_SETUP -#line 208 "swf5compiler.flex" +#line 214 "swf5compiler.flex" { count(); return STARTDRAG; } YY_BREAK case 99: YY_RULE_SETUP -#line 209 "swf5compiler.flex" +#line 215 "swf5compiler.flex" { count(); return STOPDRAG; } YY_BREAK case 100: YY_RULE_SETUP -#line 210 "swf5compiler.flex" +#line 216 "swf5compiler.flex" { count(); return STRINGLESSTHAN; } YY_BREAK case 101: YY_RULE_SETUP -#line 211 "swf5compiler.flex" +#line 217 "swf5compiler.flex" { count(); return MBLENGTH; } YY_BREAK case 102: YY_RULE_SETUP -#line 212 "swf5compiler.flex" +#line 218 "swf5compiler.flex" { count(); return MBSUBSTRING; } YY_BREAK case 103: YY_RULE_SETUP -#line 213 "swf5compiler.flex" +#line 219 "swf5compiler.flex" { count(); return MBORD; } YY_BREAK case 104: YY_RULE_SETUP -#line 214 "swf5compiler.flex" +#line 220 "swf5compiler.flex" { count(); return MBCHR; } YY_BREAK case 105: YY_RULE_SETUP -#line 215 "swf5compiler.flex" +#line 221 "swf5compiler.flex" { count(); return BRANCHALWAYS; } YY_BREAK case 106: YY_RULE_SETUP -#line 216 "swf5compiler.flex" +#line 222 "swf5compiler.flex" { count(); return BRANCHALWAYS; } YY_BREAK case 107: YY_RULE_SETUP -#line 217 "swf5compiler.flex" +#line 223 "swf5compiler.flex" { count(); return BRANCHIFTRUE; } YY_BREAK case 108: YY_RULE_SETUP -#line 218 "swf5compiler.flex" +#line 224 "swf5compiler.flex" { count(); return POST; } YY_BREAK case 109: YY_RULE_SETUP -#line 219 "swf5compiler.flex" +#line 225 "swf5compiler.flex" { count(); return GET; } YY_BREAK case 110: YY_RULE_SETUP -#line 220 "swf5compiler.flex" +#line 226 "swf5compiler.flex" { count(); return END; } YY_BREAK case 111: YY_RULE_SETUP -#line 223 "swf5compiler.flex" +#line 229 "swf5compiler.flex" { count(); swf5lval.str = strdup(swf5text+2); return REGISTER; } YY_BREAK case 112: YY_RULE_SETUP -#line 227 "swf5compiler.flex" +#line 233 "swf5compiler.flex" { count(); swf5lval.str = strdup(swf5text); return IDENTIFIER; } YY_BREAK case 113: /* rule 113 can match eol */ YY_RULE_SETUP -#line 230 "swf5compiler.flex" +#line 236 "swf5compiler.flex" { count(); swf5lval.str = strdup(swf5text+1); swf5lval.str[strlen(swf5lval.str)-1]=0; unescape(swf5lval.str); @@ -1756,7 +1952,7 @@ case 114: /* rule 114 can match eol */ YY_RULE_SETUP -#line 235 "swf5compiler.flex" +#line 241 "swf5compiler.flex" { count(); swf5lval.str = strdup(swf5text+1); swf5lval.str[strlen(swf5lval.str)-1]=0; unescape(swf5lval.str); @@ -1768,7 +1964,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up swf5text again */ YY_RULE_SETUP -#line 240 "swf5compiler.flex" +#line 246 "swf5compiler.flex" { count(); swf5lval.str = strdup(""); warning("Unterminated string!"); return STRING; } @@ -1779,264 +1975,264 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up swf5text again */ YY_RULE_SETUP -#line 244 "swf5compiler.flex" +#line 250 "swf5compiler.flex" { count(); swf5lval.str = strdup(""); warning("Unterminated string!"); return STRING; } YY_BREAK case 117: YY_RULE_SETUP -#line 248 "swf5compiler.flex" +#line 254 "swf5compiler.flex" { count(); comment(); } YY_BREAK case 118: YY_RULE_SETUP -#line 249 "swf5compiler.flex" +#line 255 "swf5compiler.flex" { count(); comment1(); } YY_BREAK case 119: YY_RULE_SETUP -#line 250 "swf5compiler.flex" +#line 256 "swf5compiler.flex" { count(); } YY_BREAK case 120: YY_RULE_SETUP -#line 252 "swf5compiler.flex" +#line 258 "swf5compiler.flex" { count(); return INCR; } YY_BREAK case 121: YY_RULE_SETUP -#line 253 "swf5compiler.flex" +#line 259 "swf5compiler.flex" { count(); return DECR; } YY_BREAK case 122: YY_RULE_SETUP -#line 254 "swf5compiler.flex" +#line 260 "swf5compiler.flex" { count(); return LE; } YY_BREAK case 123: YY_RULE_SETUP -#line 255 "swf5compiler.flex" +#line 261 "swf5compiler.flex" { count(); return GE; } YY_BREAK case 124: YY_RULE_SETUP -#line 256 "swf5compiler.flex" +#line 262 "swf5compiler.flex" { count(); return EQ; } YY_BREAK case 125: YY_RULE_SETUP -#line 257 "swf5compiler.flex" +#line 263 "swf5compiler.flex" { count(); return NE; } YY_BREAK case 126: YY_RULE_SETUP -#line 258 "swf5compiler.flex" +#line 264 "swf5compiler.flex" { count(); return LAN; } YY_BREAK case 127: YY_RULE_SETUP -#line 259 "swf5compiler.flex" +#line 265 "swf5compiler.flex" { count(); return LOR; } YY_BREAK case 128: YY_RULE_SETUP -#line 260 "swf5compiler.flex" +#line 266 "swf5compiler.flex" { count(); return MEQ; } YY_BREAK case 129: YY_RULE_SETUP -#line 261 "swf5compiler.flex" +#line 267 "swf5compiler.flex" { count(); return DEQ; } YY_BREAK case 130: YY_RULE_SETUP -#line 262 "swf5compiler.flex" +#line 268 "swf5compiler.flex" { count(); return IEQ; } YY_BREAK case 131: YY_RULE_SETUP -#line 263 "swf5compiler.flex" +#line 269 "swf5compiler.flex" { count(); return SEQ; } YY_BREAK case 132: YY_RULE_SETUP -#line 264 "swf5compiler.flex" +#line 270 "swf5compiler.flex" { count(); return AEQ; } YY_BREAK case 133: YY_RULE_SETUP -#line 265 "swf5compiler.flex" +#line 271 "swf5compiler.flex" { count(); return OEQ; } YY_BREAK case 134: YY_RULE_SETUP -#line 266 "swf5compiler.flex" +#line 272 "swf5compiler.flex" { count(); return SHL; } YY_BREAK case 135: YY_RULE_SETUP -#line 267 "swf5compiler.flex" +#line 273 "swf5compiler.flex" { count(); return SHR; } YY_BREAK case 136: YY_RULE_SETUP -#line 268 "swf5compiler.flex" +#line 274 "swf5compiler.flex" { count(); return SHR2; } YY_BREAK case 137: YY_RULE_SETUP -#line 269 "swf5compiler.flex" +#line 275 "swf5compiler.flex" { count(); return SHLEQ; } YY_BREAK case 138: YY_RULE_SETUP -#line 270 "swf5compiler.flex" +#line 276 "swf5compiler.flex" { count(); return SHREQ; } YY_BREAK case 139: YY_RULE_SETUP -#line 271 "swf5compiler.flex" +#line 277 "swf5compiler.flex" { count(); return SHR2EQ; } YY_BREAK case 140: YY_RULE_SETUP -#line 273 "swf5compiler.flex" +#line 279 "swf5compiler.flex" { count(); return '<'; } YY_BREAK case 141: YY_RULE_SETUP -#line 274 "swf5compiler.flex" +#line 280 "swf5compiler.flex" { count(); return '>'; } YY_BREAK case 142: YY_RULE_SETUP -#line 275 "swf5compiler.flex" +#line 281 "swf5compiler.flex" { count(); return ';'; } YY_BREAK case 143: YY_RULE_SETUP -#line 276 "swf5compiler.flex" +#line 282 "swf5compiler.flex" { count(); return '='; } YY_BREAK case 144: YY_RULE_SETUP -#line 277 "swf5compiler.flex" +#line 283 "swf5compiler.flex" { count(); return '+'; } YY_BREAK case 145: YY_RULE_SETUP -#line 278 "swf5compiler.flex" +#line 284 "swf5compiler.flex" { count(); return '-'; } YY_BREAK case 146: YY_RULE_SETUP -#line 279 "swf5compiler.flex" +#line 285 "swf5compiler.flex" { count(); return '&'; } YY_BREAK case 147: YY_RULE_SETUP -#line 280 "swf5compiler.flex" +#line 286 "swf5compiler.flex" { count(); return '|'; } YY_BREAK case 148: YY_RULE_SETUP -#line 281 "swf5compiler.flex" +#line 287 "swf5compiler.flex" { count(); return '^'; } YY_BREAK case 149: YY_RULE_SETUP -#line 282 "swf5compiler.flex" +#line 288 "swf5compiler.flex" { count(); return '*'; } YY_BREAK case 150: YY_RULE_SETUP -#line 283 "swf5compiler.flex" +#line 289 "swf5compiler.flex" { count(); return '/'; } YY_BREAK case 151: YY_RULE_SETUP -#line 284 "swf5compiler.flex" +#line 290 "swf5compiler.flex" { count(); return '%'; } YY_BREAK case 152: YY_RULE_SETUP -#line 285 "swf5compiler.flex" +#line 291 "swf5compiler.flex" { count(); return '!'; } YY_BREAK case 153: YY_RULE_SETUP -#line 286 "swf5compiler.flex" +#line 292 "swf5compiler.flex" { count(); return '('; } YY_BREAK case 154: YY_RULE_SETUP -#line 287 "swf5compiler.flex" +#line 293 "swf5compiler.flex" { count(); return ')'; } YY_BREAK case 155: YY_RULE_SETUP -#line 288 "swf5compiler.flex" +#line 294 "swf5compiler.flex" { count(); return '['; } YY_BREAK case 156: YY_RULE_SETUP -#line 289 "swf5compiler.flex" +#line 295 "swf5compiler.flex" { count(); return ']'; } YY_BREAK case 157: YY_RULE_SETUP -#line 290 "swf5compiler.flex" +#line 296 "swf5compiler.flex" { count(); return '{'; } YY_BREAK case 158: YY_RULE_SETUP -#line 291 "swf5compiler.flex" +#line 297 "swf5compiler.flex" { count(); BEGIN(0); return '}'; } YY_BREAK case 159: YY_RULE_SETUP -#line 292 "swf5compiler.flex" +#line 298 "swf5compiler.flex" { count(); return ','; } YY_BREAK case 160: YY_RULE_SETUP -#line 293 "swf5compiler.flex" +#line 299 "swf5compiler.flex" { count(); return '.'; } YY_BREAK case 161: YY_RULE_SETUP -#line 294 "swf5compiler.flex" +#line 300 "swf5compiler.flex" { count(); return '?'; } YY_BREAK case 162: YY_RULE_SETUP -#line 295 "swf5compiler.flex" +#line 301 "swf5compiler.flex" { count(); return ':'; } YY_BREAK case 163: YY_RULE_SETUP -#line 296 "swf5compiler.flex" +#line 302 "swf5compiler.flex" { count(); return '~'; } YY_BREAK case 164: /* rule 164 can match eol */ YY_RULE_SETUP -#line 298 "swf5compiler.flex" +#line 304 "swf5compiler.flex" { count(); strcpy(szLine, swf5text + 1); countline(); yyless(1); } YY_BREAK case 165: YY_RULE_SETUP -#line 301 "swf5compiler.flex" +#line 307 "swf5compiler.flex" SWF_error("Unrecognized character: %s\n", swf5text); YY_BREAK case 166: YY_RULE_SETUP -#line 303 "swf5compiler.flex" +#line 309 "swf5compiler.flex" ECHO; YY_BREAK -#line 2040 "lex.swf5.c" +#line 2236 "lex.swf5.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(asm): yyterminate(); @@ -2268,7 +2464,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2292,6 +2488,14 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) swf5realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -2717,7 +2921,9 @@ (yy_buffer_stack) = (struct yy_buffer_state**)swf5alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in swf5ensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -2735,6 +2941,8 @@ ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in swf5ensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -2779,7 +2987,7 @@ /** Setup the input buffer state to scan a string. The next call to swf5lex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use @@ -3033,7 +3241,7 @@ #define YYTABLES_NAME "yytables" -#line 303 "swf5compiler.flex" +#line 309 "swf5compiler.flex" static int getinput() { diff -Nru swftools-0.9.0/lib/action/swf5compiler.flex swftools-0.9.2/lib/action/swf5compiler.flex --- swftools-0.9.0/lib/action/swf5compiler.flex 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/action/swf5compiler.flex 2011-12-12 21:29:27.000000000 +0000 @@ -43,21 +43,27 @@ /* very inefficient method of unescaping strings */ static void unescape(char *buf) { - char *p, *p1; + char *p, *n; - for (p1=buf; (p=strchr(p1, '\\')) != 0; p1 = p+1) { - switch(p[1]) - { - case 'b' : p[1] = '\b'; break; - case 'f' : p[1] = '\f'; break; - case 'n' : p[1] = '\n'; break; - case 'r' : p[1] = '\r'; break; - case 't' : p[1] = '\t'; break; - case 'x' : - case 'u' : warning("unsupported escape sequence"); + n = p = buf; + while(*p) { + if(*p == '\\') { + switch(p[1]) + { + case 'b' : *n++ = '\b'; break; + case 'f' : *n++ = '\f'; break; + case 'n' : *n++ = '\n'; break; + case 'r' : *n++ = '\r'; break; + case 't' : *n++ = '\t'; break; + case 'x' : + case 'u' : warning("unsupported escape sequence"); + } + p+=2; + } else { + *n++ = *p++; } - strcpy(p, p+1); } + *n = 0; } void swf5ParseInit(const char *script, int debug) diff -Nru swftools-0.9.0/lib/art/art_affine.c swftools-0.9.2/lib/art/art_affine.c --- swftools-0.9.0/lib/art/art_affine.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_affine.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,458 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Simple manipulations with affine transformations */ - -#include "config.h" -#include "art_affine.h" -#include "art_misc.h" /* for M_PI */ - -#include -#include /* for sprintf */ -#include /* for strcpy */ - - -/* According to a strict interpretation of the libart structure, this - routine should go into its own module, art_point_affine. However, - it's only two lines of code, and it can be argued that it is one of - the natural basic functions of an affine transformation. -*/ - -/** - * art_affine_point: Do an affine transformation of a point. - * @dst: Where the result point is stored. - * @src: The original point. - @ @affine: The affine transformation. - **/ -void -art_affine_point (ArtPoint *dst, const ArtPoint *src, - const double affine[6]) -{ - double x, y; - - x = src->x; - y = src->y; - dst->x = x * affine[0] + y * affine[2] + affine[4]; - dst->y = x * affine[1] + y * affine[3] + affine[5]; -} - -/** - * art_affine_invert: Find the inverse of an affine transformation. - * @dst: Where the resulting affine is stored. - * @src: The original affine transformation. - * - * All non-degenerate affine transforms are invertible. If the original - * affine is degenerate or nearly so, expect numerical instability and - * very likely core dumps on Alpha and other fp-picky architectures. - * Otherwise, @dst multiplied with @src, or @src multiplied with @dst - * will be (to within roundoff error) the identity affine. - **/ -void -art_affine_invert (double dst[6], const double src[6]) -{ - double r_det; - - r_det = 1.0 / (src[0] * src[3] - src[1] * src[2]); - dst[0] = src[3] * r_det; - dst[1] = -src[1] * r_det; - dst[2] = -src[2] * r_det; - dst[3] = src[0] * r_det; - dst[4] = -src[4] * dst[0] - src[5] * dst[2]; - dst[5] = -src[4] * dst[1] - src[5] * dst[3]; -} - -/** - * art_affine_flip: Flip an affine transformation horizontally and/or vertically. - * @dst_affine: Where the resulting affine is stored. - * @src_affine: The original affine transformation. - * @horiz: Whether or not to flip horizontally. - * @vert: Whether or not to flip horizontally. - * - * Flips the affine transform. FALSE for both @horiz and @vert implements - * a simple copy operation. TRUE for both @horiz and @vert is a - * 180 degree rotation. It is ok for @src_affine and @dst_affine to - * be equal pointers. - **/ -void -art_affine_flip (double dst_affine[6], const double src_affine[6], int horz, int vert) -{ - dst_affine[0] = horz ? - src_affine[0] : src_affine[0]; - dst_affine[1] = horz ? - src_affine[1] : src_affine[1]; - dst_affine[2] = vert ? - src_affine[2] : src_affine[2]; - dst_affine[3] = vert ? - src_affine[3] : src_affine[3]; - dst_affine[4] = horz ? - src_affine[4] : src_affine[4]; - dst_affine[5] = vert ? - src_affine[5] : src_affine[5]; -} - -#define EPSILON 1e-6 - -/* It's ridiculous I have to write this myself. This is hardcoded to - six digits of precision, which is good enough for PostScript. - - The return value is the number of characters (i.e. strlen (str)). - It is no more than 12. */ -static int -art_ftoa (char str[80], double x) -{ - char *p = str; - int i, j; - - p = str; - if (fabs (x) < EPSILON / 2) - { - strcpy (str, "0"); - return 1; - } - if (x < 0) - { - *p++ = '-'; - x = -x; - } - if ((int)floor ((x + EPSILON / 2) < 1)) - { - *p++ = '0'; - *p++ = '.'; - i = sprintf (p, "%06d", (int)floor ((x + EPSILON / 2) * 1e6)); - while (i && p[i - 1] == '0') - i--; - if (i == 0) - i--; - p += i; - } - else if (x < 1e6) - { - i = sprintf (p, "%d", (int)floor (x + EPSILON / 2)); - p += i; - if (i < 6) - { - int ix; - - *p++ = '.'; - x -= floor (x + EPSILON / 2); - for (j = i; j < 6; j++) - x *= 10; - ix = floor (x + 0.5); - - for (j = 0; j < i; j++) - ix *= 10; - - /* A cheap hack, this routine can round wrong for fractions - near one. */ - if (ix == 1000000) - ix = 999999; - - sprintf (p, "%06d", ix); - i = 6 - i; - while (i && p[i - 1] == '0') - i--; - if (i == 0) - i--; - p += i; - } - } - else - p += sprintf (p, "%g", x); - - *p = '\0'; - return p - str; -} - - - -#include -/** - * art_affine_to_string: Convert affine transformation to concise PostScript string representation. - * @str: Where to store the resulting string. - * @src: The affine transform. - * - * Converts an affine transform into a bit of PostScript code that - * implements the transform. Special cases of scaling, rotation, and - * translation are detected, and the corresponding PostScript - * operators used (this greatly aids understanding the output - * generated). The identity transform is mapped to the null string. - **/ -void -art_affine_to_string (char str[128], const double src[6]) -{ - char tmp[80]; - int i, ix; - -#if 0 - for (i = 0; i < 1000; i++) - { - double d = rand () * .1 / RAND_MAX; - art_ftoa (tmp, d); - printf ("%g %f %s\n", d, d, tmp); - } -#endif - if (fabs (src[4]) < EPSILON && fabs (src[5]) < EPSILON) - { - /* could be scale or rotate */ - if (fabs (src[1]) < EPSILON && fabs (src[2]) < EPSILON) - { - /* scale */ - if (fabs (src[0] - 1) < EPSILON && fabs (src[3] - 1) < EPSILON) - { - /* identity transform */ - str[0] = '\0'; - return; - } - else - { - ix = 0; - ix += art_ftoa (str + ix, src[0]); - str[ix++] = ' '; - ix += art_ftoa (str + ix, src[3]); - strcpy (str + ix, " scale"); - return; - } - } - else - { - /* could be rotate */ - if (fabs (src[0] - src[3]) < EPSILON && - fabs (src[1] + src[2]) < EPSILON && - fabs (src[0] * src[0] + src[1] * src[1] - 1) < 2 * EPSILON) - { - double theta; - - theta = (180 / M_PI) * atan2 (src[1], src[0]); - art_ftoa (tmp, theta); - sprintf (str, "%s rotate", tmp); - return; - } - } - } - else - { - /* could be translate */ - if (fabs (src[0] - 1) < EPSILON && fabs (src[1]) < EPSILON && - fabs (src[2]) < EPSILON && fabs (src[3] - 1) < EPSILON) - { - ix = 0; - ix += art_ftoa (str + ix, src[4]); - str[ix++] = ' '; - ix += art_ftoa (str + ix, src[5]); - strcpy (str + ix, " translate"); - return; - } - } - - ix = 0; - str[ix++] = '['; - str[ix++] = ' '; - for (i = 0; i < 6; i++) - { - ix += art_ftoa (str + ix, src[i]); - str[ix++] = ' '; - } - strcpy (str + ix, "] concat"); -} - -/** - * art_affine_multiply: Multiply two affine transformation matrices. - * @dst: Where to store the result. - * @src1: The first affine transform to multiply. - * @src2: The second affine transform to multiply. - * - * Multiplies two affine transforms together, i.e. the resulting @dst - * is equivalent to doing first @src1 then @src2. Note that the - * PostScript concat operator multiplies on the left, i.e. "M concat" - * is equivalent to "CTM = multiply (M, CTM)"; - * - * It is safe to call this function with @dst equal to @src1 or @src2. - **/ -void -art_affine_multiply (double dst[6], const double src1[6], const double src2[6]) -{ - double d0, d1, d2, d3, d4, d5; - - d0 = src1[0] * src2[0] + src1[1] * src2[2]; - d1 = src1[0] * src2[1] + src1[1] * src2[3]; - d2 = src1[2] * src2[0] + src1[3] * src2[2]; - d3 = src1[2] * src2[1] + src1[3] * src2[3]; - d4 = src1[4] * src2[0] + src1[5] * src2[2] + src2[4]; - d5 = src1[4] * src2[1] + src1[5] * src2[3] + src2[5]; - dst[0] = d0; - dst[1] = d1; - dst[2] = d2; - dst[3] = d3; - dst[4] = d4; - dst[5] = d5; -} - -/** - * art_affine_identity: Set up the identity matrix. - * @dst: Where to store the resulting affine transform. - * - * Sets up an identity matrix. - **/ -void -art_affine_identity (double dst[6]) -{ - dst[0] = 1; - dst[1] = 0; - dst[2] = 0; - dst[3] = 1; - dst[4] = 0; - dst[5] = 0; -} - - -/** - * art_affine_scale: Set up a scaling matrix. - * @dst: Where to store the resulting affine transform. - * @sx: X scale factor. - * @sy: Y scale factor. - * - * Sets up a scaling matrix. - **/ -void -art_affine_scale (double dst[6], double sx, double sy) -{ - dst[0] = sx; - dst[1] = 0; - dst[2] = 0; - dst[3] = sy; - dst[4] = 0; - dst[5] = 0; -} - -/** - * art_affine_rotate: Set up a rotation affine transform. - * @dst: Where to store the resulting affine transform. - * @theta: Rotation angle in degrees. - * - * Sets up a rotation matrix. In the standard libart coordinate - * system, in which increasing y moves downward, this is a - * counterclockwise rotation. In the standard PostScript coordinate - * system, which is reversed in the y direction, it is a clockwise - * rotation. - **/ -void -art_affine_rotate (double dst[6], double theta) -{ - double s, c; - - s = sin (theta * M_PI / 180.0); - c = cos (theta * M_PI / 180.0); - dst[0] = c; - dst[1] = s; - dst[2] = -s; - dst[3] = c; - dst[4] = 0; - dst[5] = 0; -} - -/** - * art_affine_shear: Set up a shearing matrix. - * @dst: Where to store the resulting affine transform. - * @theta: Shear angle in degrees. - * - * Sets up a shearing matrix. In the standard libart coordinate system - * and a small value for theta, || becomes \\. Horizontal lines remain - * unchanged. - **/ -void -art_affine_shear (double dst[6], double theta) -{ - double t; - - t = tan (theta * M_PI / 180.0); - dst[0] = 1; - dst[1] = 0; - dst[2] = t; - dst[3] = 1; - dst[4] = 0; - dst[5] = 0; -} - -/** - * art_affine_translate: Set up a translation matrix. - * @dst: Where to store the resulting affine transform. - * @tx: X translation amount. - * @tx: Y translation amount. - * - * Sets up a translation matrix. - **/ -void -art_affine_translate (double dst[6], double tx, double ty) -{ - dst[0] = 1; - dst[1] = 0; - dst[2] = 0; - dst[3] = 1; - dst[4] = tx; - dst[5] = ty; -} - -/** - * art_affine_expansion: Find the affine's expansion factor. - * @src: The affine transformation. - * - * Finds the expansion factor, i.e. the square root of the factor - * by which the affine transform affects area. In an affine transform - * composed of scaling, rotation, shearing, and translation, returns - * the amount of scaling. - * - * Return value: the expansion factor. - **/ -double -art_affine_expansion (const double src[6]) -{ - return sqrt (fabs (src[0] * src[3] - src[1] * src[2])); -} - -/** - * art_affine_rectilinear: Determine whether the affine transformation is rectilinear. - * @src: The original affine transformation. - * - * Determines whether @src is rectilinear, i.e. grid-aligned - * rectangles are transformed to other grid-aligned rectangles. The - * implementation has epsilon-tolerance for roundoff errors. - * - * Return value: TRUE if @src is rectilinear. - **/ -int -art_affine_rectilinear (const double src[6]) -{ - return ((fabs (src[1]) < EPSILON && fabs (src[2]) < EPSILON) || - (fabs (src[0]) < EPSILON && fabs (src[3]) < EPSILON)); -} - -/** - * art_affine_equal: Determine whether two affine transformations are equal. - * @matrix1: An affine transformation. - * @matrix2: Another affine transformation. - * - * Determines whether @matrix1 and @matrix2 are equal, with - * epsilon-tolerance for roundoff errors. - * - * Return value: TRUE if @matrix1 and @matrix2 are equal. - **/ -int -art_affine_equal (double matrix1[6], double matrix2[6]) -{ - return (fabs (matrix1[0] - matrix2[0]) < EPSILON && - fabs (matrix1[1] - matrix2[1]) < EPSILON && - fabs (matrix1[2] - matrix2[2]) < EPSILON && - fabs (matrix1[3] - matrix2[3]) < EPSILON && - fabs (matrix1[4] - matrix2[4]) < EPSILON && - fabs (matrix1[5] - matrix2[5]) < EPSILON); -} diff -Nru swftools-0.9.0/lib/art/art_affine.h swftools-0.9.2/lib/art/art_affine.h --- swftools-0.9.0/lib/art/art_affine.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_affine.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_AFFINE_H__ -#define __ART_AFFINE_H__ - -#ifdef LIBART_COMPILATION -#include "art_point.h" -#else -#include "art_point.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_affine_point (ArtPoint *dst, const ArtPoint *src, - const double affine[6]); - -void -art_affine_invert (double dst_affine[6], const double src_affine[6]); - -/* flip the matrix, FALSE, FALSE is a simple copy operation, and - TRUE, TRUE equals a rotation by 180 degrees */ -void -art_affine_flip (double dst_affine[6], const double src_affine[6], - int horz, int vert); - -void -art_affine_to_string (char str[128], const double src[6]); - -void -art_affine_multiply (double dst[6], - const double src1[6], const double src2[6]); - -/* set up the identity matrix */ -void -art_affine_identity (double dst[6]); - -/* set up a scaling matrix */ -void -art_affine_scale (double dst[6], double sx, double sy); - -/* set up a rotation matrix; theta is given in degrees */ -void -art_affine_rotate (double dst[6], double theta); - -/* set up a shearing matrix; theta is given in degrees */ -void -art_affine_shear (double dst[6], double theta); - -/* set up a translation matrix */ -void -art_affine_translate (double dst[6], double tx, double ty); - - -/* find the affine's "expansion factor", i.e. the scale amount */ -double -art_affine_expansion (const double src[6]); - -/* Determine whether the affine transformation is rectilinear, - i.e. whether a rectangle aligned to the grid is transformed into - another rectangle aligned to the grid. */ -int -art_affine_rectilinear (const double src[6]); - -/* Determine whether two affine transformations are equal within grid allignment */ -int -art_affine_equal (double matrix1[6], double matrix2[6]); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_AFFINE_H__ */ diff -Nru swftools-0.9.0/lib/art/art_alphagamma.c swftools-0.9.2/lib/art/art_alphagamma.c --- swftools-0.9.0/lib/art/art_alphagamma.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_alphagamma.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Some functions to build alphagamma tables */ - -#include "config.h" -#include "art_alphagamma.h" - -#include - -/** - * art_alphagamma_new: Create a new #ArtAlphaGamma. - * @gamma: Gamma value. - * - * Create a new #ArtAlphaGamma for a specific value of @gamma. When - * correctly implemented (which is generally not the case in libart), - * alpha compositing with an alphagamma parameter is equivalent to - * applying the gamma transformation to source images, doing the alpha - * compositing (in linear intensity space), then applying the inverse - * gamma transformation, bringing it back to a gamma-adjusted - * intensity space. - * - * Return value: The newly created #ArtAlphaGamma. - **/ -ArtAlphaGamma * -art_alphagamma_new (double gamma) -{ - int tablesize; - ArtAlphaGamma *alphagamma; - int i; - int *table; - art_u8 *invtable; - double s, r_gamma; - - tablesize = ceil (gamma * 8); - if (tablesize < 10) - tablesize = 10; - - alphagamma = (ArtAlphaGamma *)art_alloc (sizeof(ArtAlphaGamma) + - ((1 << tablesize) - 1) * - sizeof(art_u8)); - alphagamma->gamma = gamma; - alphagamma->invtable_size = tablesize; - - table = alphagamma->table; - for (i = 0; i < 256; i++) - table[i] = (int)floor (((1 << tablesize) - 1) * - pow (i * (1.0 / 255), gamma) + 0.5); - - invtable = alphagamma->invtable; - s = 1.0 / ((1 << tablesize) - 1); - r_gamma = 1.0 / gamma; - for (i = 0; i < 1 << tablesize; i++) - invtable[i] = (int)floor (255 * pow (i * s, r_gamma) + 0.5); - - return alphagamma; -} - -/** - * art_alphagamma_free: Free an #ArtAlphaGamma. - * @alphagamma: An #ArtAlphaGamma. - * - * Frees the #ArtAlphaGamma. - **/ -void -art_alphagamma_free (ArtAlphaGamma *alphagamma) -{ - art_free (alphagamma); -} diff -Nru swftools-0.9.0/lib/art/art_alphagamma.h swftools-0.9.2/lib/art/art_alphagamma.h --- swftools-0.9.0/lib/art/art_alphagamma.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_alphagamma.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_ALPHAGAMMA_H__ -#define __ART_ALPHAGAMMA_H__ - -/* Alphagamma tables */ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#else -#include "art_misc.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtAlphaGamma ArtAlphaGamma; - -struct _ArtAlphaGamma { - /*< private >*/ - double gamma; - int invtable_size; - int table[256]; - art_u8 invtable[1]; -}; - -ArtAlphaGamma * -art_alphagamma_new (double gamma); - -void -art_alphagamma_free (ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/art_bpath.c swftools-0.9.2/lib/art/art_bpath.c --- swftools-0.9.0/lib/art/art_bpath.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_bpath.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Basic constructors and operations for bezier paths */ - -#include "config.h" -#include "art_bpath.h" - -#include - - -/** - * art_bpath_affine_transform: Affine transform an #ArtBpath. - * @src: The source #ArtBpath. - * @matrix: The affine transform. - * - * Affine transform the bezpath, returning a newly allocated #ArtBpath - * (allocated using art_alloc()). - * - * Result (x', y') = (matrix[0] * x + matrix[2] * y + matrix[4], - * matrix[1] * x + matrix[3] * y + matrix[5]) - * - * Return value: the transformed #ArtBpath. - **/ -ArtBpath * -art_bpath_affine_transform (const ArtBpath *src, const double matrix[6]) -{ - int i; - int size; - ArtBpath *xnew; - ArtPathcode code; - double x, y; - - for (i = 0; src[i].code != ART_END; i++); - size = i; - - xnew = art_new (ArtBpath, size + 1); - - for (i = 0; i < size; i++) - { - code = src[i].code; - xnew[i].code = code; - if (code == ART_CURVETO) - { - x = src[i].x1; - y = src[i].y1; - xnew[i].x1 = matrix[0] * x + matrix[2] * y + matrix[4]; - xnew[i].y1 = matrix[1] * x + matrix[3] * y + matrix[5]; - x = src[i].x2; - y = src[i].y2; - xnew[i].x2 = matrix[0] * x + matrix[2] * y + matrix[4]; - xnew[i].y2 = matrix[1] * x + matrix[3] * y + matrix[5]; - } - else - { - xnew[i].x1 = 0; - xnew[i].y1 = 0; - xnew[i].x2 = 0; - xnew[i].y2 = 0; - } - x = src[i].x3; - y = src[i].y3; - xnew[i].x3 = matrix[0] * x + matrix[2] * y + matrix[4]; - xnew[i].y3 = matrix[1] * x + matrix[3] * y + matrix[5]; - } - xnew[i].code = ART_END; - xnew[i].x1 = 0; - xnew[i].y1 = 0; - xnew[i].x2 = 0; - xnew[i].y2 = 0; - xnew[i].x3 = 0; - xnew[i].y3 = 0; - - return xnew; -} - diff -Nru swftools-0.9.0/lib/art/art_bpath.h swftools-0.9.2/lib/art/art_bpath.h --- swftools-0.9.0/lib/art/art_bpath.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_bpath.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_BPATH_H__ -#define __ART_BPATH_H__ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#include "art_point.h" -#include "art_pathcode.h" -#else -#include "art_misc.h" -#include "art_point.h" -#include "art_pathcode.h" -#endif - -/* Basic data structures and constructors for bezier paths */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtBpath ArtBpath; - -struct _ArtBpath { - /*< public >*/ - ArtPathcode code; - double x1; - double y1; - double x2; - double y2; - double x3; - double y3; -}; - -ArtBpath * -art_bpath_affine_transform (const ArtBpath *src, const double matrix[6]); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_BPATH_H__ */ diff -Nru swftools-0.9.0/lib/art/art_config.h swftools-0.9.2/lib/art/art_config.h --- swftools-0.9.0/lib/art/art_config.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -/* Automatically generated by gen_art_config.c */ - -#define ART_SIZEOF_CHAR 1 -#define ART_SIZEOF_SHORT 2 -#define ART_SIZEOF_INT 4 -#define ART_SIZEOF_LONG 4 - -typedef unsigned char art_u8; -typedef unsigned short art_u16; -typedef unsigned int art_u32; diff -Nru swftools-0.9.0/lib/art/art_filterlevel.h swftools-0.9.2/lib/art/art_filterlevel.h --- swftools-0.9.0/lib/art/art_filterlevel.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_filterlevel.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_FILTERLEVEL_H__ -#define __ART_FILTERLEVEL_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef enum { - ART_FILTER_NEAREST, - ART_FILTER_TILES, - ART_FILTER_BILINEAR, - ART_FILTER_HYPER -} ArtFilterLevel; - -/* NEAREST is nearest neighbor. It is the fastest and lowest quality. - - TILES is an accurate simulation of the PostScript image operator - without any interpolation enabled; each pixel is rendered as a tiny - parallelogram of solid color, the edges of which are implemented - with antialiasing. It resembles nearest neighbor for enlargement, - and bilinear for reduction. - - BILINEAR is bilinear interpolation. For enlargement, it is - equivalent to point-sampling the ideal bilinear-interpolated - image. For reduction, it is equivalent to laying down small tiles - and integrating over the coverage area. - - HYPER is the highest quality reconstruction function. It is derived - from the hyperbolic filters in Wolberg's "Digital Image Warping," - and is formally defined as the hyperbolic-filter sampling the ideal - hyperbolic-filter interpolated image (the filter is designed to be - idempotent for 1:1 pixel mapping). It is the slowest and highest - quality. - - Note: at this stage of implementation, most filter modes are likely - not to be implemented. - - Note: cubic filtering is missing from this list, because there isn't - much point - hyper is just as fast to implement and slightly better - in quality. - -*/ - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_PATHCODE_H__ */ diff -Nru swftools-0.9.0/lib/art/art_gray_svp.c swftools-0.9.2/lib/art/art_gray_svp.c --- swftools-0.9.0/lib/art/art_gray_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_gray_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Render a sorted vector path into a graymap. */ - -#include "config.h" -#include "art_gray_svp.h" - -#include /* for memset */ -#include "art_misc.h" - -#include "art_svp.h" -#include "art_svp_render_aa.h" - -typedef struct _ArtGraySVPData ArtGraySVPData; - -struct _ArtGraySVPData { - art_u8 *buf; - int rowstride; - int x0, x1; -}; - -static void -art_gray_svp_callback (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtGraySVPData *data = (ArtGraySVPData *)callback_data; - art_u8 *linebuf; - int run_x0, run_x1; - int running_sum = start; - int x0, x1; - int k; - -#if 0 - printf ("start = %d", start); - running_sum = start; - for (k = 0; k < n_steps; k++) - { - running_sum += steps[k].delta; - printf (" %d:%d", steps[k].x, running_sum >> 16); - } - printf ("\n"); -#endif - - linebuf = data->buf; - x0 = data->x0; - x1 = data->x1; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - if (run_x1 > x0) - memset (linebuf, running_sum >> 16, run_x1 - x0); - - for (k = 0; k < n_steps - 1; k++) - { - running_sum += steps[k].delta; - run_x0 = run_x1; - run_x1 = steps[k + 1].x; - if (run_x1 > run_x0) - memset (linebuf + run_x0 - x0, running_sum >> 16, run_x1 - run_x0); - } - running_sum += steps[k].delta; - if (x1 > run_x1) - memset (linebuf + run_x1 - x0, running_sum >> 16, x1 - run_x1); - } - else - { - memset (linebuf, running_sum >> 16, x1 - x0); - } - - data->buf += data->rowstride; -} - -/** - * art_gray_svp_aa: Render the vector path into the bytemap. - * @svp: The SVP to render. - * @x0: The view window's left coord. - * @y0: The view window's top coord. - * @x1: The view window's right coord. - * @y1: The view window's bottom coord. - * @buf: The buffer where the bytemap is stored. - * @rowstride: the rowstride for @buf. - * - * Each pixel gets a value proportional to the area within the pixel - * overlapping the (filled) SVP. Pixel (x, y) is stored at: - * - * @buf[(y - * @y0) * @rowstride + (x - @x0)] - * - * All pixels @x0 <= x < @x1, @y0 <= y < @y1 are generated. A - * stored value of zero is no coverage, and a value of 255 is full - * coverage. The area within the pixel (x, y) is the region covered - * by [x..x+1] and [y..y+1]. - **/ -void -art_gray_svp_aa (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - art_u8 *buf, int rowstride) -{ - ArtGraySVPData data; - - data.buf = buf; - data.rowstride = rowstride; - data.x0 = x0; - data.x1 = x1; - art_svp_render_aa (svp, x0, y0, x1, y1, art_gray_svp_callback, &data); -} diff -Nru swftools-0.9.0/lib/art/art_gray_svp.h swftools-0.9.2/lib/art/art_gray_svp.h --- swftools-0.9.0/lib/art/art_gray_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_gray_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Render a sorted vector path into a graymap. */ - -#ifndef __ART_GRAY_SVP_H__ -#define __ART_GRAY_SVP_H__ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#include "art_svp.h" -#else -#include "art_misc.h" -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_gray_svp_aa (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - art_u8 *buf, int rowstride); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_GRAY_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/art_misc.c swftools-0.9.2/lib/art/art_misc.c --- swftools-0.9.0/lib/art/art_misc.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_misc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Various utility functions RLL finds useful. */ - -#include "config.h" -#include "art_misc.h" - -#ifdef HAVE_UINSTD_H -#include -#endif -#include -#include - -/** - * art_die: Print the error message to stderr and exit with a return code of 1. - * @fmt: The printf-style format for the error message. - * - * Used for dealing with severe errors. - **/ -void -art_die (const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - vfprintf (stderr, fmt, ap); - va_end (ap); - exit (1); -} - -/** - * art_warn: Print the warning message to stderr. - * @fmt: The printf-style format for the warning message. - * - * Used for generating warnings. - **/ -void -art_warn (const char *fmt, ...) -{ - va_list ap; - - fprintf(stderr, "warn: "); - va_start (ap, fmt); - vfprintf (stderr, fmt, ap); - va_end (ap); -} - -/** - * art_dprint: Print the debug message to stderr. - * @fmt: The printf-style format for the debug message. - * - * Used for generating debug output. - **/ -void -art_dprint (const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - vfprintf (stderr, fmt, ap); - va_end (ap); -} - diff -Nru swftools-0.9.0/lib/art/art_misc.h swftools-0.9.2/lib/art/art_misc.h --- swftools-0.9.0/lib/art/art_misc.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_misc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Simple macros to set up storage allocation and basic types for libart - functions. */ - -#ifndef __ART_MISC_H__ -#define __ART_MISC_H__ - -#include /* for malloc, etc. */ - -/* The art_config.h file is automatically generated by - gen_art_config.c and contains definitions of - ART_SIZEOF_{CHAR,SHORT,INT,LONG} and art_u{8,16,32}. */ -#ifdef LIBART_COMPILATION -#include "art_config.h" -#else -#include "art_config.h" -#endif - -#include "../mem.h" -#ifdef __mem_h__ -#define art_alloc rfx_alloc -#define art_free rfx_free -#define art_realloc rfx_realloc -#else -#define art_alloc malloc -#define art_free free -#define art_realloc realloc -#endif - -/* These aren't, strictly speaking, configuration macros, but they're - damn handy to have around, and may be worth playing with for - debugging. */ -#define art_new(type, n) ((type *)art_alloc ((n) * sizeof(type))) - -#define art_renew(p, type, n) ((type *)art_realloc (p, (n) * sizeof(type))) - -/* This one must be used carefully - in particular, p and max should - be variables. They can also be pstruct->el lvalues. */ -#define art_expand(p, type, max) do { if(max) { p = art_renew (p, type, max <<= 1); } else { max = 1; p = art_new(type, 1); } } while (0) - -typedef int art_boolean; -#define ART_FALSE 0 -#define ART_TRUE 1 - -/* define pi */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif /* M_PI */ - -#ifndef M_SQRT2 -#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ -#endif /* M_SQRT2 */ - -/* Provide macros to feature the GCC function attribute. - */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) -#define ART_GNUC_PRINTF( format_idx, arg_idx ) \ - __attribute__((format (printf, format_idx, arg_idx))) -#define ART_GNUC_NORETURN \ - __attribute__((noreturn)) -#else /* !__GNUC__ */ -#define ART_GNUC_PRINTF( format_idx, arg_idx ) -#define ART_GNUC_NORETURN -#endif /* !__GNUC__ */ - -#ifdef __cplusplus -extern "C" { -#endif - -void ART_GNUC_NORETURN -art_die (const char *fmt, ...) ART_GNUC_PRINTF (1, 2); - -void -art_warn (const char *fmt, ...) ART_GNUC_PRINTF (1, 2); - -void -art_dprint (const char *fmt, ...) ART_GNUC_PRINTF (1, 2); - -#ifdef __cplusplus -} -#endif - -#define ART_USE_NEW_INTERSECTOR - -#endif /* __ART_MISC_H__ */ diff -Nru swftools-0.9.0/lib/art/art_pathcode.h swftools-0.9.2/lib/art/art_pathcode.h --- swftools-0.9.0/lib/art/art_pathcode.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_pathcode.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_PATHCODE_H__ -#define __ART_PATHCODE_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef enum { - ART_MOVETO, - ART_MOVETO_OPEN, - ART_CURVETO, - ART_LINETO, - ART_END -} ArtPathcode; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_PATHCODE_H__ */ diff -Nru swftools-0.9.0/lib/art/art_pixbuf.c swftools-0.9.2/lib/art/art_pixbuf.c --- swftools-0.9.0/lib/art/art_pixbuf.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_pixbuf.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_pixbuf.h" - -#include "art_misc.h" -#include - -/** - * art_pixbuf_new_rgb_dnotify: Create a new RGB #ArtPixBuf with explicit destroy notification. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * @dfunc_data: The private data passed to @dfunc. - * @dfunc: The destroy notification function. - * - * Creates a generic data structure for holding a buffer of RGB - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * @dfunc is called with @dfunc_data and @pixels as arguments when the - * #ArtPixBuf is destroyed. Using a destroy notification function - * allows a wide range of memory management disciplines for the pixel - * memory. A NULL value for @dfunc is also allowed and means that no - * special action will be taken on destruction. - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_rgb_dnotify (art_u8 *pixels, int width, int height, int rowstride, - void *dfunc_data, ArtDestroyNotify dfunc) -{ - ArtPixBuf *pixbuf; - - pixbuf = art_new (ArtPixBuf, 1); - - pixbuf->format = ART_PIX_RGB; - pixbuf->n_channels = 3; - pixbuf->has_alpha = 0; - pixbuf->bits_per_sample = 8; - - pixbuf->pixels = (art_u8 *) pixels; - pixbuf->width = width; - pixbuf->height = height; - pixbuf->rowstride = rowstride; - pixbuf->destroy_data = dfunc_data; - pixbuf->destroy = dfunc; - - return pixbuf; -} - -/** - * art_pixbuf_new_rgba_dnotify: Create a new RGBA #ArtPixBuf with explicit destroy notification. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * @dfunc_data: The private data passed to @dfunc. - * @dfunc: The destroy notification function. - * - * Creates a generic data structure for holding a buffer of RGBA - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * @dfunc is called with @dfunc_data and @pixels as arguments when the - * #ArtPixBuf is destroyed. Using a destroy notification function - * allows a wide range of memory management disciplines for the pixel - * memory. A NULL value for @dfunc is also allowed and means that no - * special action will be taken on destruction. - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstride, - void *dfunc_data, ArtDestroyNotify dfunc) -{ - ArtPixBuf *pixbuf; - - pixbuf = art_new (ArtPixBuf, 1); - - pixbuf->format = ART_PIX_RGB; - pixbuf->n_channels = 4; - pixbuf->has_alpha = 1; - pixbuf->bits_per_sample = 8; - - pixbuf->pixels = (art_u8 *) pixels; - pixbuf->width = width; - pixbuf->height = height; - pixbuf->rowstride = rowstride; - pixbuf->destroy_data = dfunc_data; - pixbuf->destroy = dfunc; - - return pixbuf; -} - -/** - * art_pixbuf_new_const_rgb: Create a new RGB #ArtPixBuf with constant pixel data. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGB - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * No action is taken when the #ArtPixBuf is destroyed. Thus, this - * function is useful when the pixel data is constant or statically - * allocated. - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgb_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL); -} - -/** - * art_pixbuf_new_const_rgba: Create a new RGBA #ArtPixBuf with constant pixel data. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGBA - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * No action is taken when the #ArtPixBuf is destroyed. Thus, this - * function is suitable when the pixel data is constant or statically - * allocated. - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgba_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL); -} - -static void -art_pixel_destroy (void *func_data, void *data) -{ - art_free (data); -} - -/** - * art_pixbuf_new_rgb: Create a new RGB #ArtPixBuf. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGB - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * The @pixels buffer is freed with art_free() when the #ArtPixBuf is - * destroyed. Thus, this function is suitable when the pixel data is - * allocated with art_alloc(). - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgb_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy); -} - -/** - * art_pixbuf_new_rgba: Create a new RGBA #ArtPixBuf. - * @pixels: A buffer containing the actual pixel data. - * @width: The width of the pixbuf. - * @height: The height of the pixbuf. - * @rowstride: The rowstride of the pixbuf. - * - * Creates a generic data structure for holding a buffer of RGBA - * pixels. It is possible to think of an #ArtPixBuf as a - * virtualization over specific pixel buffer formats. - * - * The @pixels buffer is freed with art_free() when the #ArtPixBuf is - * destroyed. Thus, this function is suitable when the pixel data is - * allocated with art_alloc(). - * - * Return value: The newly created #ArtPixBuf. - **/ -ArtPixBuf * -art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride) -{ - return art_pixbuf_new_rgba_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy); -} - -/** - * art_pixbuf_free: Destroy an #ArtPixBuf. - * @pixbuf: The #ArtPixBuf to be destroyed. - * - * Destroys the #ArtPixBuf, calling the destroy notification function - * (if non-NULL) so that the memory for the pixel buffer can be - * properly reclaimed. - **/ -void -art_pixbuf_free (ArtPixBuf *pixbuf) -{ - ArtDestroyNotify destroy = pixbuf->destroy; - void *destroy_data = pixbuf->destroy_data; - art_u8 *pixels = pixbuf->pixels; - - pixbuf->pixels = NULL; - pixbuf->destroy = NULL; - pixbuf->destroy_data = NULL; - - if (destroy) - destroy (destroy_data, pixels); - - art_free (pixbuf); -} - -/** - * art_pixbuf_free_shallow: - * @pixbuf: The #ArtPixBuf to be destroyed. - * - * Destroys the #ArtPixBuf without calling the destroy notification function. - * - * This function is deprecated. Use the _dnotify variants for - * allocation instead. - **/ -void -art_pixbuf_free_shallow (ArtPixBuf *pixbuf) -{ - art_free (pixbuf); -} - -/** - * art_pixbuf_duplicate: Duplicate a pixbuf. - * @pixbuf: The #ArtPixBuf to duplicate. - * - * Duplicates a pixbuf, including duplicating the buffer. - * - * Return value: The duplicated pixbuf. - **/ -ArtPixBuf * -art_pixbuf_duplicate (const ArtPixBuf *pixbuf) -{ - ArtPixBuf *result; - int size; - - result = art_new (ArtPixBuf, 1); - - result->format = pixbuf->format; - result->n_channels = pixbuf->n_channels; - result->has_alpha = pixbuf->has_alpha; - result->bits_per_sample = pixbuf->bits_per_sample; - - size = (pixbuf->height - 1) * pixbuf->rowstride + - pixbuf->width * ((pixbuf->n_channels * pixbuf->bits_per_sample + 7) >> 3); - result->pixels = (art_u8*)art_alloc (size); - memcpy (result->pixels, pixbuf->pixels, size); - - result->width = pixbuf->width; - result->height = pixbuf->height; - result->rowstride = pixbuf->rowstride; - result->destroy_data = NULL; - result->destroy = art_pixel_destroy; - - return result; -} diff -Nru swftools-0.9.0/lib/art/art_pixbuf.h swftools-0.9.2/lib/art/art_pixbuf.h --- swftools-0.9.0/lib/art/art_pixbuf.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_pixbuf.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_PIXBUF_H__ -#define __ART_PIXBUF_H__ - -/* A generic data structure for holding a buffer of pixels. One way - to think about this module is as a virtualization over specific - pixel buffer formats. */ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#else -#include "art_misc.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef void (*ArtDestroyNotify) (void *func_data, void *data); - -typedef struct _ArtPixBuf ArtPixBuf; - -typedef enum { - ART_PIX_RGB - /* gray, cmyk, lab, ... ? */ -} ArtPixFormat; - - -/* The pixel buffer consists of width * height pixels, each of which - has n_channels samples. It is stored in simple packed format. */ - -struct _ArtPixBuf { - /*< public >*/ - ArtPixFormat format; - int n_channels; - int has_alpha; - int bits_per_sample; - - art_u8 *pixels; - int width; - int height; - int rowstride; - void *destroy_data; - ArtDestroyNotify destroy; -}; - -/* allocate an ArtPixBuf from art_alloc()ed pixels (automated destruction) */ -ArtPixBuf * -art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride); - -ArtPixBuf * -art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride); - -/* allocate an ArtPixBuf from constant pixels (no destruction) */ -ArtPixBuf * -art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride); - -ArtPixBuf * -art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride); - -/* allocate an ArtPixBuf and notify creator upon destruction */ -ArtPixBuf * -art_pixbuf_new_rgb_dnotify (art_u8 *pixels, int width, int height, int rowstride, - void *dfunc_data, ArtDestroyNotify dfunc); - -ArtPixBuf * -art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstride, - void *dfunc_data, ArtDestroyNotify dfunc); - -/* free an ArtPixBuf with destroy notification */ -void -art_pixbuf_free (ArtPixBuf *pixbuf); - -/* deprecated function, use the _dnotify variants for allocation instead */ -void -art_pixbuf_free_shallow (ArtPixBuf *pixbuf); - -ArtPixBuf * -art_pixbuf_duplicate (const ArtPixBuf *pixbuf); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_point.h swftools-0.9.2/lib/art/art_point.h --- swftools-0.9.0/lib/art/art_point.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_point.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_POINT_H__ -#define __ART_POINT_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtPoint ArtPoint; - -struct _ArtPoint { - /*< public >*/ - double x, y; -}; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_POINT_H__ */ diff -Nru swftools-0.9.0/lib/art/art_rect.c swftools-0.9.2/lib/art/art_rect.c --- swftools-0.9.0/lib/art/art_rect.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rect.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rect.h" - -#include - -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif /* MAX */ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif /* MIN */ - -/* rectangle primitives stolen from gzilla */ - -/** - * art_irect_copy: Make a copy of an integer rectangle. - * @dest: Where the copy is stored. - * @src: The source rectangle. - * - * Copies the rectangle. - **/ -void -art_irect_copy (ArtIRect *dest, const ArtIRect *src) { - dest->x0 = src->x0; - dest->y0 = src->y0; - dest->x1 = src->x1; - dest->y1 = src->y1; -} - -/** - * art_irect_union: Find union of two integer rectangles. - * @dest: Where the result is stored. - * @src1: A source rectangle. - * @src2: Another source rectangle. - * - * Finds the smallest rectangle that includes @src1 and @src2. - **/ -void -art_irect_union (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2) { - if (art_irect_empty (src1)) { - art_irect_copy (dest, src2); - } else if (art_irect_empty (src2)) { - art_irect_copy (dest, src1); - } else { - dest->x0 = MIN (src1->x0, src2->x0); - dest->y0 = MIN (src1->y0, src2->y0); - dest->x1 = MAX (src1->x1, src2->x1); - dest->y1 = MAX (src1->y1, src2->y1); - } -} - -/** - * art_irect_intersection: Find intersection of two integer rectangles. - * @dest: Where the result is stored. - * @src1: A source rectangle. - * @src2: Another source rectangle. - * - * Finds the intersection of @src1 and @src2. - **/ -void -art_irect_intersect (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2) { - dest->x0 = MAX (src1->x0, src2->x0); - dest->y0 = MAX (src1->y0, src2->y0); - dest->x1 = MIN (src1->x1, src2->x1); - dest->y1 = MIN (src1->y1, src2->y1); -} - -/** - * art_irect_empty: Determine whether integer rectangle is empty. - * @src: The source rectangle. - * - * Return value: TRUE if @src is an empty rectangle, FALSE otherwise. - **/ -int -art_irect_empty (const ArtIRect *src) { - return (src->x1 <= src->x0 || src->y1 <= src->y0); -} - -#if 0 -gboolean irect_point_inside (ArtIRect *rect, GzwPoint *point) { - return (point->x >= rect->x0 && point->y >= rect->y0 && - point->x < rect->x1 && point->y < rect->y1); -} -#endif - -/** - * art_drect_copy: Make a copy of a rectangle. - * @dest: Where the copy is stored. - * @src: The source rectangle. - * - * Copies the rectangle. - **/ -void -art_drect_copy (ArtDRect *dest, const ArtDRect *src) { - dest->x0 = src->x0; - dest->y0 = src->y0; - dest->x1 = src->x1; - dest->y1 = src->y1; -} - -/** - * art_drect_union: Find union of two rectangles. - * @dest: Where the result is stored. - * @src1: A source rectangle. - * @src2: Another source rectangle. - * - * Finds the smallest rectangle that includes @src1 and @src2. - **/ -void -art_drect_union (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) { - if (art_drect_empty (src1)) { - art_drect_copy (dest, src2); - } else if (art_drect_empty (src2)) { - art_drect_copy (dest, src1); - } else { - dest->x0 = MIN (src1->x0, src2->x0); - dest->y0 = MIN (src1->y0, src2->y0); - dest->x1 = MAX (src1->x1, src2->x1); - dest->y1 = MAX (src1->y1, src2->y1); - } -} - -/** - * art_drect_intersection: Find intersection of two rectangles. - * @dest: Where the result is stored. - * @src1: A source rectangle. - * @src2: Another source rectangle. - * - * Finds the intersection of @src1 and @src2. - **/ -void -art_drect_intersect (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) { - dest->x0 = MAX (src1->x0, src2->x0); - dest->y0 = MAX (src1->y0, src2->y0); - dest->x1 = MIN (src1->x1, src2->x1); - dest->y1 = MIN (src1->y1, src2->y1); -} - -/** - * art_irect_empty: Determine whether rectangle is empty. - * @src: The source rectangle. - * - * Return value: TRUE if @src is an empty rectangle, FALSE otherwise. - **/ -int -art_drect_empty (const ArtDRect *src) { - return (src->x1 <= src->x0 || src->y1 <= src->y0); -} - -/** - * art_drect_affine_transform: Affine transform rectangle. - * @dst: Where to store the result. - * @src: The source rectangle. - * @matrix: The affine transformation. - * - * Find the smallest rectangle enclosing the affine transformed @src. - * The result is exactly the affine transformation of @src when - * @matrix specifies a rectilinear affine transformation, otherwise it - * is a conservative approximation. - **/ -void -art_drect_affine_transform (ArtDRect *dst, const ArtDRect *src, const double matrix[6]) -{ - double x00, y00, x10, y10; - double x01, y01, x11, y11; - - x00 = src->x0 * matrix[0] + src->y0 * matrix[2] + matrix[4]; - y00 = src->x0 * matrix[1] + src->y0 * matrix[3] + matrix[5]; - x10 = src->x1 * matrix[0] + src->y0 * matrix[2] + matrix[4]; - y10 = src->x1 * matrix[1] + src->y0 * matrix[3] + matrix[5]; - x01 = src->x0 * matrix[0] + src->y1 * matrix[2] + matrix[4]; - y01 = src->x0 * matrix[1] + src->y1 * matrix[3] + matrix[5]; - x11 = src->x1 * matrix[0] + src->y1 * matrix[2] + matrix[4]; - y11 = src->x1 * matrix[1] + src->y1 * matrix[3] + matrix[5]; - dst->x0 = MIN (MIN (x00, x10), MIN (x01, x11)); - dst->y0 = MIN (MIN (y00, y10), MIN (y01, y11)); - dst->x1 = MAX (MAX (x00, x10), MAX (x01, x11)); - dst->y1 = MAX (MAX (y00, y10), MAX (y01, y11)); -} - -/** - * art_drect_to_irect: Convert rectangle to integer rectangle. - * @dst: Where to store resulting integer rectangle. - * @src: The source rectangle. - * - * Find the smallest integer rectangle that encloses @src. - **/ -void -art_drect_to_irect (ArtIRect *dst, ArtDRect *src) -{ - dst->x0 = floor (src->x0); - dst->y0 = floor (src->y0); - dst->x1 = ceil (src->x1); - dst->y1 = ceil (src->y1); -} diff -Nru swftools-0.9.0/lib/art/art_rect.h swftools-0.9.2/lib/art/art_rect.h --- swftools-0.9.0/lib/art/art_rect.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RECT_H__ -#define __ART_RECT_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _ArtDRect ArtDRect; -typedef struct _ArtIRect ArtIRect; - -struct _ArtDRect { - /*< public >*/ - double x0, y0, x1, y1; -}; - -struct _ArtIRect { - /*< public >*/ - int x0, y0, x1, y1; -}; - -/* Make a copy of the rectangle. */ -void art_irect_copy (ArtIRect *dest, const ArtIRect *src); - -/* Find the smallest rectangle that includes both source rectangles. */ -void art_irect_union (ArtIRect *dest, - const ArtIRect *src1, const ArtIRect *src2); - -/* Return the intersection of the two rectangles */ -void art_irect_intersect (ArtIRect *dest, - const ArtIRect *src1, const ArtIRect *src2); - -/* Return true if the rectangle is empty. */ -int art_irect_empty (const ArtIRect *src); - -/* Make a copy of the rectangle. */ -void art_drect_copy (ArtDRect *dest, const ArtDRect *src); - -/* Find the smallest rectangle that includes both source rectangles. */ -void art_drect_union (ArtDRect *dest, - const ArtDRect *src1, const ArtDRect *src2); - -/* Return the intersection of the two rectangles */ -void art_drect_intersect (ArtDRect *dest, - const ArtDRect *src1, const ArtDRect *src2); - -/* Return true if the rectangle is empty. */ -int art_drect_empty (const ArtDRect *src); - -void -art_drect_affine_transform (ArtDRect *dst, const ArtDRect *src, - const double matrix[6]); - -void art_drect_to_irect (ArtIRect *dst, ArtDRect *src); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rect_svp.c swftools-0.9.2/lib/art/art_rect_svp.c --- swftools-0.9.0/lib/art/art_rect_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rect_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rect_svp.h" - -#include "art_misc.h" -#include "art_svp.h" -#include "art_rect.h" - -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif /* MAX */ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif /* MIN */ - -/** - * art_drect_svp: Find the bounding box of a sorted vector path. - * @bbox: Where to store the bounding box. - * @svp: The SVP. - * - * Finds the bounding box of the SVP. - **/ -void -art_drect_svp (ArtDRect *bbox, const ArtSVP *svp) -{ - int i; - - if (svp->n_segs == 0) - { - bbox->x0 = 0; - bbox->y0 = 0; - bbox->x1 = 0; - bbox->y1 = 0; - return; - } - - art_drect_copy (bbox, &svp->segs[0].bbox); - - for (i = 1; i < svp->n_segs; i++) - { - bbox->x0 = MIN (bbox->x0, svp->segs[i].bbox.x0); - bbox->y0 = MIN (bbox->y0, svp->segs[i].bbox.y0); - bbox->x1 = MAX (bbox->x1, svp->segs[i].bbox.x1); - bbox->y1 = MAX (bbox->y1, svp->segs[i].bbox.y1); - } -} - -/** - * art_drect_svp_union: Compute the bounding box of the svp and union it in to the existing bounding box. - * @bbox: Initial boundin box and where to store the bounding box. - * @svp: The SVP. - * - * Finds the bounding box of the SVP, computing its union with an - * existing bbox. - **/ -void -art_drect_svp_union (ArtDRect *bbox, const ArtSVP *svp) -{ - ArtDRect svp_bbox; - - art_drect_svp (&svp_bbox, svp); - art_drect_union (bbox, bbox, &svp_bbox); -} diff -Nru swftools-0.9.0/lib/art/art_rect_svp.h swftools-0.9.2/lib/art/art_rect_svp.h --- swftools-0.9.0/lib/art/art_rect_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rect_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RECT_SVP_H__ -#define __ART_RECT_SVP_H__ - -/* Find the bounding box of a sorted vector path. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#else -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_drect_svp (ArtDRect *bbox, const ArtSVP *svp); - -/* Compute the bounding box of the svp and union it in to the - existing bounding box. */ -void -art_drect_svp_union (ArtDRect *bbox, const ArtSVP *svp); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RECT_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/art_rect_uta.c swftools-0.9.2/lib/art/art_rect_uta.c --- swftools-0.9.0/lib/art/art_rect_uta.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rect_uta.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rect_uta.h" - -/* Functions to decompose a microtile array into a list of rectangles. */ - -/** - * art_rect_list_from_uta: Decompose uta into list of rectangles. - * @uta: The source uta. - * @max_width: The maximum width of the resulting rectangles. - * @max_height: The maximum height of the resulting rectangles. - * @p_nrects: Where to store the number of returned rectangles. - * - * Allocates a new list of rectangles, sets *@p_nrects to the number - * in the list. This list should be freed with art_free(). - * - * Each rectangle bounded in size by (@max_width, @max_height). - * However, these bounds must be at least the size of one tile. - * - * This routine provides a precise implementation, i.e. the rectangles - * cover exactly the same area as the uta. It is thus appropriate in - * cases where the overhead per rectangle is small compared with the - * cost of filling in extra pixels. - * - * Return value: An array containing the resulting rectangles. - **/ -ArtIRect * -art_rect_list_from_uta (ArtUta *uta, int max_width, int max_height, - int *p_nrects) -{ - ArtIRect *rects; - int n_rects, n_rects_max; - int x, y; - int width, height; - int ix; - int left_ix; - ArtUtaBbox *utiles; - ArtUtaBbox bb; - int x0, y0, x1, y1; - int *glom; - int glom_rect; - - n_rects = 0; - n_rects_max = 1; - rects = art_new (ArtIRect, n_rects_max); - - width = uta->width; - height = uta->height; - utiles = uta->utiles; - - glom = art_new (int, width * height); - for (ix = 0; ix < width * height; ix++) - glom[ix] = -1; - - ix = 0; - for (y = 0; y < height; y++) - for (x = 0; x < width; x++) - { - bb = utiles[ix]; - if (bb) - { - x0 = ((uta->x0 + x) << ART_UTILE_SHIFT) + ART_UTA_BBOX_X0(bb); - y0 = ((uta->y0 + y) << ART_UTILE_SHIFT) + ART_UTA_BBOX_Y0(bb); - y1 = ((uta->y0 + y) << ART_UTILE_SHIFT) + ART_UTA_BBOX_Y1(bb); - - left_ix = ix; - /* now try to extend to the right */ - while (x != width - 1 && - ART_UTA_BBOX_X1(bb) == ART_UTILE_SIZE && - (((bb & 0xffffff) ^ utiles[ix + 1]) & 0xffff00ff) == 0 && - (((uta->x0 + x + 1) << ART_UTILE_SHIFT) + - ART_UTA_BBOX_X1(utiles[ix + 1]) - - x0) <= max_width) - { - bb = utiles[ix + 1]; - ix++; - x++; - } - x1 = ((uta->x0 + x) << ART_UTILE_SHIFT) + ART_UTA_BBOX_X1(bb); - - - /* if rectangle nonempty */ - if ((x1 ^ x0) | (y1 ^ y0)) - { - /* try to glom onto an existing rectangle */ - glom_rect = glom[left_ix]; - if (glom_rect != -1 && - x0 == rects[glom_rect].x0 && - x1 == rects[glom_rect].x1 && - y0 == rects[glom_rect].y1 && - y1 - rects[glom_rect].y0 <= max_height) - { - rects[glom_rect].y1 = y1; - } - else - { - if (n_rects == n_rects_max) - art_expand (rects, ArtIRect, n_rects_max); - rects[n_rects].x0 = x0; - rects[n_rects].y0 = y0; - rects[n_rects].x1 = x1; - rects[n_rects].y1 = y1; - glom_rect = n_rects; - n_rects++; - } - if (y != height - 1) - glom[left_ix + width] = glom_rect; - } - } - ix++; - } - - art_free (glom); - *p_nrects = n_rects; - return rects; -} diff -Nru swftools-0.9.0/lib/art/art_rect_uta.h swftools-0.9.2/lib/art/art_rect_uta.h --- swftools-0.9.0/lib/art/art_rect_uta.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rect_uta.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RECT_UTA_H__ -#define __ART_RECT_UTA_H__ - -#ifdef LIBART_COMPILATION -#include "art_rect.h" -#include "art_uta.h" -#else -#include "art_rect.h" -#include "art_uta.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtIRect * -art_rect_list_from_uta (ArtUta *uta, int max_width, int max_height, - int *p_nrects); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RECT_UTA_H__ */ diff -Nru swftools-0.9.0/lib/art/art_render.c swftools-0.9.2/lib/art/art_render.c --- swftools-0.9.0/lib/art/art_render.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1383 +0,0 @@ -/* - * art_render.c: Modular rendering architecture. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_render.h" - -#include "art_rgb.h" - -typedef struct _ArtRenderPriv ArtRenderPriv; - -struct _ArtRenderPriv { - ArtRender super; - - ArtImageSource *image_source; - - int n_mask_source; - ArtMaskSource **mask_source; - - int n_callbacks; - ArtRenderCallback **callbacks; -}; - -ArtRender * -art_render_new (int x0, int y0, int x1, int y1, - art_u8 *pixels, int rowstride, - int n_chan, int depth, ArtAlphaType alpha_type, - ArtAlphaGamma *alphagamma) -{ - ArtRenderPriv *priv; - ArtRender *result; - - priv = art_new (ArtRenderPriv, 1); - result = &priv->super; - - if (n_chan > ART_MAX_CHAN) - { - art_warn ("art_render_new: n_chan = %d, exceeds %d max\n", - n_chan, ART_MAX_CHAN); - return NULL; - } - if (depth > ART_MAX_DEPTH) - { - art_warn ("art_render_new: depth = %d, exceeds %d max\n", - depth, ART_MAX_DEPTH); - return NULL; - } - if (x0 >= x1) - { - art_warn ("art_render_new: x0 >= x1 (x0 = %d, x1 = %d)\n", x0, x1); - return NULL; - } - result->x0 = x0; - result->y0 = y0; - result->x1 = x1; - result->y1 = y1; - result->pixels = pixels; - result->rowstride = rowstride; - result->n_chan = n_chan; - result->depth = depth; - result->alpha_type = alpha_type; - - result->clear = ART_FALSE; - result->opacity = 0x10000; - result->compositing_mode = ART_COMPOSITE_NORMAL; - result->alphagamma = alphagamma; - - result->alpha_buf = NULL; - result->image_buf = NULL; - - result->run = NULL; - result->span_x = NULL; - - result->need_span = ART_FALSE; - - priv->image_source = NULL; - - priv->n_mask_source = 0; - priv->mask_source = NULL; - - return result; -} - -/* todo on clear routines: I haven't really figured out what to do - with clearing the alpha channel. It _should_ be possible to clear - to an arbitrary RGBA color. */ - -/** - * art_render_clear: Set clear color. - * @clear_color: Color with which to clear dest. - * - * Sets clear color, equivalent to actually clearing the destination - * buffer before rendering. This is the most general form. - **/ -void -art_render_clear (ArtRender *render, const ArtPixMaxDepth *clear_color) -{ - int i; - int n_ch = render->n_chan + (render->alpha_type != ART_ALPHA_NONE); - - render->clear = ART_TRUE; - for (i = 0; i < n_ch; i++) - render->clear_color[i] = clear_color[i]; -} - -/** - * art_render_clear_rgb: Set clear color, given in RGB format. - * @clear_rgb: Clear color, in 0xRRGGBB format. - * - * Sets clear color, equivalent to actually clearing the destination - * buffer before rendering. - **/ -void -art_render_clear_rgb (ArtRender *render, art_u32 clear_rgb) -{ - if (render->n_chan != 3) - art_warn ("art_render_clear_rgb: called on render with %d channels, only works with 3\n", - render->n_chan); - else - { - int r, g, b; - - render->clear = ART_TRUE; - r = clear_rgb >> 16; - g = (clear_rgb >> 8) & 0xff; - b = clear_rgb & 0xff; - render->clear_color[0] = ART_PIX_MAX_FROM_8(r); - render->clear_color[1] = ART_PIX_MAX_FROM_8(g); - render->clear_color[2] = ART_PIX_MAX_FROM_8(b); - } -} - -static void -art_render_nop_done (ArtRenderCallback *self, ArtRender *render) -{ -} - -static void -art_render_clear_render_rgb8 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - int width = render->x1 - render->x0; - art_u8 r, g, b; - ArtPixMaxDepth color_max; - - color_max = render->clear_color[0]; - r = ART_PIX_8_FROM_MAX (color_max); - color_max = render->clear_color[1]; - g = ART_PIX_8_FROM_MAX (color_max); - color_max = render->clear_color[2]; - b = ART_PIX_8_FROM_MAX (color_max); - - art_rgb_fill_run (dest, r, g, b, width); -} - -static void -art_render_clear_render_8 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - int width = render->x1 - render->x0; - int i, j; - int n_ch = render->n_chan + (render->alpha_type != ART_ALPHA_NONE); - int ix; - art_u8 color[ART_MAX_CHAN + 1]; - - for (j = 0; j < n_ch; j++) - { - ArtPixMaxDepth color_max = render->clear_color[j]; - color[j] = ART_PIX_8_FROM_MAX (color_max); - } - - ix = 0; - for (i = 0; i < width; i++) - for (j = 0; j < n_ch; j++) - dest[ix++] = color[j]; -} - -const ArtRenderCallback art_render_clear_rgb8_obj = -{ - art_render_clear_render_rgb8, - art_render_nop_done -}; - -const ArtRenderCallback art_render_clear_8_obj = -{ - art_render_clear_render_8, - art_render_nop_done -}; - -#if ART_MAX_DEPTH >= 16 - -static void -art_render_clear_render_16 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - int width = render->x1 - render->x0; - int i, j; - int n_ch = render->n_chan + (render->alpha_type != ART_ALPHA_NONE); - int ix; - art_u16 *dest_16 = (art_u16 *)dest; - art_u8 color[ART_MAX_CHAN + 1]; - - for (j = 0; j < n_ch; j++) - { - int color_16 = render->clear_color[j]; - color[j] = color_16; - } - - ix = 0; - for (i = 0; i < width; i++) - for (j = 0; j < n_ch; j++) - dest_16[ix++] = color[j]; -} - -const ArtRenderCallback art_render_clear_16_obj = -{ - art_render_clear_render_16, - art_render_nop_done -}; - -#endif /* ART_MAX_DEPTH >= 16 */ - -/* todo: inline */ -static ArtRenderCallback * -art_render_choose_clear_callback (ArtRender *render) -{ - ArtRenderCallback *clear_callback; - - if (render->depth == 8) - { - if (render->n_chan == 3 && - render->alpha_type == ART_ALPHA_NONE) - clear_callback = (ArtRenderCallback *)&art_render_clear_rgb8_obj; - else - clear_callback = (ArtRenderCallback *)&art_render_clear_8_obj; - } -#if ART_MAX_DEPTH >= 16 - else if (render->depth == 16) - clear_callback = (ArtRenderCallback *)&art_render_clear_16_obj; -#endif - else - { - art_die ("art_render_choose_clear_callback: inconsistent render->depth = %d\n", - render->depth); - } - return clear_callback; -} - -#if 0 -/* todo: get around to writing this */ -static void -art_render_composite_render_noa_8_norm (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - int width = render->x1 - render->x0; - -} -#endif - -/* This is the most general form of the function. It is slow but - (hopefully) correct. Actually, I'm still worried about roundoff - errors in the premul case - it seems to me that an off-by-one could - lead to overflow. */ -static void -art_render_composite (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtRenderMaskRun *run = render->run; - art_u32 depth = render->depth; - int n_run = render->n_run; - int x0 = render->x0; - int x; - int run_x0, run_x1; - art_u8 *alpha_buf = render->alpha_buf; - art_u8 *image_buf = render->image_buf; - int i, j; - art_u32 tmp; - art_u32 run_alpha; - art_u32 alpha; - int image_ix; - art_u16 src[ART_MAX_CHAN + 1]; - art_u16 dst[ART_MAX_CHAN + 1]; - int n_chan = render->n_chan; - ArtAlphaType alpha_type = render->alpha_type; - int n_ch = n_chan + (alpha_type != ART_ALPHA_NONE); - int dst_pixstride = n_ch * (depth >> 3); - int buf_depth = render->buf_depth; - ArtAlphaType buf_alpha = render->buf_alpha; - int buf_n_ch = n_chan + (buf_alpha != ART_ALPHA_NONE); - int buf_pixstride = buf_n_ch * (buf_depth >> 3); - art_u8 *bufptr; - art_u32 src_alpha; - art_u32 src_mul; - art_u8 *dstptr; - art_u32 dst_alpha; - art_u32 dst_mul; - - image_ix = 0; - for (i = 0; i < n_run - 1; i++) - { - run_x0 = run[i].x; - run_x1 = run[i + 1].x; - tmp = run[i].alpha; - if (tmp < 0x8100) - continue; - - run_alpha = (tmp + (tmp >> 8) + (tmp >> 16) - 0x8000) >> 8; /* range [0 .. 0x10000] */ - bufptr = image_buf + (run_x0 - x0) * buf_pixstride; - dstptr = dest + (run_x0 - x0) * dst_pixstride; - for (x = run_x0; x < run_x1; x++) - { - if (alpha_buf) - { - if (depth == 8) - { - tmp = run_alpha * alpha_buf[x - x0] + 0x80; - /* range 0x80 .. 0xff0080 */ - alpha = (tmp + (tmp >> 8) + (tmp >> 16)) >> 8; - } - else /* (depth == 16) */ - { - tmp = ((art_u16 *)alpha_buf)[x - x0]; - tmp = (run_alpha * tmp + 0x8000) >> 8; - /* range 0x80 .. 0xffff80 */ - alpha = (tmp + (tmp >> 16)) >> 8; - } - } - else - alpha = run_alpha; - /* alpha is run_alpha * alpha_buf[x], range 0 .. 0x10000 */ - - /* convert (src pixel * alpha) to premul alpha form, - store in src as 0..0xffff range */ - if (buf_alpha == ART_ALPHA_NONE) - { - src_alpha = alpha; - src_mul = src_alpha; - } - else - { - if (buf_depth == 8) - { - tmp = alpha * bufptr[n_chan] + 0x80; - /* range 0x80 .. 0xff0080 */ - src_alpha = (tmp + (tmp >> 8) + (tmp >> 16)) >> 8; - } - else /* (depth == 16) */ - { - tmp = ((art_u16 *)bufptr)[n_chan]; - tmp = (alpha * tmp + 0x8000) >> 8; - /* range 0x80 .. 0xffff80 */ - src_alpha = (tmp + (tmp >> 16)) >> 8; - } - if (buf_alpha == ART_ALPHA_SEPARATE) - src_mul = src_alpha; - else /* buf_alpha == (ART_ALPHA_PREMUL) */ - src_mul = alpha; - } - /* src_alpha is the (alpha of the source pixel * alpha), - range 0..0x10000 */ - - if (buf_depth == 8) - { - src_mul *= 0x101; - for (j = 0; j < n_chan; j++) - src[j] = (bufptr[j] * src_mul + 0x8000) >> 16; - } - else if (buf_depth == 16) - { - for (j = 0; j < n_chan; j++) - src[j] = (((art_u16 *)bufptr)[j] * src_mul + 0x8000) >> 16; - } - bufptr += buf_pixstride; - - /* src[0..n_chan - 1] (range 0..0xffff) and src_alpha (range - 0..0x10000) now contain the source pixel with - premultiplied alpha */ - - /* convert dst pixel to premul alpha form, - store in dst as 0..0xffff range */ - if (alpha_type == ART_ALPHA_NONE) - { - dst_alpha = 0x10000; - dst_mul = dst_alpha; - } - else - { - if (depth == 8) - { - tmp = dstptr[n_chan]; - /* range 0..0xff */ - dst_alpha = (tmp << 8) + tmp + (tmp >> 7); - } - else /* (depth == 16) */ - { - tmp = ((art_u16 *)dstptr)[n_chan]; - dst_alpha = (tmp + (tmp >> 15)); - } - if (alpha_type == ART_ALPHA_SEPARATE) - dst_mul = dst_alpha; - else /* (alpha_type == ART_ALPHA_PREMUL) */ - dst_mul = 0x10000; - } - /* dst_alpha is the alpha of the dest pixel, - range 0..0x10000 */ - - if (depth == 8) - { - dst_mul *= 0x101; - for (j = 0; j < n_chan; j++) - dst[j] = (dstptr[j] * dst_mul + 0x8000) >> 16; - } - else if (buf_depth == 16) - { - for (j = 0; j < n_chan; j++) - dst[j] = (((art_u16 *)dstptr)[j] * dst_mul + 0x8000) >> 16; - } - - /* do the compositing, dst = (src over dst) */ - for (j = 0; j < n_chan; j++) - { - art_u32 srcv, dstv; - art_u32 tmp; - - srcv = src[j]; - dstv = dst[j]; - tmp = ((dstv * (0x10000 - src_alpha) + 0x8000) >> 16) + srcv; - tmp -= tmp >> 16; - dst[j] = tmp; - } - - if (alpha_type == ART_ALPHA_NONE) - { - if (depth == 8) - dst_mul = 0xff; - else /* (depth == 16) */ - dst_mul = 0xffff; - } - else - { - if (src_alpha >= 0x10000) - dst_alpha = 0x10000; - else - dst_alpha += ((((0x10000 - dst_alpha) * src_alpha) >> 8) + 0x80) >> 8; - if (alpha_type == ART_ALPHA_PREMUL || dst_alpha == 0) - { - if (depth == 8) - dst_mul = 0xff; - else /* (depth == 16) */ - dst_mul = 0xffff; - } - else /* (ALPHA_TYPE == ART_ALPHA_SEPARATE && dst_alpha != 0) */ - { - if (depth == 8) - dst_mul = 0xff0000 / dst_alpha; - else /* (depth == 16) */ - dst_mul = 0xffff0000 / dst_alpha; - } - } - if (depth == 8) - { - for (j = 0; j < n_chan; j++) - dstptr[j] = (dst[j] * dst_mul + 0x8000) >> 16; - if (alpha_type != ART_ALPHA_NONE) - dstptr[n_chan] = (dst_alpha * 0xff + 0x8000) >> 16; - } - else if (depth == 16) - { - for (j = 0; j < n_chan; j++) - ((art_u16 *)dstptr)[j] = (dst[j] * dst_mul + 0x8000) >> 16; - if (alpha_type != ART_ALPHA_NONE) - ((art_u16 *)dstptr)[n_chan] = (dst_alpha * 0xffff + 0x8000) >> 16; - } - dstptr += dst_pixstride; - } - } -} - -const ArtRenderCallback art_render_composite_obj = -{ - art_render_composite, - art_render_nop_done -}; - -static void -art_render_composite_8 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtRenderMaskRun *run = render->run; - int n_run = render->n_run; - int x0 = render->x0; - int x; - int run_x0, run_x1; - art_u8 *alpha_buf = render->alpha_buf; - art_u8 *image_buf = render->image_buf; - int i, j; - art_u32 tmp; - art_u32 run_alpha; - art_u32 alpha; - int image_ix; - int n_chan = render->n_chan; - ArtAlphaType alpha_type = render->alpha_type; - int n_ch = n_chan + (alpha_type != ART_ALPHA_NONE); - int dst_pixstride = n_ch; - ArtAlphaType buf_alpha = render->buf_alpha; - int buf_n_ch = n_chan + (buf_alpha != ART_ALPHA_NONE); - int buf_pixstride = buf_n_ch; - art_u8 *bufptr; - art_u32 src_alpha; - art_u32 src_mul; - art_u8 *dstptr; - art_u32 dst_alpha; - art_u32 dst_mul, dst_save_mul; - - image_ix = 0; - for (i = 0; i < n_run - 1; i++) - { - run_x0 = run[i].x; - run_x1 = run[i + 1].x; - tmp = run[i].alpha; - if (tmp < 0x10000) - continue; - - run_alpha = (tmp + (tmp >> 8) + (tmp >> 16) - 0x8000) >> 8; /* range [0 .. 0x10000] */ - bufptr = image_buf + (run_x0 - x0) * buf_pixstride; - dstptr = dest + (run_x0 - x0) * dst_pixstride; - for (x = run_x0; x < run_x1; x++) - { - if (alpha_buf) - { - tmp = run_alpha * alpha_buf[x - x0] + 0x80; - /* range 0x80 .. 0xff0080 */ - alpha = (tmp + (tmp >> 8) + (tmp >> 16)) >> 8; - } - else - alpha = run_alpha; - /* alpha is run_alpha * alpha_buf[x], range 0 .. 0x10000 */ - - /* convert (src pixel * alpha) to premul alpha form, - store in src as 0..0xffff range */ - if (buf_alpha == ART_ALPHA_NONE) - { - src_alpha = alpha; - src_mul = src_alpha; - } - else - { - tmp = alpha * bufptr[n_chan] + 0x80; - /* range 0x80 .. 0xff0080 */ - src_alpha = (tmp + (tmp >> 8) + (tmp >> 16)) >> 8; - - if (buf_alpha == ART_ALPHA_SEPARATE) - src_mul = src_alpha; - else /* buf_alpha == (ART_ALPHA_PREMUL) */ - src_mul = alpha; - } - /* src_alpha is the (alpha of the source pixel * alpha), - range 0..0x10000 */ - - src_mul *= 0x101; - - if (alpha_type == ART_ALPHA_NONE) - { - dst_alpha = 0x10000; - dst_mul = dst_alpha; - } - else - { - tmp = dstptr[n_chan]; - /* range 0..0xff */ - dst_alpha = (tmp << 8) + tmp + (tmp >> 7); - if (alpha_type == ART_ALPHA_SEPARATE) - dst_mul = dst_alpha; - else /* (alpha_type == ART_ALPHA_PREMUL) */ - dst_mul = 0x10000; - } - /* dst_alpha is the alpha of the dest pixel, - range 0..0x10000 */ - - dst_mul *= 0x101; - - if (alpha_type == ART_ALPHA_NONE) - { - dst_save_mul = 0xff; - } - else - { - if (src_alpha >= 0x10000) - dst_alpha = 0x10000; - else - dst_alpha += ((((0x10000 - dst_alpha) * src_alpha) >> 8) + 0x80) >> 8; - if (alpha_type == ART_ALPHA_PREMUL || dst_alpha == 0) - { - dst_save_mul = 0xff; - } - else /* (ALPHA_TYPE == ART_ALPHA_SEPARATE && dst_alpha != 0) */ - { - dst_save_mul = 0xff0000 / dst_alpha; - } - } - - for (j = 0; j < n_chan; j++) - { - art_u32 src, dst; - art_u32 tmp; - - src = (bufptr[j] * src_mul + 0x8000) >> 16; - dst = (dstptr[j] * dst_mul + 0x8000) >> 16; - tmp = ((dst * (0x10000 - src_alpha) + 0x8000) >> 16) + src; - tmp -= tmp >> 16; - dstptr[j] = (tmp * dst_save_mul + 0x8000) >> 16; - } - if (alpha_type != ART_ALPHA_NONE) - dstptr[n_chan] = (dst_alpha * 0xff + 0x8000) >> 16; - - bufptr += buf_pixstride; - dstptr += dst_pixstride; - } - } -} - -const ArtRenderCallback art_render_composite_8_obj = -{ - art_render_composite_8, - art_render_nop_done -}; - - -/* Assumes: - * alpha_buf is NULL - * buf_alpha = ART_ALPHA_NONE (source) - * alpha_type = ART_ALPHA_SEPARATE (dest) - * n_chan = 3; - */ -static void -art_render_composite_8_opt1 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtRenderMaskRun *run = render->run; - int n_run = render->n_run; - int x0 = render->x0; - int x; - int run_x0, run_x1; - art_u8 *image_buf = render->image_buf; - int i, j; - art_u32 tmp; - art_u32 run_alpha; - int image_ix; - art_u8 *bufptr; - art_u32 src_mul; - art_u8 *dstptr; - art_u32 dst_alpha; - art_u32 dst_mul, dst_save_mul; - - image_ix = 0; - for (i = 0; i < n_run - 1; i++) - { - run_x0 = run[i].x; - run_x1 = run[i + 1].x; - tmp = run[i].alpha; - if (tmp < 0x10000) - continue; - - run_alpha = (tmp + (tmp >> 8) + (tmp >> 16) - 0x8000) >> 8; /* range [0 .. 0x10000] */ - bufptr = image_buf + (run_x0 - x0) * 3; - dstptr = dest + (run_x0 - x0) * 4; - if (run_alpha == 0x10000) - { - for (x = run_x0; x < run_x1; x++) - { - *dstptr++ = *bufptr++; - *dstptr++ = *bufptr++; - *dstptr++ = *bufptr++; - *dstptr++ = 0xff; - } - } - else - { - for (x = run_x0; x < run_x1; x++) - { - src_mul = run_alpha * 0x101; - - tmp = dstptr[3]; - /* range 0..0xff */ - dst_alpha = (tmp << 8) + tmp + (tmp >> 7); - dst_mul = dst_alpha; - /* dst_alpha is the alpha of the dest pixel, - range 0..0x10000 */ - - dst_mul *= 0x101; - - dst_alpha += ((((0x10000 - dst_alpha) * run_alpha) >> 8) + 0x80) >> 8; - if (dst_alpha == 0) - dst_save_mul = 0xff; - else /* (dst_alpha != 0) */ - dst_save_mul = 0xff0000 / dst_alpha; - - for (j = 0; j < 3; j++) - { - art_u32 src, dst; - art_u32 tmp; - - src = (bufptr[j] * src_mul + 0x8000) >> 16; - dst = (dstptr[j] * dst_mul + 0x8000) >> 16; - tmp = ((dst * (0x10000 - run_alpha) + 0x8000) >> 16) + src; - tmp -= tmp >> 16; - dstptr[j] = (tmp * dst_save_mul + 0x8000) >> 16; - } - dstptr[3] = (dst_alpha * 0xff + 0x8000) >> 16; - - bufptr += 3; - dstptr += 4; - } - } - } -} - - -const ArtRenderCallback art_render_composite_8_opt1_obj = -{ - art_render_composite_8_opt1, - art_render_nop_done -}; - -/* Assumes: - * alpha_buf is NULL - * buf_alpha = ART_ALPHA_PREMUL (source) - * alpha_type = ART_ALPHA_SEPARATE (dest) - * n_chan = 3; - */ -static void -art_render_composite_8_opt2 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtRenderMaskRun *run = render->run; - int n_run = render->n_run; - int x0 = render->x0; - int x; - int run_x0, run_x1; - art_u8 *image_buf = render->image_buf; - int i, j; - art_u32 tmp; - art_u32 run_alpha; - int image_ix; - art_u8 *bufptr; - art_u32 src_alpha; - art_u32 src_mul; - art_u8 *dstptr; - art_u32 dst_alpha; - art_u32 dst_mul, dst_save_mul; - - image_ix = 0; - for (i = 0; i < n_run - 1; i++) - { - run_x0 = run[i].x; - run_x1 = run[i + 1].x; - tmp = run[i].alpha; - if (tmp < 0x10000) - continue; - - run_alpha = (tmp + (tmp >> 8) + (tmp >> 16) - 0x8000) >> 8; /* range [0 .. 0x10000] */ - bufptr = image_buf + (run_x0 - x0) * 4; - dstptr = dest + (run_x0 - x0) * 4; - if (run_alpha == 0x10000) - { - for (x = run_x0; x < run_x1; x++) - { - src_alpha = (bufptr[3] << 8) + bufptr[3] + (bufptr[3] >> 7); - /* src_alpha is the (alpha of the source pixel), - range 0..0x10000 */ - - dst_alpha = (dstptr[3] << 8) + dstptr[3] + (dstptr[3] >> 7); - /* dst_alpha is the alpha of the dest pixel, - range 0..0x10000 */ - - dst_mul = dst_alpha*0x101; - - if (src_alpha >= 0x10000) - dst_alpha = 0x10000; - else - dst_alpha += ((((0x10000 - dst_alpha) * src_alpha) >> 8) + 0x80) >> 8; - - if (dst_alpha == 0) - dst_save_mul = 0xff; - else /* dst_alpha != 0) */ - dst_save_mul = 0xff0000 / dst_alpha; - - for (j = 0; j < 3; j++) - { - art_u32 src, dst; - art_u32 tmp; - - src = (bufptr[j] << 8) | bufptr[j]; - dst = (dstptr[j] * dst_mul + 0x8000) >> 16; - tmp = ((dst * (0x10000 - src_alpha) + 0x8000) >> 16) + src; - tmp -= tmp >> 16; - dstptr[j] = (tmp * dst_save_mul + 0x8000) >> 16; - } - dstptr[3] = (dst_alpha * 0xff + 0x8000) >> 16; - - bufptr += 4; - dstptr += 4; - } - } - else - { - for (x = run_x0; x < run_x1; x++) - { - tmp = run_alpha * bufptr[3] + 0x80; - /* range 0x80 .. 0xff0080 */ - src_alpha = (tmp + (tmp >> 8) + (tmp >> 16)) >> 8; - /* src_alpha is the (alpha of the source pixel * alpha), - range 0..0x10000 */ - - src_mul = run_alpha * 0x101; - - tmp = dstptr[3]; - /* range 0..0xff */ - dst_alpha = (tmp << 8) + tmp + (tmp >> 7); - dst_mul = dst_alpha; - /* dst_alpha is the alpha of the dest pixel, - range 0..0x10000 */ - - dst_mul *= 0x101; - - if (src_alpha >= 0x10000) - dst_alpha = 0x10000; - else - dst_alpha += ((((0x10000 - dst_alpha) * src_alpha) >> 8) + 0x80) >> 8; - - if (dst_alpha == 0) - { - dst_save_mul = 0xff; - } - else /* dst_alpha != 0) */ - { - dst_save_mul = 0xff0000 / dst_alpha; - } - - for (j = 0; j < 3; j++) - { - art_u32 src, dst; - art_u32 tmp; - - src = (bufptr[j] * src_mul + 0x8000) >> 16; - dst = (dstptr[j] * dst_mul + 0x8000) >> 16; - tmp = ((dst * (0x10000 - src_alpha) + 0x8000) >> 16) + src; - tmp -= tmp >> 16; - dstptr[j] = (tmp * dst_save_mul + 0x8000) >> 16; - } - dstptr[3] = (dst_alpha * 0xff + 0x8000) >> 16; - - bufptr += 4; - dstptr += 4; - } - } - } -} - -const ArtRenderCallback art_render_composite_8_opt2_obj = -{ - art_render_composite_8_opt2, - art_render_nop_done -}; - - -/* todo: inline */ -static ArtRenderCallback * -art_render_choose_compositing_callback (ArtRender *render) -{ - if (render->depth == 8 && render->buf_depth == 8) - { - if (render->n_chan == 3 && - render->alpha_buf == NULL && - render->alpha_type == ART_ALPHA_SEPARATE) - { - if (render->buf_alpha == ART_ALPHA_NONE) - return (ArtRenderCallback *)&art_render_composite_8_opt1_obj; - else if (render->buf_alpha == ART_ALPHA_PREMUL) - return (ArtRenderCallback *)&art_render_composite_8_opt2_obj; - } - - return (ArtRenderCallback *)&art_render_composite_8_obj; - } - return (ArtRenderCallback *)&art_render_composite_obj; -} - -/** - * art_render_invoke_callbacks: Invoke the callbacks in the render object. - * @render: The render object. - * @y: The current Y coordinate value. - * - * Invokes the callbacks of the render object in the appropriate - * order. Drivers should call this routine once per scanline. - * - * todo: should management of dest devolve to this routine? very - * plausibly yes. - **/ -void -art_render_invoke_callbacks (ArtRender *render, art_u8 *dest, int y) -{ - ArtRenderPriv *priv = (ArtRenderPriv *)render; - int i; - - for (i = 0; i < priv->n_callbacks; i++) - { - ArtRenderCallback *callback; - - callback = priv->callbacks[i]; - callback->render (callback, render, dest, y); - } -} - -/** - * art_render_invoke: Perform the requested rendering task. - * @render: The render object. - * - * Invokes the renderer and all sources associated with it, to perform - * the requested rendering task. - **/ -void -art_render_invoke (ArtRender *render) -{ - ArtRenderPriv *priv = (ArtRenderPriv *)render; - int width; - int best_driver, best_score; - int i; - int n_callbacks, n_callbacks_max; - ArtImageSource *image_source; - int image_flags; - int buf_depth; - ArtAlphaType buf_alpha; - art_boolean first = ART_TRUE; - - if (render == NULL) - { - art_warn ("art_render_invoke: called with render == NULL\n"); - return; - } - if (priv->image_source == NULL) - { - art_warn ("art_render_invoke: no image source given\n"); - return; - } - - width = render->x1 - render->x0; - - render->run = art_new (ArtRenderMaskRun, width + 1); - - /* Elect a mask source as driver. */ - best_driver = -1; - best_score = 0; - for (i = 0; i < priv->n_mask_source; i++) - { - int score; - ArtMaskSource *mask_source; - - mask_source = priv->mask_source[i]; - score = mask_source->can_drive (mask_source, render); - if (score > best_score) - { - best_score = score; - best_driver = i; - } - } - - /* Allocate alpha buffer if needed. */ - if (priv->n_mask_source > 1 || - (priv->n_mask_source == 1 && best_driver < 0)) - { - render->alpha_buf = art_new (art_u8, (width * render->depth) >> 3); - } - - /* Negotiate image rendering and compositing. */ - image_source = priv->image_source; - image_source->negotiate (image_source, render, &image_flags, &buf_depth, - &buf_alpha); - - /* Build callback list. */ - n_callbacks_max = priv->n_mask_source + 3; - priv->callbacks = art_new (ArtRenderCallback *, n_callbacks_max); - n_callbacks = 0; - for (i = 0; i < priv->n_mask_source; i++) - if (i != best_driver) - { - ArtMaskSource *mask_source = priv->mask_source[i]; - - mask_source->prepare (mask_source, render, first); - first = ART_FALSE; - priv->callbacks[n_callbacks++] = &mask_source->super; - } - - if (render->clear && !(image_flags & ART_IMAGE_SOURCE_CAN_CLEAR)) - priv->callbacks[n_callbacks++] = - art_render_choose_clear_callback (render); - - priv->callbacks[n_callbacks++] = &image_source->super; - - /* Allocate image buffer and add compositing callback if needed. */ - if (!(image_flags & ART_IMAGE_SOURCE_CAN_COMPOSITE)) - { - int bytespp = ((render->n_chan + (buf_alpha != ART_ALPHA_NONE)) * - buf_depth) >> 3; - render->buf_depth = buf_depth; - render->buf_alpha = buf_alpha; - render->image_buf = art_new (art_u8, width * bytespp); - priv->callbacks[n_callbacks++] = - art_render_choose_compositing_callback (render); - } - - priv->n_callbacks = n_callbacks; - - if (render->need_span) - render->span_x = art_new (int, width + 1); - - /* Invoke the driver */ - if (best_driver >= 0) - { - ArtMaskSource *driver; - - driver = priv->mask_source[best_driver]; - driver->invoke_driver (driver, render); - } - else - { - art_u8 *dest_ptr = render->pixels; - int y; - - /* Dummy driver */ - render->n_run = 2; - render->run[0].x = render->x0; - render->run[0].alpha = 0x8000 + 0xff * render->opacity; - render->run[1].x = render->x1; - render->run[1].alpha = 0x8000; - if (render->need_span) - { - render->n_span = 2; - render->span_x[0] = render->x0; - render->span_x[1] = render->x1; - } - for (y = render->y0; y < render->y1; y++) - { - art_render_invoke_callbacks (render, dest_ptr, y); - dest_ptr += render->rowstride; - } - } - - if (priv->mask_source != NULL) - art_free (priv->mask_source); - - /* clean up callbacks */ - for (i = 0; i < priv->n_callbacks; i++) - { - ArtRenderCallback *callback; - - callback = priv->callbacks[i]; - callback->done (callback, render); - } - - /* Tear down object */ - if (render->alpha_buf != NULL) - art_free (render->alpha_buf); - if (render->image_buf != NULL) - art_free (render->image_buf); - art_free (render->run); - if (render->span_x != NULL) - art_free (render->span_x); - art_free (priv->callbacks); - art_free (render); -} - -/** - * art_render_mask_solid: Add a solid translucent mask. - * @render: The render object. - * @opacity: Opacity in [0..0x10000] form. - * - * Adds a translucent mask to the rendering object. - **/ -void -art_render_mask_solid (ArtRender *render, int opacity) -{ - art_u32 old_opacity = render->opacity; - art_u32 new_opacity_tmp; - - if (opacity == 0x10000) - /* avoid potential overflow */ - return; - new_opacity_tmp = old_opacity * (art_u32)opacity + 0x8000; - render->opacity = new_opacity_tmp >> 16; -} - -/** - * art_render_add_mask_source: Add a mask source to the render object. - * @render: Render object. - * @mask_source: Mask source to add. - * - * This routine adds a mask source to the render object. In general, - * client api's for adding mask sources should just take a render object, - * then the mask source creation function should call this function. - * Clients should never have to call this function directly, unless of - * course they're creating custom mask sources. - **/ -void -art_render_add_mask_source (ArtRender *render, ArtMaskSource *mask_source) -{ - ArtRenderPriv *priv = (ArtRenderPriv *)render; - int n_mask_source = priv->n_mask_source++; - - if (n_mask_source == 0) - priv->mask_source = art_new (ArtMaskSource *, 1); - /* This predicate is true iff n_mask_source is a power of two */ - else if (!(n_mask_source & (n_mask_source - 1))) - priv->mask_source = art_renew (priv->mask_source, ArtMaskSource *, - n_mask_source << 1); - - priv->mask_source[n_mask_source] = mask_source; -} - -/** - * art_render_add_image_source: Add a mask source to the render object. - * @render: Render object. - * @image_source: Image source to add. - * - * This routine adds an image source to the render object. In general, - * client api's for adding image sources should just take a render - * object, then the mask source creation function should call this - * function. Clients should never have to call this function - * directly, unless of course they're creating custom image sources. - **/ -void -art_render_add_image_source (ArtRender *render, ArtImageSource *image_source) -{ - ArtRenderPriv *priv = (ArtRenderPriv *)render; - - if (priv->image_source != NULL) - { - art_warn ("art_render_add_image_source: image source already present.\n"); - return; - } - priv->image_source = image_source; -} - -/* Solid image source object and methods. Perhaps this should go into a - separate file. */ - -typedef struct _ArtImageSourceSolid ArtImageSourceSolid; - -struct _ArtImageSourceSolid { - ArtImageSource super; - ArtPixMaxDepth color[ART_MAX_CHAN]; - art_u32 *rgbtab; - art_boolean init; -}; - -static void -art_render_image_solid_done (ArtRenderCallback *self, ArtRender *render) -{ - ArtImageSourceSolid *z = (ArtImageSourceSolid *)self; - - if (z->rgbtab != NULL) - art_free (z->rgbtab); - art_free (self); -} - -static void -art_render_image_solid_rgb8_opaq_init (ArtImageSourceSolid *self, ArtRender *render) -{ - ArtImageSourceSolid *z = (ArtImageSourceSolid *)self; - ArtPixMaxDepth color_max; - int r_fg, g_fg, b_fg; - int r_bg, g_bg, b_bg; - int r, g, b; - int dr, dg, db; - int i; - int tmp; - art_u32 *rgbtab; - - rgbtab = art_new (art_u32, 256); - z->rgbtab = rgbtab; - - color_max = self->color[0]; - r_fg = ART_PIX_8_FROM_MAX (color_max); - color_max = self->color[1]; - g_fg = ART_PIX_8_FROM_MAX (color_max); - color_max = self->color[2]; - b_fg = ART_PIX_8_FROM_MAX (color_max); - - color_max = render->clear_color[0]; - r_bg = ART_PIX_8_FROM_MAX (color_max); - color_max = render->clear_color[1]; - g_bg = ART_PIX_8_FROM_MAX (color_max); - color_max = render->clear_color[2]; - b_bg = ART_PIX_8_FROM_MAX (color_max); - - r = (r_bg << 16) + 0x8000; - g = (g_bg << 16) + 0x8000; - b = (b_bg << 16) + 0x8000; - tmp = ((r_fg - r_bg) << 16) + 0x80; - dr = (tmp + (tmp >> 8)) >> 8; - tmp = ((g_fg - g_bg) << 16) + 0x80; - dg = (tmp + (tmp >> 8)) >> 8; - tmp = ((b_fg - b_bg) << 16) + 0x80; - db = (tmp + (tmp >> 8)) >> 8; - - for (i = 0; i < 256; i++) - { - rgbtab[i] = (r & 0xff0000) | ((g & 0xff0000) >> 8) | (b >> 16); - r += dr; - g += dg; - b += db; - } -} - -static void -art_render_image_solid_rgb8_opaq (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtImageSourceSolid *z = (ArtImageSourceSolid *)self; - ArtRenderMaskRun *run = render->run; - int n_run = render->n_run; - art_u32 *rgbtab = z->rgbtab; - art_u32 rgb; - int x0 = render->x0; - int x1 = render->x1; - int run_x0, run_x1; - int i; - int ix; - - if (n_run > 0) - { - run_x1 = run[0].x; - if (run_x1 > x0) - { - rgb = rgbtab[0]; - art_rgb_fill_run (dest, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - run_x1 - x0); - } - for (i = 0; i < n_run - 1; i++) - { - run_x0 = run_x1; - run_x1 = run[i + 1].x; - rgb = rgbtab[(run[i].alpha >> 16) & 0xff]; - ix = (run_x0 - x0) * 3; -#define OPTIMIZE_LEN_1 -#ifdef OPTIMIZE_LEN_1 - if (run_x1 - run_x0 == 1) - { - dest[ix] = rgb >> 16; - dest[ix + 1] = (rgb >> 8) & 0xff; - dest[ix + 2] = rgb & 0xff; - } - else - { - art_rgb_fill_run (dest + ix, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - run_x1 - run_x0); - } -#else - art_rgb_fill_run (dest + ix, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - run_x1 - run_x0); -#endif - } - } - else - { - run_x1 = x0; - } - if (run_x1 < x1) - { - rgb = rgbtab[0]; - art_rgb_fill_run (dest + (run_x1 - x0) * 3, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - x1 - run_x1); - } -} - -static void -art_render_image_solid_rgb8 (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtImageSourceSolid *z = (ArtImageSourceSolid *)self; - int width = render->x1 - render->x0; - art_u8 r, g, b; - ArtPixMaxDepth color_max; - - /* todo: replace this simple test with real sparseness */ - if (z->init) - return; - z->init = ART_TRUE; - - color_max = z->color[0]; - r = ART_PIX_8_FROM_MAX (color_max); - color_max = z->color[1]; - g = ART_PIX_8_FROM_MAX (color_max); - color_max = z->color[2]; - b = ART_PIX_8_FROM_MAX (color_max); - - art_rgb_fill_run (render->image_buf, r, g, b, width); -} - -static void -art_render_image_solid_negotiate (ArtImageSource *self, ArtRender *render, - int *p_flags, - int *p_buf_depth, ArtAlphaType *p_alpha) -{ - ArtImageSourceSolid *z = (ArtImageSourceSolid *)self; - int flags = 0; - static void (*render_cbk) (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y); - - render_cbk = NULL; - - if (render->depth == 8 && render->n_chan == 3 && - render->alpha_type == ART_ALPHA_NONE) - { - if (render->clear) - { - render_cbk = art_render_image_solid_rgb8_opaq; - flags |= ART_IMAGE_SOURCE_CAN_CLEAR | ART_IMAGE_SOURCE_CAN_COMPOSITE; - art_render_image_solid_rgb8_opaq_init (z, render); - } - } - if (render_cbk == NULL) - { - if (render->depth == 8) - { - render_cbk = art_render_image_solid_rgb8; - *p_buf_depth = 8; - *p_alpha = ART_ALPHA_NONE; /* todo */ - } - } - /* todo: general case */ - self->super.render = render_cbk; - *p_flags = flags; -} - -/** - * art_render_image_solid: Add a solid color image source. - * @render: The render object. - * @color: Color. - * - * Adds an image source with the solid color given by @color. The - * color need not be retained in memory after this call. - **/ -void -art_render_image_solid (ArtRender *render, ArtPixMaxDepth *color) -{ - ArtImageSourceSolid *image_source; - int i; - - image_source = art_new (ArtImageSourceSolid, 1); - image_source->super.super.render = NULL; - image_source->super.super.done = art_render_image_solid_done; - image_source->super.negotiate = art_render_image_solid_negotiate; - - for (i = 0; i < render->n_chan; i++) - image_source->color[i] = color[i]; - - image_source->rgbtab = NULL; - image_source->init = ART_FALSE; - - art_render_add_image_source (render, &image_source->super); -} diff -Nru swftools-0.9.0/lib/art/art_render_gradient.c swftools-0.9.2/lib/art/art_render_gradient.c --- swftools-0.9.0/lib/art/art_render_gradient.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render_gradient.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,716 +0,0 @@ -/* - * art_render_gradient.c: Gradient image source for modular rendering. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Raph Levien - * Alexander Larsson - */ - -#include "config.h" -#include "art_render_gradient.h" - -#include -#include -#include -#include -#include - -/* Hack to find out how to define alloca on different platforms. - * Modified version of glib/galloca.h. - */ - -#ifdef __GNUC__ -/* GCC does the right thing */ -# undef alloca -# define alloca(size) __builtin_alloca (size) -#elif defined (HAVE_ALLOCA_H) -/* a native and working alloca.h is there */ -# include -#else /* !__GNUC__ && !HAVE_ALLOCA_H */ -# ifdef _MSC_VER -# include -# define alloca _alloca -# else /* !_MSC_VER */ -# ifdef _AIX - #pragma alloca -# else /* !_AIX */ -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif /* !alloca */ -# endif /* !_AIX */ -# endif /* !_MSC_VER */ -#endif /* !__GNUC__ && !HAVE_ALLOCA_H */ - -#undef DEBUG_SPEW - -typedef struct _ArtImageSourceGradLin ArtImageSourceGradLin; -typedef struct _ArtImageSourceGradRad ArtImageSourceGradRad; - -/* The stops will be copied right after this structure */ -struct _ArtImageSourceGradLin { - ArtImageSource super; - ArtGradientLinear gradient; - ArtGradientStop stops[1]; -}; - -/* The stops will be copied right after this structure */ -struct _ArtImageSourceGradRad { - ArtImageSource super; - ArtGradientRadial gradient; - double a; - ArtGradientStop stops[1]; -}; - -#define EPSILON 1e-6 - -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif /* MAX */ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif /* MIN */ - -static void -art_rgba_gradient_run (art_u8 *buf, - art_u8 *color1, - art_u8 *color2, - int len) -{ - int i; - int r, g, b, a; - int dr, dg, db, da; - -#ifdef DEBUG_SPEW - printf ("gradient run from %3d %3d %3d %3d to %3d %3d %3d %3d in %d pixels\n", - color1[0], color1[1], color1[2], color1[3], - color2[0], color2[1], color2[2], color2[3], - len); -#endif - - r = (color1[0] << 16) + 0x8000; - g = (color1[1] << 16) + 0x8000; - b = (color1[2] << 16) + 0x8000; - a = (color1[3] << 16) + 0x8000; - dr = ((color2[0] - color1[0]) << 16) / len; - dg = ((color2[1] - color1[1]) << 16) / len; - db = ((color2[2] - color1[2]) << 16) / len; - da = ((color2[3] - color1[3]) << 16) / len; - - for (i = 0; i < len; i++) - { - *buf++ = (r>>16); - *buf++ = (g>>16); - *buf++ = (b>>16); - *buf++ = (a>>16); - - r += dr; - g += dg; - b += db; - a += da; - } -} - -static void -calc_color_at (ArtGradientStop *stops, - int n_stops, - ArtGradientSpread spread, - double offset, - double offset_fraction, - int favor_start, - int ix, - art_u8 *color) -{ - double off0, off1; - int j; - - if (spread == ART_GRADIENT_PAD) - { - if (offset < 0.0) - { - color[0] = ART_PIX_8_FROM_MAX (stops[0].color[0]); - color[1] = ART_PIX_8_FROM_MAX (stops[0].color[1]); - color[2] = ART_PIX_8_FROM_MAX (stops[0].color[2]); - color[3] = ART_PIX_8_FROM_MAX (stops[0].color[3]); - return; - } - if (offset >= 1.0) - { - color[0] = ART_PIX_8_FROM_MAX (stops[n_stops-1].color[0]); - color[1] = ART_PIX_8_FROM_MAX (stops[n_stops-1].color[1]); - color[2] = ART_PIX_8_FROM_MAX (stops[n_stops-1].color[2]); - color[3] = ART_PIX_8_FROM_MAX (stops[n_stops-1].color[3]); - return; - } - } - - if (ix > 0 && ix < n_stops) - { - off0 = stops[ix - 1].offset; - off1 = stops[ix].offset; - if (fabs (off1 - off0) > EPSILON) - { - double interp; - double o; - o = offset_fraction; - - if ((fabs (o) < EPSILON) && (!favor_start)) - o = 1.0; - else if ((fabs (o-1.0) < EPSILON) && (favor_start)) - o = 0.0; - - /* - if (offset_fraction == 0.0 && !favor_start) - offset_fraction = 1.0; - */ - - interp = (o - off0) / (off1 - off0); - for (j = 0; j < 4; j++) - { - int z0, z1; - int z; - z0 = stops[ix - 1].color[j]; - z1 = stops[ix].color[j]; - z = floor (z0 + (z1 - z0) * interp + 0.5); - color[j] = ART_PIX_8_FROM_MAX (z); - } - return; - } - /* If offsets are too close to safely do the division, just - pick the ix color. */ - color[0] = ART_PIX_8_FROM_MAX (stops[ix].color[0]); - color[1] = ART_PIX_8_FROM_MAX (stops[ix].color[1]); - color[2] = ART_PIX_8_FROM_MAX (stops[ix].color[2]); - color[3] = ART_PIX_8_FROM_MAX (stops[ix].color[3]); - return; - } - - printf ("WARNING! bad ix %d in calc_color_at() [internal error]\n", ix); - assert (0); -} - -static void -art_render_gradient_linear_render_8 (ArtRenderCallback *self, - ArtRender *render, - art_u8 *dest, int y) -{ - ArtImageSourceGradLin *z = (ArtImageSourceGradLin *)self; - const ArtGradientLinear *gradient = &(z->gradient); - int i; - int width = render->x1 - render->x0; - int len; - double offset, d_offset; - double offset_fraction; - int next_stop; - int ix; - art_u8 color1[4], color2[4]; - int n_stops = gradient->n_stops; - int extra_stops; - ArtGradientStop *stops = gradient->stops; - ArtGradientStop *tmp_stops; - art_u8 *bufp = render->image_buf; - ArtGradientSpread spread = gradient->spread; - -#ifdef DEBUG_SPEW - printf ("x1: %d, x2: %d, y: %d\n", render->x0, render->x1, y); - printf ("spread: %d, stops:", gradient->spread); - for (i=0;istops[i].offset); - } - printf ("\n"); - printf ("a: %f, b: %f, c: %f\n", gradient->a, gradient->b, gradient->c); -#endif - - offset = render->x0 * gradient->a + y * gradient->b + gradient->c; - d_offset = gradient->a; - - /* We need to force the gradient to extend the whole 0..1 segment, - because the rest of the code doesn't handle partial gradients - correctly */ - if ((gradient->stops[0].offset > EPSILON /* == 0.0 */) || - (gradient->stops[n_stops-1].offset < (1.0 - EPSILON))) - { - extra_stops = 0; - tmp_stops = stops = (ArtGradientStop*)alloca (sizeof (ArtGradientStop) * (n_stops + 2)); - if (gradient->stops[0].offset > EPSILON /* 0.0 */) - { - memcpy (tmp_stops, gradient->stops, sizeof (ArtGradientStop)); - tmp_stops[0].offset = 0.0; - tmp_stops += 1; - extra_stops++; - } - memcpy (tmp_stops, gradient->stops, sizeof (ArtGradientStop) * n_stops); - if (gradient->stops[n_stops-1].offset < (1.0 - EPSILON)) - { - tmp_stops += n_stops; - memcpy (tmp_stops, &gradient->stops[n_stops-1], sizeof (ArtGradientStop)); - tmp_stops[0].offset = 1.0; - extra_stops++; - } - n_stops += extra_stops; - - -#ifdef DEBUG_SPEW - printf ("start/stop modified stops:"); - for (i=0;i offset_fraction || - (d_offset < 0.0 && fabs (stops[ix].offset - offset_fraction) < EPSILON)) - break; - if (ix == 0) - ix = n_stops - 1; - else if (ix == n_stops) - ix = n_stops - 1; - -#ifdef DEBUG_SPEW - printf ("Initial ix: %d\n", ix); -#endif - - assert (ix > 0); - assert (ix < n_stops); - assert ((stops[ix-1].offset <= offset_fraction + EPSILON) || - ((stops[ix].offset > (1.0 - EPSILON)) && (offset_fraction < EPSILON /* == 0.0*/))); - assert (offset_fraction <= stops[ix].offset); - /* FIXME: These asserts may be broken, it is for now - safer to not use them. Should be fixed! - See bug #121850 - assert ((offset_fraction != stops[ix-1].offset) || - (d_offset >= 0.0)); - assert ((offset_fraction != stops[ix].offset) || - (d_offset <= 0.0)); - */ - - while (width > 0) - { -#ifdef DEBUG_SPEW - printf ("ix: %d\n", ix); - printf ("start offset: %f\n", offset); -#endif - calc_color_at (stops, n_stops, - spread, - offset, - offset_fraction, - (d_offset > -EPSILON), - ix, - color1); - - if (d_offset > 0) - next_stop = ix; - else - next_stop = ix-1; - -#ifdef DEBUG_SPEW - printf ("next_stop: %d\n", next_stop); -#endif - if (fabs (d_offset) > EPSILON) - { - double o; - o = offset_fraction; - - if ((fabs (o) <= EPSILON) && (ix == n_stops - 1)) - o = 1.0; - else if ((fabs (o-1.0) <= EPSILON) && (ix == 1)) - o = 0.0; - -#ifdef DEBUG_SPEW - printf ("o: %f\n", o); -#endif - len = (int)floor (fabs ((stops[next_stop].offset - o) / d_offset)) + 1; - len = MAX (len, 0); - len = MIN (len, width); - } - else - { - len = width; - } -#ifdef DEBUG_SPEW - printf ("len: %d\n", len); -#endif - if (len > 0) - { - offset = offset + (len-1) * d_offset; - offset_fraction = offset - floor (offset); -#ifdef DEBUG_SPEW - printf ("end offset: %f, fraction: %f\n", offset, offset_fraction); -#endif - calc_color_at (stops, n_stops, - spread, - offset, - offset_fraction, - (d_offset < EPSILON), - ix, - color2); - - art_rgba_gradient_run (bufp, - color1, - color2, - len); - offset += d_offset; - offset_fraction = offset - floor (offset); - } - - if (d_offset > 0) - { - do - { - ix++; - if (ix == n_stops) - ix = 1; - /* Note: offset_fraction can actually be one here on x86 machines that - does calculations with extended precision, but later rounds to 64bit. - This happens if the 80bit offset_fraction is larger than the - largest 64bit double that is less than one. - */ - } - while (!((stops[ix-1].offset <= offset_fraction && - offset_fraction < stops[ix].offset) || - (ix == 1 && offset_fraction > (1.0 - EPSILON)))); - } - else - { - do - { - ix--; - if (ix == 0) - ix = n_stops - 1; - } - while (!((stops[ix-1].offset < offset_fraction && - offset_fraction <= stops[ix].offset) || - (ix == n_stops - 1 && offset_fraction < EPSILON /* == 0.0*/))); - } - - bufp += 4*len; - width -= len; - } -} - - -/** - * art_render_gradient_setpix: Set a gradient pixel. - * @render: The render object. - * @dst: Pointer to destination (where to store pixel). - * @n_stops: Number of stops in @stops. - * @stops: The stops for the gradient. - * @offset: The offset. - * - * @n_stops must be > 0. - * - * Sets a gradient pixel, storing it at @dst. - **/ -static void -art_render_gradient_setpix (ArtRender *render, - art_u8 *dst, - int n_stops, ArtGradientStop *stops, - double offset) -{ - int ix; - int j; - double off0, off1; - int n_ch = render->n_chan + 1; - - for (ix = 0; ix < n_stops; ix++) - if (stops[ix].offset > offset) - break; - /* stops[ix - 1].offset < offset < stops[ix].offset */ - if (ix > 0 && ix < n_stops) - { - off0 = stops[ix - 1].offset; - off1 = stops[ix].offset; - if (fabs (off1 - off0) > EPSILON) - { - double interp; - - interp = (offset - off0) / (off1 - off0); - for (j = 0; j < n_ch; j++) - { - int z0, z1; - int z; - z0 = stops[ix - 1].color[j]; - z1 = stops[ix].color[j]; - z = floor (z0 + (z1 - z0) * interp + 0.5); - if (render->buf_depth == 8) - dst[j] = ART_PIX_8_FROM_MAX (z); - else /* (render->buf_depth == 16) */ - ((art_u16 *)dst)[j] = z; - } - return; - } - } - else if (ix == n_stops) - ix--; - - for (j = 0; j < n_ch; j++) - { - int z; - z = stops[ix].color[j]; - if (render->buf_depth == 8) - dst[j] = ART_PIX_8_FROM_MAX (z); - else /* (render->buf_depth == 16) */ - ((art_u16 *)dst)[j] = z; - } -} - -static void -art_render_gradient_linear_done (ArtRenderCallback *self, ArtRender *render) -{ - art_free (self); -} - -static void -art_render_gradient_linear_render (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtImageSourceGradLin *z = (ArtImageSourceGradLin *)self; - const ArtGradientLinear *gradient = &(z->gradient); - int pixstride = (render->n_chan + 1) * (render->depth >> 3); - int x; - int width = render->x1 - render->x0; - double offset, d_offset; - double actual_offset; - int n_stops = gradient->n_stops; - ArtGradientStop *stops = gradient->stops; - art_u8 *bufp = render->image_buf; - ArtGradientSpread spread = gradient->spread; - - offset = render->x0 * gradient->a + y * gradient->b + gradient->c; - d_offset = gradient->a; - - for (x = 0; x < width; x++) - { - if (spread == ART_GRADIENT_PAD) - actual_offset = offset; - else if (spread == ART_GRADIENT_REPEAT) - actual_offset = offset - floor (offset); - else /* (spread == ART_GRADIENT_REFLECT) */ - { - double tmp; - - tmp = offset - 2 * floor (0.5 * offset); - actual_offset = tmp > 1 ? 2 - tmp : tmp; - } - art_render_gradient_setpix (render, bufp, n_stops, stops, actual_offset); - offset += d_offset; - bufp += pixstride; - } -} - -static void -art_render_gradient_linear_negotiate (ArtImageSource *self, ArtRender *render, - int *p_flags, - int *p_buf_depth, ArtAlphaType *p_alpha) -{ - if (render->depth == 8 && - render->n_chan == 3) - { - self->super.render = art_render_gradient_linear_render_8; - *p_flags = 0; - *p_buf_depth = 8; - *p_alpha = ART_ALPHA_PREMUL; - return; - } - - self->super.render = art_render_gradient_linear_render; - *p_flags = 0; - *p_buf_depth = render->depth; - *p_alpha = ART_ALPHA_PREMUL; -} - -/** - * art_render_gradient_linear: Add a linear gradient image source. - * @render: The render object. - * @gradient: The linear gradient. - * - * Adds the linear gradient @gradient as the image source for rendering - * in the render object @render. - **/ -void -art_render_gradient_linear (ArtRender *render, - const ArtGradientLinear *gradient, - ArtFilterLevel level) -{ - ArtImageSourceGradLin *image_source = (ArtImageSourceGradLin*)art_alloc (sizeof (ArtImageSourceGradLin) + - sizeof (ArtGradientStop) * (gradient->n_stops - 1)); - - image_source->super.super.render = NULL; - image_source->super.super.done = art_render_gradient_linear_done; - image_source->super.negotiate = art_render_gradient_linear_negotiate; - - /* copy the gradient into the structure */ - image_source->gradient = *gradient; - image_source->gradient.stops = image_source->stops; - memcpy (image_source->gradient.stops, gradient->stops, sizeof (ArtGradientStop) * gradient->n_stops); - - art_render_add_image_source (render, &image_source->super); -} - -static void -art_render_gradient_radial_done (ArtRenderCallback *self, ArtRender *render) -{ - art_free (self); -} - -static void -art_render_gradient_radial_render (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtImageSourceGradRad *z = (ArtImageSourceGradRad *)self; - const ArtGradientRadial *gradient = &(z->gradient); - int pixstride = (render->n_chan + 1) * (render->depth >> 3); - int x; - int x0 = render->x0; - int width = render->x1 - x0; - int n_stops = gradient->n_stops; - ArtGradientStop *stops = gradient->stops; - art_u8 *bufp = render->image_buf; - double fx = gradient->fx; - double fy = gradient->fy; - double dx, dy; - double *affine = (double*)&gradient->affine[0]; - double aff0 = affine[0]; - double aff1 = affine[1]; - const double a = z->a; - const double arecip = 1.0 / a; - double b, db; - double c, dc, ddc; - double b_a, db_a; - double rad, drad, ddrad; - - dx = x0 * aff0 + y * affine[2] + affine[4] - fx; - dy = x0 * aff1 + y * affine[3] + affine[5] - fy; - b = dx * fx + dy * fy; - db = aff0 * fx + aff1 * fy; - c = dx * dx + dy * dy; - dc = 2 * aff0 * dx + aff0 * aff0 + 2 * aff1 * dy + aff1 * aff1; - ddc = 2 * aff0 * aff0 + 2 * aff1 * aff1; - - b_a = b * arecip; - db_a = db * arecip; - - rad = b_a * b_a + c * arecip; - drad = 2 * b_a * db_a + db_a * db_a + dc * arecip; - ddrad = 2 * db_a * db_a + ddc * arecip; - - for (x = 0; x < width; x++) - { - double z; - - if (rad > 0) - z = b_a + sqrt (rad); - else - z = b_a; - art_render_gradient_setpix (render, bufp, n_stops, stops, z); - bufp += pixstride; - b_a += db_a; - rad += drad; - drad += ddrad; - } -} - -static void -art_render_gradient_radial_negotiate (ArtImageSource *self, ArtRender *render, - int *p_flags, - int *p_buf_depth, ArtAlphaType *p_alpha) -{ - self->super.render = art_render_gradient_radial_render; - *p_flags = 0; - *p_buf_depth = render->depth; - *p_alpha = ART_ALPHA_PREMUL; -} - -/** - * art_render_gradient_radial: Add a radial gradient image source. - * @render: The render object. - * @gradient: The radial gradient. - * - * Adds the radial gradient @gradient as the image source for rendering - * in the render object @render. - **/ -void -art_render_gradient_radial (ArtRender *render, - const ArtGradientRadial *gradient, - ArtFilterLevel level) -{ - ArtImageSourceGradRad *image_source = (ArtImageSourceGradRad*)art_alloc (sizeof (ArtImageSourceGradRad) + - sizeof (ArtGradientStop) * (gradient->n_stops - 1)); - double fx = gradient->fx; - double fy = gradient->fy; - - image_source->super.super.render = NULL; - image_source->super.super.done = art_render_gradient_radial_done; - image_source->super.negotiate = art_render_gradient_radial_negotiate; - - /* copy the gradient into the structure */ - image_source->gradient = *gradient; - image_source->gradient.stops = image_source->stops; - memcpy (image_source->gradient.stops, gradient->stops, sizeof (ArtGradientStop) * gradient->n_stops); - - /* todo: sanitycheck fx, fy? */ - image_source->a = 1 - fx * fx - fy * fy; - - art_render_add_image_source (render, &image_source->super); -} diff -Nru swftools-0.9.0/lib/art/art_render_gradient.h swftools-0.9.2/lib/art/art_render_gradient.h --- swftools-0.9.0/lib/art/art_render_gradient.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render_gradient.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/* - * art_render_gradient.h: Gradient image source for modular rendering. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Raph Levien - * Alexander Larsson - */ - -#ifndef __ART_RENDER_GRADIENT_H__ -#define __ART_RENDER_GRADIENT_H__ - -#ifdef LIBART_COMPILATION -#include "art_filterlevel.h" -#include "art_render.h" -#else -#include "art_filterlevel.h" -#include "art_render.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtGradientLinear ArtGradientLinear; -typedef struct _ArtGradientRadial ArtGradientRadial; -typedef struct _ArtGradientStop ArtGradientStop; - -typedef enum { - ART_GRADIENT_PAD, - ART_GRADIENT_REFLECT, - ART_GRADIENT_REPEAT -} ArtGradientSpread; - -struct _ArtGradientLinear { - double a; - double b; - double c; - ArtGradientSpread spread; - int n_stops; - ArtGradientStop *stops; -}; - -struct _ArtGradientRadial { - double affine[6]; /* transforms user coordinates to unit circle */ - double fx, fy; /* focal point in unit circle coords */ - int n_stops; - ArtGradientStop *stops; -}; - -struct _ArtGradientStop { - double offset; - ArtPixMaxDepth color[ART_MAX_CHAN + 1]; -}; - -void -art_render_gradient_linear (ArtRender *render, - const ArtGradientLinear *gradient, - ArtFilterLevel level); - -void -art_render_gradient_radial (ArtRender *render, - const ArtGradientRadial *gradient, - ArtFilterLevel level); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RENDER_GRADIENT_H__ */ diff -Nru swftools-0.9.0/lib/art/art_render.h swftools-0.9.2/lib/art/art_render.h --- swftools-0.9.0/lib/art/art_render.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/* - * art_render.h: Modular rendering architecture. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RENDER_H__ -#define __ART_RENDER_H__ - -#ifdef LIBART_COMPILATION -#include "art_alphagamma.h" -#else -#include "art_alphagamma.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Render object */ - -#ifndef ART_MAX_DEPTH -#define ART_MAX_DEPTH 16 -#endif - -#if ART_MAX_DEPTH == 16 -typedef art_u16 ArtPixMaxDepth; -#define ART_PIX_MAX_FROM_8(x) ((x) | ((x) << 8)) -#define ART_PIX_8_FROM_MAX(x) (((x) + 0x80 - (((x) + 0x80) >> 8)) >> 8) -#else -#if ART_MAX_DEPTH == 8 -typedef art_u8 ArtPixMaxDepth; -#define ART_PIX_MAX_FROM_8(x) (x) -#define ART_PIX_8_FROM_MAX(x) (x) -#else -#error ART_MAX_DEPTH must be either 8 or 16 -#endif -#endif - -#define ART_MAX_CHAN 16 - -typedef struct _ArtRender ArtRender; -typedef struct _ArtRenderCallback ArtRenderCallback; -typedef struct _ArtRenderMaskRun ArtRenderMaskRun; -typedef struct _ArtImageSource ArtImageSource; -typedef struct _ArtMaskSource ArtMaskSource; - -typedef enum { - ART_ALPHA_NONE = 0, - ART_ALPHA_SEPARATE = 1, - ART_ALPHA_PREMUL = 2 -} ArtAlphaType; - -typedef enum { - ART_COMPOSITE_NORMAL, - ART_COMPOSITE_MULTIPLY, - /* todo: more */ - ART_COMPOSITE_CUSTOM -} ArtCompositingMode; - -#define ART_IMAGE_SOURCE_CAN_CLEAR 1 -#define ART_IMAGE_SOURCE_CAN_COMPOSITE 2 - -struct _ArtRenderMaskRun { - int x; - int alpha; -}; - -struct _ArtRenderCallback { - void (*render) (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y); - void (*done) (ArtRenderCallback *self, ArtRender *render); -}; - -struct _ArtImageSource { - ArtRenderCallback super; - void (*negotiate) (ArtImageSource *self, ArtRender *render, - int *p_flags, - int *p_buf_depth, ArtAlphaType *p_alpha_type); -}; - -struct _ArtMaskSource { - ArtRenderCallback super; - int (*can_drive) (ArtMaskSource *self, ArtRender *render); - /* For each mask source, ::prepare() is invoked if it is not - a driver, or ::invoke_driver() if it is. */ - void (*invoke_driver) (ArtMaskSource *self, ArtRender *render); - void (*prepare) (ArtMaskSource *self, ArtRender *render, art_boolean first); -}; - -struct _ArtRender { - /* parameters of destination image */ - int x0, y0; - int x1, y1; - art_u8 *pixels; - int rowstride; - int n_chan; - int depth; - ArtAlphaType alpha_type; - - art_boolean clear; - ArtPixMaxDepth clear_color[ART_MAX_CHAN + 1]; - art_u32 opacity; /* [0..0x10000] */ - - ArtCompositingMode compositing_mode; - - ArtAlphaGamma *alphagamma; - - art_u8 *alpha_buf; - - /* parameters of intermediate buffer */ - int buf_depth; - ArtAlphaType buf_alpha; - art_u8 *image_buf; - - /* driving alpha scanline data */ - /* A "run" is a contiguous sequence of x values with the same alpha value. */ - int n_run; - ArtRenderMaskRun *run; - - /* A "span" is a contiguous sequence of x values with non-zero alpha. */ - int n_span; - int *span_x; - - art_boolean need_span; -}; - -ArtRender * -art_render_new (int x0, int y0, int x1, int y1, - art_u8 *pixels, int rowstride, - int n_chan, int depth, ArtAlphaType alpha_type, - ArtAlphaGamma *alphagamma); - -void -art_render_invoke (ArtRender *render); - -void -art_render_clear (ArtRender *render, const ArtPixMaxDepth *clear_color); - -void -art_render_clear_rgb (ArtRender *render, art_u32 clear_rgb); - -void -art_render_mask_solid (ArtRender *render, int opacity); - -void -art_render_image_solid (ArtRender *render, ArtPixMaxDepth *color); - -/* The next two functions are for custom mask sources only. */ -void -art_render_add_mask_source (ArtRender *render, ArtMaskSource *mask_source); - -void -art_render_invoke_callbacks (ArtRender *render, art_u8 *dest, int y); - -/* The following function is for custom image sources only. */ -void -art_render_add_image_source (ArtRender *render, ArtImageSource *image_source); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RENDER_H__ */ - diff -Nru swftools-0.9.0/lib/art/art_render_mask.c swftools-0.9.2/lib/art/art_render_mask.c --- swftools-0.9.0/lib/art/art_render_mask.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render_mask.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -/* - * art_render_mask.c: Alpha mask source for modular rendering. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Raph Levien - */ - -#include "config.h" -#include "art_render_mask.h" - -#include - - -typedef struct _ArtMaskSourceMask ArtMaskSourceMask; - -struct _ArtMaskSourceMask { - ArtMaskSource super; - ArtRender *render; - art_boolean first; - int x0; - int y0; - int x1; - int y1; - const art_u8 *mask_buf; - int rowstride; -}; - -static void -art_render_mask_done (ArtRenderCallback *self, ArtRender *render) -{ - art_free (self); -} - -static int -art_render_mask_can_drive (ArtMaskSource *self, ArtRender *render) -{ - return 0; -} - -static void -art_render_mask_render (ArtRenderCallback *self, ArtRender *render, - art_u8 *dest, int y) -{ - ArtMaskSourceMask *z = (ArtMaskSourceMask *)self; - int x0 = render->x0, x1 = render->x1; - int z_x0 = z->x0, z_x1 = z->x1; - int width = x1 - x0; - int z_width = z_x1 - z_x0; - art_u8 *alpha_buf = render->alpha_buf; - - if (y < z->y0 || y >= z->y1 || z_width <= 0) - memset (alpha_buf, 0, width); - else - { - const art_u8 *src_line = z->mask_buf + (y - z->y0) * z->rowstride; - art_u8 *dst_line = alpha_buf + z_x0 - x0; - - if (z_x0 > x0) - memset (alpha_buf, 0, z_x0 - x0); - - if (z->first) - memcpy (dst_line, src_line, z_width); - else - { - int x; - - for (x = 0; x < z_width; x++) - { - int v; - v = src_line[x]; - if (v) - { - v = v * dst_line[x] + 0x80; - v = (v + (v >> 8)) >> 8; - dst_line[x] = v; - } - else - { - dst_line[x] = 0; - } - } - } - - if (z_x1 < x1) - memset (alpha_buf + z_x1 - x0, 0, x1 - z_x1); - } -} - -static void -art_render_mask_prepare (ArtMaskSource *self, ArtRender *render, - art_boolean first) -{ - ArtMaskSourceMask *z = (ArtMaskSourceMask *)self; - self->super.render = art_render_mask_render; - z->first = first; -} - -/** - * art_render_mask: Use an alpha buffer as a render mask source. - * @render: Render object. - * @x0: Left coordinate of mask rect. - * @y0: Top coordinate of mask rect. - * @x1: Right coordinate of mask rect. - * @y1: Bottom coordinate of mask rect. - * @mask_buf: Buffer containing 8bpp alpha mask data. - * @rowstride: Rowstride of @mask_buf. - * - * Adds @mask_buf to the render object as a mask. Note: @mask_buf must - * remain allocated until art_render_invoke() is called on @render. - **/ -void -art_render_mask (ArtRender *render, - int x0, int y0, int x1, int y1, - const art_u8 *mask_buf, int rowstride) -{ - ArtMaskSourceMask *mask_source; - - if (x0 < render->x0) - { - mask_buf += render->x0 - x0; - x0 = render->x0; - } - if (x1 > render->x1) - x1 = render->x1; - - if (y0 < render->y0) - { - mask_buf += (render->y0 - y0) * rowstride; - y0 = render->y0; - } - if (y1 > render->y1) - y1 = render->y1; - - mask_source = art_new (ArtMaskSourceMask, 1); - - mask_source->super.super.render = NULL; - mask_source->super.super.done = art_render_mask_done; - mask_source->super.can_drive = art_render_mask_can_drive; - mask_source->super.invoke_driver = NULL; - mask_source->super.prepare = art_render_mask_prepare; - mask_source->render = render; - mask_source->x0 = x0; - mask_source->y0 = y0; - mask_source->x1 = x1; - mask_source->y1 = y1; - mask_source->mask_buf = mask_buf; - mask_source->rowstride = rowstride; - - art_render_add_mask_source (render, &mask_source->super); - -} diff -Nru swftools-0.9.0/lib/art/art_render_mask.h swftools-0.9.2/lib/art/art_render_mask.h --- swftools-0.9.0/lib/art/art_render_mask.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render_mask.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * art_render_mask.h: Alpha mask source for modular rendering. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Raph Levien - */ - -#ifndef __ART_RENDER_MASK_H__ -#define __ART_RENDER_MASK_H__ - -#ifdef LIBART_COMPILATION -#include "art_render.h" -#else -#include "art_render.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_render_mask (ArtRender *render, - int x0, int y0, int x1, int y1, - const art_u8 *mask_buf, int rowstride); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RENDER_MASK_H__ */ diff -Nru swftools-0.9.0/lib/art/art_render_svp.c swftools-0.9.2/lib/art/art_render_svp.c --- swftools-0.9.0/lib/art/art_render_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,421 +0,0 @@ -/* - * art_render_gradient.c: SVP mask source for modular rendering. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Raph Levien - */ - -#include "art_render_svp.h" -#include "art_svp_render_aa.h" - -typedef struct _ArtMaskSourceSVP ArtMaskSourceSVP; - -struct _ArtMaskSourceSVP { - ArtMaskSource super; - ArtRender *render; - const ArtSVP *svp; - art_u8 *dest_ptr; -}; - -static void -art_render_svp_done (ArtRenderCallback *self, ArtRender *render) -{ - art_free (self); -} - -static int -art_render_svp_can_drive (ArtMaskSource *self, ArtRender *render) -{ - return 10; -} - -/* The basic art_render_svp_callback function is repeated four times, - for all combinations of non-unit opacity and generating spans. In - general, I'd consider this bad style, but in this case I plead - a measurable performance improvement. */ - -static void -art_render_svp_callback (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtMaskSourceSVP *z = (ArtMaskSourceSVP *)callback_data; - ArtRender *render = z->render; - int n_run = 0; - int i; - int running_sum = start; - int x0 = render->x0; - int x1 = render->x1; - int run_x0, run_x1; - ArtRenderMaskRun *run = render->run; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - if (run_x1 > x0 && running_sum > 0x80ff) - { - run[0].x = x0; - run[0].alpha = running_sum; - n_run++; - } - - for (i = 0; i < n_steps - 1; i++) - { - running_sum += steps[i].delta; - run_x0 = run_x1; - run_x1 = steps[i + 1].x; - if (run_x1 > run_x0) - { - run[n_run].x = run_x0; - run[n_run].alpha = running_sum; - n_run++; - } - } - if (x1 > run_x1) - { - running_sum += steps[n_steps - 1].delta; - run[n_run].x = run_x1; - run[n_run].alpha = running_sum; - n_run++; - } - if (running_sum > 0x80ff) - { - run[n_run].x = x1; - run[n_run].alpha = 0x8000; - n_run++; - } - } - else if ((running_sum >> 16) > 0) - { - run[0].x = x0; - run[0].alpha = running_sum; - run[1].x = x1; - run[1].alpha = running_sum; - n_run = 2; - } - - render->n_run = n_run; - - art_render_invoke_callbacks (render, z->dest_ptr, y); - - z->dest_ptr += render->rowstride; -} - -static void -art_render_svp_callback_span (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtMaskSourceSVP *z = (ArtMaskSourceSVP *)callback_data; - ArtRender *render = z->render; - int n_run = 0; - int n_span = 0; - int i; - int running_sum = start; - int x0 = render->x0; - int x1 = render->x1; - int run_x0, run_x1; - ArtRenderMaskRun *run = render->run; - int *span_x = render->span_x; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - if (run_x1 > x0 && running_sum > 0x80ff) - { - run[0].x = x0; - run[0].alpha = running_sum; - n_run++; - span_x[0] = x0; - n_span++; - } - - for (i = 0; i < n_steps - 1; i++) - { - running_sum += steps[i].delta; - run_x0 = run_x1; - run_x1 = steps[i + 1].x; - if (run_x1 > run_x0) - { - run[n_run].x = run_x0; - run[n_run].alpha = running_sum; - n_run++; - if ((n_span & 1) != (running_sum > 0x80ff)) - span_x[n_span++] = run_x0; - } - } - if (x1 > run_x1) - { - running_sum += steps[n_steps - 1].delta; - run[n_run].x = run_x1; - run[n_run].alpha = running_sum; - n_run++; - if ((n_span & 1) != (running_sum > 0x80ff)) - span_x[n_span++] = run_x1; - } - if (running_sum > 0x80ff) - { - run[n_run].x = x1; - run[n_run].alpha = 0x8000; - n_run++; - span_x[n_span++] = x1; - } - } - else if ((running_sum >> 16) > 0) - { - run[0].x = x0; - run[0].alpha = running_sum; - run[1].x = x1; - run[1].alpha = running_sum; - n_run = 2; - span_x[0] = x0; - span_x[1] = x1; - n_span = 2; - } - - render->n_run = n_run; - render->n_span = n_span; - - art_render_invoke_callbacks (render, z->dest_ptr, y); - - z->dest_ptr += render->rowstride; -} - -static void -art_render_svp_callback_opacity (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtMaskSourceSVP *z = (ArtMaskSourceSVP *)callback_data; - ArtRender *render = z->render; - int n_run = 0; - int i; - art_u32 running_sum; - int x0 = render->x0; - int x1 = render->x1; - int run_x0, run_x1; - ArtRenderMaskRun *run = render->run; - art_u32 opacity = render->opacity; - art_u32 alpha; - - running_sum = start - 0x7f80; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - alpha = ((running_sum >> 8) * opacity + 0x80080) >> 8; - if (run_x1 > x0 && alpha > 0x80ff) - { - run[0].x = x0; - run[0].alpha = alpha; - n_run++; - } - - for (i = 0; i < n_steps - 1; i++) - { - running_sum += steps[i].delta; - run_x0 = run_x1; - run_x1 = steps[i + 1].x; - if (run_x1 > run_x0) - { - run[n_run].x = run_x0; - alpha = ((running_sum >> 8) * opacity + 0x80080) >> 8; - run[n_run].alpha = alpha; - n_run++; - } - } - if (x1 > run_x1) - { - running_sum += steps[n_steps - 1].delta; - run[n_run].x = run_x1; - alpha = ((running_sum >> 8) * opacity + 0x80080) >> 8; - run[n_run].alpha = alpha; - n_run++; - } - if (alpha > 0x80ff) - { - run[n_run].x = x1; - run[n_run].alpha = 0x8000; - n_run++; - } - } - else if ((running_sum >> 16) > 0) - { - run[0].x = x0; - run[0].alpha = running_sum; - run[1].x = x1; - run[1].alpha = running_sum; - n_run = 2; - } - - render->n_run = n_run; - - art_render_invoke_callbacks (render, z->dest_ptr, y); - - z->dest_ptr += render->rowstride; -} - -static void -art_render_svp_callback_opacity_span (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtMaskSourceSVP *z = (ArtMaskSourceSVP *)callback_data; - ArtRender *render = z->render; - int n_run = 0; - int n_span = 0; - int i; - art_u32 running_sum; - int x0 = render->x0; - int x1 = render->x1; - int run_x0, run_x1; - ArtRenderMaskRun *run = render->run; - int *span_x = render->span_x; - art_u32 opacity = render->opacity; - art_u32 alpha; - - running_sum = start - 0x7f80; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - alpha = ((running_sum >> 8) * opacity + 0x800080) >> 8; - if (run_x1 > x0 && alpha > 0x80ff) - { - run[0].x = x0; - run[0].alpha = alpha; - n_run++; - span_x[0] = x0; - n_span++; - } - - for (i = 0; i < n_steps - 1; i++) - { - running_sum += steps[i].delta; - run_x0 = run_x1; - run_x1 = steps[i + 1].x; - if (run_x1 > run_x0) - { - run[n_run].x = run_x0; - alpha = ((running_sum >> 8) * opacity + 0x800080) >> 8; - run[n_run].alpha = alpha; - n_run++; - if ((n_span & 1) != (alpha > 0x80ff)) - span_x[n_span++] = run_x0; - } - } - if (x1 > run_x1) - { - running_sum += steps[n_steps - 1].delta; - run[n_run].x = run_x1; - alpha = ((running_sum >> 8) * opacity + 0x800080) >> 8; - run[n_run].alpha = alpha; - n_run++; - if ((n_span & 1) != (alpha > 0x80ff)) - span_x[n_span++] = run_x1; - } - if (alpha > 0x80ff) - { - run[n_run].x = x1; - run[n_run].alpha = 0x8000; - n_run++; - span_x[n_span++] = x1; - } - } - else if ((running_sum >> 16) > 0) - { - run[0].x = x0; - run[0].alpha = running_sum; - run[1].x = x1; - run[1].alpha = running_sum; - n_run = 2; - span_x[0] = x0; - span_x[1] = x1; - n_span = 2; - } - - render->n_run = n_run; - render->n_span = n_span; - - art_render_invoke_callbacks (render, z->dest_ptr, y); - - z->dest_ptr += render->rowstride; -} - -static void -art_render_svp_invoke_driver (ArtMaskSource *self, ArtRender *render) -{ - ArtMaskSourceSVP *z = (ArtMaskSourceSVP *)self; - void (*callback) (void *callback_data, - int y, - int start, - ArtSVPRenderAAStep *steps, int n_steps); - - z->dest_ptr = render->pixels; - if (render->opacity == 0x10000) - { - if (render->need_span) - callback = art_render_svp_callback_span; - else - callback = art_render_svp_callback; - } - else - { - if (render->need_span) - callback = art_render_svp_callback_opacity_span; - else - callback = art_render_svp_callback_opacity; - } - - art_svp_render_aa (z->svp, - render->x0, render->y0, - render->x1, render->y1, callback, - self); - art_render_svp_done (&self->super, render); -} - -static void -art_render_svp_prepare (ArtMaskSource *self, ArtRender *render, - art_boolean first) -{ - /* todo */ - art_die ("art_render_svp non-driver mode not yet implemented.\n"); -} - -/** - * art_render_svp: Use an SVP as a render mask source. - * @render: Render object. - * @svp: SVP. - * - * Adds @svp to the render object as a mask. Note: @svp must remain - * allocated until art_render_invoke() is called on @render. - **/ -void -art_render_svp (ArtRender *render, const ArtSVP *svp) -{ - ArtMaskSourceSVP *mask_source; - mask_source = art_new (ArtMaskSourceSVP, 1); - - mask_source->super.super.render = NULL; - mask_source->super.super.done = art_render_svp_done; - mask_source->super.can_drive = art_render_svp_can_drive; - mask_source->super.invoke_driver = art_render_svp_invoke_driver; - mask_source->super.prepare = art_render_svp_prepare; - mask_source->render = render; - mask_source->svp = svp; - - art_render_add_mask_source (render, &mask_source->super); -} diff -Nru swftools-0.9.0/lib/art/art_render_svp.h swftools-0.9.2/lib/art/art_render_svp.h --- swftools-0.9.0/lib/art/art_render_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_render_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - * art_render_svp.h: SVP mask source for modular rendering. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Authors: Raph Levien - */ - -#ifndef __ART_RENDER_SVP_H__ -#define __ART_RENDER_SVP_H__ - -#ifdef LIBART_COMPILATION -#include "art_render.h" -#include "art_svp.h" -#else -#include "art_render.h" -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_render_svp (ArtRender *render, const ArtSVP *svp); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RENDER_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/art_rgb_a_affine.c swftools-0.9.2/lib/art/art_rgb_a_affine.c --- swftools-0.9.0/lib/art/art_rgb_a_affine.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_a_affine.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,149 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb_a_affine.h" - -#include - -#include "art_affine.h" -#include "art_point.h" -#include "art_rgb_affine_private.h" - -/* This module handles compositing of affine-transformed alpha only images - over rgb pixel buffers. */ - -/* Composite the source image over the destination image, applying the - affine transform. */ - -/** - * art_rgb_a_affine: Affine transform source Alpha image and composite. - * @dst: Destination image RGB buffer. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @dst_rowstride: Rowstride of @dst buffer. - * @src: Source image alpha buffer. - * @src_width: Width of source image. - * @src_height: Height of source image. - * @src_rowstride: Rowstride of @src buffer. - * @rgb: RGB foreground color, in 0xRRGGBB. - * @affine: Affine transform. - * @level: Filter level. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the compositing. - * - * Affine transform the solid color rgb with alpha specified by the - * source image stored in @src, compositing over the area of destination - * image @dst specified by the rectangle (@x0, @y0) - (@x1, @y1). - * As usual in libart, the left and top edges of this rectangle are - * included, and the right and bottom edges are excluded. - * - * The @alphagamma parameter specifies that the alpha compositing be - * done in a gamma-corrected color space. In the current - * implementation, it is ignored. - * - * The @level parameter specifies the speed/quality tradeoff of the - * image interpolation. Currently, only ART_FILTER_NEAREST is - * implemented. - **/ -void -art_rgb_a_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - art_u32 rgb, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma) -{ - /* Note: this is a slow implementation, and is missing all filter - levels other than NEAREST. It is here for clarity of presentation - and to establish the interface. */ - int x, y; - double inv[6]; - art_u8 *dst_p, *dst_linestart; - const art_u8 *src_p; - ArtPoint pt, src_pt; - int src_x, src_y; - int alpha; - art_u8 bg_r, bg_g, bg_b; - art_u8 fg_r, fg_g, fg_b; - int tmp; - int run_x0, run_x1; - art_u8 r, g, b; - - r = (rgb>>16)&0xff; - g = (rgb>>8)&0xff; - b = (rgb)&0xff; - - dst_linestart = dst; - art_affine_invert (inv, affine); - for (y = y0; y < y1; y++) - { - pt.y = y + 0.5; - run_x0 = x0; - run_x1 = x1; - art_rgb_affine_run (&run_x0, &run_x1, y, src_width, src_height, - inv); - dst_p = dst_linestart + (run_x0 - x0) * 3; - for (x = run_x0; x < run_x1; x++) - { - pt.x = x + 0.5; - art_affine_point (&src_pt, &pt, inv); - src_x = floor (src_pt.x); - src_y = floor (src_pt.y); - src_p = src + (src_y * src_rowstride) + src_x; - if (src_x >= 0 && src_x < src_width && - src_y >= 0 && src_y < src_height) - { - - alpha = *src_p; - if (alpha) - { - if (alpha == 255) - { - dst_p[0] = r; - dst_p[1] = g; - dst_p[2] = b; - } - else - { - bg_r = dst_p[0]; - bg_g = dst_p[1]; - bg_b = dst_p[2]; - - tmp = (r - bg_r) * alpha; - fg_r = bg_r + ((tmp + (tmp >> 8) + 0x80) >> 8); - tmp = (g - bg_g) * alpha; - fg_g = bg_g + ((tmp + (tmp >> 8) + 0x80) >> 8); - tmp = (b - bg_b) * alpha; - fg_b = bg_b + ((tmp + (tmp >> 8) + 0x80) >> 8); - - dst_p[0] = fg_r; - dst_p[1] = fg_g; - dst_p[2] = fg_b; - } - } - } else { dst_p[0] = 255; dst_p[1] = 0; dst_p[2] = 0; } - dst_p += 3; - } - dst_linestart += dst_rowstride; - } -} diff -Nru swftools-0.9.0/lib/art/art_rgb_a_affine.h swftools-0.9.2/lib/art/art_rgb_a_affine.h --- swftools-0.9.0/lib/art/art_rgb_a_affine.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_a_affine.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_A_AFFINE_H__ -#define __ART_RGB_A_AFFINE_H__ - -/* This module handles compositing of affine-transformed alpha only images - over rgb pixel buffers. */ - -#ifdef LIBART_COMPILATION -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#else -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_a_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - art_u32 rgb, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgba.c swftools-0.9.2/lib/art/art_rgba.c --- swftools-0.9.0/lib/art/art_rgba.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgba.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,258 +0,0 @@ -/* - * art_rgba.c: Functions for manipulating RGBA pixel data. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgba.h" - -#define ART_OPTIMIZE_SPACE - -#ifndef ART_OPTIMIZE_SPACE -#include "art_rgba_table.c" -#endif - -/** - * art_rgba_rgba_composite: Composite RGBA image over RGBA buffer. - * @dst: Destination RGBA buffer. - * @src: Source RGBA buffer. - * @n: Number of RGBA pixels to composite. - * - * Composites the RGBA pixels in @dst over the @src buffer. - **/ -void -art_rgba_rgba_composite (art_u8 *dst, const art_u8 *src, int n) -{ - int i; -#ifdef WORDS_BIGENDIAN - art_u32 src_rgba, dst_rgba; -#else - art_u32 src_abgr, dst_abgr; -#endif - art_u8 src_alpha, dst_alpha; - - for (i = 0; i < n; i++) - { -#ifdef WORDS_BIGENDIAN - src_rgba = ((art_u32 *)src)[i]; - src_alpha = src_rgba & 0xff; -#else - src_abgr = ((art_u32 *)src)[i]; - src_alpha = (src_abgr >> 24) & 0xff; -#endif - if (src_alpha) - { - if (src_alpha == 0xff || - ( -#ifdef WORDS_BIGENDIAN - dst_rgba = ((art_u32 *)dst)[i], - dst_alpha = dst_rgba & 0xff, -#else - dst_abgr = ((art_u32 *)dst)[i], - dst_alpha = (dst_abgr >> 24), -#endif - dst_alpha == 0)) -#ifdef WORDS_BIGENDIAN - ((art_u32 *)dst)[i] = src_rgba; -#else - ((art_u32 *)dst)[i] = src_abgr; -#endif - else - { - int r, g, b, a; - int src_r, src_g, src_b; - int dst_r, dst_g, dst_b; - int tmp; - int c; - -#ifdef ART_OPTIMIZE_SPACE - tmp = (255 - src_alpha) * (255 - dst_alpha) + 0x80; - a = 255 - ((tmp + (tmp >> 8)) >> 8); - c = ((src_alpha << 16) + (a >> 1)) / a; -#else - tmp = art_rgba_composite_table[(src_alpha << 8) + dst_alpha]; - c = tmp & 0x1ffff; - a = tmp >> 24; -#endif -#ifdef WORDS_BIGENDIAN - src_r = (src_rgba >> 24) & 0xff; - src_g = (src_rgba >> 16) & 0xff; - src_b = (src_rgba >> 8) & 0xff; - dst_r = (dst_rgba >> 24) & 0xff; - dst_g = (dst_rgba >> 16) & 0xff; - dst_b = (dst_rgba >> 8) & 0xff; -#else - src_r = src_abgr & 0xff; - src_g = (src_abgr >> 8) & 0xff; - src_b = (src_abgr >> 16) & 0xff; - dst_r = dst_abgr & 0xff; - dst_g = (dst_abgr >> 8) & 0xff; - dst_b = (dst_abgr >> 16) & 0xff; -#endif - r = dst_r + (((src_r - dst_r) * c + 0x8000) >> 16); - g = dst_g + (((src_g - dst_g) * c + 0x8000) >> 16); - b = dst_b + (((src_b - dst_b) * c + 0x8000) >> 16); -#ifdef WORDS_BIGENDIAN - ((art_u32 *)dst)[i] = (r << 24) | (g << 16) | (b << 8) | a; -#else - ((art_u32 *)dst)[i] = (a << 24) | (b << 16) | (g << 8) | r; -#endif - } - } -#if 0 - /* it's not clear to me this optimization really wins */ - else - { - /* skip over run of transparent pixels */ - for (; i < n - 1; i++) - { -#ifdef WORDS_BIGENDIAN - src_rgba = ((art_u32 *)src)[i + 1]; - if (src_rgba & 0xff) - break; -#else - src_abgr = ((art_u32 *)src)[i + 1]; - if (src_abgr & 0xff000000) - break; -#endif - } - } -#endif - } -} - -/** - * art_rgba_fill_run: fill an RGBA buffer a solid RGB color. - * @buf: Buffer to fill. - * @r: Red, range 0..255. - * @g: Green, range 0..255. - * @b: Blue, range 0..255. - * @n: Number of RGB triples to fill. - * - * Fills a buffer with @n copies of the (@r, @g, @b) triple, solid - * alpha. Thus, locations @buf (inclusive) through @buf + 4 * @n - * (exclusive) are written. - **/ -void -art_rgba_fill_run (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int n) -{ - int i; -#ifdef WORDS_BIGENDIAN - art_u32 src_rgba; -#else - art_u32 src_abgr; -#endif - -#ifdef WORDS_BIGENDIAN - src_rgba = (r << 24) | (g << 16) | (b << 8) | 255; -#else - src_abgr = (255 << 24) | (b << 16) | (g << 8) | r; -#endif - for (i = 0; i < n; i++) - { -#ifdef WORDS_BIGENDIAN - ((art_u32 *)buf)[i] = src_rgba; -#else - ((art_u32 *)buf)[i] = src_abgr; -#endif - } -} - -/** - * art_rgba_run_alpha: Render semitransparent color over RGBA buffer. - * @buf: Buffer for rendering. - * @r: Red, range 0..255. - * @g: Green, range 0..255. - * @b: Blue, range 0..255. - * @alpha: Alpha, range 0..255. - * @n: Number of RGB triples to render. - * - * Renders a sequential run of solid (@r, @g, @b) color over @buf with - * opacity @alpha. Note that the range of @alpha is 0..255, in contrast - * to art_rgb_run_alpha, which has a range of 0..256. - **/ -void -art_rgba_run_alpha (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int alpha, int n) -{ - int i; -#ifdef WORDS_BIGENDIAN - art_u32 src_rgba, dst_rgba; -#else - art_u32 src_abgr, dst_abgr; -#endif - art_u8 dst_alpha; - int a; - int dst_r, dst_g, dst_b; - int tmp; - int c; - -#ifdef WORDS_BIGENDIAN - src_rgba = (r << 24) | (g << 16) | (b << 8) | alpha; -#else - src_abgr = (alpha << 24) | (b << 16) | (g << 8) | r; -#endif - for (i = 0; i < n; i++) - { -#ifdef WORDS_BIGENDIAN - dst_rgba = ((art_u32 *)buf)[i]; - dst_alpha = dst_rgba & 0xff; -#else - dst_abgr = ((art_u32 *)buf)[i]; - dst_alpha = (dst_abgr >> 24) & 0xff; -#endif - if (dst_alpha) - { -#ifdef ART_OPTIMIZE_SPACE - tmp = (255 - alpha) * (255 - dst_alpha) + 0x80; - a = 255 - ((tmp + (tmp >> 8)) >> 8); - c = ((alpha << 16) + (a >> 1)) / a; -#else - tmp = art_rgba_composite_table[(alpha << 8) + dst_alpha]; - c = tmp & 0x1ffff; - a = tmp >> 24; -#endif -#ifdef WORDS_BIGENDIAN - dst_r = (dst_rgba >> 24) & 0xff; - dst_g = (dst_rgba >> 16) & 0xff; - dst_b = (dst_rgba >> 8) & 0xff; -#else - dst_r = dst_abgr & 0xff; - dst_g = (dst_abgr >> 8) & 0xff; - dst_b = (dst_abgr >> 16) & 0xff; -#endif - dst_r += (((r - dst_r) * c + 0x8000) >> 16); - dst_g += (((g - dst_g) * c + 0x8000) >> 16); - dst_b += (((b - dst_b) * c + 0x8000) >> 16); -#ifdef WORDS_BIGENDIAN - ((art_u32 *)buf)[i] = (dst_r << 24) | (dst_g << 16) | (dst_b << 8) | a; -#else - ((art_u32 *)buf)[i] = (a << 24) | (dst_b << 16) | (dst_g << 8) | dst_r; -#endif - } - else - { -#ifdef WORDS_BIGENDIAN - ((art_u32 *)buf)[i] = src_rgba; -#else - ((art_u32 *)buf)[i] = src_abgr; -#endif - } - } -} diff -Nru swftools-0.9.0/lib/art/art_rgb_affine.c swftools-0.9.2/lib/art/art_rgb_affine.c --- swftools-0.9.0/lib/art/art_rgb_affine.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_affine.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb_affine.h" - -#include -#include "art_misc.h" -#include "art_point.h" -#include "art_affine.h" -#include "art_rgb_affine_private.h" - -/* This module handles compositing of affine-transformed rgb images - over rgb pixel buffers. */ - -/** - * art_rgb_affine: Affine transform source RGB image and composite. - * @dst: Destination image RGB buffer. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @dst_rowstride: Rowstride of @dst buffer. - * @src: Source image RGB buffer. - * @src_width: Width of source image. - * @src_height: Height of source image. - * @src_rowstride: Rowstride of @src buffer. - * @affine: Affine transform. - * @level: Filter level. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the compositing. - * - * Affine transform the source image stored in @src, compositing over - * the area of destination image @dst specified by the rectangle - * (@x0, @y0) - (@x1, @y1). As usual in libart, the left and top edges - * of this rectangle are included, and the right and bottom edges are - * excluded. - * - * The @alphagamma parameter specifies that the alpha compositing be done - * in a gamma-corrected color space. Since the source image is opaque RGB, - * this argument only affects the edges. In the current implementation, - * it is ignored. - * - * The @level parameter specifies the speed/quality tradeoff of the - * image interpolation. Currently, only ART_FILTER_NEAREST is - * implemented. - **/ -void -art_rgb_affine (art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma) -{ - /* Note: this is a slow implementation, and is missing all filter - levels other than NEAREST. It is here for clarity of presentation - and to establish the interface. */ - int x, y; - double inv[6]; - art_u8 *dst_p, *dst_linestart; - const art_u8 *src_p; - ArtPoint pt, src_pt; - int src_x, src_y; - int run_x0, run_x1; - - dst_linestart = dst; - art_affine_invert (inv, affine); - for (y = y0; y < y1; y++) - { - pt.y = y + 0.5; - run_x0 = x0; - run_x1 = x1; - art_rgb_affine_run (&run_x0, &run_x1, y, src_width, src_height, - inv); - dst_p = dst_linestart + (run_x0 - x0) * 3; - for (x = run_x0; x < run_x1; x++) - { - pt.x = x + 0.5; - art_affine_point (&src_pt, &pt, inv); - src_x = floor (src_pt.x); - src_y = floor (src_pt.y); - src_p = src + (src_y * src_rowstride) + src_x * 3; - dst_p[0] = src_p[0]; - dst_p[1] = src_p[1]; - dst_p[2] = src_p[2]; - dst_p += 3; - } - dst_linestart += dst_rowstride; - } -} diff -Nru swftools-0.9.0/lib/art/art_rgb_affine.h swftools-0.9.2/lib/art/art_rgb_affine.h --- swftools-0.9.0/lib/art/art_rgb_affine.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_affine.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_AFFINE_H__ -#define __ART_RGB_AFFINE_H__ - -/* This module handles compositing of affine-transformed rgb images - over rgb pixel buffers. */ - -#ifdef LIBART_COMPILATION -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#else -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_affine (art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgb_affine_private.c swftools-0.9.2/lib/art/art_rgb_affine_private.c --- swftools-0.9.0/lib/art/art_rgb_affine_private.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_affine_private.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb_affine_private.h" - -#include -#include "art_misc.h" -#include "art_point.h" -#include "art_affine.h" - -/* Private functions for the rgb affine image compositors - primarily, - the determination of runs, eliminating the need for source image - bbox calculation in the inner loop. */ - -/* Determine a "run", such that the inverse affine of all pixels from - (x0, y) inclusive to (x1, y) exclusive fit within the bounds - of the source image. - - Initial values of x0, x1, and result values stored in first two - pointer arguments. -*/ - -#define EPSILON 1e-6 - -void -art_rgb_affine_run (int *p_x0, int *p_x1, int y, - int src_width, int src_height, - const double affine[6]) -{ - int x0, x1; - double z; - double x_intercept; - int xi; - - x0 = *p_x0; - x1 = *p_x1; - - /* do left and right edges */ - if (affine[0] > EPSILON) - { - z = affine[2] * (y + 0.5) + affine[4]; - x_intercept = -z / affine[0]; - xi = ceil (x_intercept + EPSILON - 0.5); - if (xi > x0) - x0 = xi; - x_intercept = (-z + src_width) / affine[0]; - xi = ceil (x_intercept - EPSILON - 0.5); - if (xi < x1) - x1 = xi; - } - else if (affine[0] < -EPSILON) - { - z = affine[2] * (y + 0.5) + affine[4]; - x_intercept = (-z + src_width) / affine[0]; - xi = ceil (x_intercept + EPSILON - 0.5); - if (xi > x0) - x0 = xi; - x_intercept = -z / affine[0]; - xi = ceil (x_intercept - EPSILON - 0.5); - if (xi < x1) - x1 = xi; - } - else - { - z = affine[2] * (y + 0.5) + affine[4]; - if (z < 0 || z >= src_width) - { - *p_x1 = *p_x0; - return; - } - } - - /* do top and bottom edges */ - if (affine[1] > EPSILON) - { - z = affine[3] * (y + 0.5) + affine[5]; - x_intercept = -z / affine[1]; - xi = ceil (x_intercept + EPSILON - 0.5); - if (xi > x0) - x0 = xi; - x_intercept = (-z + src_height) / affine[1]; - xi = ceil (x_intercept - EPSILON - 0.5); - if (xi < x1) - x1 = xi; - } - else if (affine[1] < -EPSILON) - { - z = affine[3] * (y + 0.5) + affine[5]; - x_intercept = (-z + src_height) / affine[1]; - xi = ceil (x_intercept + EPSILON - 0.5); - if (xi > x0) - x0 = xi; - x_intercept = -z / affine[1]; - xi = ceil (x_intercept - EPSILON - 0.5); - if (xi < x1) - x1 = xi; - } - else - { - z = affine[3] * (y + 0.5) + affine[5]; - if (z < 0 || z >= src_height) - { - *p_x1 = *p_x0; - return; - } - } - - *p_x0 = x0; - *p_x1 = x1; -} diff -Nru swftools-0.9.0/lib/art/art_rgb_affine_private.h swftools-0.9.2/lib/art/art_rgb_affine_private.h --- swftools-0.9.0/lib/art/art_rgb_affine_private.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_affine_private.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_AFFINE_PRIVATE_H__ -#define __ART_RGB_AFFINE_PRIVATE_H__ - -/* This module handles compositing of affine-transformed rgb images - over rgb pixel buffers. */ - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_affine_run (int *p_x0, int *p_x1, int y, - int src_width, int src_height, - const double affine[6]); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgba.h swftools-0.9.2/lib/art/art_rgba.h --- swftools-0.9.0/lib/art/art_rgba.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgba.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * art_rgba.h: Functions for manipulating RGBA pixel data. - * - * Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGBA_H__ -#define __ART_RGBA_H__ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#else -#include "art_misc.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_rgba_rgba_composite (art_u8 *dst, const art_u8 *src, int n); - -void -art_rgba_fill_run (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int n); - -void -art_rgba_run_alpha (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int alpha, int n); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgb_bitmap_affine.c swftools-0.9.2/lib/art/art_rgb_bitmap_affine.c --- swftools-0.9.0/lib/art/art_rgb_bitmap_affine.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_bitmap_affine.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb_bitmap_affine.h" - -#include -#include "art_misc.h" -#include "art_point.h" -#include "art_affine.h" -#include "art_rgb_affine_private.h" - -/* This module handles compositing of affine-transformed bitmap images - over rgb pixel buffers. */ - -/* Composite the source image over the destination image, applying the - affine transform. Foreground color is given and assumed to be - opaque, background color is assumed to be fully transparent. */ - -static void -art_rgb_bitmap_affine_opaque (art_u8 *dst, - int x0, int y0, int x1, int y1, - int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - art_u32 rgb, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma) -{ - /* Note: this is a slow implementation, and is missing all filter - levels other than NEAREST. It is here for clarity of presentation - and to establish the interface. */ - int x, y; - double inv[6]; - art_u8 *dst_p, *dst_linestart; - const art_u8 *src_p; - ArtPoint pt, src_pt; - int src_x, src_y; - art_u8 r, g, b; - int run_x0, run_x1; - - r = rgb >> 16; - g = (rgb >> 8) & 0xff; - b = rgb & 0xff; - dst_linestart = dst; - art_affine_invert (inv, affine); - for (y = y0; y < y1; y++) - { - pt.y = y + 0.5; - run_x0 = x0; - run_x1 = x1; - art_rgb_affine_run (&run_x0, &run_x1, y, src_width, src_height, - inv); - dst_p = dst_linestart + (run_x0 - x0) * 3; - for (x = run_x0; x < run_x1; x++) - { - pt.x = x + 0.5; - art_affine_point (&src_pt, &pt, inv); - src_x = floor (src_pt.x); - src_y = floor (src_pt.y); - src_p = src + (src_y * src_rowstride) + (src_x >> 3); - if (*src_p & (128 >> (src_x & 7))) - { - dst_p[0] = r; - dst_p[1] = g; - dst_p[2] = b; - } - dst_p += 3; - } - dst_linestart += dst_rowstride; - } -} -/* Composite the source image over the destination image, applying the - affine transform. Foreground color is given, background color is - assumed to be fully transparent. */ - -/** - * art_rgb_bitmap_affine: Affine transform source bitmap image and composite. - * @dst: Destination image RGB buffer. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @dst_rowstride: Rowstride of @dst buffer. - * @src: Source image bitmap buffer. - * @src_width: Width of source image. - * @src_height: Height of source image. - * @src_rowstride: Rowstride of @src buffer. - * @rgba: RGBA foreground color, in 0xRRGGBBAA. - * @affine: Affine transform. - * @level: Filter level. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the compositing. - * - * Affine transform the source image stored in @src, compositing over - * the area of destination image @dst specified by the rectangle - * (@x0, @y0) - (@x1, @y1). - * - * The source bitmap stored with MSB as the leftmost pixel. Source 1 - * bits correspond to the semitransparent color @rgba, while source 0 - * bits are transparent. - * - * See art_rgb_affine() for a description of additional parameters. - **/ -void -art_rgb_bitmap_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - art_u32 rgba, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma) -{ - /* Note: this is a slow implementation, and is missing all filter - levels other than NEAREST. It is here for clarity of presentation - and to establish the interface. */ - int x, y; - double inv[6]; - art_u8 *dst_p, *dst_linestart; - const art_u8 *src_p; - ArtPoint pt, src_pt; - int src_x, src_y; - int alpha; - art_u8 bg_r, bg_g, bg_b; - art_u8 fg_r, fg_g, fg_b; - art_u8 r, g, b; - int run_x0, run_x1; - - alpha = rgba & 0xff; - if (alpha == 0xff) - { - art_rgb_bitmap_affine_opaque (dst, x0, y0, x1, y1, dst_rowstride, - src, - src_width, src_height, src_rowstride, - rgba >> 8, - affine, - level, - alphagamma); - return; - } - /* alpha = (65536 * alpha) / 255; */ - alpha = (alpha << 8) + alpha + (alpha >> 7); - r = rgba >> 24; - g = (rgba >> 16) & 0xff; - b = (rgba >> 8) & 0xff; - dst_linestart = dst; - art_affine_invert (inv, affine); - for (y = y0; y < y1; y++) - { - pt.y = y + 0.5; - run_x0 = x0; - run_x1 = x1; - art_rgb_affine_run (&run_x0, &run_x1, y, src_width, src_height, - inv); - dst_p = dst_linestart + (run_x0 - x0) * 3; - for (x = run_x0; x < run_x1; x++) - { - pt.x = x + 0.5; - art_affine_point (&src_pt, &pt, inv); - src_x = floor (src_pt.x); - src_y = floor (src_pt.y); - src_p = src + (src_y * src_rowstride) + (src_x >> 3); - if (*src_p & (128 >> (src_x & 7))) - { - bg_r = dst_p[0]; - bg_g = dst_p[1]; - bg_b = dst_p[2]; - - fg_r = bg_r + (((r - bg_r) * alpha + 0x8000) >> 16); - fg_g = bg_g + (((g - bg_g) * alpha + 0x8000) >> 16); - fg_b = bg_b + (((b - bg_b) * alpha + 0x8000) >> 16); - - dst_p[0] = fg_r; - dst_p[1] = fg_g; - dst_p[2] = fg_b; - } - dst_p += 3; - } - dst_linestart += dst_rowstride; - } -} diff -Nru swftools-0.9.0/lib/art/art_rgb_bitmap_affine.h swftools-0.9.2/lib/art/art_rgb_bitmap_affine.h --- swftools-0.9.0/lib/art/art_rgb_bitmap_affine.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_bitmap_affine.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_BITMAP_AFFINE_H__ -#define __ART_RGB_BITMAP_AFFINE_H__ - -/* This module handles compositing of affine-transformed bitmap images - over rgb pixel buffers. */ - -#ifdef LIBART_COMPILATION -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#else -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_bitmap_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - art_u32 rgba, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgb.c swftools-0.9.2/lib/art/art_rgb.c --- swftools-0.9.0/lib/art/art_rgb.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb.h" - -#include /* for memset */ - -/* Basic operators for manipulating 24-bit packed RGB buffers. */ - -#define COLOR_RUN_COMPLEX - -#ifdef COLOR_RUN_SIMPLE -/* This is really slow. Is there any way we might speed it up? - Two ideas: - - First, maybe we should be working at 32-bit alignment. Then, - this can be a simple loop over word stores. - - Second, we can keep working at 24-bit alignment, but have some - intelligence about storing. For example, we can iterate over - 4-pixel chunks (aligned at 4 pixels), with an inner loop - something like: - - *buf++ = v1; - *buf++ = v2; - *buf++ = v3; - - One source of extra complexity is the need to make sure linebuf is - aligned to a 32-bit boundary. - - This second alternative has some complexity to it, but is - appealing because it really minimizes the memory bandwidth. */ -void -art_rgb_fill_run (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, gint n) -{ - int i; - - if (r == g && g == b) - { - memset (buf, g, n + n + n); - } - else - { - for (i = 0; i < n; i++) - { - *buf++ = r; - *buf++ = g; - *buf++ = b; - } - } -} -#endif - -#ifdef COLOR_RUN_COMPLEX -/* This implements the second of the two ideas above. The test results - are _very_ encouraging - it seems the speed is within 10% of - memset, which is quite good! */ -/** - * art_rgb_fill_run: fill a buffer a solid RGB color. - * @buf: Buffer to fill. - * @r: Red, range 0..255. - * @g: Green, range 0..255. - * @b: Blue, range 0..255. - * @n: Number of RGB triples to fill. - * - * Fills a buffer with @n copies of the (@r, @g, @b) triple. Thus, - * locations @buf (inclusive) through @buf + 3 * @n (exclusive) are - * written. - * - * The implementation of this routine is very highly optimized. - **/ -void -art_rgb_fill_run (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int n) -{ - int i; - unsigned int v1, v2, v3; - - if (r == g && g == b) - { - memset (buf, g, n + n + n); - } - else - { - if (n < 8) - { - for (i = 0; i < n; i++) - { - *buf++ = r; - *buf++ = g; - *buf++ = b; - } - } else { - /* handle prefix up to byte alignment */ - /* I'm worried about this cast on sizeof(long) != sizeof(uchar *) - architectures, but it _should_ work. */ - for (i = 0; ((unsigned long)buf) & 3; i++) - { - *buf++ = r; - *buf++ = g; - *buf++ = b; - } -#ifndef WORDS_BIGENDIAN - v1 = r | (g << 8) | (b << 16) | (r << 24); - v3 = (v1 << 8) | b; - v2 = (v3 << 8) | g; -#else - v1 = (r << 24) | (g << 16) | (b << 8) | r; - v2 = (v1 << 8) | g; - v3 = (v2 << 8) | b; -#endif - for (; i < n - 3; i += 4) - { - ((art_u32 *)buf)[0] = v1; - ((art_u32 *)buf)[1] = v2; - ((art_u32 *)buf)[2] = v3; - buf += 12; - } - /* handle postfix */ - for (; i < n; i++) - { - *buf++ = r; - *buf++ = g; - *buf++ = b; - } - } - } -} -#endif - -/** - * art_rgb_run_alpha: Render semitransparent color over RGB buffer. - * @buf: Buffer for rendering. - * @r: Red, range 0..255. - * @g: Green, range 0..255. - * @b: Blue, range 0..255. - * @alpha: Alpha, range 0..256. - * @n: Number of RGB triples to render. - * - * Renders a sequential run of solid (@r, @g, @b) color over @buf with - * opacity @alpha. - **/ -void -art_rgb_run_alpha (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int alpha, int n) -{ - int i; - int v; - - for (i = 0; i < n; i++) - { - v = *buf; - *buf++ = v + (((r - v) * alpha + 0x80) >> 8); - v = *buf; - *buf++ = v + (((g - v) * alpha + 0x80) >> 8); - v = *buf; - *buf++ = v + (((b - v) * alpha + 0x80) >> 8); - } -} - diff -Nru swftools-0.9.0/lib/art/art_rgb.h swftools-0.9.2/lib/art/art_rgb.h --- swftools-0.9.0/lib/art/art_rgb.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_H__ -#define __ART_RGB_H__ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#else -#include "art_misc.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_fill_run (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int n); - -void -art_rgb_run_alpha (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int alpha, - int n); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgb_pixbuf_affine.c swftools-0.9.2/lib/art/art_rgb_pixbuf_affine.c --- swftools-0.9.0/lib/art/art_rgb_pixbuf_affine.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_pixbuf_affine.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb_pixbuf_affine.h" - -#include -#include "art_misc.h" -#include "art_point.h" -#include "art_affine.h" -#include "art_pixbuf.h" -#include "art_rgb_affine.h" -#include "art_rgb_affine.h" -#include "art_rgb_rgba_affine.h" - -/* This module handles compositing of affine-transformed generic - pixbuf images over rgb pixel buffers. */ - -/* Composite the source image over the destination image, applying the - affine transform. */ -/** - * art_rgb_pixbuf_affine: Affine transform source RGB pixbuf and composite. - * @dst: Destination image RGB buffer. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @dst_rowstride: Rowstride of @dst buffer. - * @pixbuf: source image pixbuf. - * @affine: Affine transform. - * @level: Filter level. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the compositing. - * - * Affine transform the source image stored in @src, compositing over - * the area of destination image @dst specified by the rectangle - * (@x0, @y0) - (@x1, @y1). As usual in libart, the left and top edges - * of this rectangle are included, and the right and bottom edges are - * excluded. - * - * The @alphagamma parameter specifies that the alpha compositing be - * done in a gamma-corrected color space. In the current - * implementation, it is ignored. - * - * The @level parameter specifies the speed/quality tradeoff of the - * image interpolation. Currently, only ART_FILTER_NEAREST is - * implemented. - **/ -void -art_rgb_pixbuf_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const ArtPixBuf *pixbuf, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma) -{ - if (pixbuf->format != ART_PIX_RGB) - { - art_warn ("art_rgb_pixbuf_affine: need RGB format image\n"); - return; - } - - if (pixbuf->bits_per_sample != 8) - { - art_warn ("art_rgb_pixbuf_affine: need 8-bit sample data\n"); - return; - } - - if (pixbuf->n_channels != 3 + (pixbuf->has_alpha != 0)) - { - art_warn ("art_rgb_pixbuf_affine: need 8-bit sample data\n"); - return; - } - - if (pixbuf->has_alpha) - art_rgb_rgba_affine (dst, x0, y0, x1, y1, dst_rowstride, - pixbuf->pixels, - pixbuf->width, pixbuf->height, pixbuf->rowstride, - affine, - level, - alphagamma); - else - art_rgb_affine (dst, x0, y0, x1, y1, dst_rowstride, - pixbuf->pixels, - pixbuf->width, pixbuf->height, pixbuf->rowstride, - affine, - level, - alphagamma); -} diff -Nru swftools-0.9.0/lib/art/art_rgb_pixbuf_affine.h swftools-0.9.2/lib/art/art_rgb_pixbuf_affine.h --- swftools-0.9.0/lib/art/art_rgb_pixbuf_affine.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_pixbuf_affine.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_PIXBUF_AFFINE_H__ -#define __ART_RGB_PIXBUF_AFFINE_H__ - -/* This module handles compositing of affine-transformed generic - pixbuf images over rgb pixel buffers. */ - -#ifdef LIBART_COMPILATION -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#include "art_pixbuf.h" -#else -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#include "art_pixbuf.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_pixbuf_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const ArtPixBuf *pixbuf, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgb_rgba_affine.c swftools-0.9.2/lib/art/art_rgb_rgba_affine.c --- swftools-0.9.0/lib/art/art_rgb_rgba_affine.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_rgba_affine.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,142 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_rgb_rgba_affine.h" - -#include -#include "art_misc.h" -#include "art_point.h" -#include "art_affine.h" -#include "art_rgb_affine_private.h" - -/* This module handles compositing of affine-transformed rgba images - over rgb pixel buffers. */ - -/* Composite the source image over the destination image, applying the - affine transform. */ - -/** - * art_rgb_rgba_affine: Affine transform source RGBA image and composite. - * @dst: Destination image RGB buffer. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @dst_rowstride: Rowstride of @dst buffer. - * @src: Source image RGBA buffer. - * @src_width: Width of source image. - * @src_height: Height of source image. - * @src_rowstride: Rowstride of @src buffer. - * @affine: Affine transform. - * @level: Filter level. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the compositing. - * - * Affine transform the source image stored in @src, compositing over - * the area of destination image @dst specified by the rectangle - * (@x0, @y0) - (@x1, @y1). As usual in libart, the left and top edges - * of this rectangle are included, and the right and bottom edges are - * excluded. - * - * The @alphagamma parameter specifies that the alpha compositing be - * done in a gamma-corrected color space. In the current - * implementation, it is ignored. - * - * The @level parameter specifies the speed/quality tradeoff of the - * image interpolation. Currently, only ART_FILTER_NEAREST is - * implemented. - **/ -void -art_rgb_rgba_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma) -{ - /* Note: this is a slow implementation, and is missing all filter - levels other than NEAREST. It is here for clarity of presentation - and to establish the interface. */ - int x, y; - double inv[6]; - art_u8 *dst_p, *dst_linestart; - const art_u8 *src_p; - ArtPoint pt, src_pt; - int src_x, src_y; - int alpha; - art_u8 bg_r, bg_g, bg_b; - art_u8 fg_r, fg_g, fg_b; - int tmp; - int run_x0, run_x1; - - dst_linestart = dst; - art_affine_invert (inv, affine); - for (y = y0; y < y1; y++) - { - pt.y = y + 0.5; - run_x0 = x0; - run_x1 = x1; - art_rgb_affine_run (&run_x0, &run_x1, y, src_width, src_height, - inv); - dst_p = dst_linestart + (run_x0 - x0) * 3; - for (x = run_x0; x < run_x1; x++) - { - pt.x = x + 0.5; - art_affine_point (&src_pt, &pt, inv); - src_x = floor (src_pt.x); - src_y = floor (src_pt.y); - src_p = src + (src_y * src_rowstride) + src_x * 4; - if (src_x >= 0 && src_x < src_width && - src_y >= 0 && src_y < src_height) - { - - alpha = src_p[3]; - if (alpha) - { - if (alpha == 255) - { - dst_p[0] = src_p[0]; - dst_p[1] = src_p[1]; - dst_p[2] = src_p[2]; - } - else - { - bg_r = dst_p[0]; - bg_g = dst_p[1]; - bg_b = dst_p[2]; - - tmp = (src_p[0] - bg_r) * alpha; - fg_r = bg_r + ((tmp + (tmp >> 8) + 0x80) >> 8); - tmp = (src_p[1] - bg_g) * alpha; - fg_g = bg_g + ((tmp + (tmp >> 8) + 0x80) >> 8); - tmp = (src_p[2] - bg_b) * alpha; - fg_b = bg_b + ((tmp + (tmp >> 8) + 0x80) >> 8); - - dst_p[0] = fg_r; - dst_p[1] = fg_g; - dst_p[2] = fg_b; - } - } - } else { dst_p[0] = 255; dst_p[1] = 0; dst_p[2] = 0; } - dst_p += 3; - } - dst_linestart += dst_rowstride; - } -} diff -Nru swftools-0.9.0/lib/art/art_rgb_rgba_affine.h swftools-0.9.2/lib/art/art_rgb_rgba_affine.h --- swftools-0.9.0/lib/art/art_rgb_rgba_affine.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_rgba_affine.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_RGBA_AFFINE_H__ -#define __ART_RGB_RGBA_AFFINE_H__ - -/* This module handles compositing of affine-transformed rgba images - over rgb pixel buffers. */ - -#ifdef LIBART_COMPILATION -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#else -#include "art_filterlevel.h" -#include "art_alphagamma.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void -art_rgb_rgba_affine (art_u8 *dst, - int x0, int y0, int x1, int y1, int dst_rowstride, - const art_u8 *src, - int src_width, int src_height, int src_rowstride, - const double affine[6], - ArtFilterLevel level, - ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru swftools-0.9.0/lib/art/art_rgb_svp.c swftools-0.9.2/lib/art/art_rgb_svp.c --- swftools-0.9.0/lib/art/art_rgb_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,457 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Render a sorted vector path into an RGB buffer. */ - -#include "config.h" -#include "art_rgb_svp.h" - -#include "art_svp.h" -#include "art_svp_render_aa.h" -#include "art_rgb.h" - -typedef struct _ArtRgbSVPData ArtRgbSVPData; -typedef struct _ArtRgbSVPAlphaData ArtRgbSVPAlphaData; - -struct _ArtRgbSVPData { - art_u32 rgbtab[256]; - art_u8 *buf; - int rowstride; - int x0, x1; -}; - -struct _ArtRgbSVPAlphaData { - int alphatab[256]; - art_u8 r, g, b, alpha; - art_u8 *buf; - int rowstride; - int x0, x1; -}; - -static void -art_rgb_svp_callback (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtRgbSVPData *data = (ArtRgbSVPData *)callback_data; - art_u8 *linebuf; - int run_x0, run_x1; - art_u32 running_sum = start; - art_u32 rgb; - int x0, x1; - int k; - - linebuf = data->buf; - x0 = data->x0; - x1 = data->x1; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - if (run_x1 > x0) - { - rgb = data->rgbtab[(running_sum >> 16) & 0xff]; - art_rgb_fill_run (linebuf, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - run_x1 - x0); - } - - for (k = 0; k < n_steps - 1; k++) - { - running_sum += steps[k].delta; - run_x0 = run_x1; - run_x1 = steps[k + 1].x; - if (run_x1 > run_x0) - { - rgb = data->rgbtab[(running_sum >> 16) & 0xff]; - art_rgb_fill_run (linebuf + (run_x0 - x0) * 3, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - run_x1 - run_x0); - } - } - running_sum += steps[k].delta; - if (x1 > run_x1) - { - rgb = data->rgbtab[(running_sum >> 16) & 0xff]; - art_rgb_fill_run (linebuf + (run_x1 - x0) * 3, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - x1 - run_x1); - } - } - else - { - rgb = data->rgbtab[(running_sum >> 16) & 0xff]; - art_rgb_fill_run (linebuf, - rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff, - x1 - x0); - } - - data->buf += data->rowstride; -} - -/* Render the vector path into the RGB buffer. */ - -/** - * art_rgb_svp_aa: Render sorted vector path into RGB buffer. - * @svp: The source sorted vector path. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @fg_color: Foreground color in 0xRRGGBB format. - * @bg_color: Background color in 0xRRGGBB format. - * @buf: Destination RGB buffer. - * @rowstride: Rowstride of @buf buffer. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the rendering. - * - * Renders the shape specified with @svp into the @buf RGB buffer. - * @x1 - @x0 specifies the width, and @y1 - @y0 specifies the height, - * of the rectangle rendered. The new pixels are stored starting at - * the first byte of @buf. Thus, the @x0 and @y0 parameters specify - * an offset within @svp, and may be tweaked as a way of doing - * integer-pixel translations without fiddling with @svp itself. - * - * The @fg_color and @bg_color arguments specify the opaque colors to - * be used for rendering. For pixels of entirely 0 winding-number, - * @bg_color is used. For pixels of entirely 1 winding number, - * @fg_color is used. In between, the color is interpolated based on - * the fraction of the pixel with a winding number of 1. If - * @alphagamma is NULL, then linear interpolation (in pixel counts) is - * the default. Otherwise, the interpolation is as specified by - * @alphagamma. - **/ -void -art_rgb_svp_aa (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - art_u32 fg_color, art_u32 bg_color, - art_u8 *buf, int rowstride, - ArtAlphaGamma *alphagamma) -{ - ArtRgbSVPData data; - - int r_fg, g_fg, b_fg; - int r_bg, g_bg, b_bg; - int r, g, b; - int dr, dg, db; - int i; - - if (alphagamma == NULL) - { - r_fg = fg_color >> 16; - g_fg = (fg_color >> 8) & 0xff; - b_fg = fg_color & 0xff; - - r_bg = bg_color >> 16; - g_bg = (bg_color >> 8) & 0xff; - b_bg = bg_color & 0xff; - - r = (r_bg << 16) + 0x8000; - g = (g_bg << 16) + 0x8000; - b = (b_bg << 16) + 0x8000; - dr = ((r_fg - r_bg) << 16) / 255; - dg = ((g_fg - g_bg) << 16) / 255; - db = ((b_fg - b_bg) << 16) / 255; - - for (i = 0; i < 256; i++) - { - data.rgbtab[i] = (r & 0xff0000) | ((g & 0xff0000) >> 8) | (b >> 16); - r += dr; - g += dg; - b += db; - } - } - else - { - int *table; - art_u8 *invtab; - - table = alphagamma->table; - - r_fg = table[fg_color >> 16]; - g_fg = table[(fg_color >> 8) & 0xff]; - b_fg = table[fg_color & 0xff]; - - r_bg = table[bg_color >> 16]; - g_bg = table[(bg_color >> 8) & 0xff]; - b_bg = table[bg_color & 0xff]; - - r = (r_bg << 16) + 0x8000; - g = (g_bg << 16) + 0x8000; - b = (b_bg << 16) + 0x8000; - dr = ((r_fg - r_bg) << 16) / 255; - dg = ((g_fg - g_bg) << 16) / 255; - db = ((b_fg - b_bg) << 16) / 255; - - invtab = alphagamma->invtable; - for (i = 0; i < 256; i++) - { - data.rgbtab[i] = (invtab[r >> 16] << 16) | - (invtab[g >> 16] << 8) | - invtab[b >> 16]; - r += dr; - g += dg; - b += db; - } - } - data.buf = buf; - data.rowstride = rowstride; - data.x0 = x0; - data.x1 = x1; - art_svp_render_aa (svp, x0, y0, x1, y1, art_rgb_svp_callback, &data); -} - -static void -art_rgb_svp_alpha_callback (void *callback_data, int y, - int start, ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtRgbSVPAlphaData *data = (ArtRgbSVPAlphaData *)callback_data; - art_u8 *linebuf; - int run_x0, run_x1; - art_u32 running_sum = start; - int x0, x1; - int k; - art_u8 r, g, b; - int *alphatab; - int alpha; - - linebuf = data->buf; - x0 = data->x0; - x1 = data->x1; - - r = data->r; - g = data->g; - b = data->b; - alphatab = data->alphatab; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - if (run_x1 > x0) - { - alpha = (running_sum >> 16) & 0xff; - if (alpha) - art_rgb_run_alpha (linebuf, - r, g, b, alphatab[alpha], - run_x1 - x0); - } - - for (k = 0; k < n_steps - 1; k++) - { - running_sum += steps[k].delta; - run_x0 = run_x1; - run_x1 = steps[k + 1].x; - if (run_x1 > run_x0) - { - alpha = (running_sum >> 16) & 0xff; - if (alpha) - art_rgb_run_alpha (linebuf + (run_x0 - x0) * 3, - r, g, b, alphatab[alpha], - run_x1 - run_x0); - } - } - running_sum += steps[k].delta; - if (x1 > run_x1) - { - alpha = (running_sum >> 16) & 0xff; - if (alpha) - art_rgb_run_alpha (linebuf + (run_x1 - x0) * 3, - r, g, b, alphatab[alpha], - x1 - run_x1); - } - } - else - { - alpha = (running_sum >> 16) & 0xff; - if (alpha) - art_rgb_run_alpha (linebuf, - r, g, b, alphatab[alpha], - x1 - x0); - } - - data->buf += data->rowstride; -} - -static void -art_rgb_svp_alpha_opaque_callback (void *callback_data, int y, - int start, - ArtSVPRenderAAStep *steps, int n_steps) -{ - ArtRgbSVPAlphaData *data = (ArtRgbSVPAlphaData *)callback_data; - art_u8 *linebuf; - int run_x0, run_x1; - art_u32 running_sum = start; - int x0, x1; - int k; - art_u8 r, g, b; - int *alphatab; - int alpha; - - linebuf = data->buf; - x0 = data->x0; - x1 = data->x1; - - r = data->r; - g = data->g; - b = data->b; - alphatab = data->alphatab; - - if (n_steps > 0) - { - run_x1 = steps[0].x; - if (run_x1 > x0) - { - alpha = running_sum >> 16; - if (alpha) - { - if (alpha >= 255) - art_rgb_fill_run (linebuf, - r, g, b, - run_x1 - x0); - else - art_rgb_run_alpha (linebuf, - r, g, b, alphatab[alpha], - run_x1 - x0); - } - } - - for (k = 0; k < n_steps - 1; k++) - { - running_sum += steps[k].delta; - run_x0 = run_x1; - run_x1 = steps[k + 1].x; - if (run_x1 > run_x0) - { - alpha = running_sum >> 16; - if (alpha) - { - if (alpha >= 255) - art_rgb_fill_run (linebuf + (run_x0 - x0) * 3, - r, g, b, - run_x1 - run_x0); - else - art_rgb_run_alpha (linebuf + (run_x0 - x0) * 3, - r, g, b, alphatab[alpha], - run_x1 - run_x0); - } - } - } - running_sum += steps[k].delta; - if (x1 > run_x1) - { - alpha = running_sum >> 16; - if (alpha) - { - if (alpha >= 255) - art_rgb_fill_run (linebuf + (run_x1 - x0) * 3, - r, g, b, - x1 - run_x1); - else - art_rgb_run_alpha (linebuf + (run_x1 - x0) * 3, - r, g, b, alphatab[alpha], - x1 - run_x1); - } - } - } - else - { - alpha = running_sum >> 16; - if (alpha) - { - if (alpha >= 255) - art_rgb_fill_run (linebuf, - r, g, b, - x1 - x0); - else - art_rgb_run_alpha (linebuf, - r, g, b, alphatab[alpha], - x1 - x0); - } - } - - data->buf += data->rowstride; -} - -/** - * art_rgb_svp_alpha: Alpha-composite sorted vector path over RGB buffer. - * @svp: The source sorted vector path. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @rgba: Color in 0xRRGGBBAA format. - * @buf: Destination RGB buffer. - * @rowstride: Rowstride of @buf buffer. - * @alphagamma: #ArtAlphaGamma for gamma-correcting the compositing. - * - * Renders the shape specified with @svp over the @buf RGB buffer. - * @x1 - @x0 specifies the width, and @y1 - @y0 specifies the height, - * of the rectangle rendered. The new pixels are stored starting at - * the first byte of @buf. Thus, the @x0 and @y0 parameters specify - * an offset within @svp, and may be tweaked as a way of doing - * integer-pixel translations without fiddling with @svp itself. - * - * The @rgba argument specifies the color for the rendering. Pixels of - * entirely 0 winding number are left untouched. Pixels of entirely - * 1 winding number have the color @rgba composited over them (ie, - * are replaced by the red, green, blue components of @rgba if the alpha - * component is 0xff). Pixels of intermediate coverage are interpolated - * according to the rule in @alphagamma, or default to linear if - * @alphagamma is NULL. - **/ -void -art_rgb_svp_alpha (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - art_u32 rgba, - art_u8 *buf, int rowstride, - ArtAlphaGamma *alphagamma) -{ - ArtRgbSVPAlphaData data; - int r, g, b, alpha; - int i; - int a, da; - - r = rgba >> 24; - g = (rgba >> 16) & 0xff; - b = (rgba >> 8) & 0xff; - alpha = rgba & 0xff; - - data.r = r; - data.g = g; - data.b = b; - data.alpha = alpha; - - a = 0x8000; - da = (alpha * 66051 + 0x80) >> 8; /* 66051 equals 2 ^ 32 / (255 * 255) */ - - for (i = 0; i < 256; i++) - { - data.alphatab[i] = a >> 16; - a += da; - } - - data.buf = buf; - data.rowstride = rowstride; - data.x0 = x0; - data.x1 = x1; - if (alpha == 255) - art_svp_render_aa (svp, x0, y0, x1, y1, art_rgb_svp_alpha_opaque_callback, - &data); - else - art_svp_render_aa (svp, x0, y0, x1, y1, art_rgb_svp_alpha_callback, &data); -} - diff -Nru swftools-0.9.0/lib/art/art_rgb_svp.h swftools-0.9.2/lib/art/art_rgb_svp.h --- swftools-0.9.0/lib/art/art_rgb_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_rgb_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_RGB_SVP_H__ -#define __ART_RGB_SVP_H__ - -/* Render a sorted vector path into an RGB buffer. */ - -#ifdef LIBART_COMPILATION -#include "art_alphagamma.h" -#include "art_svp.h" -#else -#include "art_alphagamma.h" -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void -art_rgb_svp_aa (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - art_u32 fg_color, art_u32 bg_color, - art_u8 *buf, int rowstride, - ArtAlphaGamma *alphagamma); - -void -art_rgb_svp_alpha (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - art_u32 rgba, - art_u8 *buf, int rowstride, - ArtAlphaGamma *alphagamma); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_RGB_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp.c swftools-0.9.2/lib/art/art_svp.c --- swftools-0.9.0/lib/art/art_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Basic constructors and operations for sorted vector paths */ - -#include "config.h" -#include "art_svp.h" - -#include "art_misc.h" - -/* Add a new segment. The arguments can be zero and NULL if the caller - would rather fill them in later. - - We also realloc one auxiliary array of ints of size n_segs if - desired. -*/ -/** - * art_svp_add_segment: Add a segment to an #ArtSVP structure. - * @p_vp: Pointer to where the #ArtSVP structure is stored. - * @pn_segs_max: Pointer to the allocated size of *@p_vp. - * @pn_points_max: Pointer to where auxiliary array is stored. - * @n_points: Number of points for new segment. - * @dir: Direction for new segment; 0 is up, 1 is down. - * @points: Points for new segment. - * @bbox: Bounding box for new segment. - * - * Adds a new segment to an ArtSVP structure. This routine reallocates - * the structure if necessary, updating *@p_vp and *@pn_segs_max as - * necessary. - * - * The new segment is simply added after all other segments. Thus, - * this routine should be called in order consistent with the #ArtSVP - * sorting rules. - * - * If the @bbox argument is given, it is simply stored in the new - * segment. Otherwise (if it is NULL), the bounding box is computed - * from the @points given. - **/ -int -art_svp_add_segment (ArtSVP **p_vp, int *pn_segs_max, - int **pn_points_max, - int n_points, int dir, ArtPoint *points, - ArtDRect *bbox) -{ - int seg_num; - ArtSVP *svp; - ArtSVPSeg *seg; - - svp = *p_vp; - seg_num = svp->n_segs++; - if (*pn_segs_max == seg_num) - { - *pn_segs_max <<= 1; - svp = (ArtSVP *)art_realloc (svp, sizeof(ArtSVP) + - (*pn_segs_max - 1) * sizeof(ArtSVPSeg)); - *p_vp = svp; - if (pn_points_max != NULL) - *pn_points_max = art_renew (*pn_points_max, int, *pn_segs_max); - } - seg = &svp->segs[seg_num]; - seg->n_points = n_points; - seg->dir = dir; - seg->points = points; - if (bbox) - seg->bbox = *bbox; - else if (points) - { - double x_min, x_max; - int i; - - x_min = x_max = points[0].x; - for (i = 1; i < n_points; i++) - { - if (x_min > points[i].x) - x_min = points[i].x; - if (x_max < points[i].x) - x_max = points[i].x; - } - seg->bbox.x0 = x_min; - seg->bbox.y0 = points[0].y; - - seg->bbox.x1 = x_max; - seg->bbox.y1 = points[n_points - 1].y; - } - return seg_num; -} - - -/** - * art_svp_free: Free an #ArtSVP structure. - * @svp: #ArtSVP to free. - * - * Frees an #ArtSVP structure and all the segments in it. - **/ -void -art_svp_free (ArtSVP *svp) -{ - int n_segs = svp->n_segs; - int i; - - for (i = 0; i < n_segs; i++) - art_free (svp->segs[i].points); - art_free (svp); -} - -#ifdef ART_USE_NEW_INTERSECTOR -#define EPSILON 0 -#else -#define EPSILON 1e-6 -#endif - -/** - * art_svp_seg_compare: Compare two segments of an svp. - * @seg1: First segment to compare. - * @seg2: Second segment to compare. - * - * Compares two segments of an svp. Return 1 if @seg2 is below or to the - * right of @seg1, -1 otherwise. - **/ -int -art_svp_seg_compare (const void *s1, const void *s2) -{ - const ArtSVPSeg *seg1 = (ArtSVPSeg *)s1; - const ArtSVPSeg *seg2 = (ArtSVPSeg *)s2; - - if (seg1->points[0].y - EPSILON > seg2->points[0].y) return 1; - else if (seg1->points[0].y + EPSILON < seg2->points[0].y) return -1; - else if (seg1->points[0].x - EPSILON > seg2->points[0].x) return 1; - else if (seg1->points[0].x + EPSILON < seg2->points[0].x) return -1; - else if ((seg1->points[1].x - seg1->points[0].x) * - (seg2->points[1].y - seg2->points[0].y) - - (seg1->points[1].y - seg1->points[0].y) * - (seg2->points[1].x - seg2->points[0].x) > 0) return 1; - else return -1; -} - diff -Nru swftools-0.9.0/lib/art/art_svp.h swftools-0.9.2/lib/art/art_svp.h --- swftools-0.9.0/lib/art/art_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_H__ -#define __ART_SVP_H__ - -/* Basic data structures and constructors for sorted vector paths */ - -#ifdef LIBART_COMPILATION -#include "art_rect.h" -#include "art_point.h" -#else -#include "art_rect.h" -#include "art_point.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtSVP ArtSVP; -typedef struct _ArtSVPSeg ArtSVPSeg; - -struct _ArtSVPSeg { - int n_points; - int dir; /* == 0 for "up", 1 for "down" */ - ArtDRect bbox; - ArtPoint *points; -}; - -struct _ArtSVP { - int n_segs; - ArtSVPSeg segs[1]; -}; - -int -art_svp_add_segment (ArtSVP **p_vp, int *pn_segs_max, - int **pn_points_max, - int n_points, int dir, ArtPoint *points, - ArtDRect *bbox); - -void -art_svp_free (ArtSVP *svp); - -int -art_svp_seg_compare (const void *s1, const void *s2); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp_intersect.c swftools-0.9.2/lib/art/art_svp_intersect.c --- swftools-0.9.0/lib/art/art_svp_intersect.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_intersect.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2195 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2001 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* This file contains a testbed implementation of the new intersection - code. -*/ - -#include -#include -#include "config.h" -#include "art_svp_intersect.h" - -#include /* for sqrt */ - -/* Sanitychecking verifies the main invariant on every priority queue - point. Do not use in production, as it slows things down way too - much. */ -#define noSANITYCHECK - -/* This can be used in production, to prevent hangs. Eventually, it - should not be necessary. */ -#define CHEAP_SANITYCHECK - -#define noVERBOSE - -#define noABORT_ON_ERROR - -#include "art_misc.h" - -/* A priority queue - perhaps move to a separate file if it becomes - needed somewhere else */ - -#define ART_PRIQ_USE_HEAP - -typedef struct _ArtPriQ ArtPriQ; -typedef struct _ArtPriPoint ArtPriPoint; - -struct _ArtPriQ { - int n_items; - int n_items_max; - ArtPriPoint **items; -}; - -struct _ArtPriPoint { - double x; - double y; - void *user_data; -}; - -static ArtPriQ * -art_pri_new (void) -{ - ArtPriQ *result = art_new (ArtPriQ, 1); - - result->n_items = 0; - result->n_items_max = 16; - result->items = art_new (ArtPriPoint *, result->n_items_max); - return result; -} - -static void -art_pri_free (ArtPriQ *pq) -{ - art_free (pq->items); - art_free (pq); -} - -static art_boolean -art_pri_empty (ArtPriQ *pq) -{ - return pq->n_items == 0; -} - -/* This heap implementation is based on Vasek Chvatal's course notes: - http://www.cs.rutgers.edu/~chvatal/notes/pq.html#heap */ - -static void -art_pri_bubble_up (ArtPriQ *pq, int vacant, ArtPriPoint *missing) -{ - ArtPriPoint **items = pq->items; - int parent; - - parent = (vacant - 1) >> 1; - while (vacant > 0 && (missing->y < items[parent]->y || - (missing->y == items[parent]->y && - missing->x < items[parent]->x))) - { - items[vacant] = items[parent]; - vacant = parent; - parent = (vacant - 1) >> 1; - } - - items[vacant] = missing; -} - -static void -art_pri_insert (ArtPriQ *pq, ArtPriPoint *point) -{ -#ifdef VERBOSE - art_dprint("insert into pq %08x: %.16f,%.16f %08x\n", pq, point->x, point->y, point->user_data); -#endif - if (pq->n_items == pq->n_items_max) - art_expand (pq->items, ArtPriPoint *, pq->n_items_max); - - art_pri_bubble_up (pq, pq->n_items++, point); -} - -static void -art_pri_sift_down_from_root (ArtPriQ *pq, ArtPriPoint *missing) -{ - ArtPriPoint **items = pq->items; - int vacant = 0, child = 2; - int n = pq->n_items; - - while (child < n) - { - if (items[child - 1]->y < items[child]->y || - (items[child - 1]->y == items[child]->y && - items[child - 1]->x < items[child]->x)) - child--; - items[vacant] = items[child]; - vacant = child; - child = (vacant + 1) << 1; - } - if (child == n) - { - items[vacant] = items[n - 1]; - vacant = n - 1; - } - - art_pri_bubble_up (pq, vacant, missing); -} - -static ArtPriPoint * -art_pri_choose (ArtPriQ *pq) -{ - ArtPriPoint *result = pq->items[0]; - - art_pri_sift_down_from_root (pq, pq->items[--pq->n_items]); - return result; -} - -/* TODO: this is *not* thread save */ -const ArtSVP* current_svp = 0; -int art_error_in_intersector=0; - -void art_report_error() -{ - art_error_in_intersector = 1; -#ifdef ABORT_ON_ERROR - if(!current_svp) { - fprintf(stderr, "internal error: no current polygon\n"); - exit(1); - } - const ArtSVP*svp = current_svp; - FILE*fi = fopen("svp.ps", "wb"); - int i, j; - fprintf(fi, "%% begin\n"); - for (i = 0; i < svp->n_segs; i++) - { - fprintf(fi, "%g setgray\n", svp->segs[i].dir ? 0.7 : 0); - for (j = 0; j < svp->segs[i].n_points; j++) - { - fprintf(fi, "%.32f %.32f %s\n", - svp->segs[i].points[j].x, - svp->segs[i].points[j].y, - j ? "lineto" : "moveto"); - } - fprintf(fi, "stroke\n"); - } - fprintf(fi, "showpage\n"); - fclose(fi); - - fprintf(stderr, "There was an error during polygon processing.\n"); - fprintf(stderr, "I saved a debug file, called svp.ps, to the current directory.\n"); - fprintf(stderr, "Please help making this tool more stable by mailing\n"); - fprintf(stderr, "this file to debug@swftools.org. Thank you!\n"); - exit(1); -#endif -} - -/* A virtual class for an "svp writer". A client of this object creates an - SVP by repeatedly calling "add segment" and "add point" methods on it. -*/ - -typedef struct _ArtSvpWriterRewind ArtSvpWriterRewind; - -/* An implementation of the svp writer virtual class that applies the - winding rule. */ - -struct _ArtSvpWriterRewind { - ArtSvpWriter super; - ArtWindRule rule; - ArtSVP *svp; - int n_segs_max; - int *n_points_max; -}; - -static int -art_svp_writer_rewind_add_segment (ArtSvpWriter *self, int wind_left, - int delta_wind, double x, double y) -{ - ArtSvpWriterRewind *swr = (ArtSvpWriterRewind *)self; - ArtSVP *svp; - ArtSVPSeg *seg; - art_boolean left_filled, right_filled; - int wind_right = wind_left + delta_wind; - int seg_num; - const int init_n_points_max = 4; - - switch (swr->rule) - { - case ART_WIND_RULE_NONZERO: - left_filled = (wind_left != 0); - right_filled = (wind_right != 0); - break; - case ART_WIND_RULE_INTERSECT: - left_filled = (wind_left > 1); - right_filled = (wind_right > 1); - break; - case ART_WIND_RULE_ODDEVEN: - left_filled = (wind_left & 1); - right_filled = (wind_right & 1); - break; - case ART_WIND_RULE_POSITIVE: - left_filled = (wind_left > 0); - right_filled = (wind_right > 0); - break; - default: - art_die ("Unknown wind rule %d\n", swr->rule); - } - -#ifdef VERBOSE - art_dprint("New svp segment %d: %.32f %.32f left_filled=%d, right_filled=%d\n", swr->svp->n_segs, x, y, left_filled, right_filled); -#endif - - if (left_filled == right_filled) - { - /* discard segment now */ -#ifdef VERBOSE - art_dprint (" discarding segment: %d += %d (%.16f, %.16f)\n", - wind_left, delta_wind, x, y); -#endif - return -1; - } - - svp = swr->svp; - seg_num = svp->n_segs++; - if (swr->n_segs_max == seg_num) - { - swr->n_segs_max += 10; - svp = (ArtSVP *)art_realloc (svp, sizeof(ArtSVP) + - (swr->n_segs_max - 1) * - sizeof(ArtSVPSeg)); - swr->svp = svp; - swr->n_points_max = art_renew (swr->n_points_max, int, - swr->n_segs_max); - } - seg = &svp->segs[seg_num]; - seg->n_points = 1; - seg->dir = right_filled; - swr->n_points_max[seg_num] = init_n_points_max; - seg->bbox.x0 = x; - seg->bbox.y0 = y; - seg->bbox.x1 = x; - seg->bbox.y1 = y; - seg->points = art_new (ArtPoint, init_n_points_max); - seg->points[0].x = x; - seg->points[0].y = y; -#ifdef VERBOSE - art_dprint ("swr add_segment: %d += %d (%.16f, %.16f) --> %d (%s)\n", - wind_left, delta_wind, x, y, seg_num, - seg->dir ? "filled" : "non-filled"); -#endif - return seg_num; -} - -static void -art_svp_writer_rewind_add_point (ArtSvpWriter *self, int seg_id, - double x, double y) -{ - - ArtSvpWriterRewind *swr = (ArtSvpWriterRewind *)self; - ArtSVPSeg *seg; - int n_points; - -#ifdef VERBOSE - art_dprint ("swr add_point: %d (%.16f, %.16f)\n", seg_id, x, y); -#endif - if (seg_id < 0) - /* omitted segment */ - return; - - seg = &swr->svp->segs[seg_id]; - - if(seg->n_points && - seg->points[seg->n_points-1].x == x && - seg->points[seg->n_points-1].y == y) { - //art_warn("duplicate point %.16f,%.16f in segment %08x\n", - // x, y, seg_id); - return; - } - - n_points = seg->n_points++; - if (swr->n_points_max[seg_id] == n_points) - art_expand (seg->points, ArtPoint, swr->n_points_max[seg_id]); - - if(0 && n_points>=2) { - double dx1 = seg->points[n_points-1].x - seg->points[n_points-2].x; - double dy1 = seg->points[n_points-1].y - seg->points[n_points-2].y; - double dx2 = x - seg->points[n_points-2].x; - double dy2 = y - seg->points[n_points-2].y; - if(fabs(dx1*dy2 - dx2*dy1) < 1e-10) { - seg->n_points--; - n_points--; // remove previous point pointing in the same direction - - //art_warn("redundant point %.16f,%.16f in segment %08x\n", - // seg->points[n_points-1].x, seg->points[n_points-1].y, - // seg_id); - } - } - - if(n_points && seg->points[n_points-1].y > y) { - art_warn("non-increasing segment (%.16f -> %.16f)\n", seg->points[n_points-1].y, y); - art_report_error(); - } - - seg->points[n_points].x = x; - seg->points[n_points].y = y; - if (x < seg->bbox.x0) - seg->bbox.x0 = x; - if (x > seg->bbox.x1) - seg->bbox.x1 = x; - seg->bbox.y1 = y; -} - -static void -art_svp_writer_rewind_close_segment (ArtSvpWriter *self, int seg_id) -{ - /* Not needed for this simple implementation. A potential future - optimization is to merge segments that can be merged safely. */ -#ifdef CHEAP_SANITYCHECK - ArtSvpWriterRewind *swr = (ArtSvpWriterRewind *)self; - ArtSVPSeg *seg; - - if (seg_id >= 0) - { - seg = &swr->svp->segs[seg_id]; - if (seg->n_points < 2) - art_warn ("*** closing segment %d with only %d point%s\n", - seg_id, seg->n_points, seg->n_points == 1 ? "" : "s"); - } -#endif - -#ifdef VERBOSE - art_dprint ("swr close_segment: %d\n", seg_id); -#endif -} - -ArtSVP * -art_svp_writer_rewind_reap (ArtSvpWriter *self) -{ - ArtSvpWriterRewind *swr = (ArtSvpWriterRewind *)self; - ArtSVP *result = swr->svp; - - art_free (swr->n_points_max); - art_free (swr); - return result; -} - -ArtSvpWriter * -art_svp_writer_rewind_new (ArtWindRule rule) -{ - ArtSvpWriterRewind *result = art_new (ArtSvpWriterRewind, 1); - - result->super.add_segment = art_svp_writer_rewind_add_segment; - result->super.add_point = art_svp_writer_rewind_add_point; - result->super.close_segment = art_svp_writer_rewind_close_segment; - - result->rule = rule; - result->n_segs_max = 16; - result->svp = (ArtSVP*)art_alloc (sizeof(ArtSVP) + - (result->n_segs_max - 1) * sizeof(ArtSVPSeg)); - result->svp->n_segs = 0; - result->n_points_max = (int*)art_new (int, result->n_segs_max); - - return &result->super; -} - -/* Now, data structures for the active list. - - signs: - / | - b<0 / | \ b>0, c<0 - c>0 /\ | /\ - / \ | / \ - / \ | / - \|/ - -------------+-------------------- - /|\ - \ / | \ / - \/ | \/ b<0, c<0 - b>0 \ | / - c>0 \ | / - */ - -typedef struct _ArtActiveSeg ArtActiveSeg; - -/* Note: BNEG is 1 for \ lines, and 0 for /. Thus, - x[(flags & BNEG) ^ 1] <= x[flags & BNEG] */ -#define ART_ACTIVE_FLAGS_BNEG 1 - -/* This flag is set if the segment has been inserted into the active - list. */ -#define ART_ACTIVE_FLAGS_IN_ACTIVE 2 - -/* This flag is set when the segment is to be deleted in the - horiz commit process. */ -#define ART_ACTIVE_FLAGS_DEL 4 - -/* This flag is set if the seg_id is a valid output segment. */ -#define ART_ACTIVE_FLAGS_OUT 8 - -/* This flag is set if the segment is in the horiz list. */ -#define ART_ACTIVE_FLAGS_IN_HORIZ 16 - -struct _ArtActiveSeg { - int flags; - int wind_left, delta_wind; - ArtActiveSeg *left, *right; /* doubly linked list structure */ - - const ArtSVPSeg *in_seg; - int in_curs; - - double x[2]; - double y0, y1; - double a, b, c; /* line equation; ax+by+c = 0 for the line, a^2 + b^2 = 1, - and a>0 */ - - /* bottom point and intersection point stack */ - int n_stack; - int n_stack_max; - ArtPoint *stack; - - /* horiz commit list */ - ArtActiveSeg *horiz_left, *horiz_right; - double horiz_x; - int horiz_delta_wind; - int seg_id; -}; - -typedef struct _ArtIntersectCtx ArtIntersectCtx; - -struct _ArtIntersectCtx { - const ArtSVP *in; - ArtSvpWriter *out; - - ArtPriQ *pq; - - ArtActiveSeg *active_head; - - double y; - ArtActiveSeg *horiz_first; - ArtActiveSeg *horiz_last; - - /* segment index of next input segment to be added to pri q */ - int in_curs; -}; - -#define EPSILON_A 1e-5 /* Threshold for breaking lines at point insertions */ - -/** - * art_svp_intersect_setup_seg: Set up an active segment from input segment. - * @seg: Active segment. - * @pri_pt: Priority queue point to initialize. - * - * Sets the x[], a, b, c, flags, and stack fields according to the - * line from the current cursor value. Sets the priority queue point - * to the bottom point of this line. Also advances the input segment - * cursor. - **/ -static void -art_svp_intersect_setup_seg (ArtActiveSeg *seg, ArtPriPoint *pri_pt) -{ - const ArtSVPSeg *in_seg = seg->in_seg; - int in_curs = 0; - double x0, y0, x1, y1; - double dx, dy, s; - double a, b, r2; - - //do { - in_curs = seg->in_curs++; - //} while(in_seg->points[in_curs].x == in_seg->points[in_curs + 1].x && - // in_seg->points[in_curs].y == in_seg->points[in_curs + 1].y && - // in_curs < in_seg->n_points-1 - // ); - - x0 = in_seg->points[in_curs].x; - y0 = in_seg->points[in_curs].y; - x1 = in_seg->points[in_curs + 1].x; - y1 = in_seg->points[in_curs + 1].y; - pri_pt->x = x1; - pri_pt->y = y1; - dx = x1 - x0; - dy = y1 - y0; - r2 = dx * dx + dy * dy; - if(r2 == 0) { - //art_warn("segment %08x has zero length\n", seg); - } - s = r2 == 0 ? 1 : 1 / sqrt (r2); - seg->a = a = dy * s; - seg->b = b = -dx * s; - seg->c = -(a * x0 + b * y0); - seg->flags = (seg->flags & ~ART_ACTIVE_FLAGS_BNEG) | (dx > 0); - seg->x[0] = x0; - seg->x[1] = x1; - seg->y0 = y0; - seg->y1 = y1; - seg->n_stack = 1; - seg->stack[0].x = x1; - seg->stack[0].y = y1; - - if(y1 < y0) { - art_warn("art_svp_intersect.c: bad input polygon %08x, contains decreasing y values\n", seg->in_seg); - art_report_error(); - } -#ifdef VERBOSE - art_dprint("segment %08x (top: %.16f,%.16f) starts with endpoint at %.16f,%.16f\n", seg, - x0, y0, - x1, y1); -#endif -} - -/** - * art_svp_intersect_add_horiz: Add point to horizontal list. - * @ctx: Intersector context. - * @seg: Segment with point to insert into horizontal list. - * - * Inserts @seg into horizontal list, keeping it in ascending horiz_x - * order. - * - * Note: the horiz_commit routine processes "clusters" of segs in the - * horiz list, all sharing the same horiz_x value. The cluster is - * processed in active list order, rather than horiz list order. Thus, - * the order of segs in the horiz list sharing the same horiz_x - * _should_ be irrelevant. Even so, we use b as a secondary sorting key, - * as a "belt and suspenders" defensive coding tactic. - **/ -static void -art_svp_intersect_add_horiz (ArtIntersectCtx *ctx, ArtActiveSeg *seg) -{ - ArtActiveSeg **pp = &ctx->horiz_last; - ArtActiveSeg *place; - ArtActiveSeg *place_right = NULL; - -#ifdef CHEAP_SANITYCHECK - if (seg->flags & ART_ACTIVE_FLAGS_IN_HORIZ) - { - double dx = seg->x[1] - seg->x[0]; - double dy = seg->y1 - seg->y0; - double len = sqrt(dx*dx+dy*dy); - art_warn("attempt to put segment %08x %.16f,%.16f (len:%.16f) in horiz list twice\n", seg, seg->x[0], seg->y0, len); - return; - } - seg->flags |= ART_ACTIVE_FLAGS_IN_HORIZ; -#endif - -#ifdef VERBOSE - art_dprint ("add_horiz %08x, x = %.16f\n", (unsigned long) seg, seg->horiz_x); -#endif - for (place = *pp; place != NULL && (place->horiz_x > seg->horiz_x || - (place->horiz_x == seg->horiz_x && - place->b < seg->b)); - place = *pp) - { - place_right = place; - pp = &place->horiz_left; - } - *pp = seg; - seg->horiz_left = place; - seg->horiz_right = place_right; - - if (place == NULL) - ctx->horiz_first = seg; - else - place->horiz_right = seg; - -#ifdef VERBOSE - art_dprint("horiz_list:\n"); - ArtActiveSeg*s = ctx->horiz_first; - while(s) { - art_dprint(" %08x x=%.16f wind_left=%d delta_wind=%d horiz_delta_wind=%d\n", s, s->horiz_x, - s->wind_left, s->delta_wind, s->horiz_delta_wind); - s = s->horiz_right; - } -#endif -} - -static void -art_svp_intersect_push_pt (ArtIntersectCtx *ctx, ArtActiveSeg *seg, - double x, double y) -{ - ArtPriPoint *pri_pt; - int n_stack = seg->n_stack; - - if (n_stack == seg->n_stack_max) - art_expand (seg->stack, ArtPoint, seg->n_stack_max); - - - seg->stack[n_stack].x = x; - seg->stack[n_stack].y = y; - seg->n_stack++; - -#ifdef VERBOSE - int t; - art_dprint("art_svp_intersect_push_pt %08x |top %.16f,%.16f\n", seg, seg->x[0], seg->y0); - for(t=seg->n_stack-1;t>=0;t--) { - if(t!=seg->n_stack-1) - art_dprint("art_svp_intersect_push_pt %08x |pt %.16f,%.16f\n", seg, seg->stack[t].x, seg->stack[t].y); - else - art_dprint("art_svp_intersect_push_pt %08x |new %.16f,%.16f\n", seg, seg->stack[t].x, seg->stack[t].y); - } -#endif -#ifdef VERBOSE - art_dprint("(shortening segment %08x to %.16f,%.16f)\n", seg, x, y); -#endif - - if(seg->stack[seg->n_stack-1].y == seg->y0) { - art_warn("duplicate y coordinate (=y0) in point stack\n"); - } - - if(n_stack) { - if(seg->stack[seg->n_stack-2].y < seg->stack[seg->n_stack-1].y) { - art_warn("bad shortening- segment got *longer*\n"); - art_report_error(); - } - } - - - seg->x[1] = x; - seg->y1 = y; - - pri_pt = art_new (ArtPriPoint, 1); - pri_pt->x = x; - pri_pt->y = y; - pri_pt->user_data = seg; - art_pri_insert (ctx->pq, pri_pt); -} - -#define ART_BREAK_LEFT 1 -#define ART_BREAK_RIGHT 2 - -/** - * art_svp_intersect_break: Break an active segment. - * - * Note: y must be greater than the top point's y, and less than - * the bottom's. - * - * Return value: x coordinate of break point. - */ -static double -art_svp_intersect_break (ArtIntersectCtx *ctx, ArtActiveSeg *seg, - double x_ref, double y, int break_flags) -{ - double x0, y0, x1, y1; - const ArtSVPSeg *in_seg = seg->in_seg; - int in_curs = seg->in_curs; - double x; - - x0 = in_seg->points[in_curs - 1].x; - y0 = in_seg->points[in_curs - 1].y; - x1 = in_seg->points[in_curs].x; - y1 = in_seg->points[in_curs].y; - - x = x0 + (x1 - x0) * ((y - y0) / (y1 - y0)); - - //printf("%d %.16f %.16f %d\n", break_flags&ART_BREAK_LEFT, x, x_ref, x > x_ref); - //printf("%d %.16f %.16f %d\n", break_flags&ART_BREAK_RIGHT, x, x_ref, x < x_ref); - - if ((break_flags == ART_BREAK_LEFT && x > x_ref) || - (break_flags == ART_BREAK_RIGHT && x < x_ref)) - { -#ifdef VERBOSE - art_dprint ("art_svp_intersect_break %08x: limiting x to %.16f, was %.16f, %s\n", seg, - x_ref, x, break_flags == ART_BREAK_LEFT ? "left" : "right"); -#endif - //x = x_ref; //used to be *within* the VERBOSE comment - } - - if(y < y0 || y > y1) { - art_warn("!! bad break %.16f of %.16f-%.16f\n", y, y0, y1); - art_report_error(); - return x; - } - - /* I think we can count on min(x0, x1) <= x <= max(x0, x1) with sane - arithmetic, but it might be worthwhile to check just in case. */ - - /* TODO: should we check seg instead of in_seg ? */ - if(x0x1) { - art_warn("bad x value %.16f in intersect_break: not between %.16f and %.16f\n", x, x0, x1); - art_report_error(); - } - } else { - if(xx0) { - art_warn("bad x value %.16f in intersect_break: not between %.16f and %.16f\n", x, x1, x0); - art_report_error(); - } - } - - - if (y > ctx->y) - art_svp_intersect_push_pt (ctx, seg, x, y); - else - { - if(y < ctx->y) { - art_warn("intersect_break at a y above the current scanline (%.16f < %.16f)", y, ctx->y); - art_report_error(); - } - seg->x[0] = x; - seg->y0 = y; - seg->horiz_x = x; - art_svp_intersect_add_horiz (ctx, seg); - } - - return x; -} - -/** - * art_svp_intersect_add_point: Add a point, breaking nearby neighbors. - * @ctx: Intersector context. - * @x: X coordinate of point to add. - * @y: Y coordinate of point to add. - * @seg: "nearby" segment, or NULL if leftmost. - * - * Return value: Segment immediately to the left of the new point, or - * NULL if the new point is leftmost. - **/ -static ArtActiveSeg * -art_svp_intersect_add_point (ArtIntersectCtx *ctx, double x, double y, - ArtActiveSeg *seg, int break_flags) -{ - ArtActiveSeg *left, *right; - double x_min = x, x_max = x; - art_boolean left_live, right_live; - double d; - double new_x; - ArtActiveSeg *test, *result = NULL; - double x_test; - - left = seg; - if (left == NULL) - right = ctx->active_head; - else - right = left->right; - left_live = (break_flags & ART_BREAK_LEFT) && (left != NULL); - right_live = (break_flags & ART_BREAK_RIGHT) && (right != NULL); - -#ifdef VERBOSE - double dd = 0; - if(seg) - dd = seg->a*x + seg->b*y + seg->c; - art_dprint("add_point seg=%08x %f,%f%s%s (left=%08x, right=%08x) d=%f\n", seg, x, y, - break_flags&ART_BREAK_LEFT?" BREAK_LEFT":"", - break_flags&ART_BREAK_LEFT?" BREAK_RIGHT":"", - seg?seg->left:0, seg?seg->right:0, dd); -#endif - /* add_point relies on the fact that the active list is ascending- - no checks are done for lines which are not in strict order. - - a point position (x,y) is tested against left (if break_flags&ART_BREAK_LEFT) - and right (if break_flags&ART_BREAK_RIGHT) neighboring segments which are - within EPSILON_A distance of the point. If they are, they are split at y. - For ART_BREAK_LEFT, the "intersection point" on the line (which is to the left - of (x,y) will never be to the right of "our" (x,y)- new_x will be shifted - by _break to make sure of that. (Which should only happen for horizontal - line segments) Likewise for ART_BREAK_RIGHT. - - The horizontal area around (x,y) (x_min, x_max) will be extended into the - break direction for every cut we make. - */ - - //new_x = art_svp_intersect_break (ctx, left, x_min, y, ART_BREAK_LEFT); - - while (left_live || right_live) - { -#ifdef VERBOSE - art_dprint(" left: %08x (%d) right: %08x (%d)\n", left, left_live, right, right_live); -#endif - if (left_live) - { - if (x <= left->x[left->flags & ART_ACTIVE_FLAGS_BNEG] && - /* It may be that one of these conjuncts turns out to be always - true. We test both anyway, to be defensive. */ - y != left->y0 && y < left->y1) - { - d = x_min * left->a + y * left->b + left->c; - if (d < EPSILON_A) - { - new_x = art_svp_intersect_break (ctx, left, x_min, y, - ART_BREAK_LEFT); -#ifdef VERBOSE - art_dprint("break %08x at x<=%.16f,y=%.16f, new_x=%f\n", left, x_min, y, new_x); -#endif - if (new_x > x_max) - { - x_max = new_x; - right_live = (right != NULL); - } - else if (new_x < x_min) - x_min = new_x; - left = left->left; - left_live = (left != NULL); - } - else - left_live = ART_FALSE; - } - else - left_live = ART_FALSE; - } - else if (right_live) - { - if (x >= right->x[(right->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1] && - /* It may be that one of these conjuncts turns out to be always - true. We test both anyway, to be defensive. */ - y != right->y0 && y < right->y1) - { - d = x_max * right->a + y * right->b + right->c; - if (d > -EPSILON_A) - { - new_x = art_svp_intersect_break (ctx, right, x_max, y, - ART_BREAK_RIGHT); -#ifdef VERBOSE - art_dprint("break %08x at x>=%.16f,y=%.16f, new_x=%f\n", right, x_max, y, new_x); -#endif - if (new_x < x_min) - { - x_min = new_x; - left_live = (left != NULL); - } - else if (new_x >= x_max) - x_max = new_x; - right = right->right; - right_live = (right != NULL); - } - else - right_live = ART_FALSE; - } - else - right_live = ART_FALSE; - } - } - - /* Ascending order is guaranteed by break_flags. Thus, we don't need - to actually fix up non-ascending pairs. */ - - /* Now, (left, right) defines an interval of segments broken. Sort - into ascending x order. (find segment to the left of the new point) */ - test = left == NULL ? ctx->active_head : left->right; - result = left; - if (test != NULL && test != right) - { - if (y == test->y0) - x_test = test->x[0]; - else if(y == test->y1) - x_test = test->x[1]; - else { - art_warn ("internal error in add_point: y=%.16f is between %.16f and %.16f\n", y, test->y0, test->y1); - x_test = test->x[1]; - art_report_error(); - } - - for (;;) - { - if (x_test <= x) - result = test; - test = test->right; - if (test == right) - break; - - /* FIXME the following code doesn't do anything (?) */ - new_x = x_test; - if (new_x < x_test) - { - art_warn ("art_svp_intersect_add_point: non-ascending x\n"); - } - x_test = new_x; - } - } - return result; -} - -static void -art_svp_intersect_swap_active (ArtIntersectCtx *ctx, - ArtActiveSeg *left_seg, ArtActiveSeg *right_seg) -{ - if((left_seg && left_seg->right != right_seg) || - (right_seg && right_seg->left != left_seg)) { - art_warn("error: active list in disarray\n"); - art_report_error(); - } - - right_seg->left = left_seg->left; - if (right_seg->left != NULL) - right_seg->left->right = right_seg; - else - ctx->active_head = right_seg; - left_seg->right = right_seg->right; - if (left_seg->right != NULL) - left_seg->right->left = left_seg; - left_seg->left = right_seg; - right_seg->right = left_seg; -} - -volatile char add0 = 0; -static double double_precision(double x) -{ - /* make sure x has exactly 11 bits exponent and 52 bit mantissa- - there is probably a more elegant (or faster) way to trick the compiler - into doing this, but this works for now. */ - unsigned char xx[8]; - *(double*)xx = x; - xx[0]+=add0; xx[1]+=add0; xx[2]+=add0; xx[3]+=add0; - xx[4]+=add0; xx[5]+=add0; xx[6]+=add0; xx[7]+=add0; - return *(double*)xx; -} - -/** - * art_svp_intersect_test_cross: Test crossing of a pair of active segments. - * @ctx: Intersector context. - * @left_seg: Left segment of the pair. - * @right_seg: Right segment of the pair. - * @break_flags: Flags indicating whether to break neighbors. - * - * Tests crossing of @left_seg and @right_seg. If there is a crossing, - * inserts the intersection point into both segments. - * - * Return value: True if the intersection took place at the current - * scan line, indicating further iteration is needed. - **/ -static art_boolean -art_svp_intersect_test_cross (ArtIntersectCtx *ctx, - ArtActiveSeg *left_seg, ArtActiveSeg *right_seg, - int break_flags) -{ - double left_x0, left_y0, left_x1; - double left_y1 = left_seg->y1; - double right_y1 = right_seg->y1; - double d; - - const ArtSVPSeg *in_seg; - int in_curs; - double d0, d1, t; - double x, y; /* intersection point */ - -#ifdef VERBOSE - static int count = 0; - - art_dprint ("art_svp_intersect_test_cross %08x <-> %08x: count=%d\n", - (unsigned long)left_seg, (unsigned long)right_seg, count++); - art_dprint ("%08x = %.16f,%.16f -> %.16f %.16f\n", left_seg, - left_seg->x[0], left_seg->y0, - left_seg->x[1], left_seg->y1); - art_dprint ("(full: %.16f,%.16f -> %.16f %.16f)\n", - left_seg->in_seg->points[left_seg->in_curs - 1].x, left_seg->in_seg->points[left_seg->in_curs - 1].y, - left_seg->in_seg->points[left_seg->in_curs].x, left_seg->in_seg->points[left_seg->in_curs].y - ); - - art_dprint ("%08x = %.16f,%.16f -> %.16f %.16f\n", right_seg, - right_seg->x[0], right_seg->y0, - right_seg->x[1], right_seg->y1); - art_dprint ("(full: %.16f,%.16f -> %.16f %.16f)\n", - right_seg->in_seg->points[right_seg->in_curs - 1].x, right_seg->in_seg->points[right_seg->in_curs - 1].y, - right_seg->in_seg->points[right_seg->in_curs].x, right_seg->in_seg->points[right_seg->in_curs].y - ); -#endif - -#ifdef CHEAP_SANITYCHECK - if (right_seg->x[0] < left_seg->x[(left_seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1]) { - /* notice: if we test *only* the line equation here, dd might be < 0, even though - right_seg was inserted to the right of left_seg correctly, due to numerical - instabilities */ - double dd = right_seg->x[0] * left_seg->a + right_seg->y0 * left_seg->b + left_seg->c; - if(dd < 0) { - //art_warn ("segment %08x[%d] isn't to the left of %08x[%d]. d=%.16f\n", - // left_seg, left_seg->n_stack, - // right_seg, right_seg->n_stack, - // dd); - } - } -#endif - - if (left_seg->y0 == right_seg->y0 && left_seg->x[0] == right_seg->x[0]) - { - /* Top points of left and right segments coincide. This case - feels like a bit of duplication - we may want to merge it - with the cases below. However, this way, we're sure that this - logic makes only localized changes. */ - - if (left_y1 < right_y1) - { - /* Test left (x1, y1) against right segment */ - double left_x1 = left_seg->x[1]; - - if (left_x1 < - right_seg->x[(right_seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1] || - left_y1 == right_seg->y0) - return ART_FALSE; - d = left_x1 * right_seg->a + left_y1 * right_seg->b + right_seg->c; - if (d < -EPSILON_A) - - return ART_FALSE; - else if (d < EPSILON_A) /* should we use zero here? */ - { -#ifdef VERBOSE - art_dprint("break %08x because of common top point, left_y1 < right_y1\n", right_seg); -#endif - /* I'm unsure about the break flags here. */ - double right_x1 = art_svp_intersect_break (ctx, right_seg, - left_x1, left_y1, - ART_BREAK_RIGHT); - - /* this is always true due to ART_BREAK_RIGHT right_x1>=left_x1 if - _break uses x_ref clipping */ - if (left_x1 <= right_x1) { - return ART_FALSE; - } - } - } - else if (left_y1 > right_y1) - { - /* Test right (x1, y1) against left segment */ - double right_x1 = right_seg->x[1]; - - if (right_x1 > left_seg->x[left_seg->flags & ART_ACTIVE_FLAGS_BNEG] || - right_y1 == left_seg->y0) - - return ART_FALSE; - d = right_x1 * left_seg->a + right_y1 * left_seg->b + left_seg->c; - if (d > EPSILON_A) - return ART_FALSE; - else if (d > -EPSILON_A) /* should we use zero here? */ - { -#ifdef VERBOSE - art_dprint("break %08x because of common top point, left_y1 > right_y1\n", left_seg); -#endif - /* See above regarding break flags. */ - double left_x1 = art_svp_intersect_break (ctx, left_seg, - right_x1, right_y1, - ART_BREAK_LEFT); - - /* this is always true, due to ART_BREAK_LEFT left_x1<=right_x1, if - _break uses x_ref clipping - */ - if (left_x1 <= right_x1) { - return ART_FALSE; - } - } - } - else /* left_y1 == right_y1 */ - { - double left_x1 = left_seg->x[1]; - double right_x1 = right_seg->x[1]; - - - if (left_x1 <= right_x1) - return ART_FALSE; - } - - //int wind_left = left_seg->wind_left; - //int wind_right = right_seg->wind_left; - art_svp_intersect_swap_active (ctx, left_seg, right_seg); - //left_seg->wind_left = wind_right; - //right_seg->wind_left = wind_left; - - return ART_TRUE; - } - - if (left_y1 < right_y1) - { - /* Test left (x1, y1) against right segment */ - double left_x1 = left_seg->x[1]; - - if (left_x1 < - right_seg->x[(right_seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1] || - left_y1 == right_seg->y0) - return ART_FALSE; - - if(left_y1 < right_seg->y0) { - art_warn("left_y1 < right_seg->y0\n"); - return ART_FALSE; - } - - /* we might want to output a warning for left_y1 < right_seg->y0 */ - - d = left_x1 * right_seg->a + left_y1 * right_seg->b + right_seg->c; - if (d < -EPSILON_A) - return ART_FALSE; - else if (d < EPSILON_A) - { -#ifdef VERBOSE - art_dprint("break %08x at %.16f because left_y1 < right_y1\n", right_seg, left_y1); - art_dprint ("%08x = %.16f,%.16f -> %.16f %.16f\n", right_seg, - right_seg->x[0], right_seg->y0, - right_seg->x[1], right_seg->y1); -#endif - double right_x1 = art_svp_intersect_break (ctx, right_seg, - left_x1, left_y1, - ART_BREAK_RIGHT); -#ifdef VERBOSE - art_dprint("after break:\n", right_seg); - art_dprint ("%08x = %.16f,%.16f -> %.16f %.16f\n", right_seg, - right_seg->x[0], right_seg->y0, - right_seg->x[1], right_seg->y1); -#endif - /* this is always true if _break uses x_ref clipping */ - if (left_x1 <= right_x1) - return ART_FALSE; - } - } - else if (left_y1 > right_y1) - { - /* Test right (x1, y1) against left segment */ - double right_x1 = right_seg->x[1]; - - if (right_x1 > left_seg->x[left_seg->flags & ART_ACTIVE_FLAGS_BNEG] || - right_y1 == left_seg->y0) - return ART_FALSE; - - if(right_y1 < left_seg->y0) { - art_warn("left_y1 < right_seg->y0\n"); - return ART_FALSE; - } - - /* we might want to output a warning for right_y1 < left_seg->y0 */ - - d = right_x1 * left_seg->a + right_y1 * left_seg->b + left_seg->c; - if (d > EPSILON_A) - return ART_FALSE; - else if (d > -EPSILON_A) - { -#ifdef VERBOSE - art_dprint("break %08x because left_y1 > right_y1\n", right_seg); -#endif - double left_x1 = art_svp_intersect_break (ctx, left_seg, - right_x1, right_y1, - ART_BREAK_LEFT); - /* this is always true if _break uses x_ref clipping */ - if (left_x1 <= right_x1) - return ART_FALSE; - } - } - else /* left_y1 == right_y1 */ - { - double left_x1 = left_seg->x[1]; - double right_x1 = right_seg->x[1]; - - if (left_x1 <= right_x1) - return ART_FALSE; - } - - - /* The segments cross. Find the intersection point. */ - - in_seg = left_seg->in_seg; - in_curs = left_seg->in_curs; - left_x0 = in_seg->points[in_curs - 1].x; - left_y0 = in_seg->points[in_curs - 1].y; - left_x1 = in_seg->points[in_curs].x; - left_y1 = in_seg->points[in_curs].y; - -#if 0 - /* check for endpoint = firstpoint cases */ - if(left_seg->y0 == right_seg->y1 && left_seg->x[0] == right_seg->x[1]) - return ART_FALSE; - if(left_seg->y1 == right_seg->y0 && left_seg->x[1] == right_seg->x[0]) - return ART_FALSE; -#endif - - d0 = left_x0 * right_seg->a + left_y0 * right_seg->b + right_seg->c; - d1 = left_x1 * right_seg->a + left_y1 * right_seg->b + right_seg->c; - if (d0 == d1) - { - x = left_x0; - y = left_y0; - } - else - { - /* Is this division always safe? It could possibly overflow. */ - t = d0 / (d0 - d1); - if (t <= 0) - { - x = left_x0; - y = left_y0; - } - else if (t >= 1) - { - x = left_x1; - y = left_y1; - } - else - { - x = left_x0 + t * (left_x1 - left_x0); - y = left_y0 + t * (left_y1 - left_y0); - } - } - - /* Make sure intersection point is within bounds of right seg. */ - if (y < right_seg->y0) - { - x = right_seg->x[0]; - y = right_seg->y0; - } - else if (y > right_seg->y1) - { - x = right_seg->x[1]; - y = right_seg->y1; - } - else if (x < right_seg->x[(right_seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1]) - x = right_seg->x[(right_seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1]; - else if (x > right_seg->x[right_seg->flags & ART_ACTIVE_FLAGS_BNEG]) - x = right_seg->x[right_seg->flags & ART_ACTIVE_FLAGS_BNEG]; - - x = double_precision(x); - y = double_precision(y); - - assert(ctx->y >= left_seg->y0); -#ifdef VERBOSE - art_dprint ("intersect at %.16f %.16f\n", x, y); -#endif - - - if(y < ctx->y) { - /* as we use the full segment length (not just the subsegment currently - under evaluation), intersection points may be above the current scanline. - As we're not able to process these anymore, we also don't need to add - anything to the active list or pq. - - Intersection points above the current scanline happen if an - intersection is handled twice- once when the line is inserted, and - once when e.g. some other intersection point triggers insert_cross. - */ - art_warn ("previously unhandled intersection point %.16f %.16f (dy=%.16f)\n", x, y, ctx->y - y); - return ART_FALSE; - } - - if(y > left_seg->y1) { - /* not within the subsegment we're currently looking into- this is not an intersection */ - return ART_FALSE; - } - - if (y == left_seg->y0) - { - if (y != right_seg->y0) - { -#ifdef VERBOSE - art_dprint ("art_svp_intersect_test_cross: intersection (%.16f, %.16f) matches former y0 of %08x, [%08x]\n", - x, y, (unsigned long)left_seg, (unsigned long)right_seg); -#endif - art_svp_intersect_push_pt (ctx, right_seg, x, y); - if ((break_flags & ART_BREAK_RIGHT) && right_seg->right != NULL) - art_svp_intersect_add_point (ctx, x, y, right_seg->right, - break_flags); - } - else - { -#ifdef VERBOSE - art_dprint ("art_svp_intersect_test_cross: intersection (%.16f, %.16f) at current scan line (y=ly0=ry0)\n", - x, y, (unsigned long)left_seg, (unsigned long)right_seg); -#endif - /* Intersection takes place at current scan line, with - left->x0 <= x <= right->x0, left->x0 != right->x0. - - This happens if one of the lines is horizontal, or very near - horizontal. (true horizontal lines are processed by _horiz()) - - Process immediately rather than queueing intersection point into - priq. */ - ArtActiveSeg *winner, *loser; - - /* Choose "most vertical" segement */ - if (left_seg->a > right_seg->a) - { - winner = left_seg; - loser = right_seg; - } - else - { - winner = right_seg; - loser = left_seg; - } -#ifdef VERBOSE - art_dprint (" x = %.16f\n", x); - art_dprint (" loser->x[0] = %.16f\n", loser->x[0]); - art_dprint ("winner->x[0] = %.16f\n", winner->x[0]); -#endif - loser->x[0] = winner->x[0]; - loser->horiz_x = loser->x[0]; - loser->horiz_delta_wind += loser->delta_wind; - winner->horiz_delta_wind -= loser->delta_wind; - - art_svp_intersect_swap_active (ctx, left_seg, right_seg); - return ART_TRUE; - } - } - else if (y == right_seg->y0) - { -#ifdef VERBOSE - art_dprint ("*** art_svp_intersect_test_cross: intersection (%.16f, %.16f) matches latter y0 of [%08x], %08x\n", - x, y, (unsigned long)left_seg, (unsigned long)right_seg); - art_dprint ("%08x = %.16f,%.16f -> %.16f %.16f\n", left_seg, - left_seg->x[0], left_seg->y0, - left_seg->x[1], left_seg->y1); - art_dprint ("%08x = %.16f,%.16f -> %.16f %.16f\n", right_seg, - right_seg->x[0], right_seg->y0, - right_seg->x[1], right_seg->y1); - -#endif - art_svp_intersect_push_pt (ctx, left_seg, x, y); - if ((break_flags & ART_BREAK_LEFT) && left_seg->left != NULL) - art_svp_intersect_add_point (ctx, x, y, left_seg->left, - break_flags); - } - else - { -#ifdef VERBOSE - art_dprint ("Inserting (%.16f, %.16f) into %08x, %08x\n", - x, y, (unsigned long)left_seg, (unsigned long)right_seg); -#endif - /* Insert the intersection point into both segments. */ - art_svp_intersect_push_pt (ctx, left_seg, x, y); - art_svp_intersect_push_pt (ctx, right_seg, x, y); - if ((break_flags & ART_BREAK_LEFT) && left_seg->left != NULL) - art_svp_intersect_add_point (ctx, x, y, left_seg->left, ART_BREAK_LEFT | ART_BREAK_RIGHT); - if ((break_flags & ART_BREAK_RIGHT) && right_seg->right != NULL) - art_svp_intersect_add_point (ctx, x, y, right_seg->right, ART_BREAK_LEFT | ART_BREAK_RIGHT); - } - return ART_FALSE; -} - -/** - * art_svp_intersect_active_delete: Delete segment from active list. - * @ctx: Intersection context. - * @seg: Segment to delete. - * - * Deletes @seg from the active list. - **/ -static /* todo inline */ void -art_svp_intersect_active_delete (ArtIntersectCtx *ctx, ArtActiveSeg *seg) -{ - ArtActiveSeg *left = seg->left, *right = seg->right; - - if (left != NULL) - left->right = right; - else - ctx->active_head = right; - if (right != NULL) - right->left = left; -} - -/** - * art_svp_intersect_active_free: Free an active segment. - * @seg: Segment to delete. - * - * Frees @seg. - **/ -static /* todo inline */ void -art_svp_intersect_active_free (ArtActiveSeg *seg) -{ - art_free (seg->stack); -#ifdef VERBOSE - art_dprint ("Freeing %08x\n", (unsigned long) seg); -#else - // !!! - art_free (seg); -#endif -} - -/** - * art_svp_intersect_insert_cross: Test crossings of newly inserted line. - * - * Tests @seg against its left and right neighbors for intersections. - * Precondition: the line in @seg is not purely horizontal. - **/ -static void -art_svp_intersect_insert_cross (ArtIntersectCtx *ctx, - ArtActiveSeg *seg) -{ - ArtActiveSeg *left = seg, *right = seg; - - for (;;) - { - if (left != NULL) - { - ArtActiveSeg *leftc; - - for (leftc = left->left; leftc != NULL; leftc = leftc->left) - if (!(leftc->flags & ART_ACTIVE_FLAGS_DEL)) - break; - if (leftc != NULL && - art_svp_intersect_test_cross (ctx, leftc, left, - ART_BREAK_LEFT)) - { - if (left == right || right == NULL) - right = left->right; - } - else - { - left = NULL; - } - } - else if (right != NULL && right->right != NULL) - { - ArtActiveSeg *rightc; - - for (rightc = right->right; rightc != NULL; rightc = rightc->right) - if (!(rightc->flags & ART_ACTIVE_FLAGS_DEL)) - break; - if (rightc != NULL && - art_svp_intersect_test_cross (ctx, right, rightc, - ART_BREAK_RIGHT)) - { - if (left == right || left == NULL) - left = right->left; - } - else - { - right = NULL; - } - } - else - break; - } -} - -/** - * art_svp_intersect_horiz: Add horizontal line segment. - * @ctx: Intersector context. - * @seg: Segment on which to add horizontal line. - * @x0: Old x position. - * @x1: New x position. - * - * Adds a horizontal line from @x0 to @x1, and updates the current - * location of @seg to @x1. - **/ -static void -art_svp_intersect_horiz (ArtIntersectCtx *ctx, ArtActiveSeg *seg, - double x0, double x1) -{ - ArtActiveSeg *hs; - - if (x0 == x1) - return; - -#ifdef VERBOSE - art_dprint("horiz: seg=%08x x0=%f x1=%f segid=%08x flags=%s delta_wind=%d\n", seg, x0, x1, seg->seg_id, - seg->flags & ART_ACTIVE_FLAGS_OUT?"out":"", seg->delta_wind); -#endif - - hs = art_new (ArtActiveSeg, 1); - - hs->flags = ART_ACTIVE_FLAGS_DEL | (seg->flags & ART_ACTIVE_FLAGS_OUT); - if (seg->flags & ART_ACTIVE_FLAGS_OUT) - { - ArtSvpWriter *swr = ctx->out; - - swr->add_point (swr, seg->seg_id, x0, ctx->y); - } - hs->seg_id = seg->seg_id; - hs->horiz_x = x0; - hs->horiz_delta_wind = seg->delta_wind; - hs->stack = NULL; - - /* Ideally, the (a, b, c) values will never be read. However, there - are probably some tests remaining that don't check for _DEL - before evaluating the line equation. For those, these - initializations will at least prevent a UMR of the values, which - can crash on some platforms. */ - hs->a = 0.0; - hs->b = 0.0; - hs->c = 0.0; - - seg->horiz_delta_wind -= seg->delta_wind; - - art_svp_intersect_add_horiz (ctx, hs); - - if (x0 > x1) - { - ArtActiveSeg *left; - art_boolean first = ART_TRUE; - - for (left = seg->left; left != NULL; left = seg->left) - { - int left_bneg = left->flags & ART_ACTIVE_FLAGS_BNEG; - - if (left->x[left_bneg] <= x1) - break; - if (left->x[left_bneg ^ 1] <= x1 && - x1 * left->a + ctx->y * left->b + left->c >= 0) - break; - if (left->y0 != ctx->y && left->y1 != ctx->y) - { - art_svp_intersect_break (ctx, left, x1, ctx->y, ART_BREAK_LEFT); - } -#ifdef VERBOSE - art_dprint ("x0=%.16f > x1=%.16f, swapping %08x, %08x\n", - x0, x1, (unsigned long)left, (unsigned long)seg); -#endif - art_svp_intersect_swap_active (ctx, left, seg); - if (first && left->right != NULL) - { - art_svp_intersect_test_cross (ctx, left, left->right, - ART_BREAK_RIGHT); - first = ART_FALSE; - } - } - } - else - { - ArtActiveSeg *right; - art_boolean first = ART_TRUE; - - for (right = seg->right; right != NULL; right = seg->right) - { - int right_bneg = right->flags & ART_ACTIVE_FLAGS_BNEG; - - if (right->x[right_bneg ^ 1] >= x1) - break; - if (right->x[right_bneg] >= x1 && - x1 * right->a + ctx->y * right->b + right->c <= 0) - break; - if (right->y0 != ctx->y && right->y1 != ctx->y) - { - art_svp_intersect_break (ctx, right, x1, ctx->y, - ART_BREAK_LEFT); - } -#ifdef VERBOSE - art_dprint ("[right]x0=%.16f < x1=%.16f, swapping %08x, %08x\n", - x0, x1, (unsigned long)seg, (unsigned long)right); -#endif - art_svp_intersect_swap_active (ctx, seg, right); - if (first && right->left != NULL) - { - art_svp_intersect_test_cross (ctx, right->left, right, - ART_BREAK_RIGHT); - first = ART_FALSE; - } - } - } - - seg->x[0] = x1; - seg->x[1] = x1; - seg->horiz_x = x1; - seg->flags &= ~ART_ACTIVE_FLAGS_OUT; -} - -/** - * art_svp_intersect_insert_line: Insert a line into the active list. - * @ctx: Intersector context. - * @seg: Segment containing line to insert. - * - * Inserts the line into the intersector context, taking care of any - * intersections, and adding the appropriate horizontal points to the - * active list. - **/ -static void -art_svp_intersect_insert_line (ArtIntersectCtx *ctx, ArtActiveSeg *seg) -{ - if (seg->y1 == seg->y0) - { -#ifdef VERBOSE - art_dprint ("art_svp_intersect_insert_line(%d): %08x is horizontal\n", seg->flags&ART_ACTIVE_FLAGS_IN_ACTIVE, (unsigned long)seg); -#endif - art_svp_intersect_horiz (ctx, seg, seg->x[0], seg->x[1]); - } - else - { -#ifdef VERBOSE - art_dprint ("art_svp_intersect_insert_line(%d): %08x is non-horizontal\n", seg->flags&ART_ACTIVE_FLAGS_IN_ACTIVE, (unsigned long)seg); -#endif - art_svp_intersect_insert_cross (ctx, seg); - art_svp_intersect_add_horiz (ctx, seg); - } - - seg->flags |= ART_ACTIVE_FLAGS_IN_ACTIVE; //q -} - -static void -art_svp_intersect_process_intersection (ArtIntersectCtx *ctx, - ArtActiveSeg *seg) -{ - int n_stack = --seg->n_stack; - seg->x[1] = seg->stack[n_stack - 1].x; - seg->y1 = seg->stack[n_stack - 1].y; - seg->x[0] = seg->stack[n_stack].x; - seg->y0 = seg->stack[n_stack].y; - seg->horiz_x = seg->x[0]; -#ifdef VERBOSE - art_dprint("process intersection %08x (%.16f,%.16f-%.16f,%.16f)\n", seg, seg->x[0], seg->y0, seg->x[1], seg->y1); -#endif - art_svp_intersect_insert_line (ctx, seg); -} - -static void -art_svp_intersect_advance_cursor (ArtIntersectCtx *ctx, ArtActiveSeg *seg, - ArtPriPoint *pri_pt) -{ - const ArtSVPSeg *in_seg = seg->in_seg; - int in_curs = seg->in_curs; - ArtSvpWriter *swr = seg->flags & ART_ACTIVE_FLAGS_OUT ? ctx->out : NULL; - - if (swr != NULL) - swr->add_point (swr, seg->seg_id, seg->x[1], seg->y1); - if (in_curs + 1 >= in_seg->n_points) - { - ArtActiveSeg *left = seg->left, *right = seg->right; - -#if 0 - if (swr != NULL) - swr->close_segment (swr, seg->seg_id); - seg->flags &= ~ART_ACTIVE_FLAGS_OUT; -#endif - seg->flags |= ART_ACTIVE_FLAGS_DEL; - art_svp_intersect_add_horiz (ctx, seg); - art_svp_intersect_active_delete (ctx, seg); - if (left != NULL && right != NULL) - art_svp_intersect_test_cross (ctx, left, right, - ART_BREAK_LEFT | ART_BREAK_RIGHT); - art_free (pri_pt); - } - else - { - seg->horiz_x = seg->x[1]; - - art_svp_intersect_setup_seg (seg, pri_pt); - art_pri_insert (ctx->pq, pri_pt); - art_svp_intersect_insert_line (ctx, seg); - } -} - -static void -art_svp_intersect_add_seg (ArtIntersectCtx *ctx, const ArtSVPSeg *in_seg) -{ - ArtActiveSeg *seg = art_new (ArtActiveSeg, 1); - ArtActiveSeg *test; - double x0, y0; - ArtActiveSeg *beg_range; - ArtActiveSeg *last = NULL; - ArtActiveSeg *left, *right; - ArtPriPoint *pri_pt = art_new (ArtPriPoint, 1); - - seg->flags = 0; - seg->in_seg = in_seg; - seg->in_curs = 0; - - seg->n_stack_max = 4; - seg->stack = art_new (ArtPoint, seg->n_stack_max); - - seg->horiz_delta_wind = 0; - - seg->wind_left = 0; - - pri_pt->user_data = seg; - art_svp_intersect_setup_seg (seg, pri_pt); - art_pri_insert (ctx->pq, pri_pt); - - /* Find insertion place for new segment */ - /* This is currently a left-to-right scan, but should be replaced - with a binary search as soon as it's validated. */ - - x0 = in_seg->points[0].x; - y0 = in_seg->points[0].y; - beg_range = NULL; - for (test = ctx->active_head; test != NULL; test = test->right) - { - double d; - int test_bneg = test->flags & ART_ACTIVE_FLAGS_BNEG; - - if (x0 < test->x[test_bneg]) - { - if (x0 < test->x[test_bneg ^ 1]) { -#ifdef VERBOSE - art_dprint("inserting segment %08x before %08x (x0 < xmin)\n", seg, test); -#endif - break; - } - d = x0 * test->a + y0 * test->b + test->c; - if (d < 0) { -#ifdef VERBOSE - art_dprint("inserting segment %08x before %08x (d = %.16f)\n", seg, test, d); -#endif - break; - } -#ifdef VERBOSE - art_dprint("segment %08x is to the right of %08x d=%.16f\n", seg, test, d); -#endif - } else { -#ifdef VERBOSE - d = x0 * test->a + y0 * test->b + test->c; - art_dprint("segment %08x is to the right of %08x d=%.16f (not used)\n", seg, test, d); -#endif - } - last = test; - } - - left = art_svp_intersect_add_point (ctx, x0, y0, last, ART_BREAK_LEFT | ART_BREAK_RIGHT); - -#ifdef VERBOSE - art_dprint("left=%08x x0=%.16f y=%.16f\n", left, x0, y0); -#endif - - seg->left = left; - if (left == NULL) - { - right = ctx->active_head; - ctx->active_head = seg; - } - else - { - right = left->right; - left->right = seg; - } - seg->right = right; - if (right != NULL) - right->left = seg; - - seg->delta_wind = in_seg->dir ? 1 : -1; - seg->horiz_x = x0; - - art_svp_intersect_insert_line (ctx, seg); -} - -#ifdef SANITYCHECK -static void -art_svp_intersect_sanitycheck_winding (ArtIntersectCtx *ctx) -{ -#if 0 - /* At this point, we seem to be getting false positives, so it's - turned off for now. */ - - ArtActiveSeg *seg; - int winding_number = 0; - - for (seg = ctx->active_head; seg != NULL; seg = seg->right) - { - /* Check winding number consistency. */ - if (seg->flags & ART_ACTIVE_FLAGS_OUT) - { - if (winding_number != seg->wind_left) - art_warn ("*** art_svp_intersect_sanitycheck_winding: seg %08x has wind_left of %d, expected %d\n", - (unsigned long) seg, seg->wind_left, winding_number); - winding_number = seg->wind_left + seg->delta_wind; - } - } - if (winding_number != 0) - art_warn ("*** art_svp_intersect_sanitycheck_winding: non-balanced winding number %d\n", - winding_number); -#endif -} -#endif - -/** - * art_svp_intersect_horiz_commit: Commit points in horiz list to output. - * @ctx: Intersection context. - * - * The main function of the horizontal commit is to output new - * points to the output writer. - * - * This "commit" pass is also where winding numbers are assigned, - * because doing it here provides much greater tolerance for inputs - * which are not in strict SVP order. - * - * Each cluster in the horiz_list contains both segments that are in - * the active list (ART_ACTIVE_FLAGS_DEL is false) and that are not, - * and are scheduled to be deleted (ART_ACTIVE_FLAGS_DEL is true). We - * need to deal with both. - **/ -static void -art_svp_intersect_horiz_commit (ArtIntersectCtx *ctx) -{ - ArtActiveSeg *seg; - int winding_number = 0; /* initialization just to avoid warning */ - int horiz_wind = 0; - double last_x = 0; /* initialization just to avoid warning */ - -#ifdef VERBOSE - art_dprint ("art_svp_intersect_horiz_commit: y=%.16f\n", ctx->y); - for (seg = ctx->horiz_first; seg != NULL; seg = seg->horiz_right) - art_dprint (" %08x: %.16f %+d segid=%d\n", - (unsigned long)seg, seg->horiz_x, seg->horiz_delta_wind, seg->seg_id); -#endif - - /* Output points to svp writer. */ - for (seg = ctx->horiz_first; seg != NULL;) - { - /* Find a cluster with common horiz_x, */ - ArtActiveSeg *curs; - double x = seg->horiz_x; - - /* Generate any horizontal segments. */ - if (horiz_wind != 0) - { - ArtSvpWriter *swr = ctx->out; - int seg_id; - -#ifdef VERBOSE - art_dprint ("generate horizontal segment: y=%.16f x=%.16f-%.16f wind=%d horiz_wind=%d\n", ctx->y, last_x, x, winding_number, horiz_wind); -#endif - seg_id = swr->add_segment (swr, winding_number, horiz_wind, - last_x, ctx->y); - swr->add_point (swr, seg_id, x, ctx->y); - swr->close_segment (swr, seg_id); - } - - /* Find first active segment in cluster. */ - - for (curs = seg; curs != NULL && curs->horiz_x == x; - curs = curs->horiz_right) - if (!(curs->flags & ART_ACTIVE_FLAGS_DEL)) - break; - - if (curs != NULL && curs->horiz_x == x) - { - /* There exists at least one active segment in this cluster. */ - - /* Find beginning of cluster. */ - for (; curs->left != NULL; curs = curs->left) - if (curs->left->horiz_x != x) - break; - - if (curs->left != NULL) - winding_number = curs->left->wind_left + curs->left->delta_wind; - else - winding_number = 0; - - do - { -#ifdef VERBOSE - art_dprint (" curs %08x: winding_number = %d += %d\n", (unsigned long)curs, winding_number, curs->delta_wind); -#endif - if (!(curs->flags & ART_ACTIVE_FLAGS_OUT) || - curs->wind_left != winding_number) - { - ArtSvpWriter *swr = ctx->out; - - if (curs->flags & ART_ACTIVE_FLAGS_OUT) - { - swr->add_point (swr, curs->seg_id, - curs->horiz_x, ctx->y); - swr->close_segment (swr, curs->seg_id); - } - - curs->seg_id = swr->add_segment (swr, winding_number, - curs->delta_wind, - x, ctx->y); - curs->flags |= ART_ACTIVE_FLAGS_OUT; - } - curs->wind_left = winding_number; - winding_number += curs->delta_wind; - curs = curs->right; - } - while (curs != NULL && curs->horiz_x == x); - } - - /* Skip past cluster. */ - do - { - ArtActiveSeg *next = seg->horiz_right; - - seg->flags &= ~ART_ACTIVE_FLAGS_IN_HORIZ; - horiz_wind += seg->horiz_delta_wind; - seg->horiz_delta_wind = 0; - if (seg->flags & ART_ACTIVE_FLAGS_DEL) - { - if (seg->flags & ART_ACTIVE_FLAGS_OUT) - { - ArtSvpWriter *swr = ctx->out; - swr->close_segment (swr, seg->seg_id); - } - art_svp_intersect_active_free (seg); - } - seg = next; - } - while (seg != NULL && seg->horiz_x == x); - - last_x = x; - } - ctx->horiz_first = NULL; - ctx->horiz_last = NULL; -#ifdef SANITYCHECK - art_svp_intersect_sanitycheck_winding (ctx); -#endif -} - -#ifdef SANITYCHECK -static void -art_svp_intersect_sanitycheck (ArtIntersectCtx *ctx, double y) -{ - ArtActiveSeg *seg; - ArtActiveSeg *last = NULL; - double d; - -#ifdef VERbOSE - art_dprint ("Active list (y = %.16f (new: %.16f)):\n", ctx->y, y); -#endif - - for (seg = ctx->active_head; seg != NULL; seg = seg->right) - { -#ifdef VERBOSE - char c1=' ',c2=' ',e1=' '; - if(seg->y0 > ctx->y) c1='!'; - if(seg->y0 > y) c2='!'; - if(seg->y0 > seg->y1) e1='E'; -#endif - - if (seg->left != last) - { - art_warn ("*** art_svp_intersect_sanitycheck: last=%08x, seg->left=%08x\n", - (unsigned long)last, (unsigned long)seg->left); - } - if (last != NULL) - { - /* pairwise compare with previous seg */ - - /* First the top. */ - if (last->y0 < seg->y0) - { - } - else - { - } - - /* Then the bottom. */ - if (last->y1 < seg->y1) - { - if (!((last->x[1] < - seg->x[(seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1]) || - last->y1 == seg->y0)) - { - d = last->x[1] * seg->a + last->y1 * seg->b + seg->c; - if (d >= EPSILON_A) { - art_warn ("*** bottom (%.16f, %.16f) of %08x is not clear of %08x to right (d = %g)\n", - last->x[1], last->y1, (unsigned long) last, - (unsigned long) seg, d); - art_report_error(); - } else { -#ifdef VERBOSE - art_dprint("is to the left (d=%.16f of previous x1,y1) of\n", d); -#endif - } - } else { -#ifdef VERBOSE - art_dprint("is to the left (previous x1 < next x%d) of\n", (seg->flags & ART_ACTIVE_FLAGS_BNEG) ^ 1); -#endif - } - } - else if (last->y1 > seg->y1) - - { - if (!((seg->x[1] > - last->x[last->flags & ART_ACTIVE_FLAGS_BNEG]) || - seg->y1 == last->y0)) - { - d = seg->x[1] * last->a + seg->y1 * last->b + last->c; - if (d < -EPSILON_A) { - art_warn ("*** bottom (%.16f, %.16f) of %08x is not clear of %08x to left (d = %.16f)\n", - seg->x[1], seg->y1, (unsigned long) seg, - (unsigned long) last, d); - art_report_error(); - } else { -#ifdef VERBOSE - art_dprint("is to the left (d=%.16f of next x1,y1) of\n", d); -#endif - } - } else { -#ifdef VERBOSE - art_dprint("is to the left (next x1 > previous x%d) of\n", last->flags & ART_ACTIVE_FLAGS_BNEG); -#endif - } - } - else - { - if (last->x[1] - seg->x[1] > EPSILON_A) { - art_warn ("*** bottoms (%.16f, %.16f) of %08x and (%.16f, %.16f) of %08x out of order\n", - last->x[1], last->y1, (unsigned long)last, - seg->x[1], seg->y1, (unsigned long)seg); - art_report_error(); - } else { -#ifdef VERBOSE - art_dprint("is to the left (y1s equal, previous x1 < next x1)\n"); -#endif - } - } - } - -#ifdef VERBOSE - art_dprint ("%c%08x: %c%c %02d (%.16f, %.16f)-(%.16f, %.16f) ", - e1, - (unsigned long)seg, c1, c2, seg->flags, - seg->x[0], seg->y0, seg->x[1], seg->y1); -#endif - - last = seg; - } -#ifdef VERBOSE - art_dprint("\n"); -#endif -} -#endif - -void -art_svp_intersector (const ArtSVP *in, ArtSvpWriter *out) -{ - ArtIntersectCtx *ctx; - ArtPriQ *pq; - ArtPriPoint *first_point; -#ifdef VERBOSE - int count = 0; -#endif - - if (in->n_segs == 0) - return; - - current_svp = in; - -#ifdef VERBOSE - int t; - art_dprint("Segments: %d\n", in->n_segs); - for(t=0;tn_segs;t++) { - const ArtSVPSeg* seg = &in->segs[t]; - art_dprint("Segment %08x(%d): %d points, %s, BBox: (%f,%f,%f,%f)\n", - seg, t, seg->n_points, seg->dir==0?"UP ":"DOWN", - seg->bbox.x0, seg->bbox.y0, seg->bbox.x1, seg->bbox.y1); - int p; - for(p=0;pn_points;p++) { - ArtPoint* point = &seg->points[p]; - art_dprint(" (%.16f,%.16f)\n", point->x, point->y); - } - } - art_dprint("\n"); -#endif - - ctx = art_new (ArtIntersectCtx, 1); - ctx->in = in; - ctx->out = out; - pq = art_pri_new (); - ctx->pq = pq; - - ctx->active_head = NULL; - - ctx->horiz_first = NULL; - ctx->horiz_last = NULL; - - ctx->in_curs = 0; - first_point = art_new (ArtPriPoint, 1); - first_point->x = in->segs[0].points[0].x; - first_point->y = in->segs[0].points[0].y; - first_point->user_data = NULL; - ctx->y = first_point->y; - art_pri_insert (pq, first_point); - - double lasty = -HUGE_VAL; - while (!art_pri_empty (pq)) - { - ArtPriPoint *pri_point = art_pri_choose (pq); - ArtActiveSeg *seg = (ArtActiveSeg *)pri_point->user_data; - -#ifdef VERBOSE - art_dprint ("\nIntersector step %d (%d items in pq)\n", count++, pq->n_items); -#endif -#ifdef SANITYCHECK - art_svp_intersect_sanitycheck(ctx, pri_point->y); -#endif -#ifdef VERBOSE - art_dprint ("priq choose (%.16f, %.16f) %08x\n", pri_point->x, pri_point->y, - (unsigned long)pri_point->user_data); - if(seg) { - art_dprint (" %08x = %.16f,%.16f -> %.16f %.16f\n", seg, seg->x[0], seg->y0, seg->x[1], seg->y1); - } - //int t; - //for(t=0;tn_items;t++) { - // art_dprint("pq[%d] %.16f,%.16f %08x\n", - // t, - // pq->items[t]->x, - // pq->items[t]->y, - // pq->items[t]->user_data); - //} -#endif - - //art_dprint("y=%f %08x\n", pri_point->y, pri_point->user_data); - if (ctx->y != pri_point->y) - { - art_svp_intersect_horiz_commit (ctx); - ctx->y = pri_point->y; - } - - if(ctx->y < lasty) { - art_warn("y decreased\n"); - art_report_error(); - } - - if (seg == NULL) - { - /* Insert new segment from input */ - const ArtSVPSeg *in_seg = 0; - - while(1) { - in_seg = &in->segs[ctx->in_curs++]; - if(in_seg->n_points > 1) - break; - if(ctx->in_curs == in->n_segs) { - in_seg = 0; - break; - } - -#ifdef VERBOSE - art_dprint("ignoring input segment %08x- it only contains %d point(s)\n", - in_seg, in_seg->n_points); -#endif - } - - if(in_seg) { - int t; - int error = 0; - for(t=0;tn_points-1;t++) { - if(!(in_seg->points[t].y <= in_seg->points[t+1].y)) { - error = 1; - } - } - if(error) { - art_warn("bad input: contains a segment with descending y\n"); - for(t=0;tn_points;t++) { - art_dprint("%d) %.16f %.16f\n", t, in_seg->points[t].x, in_seg->points[t].y); - } - art_report_error(); - } - -#ifdef VERBOSE - art_dprint("insert new segment from input (%.16f,%.16f) dir=%d\n", in_seg->points[0].x, in_seg->points[0].y, in_seg->dir); -#endif - art_svp_intersect_add_seg (ctx, in_seg); - if (ctx->in_curs < in->n_segs) - { - const ArtSVPSeg *next_seg = &in->segs[ctx->in_curs]; - pri_point->x = next_seg->points[0].x; - pri_point->y = next_seg->points[0].y; - /* user_data is already NULL */ - art_pri_insert (pq, pri_point); - } - else - art_free(pri_point);pri_point =0; - } else { - art_free(pri_point);pri_point = 0; - } - } - else - { - int n_stack = seg->n_stack; - - if (n_stack > 1) - { - art_svp_intersect_process_intersection (ctx, seg); - art_free (pri_point); - } - else - { - art_svp_intersect_advance_cursor (ctx, seg, pri_point); - } - } - lasty = ctx->y; - } - - art_svp_intersect_horiz_commit (ctx); - - art_pri_free (pq); - art_free (ctx); - current_svp = 0; -} diff -Nru swftools-0.9.0/lib/art/art_svp_intersect.h swftools-0.9.2/lib/art/art_svp_intersect.h --- swftools-0.9.0/lib/art/art_svp_intersect.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_intersect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 2001 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_INTERSECT_H__ -#define __ART_SVP_INTERSECT_H__ - -/* The funky new SVP intersector. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#else -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -extern const ArtSVP* current_svp; -extern void art_report_error(); -extern int art_error_in_intersector; - -#ifndef ART_WIND_RULE_DEFINED -#define ART_WIND_RULE_DEFINED -typedef enum { - ART_WIND_RULE_NONZERO, - ART_WIND_RULE_INTERSECT, - ART_WIND_RULE_ODDEVEN, - ART_WIND_RULE_POSITIVE -} ArtWindRule; -#endif - -typedef struct _ArtSvpWriter ArtSvpWriter; - -struct _ArtSvpWriter { - int (*add_segment) (ArtSvpWriter *self, int wind_left, int delta_wind, - double x, double y); - void (*add_point) (ArtSvpWriter *self, int seg_id, double x, double y); - void (*close_segment) (ArtSvpWriter *self, int seg_id); -}; - -ArtSvpWriter * -art_svp_writer_rewind_new (ArtWindRule rule); - -ArtSVP * -art_svp_writer_rewind_reap (ArtSvpWriter *self); - -int -art_svp_seg_compare (const void *s1, const void *s2); - -void -art_svp_intersector (const ArtSVP *in, ArtSvpWriter *out); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_INTERSECT_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp_ops.c swftools-0.9.2/lib/art/art_svp_ops.c --- swftools-0.9.0/lib/art/art_svp_ops.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_ops.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,400 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#define noVERBOSE - -/* Vector path set operations, over sorted vpaths. */ - -#include "config.h" -#include "art_svp_ops.h" - -#include "art_misc.h" - -#include "art_svp.h" -#include "art_vpath.h" -#include "art_svp_vpath.h" -#include "art_svp.h" -#ifdef ART_USE_NEW_INTERSECTOR -#include "art_svp_intersect.h" -#else -#include "art_svp_wind.h" -#endif -#include "art_vpath_svp.h" - -/* Merge the segments of the two svp's. The resulting svp will share - segments with args passed in, so be super-careful with the - allocation. */ -/** - * art_svp_merge: Merge the segments of two svp's. - * @svp1: One svp to merge. - * @svp2: The other svp to merge. - * - * Merges the segments of two SVP's into a new one. The resulting - * #ArtSVP data structure will share the segments of the argument - * svp's, so it is probably a good idea to free it shallowly, - * especially if the arguments will be freed with art_svp_free(). - * - * Return value: The merged #ArtSVP. - **/ -ArtSVP * art_svp_merge (const ArtSVP *svp1, const ArtSVP *svp2) -{ - ArtSVP *svp_new; - int ix; - int ix1, ix2; - - svp_new = (ArtSVP *)art_alloc (sizeof(ArtSVP) + - (svp1->n_segs + svp2->n_segs - 1) * - sizeof(ArtSVPSeg)); - ix1 = 0; - ix2 = 0; - for (ix = 0; ix < svp1->n_segs + svp2->n_segs; ix++) - { - if (ix1 < svp1->n_segs && - (ix2 == svp2->n_segs || - art_svp_seg_compare (&svp1->segs[ix1], &svp2->segs[ix2]) < 1)) - svp_new->segs[ix] = svp1->segs[ix1++]; - else - svp_new->segs[ix] = svp2->segs[ix2++]; - } - - svp_new->n_segs = ix; - return svp_new; -} - -#ifdef VERBOSE - -#define XOFF 50 -#define YOFF 700 - -static void -print_ps_vpath (ArtVpath *vpath) -{ - int i; - - printf ("gsave %d %d translate 1 -1 scale\n", XOFF, YOFF); - for (i = 0; vpath[i].code != ART_END; i++) - { - switch (vpath[i].code) - { - case ART_MOVETO: - printf ("%g %g moveto\n", vpath[i].x, vpath[i].y); - break; - case ART_LINETO: - printf ("%g %g lineto\n", vpath[i].x, vpath[i].y); - break; - default: - break; - } - } - printf ("stroke grestore showpage\n"); -} - -#define DELT 4 - -static void -print_ps_svp (ArtSVP *vpath) -{ - int i, j; - - printf ("%% begin\n"); - for (i = 0; i < vpath->n_segs; i++) - { - printf ("%g setgray\n", vpath->segs[i].dir ? 0.7 : 0); - for (j = 0; j < vpath->segs[i].n_points; j++) - { - printf ("%g %g %s\n", - XOFF + vpath->segs[i].points[j].x, - YOFF - vpath->segs[i].points[j].y, - j ? "lineto" : "moveto"); - } - printf ("%g %g moveto %g %g lineto %g %g lineto %g %g lineto stroke\n", - XOFF + vpath->segs[i].points[0].x - DELT, - YOFF - DELT - vpath->segs[i].points[0].y, - XOFF + vpath->segs[i].points[0].x - DELT, - YOFF - vpath->segs[i].points[0].y, - XOFF + vpath->segs[i].points[0].x + DELT, - YOFF - vpath->segs[i].points[0].y, - XOFF + vpath->segs[i].points[0].x + DELT, - YOFF - DELT - vpath->segs[i].points[0].y); - printf ("%g %g moveto %g %g lineto %g %g lineto %g %g lineto stroke\n", - XOFF + vpath->segs[i].points[j - 1].x - DELT, - YOFF + DELT - vpath->segs[i].points[j - 1].y, - XOFF + vpath->segs[i].points[j - 1].x - DELT, - YOFF - vpath->segs[i].points[j - 1].y, - XOFF + vpath->segs[i].points[j - 1].x + DELT, - YOFF - vpath->segs[i].points[j - 1].y, - XOFF + vpath->segs[i].points[j - 1].x + DELT, - YOFF + DELT - vpath->segs[i].points[j - 1].y); - printf ("stroke\n"); - } - - printf ("showpage\n"); -} -#endif - -#ifndef ART_USE_NEW_INTERSECTOR -static ArtSVP * -art_svp_merge_perturbed (const ArtSVP *svp1, const ArtSVP *svp2) -{ - ArtVpath *vpath1, *vpath2; - ArtVpath *vpath1_p, *vpath2_p; - ArtSVP *svp1_p, *svp2_p; - ArtSVP *svp_new; - - vpath1 = art_vpath_from_svp (svp1); - vpath1_p = art_vpath_perturb (vpath1); - art_free (vpath1); - svp1_p = art_svp_from_vpath (vpath1_p); - art_free (vpath1_p); - - vpath2 = art_vpath_from_svp (svp2); - vpath2_p = art_vpath_perturb (vpath2); - art_free (vpath2); - svp2_p = art_svp_from_vpath (vpath2_p); - art_free (vpath2_p); - - svp_new = art_svp_merge (svp1_p, svp2_p); -#ifdef VERBOSE - print_ps_svp (svp1_p); - print_ps_svp (svp2_p); - print_ps_svp (svp_new); -#endif - art_free (svp1_p); - art_free (svp2_p); - - return svp_new; -} -#endif - -/* Compute the union of two vector paths. - - Status of this routine: - - Basic correctness: Seems to work. - - Numerical stability: We cheat (adding random perturbation). Thus, - it seems very likely that no numerical stability problems will be - seen in practice. - - Speed: Would be better if we didn't go to unsorted vector path - and back to add the perturbation. - - Precision: The perturbation fuzzes the coordinates slightly. In - cases of butting segments, razor thin long holes may appear. - -*/ -/** - * art_svp_union: Compute the union of two sorted vector paths. - * @svp1: One sorted vector path. - * @svp2: The other sorted vector path. - * - * Computes the union of the two argument svp's. Given two svp's with - * winding numbers of 0 and 1 everywhere, the resulting winding number - * will be 1 where either (or both) of the argument svp's has a - * winding number 1, 0 otherwise. The result is newly allocated. - * - * Currently, this routine has accuracy problems pending the - * implementation of the new intersector. - * - * Return value: The union of @svp1 and @svp2. - **/ -ArtSVP * -art_svp_union (const ArtSVP *svp1, const ArtSVP *svp2) -{ -#ifdef ART_USE_NEW_INTERSECTOR - ArtSVP *svp3, *svp_new; - ArtSvpWriter *swr; - - svp3 = art_svp_merge (svp1, svp2); - swr = art_svp_writer_rewind_new (ART_WIND_RULE_POSITIVE); - art_svp_intersector (svp3, swr); - svp_new = art_svp_writer_rewind_reap (swr); - art_free (svp3); /* shallow free because svp3 contains shared segments */ - - return svp_new; -#else - ArtSVP *svp3, *svp4, *svp_new; - - svp3 = art_svp_merge_perturbed (svp1, svp2); - svp4 = art_svp_uncross (svp3); - art_svp_free (svp3); - - svp_new = art_svp_rewind_uncrossed (svp4, ART_WIND_RULE_POSITIVE); -#ifdef VERBOSE - print_ps_svp (svp4); - print_ps_svp (svp_new); -#endif - art_svp_free (svp4); - return svp_new; -#endif -} - -/* Compute the intersection of two vector paths. - - Status of this routine: - - Basic correctness: Seems to work. - - Numerical stability: We cheat (adding random perturbation). Thus, - it seems very likely that no numerical stability problems will be - seen in practice. - - Speed: Would be better if we didn't go to unsorted vector path - and back to add the perturbation. - - Precision: The perturbation fuzzes the coordinates slightly. In - cases of butting segments, razor thin long isolated segments may - appear. - -*/ - -/** - * art_svp_intersect: Compute the intersection of two sorted vector paths. - * @svp1: One sorted vector path. - * @svp2: The other sorted vector path. - * - * Computes the intersection of the two argument svp's. Given two - * svp's with winding numbers of 0 and 1 everywhere, the resulting - * winding number will be 1 where both of the argument svp's has a - * winding number 1, 0 otherwise. The result is newly allocated. - * - * Currently, this routine has accuracy problems pending the - * implementation of the new intersector. - * - * Return value: The intersection of @svp1 and @svp2. - **/ -ArtSVP * -art_svp_intersect (const ArtSVP *svp1, const ArtSVP *svp2) -{ -#ifdef ART_USE_NEW_INTERSECTOR - ArtSVP *svp3, *svp_new; - ArtSvpWriter *swr; - - svp3 = art_svp_merge (svp1, svp2); - swr = art_svp_writer_rewind_new (ART_WIND_RULE_INTERSECT); - art_svp_intersector (svp3, swr); - svp_new = art_svp_writer_rewind_reap (swr); - art_free (svp3); /* shallow free because svp3 contains shared segments */ - - return svp_new; -#else - ArtSVP *svp3, *svp4, *svp_new; - - svp3 = art_svp_merge_perturbed (svp1, svp2); - svp4 = art_svp_uncross (svp3); - art_svp_free (svp3); - - svp_new = art_svp_rewind_uncrossed (svp4, ART_WIND_RULE_INTERSECT); - art_svp_free (svp4); - return svp_new; -#endif -} - -/* Compute the symmetric difference of two vector paths. - - Status of this routine: - - Basic correctness: Seems to work. - - Numerical stability: We cheat (adding random perturbation). Thus, - it seems very likely that no numerical stability problems will be - seen in practice. - - Speed: We could do a lot better by scanning through the svp - representations and culling out any segments that are exactly - identical. It would also be better if we didn't go to unsorted - vector path and back to add the perturbation. - - Precision: Awful. In the case of inputs which are similar (the - common case for canvas display), the entire outline is "hairy." In - addition, the perturbation fuzzes the coordinates slightly. It can - be used as a conservative approximation. - -*/ - -/** - * art_svp_diff: Compute the symmetric difference of two sorted vector paths. - * @svp1: One sorted vector path. - * @svp2: The other sorted vector path. - * - * Computes the symmetric of the two argument svp's. Given two svp's - * with winding numbers of 0 and 1 everywhere, the resulting winding - * number will be 1 where either, but not both, of the argument svp's - * has a winding number 1, 0 otherwise. The result is newly allocated. - * - * Currently, this routine has accuracy problems pending the - * implementation of the new intersector. - * - * Return value: The symmetric difference of @svp1 and @svp2. - **/ -ArtSVP * -art_svp_diff (const ArtSVP *svp1, const ArtSVP *svp2) -{ -#ifdef ART_USE_NEW_INTERSECTOR - ArtSVP *svp3, *svp_new; - ArtSvpWriter *swr; - - svp3 = art_svp_merge (svp1, svp2); - swr = art_svp_writer_rewind_new (ART_WIND_RULE_ODDEVEN); - art_svp_intersector (svp3, swr); - svp_new = art_svp_writer_rewind_reap (swr); - art_free (svp3); /* shallow free because svp3 contains shared segments */ - - return svp_new; -#else - ArtSVP *svp3, *svp4, *svp_new; - - svp3 = art_svp_merge_perturbed (svp1, svp2); - svp4 = art_svp_uncross (svp3); - art_svp_free (svp3); - - svp_new = art_svp_rewind_uncrossed (svp4, ART_WIND_RULE_ODDEVEN); - art_svp_free (svp4); - return svp_new; -#endif -} - -#ifdef ART_USE_NEW_INTERSECTOR -ArtSVP * -art_svp_minus (const ArtSVP *svp1, const ArtSVP *svp2) -{ - ArtSVP *svp2_mod; - ArtSVP *svp3, *svp_new; - ArtSvpWriter *swr; - int i; - - svp2_mod = (ArtSVP *) svp2; /* get rid of the const for a while */ - - /* First invert svp2 to "turn it inside out" */ - for (i = 0; i < svp2_mod->n_segs; i++) - svp2_mod->segs[i].dir = !svp2_mod->segs[i].dir; - - svp3 = art_svp_merge (svp1, svp2_mod); - swr = art_svp_writer_rewind_new (ART_WIND_RULE_POSITIVE); - art_svp_intersector (svp3, swr); - svp_new = art_svp_writer_rewind_reap (swr); - art_free (svp3); /* shallow free because svp3 contains shared segments */ - - /* Flip svp2 back to its original state */ - for (i = 0; i < svp2_mod->n_segs; i++) - svp2_mod->segs[i].dir = !svp2_mod->segs[i].dir; - - return svp_new; -} -#endif /* ART_USE_NEW_INTERSECTOR */ diff -Nru swftools-0.9.0/lib/art/art_svp_ops.h swftools-0.9.2/lib/art/art_svp_ops.h --- swftools-0.9.0/lib/art/art_svp_ops.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_ops.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_OPS_H__ -#define __ART_SVP_OPS_H__ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#else -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Vector path set operations, over sorted vpaths. */ - -ArtSVP *art_svp_union (const ArtSVP *svp1, const ArtSVP *svp2); -ArtSVP *art_svp_intersect (const ArtSVP *svp1, const ArtSVP *svp2); -ArtSVP *art_svp_diff (const ArtSVP *svp1, const ArtSVP *svp2); -ArtSVP *art_svp_minus (const ArtSVP *svp1, const ArtSVP *svp2); - -ArtSVP *art_svp_merge (const ArtSVP *svp1, const ArtSVP *svp2); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_OPS_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp_point.c swftools-0.9.2/lib/art/art_svp_point.c --- swftools-0.9.0/lib/art/art_svp_point.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_point.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1999 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_svp_point.h" - -#include -#include "art_misc.h" - -#include "art_svp.h" - -/* Determine whether a point is inside, or near, an svp. */ - -/* return winding number of point wrt svp */ -/** - * art_svp_point_wind: Determine winding number of a point with respect to svp. - * @svp: The svp. - * @x: The X coordinate of the point. - * @y: The Y coordinate of the point. - * - * Determine the winding number of the point @x, @y with respect to @svp. - * - * Return value: the winding number. - **/ -int -art_svp_point_wind (ArtSVP *svp, double x, double y) -{ - int i, j; - int wind = 0; - - for (i = 0; i < svp->n_segs; i++) - { - ArtSVPSeg *seg = &svp->segs[i]; - - if (seg->bbox.y0 > y) - break; - - if (seg->bbox.y1 > y) - { - if (seg->bbox.x1 < x) - wind += seg->dir ? 1 : -1; - else if (seg->bbox.x0 <= x) - { - double x0, y0, x1, y1, dx, dy; - - for (j = 0; j < seg->n_points - 1; j++) - { - if (seg->points[j + 1].y > y) - break; - } - x0 = seg->points[j].x; - y0 = seg->points[j].y; - x1 = seg->points[j + 1].x; - y1 = seg->points[j + 1].y; - - dx = x1 - x0; - dy = y1 - y0; - if ((x - x0) * dy > (y - y0) * dx) - wind += seg->dir ? 1 : -1; - } - } - } - - return wind; -} - -/** - * art_svp_point_dist: Determine distance between point and svp. - * @svp: The svp. - * @x: The X coordinate of the point. - * @y: The Y coordinate of the point. - * - * Determines the distance of the point @x, @y to the closest edge in - * @svp. A large number is returned if @svp is empty. - * - * Return value: the distance. - **/ -double -art_svp_point_dist (ArtSVP *svp, double x, double y) -{ - int i, j; - double dist_sq; - double best_sq = -1; - - for (i = 0; i < svp->n_segs; i++) - { - ArtSVPSeg *seg = &svp->segs[i]; - for (j = 0; j < seg->n_points - 1; j++) - { - double x0 = seg->points[j].x; - double y0 = seg->points[j].y; - double x1 = seg->points[j + 1].x; - double y1 = seg->points[j + 1].y; - - double dx = x1 - x0; - double dy = y1 - y0; - - double dxx0 = x - x0; - double dyy0 = y - y0; - - double dot = dxx0 * dx + dyy0 * dy; - - if (dot < 0) - dist_sq = dxx0 * dxx0 + dyy0 * dyy0; - else - { - double rr = dx * dx + dy * dy; - - if (dot > rr) - dist_sq = (x - x1) * (x - x1) + (y - y1) * (y - y1); - else - { - double perp = (y - y0) * dx - (x - x0) * dy; - - dist_sq = perp * perp / rr; - } - } - if (best_sq < 0 || dist_sq < best_sq) - best_sq = dist_sq; - } - } - - if (best_sq >= 0) - return sqrt (best_sq); - else - return 1e12; -} - diff -Nru swftools-0.9.0/lib/art/art_svp_point.h swftools-0.9.2/lib/art/art_svp_point.h --- swftools-0.9.0/lib/art/art_svp_point.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_point.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1999 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_POINT_H__ -#define __ART_SVP_POINT_H__ - -/* Determine whether a point is inside, or near, an svp. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#else -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -int -art_svp_point_wind (ArtSVP *svp, double x, double y); - -double -art_svp_point_dist (ArtSVP *svp, double x, double y); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_H__ */ - - - - diff -Nru swftools-0.9.0/lib/art/art_svp_render_aa.c swftools-0.9.2/lib/art/art_svp_render_aa.c --- swftools-0.9.0/lib/art/art_svp_render_aa.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_render_aa.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,463 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* The spiffy antialiased renderer for sorted vector paths. */ - -#include "config.h" -#include "art_svp_render_aa.h" - -#include -#include /* for memmove */ -#include "art_misc.h" - -#include "art_rect.h" -#include "art_svp.h" - -#include - -typedef double artfloat; - -struct _ArtSVPRenderAAIter { - const ArtSVP *svp; - int x0, x1; - int y; - int seg_ix; - - int *active_segs; - int n_active_segs; - int *cursor; - artfloat *seg_x; - artfloat *seg_dx; - - ArtSVPRenderAAStep *steps; -}; - -static void -art_svp_render_insert_active (int i, int *active_segs, int n_active_segs, - artfloat *seg_x, artfloat *seg_dx) -{ - int j; - artfloat x; - int tmp1, tmp2; - - /* this is a cheap hack to get ^'s sorted correctly */ - x = seg_x[i] + 0.001 * seg_dx[i]; - for (j = 0; j < n_active_segs && seg_x[active_segs[j]] < x; j++); - - tmp1 = i; - while (j < n_active_segs) - { - tmp2 = active_segs[j]; - active_segs[j] = tmp1; - tmp1 = tmp2; - j++; - } - active_segs[j] = tmp1; -} - -static void -art_svp_render_delete_active (int *active_segs, int j, int n_active_segs) -{ - int k; - - for (k = j; k < n_active_segs; k++) - active_segs[k] = active_segs[k + 1]; -} - -#define EPSILON 1e-6 - -/* Render the sorted vector path in the given rectangle, antialiased. - - This interface uses a callback for the actual pixel rendering. The - callback is called y1 - y0 times (once for each scan line). The y - coordinate is given as an argument for convenience (it could be - stored in the callback's private data and incremented on each - call). - - The rendered polygon is represented in a semi-runlength format: a - start value and a sequence of "steps". Each step has an x - coordinate and a value delta. The resulting value at position x is - equal to the sum of the start value and all step delta values for - which the step x coordinate is less than or equal to x. An - efficient algorithm will traverse the steps left to right, keeping - a running sum. - - All x coordinates in the steps are guaranteed to be x0 <= x < x1. - (This guarantee is a change from the gfonted vpaar renderer, and is - designed to simplify the callback). - - There is now a further guarantee that no two steps will have the - same x value. This may allow for further speedup and simplification - of renderers. - - The value 0x8000 represents 0% coverage by the polygon, while - 0xff8000 represents 100% coverage. This format is designed so that - >> 16 results in a standard 0x00..0xff value range, with nice - rounding. - - Status of this routine: - - Basic correctness: OK - - Numerical stability: pretty good, although probably not - bulletproof. - - Speed: Needs more aggressive culling of bounding boxes. Can - probably speed up the [x0,x1) clipping of step values. Can do more - of the step calculation in fixed point. - - Precision: No known problems, although it should be tested - thoroughly, especially for symmetry. - -*/ - -ArtSVPRenderAAIter * -art_svp_render_aa_iter (const ArtSVP *svp, - int x0, int y0, int x1, int y1) -{ - ArtSVPRenderAAIter *iter = art_new (ArtSVPRenderAAIter, 1); - - iter->svp = svp; - iter->y = y0; - iter->x0 = x0; - iter->x1 = x1; - iter->seg_ix = 0; - - iter->active_segs = art_new (int, svp->n_segs); - iter->cursor = art_new (int, svp->n_segs); - iter->seg_x = art_new (artfloat, svp->n_segs); - iter->seg_dx = art_new (artfloat, svp->n_segs); - iter->steps = art_new (ArtSVPRenderAAStep, x1 - x0); - iter->n_active_segs = 0; - - return iter; -} - -#define ADD_STEP(xpos, xdelta) \ - /* stereotype code fragment for adding a step */ \ - if (n_steps == 0 || steps[n_steps - 1].x < xpos) \ - { \ - sx = n_steps; \ - steps[sx].x = xpos; \ - steps[sx].delta = xdelta; \ - n_steps++; \ - } \ - else \ - { \ - for (sx = n_steps; sx > 0; sx--) \ - { \ - if (steps[sx - 1].x == xpos) \ - { \ - steps[sx - 1].delta += xdelta; \ - sx = n_steps; \ - break; \ - } \ - else if (steps[sx - 1].x < xpos) \ - { \ - break; \ - } \ - } \ - if (sx < n_steps) \ - { \ - memmove (&steps[sx + 1], &steps[sx], \ - (n_steps - sx) * sizeof(steps[0])); \ - steps[sx].x = xpos; \ - steps[sx].delta = xdelta; \ - n_steps++; \ - } \ - } - -void -art_svp_render_aa_iter_step (ArtSVPRenderAAIter *iter, int *p_start, - ArtSVPRenderAAStep **p_steps, int *p_n_steps) -{ - const ArtSVP *svp = iter->svp; - int *active_segs = iter->active_segs; - int n_active_segs = iter->n_active_segs; - int *cursor = iter->cursor; - artfloat *seg_x = iter->seg_x; - artfloat *seg_dx = iter->seg_dx; - int i = iter->seg_ix; - int j; - int x0 = iter->x0; - int x1 = iter->x1; - int y = iter->y; - int seg_index; - - int x; - ArtSVPRenderAAStep *steps = iter->steps; - int n_steps; - artfloat y_top, y_bot; - artfloat x_top, x_bot; - artfloat x_min, x_max; - int ix_min, ix_max; - artfloat delta; /* delta should be int too? */ - int last, xthis; - int xdelta; - artfloat rslope, drslope; - int start; - const ArtSVPSeg *seg; - int curs; - artfloat dy; - - int sx; - - /* insert new active segments */ - for (; i < svp->n_segs && svp->segs[i].bbox.y0 < y + 1; i++) - { - if (svp->segs[i].bbox.y1 > y && - svp->segs[i].bbox.x0 < x1) - { - seg = &svp->segs[i]; - /* move cursor to topmost vector which overlaps [y,y+1) */ - for (curs = 0; seg->points[curs + 1].y < y; curs++); - cursor[i] = curs; - dy = seg->points[curs + 1].y - seg->points[curs].y; - if (fabs (dy) >= EPSILON) - seg_dx[i] = (seg->points[curs + 1].x - seg->points[curs].x) / - dy; - else - seg_dx[i] = 1e12; - seg_x[i] = seg->points[curs].x + - (y - seg->points[curs].y) * seg_dx[i]; - art_svp_render_insert_active (i, active_segs, n_active_segs++, - seg_x, seg_dx); - } - } - - n_steps = 0; - - /* render the runlengths, advancing and deleting as we go */ - start = 0x8000; - - for (j = 0; j < n_active_segs; j++) - { - seg_index = active_segs[j]; - seg = &svp->segs[seg_index]; - curs = cursor[seg_index]; - while (curs != seg->n_points - 1 && - seg->points[curs].y < y + 1) - { - y_top = y; - if (y_top < seg->points[curs].y) - y_top = seg->points[curs].y; - y_bot = y + 1; - if (y_bot > seg->points[curs + 1].y) - y_bot = seg->points[curs + 1].y; - if (y_top != y_bot) { - delta = (seg->dir ? 16711680.0 : -16711680.0) * - (y_bot - y_top); - x_top = seg_x[seg_index] + (y_top - y) * seg_dx[seg_index]; - x_bot = seg_x[seg_index] + (y_bot - y) * seg_dx[seg_index]; - if (x_top < x_bot) - { - x_min = x_top; - x_max = x_bot; - } - else - { - x_min = x_bot; - x_max = x_top; - } - ix_min = floor (x_min); - ix_max = floor (x_max); - if (ix_min >= x1) - { - /* skip; it starts to the right of the render region */ - } - else if (ix_max < x0) - /* it ends to the left of the render region */ - start += delta; - else if (ix_min == ix_max) - { - /* case 1, antialias a single pixel */ - xdelta = (ix_min + 1 - (x_min + x_max) * 0.5) * delta; - - ADD_STEP(ix_min, xdelta) - - if (ix_min + 1 < x1) - { - xdelta = delta - xdelta; - - ADD_STEP(ix_min + 1, xdelta) - } - } - else - { - /* case 2, antialias a run */ - rslope = 1.0 / fabs (seg_dx[seg_index]); - drslope = delta * rslope; - last = - drslope * 0.5 * - (ix_min + 1 - x_min) * (ix_min + 1 - x_min); - xdelta = last; - if (ix_min >= x0) - { - ADD_STEP(ix_min, xdelta) - - x = ix_min + 1; - } - else - { - start += last; - x = x0; - } - if (ix_max > x1) - ix_max = x1; - for (; x < ix_max; x++) - { - xthis = (seg->dir ? 16711680.0 : -16711680.0) * rslope * - (x + 0.5 - x_min); - xdelta = xthis - last; - last = xthis; - - ADD_STEP(x, xdelta) - } - if (x < x1) - { - xthis = - delta * (1 - 0.5 * - (x_max - ix_max) * (x_max - ix_max) * - rslope); - xdelta = xthis - last; - last = xthis; - - ADD_STEP(x, xdelta) - - if (x + 1 < x1) - { - xdelta = delta - last; - - ADD_STEP(x + 1, xdelta) - } - } - } - } - curs++; - if (curs != seg->n_points - 1 && - seg->points[curs].y < y + 1) - { - dy = seg->points[curs + 1].y - seg->points[curs].y; - if (fabs (dy) >= EPSILON) - seg_dx[seg_index] = (seg->points[curs + 1].x - - seg->points[curs].x) / dy; - else - seg_dx[seg_index] = 1e12; - seg_x[seg_index] = seg->points[curs].x + - (y - seg->points[curs].y) * seg_dx[seg_index]; - } - /* break here, instead of duplicating predicate in while? */ - } - if (seg->points[curs].y >= y + 1) - { - curs--; - cursor[seg_index] = curs; - seg_x[seg_index] += seg_dx[seg_index]; - } - else - { - art_svp_render_delete_active (active_segs, j--, - --n_active_segs); - } - } - - *p_start = start; - *p_steps = steps; - *p_n_steps = n_steps; - - iter->seg_ix = i; - iter->n_active_segs = n_active_segs; - iter->y++; -} - -void -art_svp_render_aa_iter_done (ArtSVPRenderAAIter *iter) -{ - art_free (iter->steps); - - art_free (iter->seg_dx); - art_free (iter->seg_x); - art_free (iter->cursor); - art_free (iter->active_segs); - art_free (iter); -} - -/** - * art_svp_render_aa: Render SVP antialiased. - * @svp: The #ArtSVP to render. - * @x0: Left coordinate of destination rectangle. - * @y0: Top coordinate of destination rectangle. - * @x1: Right coordinate of destination rectangle. - * @y1: Bottom coordinate of destination rectangle. - * @callback: The callback which actually paints the pixels. - * @callback_data: Private data for @callback. - * - * Renders the sorted vector path in the given rectangle, antialiased. - * - * This interface uses a callback for the actual pixel rendering. The - * callback is called @y1 - @y0 times (once for each scan line). The y - * coordinate is given as an argument for convenience (it could be - * stored in the callback's private data and incremented on each - * call). - * - * The rendered polygon is represented in a semi-runlength format: a - * start value and a sequence of "steps". Each step has an x - * coordinate and a value delta. The resulting value at position x is - * equal to the sum of the start value and all step delta values for - * which the step x coordinate is less than or equal to x. An - * efficient algorithm will traverse the steps left to right, keeping - * a running sum. - * - * All x coordinates in the steps are guaranteed to be @x0 <= x < @x1. - * (This guarantee is a change from the gfonted vpaar renderer from - * which this routine is derived, and is designed to simplify the - * callback). - * - * The value 0x8000 represents 0% coverage by the polygon, while - * 0xff8000 represents 100% coverage. This format is designed so that - * >> 16 results in a standard 0x00..0xff value range, with nice - * rounding. - * - **/ -void -art_svp_render_aa (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - void (*callback) (void *callback_data, - int y, - int start, - ArtSVPRenderAAStep *steps, int n_steps), - void *callback_data) -{ - ArtSVPRenderAAIter *iter; - int y; - int start; - ArtSVPRenderAAStep *steps; - int n_steps; - - iter = art_svp_render_aa_iter (svp, x0, y0, x1, y1); - - - for (y = y0; y < y1; y++) - { - art_svp_render_aa_iter_step (iter, &start, &steps, &n_steps); - (*callback) (callback_data, y, start, steps, n_steps); - } - - art_svp_render_aa_iter_done (iter); -} diff -Nru swftools-0.9.0/lib/art/art_svp_render_aa.h swftools-0.9.2/lib/art/art_svp_render_aa.h --- swftools-0.9.0/lib/art/art_svp_render_aa.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_render_aa.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_RENDER_AA_H__ -#define __ART_SVP_RENDER_AA_H__ - -/* The spiffy antialiased renderer for sorted vector paths. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#else -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtSVPRenderAAStep ArtSVPRenderAAStep; -typedef struct _ArtSVPRenderAAIter ArtSVPRenderAAIter; - -struct _ArtSVPRenderAAStep { - int x; - int delta; /* stored with 16 fractional bits */ -}; - -ArtSVPRenderAAIter * -art_svp_render_aa_iter (const ArtSVP *svp, - int x0, int y0, int x1, int y1); - -void -art_svp_render_aa_iter_step (ArtSVPRenderAAIter *iter, int *p_start, - ArtSVPRenderAAStep **p_steps, int *p_n_steps); - -void -art_svp_render_aa_iter_done (ArtSVPRenderAAIter *iter); - -void -art_svp_render_aa (const ArtSVP *svp, - int x0, int y0, int x1, int y1, - void (*callback) (void *callback_data, - int y, - int start, - ArtSVPRenderAAStep *steps, int n_steps), - void *callback_data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_RENDER_AA_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp_vpath.c swftools-0.9.2/lib/art/art_svp_vpath.c --- swftools-0.9.0/lib/art/art_svp_vpath.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_vpath.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Sort vector paths into sorted vector paths */ - -#include "config.h" -#include "art_svp_vpath.h" - -#include -#include - -#include "art_misc.h" - -#include "art_vpath.h" -#include "art_svp.h" - - -/* reverse a list of points in place */ -static void -reverse_points (ArtPoint *points, int n_points) -{ - int i; - ArtPoint tmp_p; - - for (i = 0; i < (n_points >> 1); i++) - { - tmp_p = points[i]; - points[i] = points[n_points - (i + 1)]; - points[n_points - (i + 1)] = tmp_p; - } -} - -/** - * art_svp_from_vpath: Convert a vpath to a sorted vector path. - * @vpath: #ArtVPath to convert. - * - * Converts a vector path into sorted vector path form. The svp form is - * more efficient for rendering and other vector operations. - * - * Basically, the implementation is to traverse the vector path, - * generating a new segment for each "run" of points in the vector - * path with monotonically increasing Y values. All the resulting - * values are then sorted. - * - * Note: I'm not sure that the sorting rule is correct with respect - * to numerical stability issues. - * - * Return value: Resulting sorted vector path. - **/ -ArtSVP * -art_svp_from_vpath (ArtVpath *vpath) -{ - int n_segs, n_segs_max; - ArtSVP *svp; - int dir; - int new_dir; - int i; - ArtPoint *points; - int n_points, n_points_max; - double x, y; - double x_min, x_max; - - n_segs = 0; - n_segs_max = 16; - svp = (ArtSVP *)art_alloc (sizeof(ArtSVP) + - (n_segs_max - 1) * sizeof(ArtSVPSeg)); - - dir = 0; - n_points = 0; - n_points_max = 0; - points = NULL; - i = 0; - - x = y = 0; /* unnecessary, given "first code must not be LINETO" invariant, - but it makes gcc -Wall -ansi -pedantic happier */ - x_min = x_max = 0; /* same */ - - while (vpath[i].code != ART_END) { - if (vpath[i].code == ART_MOVETO || vpath[i].code == ART_MOVETO_OPEN) - { - if (points != NULL && n_points >= 2) - { - if (n_segs == n_segs_max) - { - n_segs_max <<= 1; - svp = (ArtSVP *)art_realloc (svp, sizeof(ArtSVP) + - (n_segs_max - 1) * - sizeof(ArtSVPSeg)); - } - svp->segs[n_segs].n_points = n_points; - svp->segs[n_segs].dir = (dir > 0); - if (dir < 0) - reverse_points (points, n_points); - svp->segs[n_segs].points = points; - svp->segs[n_segs].bbox.x0 = x_min; - svp->segs[n_segs].bbox.x1 = x_max; - svp->segs[n_segs].bbox.y0 = points[0].y; - svp->segs[n_segs].bbox.y1 = points[n_points - 1].y; - n_segs++; - points = NULL; - } - - if (points == NULL) - { - n_points_max = 4; - points = art_new (ArtPoint, n_points_max); - } - - n_points = 1; - points[0].x = x = vpath[i].x; - points[0].y = y = vpath[i].y; - x_min = x; - x_max = x; - dir = 0; - } - else /* must be LINETO */ - { - new_dir = (vpath[i].y > y || - (vpath[i].y == y && vpath[i].x > x)) ? 1 : -1; - if (dir && dir != new_dir) - { - /* new segment */ - x = points[n_points - 1].x; - y = points[n_points - 1].y; - if (n_segs == n_segs_max) - { - n_segs_max <<= 1; - svp = (ArtSVP *)art_realloc (svp, sizeof(ArtSVP) + - (n_segs_max - 1) * - sizeof(ArtSVPSeg)); - } - svp->segs[n_segs].n_points = n_points; - svp->segs[n_segs].dir = (dir > 0); - if (dir < 0) - reverse_points (points, n_points); - svp->segs[n_segs].points = points; - svp->segs[n_segs].bbox.x0 = x_min; - svp->segs[n_segs].bbox.x1 = x_max; - svp->segs[n_segs].bbox.y0 = points[0].y; - svp->segs[n_segs].bbox.y1 = points[n_points - 1].y; - n_segs++; - - n_points = 1; - n_points_max = 4; - points = art_new (ArtPoint, n_points_max); - points[0].x = x; - points[0].y = y; - x_min = x; - x_max = x; - } - - if (points != NULL) - { - if (n_points == n_points_max) - art_expand (points, ArtPoint, n_points_max); - points[n_points].x = x = vpath[i].x; - points[n_points].y = y = vpath[i].y; - if (x < x_min) x_min = x; - else if (x > x_max) x_max = x; - n_points++; - } - dir = new_dir; - } - i++; - } - - if (points != NULL) - { - if (n_points >= 2) - { - if (n_segs == n_segs_max) - { - n_segs_max <<= 1; - svp = (ArtSVP *)art_realloc (svp, sizeof(ArtSVP) + - (n_segs_max - 1) * - sizeof(ArtSVPSeg)); - } - svp->segs[n_segs].n_points = n_points; - svp->segs[n_segs].dir = (dir > 0); - if (dir < 0) - reverse_points (points, n_points); - svp->segs[n_segs].points = points; - svp->segs[n_segs].bbox.x0 = x_min; - svp->segs[n_segs].bbox.x1 = x_max; - svp->segs[n_segs].bbox.y0 = points[0].y; - svp->segs[n_segs].bbox.y1 = points[n_points - 1].y; - n_segs++; - } - else - art_free (points); - } - - svp->n_segs = n_segs; - - qsort (&svp->segs, n_segs, sizeof (ArtSVPSeg), art_svp_seg_compare); - - return svp; -} - diff -Nru swftools-0.9.0/lib/art/art_svp_vpath.h swftools-0.9.2/lib/art/art_svp_vpath.h --- swftools-0.9.0/lib/art/art_svp_vpath.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_vpath.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_VPATH_H__ -#define __ART_SVP_VPATH_H__ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#include "art_vpath.h" -#else -#include "art_svp.h" -#include "art_vpath.h" -#endif - -/* Sort vector paths into sorted vector paths. */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtSVP * -art_svp_from_vpath (ArtVpath *vpath); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_VPATH_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp_vpath_stroke.c swftools-0.9.2/lib/art/art_svp_vpath_stroke.c --- swftools-0.9.0/lib/art/art_svp_vpath_stroke.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_vpath_stroke.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,741 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -#include "config.h" -#include "art_svp_vpath_stroke.h" - -#include -#include - -#include "art_misc.h" - -#include "art_vpath.h" -#include "art_svp.h" -#ifdef ART_USE_NEW_INTERSECTOR -#include "art_svp_intersect.h" -#else -#include "art_svp_wind.h" -#endif -#include "art_svp_vpath.h" - -#define EPSILON 1e-6 -#define EPSILON_2 1e-12 - -#define yes_OPTIMIZE_INNER - -/* Render an arc segment starting at (xc + x0, yc + y0) to (xc + x1, - yc + y1), centered at (xc, yc), and with given radius. Both x0^2 + - y0^2 and x1^2 + y1^2 should be equal to radius^2. - - A positive value of radius means curve to the left, negative means - curve to the right. -*/ -static void -art_svp_vpath_stroke_arc (ArtVpath **p_vpath, int *pn, int *pn_max, - double xc, double yc, - double x0, double y0, - double x1, double y1, - double radius, - double flatness) -{ - double theta; - double th_0, th_1; - int n_pts; - int i; - double aradius; - - aradius = fabs (radius); - theta = 2 * M_SQRT2 * sqrt (flatness / aradius); - th_0 = atan2 (y0, x0); - th_1 = atan2 (y1, x1); - if (radius > 0) - { - /* curve to the left */ - if (th_0 < th_1) th_0 += M_PI * 2; - n_pts = ceil ((th_0 - th_1) / theta); - } - else - { - /* curve to the right */ - if (th_1 < th_0) th_1 += M_PI * 2; - n_pts = ceil ((th_1 - th_0) / theta); - } -#ifdef VERBOSE - printf ("start %f %f; th_0 = %f, th_1 = %f, r = %f, theta = %f\n", x0, y0, th_0, th_1, radius, theta); -#endif - art_vpath_add_point (p_vpath, pn, pn_max, - ART_LINETO, xc + x0, yc + y0); - for (i = 1; i < n_pts; i++) - { - theta = th_0 + (th_1 - th_0) * i / n_pts; - art_vpath_add_point (p_vpath, pn, pn_max, - ART_LINETO, xc + cos (theta) * aradius, - yc + sin (theta) * aradius); -#ifdef VERBOSE - printf ("mid %f %f\n", cos (theta) * radius, sin (theta) * radius); -#endif - } - art_vpath_add_point (p_vpath, pn, pn_max, - ART_LINETO, xc + x1, yc + y1); -#ifdef VERBOSE - printf ("end %f %f\n", x1, y1); -#endif -} - -/* Assume that forw and rev are at point i0. Bring them to i1, - joining with the vector i1 - i2. - - This used to be true, but isn't now that the stroke_raw code is - filtering out (near)zero length vectors: {It so happens that all - invocations of this function maintain the precondition i1 = i0 + 1, - so we could decrease the number of arguments by one. We haven't - done that here, though.} - - forw is to the line's right and rev is to its left. - - Precondition: no zero-length vectors, otherwise a divide by - zero will happen. */ -static void -render_seg (ArtVpath **p_forw, int *pn_forw, int *pn_forw_max, - ArtVpath **p_rev, int *pn_rev, int *pn_rev_max, - ArtVpath *vpath, int i0, int i1, int i2, - ArtPathStrokeJoinType join, - double line_width, double miter_limit, double flatness) -{ - double dx0, dy0; - double dx1, dy1; - double dlx0, dly0; - double dlx1, dly1; - double dmx, dmy; - double dmr2; - double scale; - double cross; - -#ifdef VERBOSE - printf ("join style = %d\n", join); -#endif - - /* The vectors of the lines from i0 to i1 and i1 to i2. */ - dx0 = vpath[i1].x - vpath[i0].x; - dy0 = vpath[i1].y - vpath[i0].y; - - dx1 = vpath[i2].x - vpath[i1].x; - dy1 = vpath[i2].y - vpath[i1].y; - - /* Set dl[xy]0 to the vector from i0 to i1, rotated counterclockwise - 90 degrees, and scaled to the length of line_width. */ - scale = line_width / sqrt (dx0 * dx0 + dy0 * dy0); - dlx0 = dy0 * scale; - dly0 = -dx0 * scale; - - /* Set dl[xy]1 to the vector from i1 to i2, rotated counterclockwise - 90 degrees, and scaled to the length of line_width. */ - scale = line_width / sqrt (dx1 * dx1 + dy1 * dy1); - dlx1 = dy1 * scale; - dly1 = -dx1 * scale; - -#ifdef VERBOSE - printf ("%% render_seg: (%g, %g) - (%g, %g) - (%g, %g)\n", - vpath[i0].x, vpath[i0].y, - vpath[i1].x, vpath[i1].y, - vpath[i2].x, vpath[i2].y); - - printf ("%% render_seg: d[xy]0 = (%g, %g), dl[xy]0 = (%g, %g)\n", - dx0, dy0, dlx0, dly0); - - printf ("%% render_seg: d[xy]1 = (%g, %g), dl[xy]1 = (%g, %g)\n", - dx1, dy1, dlx1, dly1); -#endif - - /* now, forw's last point is expected to be colinear along d[xy]0 - to point i0 - dl[xy]0, and rev with i0 + dl[xy]0. */ - - /* positive for positive area (i.e. left turn) */ - cross = dx1 * dy0 - dx0 * dy1; - - dmx = (dlx0 + dlx1) * 0.5; - dmy = (dly0 + dly1) * 0.5; - dmr2 = dmx * dmx + dmy * dmy; - - if (join == ART_PATH_STROKE_JOIN_MITER && - dmr2 * miter_limit * miter_limit < line_width * line_width) - join = ART_PATH_STROKE_JOIN_BEVEL; - - /* the case when dmr2 is zero or very small bothers me - (i.e. near a 180 degree angle) - ALEX: So, we avoid the optimization when dmr2 is very small. This should - be safe since dmx/y is only used in optimization and in MITER case, and MITER - should be converted to BEVEL when dmr2 is very small. */ - if (dmr2 > EPSILON_2) - { - scale = line_width * line_width / dmr2; - dmx *= scale; - dmy *= scale; - } - - if (cross * cross < EPSILON_2 && dx0 * dx1 + dy0 * dy1 >= 0) - { - /* going straight */ -#ifdef VERBOSE - printf ("%% render_seg: straight\n"); -#endif - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dlx0, vpath[i1].y - dly0); - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dlx0, vpath[i1].y + dly0); - } - else if (cross > 0) - { - /* left turn, forw is outside and rev is inside */ - -#ifdef VERBOSE - printf ("%% render_seg: left\n"); -#endif - if ( -#ifdef NO_OPTIMIZE_INNER - 0 && -#endif - (dmr2 > EPSILON_2) && - /* check that i1 + dm[xy] is inside i0-i1 rectangle */ - (dx0 + dmx) * dx0 + (dy0 + dmy) * dy0 > 0 && - /* and that i1 + dm[xy] is inside i1-i2 rectangle */ - ((dx1 - dmx) * dx1 + (dy1 - dmy) * dy1 > 0) -#ifdef PEDANTIC_INNER - && - /* check that i1 + dl[xy]1 is inside i0-i1 rectangle */ - (dx0 + dlx1) * dx0 + (dy0 + dly1) * dy0 > 0 && - /* and that i1 + dl[xy]0 is inside i1-i2 rectangle */ - ((dx1 - dlx0) * dx1 + (dy1 - dly0) * dy1 > 0) -#endif - ) - { - /* can safely add single intersection point */ - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dmx, vpath[i1].y + dmy); - } - else - { - /* need to loop-de-loop the inside */ - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dlx0, vpath[i1].y + dly0); - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x, vpath[i1].y); - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dlx1, vpath[i1].y + dly1); - } - - if (join == ART_PATH_STROKE_JOIN_BEVEL) - { - /* bevel */ - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dlx0, vpath[i1].y - dly0); - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dlx1, vpath[i1].y - dly1); - } - else if (join == ART_PATH_STROKE_JOIN_MITER) - { - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dmx, vpath[i1].y - dmy); - } - else if (join == ART_PATH_STROKE_JOIN_ROUND) { - art_svp_vpath_stroke_arc (p_forw, pn_forw, pn_forw_max, - vpath[i1].x, vpath[i1].y, - -dlx0, -dly0, - -dlx1, -dly1, - line_width, - flatness); - } - } - else - { - /* right turn, rev is outside and forw is inside */ -#ifdef VERBOSE - printf ("%% render_seg: right\n"); -#endif - - if ( -#ifdef NO_OPTIMIZE_INNER - 0 && -#endif - (dmr2 > EPSILON_2) && - /* check that i1 - dm[xy] is inside i0-i1 rectangle */ - (dx0 - dmx) * dx0 + (dy0 - dmy) * dy0 > 0 && - /* and that i1 - dm[xy] is inside i1-i2 rectangle */ - ((dx1 + dmx) * dx1 + (dy1 + dmy) * dy1 > 0) -#ifdef PEDANTIC_INNER - && - /* check that i1 - dl[xy]1 is inside i0-i1 rectangle */ - (dx0 - dlx1) * dx0 + (dy0 - dly1) * dy0 > 0 && - /* and that i1 - dl[xy]0 is inside i1-i2 rectangle */ - ((dx1 + dlx0) * dx1 + (dy1 + dly0) * dy1 > 0) -#endif - ) - { - /* can safely add single intersection point */ - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dmx, vpath[i1].y - dmy); - } - else - { - /* need to loop-de-loop the inside */ - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dlx0, vpath[i1].y - dly0); - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x, vpath[i1].y); - art_vpath_add_point (p_forw, pn_forw, pn_forw_max, - ART_LINETO, vpath[i1].x - dlx1, vpath[i1].y - dly1); - } - - if (join == ART_PATH_STROKE_JOIN_BEVEL) - { - /* bevel */ - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dlx0, vpath[i1].y + dly0); - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dlx1, vpath[i1].y + dly1); - } - else if (join == ART_PATH_STROKE_JOIN_MITER) - { - art_vpath_add_point (p_rev, pn_rev, pn_rev_max, - ART_LINETO, vpath[i1].x + dmx, vpath[i1].y + dmy); - } - else if (join == ART_PATH_STROKE_JOIN_ROUND) { - art_svp_vpath_stroke_arc (p_rev, pn_rev, pn_rev_max, - vpath[i1].x, vpath[i1].y, - dlx0, dly0, - dlx1, dly1, - -line_width, - flatness); - } - - } -} - -/* caps i1, under the assumption of a vector from i0 */ -static void -render_cap (ArtVpath **p_result, int *pn_result, int *pn_result_max, - ArtVpath *vpath, int i0, int i1, - ArtPathStrokeCapType cap, double line_width, double flatness) -{ - double dx0, dy0; - double dlx0, dly0; - double scale; - int n_pts; - int i; - - dx0 = vpath[i1].x - vpath[i0].x; - dy0 = vpath[i1].y - vpath[i0].y; - - /* Set dl[xy]0 to the vector from i0 to i1, rotated counterclockwise - 90 degrees, and scaled to the length of line_width. */ - scale = line_width / sqrt (dx0 * dx0 + dy0 * dy0); - dlx0 = dy0 * scale; - dly0 = -dx0 * scale; - -#ifdef VERBOSE - printf ("cap style = %d\n", cap); -#endif - - switch (cap) - { - case ART_PATH_STROKE_CAP_BUTT: - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, vpath[i1].x - dlx0, vpath[i1].y - dly0); - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, vpath[i1].x + dlx0, vpath[i1].y + dly0); - break; - case ART_PATH_STROKE_CAP_ROUND: - n_pts = ceil (M_PI / (2.0 * M_SQRT2 * sqrt (flatness / line_width))); - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, vpath[i1].x - dlx0, vpath[i1].y - dly0); - for (i = 1; i < n_pts; i++) - { - double theta, c_th, s_th; - - theta = M_PI * i / n_pts; - c_th = cos (theta); - s_th = sin (theta); - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, - vpath[i1].x - dlx0 * c_th - dly0 * s_th, - vpath[i1].y - dly0 * c_th + dlx0 * s_th); - } - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, vpath[i1].x + dlx0, vpath[i1].y + dly0); - break; - case ART_PATH_STROKE_CAP_SQUARE: - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, - vpath[i1].x - dlx0 - dly0, - vpath[i1].y - dly0 + dlx0); - art_vpath_add_point (p_result, pn_result, pn_result_max, - ART_LINETO, - vpath[i1].x + dlx0 - dly0, - vpath[i1].y + dly0 + dlx0); - break; - } -} - -/** - * art_svp_from_vpath_raw: Stroke a vector path, raw version - * @vpath: #ArtVPath to stroke. - * @join: Join style. - * @cap: Cap style. - * @line_width: Width of stroke. - * @miter_limit: Miter limit. - * @flatness: Flatness. - * - * Exactly the same as art_svp_vpath_stroke(), except that the resulting - * stroke outline may self-intersect and have regions of winding number - * greater than 1. - * - * Return value: Resulting raw stroked outline in svp format. - **/ -ArtVpath * -art_svp_vpath_stroke_raw (ArtVpath *vpath, - ArtPathStrokeJoinType join, - ArtPathStrokeCapType cap, - double line_width, - double miter_limit, - double flatness) -{ - int begin_idx, end_idx; - int i; - ArtVpath *forw, *rev; - int n_forw, n_rev; - int n_forw_max, n_rev_max; - ArtVpath *result; - int n_result, n_result_max; - double half_lw = 0.5 * line_width; - int closed; - int last, xthis, next, second; - double dx, dy; - - n_forw_max = 16; - forw = art_new (ArtVpath, n_forw_max); - - n_rev_max = 16; - rev = art_new (ArtVpath, n_rev_max); - - n_result = 0; - n_result_max = 16; - result = art_new (ArtVpath, n_result_max); - - for (begin_idx = 0; vpath[begin_idx].code != ART_END; begin_idx = end_idx) - { - n_forw = 0; - n_rev = 0; - - closed = (vpath[begin_idx].code == ART_MOVETO); - - /* we don't know what the first point joins with until we get to the - last point and see if it's closed. So we start with the second - line in the path. - - Note: this is not strictly true (we now know it's closed from - the opening pathcode), but why fix code that isn't broken? - */ - - xthis = begin_idx; - /* skip over identical points at the beginning of the subpath */ - for (i = xthis + 1; vpath[i].code == ART_LINETO; i++) - { - dx = vpath[i].x - vpath[xthis].x; - dy = vpath[i].y - vpath[xthis].y; - if (dx * dx + dy * dy > EPSILON_2) - break; - } - next = i; - second = next; - - /* invariant: this doesn't coincide with next */ - while (vpath[next].code == ART_LINETO) - { - last = xthis; - xthis = next; - /* skip over identical points after the beginning of the subpath */ - for (i = xthis + 1; vpath[i].code == ART_LINETO; i++) - { - dx = vpath[i].x - vpath[xthis].x; - dy = vpath[i].y - vpath[xthis].y; - if (dx * dx + dy * dy > EPSILON_2) - break; - } - next = i; - if (vpath[next].code != ART_LINETO) - { - /* reached end of path */ - /* make "closed" detection conform to PostScript - semantics (i.e. explicit closepath code rather than - just the fact that end of the path is the beginning) */ - if (closed && - vpath[xthis].x == vpath[begin_idx].x && - vpath[xthis].y == vpath[begin_idx].y) - { - int j; - - /* path is closed, render join to beginning */ - render_seg (&forw, &n_forw, &n_forw_max, - &rev, &n_rev, &n_rev_max, - vpath, last, xthis, second, - join, half_lw, miter_limit, flatness); - -#ifdef VERBOSE - printf ("%% forw %d, rev %d\n", n_forw, n_rev); -#endif - /* do forward path */ - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_MOVETO, forw[n_forw - 1].x, - forw[n_forw - 1].y); - for (j = 0; j < n_forw; j++) - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_LINETO, forw[j].x, - forw[j].y); - - /* do reverse path, reversed */ - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_MOVETO, rev[0].x, - rev[0].y); - for (j = n_rev - 1; j >= 0; j--) - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_LINETO, rev[j].x, - rev[j].y); - } - else - { - /* path is open */ - int j; - - /* add to forw rather than result to ensure that - forw has at least one point. */ - render_cap (&forw, &n_forw, &n_forw_max, - vpath, last, xthis, - cap, half_lw, flatness); - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_MOVETO, forw[0].x, - forw[0].y); - for (j = 1; j < n_forw; j++) - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_LINETO, forw[j].x, - forw[j].y); - for (j = n_rev - 1; j >= 0; j--) - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_LINETO, rev[j].x, - rev[j].y); - render_cap (&result, &n_result, &n_result_max, - vpath, second, begin_idx, - cap, half_lw, flatness); - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_LINETO, forw[0].x, - forw[0].y); - } - } - else - render_seg (&forw, &n_forw, &n_forw_max, - &rev, &n_rev, &n_rev_max, - vpath, last, xthis, next, - join, half_lw, miter_limit, flatness); - } - end_idx = next; - } - - art_free (forw); - art_free (rev); -#ifdef VERBOSE - printf ("%% n_result = %d\n", n_result); -#endif - art_vpath_add_point (&result, &n_result, &n_result_max, ART_END, 0, 0); - return result; -} - -#define noVERBOSE - -#ifdef VERBOSE - -#define XOFF 50 -#define YOFF 700 - -static void -print_ps_vpath (ArtVpath *vpath) -{ - int i; - - for (i = 0; vpath[i].code != ART_END; i++) - { - switch (vpath[i].code) - { - case ART_MOVETO: - printf ("%g %g moveto\n", XOFF + vpath[i].x, YOFF - vpath[i].y); - break; - case ART_LINETO: - printf ("%g %g lineto\n", XOFF + vpath[i].x, YOFF - vpath[i].y); - break; - default: - break; - } - } - printf ("stroke showpage\n"); -} - -static void -print_ps_svp (ArtSVP *vpath) -{ - int i, j; - - printf ("%% begin\n"); - for (i = 0; i < vpath->n_segs; i++) - { - printf ("%g setgray\n", vpath->segs[i].dir ? 0.7 : 0); - for (j = 0; j < vpath->segs[i].n_points; j++) - { - printf ("%g %g %s\n", - XOFF + vpath->segs[i].points[j].x, - YOFF - vpath->segs[i].points[j].y, - j ? "lineto" : "moveto"); - } - printf ("stroke\n"); - } - - printf ("showpage\n"); -} -#endif - -/* Render a vector path into a stroked outline. - - Status of this routine: - - Basic correctness: Only miter and bevel line joins are implemented, - and only butt line caps. Otherwise, seems to be fine. - - Numerical stability: We cheat (adding random perturbation). Thus, - it seems very likely that no numerical stability problems will be - seen in practice. - - Speed: Should be pretty good. - - Precision: The perturbation fuzzes the coordinates slightly, - but not enough to be visible. */ -/** - * art_svp_vpath_stroke: Stroke a vector path. - * @vpath: #ArtVPath to stroke. - * @join: Join style. - * @cap: Cap style. - * @line_width: Width of stroke. - * @miter_limit: Miter limit. - * @flatness: Flatness. - * - * Computes an svp representing the stroked outline of @vpath. The - * width of the stroked line is @line_width. - * - * Lines are joined according to the @join rule. Possible values are - * ART_PATH_STROKE_JOIN_MITER (for mitered joins), - * ART_PATH_STROKE_JOIN_ROUND (for round joins), and - * ART_PATH_STROKE_JOIN_BEVEL (for bevelled joins). The mitered join - * is converted to a bevelled join if the miter would extend to a - * distance of more than @miter_limit * @line_width from the actual - * join point. - * - * If there are open subpaths, the ends of these subpaths are capped - * according to the @cap rule. Possible values are - * ART_PATH_STROKE_CAP_BUTT (squared cap, extends exactly to end - * point), ART_PATH_STROKE_CAP_ROUND (rounded half-circle centered at - * the end point), and ART_PATH_STROKE_CAP_SQUARE (squared cap, - * extending half @line_width past the end point). - * - * The @flatness parameter controls the accuracy of the rendering. It - * is most important for determining the number of points to use to - * approximate circular arcs for round lines and joins. In general, the - * resulting vector path will be within @flatness pixels of the "ideal" - * path containing actual circular arcs. I reserve the right to use - * the @flatness parameter to convert bevelled joins to miters for very - * small turn angles, as this would reduce the number of points in the - * resulting outline path. - * - * The resulting path is "clean" with respect to self-intersections, i.e. - * the winding number is 0 or 1 at each point. - * - * Return value: Resulting stroked outline in svp format. - **/ -ArtSVP * -art_svp_vpath_stroke (ArtVpath *vpath, - ArtPathStrokeJoinType join, - ArtPathStrokeCapType cap, - double line_width, - double miter_limit, - double flatness) -{ -#ifdef ART_USE_NEW_INTERSECTOR - ArtVpath *vpath_stroke; - ArtSVP *svp, *svp2; - ArtSvpWriter *swr; - - vpath_stroke = art_svp_vpath_stroke_raw (vpath, join, cap, - line_width, miter_limit, flatness); -#ifdef VERBOSE - //print_ps_vpath (vpath_stroke); -#endif - svp = art_svp_from_vpath (vpath_stroke); -#ifdef VERBOSE - //print_ps_svp (svp); -#endif - art_free (vpath_stroke); - - swr = art_svp_writer_rewind_new (ART_WIND_RULE_NONZERO); - art_svp_intersector (svp, swr); - - svp2 = art_svp_writer_rewind_reap (swr); -#ifdef VERBOSE - //print_ps_svp (svp2); -#endif - art_svp_free (svp); - return svp2; -#else - ArtVpath *vpath_stroke, *vpath2; - ArtSVP *svp, *svp2, *svp3; - - vpath_stroke = art_svp_vpath_stroke_raw (vpath, join, cap, - line_width, miter_limit, flatness); -#ifdef VERBOSE - //print_ps_vpath (vpath_stroke); -#endif - vpath2 = art_vpath_perturb (vpath_stroke); -#ifdef VERBOSE - //print_ps_vpath (vpath2); -#endif - art_free (vpath_stroke); - svp = art_svp_from_vpath (vpath2); -#ifdef VERBOSE - //print_ps_svp (svp); -#endif - art_free (vpath2); - svp2 = art_svp_uncross (svp); -#ifdef VERBOSE - //print_ps_svp (svp2); -#endif - art_svp_free (svp); - svp3 = art_svp_rewind_uncrossed (svp2, ART_WIND_RULE_NONZERO); -#ifdef VERBOSE - //print_ps_svp (svp3); -#endif - art_svp_free (svp2); - - return svp3; -#endif -} diff -Nru swftools-0.9.0/lib/art/art_svp_vpath_stroke.h swftools-0.9.2/lib/art/art_svp_vpath_stroke.h --- swftools-0.9.0/lib/art/art_svp_vpath_stroke.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_vpath_stroke.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_VPATH_STROKE_H__ -#define __ART_SVP_VPATH_STROKE_H__ - -/* Sort vector paths into sorted vector paths. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#include "art_vpath.h" -#else -#include "art_svp.h" -#include "art_vpath.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef enum { - ART_PATH_STROKE_JOIN_MITER, - ART_PATH_STROKE_JOIN_ROUND, - ART_PATH_STROKE_JOIN_BEVEL -} ArtPathStrokeJoinType; - -typedef enum { - ART_PATH_STROKE_CAP_BUTT, - ART_PATH_STROKE_CAP_ROUND, - ART_PATH_STROKE_CAP_SQUARE -} ArtPathStrokeCapType; - -ArtSVP * -art_svp_vpath_stroke (ArtVpath *vpath, - ArtPathStrokeJoinType join, - ArtPathStrokeCapType cap, - double line_width, - double miter_limit, - double flatness); - -/* This version may have winding numbers exceeding 1. */ -ArtVpath * -art_svp_vpath_stroke_raw (ArtVpath *vpath, - ArtPathStrokeJoinType join, - ArtPathStrokeCapType cap, - double line_width, - double miter_limit, - double flatness); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_VPATH_STROKE_H__ */ diff -Nru swftools-0.9.0/lib/art/art_svp_wind.c swftools-0.9.2/lib/art/art_svp_wind.c --- swftools-0.9.0/lib/art/art_svp_wind.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_wind.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1545 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Primitive intersection and winding number operations on sorted - vector paths. - - These routines are internal to libart, used to construct operations - like intersection, union, and difference. */ - -#include "config.h" -#include "art_svp_wind.h" - -#include /* for printf of debugging info */ -#include /* for memcpy */ -#include -#include "art_misc.h" - -#include "art_rect.h" -#include "art_svp.h" - -#define noVERBOSE - -#define PT_EQ(p1,p2) ((p1).x == (p2).x && (p1).y == (p2).y) - -#define PT_CLOSE(p1,p2) (fabs ((p1).x - (p2).x) < 1e-6 && fabs ((p1).y - (p2).y) < 1e-6) - -/* return nonzero and set *p to the intersection point if the lines - z0-z1 and z2-z3 intersect each other. */ -static int -intersect_lines (ArtPoint z0, ArtPoint z1, ArtPoint z2, ArtPoint z3, - ArtPoint *p) -{ - double a01, b01, c01; - double a23, b23, c23; - double d0, d1, d2, d3; - double det; - - /* if the vectors share an endpoint, they don't intersect */ - if (PT_EQ (z0, z2) || PT_EQ (z0, z3) || PT_EQ (z1, z2) || PT_EQ (z1, z3)) - return 0; - -#if 0 - if (PT_CLOSE (z0, z2) || PT_CLOSE (z0, z3) || PT_CLOSE (z1, z2) || PT_CLOSE (z1, z3)) - return 0; -#endif - - /* find line equations ax + by + c = 0 */ - a01 = z0.y - z1.y; - b01 = z1.x - z0.x; - c01 = -(z0.x * a01 + z0.y * b01); - /* = -((z0.y - z1.y) * z0.x + (z1.x - z0.x) * z0.y) - = (z1.x * z0.y - z1.y * z0.x) */ - - d2 = a01 * z2.x + b01 * z2.y + c01; - d3 = a01 * z3.x + b01 * z3.y + c01; - if ((d2 > 0) == (d3 > 0)) - return 0; - - a23 = z2.y - z3.y; - b23 = z3.x - z2.x; - c23 = -(z2.x * a23 + z2.y * b23); - - d0 = a23 * z0.x + b23 * z0.y + c23; - d1 = a23 * z1.x + b23 * z1.y + c23; - if ((d0 > 0) == (d1 > 0)) - return 0; - - /* now we definitely know that the lines intersect */ - /* solve the two linear equations ax + by + c = 0 */ - det = 1.0 / (a01 * b23 - a23 * b01); - p->x = det * (c23 * b01 - c01 * b23); - p->y = det * (c01 * a23 - c23 * a01); - - return 1; -} - -#define EPSILON 1e-6 - -static double -trap_epsilon (double v) -{ - const double epsilon = EPSILON; - - if (v < epsilon && v > -epsilon) return 0; - else return v; -} - -/* Determine the order of line segments z0-z1 and z2-z3. - Return +1 if z2-z3 lies entirely to the right of z0-z1, - -1 if entirely to the left, - or 0 if overlap. - - The case analysis in this function is quite ugly. The fact that it's - almost 200 lines long is ridiculous. - - Ok, so here's the plan to cut it down: - - First, do a bounding line comparison on the x coordinates. This is pretty - much the common case, and should go quickly. It also takes care of the - case where both lines are horizontal. - - Then, do d0 and d1 computation, but only if a23 is nonzero. - - Finally, do d2 and d3 computation, but only if a01 is nonzero. - - Fall through to returning 0 (this will happen when both lines are - horizontal and they overlap). - */ -static int -x_order (ArtPoint z0, ArtPoint z1, ArtPoint z2, ArtPoint z3) -{ - double a01, b01, c01; - double a23, b23, c23; - double d0, d1, d2, d3; - - if (z0.y == z1.y) - { - if (z2.y == z3.y) - { - double x01min, x01max; - double x23min, x23max; - - if (z0.x > z1.x) - { - x01min = z1.x; - x01max = z0.x; - } - else - { - x01min = z0.x; - x01max = z1.x; - } - - if (z2.x > z3.x) - { - x23min = z3.x; - x23max = z2.x; - } - else - { - x23min = z2.x; - x23max = z3.x; - } - - if (x23min >= x01max) return 1; - else if (x01min >= x23max) return -1; - else return 0; - } - else - { - /* z0-z1 is horizontal, z2-z3 isn't */ - a23 = z2.y - z3.y; - b23 = z3.x - z2.x; - c23 = -(z2.x * a23 + z2.y * b23); - - if (z3.y < z2.y) - { - a23 = -a23; - b23 = -b23; - c23 = -c23; - } - - d0 = trap_epsilon (a23 * z0.x + b23 * z0.y + c23); - d1 = trap_epsilon (a23 * z1.x + b23 * z1.y + c23); - - if (d0 > 0) - { - if (d1 >= 0) return 1; - else return 0; - } - else if (d0 == 0) - { - if (d1 > 0) return 1; - else if (d1 < 0) return -1; - else /*printf ("case 1 degenerate\n")*/; - return 0; - } - else /* d0 < 0 */ - { - if (d1 <= 0) return -1; - else return 0; - } - } - } - else if (z2.y == z3.y) - { - /* z2-z3 is horizontal, z0-z1 isn't */ - a01 = z0.y - z1.y; - b01 = z1.x - z0.x; - c01 = -(z0.x * a01 + z0.y * b01); - /* = -((z0.y - z1.y) * z0.x + (z1.x - z0.x) * z0.y) - = (z1.x * z0.y - z1.y * z0.x) */ - - if (z1.y < z0.y) - { - a01 = -a01; - b01 = -b01; - c01 = -c01; - } - - d2 = trap_epsilon (a01 * z2.x + b01 * z2.y + c01); - d3 = trap_epsilon (a01 * z3.x + b01 * z3.y + c01); - - if (d2 > 0) - { - if (d3 >= 0) return -1; - else return 0; - } - else if (d2 == 0) - { - if (d3 > 0) return -1; - else if (d3 < 0) return 1; - else printf ("case 2 degenerate\n"); - return 0; - } - else /* d2 < 0 */ - { - if (d3 <= 0) return 1; - else return 0; - } - } - - /* find line equations ax + by + c = 0 */ - a01 = z0.y - z1.y; - b01 = z1.x - z0.x; - c01 = -(z0.x * a01 + z0.y * b01); - /* = -((z0.y - z1.y) * z0.x + (z1.x - z0.x) * z0.y) - = -(z1.x * z0.y - z1.y * z0.x) */ - - if (a01 > 0) - { - a01 = -a01; - b01 = -b01; - c01 = -c01; - } - /* so now, (a01, b01) points to the left, thus a01 * x + b01 * y + c01 - is negative if the point lies to the right of the line */ - - d2 = trap_epsilon (a01 * z2.x + b01 * z2.y + c01); - d3 = trap_epsilon (a01 * z3.x + b01 * z3.y + c01); - if (d2 > 0) - { - if (d3 >= 0) return -1; - } - else if (d2 == 0) - { - if (d3 > 0) return -1; - else if (d3 < 0) return 1; - else - /*fprintf (stderr, "colinear!\n")*/; - } - else /* d2 < 0 */ - { - if (d3 <= 0) return 1; - } - - a23 = z2.y - z3.y; - b23 = z3.x - z2.x; - c23 = -(z2.x * a23 + z2.y * b23); - - if (a23 > 0) - { - a23 = -a23; - b23 = -b23; - c23 = -c23; - } - d0 = trap_epsilon (a23 * z0.x + b23 * z0.y + c23); - d1 = trap_epsilon (a23 * z1.x + b23 * z1.y + c23); - if (d0 > 0) - { - if (d1 >= 0) return 1; - } - else if (d0 == 0) - { - if (d1 > 0) return 1; - else if (d1 < 0) return -1; - else - /*fprintf (stderr, "colinear!\n")*/; - } - else /* d0 < 0 */ - { - if (d1 <= 0) return -1; - } - - return 0; -} - -/* similar to x_order, but to determine whether point z0 + epsilon lies to - the left of the line z2-z3 or to the right */ -static int -x_order_2 (ArtPoint z0, ArtPoint z1, ArtPoint z2, ArtPoint z3) -{ - double a23, b23, c23; - double d0, d1; - - a23 = z2.y - z3.y; - b23 = z3.x - z2.x; - c23 = -(z2.x * a23 + z2.y * b23); - - if (a23 > 0) - { - a23 = -a23; - b23 = -b23; - c23 = -c23; - } - - d0 = a23 * z0.x + b23 * z0.y + c23; - - if (d0 > EPSILON) - return -1; - else if (d0 < -EPSILON) - return 1; - - d1 = a23 * z1.x + b23 * z1.y + c23; - if (d1 > EPSILON) - return -1; - else if (d1 < -EPSILON) - return 1; - - if (z0.x == z1.x && z1.x == z2.x && z2.x == z3.x) - { - //art_dprint ("x_order_2: colinear and horizontally aligned!\n"); - return 0; - } - - if (z0.x <= z2.x && z1.x <= z2.x && z0.x <= z3.x && z1.x <= z3.x) - return -1; - if (z0.x >= z2.x && z1.x >= z2.x && z0.x >= z3.x && z1.x >= z3.x) - return 1; - - //fprintf (stderr, "x_order_2: colinear!\n"); - return 0; -} - -#ifdef DEAD_CODE -/* Traverse the vector path, keeping it in x-sorted order. - - This routine doesn't actually do anything - it's just here for - explanatory purposes. */ -void -traverse (ArtSVP *vp) -{ - int *active_segs; - int n_active_segs; - int *cursor; - int seg_idx; - double y; - int tmp1, tmp2; - int asi; - int i, j; - - active_segs = art_new (int, vp->n_segs); - cursor = art_new (int, vp->n_segs); - - n_active_segs = 0; - seg_idx = 0; - y = vp->segs[0].points[0].y; - while (seg_idx < vp->n_segs || n_active_segs > 0) - { - printf ("y = %g\n", y); - /* delete segments ending at y from active list */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (vp->segs[asi].n_points - 1 == cursor[asi] && - vp->segs[asi].points[cursor[asi]].y == y) - { - printf ("deleting %d\n", asi); - n_active_segs--; - for (j = i; j < n_active_segs; j++) - active_segs[j] = active_segs[j + 1]; - i--; - } - } - - /* insert new segments into the active list */ - while (seg_idx < vp->n_segs && y == vp->segs[seg_idx].points[0].y) - { - cursor[seg_idx] = 0; - printf ("inserting %d\n", seg_idx); - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (x_order (vp->segs[asi].points[cursor[asi]], - vp->segs[asi].points[cursor[asi] + 1], - vp->segs[seg_idx].points[0], - vp->segs[seg_idx].points[1]) == -1) - break; - } - tmp1 = seg_idx; - for (j = i; j < n_active_segs; j++) - { - tmp2 = active_segs[j]; - active_segs[j] = tmp1; - tmp1 = tmp2; - } - active_segs[n_active_segs] = tmp1; - n_active_segs++; - seg_idx++; - } - - /* all active segs cross the y scanline (considering segs to be - closed on top and open on bottom) */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - printf ("%d (%g, %g) - (%g, %g) %s\n", asi, - vp->segs[asi].points[cursor[asi]].x, - vp->segs[asi].points[cursor[asi]].y, - vp->segs[asi].points[cursor[asi] + 1].x, - vp->segs[asi].points[cursor[asi] + 1].y, - vp->segs[asi].dir ? "v" : "^"); - } - - /* advance y to the next event */ - if (n_active_segs == 0) - { - if (seg_idx < vp->n_segs) - y = vp->segs[seg_idx].points[0].y; - /* else we're done */ - } - else - { - asi = active_segs[0]; - y = vp->segs[asi].points[cursor[asi] + 1].y; - for (i = 1; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (y > vp->segs[asi].points[cursor[asi] + 1].y) - y = vp->segs[asi].points[cursor[asi] + 1].y; - } - if (seg_idx < vp->n_segs && y > vp->segs[seg_idx].points[0].y) - y = vp->segs[seg_idx].points[0].y; - } - - /* advance cursors to reach new y */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - while (cursor[asi] < vp->segs[asi].n_points - 1 && - y >= vp->segs[asi].points[cursor[asi] + 1].y) - cursor[asi]++; - } - printf ("\n"); - } - art_free (cursor); - art_free (active_segs); -} -#endif - -/* I believe that the loop will always break with i=1. - - I think I'll want to change this from a simple sorted list to a - modified stack. ips[*][0] will get its own data structure, and - ips[*] will in general only be allocated if there is an intersection. - Finally, the segment can be traced through the initial point - (formerly ips[*][0]), backwards through the stack, and finally - to cursor + 1. - - This change should cut down on allocation bandwidth, and also - eliminate the iteration through n_ipl below. - -*/ -static void -insert_ip (int seg_i, int *n_ips, int *n_ips_max, ArtPoint **ips, ArtPoint ip) -{ - int i; - ArtPoint tmp1, tmp2; - int n_ipl; - ArtPoint *ipl; - - n_ipl = n_ips[seg_i]++; - if (n_ipl == n_ips_max[seg_i]) - art_expand (ips[seg_i], ArtPoint, n_ips_max[seg_i]); - ipl = ips[seg_i]; - for (i = 1; i < n_ipl; i++) - if (ipl[i].y > ip.y) - break; - tmp1 = ip; - for (; i <= n_ipl; i++) - { - tmp2 = ipl[i]; - ipl[i] = tmp1; - tmp1 = tmp2; - } -} - -/* test active segment (i - 1) against i for intersection, if - so, add intersection point to both ips lists. */ -static void -intersect_neighbors (int i, int *active_segs, - int *n_ips, int *n_ips_max, ArtPoint **ips, - int *cursor, ArtSVP *vp) -{ - ArtPoint z0, z1, z2, z3; - int asi01, asi23; - ArtPoint ip; - - asi01 = active_segs[i - 1]; - - z0 = ips[asi01][0]; - if (n_ips[asi01] == 1) - z1 = vp->segs[asi01].points[cursor[asi01] + 1]; - else - z1 = ips[asi01][1]; - - asi23 = active_segs[i]; - - z2 = ips[asi23][0]; - if (n_ips[asi23] == 1) - z3 = vp->segs[asi23].points[cursor[asi23] + 1]; - else - z3 = ips[asi23][1]; - - if (intersect_lines (z0, z1, z2, z3, &ip)) - { -#ifdef VERBOSE - printf ("new intersection point: (%g, %g)\n", ip.x, ip.y); -#endif - insert_ip (asi01, n_ips, n_ips_max, ips, ip); - insert_ip (asi23, n_ips, n_ips_max, ips, ip); - } -} - -/* Add a new point to a segment in the svp. - - Here, we also check to make sure that the segments satisfy nocross. - However, this is only valuable for debugging, and could possibly be - removed. -*/ -static void -svp_add_point (ArtSVP *svp, int *n_points_max, - ArtPoint p, int *seg_map, int *active_segs, int n_active_segs, - int i) -{ - int asi, asi_left, asi_right; - int n_points, n_points_left, n_points_right; - ArtSVPSeg *seg; - - asi = seg_map[active_segs[i]]; - seg = &svp->segs[asi]; - n_points = seg->n_points; - /* find out whether neighboring segments share a point */ - if (i > 0) - { - asi_left = seg_map[active_segs[i - 1]]; - n_points_left = svp->segs[asi_left].n_points; - if (n_points_left > 1 && - PT_EQ (svp->segs[asi_left].points[n_points_left - 2], - svp->segs[asi].points[n_points - 1])) - { - /* ok, new vector shares a top point with segment to the left - - now, check that it satisfies ordering invariant */ - if (x_order (svp->segs[asi_left].points[n_points_left - 2], - svp->segs[asi_left].points[n_points_left - 1], - svp->segs[asi].points[n_points - 1], - p) < 1) - - { -#ifdef VERBOSE - printf ("svp_add_point: cross on left!\n"); -#endif - } - } - } - - if (i + 1 < n_active_segs) - { - asi_right = seg_map[active_segs[i + 1]]; - n_points_right = svp->segs[asi_right].n_points; - if (n_points_right > 1 && - PT_EQ (svp->segs[asi_right].points[n_points_right - 2], - svp->segs[asi].points[n_points - 1])) - { - /* ok, new vector shares a top point with segment to the right - - now, check that it satisfies ordering invariant */ - if (x_order (svp->segs[asi_right].points[n_points_right - 2], - svp->segs[asi_right].points[n_points_right - 1], - svp->segs[asi].points[n_points - 1], - p) > -1) - { -#ifdef VERBOSE - printf ("svp_add_point: cross on right!\n"); -#endif - } - } - } - if (n_points_max[asi] == n_points) - art_expand (seg->points, ArtPoint, n_points_max[asi]); - seg->points[n_points] = p; - if (p.x < seg->bbox.x0) - seg->bbox.x0 = p.x; - else if (p.x > seg->bbox.x1) - seg->bbox.x1 = p.x; - seg->bbox.y1 = p.y; - seg->n_points++; -} - -#if 0 -/* find where the segment (currently at i) is supposed to go, and return - the target index - if equal to i, then there is no crossing problem. - - "Where it is supposed to go" is defined as following: - - Delete element i, re-insert at position target (bumping everything - target and greater to the right). - */ -static int -find_crossing (int i, int *active_segs, int n_active_segs, - int *cursor, ArtPoint **ips, int *n_ips, ArtSVP *vp) -{ - int asi, asi_left, asi_right; - ArtPoint p0, p1; - ArtPoint p0l, p1l; - ArtPoint p0r, p1r; - int target; - - asi = active_segs[i]; - p0 = ips[asi][0]; - if (n_ips[asi] == 1) - p1 = vp->segs[asi].points[cursor[asi] + 1]; - else - p1 = ips[asi][1]; - - for (target = i; target > 0; target--) - { - asi_left = active_segs[target - 1]; - p0l = ips[asi_left][0]; - if (n_ips[asi_left] == 1) - p1l = vp->segs[asi_left].points[cursor[asi_left] + 1]; - else - p1l = ips[asi_left][1]; - if (!PT_EQ (p0, p0l)) - break; - -#ifdef VERBOSE - printf ("point matches on left (%g, %g) - (%g, %g) x (%g, %g) - (%g, %g)!\n", - p0l.x, p0l.y, p1l.x, p1l.y, p0.x, p0.y, p1.x, p1.y); -#endif - if (x_order (p0l, p1l, p0, p1) == 1) - break; - -#ifdef VERBOSE - printf ("scanning to the left (i=%d, target=%d)\n", i, target); -#endif - } - - if (target < i) return target; - - for (; target < n_active_segs - 1; target++) - { - asi_right = active_segs[target + 1]; - p0r = ips[asi_right][0]; - if (n_ips[asi_right] == 1) - p1r = vp->segs[asi_right].points[cursor[asi_right] + 1]; - else - p1r = ips[asi_right][1]; - if (!PT_EQ (p0, p0r)) - break; - -#ifdef VERBOSE - printf ("point matches on left (%g, %g) - (%g, %g) x (%g, %g) - (%g, %g)!\n", - p0.x, p0.y, p1.x, p1.y, p0r.x, p0r.y, p1r.x, p1r.y); -#endif - if (x_order (p0r, p1r, p0, p1) == 1) - break; - -#ifdef VERBOSE - printf ("scanning to the right (i=%d, target=%d)\n", i, target); -#endif - } - - return target; -} -#endif - -/* This routine handles the case where the segment changes its position - in the active segment list. Generally, this will happen when the - segment (defined by i and cursor) shares a top point with a neighbor, - but breaks the ordering invariant. - - Essentially, this routine sorts the lines [start..end), all of which - share a top point. This is implemented as your basic insertion sort. - - This routine takes care of intersecting the appropriate neighbors, - as well. - - A first argument of -1 immediately returns, which helps reduce special - casing in the main unwind routine. -*/ -static void -fix_crossing (int start, int end, int *active_segs, int n_active_segs, - int *cursor, ArtPoint **ips, int *n_ips, int *n_ips_max, - ArtSVP *vp, int *seg_map, - ArtSVP **p_new_vp, int *pn_segs_max, - int **pn_points_max) -{ - int i, j; - int target; - int asi, asj; - ArtPoint p0i, p1i; - ArtPoint p0j, p1j; - int swap = 0; -#ifdef VERBOSE - int k; -#endif - ArtPoint *pts; - -#ifdef VERBOSE - printf ("fix_crossing: [%d..%d)", start, end); - for (k = 0; k < n_active_segs; k++) - printf (" %d", active_segs[k]); - printf ("\n"); -#endif - - if (start == -1) - return; - - for (i = start + 1; i < end; i++) - { - - asi = active_segs[i]; - if (cursor[asi] < vp->segs[asi].n_points - 1) { - p0i = ips[asi][0]; - if (n_ips[asi] == 1) - p1i = vp->segs[asi].points[cursor[asi] + 1]; - else - p1i = ips[asi][1]; - - for (j = i - 1; j >= start; j--) - { - asj = active_segs[j]; - if (cursor[asj] < vp->segs[asj].n_points - 1) - { - p0j = ips[asj][0]; - if (n_ips[asj] == 1) - p1j = vp->segs[asj].points[cursor[asj] + 1]; - else - p1j = ips[asj][1]; - - /* we _hope_ p0i = p0j */ - if (x_order_2 (p0j, p1j, p0i, p1i) == -1) - break; - } - } - - target = j + 1; - /* target is where active_seg[i] _should_ be in active_segs */ - - if (target != i) - { - swap = 1; - -#ifdef VERBOSE - printf ("fix_crossing: at %i should be %i\n", i, target); -#endif - - /* let's close off all relevant segments */ - for (j = i; j >= target; j--) - { - asi = active_segs[j]; - /* First conjunct: this isn't the last point in the original - segment. - - Second conjunct: this isn't the first point in the new - segment (i.e. already broken). - */ - if (cursor[asi] < vp->segs[asi].n_points - 1 && - (*p_new_vp)->segs[seg_map[asi]].n_points != 1) - { - int seg_num; - /* so break here */ -#ifdef VERBOSE - printf ("closing off %d\n", j); -#endif - - pts = art_new (ArtPoint, 16); - pts[0] = ips[asi][0]; - seg_num = art_svp_add_segment (p_new_vp, pn_segs_max, - pn_points_max, - 1, vp->segs[asi].dir, - pts, - NULL); - (*pn_points_max)[seg_num] = 16; - seg_map[asi] = seg_num; - } - } - - /* now fix the ordering in active_segs */ - asi = active_segs[i]; - for (j = i; j > target; j--) - active_segs[j] = active_segs[j - 1]; - active_segs[j] = asi; - } - } - } - if (swap && start > 0) - { - int as_start; - - as_start = active_segs[start]; - if (cursor[as_start] < vp->segs[as_start].n_points) - { -#ifdef VERBOSE - printf ("checking intersection of %d, %d\n", start - 1, start); -#endif - intersect_neighbors (start, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - } - } - - if (swap && end < n_active_segs) - { - int as_end; - - as_end = active_segs[end - 1]; - if (cursor[as_end] < vp->segs[as_end].n_points) - { -#ifdef VERBOSE - printf ("checking intersection of %d, %d\n", end - 1, end); -#endif - intersect_neighbors (end, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - } - } - if (swap) - { -#ifdef VERBOSE - printf ("fix_crossing return: [%d..%d)", start, end); - for (k = 0; k < n_active_segs; k++) - printf (" %d", active_segs[k]); - printf ("\n"); -#endif - } -} - -/* Return a new sorted vector that covers the same area as the - argument, but which satisfies the nocross invariant. - - Basically, this routine works by finding the intersection points, - and cutting the segments at those points. - - Status of this routine: - - Basic correctness: Seems ok. - - Numerical stability: known problems in the case of points falling - on lines, and colinear lines. For actual use, randomly perturbing - the vertices is currently recommended. - - Speed: pretty good, although a more efficient priority queue, as - well as bbox culling of potential intersections, are two - optimizations that could help. - - Precision: pretty good, although the numerical stability problems - make this routine unsuitable for precise calculations of - differences. - -*/ - -/* Here is a more detailed description of the algorithm. It follows - roughly the structure of traverse (above), but is obviously quite - a bit more complex. - - Here are a few important data structures: - - A new sorted vector path (new_svp). - - For each (active) segment in the original, a list of intersection - points. - - Of course, the original being traversed. - - The following invariants hold (in addition to the invariants - of the traverse procedure). - - The new sorted vector path lies entirely above the y scan line. - - The new sorted vector path keeps the nocross invariant. - - For each active segment, the y scan line crosses the line from the - first to the second of the intersection points (where the second - point is cursor + 1 if there is only one intersection point). - - The list of intersection points + the (cursor + 1) point is kept - in nondecreasing y order. - - Of the active segments, none of the lines from first to second - intersection point cross the 1st ip..2nd ip line of the left or - right neighbor. (However, such a line may cross further - intersection points of the neighbors, or segments past the - immediate neighbors). - - Of the active segments, all lines from 1st ip..2nd ip are in - strictly increasing x_order (this is very similar to the invariant - of the traverse procedure, but is explicitly stated here in terms - of ips). (this basically says that nocross holds on the active - segments) - - The combination of the new sorted vector path, the path through all - the intersection points to cursor + 1, and [cursor + 1, n_points) - covers the same area as the argument. - - Another important data structure is mapping from original segment - number to new segment number. - - The algorithm is perhaps best understood as advancing the cursors - while maintaining these invariants. Here's roughly how it's done. - - When deleting segments from the active list, those segments are added - to the new sorted vector path. In addition, the neighbors may intersect - each other, so they are intersection tested (see below). - - When inserting new segments, they are intersection tested against - their neighbors. The top point of the segment becomes the first - intersection point. - - Advancing the cursor is just a bit different from the traverse - routine, as the cursor may advance through the intersection points - as well. Only when there is a single intersection point in the list - does the cursor advance in the original segment. In either case, - the new vector is intersection tested against both neighbors. It - also causes the vector over which the cursor is advancing to be - added to the new svp. - - Two steps need further clarification: - - Intersection testing: the 1st ip..2nd ip lines of the neighbors - are tested to see if they cross (using intersect_lines). If so, - then the intersection point is added to the ip list of both - segments, maintaining the invariant that the list of intersection - points is nondecreasing in y). - - Adding vector to new svp: if the new vector shares a top x - coordinate with another vector, then it is checked to see whether - it is in order. If not, then both segments are "broken," and then - restarted. Note: in the case when both segments are in the same - order, they may simply be swapped without breaking. - - For the time being, I'm going to put some of these operations into - subroutines. If it turns out to be a performance problem, I could - try to reorganize the traverse procedure so that each is only - called once, and inline them. But if it's not a performance - problem, I'll just keep it this way, because it will probably help - to make the code clearer, and I believe this code could use all the - clarity it can get. */ -/** - * art_svp_uncross: Resolve self-intersections of an svp. - * @vp: The original svp. - * - * Finds all the intersections within @vp, and constructs a new svp - * with new points added at these intersections. - * - * This routine needs to be redone from scratch with numerical robustness - * in mind. I'm working on it. - * - * Return value: The new svp. - **/ -ArtSVP * -art_svp_uncross (ArtSVP *vp) -{ - int *active_segs; - int n_active_segs; - int *cursor; - int seg_idx; - double y; - int tmp1, tmp2; - int asi; - int i, j; - /* new data structures */ - /* intersection points; invariant: *ips[i] is only allocated if - i is active */ - int *n_ips, *n_ips_max; - ArtPoint **ips; - /* new sorted vector path */ - int n_segs_max, seg_num; - ArtSVP *new_vp; - int *n_points_max; - /* mapping from argument to new segment numbers - again, only valid - if active */ - int *seg_map; - double y_curs; - ArtPoint p_curs; - int first_share; - double share_x; - ArtPoint *pts; - - n_segs_max = 16; - new_vp = (ArtSVP *)art_alloc (sizeof(ArtSVP) + - (n_segs_max - 1) * sizeof(ArtSVPSeg)); - new_vp->n_segs = 0; - - if (vp->n_segs == 0) - return new_vp; - - active_segs = art_new (int, vp->n_segs); - cursor = art_new (int, vp->n_segs); - - seg_map = art_new (int, vp->n_segs); - n_ips = art_new (int, vp->n_segs); - n_ips_max = art_new (int, vp->n_segs); - ips = art_new (ArtPoint *, vp->n_segs); - - n_points_max = art_new (int, n_segs_max); - - n_active_segs = 0; - seg_idx = 0; - y = vp->segs[0].points[0].y; - while (seg_idx < vp->n_segs || n_active_segs > 0) - { -#ifdef VERBOSE - printf ("y = %g\n", y); -#endif - - /* maybe move deletions to end of loop (to avoid so much special - casing on the end of a segment)? */ - - /* delete segments ending at y from active list */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (vp->segs[asi].n_points - 1 == cursor[asi] && - vp->segs[asi].points[cursor[asi]].y == y) - { - do - { -#ifdef VERBOSE - printf ("deleting %d\n", asi); -#endif - art_free (ips[asi]); - n_active_segs--; - for (j = i; j < n_active_segs; j++) - active_segs[j] = active_segs[j + 1]; - if (i < n_active_segs) - asi = active_segs[i]; - else - break; - } - while (vp->segs[asi].n_points - 1 == cursor[asi] && - vp->segs[asi].points[cursor[asi]].y == y); - - /* test intersection of neighbors */ - if (i > 0 && i < n_active_segs) - intersect_neighbors (i, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - - i--; - } - } - - /* insert new segments into the active list */ - while (seg_idx < vp->n_segs && y == vp->segs[seg_idx].points[0].y) - { -#ifdef VERBOSE - printf ("inserting %d\n", seg_idx); -#endif - cursor[seg_idx] = 0; - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (x_order_2 (vp->segs[seg_idx].points[0], - vp->segs[seg_idx].points[1], - vp->segs[asi].points[cursor[asi]], - vp->segs[asi].points[cursor[asi] + 1]) == -1) - break; - } - - /* Create and initialize the intersection points data structure */ - n_ips[seg_idx] = 1; - n_ips_max[seg_idx] = 2; - ips[seg_idx] = art_new (ArtPoint, n_ips_max[seg_idx]); - ips[seg_idx][0] = vp->segs[seg_idx].points[0]; - - /* Start a new segment in the new vector path */ - pts = art_new (ArtPoint, 16); - pts[0] = vp->segs[seg_idx].points[0]; - seg_num = art_svp_add_segment (&new_vp, &n_segs_max, - &n_points_max, - 1, vp->segs[seg_idx].dir, - pts, - NULL); - n_points_max[seg_num] = 16; - seg_map[seg_idx] = seg_num; - - tmp1 = seg_idx; - for (j = i; j < n_active_segs; j++) - { - tmp2 = active_segs[j]; - active_segs[j] = tmp1; - tmp1 = tmp2; - } - active_segs[n_active_segs] = tmp1; - n_active_segs++; - - if (i > 0) - intersect_neighbors (i, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - - if (i + 1 < n_active_segs) - intersect_neighbors (i + 1, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - - seg_idx++; - } - - /* all active segs cross the y scanline (considering segs to be - closed on top and open on bottom) */ -#ifdef VERBOSE - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - printf ("%d ", asi); - for (j = 0; j < n_ips[asi]; j++) - printf ("(%g, %g) - ", - ips[asi][j].x, - ips[asi][j].y); - printf ("(%g, %g) %s\n", - vp->segs[asi].points[cursor[asi] + 1].x, - vp->segs[asi].points[cursor[asi] + 1].y, - vp->segs[asi].dir ? "v" : "^"); - } -#endif - - /* advance y to the next event - Note: this is quadratic. We'd probably get decent constant - factor speed improvement by caching the y_curs values. */ - if (n_active_segs == 0) - { - if (seg_idx < vp->n_segs) - y = vp->segs[seg_idx].points[0].y; - /* else we're done */ - } - else - { - asi = active_segs[0]; - if (n_ips[asi] == 1) - y = vp->segs[asi].points[cursor[asi] + 1].y; - else - y = ips[asi][1].y; - for (i = 1; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (n_ips[asi] == 1) - y_curs = vp->segs[asi].points[cursor[asi] + 1].y; - else - y_curs = ips[asi][1].y; - if (y > y_curs) - y = y_curs; - } - if (seg_idx < vp->n_segs && y > vp->segs[seg_idx].points[0].y) - y = vp->segs[seg_idx].points[0].y; - } - - first_share = -1; - share_x = 0; /* to avoid gcc warning, although share_x is never - used when first_share is -1 */ - /* advance cursors to reach new y */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (n_ips[asi] == 1) - p_curs = vp->segs[asi].points[cursor[asi] + 1]; - else - p_curs = ips[asi][1]; - if (p_curs.y == y) - { - svp_add_point (new_vp, n_points_max, - p_curs, seg_map, active_segs, n_active_segs, i); - - n_ips[asi]--; - for (j = 0; j < n_ips[asi]; j++) - ips[asi][j] = ips[asi][j + 1]; - - if (n_ips[asi] == 0) - { - ips[asi][0] = p_curs; - n_ips[asi] = 1; - cursor[asi]++; - } - - if (first_share < 0 || p_curs.x != share_x) - { - /* this is where crossings are detected, and if - found, the active segments switched around. */ - - fix_crossing (first_share, i, - active_segs, n_active_segs, - cursor, ips, n_ips, n_ips_max, vp, seg_map, - &new_vp, - &n_segs_max, &n_points_max); - - first_share = i; - share_x = p_curs.x; - } - - if (cursor[asi] < vp->segs[asi].n_points - 1) - { - - if (i > 0) - intersect_neighbors (i, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - - if (i + 1 < n_active_segs) - intersect_neighbors (i + 1, active_segs, - n_ips, n_ips_max, ips, - cursor, vp); - } - } - else - { - /* not on a cursor point */ - fix_crossing (first_share, i, - active_segs, n_active_segs, - cursor, ips, n_ips, n_ips_max, vp, seg_map, - &new_vp, - &n_segs_max, &n_points_max); - first_share = -1; - } - } - - /* fix crossing on last shared group */ - fix_crossing (first_share, i, - active_segs, n_active_segs, - cursor, ips, n_ips, n_ips_max, vp, seg_map, - &new_vp, - &n_segs_max, &n_points_max); - -#ifdef VERBOSE - printf ("\n"); -#endif - } - - /* not necessary to sort, new segments only get added at y, which - increases monotonically */ -#if 0 - qsort (&new_vp->segs, new_vp->n_segs, sizeof (svp_seg), svp_seg_compare); - { - int k; - for (k = 0; k < new_vp->n_segs - 1; k++) - { - printf ("(%g, %g) - (%g, %g) %s (%g, %g) - (%g, %g)\n", - new_vp->segs[k].points[0].x, - new_vp->segs[k].points[0].y, - new_vp->segs[k].points[1].x, - new_vp->segs[k].points[1].y, - svp_seg_compare (&new_vp->segs[k], &new_vp->segs[k + 1]) > 1 ? ">": "<", - new_vp->segs[k + 1].points[0].x, - new_vp->segs[k + 1].points[0].y, - new_vp->segs[k + 1].points[1].x, - new_vp->segs[k + 1].points[1].y); - } - } -#endif - - art_free (n_points_max); - art_free (seg_map); - art_free (n_ips_max); - art_free (n_ips); - art_free (ips); - art_free (cursor); - art_free (active_segs); - - return new_vp; -} - -#define noVERBOSE - -/* Rewind a svp satisfying the nocross invariant. - - The winding number of a segment is defined as the winding number of - the points to the left while travelling in the direction of the - segment. Therefore it preincrements and postdecrements as a scan - line is traversed from left to right. - - Status of this routine: - - Basic correctness: Was ok in gfonted. However, this code does not - yet compute bboxes for the resulting svp segs. - - Numerical stability: known problems in the case of horizontal - segments in polygons with any complexity. For actual use, randomly - perturbing the vertices is recommended. - - Speed: good. - - Precision: good, except that no attempt is made to remove "hair". - Doing random perturbation just makes matters worse. - -*/ -/** - * art_svp_rewind_uncrossed: Rewind an svp satisfying the nocross invariant. - * @vp: The original svp. - * @rule: The winding rule. - * - * Creates a new svp with winding number of 0 or 1 everywhere. The @rule - * argument specifies a rule for how winding numbers in the original - * @vp map to the winding numbers in the result. - * - * With @rule == ART_WIND_RULE_NONZERO, the resulting svp has a - * winding number of 1 where @vp has a nonzero winding number. - * - * With @rule == ART_WIND_RULE_INTERSECT, the resulting svp has a - * winding number of 1 where @vp has a winding number greater than - * 1. It is useful for computing intersections. - * - * With @rule == ART_WIND_RULE_ODDEVEN, the resulting svp has a - * winding number of 1 where @vp has an odd winding number. It is - * useful for implementing the even-odd winding rule of the - * PostScript imaging model. - * - * With @rule == ART_WIND_RULE_POSITIVE, the resulting svp has a - * winding number of 1 where @vp has a positive winding number. It is - * useful for implementing asymmetric difference. - * - * This routine needs to be redone from scratch with numerical robustness - * in mind. I'm working on it. - * - * Return value: The new svp. - **/ -ArtSVP * -art_svp_rewind_uncrossed (ArtSVP *vp, ArtWindRule rule) -{ - int *active_segs; - int n_active_segs; - int *cursor; - int seg_idx; - double y; - int tmp1, tmp2; - int asi; - int i, j; - - ArtSVP *new_vp; - int n_segs_max; - int *winding; - int left_wind; - int wind; - int keep, invert; - -#ifdef VERBOSE - print_svp (vp); -#endif - n_segs_max = 16; - new_vp = (ArtSVP *)art_alloc (sizeof(ArtSVP) + - (n_segs_max - 1) * sizeof(ArtSVPSeg)); - new_vp->n_segs = 0; - - if (vp->n_segs == 0) - return new_vp; - - winding = art_new (int, vp->n_segs); - - active_segs = art_new (int, vp->n_segs); - cursor = art_new (int, vp->n_segs); - - n_active_segs = 0; - seg_idx = 0; - y = vp->segs[0].points[0].y; - while (seg_idx < vp->n_segs || n_active_segs > 0) - { -#ifdef VERBOSE - printf ("y = %g\n", y); -#endif - /* delete segments ending at y from active list */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (vp->segs[asi].n_points - 1 == cursor[asi] && - vp->segs[asi].points[cursor[asi]].y == y) - { -#ifdef VERBOSE - printf ("deleting %d\n", asi); -#endif - n_active_segs--; - for (j = i; j < n_active_segs; j++) - active_segs[j] = active_segs[j + 1]; - i--; - } - } - - /* insert new segments into the active list */ - while (seg_idx < vp->n_segs && y == vp->segs[seg_idx].points[0].y) - { -#ifdef VERBOSE - printf ("inserting %d\n", seg_idx); -#endif - cursor[seg_idx] = 0; - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (x_order_2 (vp->segs[seg_idx].points[0], - vp->segs[seg_idx].points[1], - vp->segs[asi].points[cursor[asi]], - vp->segs[asi].points[cursor[asi] + 1]) == -1) - break; - } - - /* Determine winding number for this segment */ - if (i == 0) - left_wind = 0; - else if (vp->segs[active_segs[i - 1]].dir) - left_wind = winding[active_segs[i - 1]]; - else - left_wind = winding[active_segs[i - 1]] - 1; - - if (vp->segs[seg_idx].dir) - wind = left_wind + 1; - else - wind = left_wind; - - winding[seg_idx] = wind; - - switch (rule) - { - case ART_WIND_RULE_NONZERO: - keep = (wind == 1 || wind == 0); - invert = (wind == 0); - break; - case ART_WIND_RULE_INTERSECT: - keep = (wind == 2); - invert = 0; - break; - case ART_WIND_RULE_ODDEVEN: - keep = 1; - invert = !(wind & 1); - break; - case ART_WIND_RULE_POSITIVE: - keep = (wind == 1); - invert = 0; - break; - default: - keep = 0; - invert = 0; - break; - } - - if (keep) - { - ArtPoint *points, *new_points; - int n_points; - int new_dir; - -#ifdef VERBOSE - printf ("keeping segment %d\n", seg_idx); -#endif - n_points = vp->segs[seg_idx].n_points; - points = vp->segs[seg_idx].points; - new_points = art_new (ArtPoint, n_points); - memcpy (new_points, points, n_points * sizeof (ArtPoint)); - new_dir = vp->segs[seg_idx].dir ^ invert; - art_svp_add_segment (&new_vp, &n_segs_max, - NULL, - n_points, new_dir, new_points, - &vp->segs[seg_idx].bbox); - } - - tmp1 = seg_idx; - for (j = i; j < n_active_segs; j++) - { - tmp2 = active_segs[j]; - active_segs[j] = tmp1; - tmp1 = tmp2; - } - active_segs[n_active_segs] = tmp1; - n_active_segs++; - seg_idx++; - } - -#ifdef VERBOSE - /* all active segs cross the y scanline (considering segs to be - closed on top and open on bottom) */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - printf ("%d:%d (%g, %g) - (%g, %g) %s %d\n", asi, - cursor[asi], - vp->segs[asi].points[cursor[asi]].x, - vp->segs[asi].points[cursor[asi]].y, - vp->segs[asi].points[cursor[asi] + 1].x, - vp->segs[asi].points[cursor[asi] + 1].y, - vp->segs[asi].dir ? "v" : "^", - winding[asi]); - } -#endif - - /* advance y to the next event */ - if (n_active_segs == 0) - { - if (seg_idx < vp->n_segs) - y = vp->segs[seg_idx].points[0].y; - /* else we're done */ - } - else - { - asi = active_segs[0]; - y = vp->segs[asi].points[cursor[asi] + 1].y; - for (i = 1; i < n_active_segs; i++) - { - asi = active_segs[i]; - if (y > vp->segs[asi].points[cursor[asi] + 1].y) - y = vp->segs[asi].points[cursor[asi] + 1].y; - } - if (seg_idx < vp->n_segs && y > vp->segs[seg_idx].points[0].y) - y = vp->segs[seg_idx].points[0].y; - } - - /* advance cursors to reach new y */ - for (i = 0; i < n_active_segs; i++) - { - asi = active_segs[i]; - while (cursor[asi] < vp->segs[asi].n_points - 1 && - y >= vp->segs[asi].points[cursor[asi] + 1].y) - cursor[asi]++; - } -#ifdef VERBOSE - printf ("\n"); -#endif - } - art_free (cursor); - art_free (active_segs); - art_free (winding); - - return new_vp; -} diff -Nru swftools-0.9.0/lib/art/art_svp_wind.h swftools-0.9.2/lib/art/art_svp_wind.h --- swftools-0.9.0/lib/art/art_svp_wind.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_svp_wind.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_SVP_WIND_H__ -#define __ART_SVP_WIND_H__ - -/* Primitive intersection and winding number operations on sorted - vector paths. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#else -#include "art_svp.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef ART_WIND_RULE_DEFINED -#define ART_WIND_RULE_DEFINED -typedef enum { - ART_WIND_RULE_NONZERO, - ART_WIND_RULE_INTERSECT, - ART_WIND_RULE_ODDEVEN, - ART_WIND_RULE_POSITIVE -} ArtWindRule; -#endif - -ArtSVP * -art_svp_uncross (ArtSVP *vp); - -ArtSVP * -art_svp_rewind_uncrossed (ArtSVP *vp, ArtWindRule rule); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_SVP_WIND_H__ */ diff -Nru swftools-0.9.0/lib/art/art_uta.c swftools-0.9.2/lib/art/art_uta.c --- swftools-0.9.0/lib/art/art_uta.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_uta.h" - -#include -#include "art_misc.h" - -/** - * art_uta_new: Allocate a new uta. - * @x0: Left coordinate of uta. - * @y0: Top coordinate of uta. - * @x1: Right coordinate of uta. - * @y1: Bottom coordinate of uta. - * - * Allocates a new microtile array. The arguments are in units of - * tiles, not pixels. - * - * Returns: the newly allocated #ArtUta. - **/ -ArtUta * -art_uta_new (int x0, int y0, int x1, int y1) -{ - ArtUta *uta; - - uta = art_new (ArtUta, 1); - uta->x0 = x0; - uta->y0 = y0; - uta->width = x1 - x0; - uta->height = y1 - y0; - - uta->utiles = art_new (ArtUtaBbox, uta->width * uta->height); - - memset (uta->utiles, 0, uta->width * uta->height * sizeof(ArtUtaBbox)); - return uta; - } - -/** - * art_uta_new_coords: Allocate a new uta, based on pixel coordinates. - * @x0: Left coordinate of uta. - * @y0: Top coordinate of uta. - * @x1: Right coordinate of uta. - * @y1: Bottom coordinate of uta. - * - * Allocates a new microtile array. The arguments are in pixels - * - * Returns: the newly allocated #ArtUta. - **/ -ArtUta * -art_uta_new_coords (int x0, int y0, int x1, int y1) -{ - return art_uta_new (x0 >> ART_UTILE_SHIFT, y0 >> ART_UTILE_SHIFT, - 1 + (x1 >> ART_UTILE_SHIFT), - 1 + (y1 >> ART_UTILE_SHIFT)); -} - -/** - * art_uta_free: Free a uta. - * @uta: The uta to free. - * - * Frees the microtile array structure, including the actual microtile - * data. - **/ -void -art_uta_free (ArtUta *uta) -{ - art_free (uta->utiles); - art_free (uta); -} - -/* User to Aardvark! */ diff -Nru swftools-0.9.0/lib/art/art_uta.h swftools-0.9.2/lib/art/art_uta.h --- swftools-0.9.0/lib/art/art_uta.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_UTA_H__ -#define __ART_UTA_H__ - -/* Basic data structures and constructors for microtile arrays */ - -#ifdef LIBART_COMPILATION -#include "art_misc.h" -#else -#include "art_misc.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef art_u32 ArtUtaBbox; -typedef struct _ArtUta ArtUta; - -#define ART_UTA_BBOX_CONS(x0, y0, x1, y1) (((x0) << 24) | ((y0) << 16) | \ - ((x1) << 8) | (y1)) - -#define ART_UTA_BBOX_X0(ub) ((ub) >> 24) -#define ART_UTA_BBOX_Y0(ub) (((ub) >> 16) & 0xff) -#define ART_UTA_BBOX_X1(ub) (((ub) >> 8) & 0xff) -#define ART_UTA_BBOX_Y1(ub) ((ub) & 0xff) - -#define ART_UTILE_SHIFT 5 -#define ART_UTILE_SIZE (1 << ART_UTILE_SHIFT) - -/* Coordinates are shifted right by ART_UTILE_SHIFT wrt the real - coordinates. */ -struct _ArtUta { - int x0; - int y0; - int width; - int height; - ArtUtaBbox *utiles; -}; - -ArtUta * -art_uta_new (int x0, int y0, int x1, int y1); - -ArtUta * -art_uta_new_coords (int x0, int y0, int x1, int y1); - -void -art_uta_free (ArtUta *uta); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_UTA_H__ */ diff -Nru swftools-0.9.0/lib/art/art_uta_ops.c swftools-0.9.2/lib/art/art_uta_ops.c --- swftools-0.9.0/lib/art/art_uta_ops.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_ops.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_uta_ops.h" - -#include -#include "art_misc.h" -#include "art_uta.h" - -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -/** - * art_uta_union: Compute union of two uta's. - * @uta1: One uta. - * @uta2: The other uta. - * - * Computes the union of @uta1 and @uta2. The union is approximate, - * but coverage is guaranteed over all pixels included in either of - * the arguments, ie more pixels may be covered than the "exact" - * union. - * - * Note: this routine is used in the Gnome Canvas to accumulate the - * region that needs to be repainted. However, since it copies over - * the entire uta (which might be largish) even when the update may be - * small, it can be a performance bottleneck. There are two approaches - * to this problem, both of which are probably worthwhile. First, the - * generated uta's should always be limited to the visible window, - * thus guaranteeing that uta's never become large. Second, there - * should be a new, destructive union operation that only touches a - * small part of the uta when the update is small. - * - * Return value: The new union uta. - **/ -ArtUta * -art_uta_union (ArtUta *uta1, ArtUta *uta2) -{ - ArtUta *uta; - int x0, y0, x1, y1; - int x, y; - int ix, ix1, ix2; - ArtUtaBbox bb, bb1, bb2; - - x0 = MIN(uta1->x0, uta2->x0); - y0 = MIN(uta1->y0, uta2->y0); - x1 = MAX(uta1->x0 + uta1->width, uta2->x0 + uta2->width); - y1 = MAX(uta1->y0 + uta1->height, uta2->y0 + uta2->height); - uta = art_uta_new (x0, y0, x1, y1); - - /* could move the first two if/else statements out of the loop */ - ix = 0; - for (y = y0; y < y1; y++) - { - ix1 = (y - uta1->y0) * uta1->width + x0 - uta1->x0; - ix2 = (y - uta2->y0) * uta2->width + x0 - uta2->x0; - for (x = x0; x < x1; x++) - { - if (x < uta1->x0 || y < uta1->y0 || - x >= uta1->x0 + uta1->width || y >= uta1->y0 + uta1->height) - bb1 = 0; - else - bb1 = uta1->utiles[ix1]; - - if (x < uta2->x0 || y < uta2->y0 || - x >= uta2->x0 + uta2->width || y >= uta2->y0 + uta2->height) - bb2 = 0; - else - bb2 = uta2->utiles[ix2]; - - if (bb1 == 0) - bb = bb2; - else if (bb2 == 0) - bb = bb1; - else - bb = ART_UTA_BBOX_CONS(MIN(ART_UTA_BBOX_X0(bb1), - ART_UTA_BBOX_X0(bb2)), - MIN(ART_UTA_BBOX_Y0(bb1), - ART_UTA_BBOX_Y0(bb2)), - MAX(ART_UTA_BBOX_X1(bb1), - ART_UTA_BBOX_X1(bb2)), - MAX(ART_UTA_BBOX_Y1(bb1), - ART_UTA_BBOX_Y1(bb2))); - uta->utiles[ix] = bb; - ix++; - ix1++; - ix2++; - } - } - return uta; -} diff -Nru swftools-0.9.0/lib/art/art_uta_ops.h swftools-0.9.2/lib/art/art_uta_ops.h --- swftools-0.9.0/lib/art/art_uta_ops.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_ops.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_UTA_OPS_H__ -#define __ART_UTA_OPS_H__ - -/* Basic operations on microtile arrays */ - -#ifdef LIBART_COMPILATION -#include "art_uta.h" -#else -#include "art_uta.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtUta * -art_uta_union (ArtUta *uta1, ArtUta *uta2); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_UTA_OPS_H__ */ diff -Nru swftools-0.9.0/lib/art/art_uta_rect.c swftools-0.9.2/lib/art/art_uta_rect.c --- swftools-0.9.0/lib/art/art_uta_rect.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_rect.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_uta_rect.h" - -#include "art_misc.h" -#include "art_uta.h" -#include "art_rect.h" - -/** - * art_uta_from_irect: Generate uta covering a rectangle. - * @bbox: The source rectangle. - * - * Generates a uta exactly covering @bbox. Please do not call this - * function with a @bbox with zero height or width. - * - * Return value: the new uta. - **/ -ArtUta * -art_uta_from_irect (ArtIRect *bbox) -{ - ArtUta *uta; - ArtUtaBbox *utiles; - ArtUtaBbox bb; - int width, height; - int x, y; - int xf0, yf0, xf1, yf1; - int ix; - - uta = art_new (ArtUta, 1); - uta->x0 = bbox->x0 >> ART_UTILE_SHIFT; - uta->y0 = bbox->y0 >> ART_UTILE_SHIFT; - width = ((bbox->x1 + ART_UTILE_SIZE - 1) >> ART_UTILE_SHIFT) - uta->x0; - height = ((bbox->y1 + ART_UTILE_SIZE - 1) >> ART_UTILE_SHIFT) - uta->y0; - utiles = art_new (ArtUtaBbox, width * height); - - uta->width = width; - uta->height = height; - uta->utiles = utiles; - - xf0 = bbox->x0 & (ART_UTILE_SIZE - 1); - yf0 = bbox->y0 & (ART_UTILE_SIZE - 1); - xf1 = ((bbox->x1 - 1) & (ART_UTILE_SIZE - 1)) + 1; - yf1 = ((bbox->y1 - 1) & (ART_UTILE_SIZE - 1)) + 1; - if (height == 1) - { - if (width == 1) - utiles[0] = ART_UTA_BBOX_CONS (xf0, yf0, xf1, yf1); - else - { - utiles[0] = ART_UTA_BBOX_CONS (xf0, yf0, ART_UTILE_SIZE, yf1); - bb = ART_UTA_BBOX_CONS (0, yf0, ART_UTILE_SIZE, yf1); - for (x = 1; x < width - 1; x++) - utiles[x] = bb; - utiles[x] = ART_UTA_BBOX_CONS (0, yf0, xf1, yf1); - } - } - else - { - if (width == 1) - { - utiles[0] = ART_UTA_BBOX_CONS (xf0, yf0, xf1, ART_UTILE_SIZE); - bb = ART_UTA_BBOX_CONS (xf0, 0, xf1, ART_UTILE_SIZE); - for (y = 1; y < height - 1; y++) - utiles[y] = bb; - utiles[y] = ART_UTA_BBOX_CONS (xf0, 0, xf1, yf1); - } - else - { - utiles[0] = - ART_UTA_BBOX_CONS (xf0, yf0, ART_UTILE_SIZE, ART_UTILE_SIZE); - bb = ART_UTA_BBOX_CONS (0, yf0, ART_UTILE_SIZE, ART_UTILE_SIZE); - for (x = 1; x < width - 1; x++) - utiles[x] = bb; - utiles[x] = ART_UTA_BBOX_CONS (0, yf0, xf1, ART_UTILE_SIZE); - ix = width; - for (y = 1; y < height - 1; y++) - { - utiles[ix++] = - ART_UTA_BBOX_CONS (xf0, 0, ART_UTILE_SIZE, ART_UTILE_SIZE); - bb = ART_UTA_BBOX_CONS (0, 0, ART_UTILE_SIZE, ART_UTILE_SIZE); - for (x = 1; x < width - 1; x++) - utiles[ix++] = bb; - utiles[ix++] = ART_UTA_BBOX_CONS (0, 0, xf1, ART_UTILE_SIZE); - } - utiles[ix++] = ART_UTA_BBOX_CONS (xf0, 0, ART_UTILE_SIZE, yf1); - bb = ART_UTA_BBOX_CONS (0, 0, ART_UTILE_SIZE, yf1); - for (x = 1; x < width - 1; x++) - utiles[ix++] = bb; - utiles[ix++] = ART_UTA_BBOX_CONS (0, 0, xf1, yf1); - } - } - return uta; -} diff -Nru swftools-0.9.0/lib/art/art_uta_rect.h swftools-0.9.2/lib/art/art_uta_rect.h --- swftools-0.9.0/lib/art/art_uta_rect.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_rect.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_UTA_RECT_H__ -#define __ART_UTA_RECT_H__ - -#ifdef LIBART_COMPILATION -#include "art_rect.h" -#include "art_uta.h" -#else -#include "art_rect.h" -#include "art_uta.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtUta * -art_uta_from_irect (ArtIRect *bbox); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_UTA_RECT_H__ */ diff -Nru swftools-0.9.0/lib/art/art_uta_svp.c swftools-0.9.2/lib/art/art_uta_svp.c --- swftools-0.9.0/lib/art/art_uta_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* LGPL Copyright 1998 Raph Levien */ - -#include "config.h" -#include "art_uta_svp.h" - -#include "art_misc.h" -#include "art_vpath.h" -#include "art_uta.h" -#include "art_uta_vpath.h" -#include "art_svp.h" -#include "art_vpath_svp.h" - -/** - * art_uta_from_svp: Generate uta covering an svp. - * @svp: The source svp. - * - * Generates a uta covering @svp. The resulting uta is of course - * approximate, ie it may cover more pixels than covered by @svp. - * - * Note: I will want to replace this with a more direct - * implementation. But this gets the api in place. - * - * Return value: the new uta. - **/ -ArtUta * -art_uta_from_svp (const ArtSVP *svp) -{ - ArtVpath *vpath; - ArtUta *uta; - - vpath = art_vpath_from_svp (svp); - uta = art_uta_from_vpath (vpath); - art_free (vpath); - return uta; -} diff -Nru swftools-0.9.0/lib/art/art_uta_svp.h swftools-0.9.2/lib/art/art_uta_svp.h --- swftools-0.9.0/lib/art/art_uta_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_UTA_SVP_H__ -#define __ART_UTA_SVP_H__ - -/* Basic data structures and constructors for microtile arrays */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#include "art_uta.h" -#else -#include "art_svp.h" -#include "art_uta.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtUta * -art_uta_from_svp (const ArtSVP *svp); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_UTA_SVP_H__ */ - diff -Nru swftools-0.9.0/lib/art/art_uta_vpath.c swftools-0.9.2/lib/art/art_uta_vpath.c --- swftools-0.9.0/lib/art/art_uta_vpath.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_vpath.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,382 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "art_uta_vpath.h" - -#include - -#include "art_misc.h" -#include "art_vpath.h" -#include "art_uta.h" - -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif /* MAX */ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif /* MIN */ - -/** - * art_uta_add_line: Add a line to the uta. - * @uta: The uta to modify. - * @x0: X coordinate of line start point. - * @y0: Y coordinate of line start point. - * @x1: X coordinate of line end point. - * @y1: Y coordinate of line end point. - * @rbuf: Buffer containing first difference of winding number. - * @rbuf_rowstride: Rowstride of @rbuf. - * - * Add the line (@x0, @y0) - (@x1, @y1) to @uta, and also update the - * winding number buffer used for rendering the interior. @rbuf - * contains the first partial difference (in the X direction) of the - * winding number, measured in grid cells. Thus, each time that a line - * crosses a horizontal uta grid line, an entry of @rbuf is - * incremented if @y1 > @y0, decremented otherwise. - * - * Note that edge handling is fairly delicate. Please rtfs for - * details. - **/ -void -art_uta_add_line (ArtUta *uta, double x0, double y0, double x1, double y1, - int *rbuf, int rbuf_rowstride) -{ - int xmin, ymin; - double xmax, ymax; - int xmaxf, ymaxf; - int xmaxc, ymaxc; - int xt0, yt0; - int xt1, yt1; - int xf0, yf0; - int xf1, yf1; - int ix, ix1; - ArtUtaBbox bb; - - xmin = floor (MIN(x0, x1)); - xmax = MAX(x0, x1); - xmaxf = floor (xmax); - xmaxc = ceil (xmax); - ymin = floor (MIN(y0, y1)); - ymax = MAX(y0, y1); - ymaxf = floor (ymax); - ymaxc = ceil (ymax); - xt0 = (xmin >> ART_UTILE_SHIFT) - uta->x0; - yt0 = (ymin >> ART_UTILE_SHIFT) - uta->y0; - xt1 = (xmaxf >> ART_UTILE_SHIFT) - uta->x0; - yt1 = (ymaxf >> ART_UTILE_SHIFT) - uta->y0; - if (xt0 == xt1 && yt0 == yt1) - { - /* entirely inside a microtile, this is easy! */ - xf0 = xmin & (ART_UTILE_SIZE - 1); - yf0 = ymin & (ART_UTILE_SIZE - 1); - xf1 = (xmaxf & (ART_UTILE_SIZE - 1)) + xmaxc - xmaxf; - yf1 = (ymaxf & (ART_UTILE_SIZE - 1)) + ymaxc - ymaxf; - - ix = yt0 * uta->width + xt0; - bb = uta->utiles[ix]; - if (bb == 0) - bb = ART_UTA_BBOX_CONS(xf0, yf0, xf1, yf1); - else - bb = ART_UTA_BBOX_CONS(MIN(ART_UTA_BBOX_X0(bb), xf0), - MIN(ART_UTA_BBOX_Y0(bb), yf0), - MAX(ART_UTA_BBOX_X1(bb), xf1), - MAX(ART_UTA_BBOX_Y1(bb), yf1)); - uta->utiles[ix] = bb; - } - else - { - double dx, dy; - int sx, sy; - - dx = x1 - x0; - dy = y1 - y0; - sx = dx > 0 ? 1 : dx < 0 ? -1 : 0; - sy = dy > 0 ? 1 : dy < 0 ? -1 : 0; - if (ymin == ymaxf) - { - /* special case horizontal (dx/dy slope would be infinite) */ - xf0 = xmin & (ART_UTILE_SIZE - 1); - yf0 = ymin & (ART_UTILE_SIZE - 1); - xf1 = (xmaxf & (ART_UTILE_SIZE - 1)) + xmaxc - xmaxf; - yf1 = (ymaxf & (ART_UTILE_SIZE - 1)) + ymaxc - ymaxf; - - ix = yt0 * uta->width + xt0; - ix1 = yt0 * uta->width + xt1; - while (ix != ix1) - { - bb = uta->utiles[ix]; - if (bb == 0) - bb = ART_UTA_BBOX_CONS(xf0, yf0, ART_UTILE_SIZE, yf1); - else - bb = ART_UTA_BBOX_CONS(MIN(ART_UTA_BBOX_X0(bb), xf0), - MIN(ART_UTA_BBOX_Y0(bb), yf0), - ART_UTILE_SIZE, - MAX(ART_UTA_BBOX_Y1(bb), yf1)); - uta->utiles[ix] = bb; - xf0 = 0; - ix++; - } - bb = uta->utiles[ix]; - if (bb == 0) - bb = ART_UTA_BBOX_CONS(0, yf0, xf1, yf1); - else - bb = ART_UTA_BBOX_CONS(0, - MIN(ART_UTA_BBOX_Y0(bb), yf0), - MAX(ART_UTA_BBOX_X1(bb), xf1), - MAX(ART_UTA_BBOX_Y1(bb), yf1)); - uta->utiles[ix] = bb; - } - else - { - /* Do a Bresenham-style traversal of the line */ - double dx_dy; - double x, y; - double xn, yn; - - /* normalize coordinates to uta origin */ - x0 -= uta->x0 << ART_UTILE_SHIFT; - y0 -= uta->y0 << ART_UTILE_SHIFT; - x1 -= uta->x0 << ART_UTILE_SHIFT; - y1 -= uta->y0 << ART_UTILE_SHIFT; - if (dy < 0) - { - double tmp; - - tmp = x0; - x0 = x1; - x1 = tmp; - - tmp = y0; - y0 = y1; - y1 = tmp; - - dx = -dx; - sx = -sx; - dy = -dy; - /* we leave sy alone, because it would always be 1, - and we need it for the rbuf stuff. */ - } - xt0 = ((int)floor (x0) >> ART_UTILE_SHIFT); - xt1 = ((int)floor (x1) >> ART_UTILE_SHIFT); - /* now [xy]0 is above [xy]1 */ - - ix = yt0 * uta->width + xt0; - ix1 = yt1 * uta->width + xt1; -#ifdef VERBOSE - printf ("%% ix = %d,%d; ix1 = %d,%d\n", xt0, yt0, xt1, yt1); -#endif - - dx_dy = dx / dy; - x = x0; - y = y0; - while (ix != ix1) - { - int dix; - - /* figure out whether next crossing is horizontal or vertical */ -#ifdef VERBOSE - printf ("%% %d,%d\n", xt0, yt0); -#endif - yn = (yt0 + 1) << ART_UTILE_SHIFT; - - /* xn is the intercept with bottom edge of this tile. The - following expression is careful to result in exactly - x1 when yn = y1. */ - xn = x1 + dx_dy * (yn - y1); - - if (xt0 != (int)floor (xn) >> ART_UTILE_SHIFT) - { - /* horizontal crossing */ - xt0 += sx; - dix = sx; - if (dx > 0) - { - xn = xt0 << ART_UTILE_SHIFT; - yn = y0 + (xn - x0) / dx_dy; - - xf0 = (int)floor (x) & (ART_UTILE_SIZE - 1); - xf1 = ART_UTILE_SIZE; - } - else - { - xn = (xt0 + 1) << ART_UTILE_SHIFT; - yn = y0 + (xn - x0) / dx_dy; - - xf0 = 0; - xmaxc = (int)ceil (x); - xf1 = xmaxc - ((xt0 + 1) << ART_UTILE_SHIFT); - } - ymaxf = (int)floor (yn); - ymaxc = (int)ceil (yn); - yf1 = (ymaxf & (ART_UTILE_SIZE - 1)) + ymaxc - ymaxf; - } - else - { - /* vertical crossing */ - dix = uta->width; - xf0 = (int)floor (MIN(x, xn)) & (ART_UTILE_SIZE - 1); - xmax = MAX(x, xn); - xmaxc = (int)ceil (xmax); - xf1 = xmaxc - (xt0 << ART_UTILE_SHIFT); - yf1 = ART_UTILE_SIZE; - - if (rbuf != NULL) - rbuf[yt0 * rbuf_rowstride + xt0] += sy; - - yt0++; - } - yf0 = (int)floor (y) & (ART_UTILE_SIZE - 1); - bb = uta->utiles[ix]; - if (bb == 0) - bb = ART_UTA_BBOX_CONS(xf0, yf0, xf1, yf1); - else - bb = ART_UTA_BBOX_CONS(MIN(ART_UTA_BBOX_X0(bb), xf0), - MIN(ART_UTA_BBOX_Y0(bb), yf0), - MAX(ART_UTA_BBOX_X1(bb), xf1), - MAX(ART_UTA_BBOX_Y1(bb), yf1)); - uta->utiles[ix] = bb; - - x = xn; - y = yn; - ix += dix; - } - xmax = MAX(x, x1); - xmaxc = ceil (xmax); - ymaxc = ceil (y1); - xf0 = (int)floor (MIN(x1, x)) & (ART_UTILE_SIZE - 1); - yf0 = (int)floor (y) & (ART_UTILE_SIZE - 1); - xf1 = xmaxc - (xt0 << ART_UTILE_SHIFT); - yf1 = ymaxc - (yt0 << ART_UTILE_SHIFT); - bb = uta->utiles[ix]; - if (bb == 0) - bb = ART_UTA_BBOX_CONS(xf0, yf0, xf1, yf1); - else - bb = ART_UTA_BBOX_CONS(MIN(ART_UTA_BBOX_X0(bb), xf0), - MIN(ART_UTA_BBOX_Y0(bb), yf0), - MAX(ART_UTA_BBOX_X1(bb), xf1), - MAX(ART_UTA_BBOX_Y1(bb), yf1)); - uta->utiles[ix] = bb; - } - } -} - -/** - * art_uta_from_vpath: Generate uta covering a vpath. - * @vec: The source vpath. - * - * Generates a uta covering @vec. The resulting uta is of course - * approximate, ie it may cover more pixels than covered by @vec. - * - * Return value: the new uta. - **/ -ArtUta * -art_uta_from_vpath (const ArtVpath *vec) -{ - ArtUta *uta; - ArtIRect bbox; - int *rbuf; - int i; - double x, y; - int sum; - int xt, yt; - ArtUtaBbox *utiles; - ArtUtaBbox bb; - int width; - int height; - int ix; - - art_vpath_bbox_irect (vec, &bbox); - - uta = art_uta_new_coords (bbox.x0, bbox.y0, bbox.x1, bbox.y1); - - width = uta->width; - height = uta->height; - utiles = uta->utiles; - - rbuf = art_new (int, width * height); - for (i = 0; i < width * height; i++) - rbuf[i] = 0; - - x = 0; - y = 0; - for (i = 0; vec[i].code != ART_END; i++) - { - switch (vec[i].code) - { - case ART_MOVETO: - x = vec[i].x; - y = vec[i].y; - break; - case ART_LINETO: - art_uta_add_line (uta, vec[i].x, vec[i].y, x, y, rbuf, width); - x = vec[i].x; - y = vec[i].y; - break; - default: - /* this shouldn't happen */ - art_free (rbuf); - art_free (uta); - return NULL; - } - } - - /* now add in the filling from rbuf */ - ix = 0; - for (yt = 0; yt < height; yt++) - { - sum = 0; - for (xt = 0; xt < width; xt++) - { - sum += rbuf[ix]; - /* Nonzero winding rule - others are possible, but hardly - worth it. */ - if (sum != 0) - { - bb = utiles[ix]; - bb &= 0xffff0000; - bb |= (ART_UTILE_SIZE << 8) | ART_UTILE_SIZE; - utiles[ix] = bb; - if (xt != width - 1) - { - bb = utiles[ix + 1]; - bb &= 0xffff00; - bb |= ART_UTILE_SIZE; - utiles[ix + 1] = bb; - } - if (yt != height - 1) - { - bb = utiles[ix + width]; - bb &= 0xff0000ff; - bb |= ART_UTILE_SIZE << 8; - utiles[ix + width] = bb; - if (xt != width - 1) - { - utiles[ix + width + 1] &= 0xffff; - } - } - } - ix++; - } - } - - art_free (rbuf); - - return uta; -} diff -Nru swftools-0.9.0/lib/art/art_uta_vpath.h swftools-0.9.2/lib/art/art_uta_vpath.h --- swftools-0.9.0/lib/art/art_uta_vpath.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_uta_vpath.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_UTA_VPATH_H__ -#define __ART_UTA_VPATH_H__ - -/* Basic data structures and constructors for microtile arrays */ - -#ifdef LIBART_COMPILATION -#include "art_uta.h" -#include "art_vpath.h" -#else -#include "art_uta.h" -#include "art_vpath.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtUta * -art_uta_from_vpath (const ArtVpath *vec); - -/* This is a private function: */ -void -art_uta_add_line (ArtUta *uta, double x0, double y0, double x1, double y1, - int *rbuf, int rbuf_rowstride); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_UTA_VPATH_H__ */ - diff -Nru swftools-0.9.0/lib/art/art_vpath_bpath.c swftools-0.9.2/lib/art/art_vpath_bpath.c --- swftools-0.9.0/lib/art/art_vpath_bpath.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath_bpath.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,328 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Basic constructors and operations for bezier paths */ - -#include "config.h" -#include "art_vpath_bpath.h" - -#include - -#include "art_misc.h" - -#include "art_bpath.h" -#include "art_vpath.h" - -/* p must be allocated 2^level points. */ - -/* level must be >= 1 */ -ArtPoint * -art_bezier_to_vec (double x0, double y0, - double x1, double y1, - double x2, double y2, - double x3, double y3, - ArtPoint *p, - int level) -{ - double x_m, y_m; - -#ifdef VERBOSE - printf ("bezier_to_vec: %g,%g %g,%g %g,%g %g,%g %d\n", - x0, y0, x1, y1, x2, y2, x3, y3, level); -#endif - if (level == 1) { - x_m = (x0 + 3 * (x1 + x2) + x3) * 0.125; - y_m = (y0 + 3 * (y1 + y2) + y3) * 0.125; - p->x = x_m; - p->y = y_m; - p++; - p->x = x3; - p->y = y3; - p++; -#ifdef VERBOSE - printf ("-> (%g, %g) -> (%g, %g)\n", x_m, y_m, x3, y3); -#endif - } else { - double xa1, ya1; - double xa2, ya2; - double xb1, yb1; - double xb2, yb2; - - xa1 = (x0 + x1) * 0.5; - ya1 = (y0 + y1) * 0.5; - xa2 = (x0 + 2 * x1 + x2) * 0.25; - ya2 = (y0 + 2 * y1 + y2) * 0.25; - xb1 = (x1 + 2 * x2 + x3) * 0.25; - yb1 = (y1 + 2 * y2 + y3) * 0.25; - xb2 = (x2 + x3) * 0.5; - yb2 = (y2 + y3) * 0.5; - x_m = (xa2 + xb1) * 0.5; - y_m = (ya2 + yb1) * 0.5; -#ifdef VERBOSE - printf ("%g,%g %g,%g %g,%g %g,%g\n", xa1, ya1, xa2, ya2, - xb1, yb1, xb2, yb2); -#endif - p = art_bezier_to_vec (x0, y0, xa1, ya1, xa2, ya2, x_m, y_m, p, level - 1); - p = art_bezier_to_vec (x_m, y_m, xb1, yb1, xb2, yb2, x3, y3, p, level - 1); - } - return p; -} - -#define RENDER_LEVEL 4 -#define RENDER_SIZE (1 << (RENDER_LEVEL)) - -/** - * art_vpath_render_bez: Render a bezier segment into the vpath. - * @p_vpath: Where the pointer to the #ArtVpath structure is stored. - * @pn_points: Pointer to the number of points in *@p_vpath. - * @pn_points_max: Pointer to the number of points allocated. - * @x0: X coordinate of starting bezier point. - * @y0: Y coordinate of starting bezier point. - * @x1: X coordinate of first bezier control point. - * @y1: Y coordinate of first bezier control point. - * @x2: X coordinate of second bezier control point. - * @y2: Y coordinate of second bezier control point. - * @x3: X coordinate of ending bezier point. - * @y3: Y coordinate of ending bezier point. - * @flatness: Flatness control. - * - * Renders a bezier segment into the vector path, reallocating and - * updating *@p_vpath and *@pn_vpath_max as necessary. *@pn_vpath is - * incremented by the number of vector points added. - * - * This step includes (@x0, @y0) but not (@x3, @y3). - * - * The @flatness argument guides the amount of subdivision. The Adobe - * PostScript reference manual defines flatness as the maximum - * deviation between the any point on the vpath approximation and the - * corresponding point on the "true" curve, and we follow this - * definition here. A value of 0.25 should ensure high quality for aa - * rendering. -**/ -static void -art_vpath_render_bez (ArtVpath **p_vpath, int *pn, int *pn_max, - double x0, double y0, - double x1, double y1, - double x2, double y2, - double x3, double y3, - double flatness) -{ - double x3_0, y3_0; - double z3_0_dot; - double z1_dot, z2_dot; - double z1_perp, z2_perp; - double max_perp_sq; - - double x_m, y_m; - double xa1, ya1; - double xa2, ya2; - double xb1, yb1; - double xb2, yb2; - - /* It's possible to optimize this routine a fair amount. - - First, once the _dot conditions are met, they will also be met in - all further subdivisions. So we might recurse to a different - routine that only checks the _perp conditions. - - Second, the distance _should_ decrease according to fairly - predictable rules (a factor of 4 with each subdivision). So it might - be possible to note that the distance is within a factor of 4 of - acceptable, and subdivide once. But proving this might be hard. - - Third, at the last subdivision, x_m and y_m can be computed more - expeditiously (as in the routine above). - - Finally, if we were able to subdivide by, say 2 or 3, this would - allow considerably finer-grain control, i.e. fewer points for the - same flatness tolerance. This would speed things up downstream. - - In any case, this routine is unlikely to be the bottleneck. It's - just that I have this undying quest for more speed... - - */ - - x3_0 = x3 - x0; - y3_0 = y3 - y0; - - /* z3_0_dot is dist z0-z3 squared */ - z3_0_dot = x3_0 * x3_0 + y3_0 * y3_0; - - if (z3_0_dot < 0.001) - { - /* if start and end point are almost identical, the flatness tests - * don't work properly, so fall back on testing whether both of - * the other two control points are the same as the start point, - * too. - */ - if (hypot(x1 - x0, y1 - y0) < 0.001 - && hypot(x2 - x0, y2 - y0) < 0.001) - goto nosubdivide; - else - goto subdivide; - } - - /* we can avoid subdivision if: - - z1 has distance no more than flatness from the z0-z3 line - - z1 is no more z0'ward than flatness past z0-z3 - - z1 is more z0'ward than z3'ward on the line traversing z0-z3 - - and correspondingly for z2 */ - - /* perp is distance from line, multiplied by dist z0-z3 */ - max_perp_sq = flatness * flatness * z3_0_dot; - - z1_perp = (y1 - y0) * x3_0 - (x1 - x0) * y3_0; - if (z1_perp * z1_perp > max_perp_sq) - goto subdivide; - - z2_perp = (y3 - y2) * x3_0 - (x3 - x2) * y3_0; - if (z2_perp * z2_perp > max_perp_sq) - goto subdivide; - - z1_dot = (x1 - x0) * x3_0 + (y1 - y0) * y3_0; - if (z1_dot < 0 && z1_dot * z1_dot > max_perp_sq) - goto subdivide; - - z2_dot = (x3 - x2) * x3_0 + (y3 - y2) * y3_0; - if (z2_dot < 0 && z2_dot * z2_dot > max_perp_sq) - goto subdivide; - - if (z1_dot + z1_dot > z3_0_dot) - goto subdivide; - - if (z2_dot + z2_dot > z3_0_dot) - goto subdivide; - - - nosubdivide: - /* don't subdivide */ - art_vpath_add_point (p_vpath, pn, pn_max, - ART_LINETO, x3, y3); - return; - - subdivide: - - xa1 = (x0 + x1) * 0.5; - ya1 = (y0 + y1) * 0.5; - xa2 = (x0 + 2 * x1 + x2) * 0.25; - ya2 = (y0 + 2 * y1 + y2) * 0.25; - xb1 = (x1 + 2 * x2 + x3) * 0.25; - yb1 = (y1 + 2 * y2 + y3) * 0.25; - xb2 = (x2 + x3) * 0.5; - yb2 = (y2 + y3) * 0.5; - x_m = (xa2 + xb1) * 0.5; - y_m = (ya2 + yb1) * 0.5; -#ifdef VERBOSE - printf ("%g,%g %g,%g %g,%g %g,%g\n", xa1, ya1, xa2, ya2, - xb1, yb1, xb2, yb2); -#endif - art_vpath_render_bez (p_vpath, pn, pn_max, - x0, y0, xa1, ya1, xa2, ya2, x_m, y_m, flatness); - art_vpath_render_bez (p_vpath, pn, pn_max, - x_m, y_m, xb1, yb1, xb2, yb2, x3, y3, flatness); -} - -/** - * art_bez_path_to_vec: Create vpath from bezier path. - * @bez: Bezier path. - * @flatness: Flatness control. - * - * Creates a vector path closely approximating the bezier path defined by - * @bez. The @flatness argument controls the amount of subdivision. In - * general, the resulting vpath deviates by at most @flatness pixels - * from the "ideal" path described by @bez. - * - * Return value: Newly allocated vpath. - **/ -ArtVpath * -art_bez_path_to_vec (const ArtBpath *bez, double flatness) -{ - ArtVpath *vec; - int vec_n, vec_n_max; - int bez_index; - double x, y; - - vec_n = 0; - vec_n_max = RENDER_SIZE; - vec = art_new (ArtVpath, vec_n_max); - - /* Initialization is unnecessary because of the precondition that the - bezier path does not begin with LINETO or CURVETO, but is here - to make the code warning-free. */ - x = 0; - y = 0; - - bez_index = 0; - do - { -#ifdef VERBOSE - printf ("%s %g %g\n", - bez[bez_index].code == ART_CURVETO ? "curveto" : - bez[bez_index].code == ART_LINETO ? "lineto" : - bez[bez_index].code == ART_MOVETO ? "moveto" : - bez[bez_index].code == ART_MOVETO_OPEN ? "moveto-open" : - "end", bez[bez_index].x3, bez[bez_index].y3); -#endif - /* make sure space for at least one more code */ - if (vec_n >= vec_n_max) - art_expand (vec, ArtVpath, vec_n_max); - switch (bez[bez_index].code) - { - case ART_MOVETO_OPEN: - case ART_MOVETO: - case ART_LINETO: - x = bez[bez_index].x3; - y = bez[bez_index].y3; - vec[vec_n].code = bez[bez_index].code; - vec[vec_n].x = x; - vec[vec_n].y = y; - vec_n++; - break; - case ART_END: - vec[vec_n].code = bez[bez_index].code; - vec[vec_n].x = 0; - vec[vec_n].y = 0; - vec_n++; - break; - case ART_CURVETO: -#ifdef VERBOSE - printf ("%g,%g %g,%g %g,%g %g,%g\n", x, y, - bez[bez_index].x1, bez[bez_index].y1, - bez[bez_index].x2, bez[bez_index].y2, - bez[bez_index].x3, bez[bez_index].y3); -#endif - art_vpath_render_bez (&vec, &vec_n, &vec_n_max, - x, y, - bez[bez_index].x1, bez[bez_index].y1, - bez[bez_index].x2, bez[bez_index].y2, - bez[bez_index].x3, bez[bez_index].y3, - flatness); - x = bez[bez_index].x3; - y = bez[bez_index].y3; - break; - } - } - while (bez[bez_index++].code != ART_END); - return vec; -} - diff -Nru swftools-0.9.0/lib/art/art_vpath_bpath.h swftools-0.9.2/lib/art/art_vpath_bpath.h --- swftools-0.9.0/lib/art/art_vpath_bpath.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath_bpath.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_VPATH_BPATH_H__ -#define __ART_VPATH_BPATH_H__ - -#ifdef LIBART_COMPILATION -#include "art_bpath.h" -#include "art_vpath.h" -#else -#include "art_bpath.h" -#include "art_vpath.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtPoint *art_bezier_to_vec (double x0, double y0, - double x1, double y1, - double x2, double y2, - double x3, double y3, - ArtPoint *p, - int level); - -ArtVpath *art_bez_path_to_vec (const ArtBpath *bez, double flatness); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_VPATH_BPATH_H__ */ diff -Nru swftools-0.9.0/lib/art/art_vpath.c swftools-0.9.2/lib/art/art_vpath.c --- swftools-0.9.0/lib/art/art_vpath.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,241 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Basic constructors and operations for vector paths */ - -#include "config.h" -#include "art_vpath.h" - -#include -#include - -#include "art_misc.h" - -#include "art_rect.h" - -/** - * art_vpath_add_point: Add point to vpath. - * @p_vpath: Where the pointer to the #ArtVpath structure is stored. - * @pn_points: Pointer to the number of points in *@p_vpath. - * @pn_points_max: Pointer to the number of points allocated. - * @code: The pathcode for the new point. - * @x: The X coordinate of the new point. - * @y: The Y coordinate of the new point. - * - * Adds a new point to *@p_vpath, reallocating and updating *@p_vpath - * and *@pn_points_max as necessary. *@pn_points is incremented. - * - * This routine always adds the point after all points already in the - * vpath. Thus, it should be called in the order the points are - * desired. - **/ -void -art_vpath_add_point (ArtVpath **p_vpath, int *pn_points, int *pn_points_max, - ArtPathcode code, double x, double y) -{ - int i; - - i = (*pn_points)++; - if (i == *pn_points_max) - art_expand (*p_vpath, ArtVpath, *pn_points_max); - (*p_vpath)[i].code = code; - (*p_vpath)[i].x = x; - (*p_vpath)[i].y = y; -} - -/* number of steps should really depend on radius. */ -#define CIRCLE_STEPS 128 - -/** - * art_vpath_new_circle: Create a new circle. - * @x: X coordinate of center. - * @y: Y coordinate of center. - * @r: radius. - * - * Creates a new polygon closely approximating a circle with center - * (@x, @y) and radius @r. Currently, the number of points used in the - * approximation is fixed, but that will probably change. - * - * Return value: The newly created #ArtVpath. - **/ -ArtVpath * -art_vpath_new_circle (double x, double y, double r) -{ - int i; - ArtVpath *vec; - double theta; - - vec = (ArtVpath*)art_new (ArtVpath, CIRCLE_STEPS + 2); - - for (i = 0; i < CIRCLE_STEPS + 1; i++) - { - vec[i].code = i ? ART_LINETO : ART_MOVETO; - theta = (i & (CIRCLE_STEPS - 1)) * (M_PI * 2.0 / CIRCLE_STEPS); - vec[i].x = x + r * cos (theta); - vec[i].y = y - r * sin (theta); - } - vec[i].code = ART_END; - - return vec; -} - -/** - * art_vpath_affine_transform: Affine transform a vpath. - * @src: Source vpath to transform. - * @matrix: Affine transform. - * - * Computes the affine transform of the vpath, using @matrix as the - * transform. @matrix is stored in the same format as PostScript, ie. - * x' = @matrix[0] * x + @matrix[2] * y + @matrix[4] - * y' = @matrix[1] * x + @matrix[3] * y + @matrix[5] - * - * Return value: the newly allocated vpath resulting from the transform. -**/ -ArtVpath * -art_vpath_affine_transform (const ArtVpath *src, const double matrix[6]) -{ - int i; - int size; - ArtVpath *xnew; - double x, y; - - for (i = 0; src[i].code != ART_END; i++); - size = i; - - xnew = (ArtVpath*)art_new (ArtVpath, size + 1); - - for (i = 0; i < size; i++) - { - xnew[i].code = src[i].code; - x = src[i].x; - y = src[i].y; - xnew[i].x = matrix[0] * x + matrix[2] * y + matrix[4]; - xnew[i].y = matrix[1] * x + matrix[3] * y + matrix[5]; - } - xnew[i].code = ART_END; - - return xnew; -} - -/** - * art_vpath_bbox_drect: Determine bounding box of vpath. - * @vec: Source vpath. - * @drect: Where to store bounding box. - * - * Determines bounding box of @vec, and stores it in @drect. - **/ -void -art_vpath_bbox_drect (const ArtVpath *vec, ArtDRect *drect) -{ - int i; - double x0, y0, x1, y1; - - if (vec[0].code == ART_END) - { - x0 = y0 = x1 = y1 = 0; - } - else - { - x0 = x1 = vec[0].x; - y0 = y1 = vec[0].y; - for (i = 1; vec[i].code != ART_END; i++) - { - if (vec[i].x < x0) x0 = vec[i].x; - if (vec[i].x > x1) x1 = vec[i].x; - if (vec[i].y < y0) y0 = vec[i].y; - if (vec[i].y > y1) y1 = vec[i].y; - } - } - drect->x0 = x0; - drect->y0 = y0; - drect->x1 = x1; - drect->y1 = y1; -} - -/** - * art_vpath_bbox_irect: Determine integer bounding box of vpath. - * @vec: Source vpath. - * idrect: Where to store bounding box. - * - * Determines integer bounding box of @vec, and stores it in @irect. - **/ -void -art_vpath_bbox_irect (const ArtVpath *vec, ArtIRect *irect) -{ - ArtDRect drect; - - art_vpath_bbox_drect (vec, &drect); - art_drect_to_irect (irect, &drect); -} - -#define PERTURBATION 2e-3 - -/** - * art_vpath_perturb: Perturb each point in vpath by small random amount. - * @src: Source vpath. - * - * Perturbs each of the points by a small random amount. This is - * helpful for cheating in cases when algorithms haven't attained - * numerical stability yet. - * - * Return value: Newly allocated vpath containing perturbed @src. - **/ -ArtVpath * -art_vpath_perturb (ArtVpath *src) -{ - int i; - int size; - ArtVpath *xnew; - double x, y; - double x_start, y_start; - int open; - - for (i = 0; src[i].code != ART_END; i++); - size = i; - - xnew = (ArtVpath*)art_new (ArtVpath, size + 1); - - x_start = 0; - y_start = 0; - open = 0; - for (i = 0; i < size; i++) - { - xnew[i].code = src[i].code; - x = src[i].x + (PERTURBATION * rand ()) / RAND_MAX - PERTURBATION * 0.5; - y = src[i].y + (PERTURBATION * rand ()) / RAND_MAX - PERTURBATION * 0.5; - if (src[i].code == ART_MOVETO) - { - x_start = x; - y_start = y; - open = 0; - } - else if (src[i].code == ART_MOVETO_OPEN) - open = 1; - if (!open && (i + 1 == size || src[i + 1].code != ART_LINETO)) - { - x = x_start; - y = y_start; - } - xnew[i].x = x; - xnew[i].y = y; - } - xnew[i].code = ART_END; - - return xnew; -} diff -Nru swftools-0.9.0/lib/art/art_vpath_dash.c swftools-0.9.2/lib/art/art_vpath_dash.c --- swftools-0.9.0/lib/art/art_vpath_dash.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath_dash.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1999-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* Apply a dash style to a vector path. */ - -#include "config.h" -#include "art_vpath_dash.h" - -#include -#include - -#include "art_misc.h" - -#include "art_vpath.h" - - -/* Return the length of the largest subpath within vpath */ -static int -art_vpath_dash_max_subpath (const ArtVpath *vpath) -{ - int max_subpath; - int i; - int start; - - max_subpath = 0; - start = 0; - for (i = 0; vpath[i].code != ART_END; i++) - { - if (vpath[i].code == ART_MOVETO || vpath[i].code == ART_MOVETO_OPEN) - { - if (i - start > max_subpath) - max_subpath = i - start; - start = i; - } - } - if (i - start > max_subpath) - max_subpath = i - start; - - return max_subpath; -} - -/** - * art_vpath_dash: Add dash style to vpath. - * @vpath: Original vpath. - * @dash: Dash style. - * - * Creates a new vpath that is the result of applying dash style @dash - * to @vpath. - * - * This implementation has two known flaws: - * - * First, it adds a spurious break at the beginning of the vpath. The - * only way I see to resolve this flaw is to run the state forward one - * dash break at the beginning, and fix up by looping back to the - * first dash break at the end. This is doable but of course adds some - * complexity. - * - * Second, it does not suppress output points that are within epsilon - * of each other. - * - * Return value: Newly created vpath. - **/ -ArtVpath * -art_vpath_dash (const ArtVpath *vpath, const ArtVpathDash *dash) -{ - int max_subpath; - double *dists; - ArtVpath *result; - int n_result, n_result_max; - int start, end; - int i; - double total_dist; - - /* state while traversing dasharray - offset is offset of current dash - value, toggle is 0 for "off" and 1 for "on", and phase is the distance - in, >= 0, < dash->dash[offset]. */ - int offset, toggle; - double phase; - - /* initial values */ - int offset_init, toggle_init; - double phase_init; - - max_subpath = art_vpath_dash_max_subpath (vpath); - dists = art_new (double, max_subpath); - - n_result = 0; - n_result_max = 16; - result = art_new (ArtVpath, n_result_max); - - /* determine initial values of dash state */ - toggle_init = 1; - offset_init = 0; - phase_init = dash->offset; - while (phase_init >= dash->dash[offset_init]) - { - toggle_init = !toggle_init; - phase_init -= dash->dash[offset_init]; - offset_init++; - if (offset_init == dash->n_dash) - offset_init = 0; - } - - for (start = 0; vpath[start].code != ART_END; start = end) - { - for (end = start + 1; vpath[end].code == ART_LINETO; end++); - /* subpath is [start..end) */ - total_dist = 0; - for (i = start; i < end - 1; i++) - { - double dx, dy; - - dx = vpath[i + 1].x - vpath[i].x; - dy = vpath[i + 1].y - vpath[i].y; - dists[i - start] = sqrt (dx * dx + dy * dy); - total_dist += dists[i - start]; - } - if (total_dist <= dash->dash[offset_init] - phase_init) - { - /* subpath fits entirely within first dash */ - if (toggle_init) - { - for (i = start; i < end; i++) - art_vpath_add_point (&result, &n_result, &n_result_max, - vpath[i].code, vpath[i].x, vpath[i].y); - } - } - else - { - /* subpath is composed of at least one dash - thus all - generated pieces are open */ - double dist; - - phase = phase_init; - offset = offset_init; - toggle = toggle_init; - dist = 0; - i = start; - if (toggle) - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_MOVETO_OPEN, vpath[i].x, vpath[i].y); - while (i != end - 1) - { - if (dists[i - start] - dist > dash->dash[offset] - phase) - { - /* dash boundary is next */ - double a; - double x, y; - - dist += dash->dash[offset] - phase; - a = dist / dists[i - start]; - x = vpath[i].x + a * (vpath[i + 1].x - vpath[i].x); - y = vpath[i].y + a * (vpath[i + 1].y - vpath[i].y); - art_vpath_add_point (&result, &n_result, &n_result_max, - toggle ? ART_LINETO : ART_MOVETO_OPEN, - x, y); - /* advance to next dash */ - toggle = !toggle; - phase = 0; - offset++; - if (offset == dash->n_dash) - offset = 0; - } - else - { - /* end of line in vpath is next */ - phase += dists[i - start] - dist; - i++; - dist = 0; - if (toggle) - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_LINETO, vpath[i].x, vpath[i].y); - } - } - } - } - - art_vpath_add_point (&result, &n_result, &n_result_max, - ART_END, 0, 0); - - art_free (dists); - - return result; -} diff -Nru swftools-0.9.0/lib/art/art_vpath_dash.h swftools-0.9.2/lib/art/art_vpath_dash.h --- swftools-0.9.0/lib/art/art_vpath_dash.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath_dash.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1999 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_VPATH_DASH_H__ -#define __ART_VPATH_DASH_H__ - -/* Apply a dash style to a vector path. */ - -#ifdef LIBART_COMPILATION -#include "art_vpath.h" -#else -#include "art_vpath.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtVpathDash ArtVpathDash; - -struct _ArtVpathDash { - double offset; - int n_dash; - double *dash; -}; - -ArtVpath * -art_vpath_dash (const ArtVpath *vpath, const ArtVpathDash *dash); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_VPATH_DASH_H__ */ diff -Nru swftools-0.9.0/lib/art/art_vpath.h swftools-0.9.2/lib/art/art_vpath.h --- swftools-0.9.0/lib/art/art_vpath.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_VPATH_H__ -#define __ART_VPATH_H__ - -#ifdef LIBART_COMPILATION -#include "art_rect.h" -#include "art_pathcode.h" -#else -#include "art_rect.h" -#include "art_pathcode.h" -#endif - -/* Basic data structures and constructors for simple vector paths */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct _ArtVpath ArtVpath; - -/* CURVETO is not allowed! */ -struct _ArtVpath { - ArtPathcode code; - double x; - double y; -}; - -/* Some of the functions need to go into their own modules */ - -void -art_vpath_add_point (ArtVpath **p_vpath, int *pn_points, int *pn_points_max, - ArtPathcode code, double x, double y); - -ArtVpath * -art_vpath_new_circle (double x, double y, double r); - -ArtVpath * -art_vpath_affine_transform (const ArtVpath *src, const double matrix[6]); - -void -art_vpath_bbox_drect (const ArtVpath *vec, ArtDRect *drect); - -void -art_vpath_bbox_irect (const ArtVpath *vec, ArtIRect *irect); - -ArtVpath * -art_vpath_perturb (ArtVpath *src); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_VPATH_H__ */ diff -Nru swftools-0.9.0/lib/art/art_vpath_svp.c swftools-0.9.2/lib/art/art_vpath_svp.c --- swftools-0.9.0/lib/art/art_vpath_svp.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath_svp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998-2000 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* "Unsort" a sorted vector path into an ordinary vector path. */ - -#include "config.h" -#include "art_vpath_svp.h" - -#include /* for printf - debugging */ -#include "art_misc.h" - -#include "art_vpath.h" -#include "art_svp.h" - -typedef struct _ArtVpathSVPEnd ArtVpathSVPEnd; - -struct _ArtVpathSVPEnd { - int seg_num; - int which; /* 0 = top, 1 = bottom */ - double x, y; -}; - -#define EPSILON 1e-6 - -static int -art_vpath_svp_point_compare (double x1, double y1, double x2, double y2) -{ - if (y1 - EPSILON > y2) return 1; - if (y1 + EPSILON < y2) return -1; - if (x1 - EPSILON > x2) return 1; - if (x1 + EPSILON < x2) return -1; - return 0; -} - -static int -art_vpath_svp_compare (const void *s1, const void *s2) -{ - const ArtVpathSVPEnd *e1 = (ArtVpathSVPEnd *)s1; - const ArtVpathSVPEnd *e2 = (ArtVpathSVPEnd *)s2; - - return art_vpath_svp_point_compare (e1->x, e1->y, e2->x, e2->y); -} - -/* Convert from sorted vector path representation into regular - vector path representation. - - Status of this routine: - - Basic correctness: Only works with closed paths. - - Numerical stability: Not known to work when more than two segments - meet at a point. - - Speed: Should be pretty good. - - Precision: Does not degrade precision. - -*/ -/** - * art_vpath_from_svp: Convert from svp to vpath form. - * @svp: Original #ArtSVP. - * - * Converts the sorted vector path @svp into standard vpath form. - * - * Return value: the newly allocated vpath. - **/ -ArtVpath * -art_vpath_from_svp (const ArtSVP *svp) -{ - int n_segs = svp->n_segs; - ArtVpathSVPEnd *ends; - ArtVpath *xnew; - int *visited; - int n_new, n_new_max; - int i, k; - int j = 0; /* Quiet compiler */ - int seg_num; - int first; - double last_x, last_y; - int n_points; - int pt_num; - - last_x = 0; /* to eliminate "uninitialized" warning */ - last_y = 0; - - ends = (ArtVpathSVPEnd*)art_new (ArtVpathSVPEnd, n_segs * 2); - for (i = 0; i < svp->n_segs; i++) - { - int lastpt; - - ends[i * 2].seg_num = i; - ends[i * 2].which = 0; - ends[i * 2].x = svp->segs[i].points[0].x; - ends[i * 2].y = svp->segs[i].points[0].y; - - lastpt = svp->segs[i].n_points - 1; - ends[i * 2 + 1].seg_num = i; - ends[i * 2 + 1].which = 1; - ends[i * 2 + 1].x = svp->segs[i].points[lastpt].x; - ends[i * 2 + 1].y = svp->segs[i].points[lastpt].y; - } - qsort (ends, n_segs * 2, sizeof (ArtVpathSVPEnd), art_vpath_svp_compare); - - n_new = 0; - n_new_max = 16; /* I suppose we _could_ estimate this from traversing - the svp, so we don't have to reallocate */ - xnew = (ArtVpath*)art_new (ArtVpath, n_new_max); - - visited = (int*)art_new (int, n_segs); - for (i = 0; i < n_segs; i++) - visited[i] = 0; - - first = 1; - for (i = 0; i < n_segs; i++) - { - if (!first) - { - /* search for the continuation of the existing subpath */ - /* This could be a binary search (which is why we sorted, above) */ - for (j = 0; j < n_segs * 2; j++) - { - if (!visited[ends[j].seg_num] && - art_vpath_svp_point_compare (last_x, last_y, - ends[j].x, ends[j].y) == 0) - break; - } - if (j == n_segs * 2) - first = 1; - } - if (first) - { - /* start a new subpath */ - for (j = 0; j < n_segs * 2; j++) - if (!visited[ends[j].seg_num]) - break; - } - if (j == n_segs * 2) - { - printf ("failure\n"); - } - seg_num = ends[j].seg_num; - n_points = svp->segs[seg_num].n_points; - for (k = 0; k < n_points; k++) - { - pt_num = svp->segs[seg_num].dir ? k : n_points - (1 + k); - if (k == 0) - { - if (first) - { - art_vpath_add_point (&xnew, &n_new, &n_new_max, - ART_MOVETO, - svp->segs[seg_num].points[pt_num].x, - svp->segs[seg_num].points[pt_num].y); - } - } - else - { - art_vpath_add_point (&xnew, &n_new, &n_new_max, - ART_LINETO, - svp->segs[seg_num].points[pt_num].x, - svp->segs[seg_num].points[pt_num].y); - if (k == n_points - 1) - { - last_x = svp->segs[seg_num].points[pt_num].x; - last_y = svp->segs[seg_num].points[pt_num].y; - /* to make more robust, check for meeting first_[xy], - set first if so */ - } - } - first = 0; - } - visited[seg_num] = 1; - } - - art_vpath_add_point (&xnew, &n_new, &n_new_max, - ART_END, 0, 0); - art_free (visited); - art_free (ends); - return xnew; -} diff -Nru swftools-0.9.0/lib/art/art_vpath_svp.h swftools-0.9.2/lib/art/art_vpath_svp.h --- swftools-0.9.0/lib/art/art_vpath_svp.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/art_vpath_svp.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* Libart_LGPL - library of basic graphic primitives - * Copyright (C) 1998 Raph Levien - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, 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 License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __ART_VPATH_SVP_H__ -#define __ART_VPATH_SVP_H__ - -/* "Unsort" a sorted vector path into an ordinary vector path. */ - -#ifdef LIBART_COMPILATION -#include "art_svp.h" -#include "art_vpath.h" -#else -#include "art_svp.h" -#include "art_vpath.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -ArtVpath *art_vpath_from_svp (const ArtSVP *svp); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __ART_VPATH_SVP_H__ */ diff -Nru swftools-0.9.0/lib/art/config.h swftools-0.9.2/lib/art/config.h --- swftools-0.9.0/lib/art/config.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ diff -Nru swftools-0.9.0/lib/art/libart.h swftools-0.9.2/lib/art/libart.h --- swftools-0.9.0/lib/art/libart.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/libart.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -#ifndef LIBART_H -#define LIBART_H 1 - -#include "art_affine.h" -#include "art_alphagamma.h" -#include "art_bpath.h" -#include "art_filterlevel.h" -#include "art_gray_svp.h" -#include "art_misc.h" -#include "art_pathcode.h" -#include "art_pixbuf.h" -#include "art_point.h" -#include "art_rect.h" -#include "art_rect_svp.h" -#include "art_rect_uta.h" -#include "art_rgb.h" -#include "art_rgb_affine.h" -#include "art_rgb_bitmap_affine.h" -#include "art_rgb_pixbuf_affine.h" -#include "art_rgb_rgba_affine.h" -#include "art_rgb_svp.h" -#include "art_svp.h" -#include "art_svp_ops.h" -#include "art_svp_point.h" -#include "art_svp_render_aa.h" -#include "art_svp_vpath.h" -#include "art_svp_vpath_stroke.h" -#include "art_svp_wind.h" -#include "art_uta.h" -#include "art_uta_ops.h" -#include "art_uta_rect.h" -#include "art_uta_svp.h" -#include "art_uta_vpath.h" -#include "art_vpath.h" -#include "art_vpath_bpath.h" -#include "art_vpath_dash.h" -#include "art_vpath_svp.h" - -#endif diff -Nru swftools-0.9.0/lib/art/Makefile.in swftools-0.9.2/lib/art/Makefile.in --- swftools-0.9.0/lib/art/Makefile.in 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/art/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -top_builddir = ../.. -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -include ../../Makefile.common - -libart_objects = art_affine.$(O) art_alphagamma.$(O) art_bpath.$(O) art_gray_svp.$(O) art_misc.$(O) art_pixbuf.$(O) art_rect.$(O) art_rect_svp.$(O) art_rect_uta.$(O) art_render.$(O) art_render_gradient.$(O) art_render_mask.$(O) art_render_svp.$(O) art_rgb.$(O) art_rgb_a_affine.$(O) art_rgb_affine.$(O) art_rgb_affine_private.$(O) art_rgb_bitmap_affine.$(O) art_rgb_pixbuf_affine.$(O) art_rgb_rgba_affine.$(O) art_rgb_svp.$(O) art_rgba.$(O) art_svp.$(O) art_svp_intersect.$(O) art_svp_ops.$(O) art_svp_point.$(O) art_svp_render_aa.$(O) art_svp_vpath.$(O) art_svp_vpath_stroke.$(O) art_svp_wind.$(O) art_uta.$(O) art_uta_ops.$(O) art_uta_rect.$(O) art_uta_svp.$(O) art_uta_vpath.$(O) art_vpath.$(O) art_vpath_bpath.$(O) art_vpath_dash.$(O) art_vpath_svp.$(O) - -all: libart$(A) - -libart$(A): $(libart_objects) - $(AR) r libart$(A) $(libart_objects) - $(RANLIB) libart$(A) - -%.$(O): %.c - $(C) $< -o $@ - -install: -uninstall: -clean: - rm -f *.o *.obj *.lo *.a *.lib *.la gmon.out - - diff -Nru swftools-0.9.0/lib/as3/abc.c swftools-0.9.2/lib/as3/abc.c --- swftools-0.9.0/lib/as3/abc.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/abc.c 2011-10-07 03:20:17.000000000 +0000 @@ -26,6 +26,7 @@ #include "../rfxswf.h" #include "../q.h" #include "abc.h" +#include "assets.h" char stringbuffer[2048]; @@ -49,12 +50,12 @@ fprintf(fo, "("); while(l) { char*s = multiname_tostring(l->multiname); - fprintf(fo, s); + fprintf(fo, "%s", s); free(s); if(i>=n-no) { s = constant_tostring(o->constant); fprintf(fo, " = "); - fprintf(fo, s); + fprintf(fo, "%s", s); free(s); o = o->next; } @@ -74,13 +75,13 @@ int t; int num_metadata = swf_GetU30(tag); - DEBUG printf("%d metadata\n"); + DEBUG printf("%d metadata\n", num_metadata); for(t=0;tmetadata = array_new(); + f->metadata = array_new1(); - f->methods = array_new(); - f->classes = array_new(); - f->scripts = array_new(); - f->method_bodies = array_new(); + f->methods = array_new1(); + f->classes = array_new1(); + f->scripts = array_new1(); + f->method_bodies = array_new1(); f->flags = ABCFILE_LAZY; return f; @@ -157,6 +158,20 @@ { list_append(c->interfaces, multiname_clone(interface)); } +char*abc_class_fullname(abc_class_t*cls) +{ + const char*package = cls->classname->ns->name; + const char*name = cls->classname->name; + int l1 = strlen(package); + int l2 = strlen(name); + char*fullname = malloc(l1+l2+2); + if(l1) { + memcpy(fullname, package, l1); + fullname[l1++]='.'; + } + memcpy(fullname+l1, name, l2+1); + return fullname; +} void abc_method_init(abc_method_t*m, abc_file_t*file, multiname_t*returntype, char body) { @@ -451,7 +466,7 @@ } else if(kind == TRAIT_CLASS) { // class trait->slot_id = swf_GetU30(tag); trait->cls = (abc_class_t*)array_getvalue(file->classes, swf_GetU30(tag)); - DEBUG printf(" class %s %d %d\n", name, trait->slot_id, trait->cls); + DEBUG printf(" class %s %d %p\n", name, trait->slot_id, (int)trait->cls); } else if(kind == TRAIT_SLOT || kind == TRAIT_CONST) { // slot, const trait->slot_id = swf_GetU30(tag); trait->type_name = multiname_clone(pool_lookup_multiname(pool, swf_GetU30(tag))); @@ -620,7 +635,7 @@ int s; array_t*items = (array_t*)array_getvalue(file->metadata, t); for(s=0;snum;s++) { - fprintf(fo, "%s# %s=%s\n", prefix, array_getkey(items, s), array_getvalue(items,s)); + fprintf(fo, "%s# %s=%s\n", prefix, (char*)array_getkey(items, s), (char*)array_getvalue(items,s)); } fprintf(fo, "%s#\n", prefix); } @@ -678,6 +693,11 @@ dump_method(fo, prefix2, "", "constructor", n, cls->constructor, file, methods_seen); free(n); traits_dump(fo, prefix2,cls->traits, file, methods_seen); + + if(cls->asset) { + swf_DumpAsset(fo, cls->asset, prefix2); + } + fprintf(fo, "%s}\n", prefix); } fprintf(fo, "%s\n", prefix); @@ -755,9 +775,9 @@ m->flags = swf_GetU8(tag); - DEBUG printf("method %d) %s ", m->name); + DEBUG printf("method %d) %s ", t, m->name); DEBUG params_dump(stdout, m->parameters, m->optional_parameters); - DEBUG printf("flags=%02x\n", t, m->flags); + DEBUG printf("flags=%02x\n", m->flags); if(m->flags&0x08) { m->optional_parameters = list_new(); diff -Nru swftools-0.9.0/lib/as3/abc.h swftools-0.9.2/lib/as3/abc.h --- swftools-0.9.0/lib/as3/abc.h 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/abc.h 2010-11-12 18:55:29.000000000 +0000 @@ -33,7 +33,14 @@ DECLARE(abc_interface); DECLARE(abc_class); DECLARE(abc_exception); +DECLARE(abc_asset); +DECLARE(asset_dependency); +DECLARE(asset_tag); +DECLARE_LIST(abc_asset); +DECLARE_LIST(asset_dependency); +DECLARE_LIST(asset_tag); DECLARE_LIST(abc_exception); +DECLARE_LIST(TAG); #include "code.h" #include "opcodes.h" @@ -133,8 +140,9 @@ U8 flags; + abc_asset_t*asset; // swf tags needed for this class + int init_scope_depth; // volatile, might be increased during code verification - int index; //filled in during writing }; @@ -148,6 +156,7 @@ void abc_class_interface(abc_class_t*c); void abc_class_protectedNS(abc_class_t*c, char*namespace); void abc_class_add_interface(abc_class_t*c, multiname_t*interface); +char*abc_class_fullname(abc_class_t*cls); trait_t* traits_find_slotid(trait_list_t*traits, int slotid); @@ -197,6 +206,20 @@ trait_list_t*traits; } abc_script_t; +struct _asset_dependency { + abc_asset_t*asset; + int patch_pos; +}; +struct _asset_tag { + TAG*tag; + asset_dependency_t*deps; + int num_deps; +}; +struct _abc_asset { + asset_tag_list_t*tags; + U16 id; +}; + abc_method_t* abc_nullmethod(abc_file_t*file); abc_script_t* abc_initscript(abc_file_t*file); trait_t*abc_initscript_addClassTrait(abc_script_t*script, multiname_t*multiname, abc_class_t*cls); diff -Nru swftools-0.9.0/lib/as3/assets.c swftools-0.9.2/lib/as3/assets.c --- swftools-0.9.0/lib/as3/assets.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/as3/assets.c 2010-11-12 18:54:00.000000000 +0000 @@ -0,0 +1,216 @@ +#include +#include "../types.h" +#include "../rfxswf.h" +#include "assets.h" + +static void add_dependencies(asset_resolver_t*assets, abc_asset_t*asset, asset_tag_t*atag) +{ + TAG*tag = atag->tag; + atag->num_deps = swf_GetNumUsedIDs(tag); + int*positions = malloc(sizeof(int)*atag->num_deps); + atag->deps = malloc(atag->num_deps*sizeof(atag->deps[0])); + swf_GetUsedIDs(tag, positions); + int t; + for(t=0;tnum_deps;t++) { + asset_dependency_t*d = &atag->deps[t]; + d->patch_pos = positions[t]; + U16 id = GET16(&tag->data[positions[t]]); + d->asset = assets->id2asset[id]; + if(!d->asset) { + fprintf(stderr, "Error: ID %d referenced, but not defined\n", id); + } + } + free(positions); +} + +asset_resolver_t* swf_ParseAssets(SWF*swf) +{ + NEW(asset_resolver_t,assets); + assets->name2asset = dict_new2(&charptr_type); + assets->id2asset = rfx_calloc(sizeof(abc_asset_t*)*65536); + + TAG*tag = swf->firstTag; + while(tag) { + if(swf_isDefiningTag(tag)) { + NEW(abc_asset_t, asset); + assets->id2asset[swf_GetDefineID(tag)] = asset; + } + tag = tag->next; + } + + tag = swf->firstTag; + while(tag) { + if(swf_isDefiningTag(tag)) { + abc_asset_t*asset = assets->id2asset[swf_GetDefineID(tag)]; + assert(asset); + if(asset) { + NEW(asset_tag_t,t); + t->tag = tag; + list_append(asset->tags, t); + add_dependencies(assets, asset, t); + } + } else if(swf_isPseudoDefiningTag(tag)) { + abc_asset_t*asset = assets->id2asset[swf_GetDefineID(tag)]; + if(asset) { + NEW(asset_tag_t,t); + t->tag = tag; + list_append(asset->tags, t); + add_dependencies(assets, asset, t); + } + } else if(tag->id == ST_SYMBOLCLASS) { + int t, num = swf_GetU16(tag); + for(t=0;tmainclass_id = id; + } else { + abc_asset_t*asset = assets->id2asset[id]; + if(!asset) { + fprintf(stderr, "Error: ID %d referenced, but not defined.\n", id); + } else { + char*name = swf_GetString(tag); + dict_put(assets->name2asset, name, asset); + } + } + } + } + tag = tag->next; + } + return assets; +} + +void swf_ResolveAssets(asset_resolver_t*assets, abc_file_t*file) +{ + int num = assets->name2asset->num; + int resolved = 0; + int t; + for(t=0;tclasses->num;t++) { + abc_class_t*cls = (abc_class_t*)array_getvalue(file->classes, t); + char*fullname = abc_class_fullname(cls); + abc_asset_t*a = (abc_asset_t*)dict_lookup(assets->name2asset, fullname); + if(a) { + resolved++; + cls->asset = a; + } + free(fullname); + } +} + +static void dump_asset(FILE*fo, abc_asset_t*a, const char*prefix) +{ + asset_tag_list_t*t = a->tags; + while(t) { + TAG*tag = t->asset_tag->tag; + fprintf(fo, "%s[tag] %s defines ID %d\n", prefix, swf_TagGetName(tag), swf_GetDefineID(tag)); + char*prefix2 = allocprintf("%s ", prefix); + int i; + for(i=0;iasset_tag->num_deps;i++) { + asset_dependency_t*d = &t->asset_tag->deps[i]; + dump_asset(fo, d->asset, prefix2); + } + free(prefix2); + t = t->next; + } +} + +void swf_DumpAsset(FILE*fo, abc_asset_t*asset, const char*prefix) +{ + dump_asset(fo, asset, prefix); +} + +static TAG* write_tag(TAG*prev, TAG*tag) +{ + if(prev) { + prev->next = tag; + } + tag->prev = prev; + tag->next = 0; + prev = tag; + return prev; +} +static TAG*write_asset(TAG*tag, abc_asset_t*a, dict_t*written, U16*currentid) +{ + if(!dict_contains(written, a)) { + dict_put(written, a, 0); + a->id = (*currentid)++; + asset_tag_list_t*tags = a->tags; + + while(tags) { + asset_tag_t*t = tags->asset_tag; + int i; + for(i=0;inum_deps;i++) { + asset_dependency_t*dep = &t->deps[i]; + tag = write_asset(tag, dep->asset, written, currentid); + PUT16(&t->tag->data[dep->patch_pos], dep->asset->id); + } + swf_SetDefineID(t->tag, a->id); + tag = write_tag(tag, t->tag); + tags = tags->next; + } + } + return tag; +} + +void swf_WriteABCSymbols(TAG*tag, abc_file_t*file) +{ + int num = 0; + int t; + for(t=0;tclasses->num;t++) { + abc_class_t*cls = (abc_class_t*)array_getvalue(file->classes, t); + abc_asset_t*a = cls->asset; + if(a && a->tags) { + num++; + } + } + swf_SetU16(tag, num); + for(t=0;tclasses->num;t++) { + abc_class_t*cls = (abc_class_t*)array_getvalue(file->classes, t); + abc_asset_t*a = cls->asset; + if(a && a->tags) { + U16 id = swf_GetDefineID(a->tags->asset_tag->tag); + char*fullname = abc_class_fullname(cls); + swf_SetU16(tag, id); + swf_SetString(tag, fullname); + } + } +} + +TAG*swf_AssetsToTags(TAG*itag, asset_bundle_list_t*assets) +{ + U16 currentid = 1; + asset_bundle_list_t*l = assets; + dict_t*written = dict_new2(&ptr_type); + while(l) { + if(l->asset_bundle->used) { + abc_file_t*file = l->asset_bundle->file; + int t; + TAG* tag = 0; + for(t=0;tclasses->num;t++) { + abc_asset_t*a = ((abc_class_t*)array_getvalue(file->classes, t))->asset; + if(a) { + tag = write_asset(tag, a, written, ¤tid); + } + } + + tag = swf_InsertTag(tag, ST_DOABC); + swf_WriteABC(tag, file); + tag = swf_InsertTag(tag, ST_SYMBOLCLASS); + swf_WriteABCSymbols(tag, file); + + TAG*first = tag; + while(first && first->prev) + first=first->prev; + + if(!itag) { + itag = first; + } else { + itag->next = first; + first->prev = itag; + itag = tag; + } + } + l = l->next; + } + dict_destroy(written); + return itag; +} diff -Nru swftools-0.9.0/lib/as3/assets.h swftools-0.9.2/lib/as3/assets.h --- swftools-0.9.0/lib/as3/assets.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/as3/assets.h 2010-11-12 18:55:29.000000000 +0000 @@ -0,0 +1,18 @@ +#ifndef __abc_assets_h__ +#define __abc_assets_h__ +#include "abc.h" +#include "registry.h" + +typedef struct _asset_resolver { + SWF*swf; + abc_asset_t**id2asset; + dict_t*name2asset; + U16 mainclass_id; +} asset_resolver_t; + +asset_resolver_t* swf_ParseAssets(SWF*swf); +void swf_ResolveAssets(asset_resolver_t*swf, abc_file_t*file); +void swf_DumpAsset(FILE*fo, abc_asset_t*asset, const char*prefix); +TAG*swf_AssetsToTags(TAG*tag, asset_bundle_list_t*assets); + +#endif //__abc_assets_h__ diff -Nru swftools-0.9.0/lib/as3/builtin.c swftools-0.9.2/lib/as3/builtin.c --- swftools-0.9.0/lib/as3/builtin.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/builtin.c 2010-11-12 18:54:09.000000000 +0000 @@ -20,8 +20,28 @@ static varinfo_t flash_text_TextFormat_tabStops; static varinfo_t flash_text_TextFormat_blockIndent; static varinfo_t flash_text_TextFormat_font; +static varinfo_t flash_text_TextFormat_leading; +static varinfo_t flash_text_TextFormat_bold; +static varinfo_t flash_text_TextFormat_underline; +static varinfo_t flash_text_TextFormat_color; +static varinfo_t flash_text_TextFormat_letterSpacing; +static varinfo_t flash_text_TextFormat_kerning; +static varinfo_t flash_text_TextFormat_target; +static varinfo_t flash_text_TextFormat_italic; +static varinfo_t flash_text_TextFormat_rightMargin; +static varinfo_t flash_text_TextFormat_bullet; +static varinfo_t flash_text_TextFormat_url; +static varinfo_t flash_text_TextFormat_size; +static varinfo_t flash_text_TextFormat_indent; +static varinfo_t flash_text_TextFormat_leftMargin; +static varinfo_t flash_text_TextFormat_display; +static varinfo_t flash_text_TextFormat_align; +static varinfo_t flash_text_TextFormat_tabStops; +static varinfo_t flash_text_TextFormat_blockIndent; +static varinfo_t flash_text_TextFormat_font; static classinfo_t flash_filters_BitmapFilter; static methodinfo_t flash_filters_BitmapFilter_clone; +static methodinfo_t flash_filters_BitmapFilter_clone; static classinfo_t flash_filters_DropShadowFilter; static varinfo_t flash_filters_DropShadowFilter_alpha; static varinfo_t flash_filters_DropShadowFilter_strength; @@ -35,21 +55,21 @@ static varinfo_t flash_filters_DropShadowFilter_blurY; static varinfo_t flash_filters_DropShadowFilter_distance; static methodinfo_t flash_filters_DropShadowFilter_clone; +static varinfo_t flash_filters_DropShadowFilter_alpha; +static varinfo_t flash_filters_DropShadowFilter_strength; +static varinfo_t flash_filters_DropShadowFilter_quality; +static varinfo_t flash_filters_DropShadowFilter_angle; +static varinfo_t flash_filters_DropShadowFilter_knockout; +static varinfo_t flash_filters_DropShadowFilter_color; +static varinfo_t flash_filters_DropShadowFilter_hideObject; +static varinfo_t flash_filters_DropShadowFilter_inner; +static varinfo_t flash_filters_DropShadowFilter_blurX; +static varinfo_t flash_filters_DropShadowFilter_blurY; +static varinfo_t flash_filters_DropShadowFilter_distance; +static methodinfo_t flash_filters_DropShadowFilter_clone; static classinfo_t adobe_utils_CustomActions; -static varinfo_t adobe_utils_CustomActions_actionsList; -static methodinfo_t adobe_utils_CustomActions_uninstallActions; -static methodinfo_t adobe_utils_CustomActions_getActions; -static methodinfo_t adobe_utils_CustomActions_installActions; static classinfo_t flash_text_engine_TextLineValidity; -static varinfo_t flash_text_engine_TextLineValidity_STATIC; -static varinfo_t flash_text_engine_TextLineValidity_VALID; -static varinfo_t flash_text_engine_TextLineValidity_INVALID; -static varinfo_t flash_text_engine_TextLineValidity_POSSIBLY_INVALID; static classinfo_t flash_display_LineScaleMode; -static varinfo_t flash_display_LineScaleMode_NORMAL; -static varinfo_t flash_display_LineScaleMode_VERTICAL; -static varinfo_t flash_display_LineScaleMode_NONE; -static varinfo_t flash_display_LineScaleMode_HORIZONTAL; static classinfo_t flash_geom_Transform; static varinfo_t flash_geom_Transform_matrix; static varinfo_t flash_geom_Transform_perspectiveProjection; @@ -59,42 +79,46 @@ static varinfo_t flash_geom_Transform_pixelBounds; static varinfo_t flash_geom_Transform_matrix3D; static varinfo_t flash_geom_Transform_concatenatedColorTransform; +static varinfo_t flash_geom_Transform_matrix; +static varinfo_t flash_geom_Transform_perspectiveProjection; +static varinfo_t flash_geom_Transform_concatenatedMatrix; +static varinfo_t flash_geom_Transform_colorTransform; +static methodinfo_t flash_geom_Transform_getRelativeMatrix3D; +static varinfo_t flash_geom_Transform_pixelBounds; +static varinfo_t flash_geom_Transform_matrix3D; +static varinfo_t flash_geom_Transform_concatenatedColorTransform; static classinfo_t flash_ui_KeyLocation; -static varinfo_t flash_ui_KeyLocation_LEFT; -static varinfo_t flash_ui_KeyLocation_RIGHT; -static varinfo_t flash_ui_KeyLocation_NUM_PAD; -static varinfo_t flash_ui_KeyLocation_STANDARD; static classinfo_t flash_events_MouseEvent; static varinfo_t flash_events_MouseEvent_localY; -static varinfo_t flash_events_MouseEvent_MOUSE_OUT; static methodinfo_t flash_events_MouseEvent_updateAfterEvent; -static varinfo_t flash_events_MouseEvent_MOUSE_MOVE; static varinfo_t flash_events_MouseEvent_delta; -static varinfo_t flash_events_MouseEvent_MOUSE_WHEEL; static varinfo_t flash_events_MouseEvent_stageX; -static varinfo_t flash_events_MouseEvent_CLICK; -static varinfo_t flash_events_MouseEvent_ROLL_OUT; -static varinfo_t flash_events_MouseEvent_MOUSE_OVER; -static varinfo_t flash_events_MouseEvent_ROLL_OVER; static methodinfo_t flash_events_MouseEvent_toString; -static varinfo_t flash_events_MouseEvent_MOUSE_DOWN; static varinfo_t flash_events_MouseEvent_relatedObject; static varinfo_t flash_events_MouseEvent_isRelatedObjectInaccessible; static varinfo_t flash_events_MouseEvent_shiftKey; -static varinfo_t flash_events_MouseEvent_DOUBLE_CLICK; static varinfo_t flash_events_MouseEvent_stageY; static varinfo_t flash_events_MouseEvent_altKey; static methodinfo_t flash_events_MouseEvent_clone; static varinfo_t flash_events_MouseEvent_ctrlKey; static varinfo_t flash_events_MouseEvent_localX; static varinfo_t flash_events_MouseEvent_buttonDown; -static varinfo_t flash_events_MouseEvent_MOUSE_UP; +static varinfo_t flash_events_MouseEvent_localY; +static methodinfo_t flash_events_MouseEvent_updateAfterEvent; +static varinfo_t flash_events_MouseEvent_delta; +static varinfo_t flash_events_MouseEvent_stageX; +static methodinfo_t flash_events_MouseEvent_toString; +static varinfo_t flash_events_MouseEvent_relatedObject; +static varinfo_t flash_events_MouseEvent_isRelatedObjectInaccessible; +static varinfo_t flash_events_MouseEvent_shiftKey; +static varinfo_t flash_events_MouseEvent_stageY; +static varinfo_t flash_events_MouseEvent_altKey; +static methodinfo_t flash_events_MouseEvent_clone; +static varinfo_t flash_events_MouseEvent_ctrlKey; +static varinfo_t flash_events_MouseEvent_localX; +static varinfo_t flash_events_MouseEvent_buttonDown; static classinfo_t flash_text_engine_LineJustification; -static varinfo_t flash_text_engine_LineJustification_ALL_INCLUDING_LAST; -static varinfo_t flash_text_engine_LineJustification_UNJUSTIFIED; -static varinfo_t flash_text_engine_LineJustification_ALL_BUT_LAST; static classinfo_t flash_media_Camera; -static methodinfo_t flash_media_Camera_getCamera; static varinfo_t flash_media_Camera_fps; static methodinfo_t flash_media_Camera_setMode; static varinfo_t flash_media_Camera_keyFrameInterval; @@ -113,7 +137,26 @@ static varinfo_t flash_media_Camera_muted; static varinfo_t flash_media_Camera_activityLevel; static varinfo_t flash_media_Camera_loopback; -static varinfo_t flash_media_Camera_names; +static methodinfo_t flash_media_Camera_setQuality; +static methodinfo_t flash_media_Camera_setMotionLevel; +static varinfo_t flash_media_Camera_fps; +static methodinfo_t flash_media_Camera_setMode; +static varinfo_t flash_media_Camera_keyFrameInterval; +static varinfo_t flash_media_Camera_motionTimeout; +static varinfo_t flash_media_Camera_width; +static methodinfo_t flash_media_Camera_setCursor; +static methodinfo_t flash_media_Camera_setLoopback; +static varinfo_t flash_media_Camera_height; +static varinfo_t flash_media_Camera_index; +static varinfo_t flash_media_Camera_name; +static varinfo_t flash_media_Camera_currentFPS; +static methodinfo_t flash_media_Camera_setKeyFrameInterval; +static varinfo_t flash_media_Camera_quality; +static varinfo_t flash_media_Camera_motionLevel; +static varinfo_t flash_media_Camera_bandwidth; +static varinfo_t flash_media_Camera_muted; +static varinfo_t flash_media_Camera_activityLevel; +static varinfo_t flash_media_Camera_loopback; static methodinfo_t flash_media_Camera_setQuality; static methodinfo_t flash_media_Camera_setMotionLevel; static methodinfo_t flash_net_registerClassAlias; @@ -132,6 +175,20 @@ static methodinfo_t flash_accessibility_AccessibilityImplementation_isLabeledBy; static methodinfo_t flash_accessibility_AccessibilityImplementation_accLocation; static methodinfo_t flash_accessibility_AccessibilityImplementation_getChildIDArray; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accState; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accName; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accSelection; +static methodinfo_t flash_accessibility_AccessibilityImplementation_accDoDefaultAction; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accFocus; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accDefaultAction; +static methodinfo_t flash_accessibility_AccessibilityImplementation_accSelect; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accValue; +static varinfo_t flash_accessibility_AccessibilityImplementation_stub; +static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accRole; +static varinfo_t flash_accessibility_AccessibilityImplementation_errno; +static methodinfo_t flash_accessibility_AccessibilityImplementation_isLabeledBy; +static methodinfo_t flash_accessibility_AccessibilityImplementation_accLocation; +static methodinfo_t flash_accessibility_AccessibilityImplementation_getChildIDArray; static classinfo_t flash_utils_ByteArray; static methodinfo_t flash_utils_ByteArray_writeBoolean; static methodinfo_t flash_utils_ByteArray_readDouble; @@ -164,7 +221,43 @@ static varinfo_t flash_utils_ByteArray_endian; static methodinfo_t flash_utils_ByteArray_readUnsignedShort; static methodinfo_t flash_utils_ByteArray_readUnsignedInt; -static varinfo_t flash_utils_ByteArray_defaultObjectEncoding; +static methodinfo_t flash_utils_ByteArray_readFloat; +static methodinfo_t flash_utils_ByteArray_compress; +static methodinfo_t flash_utils_ByteArray_writeUTFBytes; +static methodinfo_t flash_utils_ByteArray_readBoolean; +static methodinfo_t flash_utils_ByteArray_inflate; +static methodinfo_t flash_utils_ByteArray_readUTF; +static methodinfo_t flash_utils_ByteArray_writeBoolean; +static methodinfo_t flash_utils_ByteArray_readDouble; +static methodinfo_t flash_utils_ByteArray_toString; +static methodinfo_t flash_utils_ByteArray_writeByte; +static methodinfo_t flash_utils_ByteArray_writeObject; +static methodinfo_t flash_utils_ByteArray_readUTFBytes; +static methodinfo_t flash_utils_ByteArray_writeMultiByte; +static methodinfo_t flash_utils_ByteArray_uncompress; +static methodinfo_t flash_utils_ByteArray_readUnsignedByte; +static methodinfo_t flash_utils_ByteArray_writeInt; +static methodinfo_t flash_utils_ByteArray_deflate; +static methodinfo_t flash_utils_ByteArray_readMultiByte; +static methodinfo_t flash_utils_ByteArray_readBytes; +static methodinfo_t flash_utils_ByteArray_writeShort; +static varinfo_t flash_utils_ByteArray_position; +static methodinfo_t flash_utils_ByteArray_readShort; +static methodinfo_t flash_utils_ByteArray_writeUTF; +static methodinfo_t flash_utils_ByteArray_writeBytes; +static varinfo_t flash_utils_ByteArray_objectEncoding; +static methodinfo_t flash_utils_ByteArray_readObject; +static varinfo_t flash_utils_ByteArray_length; +static methodinfo_t flash_utils_ByteArray_writeUnsignedInt; +static methodinfo_t flash_utils_ByteArray_writeDouble; +static methodinfo_t flash_utils_ByteArray_writeFloat; +static methodinfo_t flash_utils_ByteArray_readInt; +static methodinfo_t flash_utils_ByteArray_readByte; +static varinfo_t flash_utils_ByteArray_bytesAvailable; +static methodinfo_t flash_utils_ByteArray_clear; +static varinfo_t flash_utils_ByteArray_endian; +static methodinfo_t flash_utils_ByteArray_readUnsignedShort; +static methodinfo_t flash_utils_ByteArray_readUnsignedInt; static methodinfo_t flash_utils_ByteArray_readFloat; static methodinfo_t flash_utils_ByteArray_compress; static methodinfo_t flash_utils_ByteArray_writeUTFBytes; @@ -173,7 +266,9 @@ static methodinfo_t flash_utils_ByteArray_readUTF; static methodinfo_t flash_sampler_stopSampling; static classinfo_t flash_events_SyncEvent; -static varinfo_t flash_events_SyncEvent_SYNC; +static methodinfo_t flash_events_SyncEvent_toString; +static methodinfo_t flash_events_SyncEvent_clone; +static varinfo_t flash_events_SyncEvent_changeList; static methodinfo_t flash_events_SyncEvent_toString; static methodinfo_t flash_events_SyncEvent_clone; static varinfo_t flash_events_SyncEvent_changeList; @@ -213,6 +308,40 @@ static methodinfo_t flash_net_Socket_writeUTFBytes; static methodinfo_t flash_net_Socket_readBoolean; static methodinfo_t flash_net_Socket_readUTF; +static methodinfo_t flash_net_Socket_writeBoolean; +static methodinfo_t flash_net_Socket_connect; +static methodinfo_t flash_net_Socket_readDouble; +static methodinfo_t flash_net_Socket_writeByte; +static methodinfo_t flash_net_Socket_writeObject; +static methodinfo_t flash_net_Socket_readUTFBytes; +static methodinfo_t flash_net_Socket_close; +static methodinfo_t flash_net_Socket_writeMultiByte; +static methodinfo_t flash_net_Socket_readUnsignedByte; +static methodinfo_t flash_net_Socket_writeInt; +static methodinfo_t flash_net_Socket_readMultiByte; +static methodinfo_t flash_net_Socket_readBytes; +static methodinfo_t flash_net_Socket_writeShort; +static methodinfo_t flash_net_Socket_readShort; +static methodinfo_t flash_net_Socket_writeUTF; +static varinfo_t flash_net_Socket_timeout; +static methodinfo_t flash_net_Socket_writeBytes; +static varinfo_t flash_net_Socket_connected; +static methodinfo_t flash_net_Socket_readObject; +static varinfo_t flash_net_Socket_objectEncoding; +static methodinfo_t flash_net_Socket_flush; +static methodinfo_t flash_net_Socket_writeUnsignedInt; +static methodinfo_t flash_net_Socket_writeDouble; +static methodinfo_t flash_net_Socket_writeFloat; +static methodinfo_t flash_net_Socket_readInt; +static methodinfo_t flash_net_Socket_readByte; +static varinfo_t flash_net_Socket_bytesAvailable; +static varinfo_t flash_net_Socket_endian; +static methodinfo_t flash_net_Socket_readUnsignedShort; +static methodinfo_t flash_net_Socket_readUnsignedInt; +static methodinfo_t flash_net_Socket_readFloat; +static methodinfo_t flash_net_Socket_writeUTFBytes; +static methodinfo_t flash_net_Socket_readBoolean; +static methodinfo_t flash_net_Socket_readUTF; static methodinfo_t _unescape; static classinfo_t flash_utils_Timer; static methodinfo_t flash_utils_Timer_reset; @@ -222,31 +351,52 @@ static methodinfo_t flash_utils_Timer_start; static varinfo_t flash_utils_Timer_currentCount; static varinfo_t flash_utils_Timer_delay; +static methodinfo_t flash_utils_Timer_reset; +static varinfo_t flash_utils_Timer_running; +static varinfo_t flash_utils_Timer_repeatCount; +static methodinfo_t flash_utils_Timer_stop; +static methodinfo_t flash_utils_Timer_start; +static varinfo_t flash_utils_Timer_currentCount; +static varinfo_t flash_utils_Timer_delay; static classinfo_t _Array; -static methodinfo_t _Array_sort; -static methodinfo_t _Array_unshift; -static varinfo_t _Array_RETURNINDEXEDARRAY; -static methodinfo_t _Array_indexOf; -static methodinfo_t _Array_join; +static methodinfo_t _Array_forEach; static methodinfo_t _Array_sortOn; -static varinfo_t _Array_UNIQUESORT; +static methodinfo_t _Array_indexOf; +static methodinfo_t _Array_splice; +static methodinfo_t _Array_lastIndexOf; +static methodinfo_t _Array_map; +static methodinfo_t _Array_concat; static methodinfo_t _Array_shift; -static methodinfo_t _Array_reverse; -static varinfo_t _Array_CASEINSENSITIVE; -static methodinfo_t _Array_forEach; -static varinfo_t _Array_DESCENDING; -static methodinfo_t _Array_pop; +static methodinfo_t _Array_unshift; +static methodinfo_t _Array_some; +static methodinfo_t _Array_filter; +static methodinfo_t _Array_join; static methodinfo_t _Array_slice; -static varinfo_t _Array_length; -static methodinfo_t _Array_map; +static methodinfo_t _Array_every; +static methodinfo_t _Array_pop; +static methodinfo_t _Array_sort; +static methodinfo_t _Array_reverse; static methodinfo_t _Array_push; -static methodinfo_t _Array_lastIndexOf; +static varinfo_t _Array_length; +static methodinfo_t _Array_forEach; +static methodinfo_t _Array_sortOn; +static methodinfo_t _Array_indexOf; static methodinfo_t _Array_splice; -static methodinfo_t _Array_every; +static methodinfo_t _Array_lastIndexOf; +static methodinfo_t _Array_map; static methodinfo_t _Array_concat; -static varinfo_t _Array_NUMERIC; -static methodinfo_t _Array_filter; +static methodinfo_t _Array_shift; +static methodinfo_t _Array_unshift; static methodinfo_t _Array_some; +static methodinfo_t _Array_filter; +static methodinfo_t _Array_join; +static methodinfo_t _Array_slice; +static methodinfo_t _Array_every; +static methodinfo_t _Array_pop; +static methodinfo_t _Array_sort; +static methodinfo_t _Array_reverse; +static methodinfo_t _Array_push; +static varinfo_t _Array_length; static classinfo_t flash_geom_ColorTransform; static varinfo_t flash_geom_ColorTransform_blueOffset; static varinfo_t flash_geom_ColorTransform_greenOffset; @@ -259,24 +409,29 @@ static methodinfo_t flash_geom_ColorTransform_toString; static varinfo_t flash_geom_ColorTransform_alphaMultiplier; static varinfo_t flash_geom_ColorTransform_redOffset; +static varinfo_t flash_geom_ColorTransform_blueOffset; +static varinfo_t flash_geom_ColorTransform_greenOffset; +static varinfo_t flash_geom_ColorTransform_greenMultiplier; +static varinfo_t flash_geom_ColorTransform_redMultiplier; +static varinfo_t flash_geom_ColorTransform_color; +static methodinfo_t flash_geom_ColorTransform_concat; +static varinfo_t flash_geom_ColorTransform_alphaOffset; +static varinfo_t flash_geom_ColorTransform_blueMultiplier; +static methodinfo_t flash_geom_ColorTransform_toString; +static varinfo_t flash_geom_ColorTransform_alphaMultiplier; +static varinfo_t flash_geom_ColorTransform_redOffset; static classinfo_t flash_text_GridFitType; -static varinfo_t flash_text_GridFitType_SUBPIXEL; -static varinfo_t flash_text_GridFitType_PIXEL; -static varinfo_t flash_text_GridFitType_NONE; static classinfo_t flash_filters_DisplacementMapFilterMode; -static varinfo_t flash_filters_DisplacementMapFilterMode_COLOR; -static varinfo_t flash_filters_DisplacementMapFilterMode_WRAP; -static varinfo_t flash_filters_DisplacementMapFilterMode_CLAMP; -static varinfo_t flash_filters_DisplacementMapFilterMode_IGNORE; static classinfo_t flash_text_TextFieldType; -static varinfo_t flash_text_TextFieldType_DYNAMIC; -static varinfo_t flash_text_TextFieldType_INPUT; static classinfo_t flash_display_IGraphicsStroke; static classinfo_t flash_media_SoundLoaderContext; static varinfo_t flash_media_SoundLoaderContext_checkPolicyFile; static varinfo_t flash_media_SoundLoaderContext_bufferTime; +static varinfo_t flash_media_SoundLoaderContext_checkPolicyFile; +static varinfo_t flash_media_SoundLoaderContext_bufferTime; static classinfo_t flash_net_IDynamicPropertyOutput; static methodinfo_t flash_net_IDynamicPropertyOutput_writeDynamicProperty; +static methodinfo_t flash_net_IDynamicPropertyOutput_writeDynamicProperty; static classinfo_t flash_display_IGraphicsData; static methodinfo_t flash_utils_getDefinitionByName; static classinfo_t _Function; @@ -284,20 +439,26 @@ static methodinfo_t _Function_apply; static methodinfo_t _Function_call; static varinfo_t _Function_prototype; +static varinfo_t _Function_length; +static methodinfo_t _Function_apply; +static methodinfo_t _Function_call; +static varinfo_t _Function_prototype; static classinfo_t flash_geom_PerspectiveProjection; static varinfo_t flash_geom_PerspectiveProjection_fieldOfView; static varinfo_t flash_geom_PerspectiveProjection_projectionCenter; static methodinfo_t flash_geom_PerspectiveProjection_toMatrix3D; static varinfo_t flash_geom_PerspectiveProjection_focalLength; +static varinfo_t flash_geom_PerspectiveProjection_fieldOfView; +static varinfo_t flash_geom_PerspectiveProjection_projectionCenter; +static methodinfo_t flash_geom_PerspectiveProjection_toMatrix3D; +static varinfo_t flash_geom_PerspectiveProjection_focalLength; static classinfo_t flash_text_engine_BreakOpportunity; -static varinfo_t flash_text_engine_BreakOpportunity_AUTO; -static varinfo_t flash_text_engine_BreakOpportunity_ANY; -static varinfo_t flash_text_engine_BreakOpportunity_ALL; -static varinfo_t flash_text_engine_BreakOpportunity_NONE; static methodinfo_t flash_sampler__getInvocationCount; static methodinfo_t _parseFloat; static classinfo_t flash_events_NetStatusEvent; -static varinfo_t flash_events_NetStatusEvent_NET_STATUS; +static methodinfo_t flash_events_NetStatusEvent_toString; +static varinfo_t flash_events_NetStatusEvent_info; +static methodinfo_t flash_events_NetStatusEvent_clone; static methodinfo_t flash_events_NetStatusEvent_toString; static varinfo_t flash_events_NetStatusEvent_info; static methodinfo_t flash_events_NetStatusEvent_clone; @@ -309,93 +470,101 @@ static varinfo_t flash_display_ShaderJob_height; static varinfo_t flash_display_ShaderJob_target; static varinfo_t flash_display_ShaderJob_progress; +static methodinfo_t flash_display_ShaderJob_cancel; +static varinfo_t flash_display_ShaderJob_width; +static methodinfo_t flash_display_ShaderJob_start; +static varinfo_t flash_display_ShaderJob_shader; +static varinfo_t flash_display_ShaderJob_height; +static varinfo_t flash_display_ShaderJob_target; +static varinfo_t flash_display_ShaderJob_progress; static classinfo_t _VerifyError; -static varinfo_t _VerifyError_length; static classinfo_t flash_events_AsyncErrorEvent; static methodinfo_t flash_events_AsyncErrorEvent_toString; -static varinfo_t flash_events_AsyncErrorEvent_ASYNC_ERROR; +static varinfo_t flash_events_AsyncErrorEvent_error; +static methodinfo_t flash_events_AsyncErrorEvent_clone; +static methodinfo_t flash_events_AsyncErrorEvent_toString; static varinfo_t flash_events_AsyncErrorEvent_error; static methodinfo_t flash_events_AsyncErrorEvent_clone; static classinfo_t flash_net_SharedObject; -static methodinfo_t flash_net_SharedObject_getLocal; -static methodinfo_t flash_net_SharedObject_getDiskUsage; static varinfo_t flash_net_SharedObject_objectEncoding; static varinfo_t flash_net_SharedObject_client; static methodinfo_t flash_net_SharedObject_setProperty; static methodinfo_t flash_net_SharedObject_clear; static methodinfo_t flash_net_SharedObject_flush; -static varinfo_t flash_net_SharedObject_defaultObjectEncoding; static methodinfo_t flash_net_SharedObject_connect; static varinfo_t flash_net_SharedObject_size; static methodinfo_t flash_net_SharedObject_setDirty; -static methodinfo_t flash_net_SharedObject_getRemote; static methodinfo_t flash_net_SharedObject_send; static methodinfo_t flash_net_SharedObject_close; -static methodinfo_t flash_net_SharedObject_deleteAll; +static varinfo_t flash_net_SharedObject_data; +static varinfo_t flash_net_SharedObject_objectEncoding; +static varinfo_t flash_net_SharedObject_client; +static methodinfo_t flash_net_SharedObject_setProperty; +static methodinfo_t flash_net_SharedObject_clear; +static methodinfo_t flash_net_SharedObject_flush; +static methodinfo_t flash_net_SharedObject_connect; +static varinfo_t flash_net_SharedObject_size; +static methodinfo_t flash_net_SharedObject_setDirty; +static methodinfo_t flash_net_SharedObject_send; +static methodinfo_t flash_net_SharedObject_close; static varinfo_t flash_net_SharedObject_data; static classinfo_t _Namespace; static methodinfo_t _Namespace_valueOf; -static varinfo_t _Namespace_length; +static methodinfo_t _Namespace_toString; +static varinfo_t _Namespace_uri; +static varinfo_t _Namespace_prefix; +static methodinfo_t _Namespace_valueOf; static methodinfo_t _Namespace_toString; static varinfo_t _Namespace_uri; static varinfo_t _Namespace_prefix; static methodinfo_t flash_utils_setTimeout; static classinfo_t flash_geom_Matrix3D; -static methodinfo_t flash_geom_Matrix3D_interpolateTo; +static methodinfo_t flash_geom_Matrix3D_decompose; static methodinfo_t flash_geom_Matrix3D_pointAt; -static methodinfo_t flash_geom_Matrix3D_interpolate; -static methodinfo_t flash_geom_Matrix3D_prependRotation; +static methodinfo_t flash_geom_Matrix3D_identity; static methodinfo_t flash_geom_Matrix3D_transformVector; -static methodinfo_t flash_geom_Matrix3D_transpose; -static methodinfo_t flash_geom_Matrix3D_prependScale; -static methodinfo_t flash_geom_Matrix3D_deltaTransformVector; +static methodinfo_t flash_geom_Matrix3D_appendRotation; +static varinfo_t flash_geom_Matrix3D_determinant; +static methodinfo_t flash_geom_Matrix3D_prependRotation; static varinfo_t flash_geom_Matrix3D_position; -static methodinfo_t flash_geom_Matrix3D_decompose; -static methodinfo_t flash_geom_Matrix3D_append; +static methodinfo_t flash_geom_Matrix3D_interpolateTo; +static methodinfo_t flash_geom_Matrix3D_appendScale; +static methodinfo_t flash_geom_Matrix3D_prepend; static methodinfo_t flash_geom_Matrix3D_recompose; -static methodinfo_t flash_geom_Matrix3D_clone; -static varinfo_t flash_geom_Matrix3D_rawData; -static varinfo_t flash_geom_Matrix3D_determinant; +static methodinfo_t flash_geom_Matrix3D_appendTranslation; static methodinfo_t flash_geom_Matrix3D_invert; -static methodinfo_t flash_geom_Matrix3D_appendScale; +static varinfo_t flash_geom_Matrix3D_rawData; +static methodinfo_t flash_geom_Matrix3D_prependTranslation; +static methodinfo_t flash_geom_Matrix3D_append; +static methodinfo_t flash_geom_Matrix3D_clone; +static methodinfo_t flash_geom_Matrix3D_prependScale; +static methodinfo_t flash_geom_Matrix3D_deltaTransformVector; static methodinfo_t flash_geom_Matrix3D_transformVectors; -static methodinfo_t flash_geom_Matrix3D_appendTranslation; +static methodinfo_t flash_geom_Matrix3D_transpose; +static methodinfo_t flash_geom_Matrix3D_decompose; +static methodinfo_t flash_geom_Matrix3D_pointAt; +static methodinfo_t flash_geom_Matrix3D_identity; +static methodinfo_t flash_geom_Matrix3D_transformVector; static methodinfo_t flash_geom_Matrix3D_appendRotation; +static varinfo_t flash_geom_Matrix3D_determinant; +static methodinfo_t flash_geom_Matrix3D_prependRotation; +static varinfo_t flash_geom_Matrix3D_position; +static methodinfo_t flash_geom_Matrix3D_interpolateTo; +static methodinfo_t flash_geom_Matrix3D_appendScale; static methodinfo_t flash_geom_Matrix3D_prepend; -static methodinfo_t flash_geom_Matrix3D_identity; +static methodinfo_t flash_geom_Matrix3D_recompose; +static methodinfo_t flash_geom_Matrix3D_appendTranslation; +static methodinfo_t flash_geom_Matrix3D_invert; +static varinfo_t flash_geom_Matrix3D_rawData; static methodinfo_t flash_geom_Matrix3D_prependTranslation; +static methodinfo_t flash_geom_Matrix3D_append; +static methodinfo_t flash_geom_Matrix3D_clone; +static methodinfo_t flash_geom_Matrix3D_prependScale; +static methodinfo_t flash_geom_Matrix3D_deltaTransformVector; +static methodinfo_t flash_geom_Matrix3D_transformVectors; +static methodinfo_t flash_geom_Matrix3D_transpose; static methodinfo_t flash_sampler_pauseSampling; static classinfo_t flash_system_Capabilities; -static varinfo_t flash_system_Capabilities_maxLevelIDC; -static varinfo_t flash_system_Capabilities_isDebugger; -static varinfo_t flash_system_Capabilities_hasStreamingAudio; -static varinfo_t flash_system_Capabilities_screenColor; -static varinfo_t flash_system_Capabilities_hasIME; -static varinfo_t flash_system_Capabilities_hasEmbeddedVideo; -static varinfo_t flash_system_Capabilities_hasTLS; -static varinfo_t flash_system_Capabilities_isEmbeddedInAcrobat; -static varinfo_t flash_system_Capabilities_hasScreenPlayback; -static varinfo_t flash_system_Capabilities_hasVideoEncoder; -static varinfo_t flash_system_Capabilities_hasAudioEncoder; -static varinfo_t flash_system_Capabilities_pixelAspectRatio; -static varinfo_t flash_system_Capabilities_hasStreamingVideo; -static varinfo_t flash_system_Capabilities_screenResolutionX; -static varinfo_t flash_system_Capabilities_hasScreenBroadcast; -static varinfo_t flash_system_Capabilities_hasAudio; -static varinfo_t flash_system_Capabilities_language; -static varinfo_t flash_system_Capabilities_manufacturer; -static varinfo_t flash_system_Capabilities_hasPrinting; -static varinfo_t flash_system_Capabilities_os; -static varinfo_t flash_system_Capabilities_localFileReadDisable; -static varinfo_t flash_system_Capabilities_hasMP3; -static varinfo_t flash_system_Capabilities_avHardwareDisable; -static varinfo_t flash_system_Capabilities_hasAccessibility; -static varinfo_t flash_system_Capabilities_version; -static varinfo_t flash_system_Capabilities_screenDPI; -static varinfo_t flash_system_Capabilities_playerType; -static varinfo_t flash_system_Capabilities_screenResolutionY; -static varinfo_t flash_system_Capabilities__internal; -static varinfo_t flash_system_Capabilities_serverString; static methodinfo_t flash_sampler_getSetterInvocationCount; static methodinfo_t flash_sampler_getGetterInvocationCount; static classinfo_t flash_filters_BlurFilter; @@ -403,6 +572,10 @@ static methodinfo_t flash_filters_BlurFilter_clone; static varinfo_t flash_filters_BlurFilter_quality; static varinfo_t flash_filters_BlurFilter_blurX; +static varinfo_t flash_filters_BlurFilter_blurY; +static methodinfo_t flash_filters_BlurFilter_clone; +static varinfo_t flash_filters_BlurFilter_quality; +static varinfo_t flash_filters_BlurFilter_blurX; static methodinfo_t _isFinite; static classinfo_t flash_media_Video; static methodinfo_t flash_media_Video_attachCamera; @@ -412,19 +585,23 @@ static varinfo_t flash_media_Video_videoHeight; static methodinfo_t flash_media_Video_attachNetStream; static varinfo_t flash_media_Video_smoothing; +static methodinfo_t flash_media_Video_attachCamera; +static varinfo_t flash_media_Video_videoWidth; +static methodinfo_t flash_media_Video_clear; +static varinfo_t flash_media_Video_deblocking; +static varinfo_t flash_media_Video_videoHeight; +static methodinfo_t flash_media_Video_attachNetStream; +static varinfo_t flash_media_Video_smoothing; static classinfo_t flash_text_engine_TextLineCreationResult; -static varinfo_t flash_text_engine_TextLineCreationResult_EMERGENCY; -static varinfo_t flash_text_engine_TextLineCreationResult_COMPLETE; -static varinfo_t flash_text_engine_TextLineCreationResult_SUCCESS; -static varinfo_t flash_text_engine_TextLineCreationResult_INSUFFICIENT_WIDTH; static classinfo_t _Error; -static methodinfo_t _Error_getErrorMessage; -static methodinfo_t _Error_throwError; -static varinfo_t _Error_length; -static varinfo_t _Error_name; static varinfo_t _Error_message; +static varinfo_t _Error_errorID; static methodinfo_t _Error_getStackTrace; +static varinfo_t _Error_name; +static varinfo_t _Error_message; static varinfo_t _Error_errorID; +static methodinfo_t _Error_getStackTrace; +static varinfo_t _Error_name; static classinfo_t flash_xml_XMLNode; static varinfo_t flash_xml_XMLNode_childNodes; static methodinfo_t flash_xml_XMLNode_appendChild; @@ -447,11 +624,53 @@ static methodinfo_t flash_xml_XMLNode_hasChildNodes; static methodinfo_t flash_xml_XMLNode_getPrefixForNamespace; static varinfo_t flash_xml_XMLNode_nodeValue; +static varinfo_t flash_xml_XMLNode_childNodes; +static methodinfo_t flash_xml_XMLNode_appendChild; +static varinfo_t flash_xml_XMLNode_nextSibling; +static varinfo_t flash_xml_XMLNode_nodeType; +static varinfo_t flash_xml_XMLNode_attributes; +static varinfo_t flash_xml_XMLNode_firstChild; +static varinfo_t flash_xml_XMLNode_parentNode; +static methodinfo_t flash_xml_XMLNode_toString; +static varinfo_t flash_xml_XMLNode_prefix; +static varinfo_t flash_xml_XMLNode_localName; +static varinfo_t flash_xml_XMLNode_nodeName; +static methodinfo_t flash_xml_XMLNode_getNamespaceForPrefix; +static methodinfo_t flash_xml_XMLNode_insertBefore; +static varinfo_t flash_xml_XMLNode_lastChild; +static methodinfo_t flash_xml_XMLNode_cloneNode; +static methodinfo_t flash_xml_XMLNode_removeNode; +static varinfo_t flash_xml_XMLNode_namespaceURI; +static varinfo_t flash_xml_XMLNode_previousSibling; +static methodinfo_t flash_xml_XMLNode_hasChildNodes; +static methodinfo_t flash_xml_XMLNode_getPrefixForNamespace; +static varinfo_t flash_xml_XMLNode_nodeValue; static classinfo_t flash_net_URLVariables; static methodinfo_t flash_net_URLVariables_toString; static methodinfo_t flash_net_URLVariables_decode; +static methodinfo_t flash_net_URLVariables_toString; +static methodinfo_t flash_net_URLVariables_decode; static classinfo_t flash_display_LoaderInfo; -static methodinfo_t flash_display_LoaderInfo_getLoaderInfoByDefinition; +static varinfo_t flash_display_LoaderInfo_actionScriptVersion; +static varinfo_t flash_display_LoaderInfo_contentType; +static varinfo_t flash_display_LoaderInfo_sameDomain; +static varinfo_t flash_display_LoaderInfo_bytesTotal; +static varinfo_t flash_display_LoaderInfo_loaderURL; +static varinfo_t flash_display_LoaderInfo_width; +static methodinfo_t flash_display_LoaderInfo_dispatchEvent; +static varinfo_t flash_display_LoaderInfo_height; +static varinfo_t flash_display_LoaderInfo_frameRate; +static varinfo_t flash_display_LoaderInfo_parameters; +static varinfo_t flash_display_LoaderInfo_bytesLoaded; +static varinfo_t flash_display_LoaderInfo_url; +static varinfo_t flash_display_LoaderInfo_content; +static varinfo_t flash_display_LoaderInfo_swfVersion; +static varinfo_t flash_display_LoaderInfo_bytes; +static varinfo_t flash_display_LoaderInfo_loader; +static varinfo_t flash_display_LoaderInfo_applicationDomain; +static varinfo_t flash_display_LoaderInfo_parentAllowsChild; +static varinfo_t flash_display_LoaderInfo_childAllowsParent; +static varinfo_t flash_display_LoaderInfo_sharedEvents; static varinfo_t flash_display_LoaderInfo_actionScriptVersion; static varinfo_t flash_display_LoaderInfo_contentType; static varinfo_t flash_display_LoaderInfo_sameDomain; @@ -475,28 +694,13 @@ static classinfo_t flash_sampler_Sample; static varinfo_t flash_sampler_Sample_time; static varinfo_t flash_sampler_Sample_stack; +static varinfo_t flash_sampler_Sample_time; +static varinfo_t flash_sampler_Sample_stack; static classinfo_t flash_text_engine_DigitWidth; -static varinfo_t flash_text_engine_DigitWidth_PROPORTIONAL; -static varinfo_t flash_text_engine_DigitWidth_DEFAULT; -static varinfo_t flash_text_engine_DigitWidth_TABULAR; static classinfo_t flash_net_URLRequestMethod; -static varinfo_t flash_net_URLRequestMethod_GET; -static varinfo_t flash_net_URLRequestMethod_POST; static methodinfo_t adobe_utils_MMExecute; static classinfo_t flash_system_System; -static methodinfo_t flash_system_System_pause; -static varinfo_t flash_system_System_useCodePage; -static methodinfo_t flash_system_System_exit; -static methodinfo_t flash_system_System_setClipboard; -static varinfo_t flash_system_System_totalMemory; -static methodinfo_t flash_system_System_gc; -static methodinfo_t flash_system_System_resume; -static varinfo_t flash_system_System_vmVersion; -static varinfo_t flash_system_System_ime; static classinfo_t flash_filters_BitmapFilterQuality; -static varinfo_t flash_filters_BitmapFilterQuality_LOW; -static varinfo_t flash_filters_BitmapFilterQuality_MEDIUM; -static varinfo_t flash_filters_BitmapFilterQuality_HIGH; static classinfo_t flash_display_DisplayObjectContainer; static methodinfo_t flash_display_DisplayObjectContainer_addChild; static methodinfo_t flash_display_DisplayObjectContainer_getObjectsUnderPoint; @@ -515,23 +719,37 @@ static varinfo_t flash_display_DisplayObjectContainer_mouseChildren; static varinfo_t flash_display_DisplayObjectContainer_tabChildren; static varinfo_t flash_display_DisplayObjectContainer_textSnapshot; +static methodinfo_t flash_display_DisplayObjectContainer_addChild; +static methodinfo_t flash_display_DisplayObjectContainer_getObjectsUnderPoint; +static methodinfo_t flash_display_DisplayObjectContainer_removeChildAt; +static methodinfo_t flash_display_DisplayObjectContainer_swapChildren; +static methodinfo_t flash_display_DisplayObjectContainer_areInaccessibleObjectsUnderPoint; +static methodinfo_t flash_display_DisplayObjectContainer_setChildIndex; +static varinfo_t flash_display_DisplayObjectContainer_numChildren; +static methodinfo_t flash_display_DisplayObjectContainer_getChildIndex; +static methodinfo_t flash_display_DisplayObjectContainer_getChildAt; +static methodinfo_t flash_display_DisplayObjectContainer_removeChild; +static methodinfo_t flash_display_DisplayObjectContainer_addChildAt; +static methodinfo_t flash_display_DisplayObjectContainer_contains; +static methodinfo_t flash_display_DisplayObjectContainer_getChildByName; +static methodinfo_t flash_display_DisplayObjectContainer_swapChildrenAt; +static varinfo_t flash_display_DisplayObjectContainer_mouseChildren; +static varinfo_t flash_display_DisplayObjectContainer_tabChildren; +static varinfo_t flash_display_DisplayObjectContainer_textSnapshot; static classinfo_t flash_system_LoaderContext; static varinfo_t flash_system_LoaderContext_checkPolicyFile; static varinfo_t flash_system_LoaderContext_securityDomain; static varinfo_t flash_system_LoaderContext_applicationDomain; +static varinfo_t flash_system_LoaderContext_checkPolicyFile; +static varinfo_t flash_system_LoaderContext_securityDomain; +static varinfo_t flash_system_LoaderContext_applicationDomain; static methodinfo_t flash_utils_clearTimeout; static methodinfo_t _isXMLName; static classinfo_t flash_xml_XMLNodeType; -static varinfo_t flash_xml_XMLNodeType_PROCESSING_INSTRUCTION_NODE; -static varinfo_t flash_xml_XMLNodeType_CDATA_NODE; -static varinfo_t flash_xml_XMLNodeType_DOCUMENT_TYPE_NODE; -static varinfo_t flash_xml_XMLNodeType_COMMENT_NODE; -static varinfo_t flash_xml_XMLNodeType_XML_DECLARATION; -static varinfo_t flash_xml_XMLNodeType_TEXT_NODE; -static varinfo_t flash_xml_XMLNodeType_ELEMENT_NODE; static classinfo_t flash_events_ErrorEvent; static methodinfo_t flash_events_ErrorEvent_toString; -static varinfo_t flash_events_ErrorEvent_ERROR; +static methodinfo_t flash_events_ErrorEvent_clone; +static methodinfo_t flash_events_ErrorEvent_toString; static methodinfo_t flash_events_ErrorEvent_clone; static classinfo_t flash_utils_IDataOutput; static methodinfo_t flash_utils_IDataOutput_writeUnsignedInt; @@ -548,15 +766,27 @@ static methodinfo_t flash_utils_IDataOutput_writeDouble; static methodinfo_t flash_utils_IDataOutput_writeBytes; static varinfo_t flash_utils_IDataOutput_endian; +static methodinfo_t flash_utils_IDataOutput_writeUnsignedInt; +static methodinfo_t flash_utils_IDataOutput_writeInt; +static varinfo_t flash_utils_IDataOutput_objectEncoding; +static methodinfo_t flash_utils_IDataOutput_writeUTFBytes; +static methodinfo_t flash_utils_IDataOutput_writeObject; +static methodinfo_t flash_utils_IDataOutput_writeMultiByte; +static methodinfo_t flash_utils_IDataOutput_writeShort; +static methodinfo_t flash_utils_IDataOutput_writeFloat; +static methodinfo_t flash_utils_IDataOutput_writeUTF; +static methodinfo_t flash_utils_IDataOutput_writeByte; +static methodinfo_t flash_utils_IDataOutput_writeBoolean; +static methodinfo_t flash_utils_IDataOutput_writeDouble; +static methodinfo_t flash_utils_IDataOutput_writeBytes; +static varinfo_t flash_utils_IDataOutput_endian; static classinfo_t flash_geom_Utils3D; -static methodinfo_t flash_geom_Utils3D_projectVectors; -static methodinfo_t flash_geom_Utils3D_projectVector; -static methodinfo_t flash_geom_Utils3D_pointTowards; static classinfo_t flash_events_TextEvent; -static varinfo_t flash_events_TextEvent_LINK; static methodinfo_t flash_events_TextEvent_toString; static varinfo_t flash_events_TextEvent_text; -static varinfo_t flash_events_TextEvent_TEXT_INPUT; +static methodinfo_t flash_events_TextEvent_clone; +static methodinfo_t flash_events_TextEvent_toString; +static varinfo_t flash_events_TextEvent_text; static methodinfo_t flash_events_TextEvent_clone; static classinfo_t flash_utils_Proxy; static methodinfo_t flash_utils_Proxy_callProperty; @@ -569,9 +799,17 @@ static methodinfo_t flash_utils_Proxy_getDescendants; static methodinfo_t flash_utils_Proxy_isAttribute; static methodinfo_t flash_utils_Proxy_nextValue; +static methodinfo_t flash_utils_Proxy_callProperty; +static methodinfo_t flash_utils_Proxy_setProperty; +static methodinfo_t flash_utils_Proxy_getProperty; +static methodinfo_t flash_utils_Proxy_nextName; +static methodinfo_t flash_utils_Proxy_nextNameIndex; +static methodinfo_t flash_utils_Proxy_hasProperty; +static methodinfo_t flash_utils_Proxy_deleteProperty; +static methodinfo_t flash_utils_Proxy_getDescendants; +static methodinfo_t flash_utils_Proxy_isAttribute; +static methodinfo_t flash_utils_Proxy_nextValue; static classinfo_t flash_text_engine_FontPosture; -static varinfo_t flash_text_engine_FontPosture_NORMAL; -static varinfo_t flash_text_engine_FontPosture_ITALIC; static classinfo_t flash_xml_XMLDocument; static varinfo_t flash_xml_XMLDocument_docTypeDecl; static varinfo_t flash_xml_XMLDocument_idMap; @@ -581,12 +819,25 @@ static varinfo_t flash_xml_XMLDocument_ignoreWhite; static methodinfo_t flash_xml_XMLDocument_createTextNode; static methodinfo_t flash_xml_XMLDocument_parseXML; +static varinfo_t flash_xml_XMLDocument_docTypeDecl; +static varinfo_t flash_xml_XMLDocument_idMap; +static methodinfo_t flash_xml_XMLDocument_toString; +static varinfo_t flash_xml_XMLDocument_xmlDecl; +static methodinfo_t flash_xml_XMLDocument_createElement; +static varinfo_t flash_xml_XMLDocument_ignoreWhite; +static methodinfo_t flash_xml_XMLDocument_createTextNode; +static methodinfo_t flash_xml_XMLDocument_parseXML; static classinfo_t flash_display_ShaderInput; static varinfo_t flash_display_ShaderInput_width; static varinfo_t flash_display_ShaderInput_input; static varinfo_t flash_display_ShaderInput_height; static varinfo_t flash_display_ShaderInput_index; static varinfo_t flash_display_ShaderInput_channels; +static varinfo_t flash_display_ShaderInput_width; +static varinfo_t flash_display_ShaderInput_input; +static varinfo_t flash_display_ShaderInput_height; +static varinfo_t flash_display_ShaderInput_index; +static varinfo_t flash_display_ShaderInput_channels; static classinfo_t flash_text_engine_TextBlock; static methodinfo_t flash_text_engine_TextBlock_createTextLine; static varinfo_t flash_text_engine_TextBlock_bidiLevel; @@ -610,27 +861,34 @@ static methodinfo_t flash_text_engine_TextBlock_findNextWordBoundary; static varinfo_t flash_text_engine_TextBlock_tabStops; static methodinfo_t flash_text_engine_TextBlock_dump; +static methodinfo_t flash_text_engine_TextBlock_createTextLine; +static varinfo_t flash_text_engine_TextBlock_bidiLevel; +static methodinfo_t flash_text_engine_TextBlock_getTextLineAtCharIndex; +static varinfo_t flash_text_engine_TextBlock_lastLine; +static methodinfo_t flash_text_engine_TextBlock_findPreviousWordBoundary; +static methodinfo_t flash_text_engine_TextBlock_findPreviousAtomBoundary; +static varinfo_t flash_text_engine_TextBlock_baselineZero; +static varinfo_t flash_text_engine_TextBlock_applyNonLinearFontScaling; +static varinfo_t flash_text_engine_TextBlock_firstLine; +static varinfo_t flash_text_engine_TextBlock_textJustifier; +static methodinfo_t flash_text_engine_TextBlock_releaseLines; +static varinfo_t flash_text_engine_TextBlock_firstInvalidLine; +static varinfo_t flash_text_engine_TextBlock_baselineFontSize; +static varinfo_t flash_text_engine_TextBlock_lineRotation; +static varinfo_t flash_text_engine_TextBlock_userData; +static varinfo_t flash_text_engine_TextBlock_content; +static varinfo_t flash_text_engine_TextBlock_textLineCreationResult; +static varinfo_t flash_text_engine_TextBlock_baselineFontDescription; +static methodinfo_t flash_text_engine_TextBlock_findNextAtomBoundary; +static methodinfo_t flash_text_engine_TextBlock_findNextWordBoundary; +static varinfo_t flash_text_engine_TextBlock_tabStops; +static methodinfo_t flash_text_engine_TextBlock_dump; static classinfo_t flash_ui_MouseCursor; -static varinfo_t flash_ui_MouseCursor_BUTTON; -static varinfo_t flash_ui_MouseCursor_AUTO; -static varinfo_t flash_ui_MouseCursor_ARROW; -static varinfo_t flash_ui_MouseCursor_IBEAM; -static varinfo_t flash_ui_MouseCursor_HAND; static varinfo_t flash_utils_flash_proxy; static classinfo_t flash_display_MorphShape; static classinfo_t flash_text_TextDisplayMode; -static varinfo_t flash_text_TextDisplayMode_CRT; -static varinfo_t flash_text_TextDisplayMode_LCD; -static varinfo_t flash_text_TextDisplayMode_DEFAULT; static classinfo_t flash_net_URLLoaderDataFormat; -static varinfo_t flash_net_URLLoaderDataFormat_VARIABLES; -static varinfo_t flash_net_URLLoaderDataFormat_BINARY; -static varinfo_t flash_net_URLLoaderDataFormat_TEXT; static classinfo_t flash_display_StageQuality; -static varinfo_t flash_display_StageQuality_LOW; -static varinfo_t flash_display_StageQuality_MEDIUM; -static varinfo_t flash_display_StageQuality_HIGH; -static varinfo_t flash_display_StageQuality_BEST; static classinfo_t flash_display_Sprite; static methodinfo_t flash_display_Sprite_stopDrag; static varinfo_t flash_display_Sprite_buttonMode; @@ -640,59 +898,15 @@ static varinfo_t flash_display_Sprite_graphics; static methodinfo_t flash_display_Sprite_startDrag; static varinfo_t flash_display_Sprite_dropTarget; +static methodinfo_t flash_display_Sprite_stopDrag; +static varinfo_t flash_display_Sprite_buttonMode; +static varinfo_t flash_display_Sprite_soundTransform; +static varinfo_t flash_display_Sprite_hitArea; +static varinfo_t flash_display_Sprite_useHandCursor; +static varinfo_t flash_display_Sprite_graphics; +static methodinfo_t flash_display_Sprite_startDrag; +static varinfo_t flash_display_Sprite_dropTarget; static classinfo_t flash_ui_Keyboard; -static varinfo_t flash_ui_Keyboard_PAGE_DOWN; -static varinfo_t flash_ui_Keyboard_F4; -static varinfo_t flash_ui_Keyboard_ENTER; -static varinfo_t flash_ui_Keyboard_CONTROL; -static varinfo_t flash_ui_Keyboard_F7; -static varinfo_t flash_ui_Keyboard_F14; -static varinfo_t flash_ui_Keyboard_NUMPAD_3; -static varinfo_t flash_ui_Keyboard_NUMPAD_DECIMAL; -static varinfo_t flash_ui_Keyboard_CAPS_LOCK; -static varinfo_t flash_ui_Keyboard_SHIFT; -static varinfo_t flash_ui_Keyboard_TAB; -static varinfo_t flash_ui_Keyboard_NUMPAD_0; -static varinfo_t flash_ui_Keyboard_END; -static varinfo_t flash_ui_Keyboard_NUMPAD_1; -static varinfo_t flash_ui_Keyboard_LEFT; -static varinfo_t flash_ui_Keyboard_F8; -static varinfo_t flash_ui_Keyboard_F9; -static varinfo_t flash_ui_Keyboard_numLock; -static varinfo_t flash_ui_Keyboard_F2; -static varinfo_t flash_ui_Keyboard_NUMPAD_4; -static varinfo_t flash_ui_Keyboard_F3; -static varinfo_t flash_ui_Keyboard_NUMPAD_2; -static varinfo_t flash_ui_Keyboard_HOME; -static varinfo_t flash_ui_Keyboard_NUMPAD_7; -static varinfo_t flash_ui_Keyboard_NUMPAD_6; -static varinfo_t flash_ui_Keyboard_F6; -static varinfo_t flash_ui_Keyboard_F5; -static varinfo_t flash_ui_Keyboard_INSERT; -static varinfo_t flash_ui_Keyboard_ESCAPE; -static varinfo_t flash_ui_Keyboard_F1; -static varinfo_t flash_ui_Keyboard_NUMPAD_SUBTRACT; -static varinfo_t flash_ui_Keyboard_NUMPAD_8; -static varinfo_t flash_ui_Keyboard_SPACE; -static varinfo_t flash_ui_Keyboard_BACKSPACE; -static varinfo_t flash_ui_Keyboard_DELETE; -static varinfo_t flash_ui_Keyboard_NUMPAD_MULTIPLY; -static varinfo_t flash_ui_Keyboard_F13; -static varinfo_t flash_ui_Keyboard_NUMPAD_ADD; -static varinfo_t flash_ui_Keyboard_NUMPAD_9; -static varinfo_t flash_ui_Keyboard_F12; -static varinfo_t flash_ui_Keyboard_RIGHT; -static varinfo_t flash_ui_Keyboard_F15; -static varinfo_t flash_ui_Keyboard_F11; -static varinfo_t flash_ui_Keyboard_UP; -static methodinfo_t flash_ui_Keyboard_isAccessible; -static varinfo_t flash_ui_Keyboard_DOWN; -static varinfo_t flash_ui_Keyboard_capsLock; -static varinfo_t flash_ui_Keyboard_PAGE_UP; -static varinfo_t flash_ui_Keyboard_NUMPAD_ENTER; -static varinfo_t flash_ui_Keyboard_F10; -static varinfo_t flash_ui_Keyboard_NUMPAD_5; -static varinfo_t flash_ui_Keyboard_NUMPAD_DIVIDE; static classinfo_t flash_filters_DisplacementMapFilter; static varinfo_t flash_filters_DisplacementMapFilter_scaleY; static varinfo_t flash_filters_DisplacementMapFilter_mapPoint; @@ -704,11 +918,19 @@ static methodinfo_t flash_filters_DisplacementMapFilter_clone; static varinfo_t flash_filters_DisplacementMapFilter_alpha; static varinfo_t flash_filters_DisplacementMapFilter_componentY; +static varinfo_t flash_filters_DisplacementMapFilter_scaleY; +static varinfo_t flash_filters_DisplacementMapFilter_mapPoint; +static varinfo_t flash_filters_DisplacementMapFilter_scaleX; +static varinfo_t flash_filters_DisplacementMapFilter_mapBitmap; +static varinfo_t flash_filters_DisplacementMapFilter_mode; +static varinfo_t flash_filters_DisplacementMapFilter_color; +static varinfo_t flash_filters_DisplacementMapFilter_componentX; +static methodinfo_t flash_filters_DisplacementMapFilter_clone; +static varinfo_t flash_filters_DisplacementMapFilter_alpha; +static varinfo_t flash_filters_DisplacementMapFilter_componentY; static methodinfo_t flash_utils_escapeMultiByte; static methodinfo_t adobe_utils_MMEndCommand; static classinfo_t flash_display_GradientType; -static varinfo_t flash_display_GradientType_LINEAR; -static varinfo_t flash_display_GradientType_RADIAL; static classinfo_t flash_media_ID3Info; static varinfo_t flash_media_ID3Info_comment; static varinfo_t flash_media_ID3Info_year; @@ -717,26 +939,26 @@ static varinfo_t flash_media_ID3Info_songName; static varinfo_t flash_media_ID3Info_genre; static varinfo_t flash_media_ID3Info_album; +static varinfo_t flash_media_ID3Info_comment; +static varinfo_t flash_media_ID3Info_year; +static varinfo_t flash_media_ID3Info_track; +static varinfo_t flash_media_ID3Info_artist; +static varinfo_t flash_media_ID3Info_songName; +static varinfo_t flash_media_ID3Info_genre; +static varinfo_t flash_media_ID3Info_album; static classinfo_t flash_display_GraphicsSolidFill; static varinfo_t flash_display_GraphicsSolidFill_color; static varinfo_t flash_display_GraphicsSolidFill_alpha; +static varinfo_t flash_display_GraphicsSolidFill_color; +static varinfo_t flash_display_GraphicsSolidFill_alpha; static classinfo_t flash_filters_ColorMatrixFilter; static varinfo_t flash_filters_ColorMatrixFilter_matrix; static methodinfo_t flash_filters_ColorMatrixFilter_clone; +static varinfo_t flash_filters_ColorMatrixFilter_matrix; +static methodinfo_t flash_filters_ColorMatrixFilter_clone; static classinfo_t flash_net_NetStreamPlayTransitions; -static varinfo_t flash_net_NetStreamPlayTransitions_RESET; -static varinfo_t flash_net_NetStreamPlayTransitions_APPEND; -static varinfo_t flash_net_NetStreamPlayTransitions_SWAP; -static varinfo_t flash_net_NetStreamPlayTransitions_SWITCH; -static varinfo_t flash_net_NetStreamPlayTransitions_STOP; static classinfo_t flash_media_SoundCodec; -static varinfo_t flash_media_SoundCodec_NELLYMOSER; -static varinfo_t flash_media_SoundCodec_SPEEX; static classinfo_t flash_net_ObjectEncoding; -static varinfo_t flash_net_ObjectEncoding_dynamicPropertyWriter; -static varinfo_t flash_net_ObjectEncoding_DEFAULT; -static varinfo_t flash_net_ObjectEncoding_AMF0; -static varinfo_t flash_net_ObjectEncoding_AMF3; static classinfo_t flash_text_engine_GroupElement; static methodinfo_t flash_text_engine_GroupElement_groupElements; static methodinfo_t flash_text_engine_GroupElement_splitTextElement; @@ -748,15 +970,27 @@ static methodinfo_t flash_text_engine_GroupElement_ungroupElements; static methodinfo_t flash_text_engine_GroupElement_replaceElements; static methodinfo_t flash_text_engine_GroupElement_getElementIndex; +static methodinfo_t flash_text_engine_GroupElement_groupElements; +static methodinfo_t flash_text_engine_GroupElement_splitTextElement; +static methodinfo_t flash_text_engine_GroupElement_mergeTextElements; +static methodinfo_t flash_text_engine_GroupElement_getElementAtCharIndex; +static varinfo_t flash_text_engine_GroupElement_elementCount; +static methodinfo_t flash_text_engine_GroupElement_setElements; +static methodinfo_t flash_text_engine_GroupElement_getElementAt; +static methodinfo_t flash_text_engine_GroupElement_ungroupElements; +static methodinfo_t flash_text_engine_GroupElement_replaceElements; +static methodinfo_t flash_text_engine_GroupElement_getElementIndex; static methodinfo_t _parseInt; static classinfo_t _QName; static varinfo_t _QName_localName; static methodinfo_t _QName_valueOf; -static varinfo_t _QName_length; +static methodinfo_t _QName_toString; +static varinfo_t _QName_uri; +static varinfo_t _QName_localName; +static methodinfo_t _QName_valueOf; static methodinfo_t _QName_toString; static varinfo_t _QName_uri; static classinfo_t _UninitializedError; -static varinfo_t _UninitializedError_length; static classinfo_t _Date; static methodinfo_t _Date_getTimezoneOffset; static methodinfo_t _Date_getTime; @@ -776,10 +1010,8 @@ static varinfo_t _Date_minutes; static methodinfo_t _Date_setUTCHours; static varinfo_t _Date_minutesUTC; -static varinfo_t _Date_length; static methodinfo_t _Date_toLocaleTimeString; static varinfo_t _Date_fullYearUTC; -static methodinfo_t _Date_UTC; static varinfo_t _Date_time; static varinfo_t _Date_monthUTC; static methodinfo_t _Date_getUTCMilliseconds; @@ -805,7 +1037,6 @@ static methodinfo_t _Date_setFullYear; static methodinfo_t _Date_setHours; static methodinfo_t _Date_setMonth; -static methodinfo_t _Date_parse; static methodinfo_t _Date_getUTCSeconds; static methodinfo_t _Date_getMinutes; static methodinfo_t _Date_toLocaleString; @@ -820,38 +1051,122 @@ static methodinfo_t _Date_toTimeString; static methodinfo_t _Date_setMilliseconds; static methodinfo_t _Date_getUTCHours; -static classinfo_t flash_text_StyleSheet; -static varinfo_t flash_text_StyleSheet_styleNames; -static methodinfo_t flash_text_StyleSheet_clear; -static methodinfo_t flash_text_StyleSheet_transform; -static methodinfo_t flash_text_StyleSheet_getStyle; -static methodinfo_t flash_text_StyleSheet_parseCSS; -static methodinfo_t flash_text_StyleSheet_setStyle; -static classinfo_t flash_display_ActionScriptVersion; -static varinfo_t flash_display_ActionScriptVersion_ACTIONSCRIPT3; -static varinfo_t flash_display_ActionScriptVersion_ACTIONSCRIPT2; -static classinfo_t flash_text_engine_EastAsianJustifier; -static varinfo_t flash_text_engine_EastAsianJustifier_justificationStyle; -static methodinfo_t flash_text_engine_EastAsianJustifier_clone; -static classinfo_t _String; -static methodinfo_t _String_indexOf; -static methodinfo_t _String_replace; -static methodinfo_t _String_lastIndexOf; -static methodinfo_t _String_valueOf; -static methodinfo_t _String_concat; -static methodinfo_t _String_substr; -static methodinfo_t _String_slice; -static methodinfo_t _String_search; -static methodinfo_t _String_fromCharCode; -static methodinfo_t _String_toLocaleUpperCase; -static methodinfo_t _String_toString; -static methodinfo_t _String_toUpperCase; -static methodinfo_t _String_charAt; -static methodinfo_t _String_match; -static methodinfo_t _String_charCodeAt; -static methodinfo_t _String_substring; -static methodinfo_t _String_localeCompare; -static methodinfo_t _String_split; +static methodinfo_t _Date_getTimezoneOffset; +static methodinfo_t _Date_getTime; +static methodinfo_t _Date_setUTCMilliseconds; +static varinfo_t _Date_month; +static methodinfo_t _Date_toString; +static methodinfo_t _Date_getHours; +static varinfo_t _Date_date; +static varinfo_t _Date_milliseconds; +static methodinfo_t _Date_setSeconds; +static methodinfo_t _Date_getDate; +static varinfo_t _Date_hoursUTC; +static methodinfo_t _Date_getUTCDate; +static varinfo_t _Date_timezoneOffset; +static methodinfo_t _Date_setTime; +static varinfo_t _Date_millisecondsUTC; +static varinfo_t _Date_minutes; +static methodinfo_t _Date_setUTCHours; +static varinfo_t _Date_minutesUTC; +static methodinfo_t _Date_toLocaleTimeString; +static varinfo_t _Date_fullYearUTC; +static varinfo_t _Date_time; +static varinfo_t _Date_monthUTC; +static methodinfo_t _Date_getUTCMilliseconds; +static methodinfo_t _Date_toDateString; +static methodinfo_t _Date_getMonth; +static methodinfo_t _Date_setMinutes; +static methodinfo_t _Date_toLocaleDateString; +static varinfo_t _Date_fullYear; +static methodinfo_t _Date_getUTCFullYear; +static methodinfo_t _Date_getSeconds; +static varinfo_t _Date_dateUTC; +static methodinfo_t _Date_getMilliseconds; +static methodinfo_t _Date_setUTCMinutes; +static varinfo_t _Date_day; +static methodinfo_t _Date_setUTCSeconds; +static methodinfo_t _Date_setUTCDate; +static methodinfo_t _Date_getUTCMonth; +static methodinfo_t _Date_valueOf; +static varinfo_t _Date_seconds; +static methodinfo_t _Date_getUTCMinutes; +static methodinfo_t _Date_setDate; +static methodinfo_t _Date_getFullYear; +static methodinfo_t _Date_setFullYear; +static methodinfo_t _Date_setHours; +static methodinfo_t _Date_setMonth; +static methodinfo_t _Date_getUTCSeconds; +static methodinfo_t _Date_getMinutes; +static methodinfo_t _Date_toLocaleString; +static methodinfo_t _Date_toUTCString; +static varinfo_t _Date_dayUTC; +static methodinfo_t _Date_getDay; +static methodinfo_t _Date_setUTCMonth; +static varinfo_t _Date_hours; +static methodinfo_t _Date_getUTCDay; +static methodinfo_t _Date_setUTCFullYear; +static varinfo_t _Date_secondsUTC; +static methodinfo_t _Date_toTimeString; +static methodinfo_t _Date_setMilliseconds; +static methodinfo_t _Date_getUTCHours; +static classinfo_t flash_text_StyleSheet; +static varinfo_t flash_text_StyleSheet_styleNames; +static methodinfo_t flash_text_StyleSheet_clear; +static methodinfo_t flash_text_StyleSheet_transform; +static methodinfo_t flash_text_StyleSheet_getStyle; +static methodinfo_t flash_text_StyleSheet_parseCSS; +static methodinfo_t flash_text_StyleSheet_setStyle; +static varinfo_t flash_text_StyleSheet_styleNames; +static methodinfo_t flash_text_StyleSheet_clear; +static methodinfo_t flash_text_StyleSheet_transform; +static methodinfo_t flash_text_StyleSheet_getStyle; +static methodinfo_t flash_text_StyleSheet_parseCSS; +static methodinfo_t flash_text_StyleSheet_setStyle; +static classinfo_t flash_display_ActionScriptVersion; +static classinfo_t flash_text_engine_EastAsianJustifier; +static varinfo_t flash_text_engine_EastAsianJustifier_justificationStyle; +static methodinfo_t flash_text_engine_EastAsianJustifier_clone; +static varinfo_t flash_text_engine_EastAsianJustifier_justificationStyle; +static methodinfo_t flash_text_engine_EastAsianJustifier_clone; +static classinfo_t _String; +static methodinfo_t _String_indexOf; +static methodinfo_t _String_replace; +static methodinfo_t _String_lastIndexOf; +static methodinfo_t _String_valueOf; +static methodinfo_t _String_concat; +static methodinfo_t _String_substr; +static methodinfo_t _String_slice; +static methodinfo_t _String_search; +static methodinfo_t _String_toLocaleUpperCase; +static methodinfo_t _String_toString; +static methodinfo_t _String_toUpperCase; +static methodinfo_t _String_charAt; +static methodinfo_t _String_match; +static methodinfo_t _String_charCodeAt; +static methodinfo_t _String_substring; +static methodinfo_t _String_localeCompare; +static methodinfo_t _String_split; +static methodinfo_t _String_toLocaleLowerCase; +static varinfo_t _String_length; +static methodinfo_t _String_toLowerCase; +static methodinfo_t _String_indexOf; +static methodinfo_t _String_replace; +static methodinfo_t _String_lastIndexOf; +static methodinfo_t _String_valueOf; +static methodinfo_t _String_concat; +static methodinfo_t _String_substr; +static methodinfo_t _String_slice; +static methodinfo_t _String_search; +static methodinfo_t _String_toLocaleUpperCase; +static methodinfo_t _String_toString; +static methodinfo_t _String_toUpperCase; +static methodinfo_t _String_charAt; +static methodinfo_t _String_match; +static methodinfo_t _String_charCodeAt; +static methodinfo_t _String_substring; +static methodinfo_t _String_localeCompare; +static methodinfo_t _String_split; static methodinfo_t _String_toLocaleLowerCase; static varinfo_t _String_length; static methodinfo_t _String_toLowerCase; @@ -861,8 +1176,19 @@ static varinfo_t flash_media_SoundChannel_position; static varinfo_t flash_media_SoundChannel_soundTransform; static varinfo_t flash_media_SoundChannel_rightPeak; +static varinfo_t flash_media_SoundChannel_leftPeak; +static methodinfo_t flash_media_SoundChannel_stop; +static varinfo_t flash_media_SoundChannel_position; +static varinfo_t flash_media_SoundChannel_soundTransform; +static varinfo_t flash_media_SoundChannel_rightPeak; static classinfo_t flash_desktop_Clipboard; -static varinfo_t flash_desktop_Clipboard_generalClipboard; +static methodinfo_t flash_desktop_Clipboard_setDataHandler; +static methodinfo_t flash_desktop_Clipboard_setData; +static varinfo_t flash_desktop_Clipboard_formats; +static methodinfo_t flash_desktop_Clipboard_clear; +static methodinfo_t flash_desktop_Clipboard_getData; +static methodinfo_t flash_desktop_Clipboard_hasFormat; +static methodinfo_t flash_desktop_Clipboard_clearData; static methodinfo_t flash_desktop_Clipboard_setDataHandler; static methodinfo_t flash_desktop_Clipboard_setData; static varinfo_t flash_desktop_Clipboard_formats; @@ -872,12 +1198,13 @@ static methodinfo_t flash_desktop_Clipboard_clearData; static classinfo_t flash_display_IBitmapDrawable; static classinfo_t _TypeError; -static varinfo_t _TypeError_length; static classinfo_t _int; -static varinfo_t _int_MAX_VALUE; static methodinfo_t _int_valueOf; -static varinfo_t _int_length; -static varinfo_t _int_MIN_VALUE; +static methodinfo_t _int_toString; +static methodinfo_t _int_toExponential; +static methodinfo_t _int_toFixed; +static methodinfo_t _int_toPrecision; +static methodinfo_t _int_valueOf; static methodinfo_t _int_toString; static methodinfo_t _int_toExponential; static methodinfo_t _int_toFixed; @@ -886,6 +1213,9 @@ static varinfo_t flash_display_Scene_numFrames; static varinfo_t flash_display_Scene_labels; static varinfo_t flash_display_Scene_name; +static varinfo_t flash_display_Scene_numFrames; +static varinfo_t flash_display_Scene_labels; +static varinfo_t flash_display_Scene_name; static classinfo_t flash_text_engine_FontMetrics; static varinfo_t flash_text_engine_FontMetrics_superscriptOffset; static varinfo_t flash_text_engine_FontMetrics_underlineThickness; @@ -896,9 +1226,20 @@ static varinfo_t flash_text_engine_FontMetrics_superscriptScale; static varinfo_t flash_text_engine_FontMetrics_subscriptOffset; static varinfo_t flash_text_engine_FontMetrics_underlineOffset; +static varinfo_t flash_text_engine_FontMetrics_superscriptOffset; +static varinfo_t flash_text_engine_FontMetrics_underlineThickness; +static varinfo_t flash_text_engine_FontMetrics_subscriptScale; +static varinfo_t flash_text_engine_FontMetrics_strikethroughOffset; +static varinfo_t flash_text_engine_FontMetrics_emBox; +static varinfo_t flash_text_engine_FontMetrics_strikethroughThickness; +static varinfo_t flash_text_engine_FontMetrics_superscriptScale; +static varinfo_t flash_text_engine_FontMetrics_subscriptOffset; +static varinfo_t flash_text_engine_FontMetrics_underlineOffset; static classinfo_t flash_utils_IExternalizable; static methodinfo_t flash_utils_IExternalizable_readExternal; static methodinfo_t flash_utils_IExternalizable_writeExternal; +static methodinfo_t flash_utils_IExternalizable_readExternal; +static methodinfo_t flash_utils_IExternalizable_writeExternal; static classinfo_t __AS3___vec_Vector; static classinfo_t flash_filters_GradientBevelFilter; static varinfo_t flash_filters_GradientBevelFilter_strength; @@ -913,17 +1254,32 @@ static varinfo_t flash_filters_GradientBevelFilter_blurY; static varinfo_t flash_filters_GradientBevelFilter_distance; static methodinfo_t flash_filters_GradientBevelFilter_clone; +static varinfo_t flash_filters_GradientBevelFilter_strength; +static varinfo_t flash_filters_GradientBevelFilter_quality; +static varinfo_t flash_filters_GradientBevelFilter_angle; +static varinfo_t flash_filters_GradientBevelFilter_knockout; +static varinfo_t flash_filters_GradientBevelFilter_alphas; +static varinfo_t flash_filters_GradientBevelFilter_type; +static varinfo_t flash_filters_GradientBevelFilter_ratios; +static varinfo_t flash_filters_GradientBevelFilter_colors; +static varinfo_t flash_filters_GradientBevelFilter_blurX; +static varinfo_t flash_filters_GradientBevelFilter_blurY; +static varinfo_t flash_filters_GradientBevelFilter_distance; +static methodinfo_t flash_filters_GradientBevelFilter_clone; static classinfo_t flash_text_TextRun; static varinfo_t flash_text_TextRun_beginIndex; static varinfo_t flash_text_TextRun_endIndex; static varinfo_t flash_text_TextRun_textFormat; +static varinfo_t flash_text_TextRun_beginIndex; +static varinfo_t flash_text_TextRun_endIndex; +static varinfo_t flash_text_TextRun_textFormat; static classinfo_t flash_text_TextColorType; -static varinfo_t flash_text_TextColorType_DARK_COLOR; -static varinfo_t flash_text_TextColorType_LIGHT_COLOR; static methodinfo_t flash_sampler_getSampleCount; static classinfo_t flash_net_URLRequestHeader; static varinfo_t flash_net_URLRequestHeader_value; static varinfo_t flash_net_URLRequestHeader_name; +static varinfo_t flash_net_URLRequestHeader_value; +static varinfo_t flash_net_URLRequestHeader_name; static methodinfo_t flash_profiler_showRedrawRegions; static classinfo_t flash_display_ShaderData; static classinfo_t flash_text_engine_TextLine; @@ -931,7 +1287,36 @@ static varinfo_t flash_text_engine_TextLine_validity; static methodinfo_t flash_text_engine_TextLine_getAtomTextBlockBeginIndex; static methodinfo_t flash_text_engine_TextLine_getAtomWordBoundaryOnLeft; -static varinfo_t flash_text_engine_TextLine_MAX_LINE_WIDTH; +static methodinfo_t flash_text_engine_TextLine_getAtomTextRotation; +static varinfo_t flash_text_engine_TextLine_textHeight; +static methodinfo_t flash_text_engine_TextLine_getAtomCenter; +static methodinfo_t flash_text_engine_TextLine_getAtomBounds; +static varinfo_t flash_text_engine_TextLine_mirrorRegions; +static varinfo_t flash_text_engine_TextLine_rawTextLength; +static varinfo_t flash_text_engine_TextLine_userData; +static varinfo_t flash_text_engine_TextLine_textWidth; +static varinfo_t flash_text_engine_TextLine_textBlock; +static varinfo_t flash_text_engine_TextLine_textBlockBeginIndex; +static varinfo_t flash_text_engine_TextLine_unjustifiedTextWidth; +static varinfo_t flash_text_engine_TextLine_ascent; +static methodinfo_t flash_text_engine_TextLine_getBaselinePosition; +static varinfo_t flash_text_engine_TextLine_specifiedWidth; +static methodinfo_t flash_text_engine_TextLine_getMirrorRegion; +static methodinfo_t flash_text_engine_TextLine_getAtomGraphic; +static varinfo_t flash_text_engine_TextLine_hasGraphicElement; +static methodinfo_t flash_text_engine_TextLine_flushAtomData; +static methodinfo_t flash_text_engine_TextLine_dump; +static varinfo_t flash_text_engine_TextLine_nextLine; +static methodinfo_t flash_text_engine_TextLine_getAtomIndexAtCharIndex; +static methodinfo_t flash_text_engine_TextLine_getAtomTextBlockEndIndex; +static varinfo_t flash_text_engine_TextLine_atomCount; +static varinfo_t flash_text_engine_TextLine_descent; +static methodinfo_t flash_text_engine_TextLine_getAtomBidiLevel; +static methodinfo_t flash_text_engine_TextLine_getAtomIndexAtPoint; +static varinfo_t flash_text_engine_TextLine_previousLine; +static varinfo_t flash_text_engine_TextLine_validity; +static methodinfo_t flash_text_engine_TextLine_getAtomTextBlockBeginIndex; +static methodinfo_t flash_text_engine_TextLine_getAtomWordBoundaryOnLeft; static methodinfo_t flash_text_engine_TextLine_getAtomTextRotation; static varinfo_t flash_text_engine_TextLine_textHeight; static methodinfo_t flash_text_engine_TextLine_getAtomCenter; @@ -966,19 +1351,23 @@ static varinfo_t flash_net_URLRequest_method; static varinfo_t flash_net_URLRequest_digest; static varinfo_t flash_net_URLRequest_data; +static varinfo_t flash_net_URLRequest_contentType; +static varinfo_t flash_net_URLRequest_url; +static varinfo_t flash_net_URLRequest_requestHeaders; +static varinfo_t flash_net_URLRequest_method; +static varinfo_t flash_net_URLRequest_digest; +static varinfo_t flash_net_URLRequest_data; static classinfo_t _URIError; -static varinfo_t _URIError_length; static methodinfo_t flash_net_getClassByAlias; static classinfo_t flash_display_ShaderParameter; static varinfo_t flash_display_ShaderParameter_value; static varinfo_t flash_display_ShaderParameter_index; static varinfo_t flash_display_ShaderParameter_type; +static varinfo_t flash_display_ShaderParameter_value; +static varinfo_t flash_display_ShaderParameter_index; +static varinfo_t flash_display_ShaderParameter_type; static classinfo_t flash_filters_BitmapFilterType; -static varinfo_t flash_filters_BitmapFilterType_FULL; -static varinfo_t flash_filters_BitmapFilterType_INNER; -static varinfo_t flash_filters_BitmapFilterType_OUTER; static classinfo_t _SecurityError; -static varinfo_t _SecurityError_length; static classinfo_t flash_utils_IDataInput; static methodinfo_t flash_utils_IDataInput_readUTF; static methodinfo_t flash_utils_IDataInput_readByte; @@ -997,14 +1386,36 @@ static methodinfo_t flash_utils_IDataInput_readFloat; static varinfo_t flash_utils_IDataInput_endian; static methodinfo_t flash_utils_IDataInput_readBoolean; +static methodinfo_t flash_utils_IDataInput_readUTF; +static methodinfo_t flash_utils_IDataInput_readByte; +static methodinfo_t flash_utils_IDataInput_readUTFBytes; +static methodinfo_t flash_utils_IDataInput_readShort; +static varinfo_t flash_utils_IDataInput_objectEncoding; +static methodinfo_t flash_utils_IDataInput_readUnsignedInt; +static methodinfo_t flash_utils_IDataInput_readDouble; +static methodinfo_t flash_utils_IDataInput_readBytes; +static methodinfo_t flash_utils_IDataInput_readUnsignedByte; +static methodinfo_t flash_utils_IDataInput_readMultiByte; +static methodinfo_t flash_utils_IDataInput_readInt; +static varinfo_t flash_utils_IDataInput_bytesAvailable; +static methodinfo_t flash_utils_IDataInput_readUnsignedShort; +static methodinfo_t flash_utils_IDataInput_readObject; +static methodinfo_t flash_utils_IDataInput_readFloat; +static varinfo_t flash_utils_IDataInput_endian; +static methodinfo_t flash_utils_IDataInput_readBoolean; static classinfo_t flash_events_IEventDispatcher; static methodinfo_t flash_events_IEventDispatcher_willTrigger; static methodinfo_t flash_events_IEventDispatcher_removeEventListener; static methodinfo_t flash_events_IEventDispatcher_hasEventListener; static methodinfo_t flash_events_IEventDispatcher_addEventListener; static methodinfo_t flash_events_IEventDispatcher_dispatchEvent; +static methodinfo_t flash_events_IEventDispatcher_willTrigger; +static methodinfo_t flash_events_IEventDispatcher_removeEventListener; +static methodinfo_t flash_events_IEventDispatcher_hasEventListener; +static methodinfo_t flash_events_IEventDispatcher_addEventListener; +static methodinfo_t flash_events_IEventDispatcher_dispatchEvent; static classinfo_t _Class; -static varinfo_t _Class_length; +static varinfo_t _Class_prototype; static varinfo_t _Class_prototype; static classinfo_t flash_geom_Rectangle; static varinfo_t flash_geom_Rectangle_top; @@ -1033,22 +1444,47 @@ static methodinfo_t flash_geom_Rectangle_clone; static varinfo_t flash_geom_Rectangle_y; static methodinfo_t flash_geom_Rectangle_offset; +static varinfo_t flash_geom_Rectangle_top; +static methodinfo_t flash_geom_Rectangle_intersection; +static methodinfo_t flash_geom_Rectangle_intersects; +static methodinfo_t flash_geom_Rectangle_containsPoint; +static methodinfo_t flash_geom_Rectangle_setEmpty; +static varinfo_t flash_geom_Rectangle_topLeft; +static varinfo_t flash_geom_Rectangle_width; +static methodinfo_t flash_geom_Rectangle_containsRect; +static methodinfo_t flash_geom_Rectangle_isEmpty; +static methodinfo_t flash_geom_Rectangle_equals; +static varinfo_t flash_geom_Rectangle_height; +static varinfo_t flash_geom_Rectangle_left; +static methodinfo_t flash_geom_Rectangle_inflate; +static methodinfo_t flash_geom_Rectangle_inflatePoint; +static methodinfo_t flash_geom_Rectangle_toString; +static methodinfo_t flash_geom_Rectangle_offsetPoint; +static varinfo_t flash_geom_Rectangle_x; +static varinfo_t flash_geom_Rectangle_size; +static varinfo_t flash_geom_Rectangle_bottomRight; +static varinfo_t flash_geom_Rectangle_right; +static methodinfo_t flash_geom_Rectangle_contains; +static methodinfo_t flash_geom_Rectangle_union; +static varinfo_t flash_geom_Rectangle_bottom; +static methodinfo_t flash_geom_Rectangle_clone; +static varinfo_t flash_geom_Rectangle_y; +static methodinfo_t flash_geom_Rectangle_offset; static classinfo_t flash_events_SecurityErrorEvent; static methodinfo_t flash_events_SecurityErrorEvent_toString; static methodinfo_t flash_events_SecurityErrorEvent_clone; -static varinfo_t flash_events_SecurityErrorEvent_SECURITY_ERROR; +static methodinfo_t flash_events_SecurityErrorEvent_toString; +static methodinfo_t flash_events_SecurityErrorEvent_clone; static classinfo_t flash_net_IDynamicPropertyWriter; static methodinfo_t flash_net_IDynamicPropertyWriter_writeDynamicProperties; +static methodinfo_t flash_net_IDynamicPropertyWriter_writeDynamicProperties; static classinfo_t flash_display_InterpolationMethod; -static varinfo_t flash_display_InterpolationMethod_RGB; -static varinfo_t flash_display_InterpolationMethod_LINEAR_RGB; static classinfo_t _Object; -static methodinfo_t _Object_init; static methodinfo_t _Object_propertyIsEnumerable; -static varinfo_t _Object_length; -static methodinfo_t _Object__setPropertyIsEnumerable; static methodinfo_t _Object_isPrototypeOf; -static methodinfo_t _Object__dontEnumPrototype; +static methodinfo_t _Object_hasOwnProperty; +static methodinfo_t _Object_propertyIsEnumerable; +static methodinfo_t _Object_isPrototypeOf; static methodinfo_t _Object_hasOwnProperty; static classinfo_t flash_errors_EOFError; static classinfo_t flash_net_NetStream; @@ -1058,7 +1494,6 @@ static varinfo_t flash_net_NetStream_farNonce; static methodinfo_t flash_net_NetStream_close; static methodinfo_t flash_net_NetStream_pause; -static varinfo_t flash_net_NetStream_CONNECT_TO_FMS; static methodinfo_t flash_net_NetStream_onPeerConnect; static varinfo_t flash_net_NetStream_client; static methodinfo_t flash_net_NetStream_resume; @@ -1066,7 +1501,41 @@ static varinfo_t flash_net_NetStream_peerStreams; static varinfo_t flash_net_NetStream_objectEncoding; static varinfo_t flash_net_NetStream_bytesLoaded; -static varinfo_t flash_net_NetStream_DIRECT_CONNECTIONS; +static methodinfo_t flash_net_NetStream_receiveVideo; +static varinfo_t flash_net_NetStream_maxPauseBufferTime; +static methodinfo_t flash_net_NetStream_play2; +static varinfo_t flash_net_NetStream_audioCodec; +static methodinfo_t flash_net_NetStream_receiveVideoFPS; +static varinfo_t flash_net_NetStream_bytesTotal; +static varinfo_t flash_net_NetStream_farID; +static methodinfo_t flash_net_NetStream_receiveAudio; +static varinfo_t flash_net_NetStream_bufferLength; +static methodinfo_t flash_net_NetStream_seek; +static methodinfo_t flash_net_NetStream_attachAudio; +static varinfo_t flash_net_NetStream_bufferTime; +static methodinfo_t flash_net_NetStream_play; +static methodinfo_t flash_net_NetStream_publish; +static methodinfo_t flash_net_NetStream_togglePause; +static varinfo_t flash_net_NetStream_checkPolicyFile; +static varinfo_t flash_net_NetStream_nearNonce; +static varinfo_t flash_net_NetStream_decodedFrames; +static methodinfo_t flash_net_NetStream_send; +static varinfo_t flash_net_NetStream_currentFPS; +static varinfo_t flash_net_NetStream_time; +static varinfo_t flash_net_NetStream_soundTransform; +static varinfo_t flash_net_NetStream_videoCodec; +static varinfo_t flash_net_NetStream_info; +static methodinfo_t flash_net_NetStream_attachCamera; +static varinfo_t flash_net_NetStream_farNonce; +static methodinfo_t flash_net_NetStream_close; +static methodinfo_t flash_net_NetStream_pause; +static methodinfo_t flash_net_NetStream_onPeerConnect; +static varinfo_t flash_net_NetStream_client; +static methodinfo_t flash_net_NetStream_resume; +static varinfo_t flash_net_NetStream_liveDelay; +static varinfo_t flash_net_NetStream_peerStreams; +static varinfo_t flash_net_NetStream_objectEncoding; +static varinfo_t flash_net_NetStream_bytesLoaded; static methodinfo_t flash_net_NetStream_receiveVideo; static varinfo_t flash_net_NetStream_maxPauseBufferTime; static methodinfo_t flash_net_NetStream_play2; @@ -1090,7 +1559,6 @@ static varinfo_t flash_net_NetStream_time; static varinfo_t flash_net_NetStream_soundTransform; static classinfo_t _ArgumentError; -static varinfo_t _ArgumentError_length; static classinfo_t _XMLList; static methodinfo_t _XMLList_normalize; static methodinfo_t _XMLList_removeNamespace; @@ -1131,22 +1599,69 @@ static methodinfo_t _XMLList_name; static methodinfo_t _XMLList_setChildren; static methodinfo_t _XMLList_attribute; +static methodinfo_t _XMLList_normalize; +static methodinfo_t _XMLList_removeNamespace; +static methodinfo_t _XMLList_prependChild; +static methodinfo_t _XMLList_toXMLString; +static methodinfo_t _XMLList_nodeKind; +static methodinfo_t _XMLList_copy; +static methodinfo_t _XMLList_text; +static methodinfo_t _XMLList_toString; +static methodinfo_t _XMLList_childIndex; +static methodinfo_t _XMLList_setName; +static methodinfo_t _XMLList_setLocalName; +static methodinfo_t _XMLList_namespace; +static methodinfo_t _XMLList_insertChildBefore; +static methodinfo_t _XMLList_addNamespace; +static methodinfo_t _XMLList_propertyIsEnumerable; +static methodinfo_t _XMLList_comments; +static methodinfo_t _XMLList_attributes; +static methodinfo_t _XMLList_descendants; +static methodinfo_t _XMLList_replace; +static methodinfo_t _XMLList_children; +static methodinfo_t _XMLList_contains; +static methodinfo_t _XMLList_hasSimpleContent; +static methodinfo_t _XMLList_elements; +static methodinfo_t _XMLList_hasComplexContent; +static methodinfo_t _XMLList_insertChildAfter; +static methodinfo_t _XMLList_parent; +static methodinfo_t _XMLList_length; +static methodinfo_t _XMLList_processingInstructions; +static methodinfo_t _XMLList_child; +static methodinfo_t _XMLList_appendChild; +static methodinfo_t _XMLList_valueOf; +static methodinfo_t _XMLList_localName; +static methodinfo_t _XMLList_inScopeNamespaces; +static methodinfo_t _XMLList_hasOwnProperty; +static methodinfo_t _XMLList_setNamespace; +static methodinfo_t _XMLList_namespaceDeclarations; +static methodinfo_t _XMLList_name; +static methodinfo_t _XMLList_setChildren; +static methodinfo_t _XMLList_attribute; static classinfo_t flash_geom_Point; -static methodinfo_t flash_geom_Point_subtract; -static methodinfo_t flash_geom_Point_distance; -static methodinfo_t flash_geom_Point_normalize; static methodinfo_t flash_geom_Point_equals; -static methodinfo_t flash_geom_Point_toString; +static methodinfo_t flash_geom_Point_normalize; static varinfo_t flash_geom_Point_x; +static methodinfo_t flash_geom_Point_offset; +static methodinfo_t flash_geom_Point_subtract; +static varinfo_t flash_geom_Point_y; +static varinfo_t flash_geom_Point_length; static methodinfo_t flash_geom_Point_add; -static methodinfo_t flash_geom_Point_polar; +static methodinfo_t flash_geom_Point_toString; static methodinfo_t flash_geom_Point_clone; -static methodinfo_t flash_geom_Point_interpolate; +static methodinfo_t flash_geom_Point_equals; +static methodinfo_t flash_geom_Point_normalize; +static varinfo_t flash_geom_Point_x; +static methodinfo_t flash_geom_Point_offset; +static methodinfo_t flash_geom_Point_subtract; static varinfo_t flash_geom_Point_y; static varinfo_t flash_geom_Point_length; -static methodinfo_t flash_geom_Point_offset; +static methodinfo_t flash_geom_Point_add; +static methodinfo_t flash_geom_Point_toString; +static methodinfo_t flash_geom_Point_clone; static classinfo_t flash_printing_PrintJobOptions; static varinfo_t flash_printing_PrintJobOptions_printAsBitmap; +static varinfo_t flash_printing_PrintJobOptions_printAsBitmap; static classinfo_t flash_display_DisplayObject; static varinfo_t flash_display_DisplayObject_rotation; static varinfo_t flash_display_DisplayObject_filters; @@ -1186,9 +1701,49 @@ static varinfo_t flash_display_DisplayObject_mouseY; static varinfo_t flash_display_DisplayObject_x; static varinfo_t flash_display_DisplayObject_y; +static varinfo_t flash_display_DisplayObject_rotation; +static varinfo_t flash_display_DisplayObject_filters; +static varinfo_t flash_display_DisplayObject_rotationZ; +static varinfo_t flash_display_DisplayObject_accessibilityProperties; +static varinfo_t flash_display_DisplayObject_mouseX; +static varinfo_t flash_display_DisplayObject_root; +static varinfo_t flash_display_DisplayObject_stage; +static varinfo_t flash_display_DisplayObject_rotationY; +static varinfo_t flash_display_DisplayObject_scaleZ; +static methodinfo_t flash_display_DisplayObject_local3DToGlobal; +static varinfo_t flash_display_DisplayObject_loaderInfo; +static varinfo_t flash_display_DisplayObject_cacheAsBitmap; +static varinfo_t flash_display_DisplayObject_transform; +static varinfo_t flash_display_DisplayObject_scaleY; +static varinfo_t flash_display_DisplayObject_height; +static varinfo_t flash_display_DisplayObject_rotationX; +static varinfo_t flash_display_DisplayObject_scrollRect; +static varinfo_t flash_display_DisplayObject_width; +static varinfo_t flash_display_DisplayObject_scale9Grid; +static varinfo_t flash_display_DisplayObject_parent; +static methodinfo_t flash_display_DisplayObject_hitTestObject; +static methodinfo_t flash_display_DisplayObject_hitTestPoint; +static varinfo_t flash_display_DisplayObject_alpha; +static methodinfo_t flash_display_DisplayObject_getRect; +static varinfo_t flash_display_DisplayObject_opaqueBackground; +static methodinfo_t flash_display_DisplayObject_globalToLocal3D; +static varinfo_t flash_display_DisplayObject_visible; +static varinfo_t flash_display_DisplayObject_blendMode; +static varinfo_t flash_display_DisplayObject_scaleX; +static methodinfo_t flash_display_DisplayObject_globalToLocal; +static methodinfo_t flash_display_DisplayObject_localToGlobal; +static varinfo_t flash_display_DisplayObject_z; +static varinfo_t flash_display_DisplayObject_name; +static methodinfo_t flash_display_DisplayObject_getBounds; +static varinfo_t flash_display_DisplayObject_mask; +static varinfo_t flash_display_DisplayObject_mouseY; +static varinfo_t flash_display_DisplayObject_x; +static varinfo_t flash_display_DisplayObject_y; static classinfo_t flash_sampler_DeleteObjectSample; static varinfo_t flash_sampler_DeleteObjectSample_size; static varinfo_t flash_sampler_DeleteObjectSample_id; +static varinfo_t flash_sampler_DeleteObjectSample_size; +static varinfo_t flash_sampler_DeleteObjectSample_id; static methodinfo_t flash_system_fscommand; static methodinfo_t flash_utils_unescapeMultiByte; static classinfo_t flash_sampler_StackFrame; @@ -1196,30 +1751,23 @@ static varinfo_t flash_sampler_StackFrame_line; static methodinfo_t flash_sampler_StackFrame_toString; static varinfo_t flash_sampler_StackFrame_file; +static varinfo_t flash_sampler_StackFrame_name; +static varinfo_t flash_sampler_StackFrame_line; +static methodinfo_t flash_sampler_StackFrame_toString; +static varinfo_t flash_sampler_StackFrame_file; static classinfo_t flash_system_JPEGLoaderContext; static varinfo_t flash_system_JPEGLoaderContext_deblockingFilter; +static varinfo_t flash_system_JPEGLoaderContext_deblockingFilter; static classinfo_t flash_system_IME; -static methodinfo_t flash_system_IME_setCompositionString; -static varinfo_t flash_system_IME_enabled; -static methodinfo_t flash_system_IME_doConversion; -static varinfo_t flash_system_IME_conversionMode; static methodinfo_t _isNaN; static classinfo_t flash_system_Security; -static varinfo_t flash_system_Security_sandboxType; -static varinfo_t flash_system_Security_LOCAL_WITH_NETWORK; -static methodinfo_t flash_system_Security_loadPolicyFile; -static methodinfo_t flash_system_Security_allowDomain; -static methodinfo_t flash_system_Security_showSettings; -static varinfo_t flash_system_Security_LOCAL_TRUSTED; -static varinfo_t flash_system_Security_disableAVM1Loading; -static methodinfo_t flash_system_Security_allowInsecureDomain; -static varinfo_t flash_system_Security_exactSettings; -static varinfo_t flash_system_Security_REMOTE; -static varinfo_t flash_system_Security_LOCAL_WITH_FILE; static classinfo_t flash_display_Bitmap; static varinfo_t flash_display_Bitmap_pixelSnapping; static varinfo_t flash_display_Bitmap_bitmapData; static varinfo_t flash_display_Bitmap_smoothing; +static varinfo_t flash_display_Bitmap_pixelSnapping; +static varinfo_t flash_display_Bitmap_bitmapData; +static varinfo_t flash_display_Bitmap_smoothing; static classinfo_t flash_printing_PrintJob; static varinfo_t flash_printing_PrintJob_paperWidth; static methodinfo_t flash_printing_PrintJob_addPage; @@ -1229,34 +1777,43 @@ static methodinfo_t flash_printing_PrintJob_send; static varinfo_t flash_printing_PrintJob_paperHeight; static varinfo_t flash_printing_PrintJob_orientation; +static varinfo_t flash_printing_PrintJob_paperWidth; +static methodinfo_t flash_printing_PrintJob_addPage; +static varinfo_t flash_printing_PrintJob_pageHeight; +static methodinfo_t flash_printing_PrintJob_start; +static varinfo_t flash_printing_PrintJob_pageWidth; +static methodinfo_t flash_printing_PrintJob_send; +static varinfo_t flash_printing_PrintJob_paperHeight; +static varinfo_t flash_printing_PrintJob_orientation; static classinfo_t flash_text_StaticText; static varinfo_t flash_text_StaticText_text; +static varinfo_t flash_text_StaticText_text; static classinfo_t flash_text_engine_SpaceJustifier; static methodinfo_t flash_text_engine_SpaceJustifier_clone; static varinfo_t flash_text_engine_SpaceJustifier_letterSpacing; +static methodinfo_t flash_text_engine_SpaceJustifier_clone; +static varinfo_t flash_text_engine_SpaceJustifier_letterSpacing; static classinfo_t flash_events_DataEvent; static methodinfo_t flash_events_DataEvent_toString; -static varinfo_t flash_events_DataEvent_DATA; static methodinfo_t flash_events_DataEvent_clone; -static varinfo_t flash_events_DataEvent_UPLOAD_COMPLETE_DATA; +static varinfo_t flash_events_DataEvent_data; +static methodinfo_t flash_events_DataEvent_toString; +static methodinfo_t flash_events_DataEvent_clone; static varinfo_t flash_events_DataEvent_data; static classinfo_t flash_events_ActivityEvent; static methodinfo_t flash_events_ActivityEvent_toString; static varinfo_t flash_events_ActivityEvent_activating; static methodinfo_t flash_events_ActivityEvent_clone; -static varinfo_t flash_events_ActivityEvent_ACTIVITY; +static methodinfo_t flash_events_ActivityEvent_toString; +static varinfo_t flash_events_ActivityEvent_activating; +static methodinfo_t flash_events_ActivityEvent_clone; static classinfo_t flash_display_GraphicsEndFill; static classinfo_t flash_display_ColorCorrection; -static varinfo_t flash_display_ColorCorrection_OFF; -static varinfo_t flash_display_ColorCorrection_DEFAULT; -static varinfo_t flash_display_ColorCorrection_ON; static classinfo_t flash_events_IOErrorEvent; -static varinfo_t flash_events_IOErrorEvent_IO_ERROR; -static varinfo_t flash_events_IOErrorEvent_VERIFY_ERROR; static methodinfo_t flash_events_IOErrorEvent_toString; -static varinfo_t flash_events_IOErrorEvent_NETWORK_ERROR; static methodinfo_t flash_events_IOErrorEvent_clone; -static varinfo_t flash_events_IOErrorEvent_DISK_ERROR; +static methodinfo_t flash_events_IOErrorEvent_toString; +static methodinfo_t flash_events_IOErrorEvent_clone; static classinfo_t flash_display_GraphicsStroke; static varinfo_t flash_display_GraphicsStroke_scaleMode; static varinfo_t flash_display_GraphicsStroke_miterLimit; @@ -1265,9 +1822,17 @@ static varinfo_t flash_display_GraphicsStroke_thickness; static varinfo_t flash_display_GraphicsStroke_joints; static varinfo_t flash_display_GraphicsStroke_caps; +static varinfo_t flash_display_GraphicsStroke_scaleMode; +static varinfo_t flash_display_GraphicsStroke_miterLimit; +static varinfo_t flash_display_GraphicsStroke_pixelHinting; +static varinfo_t flash_display_GraphicsStroke_fill; +static varinfo_t flash_display_GraphicsStroke_thickness; +static varinfo_t flash_display_GraphicsStroke_joints; +static varinfo_t flash_display_GraphicsStroke_caps; static classinfo_t _Boolean; static methodinfo_t _Boolean_valueOf; -static varinfo_t _Boolean_length; +static methodinfo_t _Boolean_toString; +static methodinfo_t _Boolean_valueOf; static methodinfo_t _Boolean_toString; static methodinfo_t flash_sampler_getMemberNames; static methodinfo_t flash_utils_getQualifiedClassName; @@ -1275,6 +1840,9 @@ static varinfo_t flash_text_engine_GraphicElement_graphic; static varinfo_t flash_text_engine_GraphicElement_elementWidth; static varinfo_t flash_text_engine_GraphicElement_elementHeight; +static varinfo_t flash_text_engine_GraphicElement_graphic; +static varinfo_t flash_text_engine_GraphicElement_elementWidth; +static varinfo_t flash_text_engine_GraphicElement_elementHeight; static classinfo_t flash_media_Microphone; static varinfo_t flash_media_Microphone_codec; static varinfo_t flash_media_Microphone_gain; @@ -1282,7 +1850,6 @@ static methodinfo_t flash_media_Microphone_setLoopBack; static methodinfo_t flash_media_Microphone_setSilenceLevel; static varinfo_t flash_media_Microphone_name; -static methodinfo_t flash_media_Microphone_getMicrophone; static methodinfo_t flash_media_Microphone_setUseEchoSuppression; static varinfo_t flash_media_Microphone_framesPerPacket; static varinfo_t flash_media_Microphone_muted; @@ -1293,7 +1860,22 @@ static varinfo_t flash_media_Microphone_silenceTimeout; static varinfo_t flash_media_Microphone_rate; static varinfo_t flash_media_Microphone_activityLevel; -static varinfo_t flash_media_Microphone_names; +static varinfo_t flash_media_Microphone_codec; +static varinfo_t flash_media_Microphone_gain; +static varinfo_t flash_media_Microphone_index; +static methodinfo_t flash_media_Microphone_setLoopBack; +static methodinfo_t flash_media_Microphone_setSilenceLevel; +static varinfo_t flash_media_Microphone_name; +static methodinfo_t flash_media_Microphone_setUseEchoSuppression; +static varinfo_t flash_media_Microphone_framesPerPacket; +static varinfo_t flash_media_Microphone_muted; +static varinfo_t flash_media_Microphone_soundTransform; +static varinfo_t flash_media_Microphone_encodeQuality; +static varinfo_t flash_media_Microphone_useEchoSuppression; +static varinfo_t flash_media_Microphone_silenceLevel; +static varinfo_t flash_media_Microphone_silenceTimeout; +static varinfo_t flash_media_Microphone_rate; +static varinfo_t flash_media_Microphone_activityLevel; static classinfo_t flash_ui_ContextMenuClipboardItems; static varinfo_t flash_ui_ContextMenuClipboardItems_clear; static methodinfo_t flash_ui_ContextMenuClipboardItems_clone; @@ -1301,9 +1883,17 @@ static varinfo_t flash_ui_ContextMenuClipboardItems_selectAll; static varinfo_t flash_ui_ContextMenuClipboardItems_copy; static varinfo_t flash_ui_ContextMenuClipboardItems_cut; +static varinfo_t flash_ui_ContextMenuClipboardItems_clear; +static methodinfo_t flash_ui_ContextMenuClipboardItems_clone; +static varinfo_t flash_ui_ContextMenuClipboardItems_paste; +static varinfo_t flash_ui_ContextMenuClipboardItems_selectAll; +static varinfo_t flash_ui_ContextMenuClipboardItems_copy; +static varinfo_t flash_ui_ContextMenuClipboardItems_cut; static classinfo_t flash_display_GraphicsShaderFill; static varinfo_t flash_display_GraphicsShaderFill_shader; static varinfo_t flash_display_GraphicsShaderFill_matrix; +static varinfo_t flash_display_GraphicsShaderFill_shader; +static varinfo_t flash_display_GraphicsShaderFill_matrix; static classinfo_t flash_errors_IllegalOperationError; static classinfo_t flash_filters_GradientGlowFilter; static varinfo_t flash_filters_GradientGlowFilter_strength; @@ -1318,10 +1908,19 @@ static varinfo_t flash_filters_GradientGlowFilter_blurY; static varinfo_t flash_filters_GradientGlowFilter_distance; static methodinfo_t flash_filters_GradientGlowFilter_clone; +static varinfo_t flash_filters_GradientGlowFilter_strength; +static varinfo_t flash_filters_GradientGlowFilter_quality; +static varinfo_t flash_filters_GradientGlowFilter_angle; +static varinfo_t flash_filters_GradientGlowFilter_knockout; +static varinfo_t flash_filters_GradientGlowFilter_type; +static varinfo_t flash_filters_GradientGlowFilter_alphas; +static varinfo_t flash_filters_GradientGlowFilter_ratios; +static varinfo_t flash_filters_GradientGlowFilter_colors; +static varinfo_t flash_filters_GradientGlowFilter_blurX; +static varinfo_t flash_filters_GradientGlowFilter_blurY; +static varinfo_t flash_filters_GradientGlowFilter_distance; +static methodinfo_t flash_filters_GradientGlowFilter_clone; static classinfo_t flash_display_CapsStyle; -static varinfo_t flash_display_CapsStyle_ROUND; -static varinfo_t flash_display_CapsStyle_SQUARE; -static varinfo_t flash_display_CapsStyle_NONE; static classinfo_t flash_text_TextSnapshot; static methodinfo_t flash_text_TextSnapshot_setSelectColor; static methodinfo_t flash_text_TextSnapshot_setSelected; @@ -1332,9 +1931,16 @@ static methodinfo_t flash_text_TextSnapshot_getSelected; static methodinfo_t flash_text_TextSnapshot_hitTestTextNearPos; static methodinfo_t flash_text_TextSnapshot_getText; +static methodinfo_t flash_text_TextSnapshot_setSelectColor; +static methodinfo_t flash_text_TextSnapshot_setSelected; +static methodinfo_t flash_text_TextSnapshot_getSelectedText; +static methodinfo_t flash_text_TextSnapshot_getTextRunInfo; +static varinfo_t flash_text_TextSnapshot_charCount; +static methodinfo_t flash_text_TextSnapshot_findText; +static methodinfo_t flash_text_TextSnapshot_getSelected; +static methodinfo_t flash_text_TextSnapshot_hitTestTextNearPos; +static methodinfo_t flash_text_TextSnapshot_getText; static classinfo_t flash_text_engine_FontLookup; -static varinfo_t flash_text_engine_FontLookup_DEVICE; -static varinfo_t flash_text_engine_FontLookup_EMBEDDED_CFF; static classinfo_t flash_display_InteractiveObject; static varinfo_t flash_display_InteractiveObject_tabIndex; static varinfo_t flash_display_InteractiveObject_doubleClickEnabled; @@ -1343,8 +1949,76 @@ static varinfo_t flash_display_InteractiveObject_contextMenu; static varinfo_t flash_display_InteractiveObject_focusRect; static varinfo_t flash_display_InteractiveObject_accessibilityImplementation; +static varinfo_t flash_display_InteractiveObject_tabIndex; +static varinfo_t flash_display_InteractiveObject_doubleClickEnabled; +static varinfo_t flash_display_InteractiveObject_tabEnabled; +static varinfo_t flash_display_InteractiveObject_mouseEnabled; +static varinfo_t flash_display_InteractiveObject_contextMenu; +static varinfo_t flash_display_InteractiveObject_focusRect; +static varinfo_t flash_display_InteractiveObject_accessibilityImplementation; static classinfo_t flash_text_TextField; -static methodinfo_t flash_text_TextField_isFontCompatible; +static methodinfo_t flash_text_TextField_getTextFormat; +static varinfo_t flash_text_TextField_border; +static varinfo_t flash_text_TextField_selectedText; +static methodinfo_t flash_text_TextField_pasteRichText; +static varinfo_t flash_text_TextField_bottomScrollV; +static methodinfo_t flash_text_TextField_getLineIndexOfChar; +static methodinfo_t flash_text_TextField_replaceText; +static varinfo_t flash_text_TextField_defaultTextFormat; +static varinfo_t flash_text_TextField_restrict; +static varinfo_t flash_text_TextField_htmlText; +static methodinfo_t flash_text_TextField_copyRichText; +static methodinfo_t flash_text_TextField_getLineText; +static methodinfo_t flash_text_TextField_getFirstCharInParagraph; +static methodinfo_t flash_text_TextField_setSelection; +static varinfo_t flash_text_TextField_length; +static varinfo_t flash_text_TextField_wordWrap; +static methodinfo_t flash_text_TextField_appendText; +static varinfo_t flash_text_TextField_caretIndex; +static varinfo_t flash_text_TextField_mouseWheelEnabled; +static varinfo_t flash_text_TextField_selectionBeginIndex; +static varinfo_t flash_text_TextField_sharpness; +static varinfo_t flash_text_TextField_type; +static methodinfo_t flash_text_TextField_getLineIndexAtPoint; +static methodinfo_t flash_text_TextField_getCharIndexAtPoint; +static methodinfo_t flash_text_TextField_getXMLText; +static methodinfo_t flash_text_TextField_getParagraphLength; +static methodinfo_t flash_text_TextField_getRawText; +static varinfo_t flash_text_TextField_gridFitType; +static methodinfo_t flash_text_TextField_getLineOffset; +static varinfo_t flash_text_TextField_backgroundColor; +static varinfo_t flash_text_TextField_multiline; +static varinfo_t flash_text_TextField_numLines; +static methodinfo_t flash_text_TextField_getImageReference; +static varinfo_t flash_text_TextField_displayAsPassword; +static varinfo_t flash_text_TextField_textWidth; +static varinfo_t flash_text_TextField_autoSize; +static varinfo_t flash_text_TextField_selectable; +static methodinfo_t flash_text_TextField_getCharBoundaries; +static varinfo_t flash_text_TextField_alwaysShowSelection; +static varinfo_t flash_text_TextField_thickness; +static varinfo_t flash_text_TextField_useRichTextClipboard; +static varinfo_t flash_text_TextField_scrollV; +static methodinfo_t flash_text_TextField_getTextRuns; +static methodinfo_t flash_text_TextField_setTextFormat; +static varinfo_t flash_text_TextField_textColor; +static varinfo_t flash_text_TextField_maxScrollV; +static varinfo_t flash_text_TextField_embedFonts; +static varinfo_t flash_text_TextField_scrollH; +static varinfo_t flash_text_TextField_text; +static methodinfo_t flash_text_TextField_getLineLength; +static varinfo_t flash_text_TextField_textHeight; +static varinfo_t flash_text_TextField_antiAliasType; +static varinfo_t flash_text_TextField_styleSheet; +static varinfo_t flash_text_TextField_background; +static methodinfo_t flash_text_TextField_replaceSelectedText; +static varinfo_t flash_text_TextField_borderColor; +static varinfo_t flash_text_TextField_maxScrollH; +static varinfo_t flash_text_TextField_maxChars; +static methodinfo_t flash_text_TextField_getLineMetrics; +static varinfo_t flash_text_TextField_selectionEndIndex; +static methodinfo_t flash_text_TextField_insertXMLText; +static varinfo_t flash_text_TextField_condenseWhite; static methodinfo_t flash_text_TextField_getTextFormat; static varinfo_t flash_text_TextField_border; static varinfo_t flash_text_TextField_selectedText; @@ -1408,15 +2082,26 @@ static methodinfo_t flash_text_TextField_insertXMLText; static varinfo_t flash_text_TextField_condenseWhite; static classinfo_t flash_printing_PrintJobOrientation; -static varinfo_t flash_printing_PrintJobOrientation_LANDSCAPE; -static varinfo_t flash_printing_PrintJobOrientation_PORTRAIT; static classinfo_t flash_text_TextRenderer; -static varinfo_t flash_text_TextRenderer_displayMode; -static varinfo_t flash_text_TextRenderer_antiAliasType; -static varinfo_t flash_text_TextRenderer_maxLevel; -static methodinfo_t flash_text_TextRenderer_setAdvancedAntiAliasingTable; static classinfo_t flash_net_NetConnection; -static varinfo_t flash_net_NetConnection_defaultObjectEncoding; +static varinfo_t flash_net_NetConnection_nearID; +static varinfo_t flash_net_NetConnection_client; +static varinfo_t flash_net_NetConnection_farNonce; +static varinfo_t flash_net_NetConnection_objectEncoding; +static varinfo_t flash_net_NetConnection_farID; +static varinfo_t flash_net_NetConnection_connected; +static methodinfo_t flash_net_NetConnection_call; +static varinfo_t flash_net_NetConnection_usingTLS; +static varinfo_t flash_net_NetConnection_proxyType; +static methodinfo_t flash_net_NetConnection_addHeader; +static varinfo_t flash_net_NetConnection_protocol; +static methodinfo_t flash_net_NetConnection_close; +static varinfo_t flash_net_NetConnection_nearNonce; +static methodinfo_t flash_net_NetConnection_connect; +static varinfo_t flash_net_NetConnection_unconnectedPeerStreams; +static varinfo_t flash_net_NetConnection_maxPeerConnections; +static varinfo_t flash_net_NetConnection_connectedProxyType; +static varinfo_t flash_net_NetConnection_uri; static varinfo_t flash_net_NetConnection_nearID; static varinfo_t flash_net_NetConnection_client; static varinfo_t flash_net_NetConnection_farNonce; @@ -1439,38 +2124,19 @@ static methodinfo_t flash_sampler_isGetterSetter; static methodinfo_t flash_utils_getQualifiedSuperclassName; static classinfo_t flash_display_GraphicsPathWinding; -static varinfo_t flash_display_GraphicsPathWinding_EVEN_ODD; -static varinfo_t flash_display_GraphicsPathWinding_NON_ZERO; static classinfo_t flash_text_engine_TabStop; static varinfo_t flash_text_engine_TabStop_alignment; static varinfo_t flash_text_engine_TabStop_position; static varinfo_t flash_text_engine_TabStop_decimalAlignmentToken; +static varinfo_t flash_text_engine_TabStop_alignment; +static varinfo_t flash_text_engine_TabStop_position; +static varinfo_t flash_text_engine_TabStop_decimalAlignmentToken; static classinfo_t flash_text_engine_JustificationStyle; -static varinfo_t flash_text_engine_JustificationStyle_PUSH_OUT_ONLY; -static varinfo_t flash_text_engine_JustificationStyle_PRIORITIZE_LEAST_ADJUSTMENT; -static varinfo_t flash_text_engine_JustificationStyle_PUSH_IN_KINSOKU; static methodinfo_t flash_sampler_startSampling; static classinfo_t flash_text_engine_TextRotation; -static varinfo_t flash_text_engine_TextRotation_ROTATE_270; -static varinfo_t flash_text_engine_TextRotation_AUTO; -static varinfo_t flash_text_engine_TextRotation_ROTATE_0; -static varinfo_t flash_text_engine_TextRotation_ROTATE_90; -static varinfo_t flash_text_engine_TextRotation_ROTATE_180; static methodinfo_t flash_sampler_clearSamples; static classinfo_t flash_system_IMEConversionMode; -static varinfo_t flash_system_IMEConversionMode_JAPANESE_KATAKANA_FULL; -static varinfo_t flash_system_IMEConversionMode_CHINESE; -static varinfo_t flash_system_IMEConversionMode_JAPANESE_KATAKANA_HALF; -static varinfo_t flash_system_IMEConversionMode_UNKNOWN; -static varinfo_t flash_system_IMEConversionMode_KOREAN; -static varinfo_t flash_system_IMEConversionMode_ALPHANUMERIC_HALF; -static varinfo_t flash_system_IMEConversionMode_ALPHANUMERIC_FULL; -static varinfo_t flash_system_IMEConversionMode_JAPANESE_HIRAGANA; static classinfo_t flash_display_StageScaleMode; -static varinfo_t flash_display_StageScaleMode_SHOW_ALL; -static varinfo_t flash_display_StageScaleMode_NO_BORDER; -static varinfo_t flash_display_StageScaleMode_EXACT_FIT; -static varinfo_t flash_display_StageScaleMode_NO_SCALE; static methodinfo_t flash_sampler_getSize; static classinfo_t flash_net_URLStream; static methodinfo_t flash_net_URLStream_readUTF; @@ -1493,94 +2159,124 @@ static methodinfo_t flash_net_URLStream_readFloat; static varinfo_t flash_net_URLStream_endian; static methodinfo_t flash_net_URLStream_readBoolean; +static methodinfo_t flash_net_URLStream_readUTF; +static methodinfo_t flash_net_URLStream_readByte; +static methodinfo_t flash_net_URLStream_readUTFBytes; +static methodinfo_t flash_net_URLStream_readShort; +static varinfo_t flash_net_URLStream_objectEncoding; +static varinfo_t flash_net_URLStream_connected; +static methodinfo_t flash_net_URLStream_readUnsignedInt; +static methodinfo_t flash_net_URLStream_readDouble; +static methodinfo_t flash_net_URLStream_readBytes; +static methodinfo_t flash_net_URLStream_readUnsignedByte; +static methodinfo_t flash_net_URLStream_readMultiByte; +static methodinfo_t flash_net_URLStream_readInt; +static varinfo_t flash_net_URLStream_bytesAvailable; +static methodinfo_t flash_net_URLStream_load; +static methodinfo_t flash_net_URLStream_close; +static methodinfo_t flash_net_URLStream_readUnsignedShort; +static methodinfo_t flash_net_URLStream_readObject; +static methodinfo_t flash_net_URLStream_readFloat; +static varinfo_t flash_net_URLStream_endian; +static methodinfo_t flash_net_URLStream_readBoolean; static classinfo_t flash_display_BlendMode; -static varinfo_t flash_display_BlendMode_LAYER; -static varinfo_t flash_display_BlendMode_ERASE; -static varinfo_t flash_display_BlendMode_HARDLIGHT; -static varinfo_t flash_display_BlendMode_OVERLAY; -static varinfo_t flash_display_BlendMode_ALPHA; -static varinfo_t flash_display_BlendMode_SUBTRACT; -static varinfo_t flash_display_BlendMode_INVERT; -static varinfo_t flash_display_BlendMode_DIFFERENCE; -static varinfo_t flash_display_BlendMode_DARKEN; -static varinfo_t flash_display_BlendMode_SHADER; -static varinfo_t flash_display_BlendMode_MULTIPLY; -static varinfo_t flash_display_BlendMode_ADD; -static varinfo_t flash_display_BlendMode_SCREEN; -static varinfo_t flash_display_BlendMode_NORMAL; -static varinfo_t flash_display_BlendMode_LIGHTEN; static classinfo_t flash_ui_Mouse; -static varinfo_t flash_ui_Mouse_cursor; -static methodinfo_t flash_ui_Mouse_show; -static methodinfo_t flash_ui_Mouse_hide; static classinfo_t flash_errors_InvalidSWFError; static classinfo_t flash_text_engine_RenderingMode; -static varinfo_t flash_text_engine_RenderingMode_NORMAL; -static varinfo_t flash_text_engine_RenderingMode_CFF; static classinfo_t flash_display_GraphicsTrianglePath; static varinfo_t flash_display_GraphicsTrianglePath_culling; static varinfo_t flash_display_GraphicsTrianglePath_vertices; static varinfo_t flash_display_GraphicsTrianglePath_indices; static varinfo_t flash_display_GraphicsTrianglePath_uvtData; +static varinfo_t flash_display_GraphicsTrianglePath_culling; +static varinfo_t flash_display_GraphicsTrianglePath_vertices; +static varinfo_t flash_display_GraphicsTrianglePath_indices; +static varinfo_t flash_display_GraphicsTrianglePath_uvtData; static classinfo_t flash_display_IGraphicsFill; static classinfo_t flash_text_engine_TypographicCase; -static varinfo_t flash_text_engine_TypographicCase_UPPERCASE; -static varinfo_t flash_text_engine_TypographicCase_DEFAULT; -static varinfo_t flash_text_engine_TypographicCase_LOWERCASE; -static varinfo_t flash_text_engine_TypographicCase_SMALL_CAPS; -static varinfo_t flash_text_engine_TypographicCase_TITLE; -static varinfo_t flash_text_engine_TypographicCase_CAPS; -static varinfo_t flash_text_engine_TypographicCase_CAPS_AND_SMALL_CAPS; static classinfo_t _XML; -static methodinfo_t _XML_attribute; +static methodinfo_t _XML_normalize; +static methodinfo_t _XML_removeNamespace; +static methodinfo_t _XML_prependChild; +static methodinfo_t _XML_toXMLString; +static methodinfo_t _XML_text; +static methodinfo_t _XML_nodeKind; +static methodinfo_t _XML_copy; static methodinfo_t _XML_toString; static methodinfo_t _XML_childIndex; -static methodinfo_t _XML_parent; -static methodinfo_t _XML_appendChild; +static methodinfo_t _XML_setName; +static methodinfo_t _XML_setLocalName; +static methodinfo_t _XML_namespace; +static methodinfo_t _XML_insertChildBefore; +static methodinfo_t _XML_addNamespace; +static methodinfo_t _XML_propertyIsEnumerable; +static methodinfo_t _XML_comments; +static methodinfo_t _XML_attributes; +static methodinfo_t _XML_descendants; static methodinfo_t _XML_replace; -static methodinfo_t _XML_elements; static methodinfo_t _XML_setNotification; -static methodinfo_t _XML_namespaceDeclarations; +static methodinfo_t _XML_children; +static methodinfo_t _XML_contains; +static methodinfo_t _XML_hasSimpleContent; +static methodinfo_t _XML_elements; +static methodinfo_t _XML_hasComplexContent; +static methodinfo_t _XML_insertChildAfter; +static methodinfo_t _XML_parent; static methodinfo_t _XML_length; -static methodinfo_t _XML_comments; static methodinfo_t _XML_processingInstructions; -static methodinfo_t _XML_inScopeNamespaces; -static varinfo_t _XML_prettyPrinting; -static methodinfo_t _XML_children; -static methodinfo_t _XML_setLocalName; -static methodinfo_t _XML_setSettings; -static varinfo_t _XML_ignoreComments; +static methodinfo_t _XML_child; +static methodinfo_t _XML_appendChild; +static methodinfo_t _XML_valueOf; +static methodinfo_t _XML_localName; static methodinfo_t _XML_notification; -static varinfo_t _XML_ignoreWhitespace; -static methodinfo_t _XML_setNamespace; -static methodinfo_t _XML_prependChild; -static methodinfo_t _XML_hasSimpleContent; -static methodinfo_t _XML_insertChildBefore; +static methodinfo_t _XML_inScopeNamespaces; static methodinfo_t _XML_hasOwnProperty; +static methodinfo_t _XML_namespaceDeclarations; +static methodinfo_t _XML_setNamespace; +static methodinfo_t _XML_name; +static methodinfo_t _XML_setChildren; +static methodinfo_t _XML_attribute; static methodinfo_t _XML_normalize; -static methodinfo_t _XML_valueOf; +static methodinfo_t _XML_removeNamespace; +static methodinfo_t _XML_prependChild; +static methodinfo_t _XML_toXMLString; +static methodinfo_t _XML_text; +static methodinfo_t _XML_nodeKind; static methodinfo_t _XML_copy; -static methodinfo_t _XML_localName; -static methodinfo_t _XML_contains; -static methodinfo_t _XML_propertyIsEnumerable; -static methodinfo_t _XML_defaultSettings; -static methodinfo_t _XML_settings; +static methodinfo_t _XML_toString; +static methodinfo_t _XML_childIndex; +static methodinfo_t _XML_setName; +static methodinfo_t _XML_setLocalName; static methodinfo_t _XML_namespace; +static methodinfo_t _XML_insertChildBefore; +static methodinfo_t _XML_addNamespace; +static methodinfo_t _XML_propertyIsEnumerable; +static methodinfo_t _XML_comments; static methodinfo_t _XML_attributes; -static methodinfo_t _XML_setName; -static methodinfo_t _XML_text; -static methodinfo_t _XML_insertChildAfter; -static varinfo_t _XML_ignoreProcessingInstructions; -static varinfo_t _XML_prettyIndent; static methodinfo_t _XML_descendants; -static methodinfo_t _XML_toXMLString; +static methodinfo_t _XML_replace; +static methodinfo_t _XML_setNotification; +static methodinfo_t _XML_children; +static methodinfo_t _XML_contains; +static methodinfo_t _XML_hasSimpleContent; +static methodinfo_t _XML_elements; static methodinfo_t _XML_hasComplexContent; +static methodinfo_t _XML_insertChildAfter; +static methodinfo_t _XML_parent; +static methodinfo_t _XML_length; +static methodinfo_t _XML_processingInstructions; static methodinfo_t _XML_child; -static methodinfo_t _XML_removeNamespace; -static methodinfo_t _XML_addNamespace; -static methodinfo_t _XML_nodeKind; +static methodinfo_t _XML_appendChild; +static methodinfo_t _XML_valueOf; +static methodinfo_t _XML_localName; +static methodinfo_t _XML_notification; +static methodinfo_t _XML_inScopeNamespaces; +static methodinfo_t _XML_hasOwnProperty; +static methodinfo_t _XML_namespaceDeclarations; +static methodinfo_t _XML_setNamespace; static methodinfo_t _XML_name; static methodinfo_t _XML_setChildren; +static methodinfo_t _XML_attribute; static classinfo_t flash_net_NetStreamInfo; static varinfo_t flash_net_NetStreamInfo_maxBytesPerSecond; static varinfo_t flash_net_NetStreamInfo_dataBufferByteLength; @@ -1602,6 +2298,26 @@ static varinfo_t flash_net_NetStreamInfo_currentBytesPerSecond; static varinfo_t flash_net_NetStreamInfo_audioBytesPerSecond; static varinfo_t flash_net_NetStreamInfo_playbackBytesPerSecond; +static varinfo_t flash_net_NetStreamInfo_maxBytesPerSecond; +static varinfo_t flash_net_NetStreamInfo_dataBufferByteLength; +static varinfo_t flash_net_NetStreamInfo_videoByteCount; +static varinfo_t flash_net_NetStreamInfo_videoBufferLength; +static varinfo_t flash_net_NetStreamInfo_audioBufferByteLength; +static varinfo_t flash_net_NetStreamInfo_dataBytesPerSecond; +static varinfo_t flash_net_NetStreamInfo_SRTT; +static varinfo_t flash_net_NetStreamInfo_droppedFrames; +static varinfo_t flash_net_NetStreamInfo_audioByteCount; +static varinfo_t flash_net_NetStreamInfo_audioBufferLength; +static varinfo_t flash_net_NetStreamInfo_byteCount; +static methodinfo_t flash_net_NetStreamInfo_toString; +static varinfo_t flash_net_NetStreamInfo_dataByteCount; +static varinfo_t flash_net_NetStreamInfo_videoBufferByteLength; +static varinfo_t flash_net_NetStreamInfo_dataBufferLength; +static varinfo_t flash_net_NetStreamInfo_audioLossRate; +static varinfo_t flash_net_NetStreamInfo_videoBytesPerSecond; +static varinfo_t flash_net_NetStreamInfo_currentBytesPerSecond; +static varinfo_t flash_net_NetStreamInfo_audioBytesPerSecond; +static varinfo_t flash_net_NetStreamInfo_playbackBytesPerSecond; static classinfo_t flash_display_Stage; static methodinfo_t flash_display_Stage_setChildIndex; static varinfo_t flash_display_Stage_stageFocusRect; @@ -1635,39 +2351,67 @@ static varinfo_t flash_display_Stage_colorCorrection; static varinfo_t flash_display_Stage_colorCorrectionSupport; static varinfo_t flash_display_Stage_stageWidth; +static methodinfo_t flash_display_Stage_setChildIndex; +static varinfo_t flash_display_Stage_stageFocusRect; +static varinfo_t flash_display_Stage_frameRate; +static methodinfo_t flash_display_Stage_invalidate; +static varinfo_t flash_display_Stage_textSnapshot; +static varinfo_t flash_display_Stage_quality; +static methodinfo_t flash_display_Stage_willTrigger; +static methodinfo_t flash_display_Stage_dispatchEvent; +static methodinfo_t flash_display_Stage_isFocusInaccessible; +static methodinfo_t flash_display_Stage_removeChildAt; +static varinfo_t flash_display_Stage_fullScreenWidth; +static methodinfo_t flash_display_Stage_addChildAt; +static varinfo_t flash_display_Stage_height; +static varinfo_t flash_display_Stage_fullScreenSourceRect; +static varinfo_t flash_display_Stage_width; +static methodinfo_t flash_display_Stage_addChild; +static varinfo_t flash_display_Stage_numChildren; +static varinfo_t flash_display_Stage_mouseChildren; +static methodinfo_t flash_display_Stage_swapChildrenAt; +static varinfo_t flash_display_Stage_showDefaultContextMenu; +static methodinfo_t flash_display_Stage_addEventListener; +static varinfo_t flash_display_Stage_stageHeight; +static varinfo_t flash_display_Stage_fullScreenHeight; +static varinfo_t flash_display_Stage_align; +static methodinfo_t flash_display_Stage_hasEventListener; +static varinfo_t flash_display_Stage_displayState; +static varinfo_t flash_display_Stage_scaleMode; +static varinfo_t flash_display_Stage_tabChildren; +static varinfo_t flash_display_Stage_focus; +static varinfo_t flash_display_Stage_colorCorrection; +static varinfo_t flash_display_Stage_colorCorrectionSupport; +static varinfo_t flash_display_Stage_stageWidth; static classinfo_t flash_ui_ContextMenuItem; static varinfo_t flash_ui_ContextMenuItem_separatorBefore; static varinfo_t flash_ui_ContextMenuItem_enabled; static varinfo_t flash_ui_ContextMenuItem_caption; static methodinfo_t flash_ui_ContextMenuItem_clone; static varinfo_t flash_ui_ContextMenuItem_visible; +static varinfo_t flash_ui_ContextMenuItem_separatorBefore; +static varinfo_t flash_ui_ContextMenuItem_enabled; +static varinfo_t flash_ui_ContextMenuItem_caption; +static methodinfo_t flash_ui_ContextMenuItem_clone; +static varinfo_t flash_ui_ContextMenuItem_visible; static classinfo_t flash_trace_Trace; -static varinfo_t flash_trace_Trace_METHODS_AND_LINES_WITH_ARGS; -static varinfo_t flash_trace_Trace_FILE; -static varinfo_t flash_trace_Trace_METHODS_WITH_ARGS; -static varinfo_t flash_trace_Trace_OFF; -static varinfo_t flash_trace_Trace_METHODS_AND_LINES; -static varinfo_t flash_trace_Trace_LISTENER; -static methodinfo_t flash_trace_Trace_getLevel; -static methodinfo_t flash_trace_Trace_setLevel; -static methodinfo_t flash_trace_Trace_setListener; -static methodinfo_t flash_trace_Trace_getListener; -static varinfo_t flash_trace_Trace_METHODS; static classinfo_t flash_events_TimerEvent; -static varinfo_t flash_events_TimerEvent_TIMER_COMPLETE; static methodinfo_t flash_events_TimerEvent_toString; static methodinfo_t flash_events_TimerEvent_clone; -static varinfo_t flash_events_TimerEvent_TIMER; +static methodinfo_t flash_events_TimerEvent_updateAfterEvent; +static methodinfo_t flash_events_TimerEvent_toString; +static methodinfo_t flash_events_TimerEvent_clone; static methodinfo_t flash_events_TimerEvent_updateAfterEvent; static classinfo_t flash_events_SampleDataEvent; static methodinfo_t flash_events_SampleDataEvent_toString; static varinfo_t flash_events_SampleDataEvent_position; static methodinfo_t flash_events_SampleDataEvent_clone; -static varinfo_t flash_events_SampleDataEvent_SAMPLE_DATA; +static varinfo_t flash_events_SampleDataEvent_data; +static methodinfo_t flash_events_SampleDataEvent_toString; +static varinfo_t flash_events_SampleDataEvent_position; +static methodinfo_t flash_events_SampleDataEvent_clone; static varinfo_t flash_events_SampleDataEvent_data; static classinfo_t flash_display_ShaderPrecision; -static varinfo_t flash_display_ShaderPrecision_FULL; -static varinfo_t flash_display_ShaderPrecision_FAST; static classinfo_t flash_net_FileReference; static varinfo_t flash_net_FileReference_type; static methodinfo_t flash_net_FileReference_browse; @@ -1682,8 +2426,20 @@ static varinfo_t flash_net_FileReference_name; static methodinfo_t flash_net_FileReference_load; static varinfo_t flash_net_FileReference_modificationDate; +static varinfo_t flash_net_FileReference_type; +static methodinfo_t flash_net_FileReference_browse; +static varinfo_t flash_net_FileReference_creationDate; +static methodinfo_t flash_net_FileReference_upload; +static methodinfo_t flash_net_FileReference_download; +static methodinfo_t flash_net_FileReference_save; +static methodinfo_t flash_net_FileReference_cancel; +static varinfo_t flash_net_FileReference_creator; +static varinfo_t flash_net_FileReference_data; +static varinfo_t flash_net_FileReference_size; +static varinfo_t flash_net_FileReference_name; +static methodinfo_t flash_net_FileReference_load; +static varinfo_t flash_net_FileReference_modificationDate; static classinfo_t _DefinitionError; -static varinfo_t _DefinitionError_length; static classinfo_t flash_events_EventDispatcher; static methodinfo_t flash_events_EventDispatcher_willTrigger; static methodinfo_t flash_events_EventDispatcher_toString; @@ -1691,9 +2447,13 @@ static methodinfo_t flash_events_EventDispatcher_hasEventListener; static methodinfo_t flash_events_EventDispatcher_addEventListener; static methodinfo_t flash_events_EventDispatcher_dispatchEvent; +static methodinfo_t flash_events_EventDispatcher_willTrigger; +static methodinfo_t flash_events_EventDispatcher_toString; +static methodinfo_t flash_events_EventDispatcher_removeEventListener; +static methodinfo_t flash_events_EventDispatcher_hasEventListener; +static methodinfo_t flash_events_EventDispatcher_addEventListener; +static methodinfo_t flash_events_EventDispatcher_dispatchEvent; static classinfo_t flash_net_SharedObjectFlushStatus; -static varinfo_t flash_net_SharedObjectFlushStatus_FLUSHED; -static varinfo_t flash_net_SharedObjectFlushStatus_PENDING; static classinfo_t flash_text_TextLineMetrics; static varinfo_t flash_text_TextLineMetrics_descent; static varinfo_t flash_text_TextLineMetrics_width; @@ -1701,23 +2461,36 @@ static varinfo_t flash_text_TextLineMetrics_leading; static varinfo_t flash_text_TextLineMetrics_height; static varinfo_t flash_text_TextLineMetrics_x; +static varinfo_t flash_text_TextLineMetrics_descent; +static varinfo_t flash_text_TextLineMetrics_width; +static varinfo_t flash_text_TextLineMetrics_ascent; +static varinfo_t flash_text_TextLineMetrics_leading; +static varinfo_t flash_text_TextLineMetrics_height; +static varinfo_t flash_text_TextLineMetrics_x; static classinfo_t flash_text_AntiAliasType; -static varinfo_t flash_text_AntiAliasType_NORMAL; -static varinfo_t flash_text_AntiAliasType_ADVANCED; static classinfo_t flash_system_SecurityDomain; -static varinfo_t flash_system_SecurityDomain_currentDomain; static classinfo_t flash_text_Font; -static methodinfo_t flash_text_Font_enumerateFonts; static methodinfo_t flash_text_Font_hasGlyphs; static varinfo_t flash_text_Font_fontName; -static methodinfo_t flash_text_Font_registerFont; +static varinfo_t flash_text_Font_fontStyle; +static varinfo_t flash_text_Font_fontType; +static methodinfo_t flash_text_Font_hasGlyphs; +static varinfo_t flash_text_Font_fontName; static varinfo_t flash_text_Font_fontStyle; static varinfo_t flash_text_Font_fontType; static classinfo_t _RegExp; static varinfo_t _RegExp_source; static methodinfo_t _RegExp_test; static varinfo_t _RegExp_global; -static varinfo_t _RegExp_length; +static methodinfo_t _RegExp_exec; +static varinfo_t _RegExp_ignoreCase; +static varinfo_t _RegExp_dotall; +static varinfo_t _RegExp_lastIndex; +static varinfo_t _RegExp_extended; +static varinfo_t _RegExp_multiline; +static varinfo_t _RegExp_source; +static methodinfo_t _RegExp_test; +static varinfo_t _RegExp_global; static methodinfo_t _RegExp_exec; static varinfo_t _RegExp_ignoreCase; static varinfo_t _RegExp_dotall; @@ -1731,6 +2504,12 @@ static varinfo_t flash_accessibility_AccessibilityProperties_name; static varinfo_t flash_accessibility_AccessibilityProperties_shortcut; static varinfo_t flash_accessibility_AccessibilityProperties_silent; +static varinfo_t flash_accessibility_AccessibilityProperties_forceSimple; +static varinfo_t flash_accessibility_AccessibilityProperties_noAutoLabeling; +static varinfo_t flash_accessibility_AccessibilityProperties_description; +static varinfo_t flash_accessibility_AccessibilityProperties_name; +static varinfo_t flash_accessibility_AccessibilityProperties_shortcut; +static varinfo_t flash_accessibility_AccessibilityProperties_silent; static classinfo_t flash_ui_ContextMenu; static methodinfo_t flash_ui_ContextMenu_hideBuiltInItems; static varinfo_t flash_ui_ContextMenu_clipboardItems; @@ -1739,42 +2518,16 @@ static methodinfo_t flash_ui_ContextMenu_clone; static varinfo_t flash_ui_ContextMenu_link; static varinfo_t flash_ui_ContextMenu_clipboardMenu; +static methodinfo_t flash_ui_ContextMenu_hideBuiltInItems; +static varinfo_t flash_ui_ContextMenu_clipboardItems; +static varinfo_t flash_ui_ContextMenu_builtInItems; +static varinfo_t flash_ui_ContextMenu_customItems; +static methodinfo_t flash_ui_ContextMenu_clone; +static varinfo_t flash_ui_ContextMenu_link; +static varinfo_t flash_ui_ContextMenu_clipboardMenu; static classinfo_t flash_text_TextFieldAutoSize; -static varinfo_t flash_text_TextFieldAutoSize_LEFT; -static varinfo_t flash_text_TextFieldAutoSize_RIGHT; -static varinfo_t flash_text_TextFieldAutoSize_CENTER; -static varinfo_t flash_text_TextFieldAutoSize_NONE; static classinfo_t _Math; -static methodinfo_t _Math_ceil; -static varinfo_t _Math_SQRT2; -static methodinfo_t _Math_cos; -static methodinfo_t _Math_abs; -static varinfo_t _Math_PI; -static varinfo_t _Math_E; -static methodinfo_t _Math_round; -static varinfo_t _Math_LN10; -static varinfo_t _Math_SQRT1_2; -static methodinfo_t _Math_log; -static varinfo_t _Math_LOG10E; -static methodinfo_t _Math_random; -static methodinfo_t _Math_acos; -static methodinfo_t _Math_tan; -static methodinfo_t _Math_asin; -static methodinfo_t _Math_exp; -static methodinfo_t _Math_atan2; -static methodinfo_t _Math_pow; -static methodinfo_t _Math_min; -static varinfo_t _Math_LN2; -static methodinfo_t _Math_sin; -static methodinfo_t _Math_sqrt; -static varinfo_t _Math_LOG2E; -static methodinfo_t _Math_max; -static methodinfo_t _Math_atan; -static methodinfo_t _Math_floor; static classinfo_t flash_display_ColorCorrectionSupport; -static varinfo_t flash_display_ColorCorrectionSupport_UNSUPPORTED; -static varinfo_t flash_display_ColorCorrectionSupport_DEFAULT_ON; -static varinfo_t flash_display_ColorCorrectionSupport_DEFAULT_OFF; static classinfo_t flash_errors_IOError; static methodinfo_t _trace; static classinfo_t flash_ui_ContextMenuBuiltInItems; @@ -1787,28 +2540,30 @@ static methodinfo_t flash_ui_ContextMenuBuiltInItems_clone; static varinfo_t flash_ui_ContextMenuBuiltInItems_quality; static varinfo_t flash_ui_ContextMenuBuiltInItems_play; +static varinfo_t flash_ui_ContextMenuBuiltInItems_zoom; +static varinfo_t flash_ui_ContextMenuBuiltInItems_save; +static varinfo_t flash_ui_ContextMenuBuiltInItems_loop; +static varinfo_t flash_ui_ContextMenuBuiltInItems_print; +static varinfo_t flash_ui_ContextMenuBuiltInItems_forwardAndBack; +static varinfo_t flash_ui_ContextMenuBuiltInItems_rewind; +static methodinfo_t flash_ui_ContextMenuBuiltInItems_clone; +static varinfo_t flash_ui_ContextMenuBuiltInItems_quality; +static varinfo_t flash_ui_ContextMenuBuiltInItems_play; static classinfo_t flash_net_FileReferenceList; static varinfo_t flash_net_FileReferenceList_fileList; static methodinfo_t flash_net_FileReferenceList_browse; +static varinfo_t flash_net_FileReferenceList_fileList; +static methodinfo_t flash_net_FileReferenceList_browse; static classinfo_t flash_display_TriangleCulling; -static varinfo_t flash_display_TriangleCulling_POSITIVE; -static varinfo_t flash_display_TriangleCulling_NEGATIVE; -static varinfo_t flash_display_TriangleCulling_NONE; static classinfo_t flash_media_SoundMixer; -static methodinfo_t flash_media_SoundMixer_computeSpectrum; -static methodinfo_t flash_media_SoundMixer_areSoundsInaccessible; -static varinfo_t flash_media_SoundMixer_soundTransform; -static varinfo_t flash_media_SoundMixer_bufferTime; -static methodinfo_t flash_media_SoundMixer_stopAll; static classinfo_t adobe_utils_XMLUI; -static methodinfo_t adobe_utils_XMLUI_cancel; -static methodinfo_t adobe_utils_XMLUI_setProperty; -static methodinfo_t adobe_utils_XMLUI_getProperty; -static methodinfo_t adobe_utils_XMLUI_accept; static methodinfo_t _escape; static methodinfo_t flash_utils_setInterval; static classinfo_t flash_events_StatusEvent; -static varinfo_t flash_events_StatusEvent_STATUS; +static methodinfo_t flash_events_StatusEvent_toString; +static varinfo_t flash_events_StatusEvent_code; +static methodinfo_t flash_events_StatusEvent_clone; +static varinfo_t flash_events_StatusEvent_level; static methodinfo_t flash_events_StatusEvent_toString; static varinfo_t flash_events_StatusEvent_code; static methodinfo_t flash_events_StatusEvent_clone; @@ -1819,34 +2574,38 @@ static methodinfo_t flash_events_ShaderEvent_toString; static varinfo_t flash_events_ShaderEvent_bitmapData; static methodinfo_t flash_events_ShaderEvent_clone; -static varinfo_t flash_events_ShaderEvent_COMPLETE; +static varinfo_t flash_events_ShaderEvent_byteArray; +static varinfo_t flash_events_ShaderEvent_vector; +static methodinfo_t flash_events_ShaderEvent_toString; +static varinfo_t flash_events_ShaderEvent_bitmapData; +static methodinfo_t flash_events_ShaderEvent_clone; static varinfo_t flash_events_ShaderEvent_byteArray; static classinfo_t flash_display_Shader; static varinfo_t flash_display_Shader_precisionHint; static varinfo_t flash_display_Shader_data; +static varinfo_t flash_display_Shader_precisionHint; +static varinfo_t flash_display_Shader_data; static classinfo_t flash_errors_StackOverflowError; static methodinfo_t flash_sampler_getInvocationCount; static classinfo_t flash_text_engine_Kerning; -static varinfo_t flash_text_engine_Kerning_AUTO; -static varinfo_t flash_text_engine_Kerning_OFF; -static varinfo_t flash_text_engine_Kerning_ON; static classinfo_t flash_text_CSMSettings; static varinfo_t flash_text_CSMSettings_fontSize; static varinfo_t flash_text_CSMSettings_outsideCutoff; static varinfo_t flash_text_CSMSettings_insideCutoff; +static varinfo_t flash_text_CSMSettings_fontSize; +static varinfo_t flash_text_CSMSettings_outsideCutoff; +static varinfo_t flash_text_CSMSettings_insideCutoff; static classinfo_t _RangeError; -static varinfo_t _RangeError_length; static classinfo_t _Number; -static varinfo_t _Number_MAX_VALUE; static methodinfo_t _Number_valueOf; -static varinfo_t _Number_length; -static varinfo_t _Number_MIN_VALUE; static methodinfo_t _Number_toString; -static varinfo_t _Number_NaN; -static varinfo_t _Number_POSITIVE_INFINITY; static methodinfo_t _Number_toExponential; static methodinfo_t _Number_toFixed; -static varinfo_t _Number_NEGATIVE_INFINITY; +static methodinfo_t _Number_toPrecision; +static methodinfo_t _Number_valueOf; +static methodinfo_t _Number_toString; +static methodinfo_t _Number_toExponential; +static methodinfo_t _Number_toFixed; static methodinfo_t _Number_toPrecision; static classinfo_t flash_display_Graphics; static methodinfo_t flash_display_Graphics_drawPath; @@ -1871,24 +2630,55 @@ static methodinfo_t flash_display_Graphics_beginShaderFill; static methodinfo_t flash_display_Graphics_drawTriangles; static methodinfo_t flash_display_Graphics_drawRect; +static methodinfo_t flash_display_Graphics_drawPath; +static methodinfo_t flash_display_Graphics_drawEllipse; +static methodinfo_t flash_display_Graphics_drawRoundRectComplex; +static methodinfo_t flash_display_Graphics_moveTo; +static methodinfo_t flash_display_Graphics_lineShaderStyle; +static methodinfo_t flash_display_Graphics_beginFill; +static methodinfo_t flash_display_Graphics_beginGradientFill; +static methodinfo_t flash_display_Graphics_drawGraphicsData; +static methodinfo_t flash_display_Graphics_lineGradientStyle; +static methodinfo_t flash_display_Graphics_drawRoundRect; +static methodinfo_t flash_display_Graphics_beginBitmapFill; +static methodinfo_t flash_display_Graphics_lineStyle; +static methodinfo_t flash_display_Graphics_lineTo; +static methodinfo_t flash_display_Graphics_endFill; +static methodinfo_t flash_display_Graphics_copyFrom; +static methodinfo_t flash_display_Graphics_lineBitmapStyle; +static methodinfo_t flash_display_Graphics_curveTo; +static methodinfo_t flash_display_Graphics_clear; +static methodinfo_t flash_display_Graphics_drawCircle; +static methodinfo_t flash_display_Graphics_beginShaderFill; +static methodinfo_t flash_display_Graphics_drawTriangles; +static methodinfo_t flash_display_Graphics_drawRect; static classinfo_t _SyntaxError; -static varinfo_t _SyntaxError_length; static classinfo_t flash_sampler_NewObjectSample; static varinfo_t flash_sampler_NewObjectSample_type; static varinfo_t flash_sampler_NewObjectSample_object; static varinfo_t flash_sampler_NewObjectSample_id; +static varinfo_t flash_sampler_NewObjectSample_type; +static varinfo_t flash_sampler_NewObjectSample_object; +static varinfo_t flash_sampler_NewObjectSample_id; static classinfo_t flash_net_FileFilter; static varinfo_t flash_net_FileFilter_extension; static varinfo_t flash_net_FileFilter_description; static varinfo_t flash_net_FileFilter_macType; +static varinfo_t flash_net_FileFilter_extension; +static varinfo_t flash_net_FileFilter_description; +static varinfo_t flash_net_FileFilter_macType; static classinfo_t flash_display_BitmapDataChannel; -static varinfo_t flash_display_BitmapDataChannel_BLUE; -static varinfo_t flash_display_BitmapDataChannel_GREEN; -static varinfo_t flash_display_BitmapDataChannel_ALPHA; -static varinfo_t flash_display_BitmapDataChannel_RED; static methodinfo_t flash_utils_clearInterval; static classinfo_t flash_text_engine_ContentElement; -static varinfo_t flash_text_engine_ContentElement_GRAPHIC_ELEMENT; +static varinfo_t flash_text_engine_ContentElement_eventMirror; +static varinfo_t flash_text_engine_ContentElement_groupElement; +static varinfo_t flash_text_engine_ContentElement_textRotation; +static varinfo_t flash_text_engine_ContentElement_text; +static varinfo_t flash_text_engine_ContentElement_userData; +static varinfo_t flash_text_engine_ContentElement_elementFormat; +static varinfo_t flash_text_engine_ContentElement_textBlock; +static varinfo_t flash_text_engine_ContentElement_rawText; +static varinfo_t flash_text_engine_ContentElement_textBlockBeginIndex; static varinfo_t flash_text_engine_ContentElement_eventMirror; static varinfo_t flash_text_engine_ContentElement_groupElement; static varinfo_t flash_text_engine_ContentElement_textRotation; @@ -1899,16 +2689,16 @@ static varinfo_t flash_text_engine_ContentElement_rawText; static varinfo_t flash_text_engine_ContentElement_textBlockBeginIndex; static classinfo_t flash_utils_Endian; -static varinfo_t flash_utils_Endian_LITTLE_ENDIAN; -static varinfo_t flash_utils_Endian_BIG_ENDIAN; static methodinfo_t flash_net_navigateToURL; static classinfo_t flash_events_ProgressEvent; static varinfo_t flash_events_ProgressEvent_bytesLoaded; static methodinfo_t flash_events_ProgressEvent_toString; -static varinfo_t flash_events_ProgressEvent_PROGRESS; static varinfo_t flash_events_ProgressEvent_bytesTotal; static methodinfo_t flash_events_ProgressEvent_clone; -static varinfo_t flash_events_ProgressEvent_SOCKET_DATA; +static varinfo_t flash_events_ProgressEvent_bytesLoaded; +static methodinfo_t flash_events_ProgressEvent_toString; +static varinfo_t flash_events_ProgressEvent_bytesTotal; +static methodinfo_t flash_events_ProgressEvent_clone; static classinfo_t flash_media_Sound; static methodinfo_t flash_media_Sound_extract; static varinfo_t flash_media_Sound_bytesLoaded; @@ -1920,6 +2710,16 @@ static varinfo_t flash_media_Sound_bytesTotal; static varinfo_t flash_media_Sound_length; static methodinfo_t flash_media_Sound_close; +static methodinfo_t flash_media_Sound_extract; +static varinfo_t flash_media_Sound_bytesLoaded; +static varinfo_t flash_media_Sound_id3; +static methodinfo_t flash_media_Sound_play; +static varinfo_t flash_media_Sound_url; +static varinfo_t flash_media_Sound_isBuffering; +static methodinfo_t flash_media_Sound_load; +static varinfo_t flash_media_Sound_bytesTotal; +static varinfo_t flash_media_Sound_length; +static methodinfo_t flash_media_Sound_close; static classinfo_t flash_text_TextExtent; static varinfo_t flash_text_TextExtent_descent; static varinfo_t flash_text_TextExtent_width; @@ -1927,11 +2727,13 @@ static varinfo_t flash_text_TextExtent_textFieldHeight; static varinfo_t flash_text_TextExtent_textFieldWidth; static varinfo_t flash_text_TextExtent_height; +static varinfo_t flash_text_TextExtent_descent; +static varinfo_t flash_text_TextExtent_width; +static varinfo_t flash_text_TextExtent_ascent; +static varinfo_t flash_text_TextExtent_textFieldHeight; +static varinfo_t flash_text_TextExtent_textFieldWidth; +static varinfo_t flash_text_TextExtent_height; static classinfo_t flash_text_FontStyle; -static varinfo_t flash_text_FontStyle_REGULAR; -static varinfo_t flash_text_FontStyle_BOLD; -static varinfo_t flash_text_FontStyle_BOLD_ITALIC; -static varinfo_t flash_text_FontStyle_ITALIC; static classinfo_t flash_text_engine_TextLineMirrorRegion; static varinfo_t flash_text_engine_TextLineMirrorRegion_mirror; static varinfo_t flash_text_engine_TextLineMirrorRegion_previousRegion; @@ -1939,17 +2741,20 @@ static varinfo_t flash_text_engine_TextLineMirrorRegion_nextRegion; static varinfo_t flash_text_engine_TextLineMirrorRegion_element; static varinfo_t flash_text_engine_TextLineMirrorRegion_textLine; +static varinfo_t flash_text_engine_TextLineMirrorRegion_mirror; +static varinfo_t flash_text_engine_TextLineMirrorRegion_previousRegion; +static varinfo_t flash_text_engine_TextLineMirrorRegion_bounds; +static varinfo_t flash_text_engine_TextLineMirrorRegion_nextRegion; +static varinfo_t flash_text_engine_TextLineMirrorRegion_element; +static varinfo_t flash_text_engine_TextLineMirrorRegion_textLine; static classinfo_t flash_geom_Vector3D; static methodinfo_t flash_geom_Vector3D_subtract; -static methodinfo_t flash_geom_Vector3D_distance; static methodinfo_t flash_geom_Vector3D_scaleBy; static methodinfo_t flash_geom_Vector3D_decrementBy; static methodinfo_t flash_geom_Vector3D_equals; static methodinfo_t flash_geom_Vector3D_normalize; static methodinfo_t flash_geom_Vector3D_dotProduct; static methodinfo_t flash_geom_Vector3D_negate; -static varinfo_t flash_geom_Vector3D_X_AXIS; -static methodinfo_t flash_geom_Vector3D_angleBetween; static methodinfo_t flash_geom_Vector3D_toString; static varinfo_t flash_geom_Vector3D_lengthSquared; static varinfo_t flash_geom_Vector3D_x; @@ -1957,34 +2762,40 @@ static varinfo_t flash_geom_Vector3D_w; static varinfo_t flash_geom_Vector3D_z; static methodinfo_t flash_geom_Vector3D_add; -static varinfo_t flash_geom_Vector3D_Z_AXIS; static methodinfo_t flash_geom_Vector3D_project; static methodinfo_t flash_geom_Vector3D_crossProduct; static methodinfo_t flash_geom_Vector3D_nearEquals; static methodinfo_t flash_geom_Vector3D_clone; -static varinfo_t flash_geom_Vector3D_Y_AXIS; +static varinfo_t flash_geom_Vector3D_y; +static varinfo_t flash_geom_Vector3D_length; +static methodinfo_t flash_geom_Vector3D_subtract; +static methodinfo_t flash_geom_Vector3D_scaleBy; +static methodinfo_t flash_geom_Vector3D_decrementBy; +static methodinfo_t flash_geom_Vector3D_equals; +static methodinfo_t flash_geom_Vector3D_normalize; +static methodinfo_t flash_geom_Vector3D_dotProduct; +static methodinfo_t flash_geom_Vector3D_negate; +static methodinfo_t flash_geom_Vector3D_toString; +static varinfo_t flash_geom_Vector3D_lengthSquared; +static varinfo_t flash_geom_Vector3D_x; +static methodinfo_t flash_geom_Vector3D_incrementBy; +static varinfo_t flash_geom_Vector3D_w; +static varinfo_t flash_geom_Vector3D_z; +static methodinfo_t flash_geom_Vector3D_add; +static methodinfo_t flash_geom_Vector3D_project; +static methodinfo_t flash_geom_Vector3D_crossProduct; +static methodinfo_t flash_geom_Vector3D_nearEquals; +static methodinfo_t flash_geom_Vector3D_clone; static varinfo_t flash_geom_Vector3D_y; static varinfo_t flash_geom_Vector3D_length; static classinfo_t flash_desktop_ClipboardTransferMode; -static varinfo_t flash_desktop_ClipboardTransferMode_CLONE_ONLY; -static varinfo_t flash_desktop_ClipboardTransferMode_ORIGINAL_PREFERRED; -static varinfo_t flash_desktop_ClipboardTransferMode_CLONE_PREFERRED; -static varinfo_t flash_desktop_ClipboardTransferMode_ORIGINAL_ONLY; static classinfo_t flash_display_SpreadMethod; -static varinfo_t flash_display_SpreadMethod_REFLECT; -static varinfo_t flash_display_SpreadMethod_REPEAT; -static varinfo_t flash_display_SpreadMethod_PAD; static classinfo_t flash_system_SecurityPanel; -static varinfo_t flash_system_SecurityPanel_LOCAL_STORAGE; -static varinfo_t flash_system_SecurityPanel_CAMERA; -static varinfo_t flash_system_SecurityPanel_DEFAULT; -static varinfo_t flash_system_SecurityPanel_SETTINGS_MANAGER; -static varinfo_t flash_system_SecurityPanel_PRIVACY; -static varinfo_t flash_system_SecurityPanel_MICROPHONE; -static varinfo_t flash_system_SecurityPanel_DISPLAY; static classinfo_t flash_events_HTTPStatusEvent; static methodinfo_t flash_events_HTTPStatusEvent_toString; -static varinfo_t flash_events_HTTPStatusEvent_HTTP_STATUS; +static methodinfo_t flash_events_HTTPStatusEvent_clone; +static varinfo_t flash_events_HTTPStatusEvent_status; +static methodinfo_t flash_events_HTTPStatusEvent_toString; static methodinfo_t flash_events_HTTPStatusEvent_clone; static varinfo_t flash_events_HTTPStatusEvent_status; static classinfo_t flash_net_NetStreamPlayOptions; @@ -1993,6 +2804,11 @@ static varinfo_t flash_net_NetStreamPlayOptions_start; static varinfo_t flash_net_NetStreamPlayOptions_oldStreamName; static varinfo_t flash_net_NetStreamPlayOptions_transition; +static varinfo_t flash_net_NetStreamPlayOptions_len; +static varinfo_t flash_net_NetStreamPlayOptions_streamName; +static varinfo_t flash_net_NetStreamPlayOptions_start; +static varinfo_t flash_net_NetStreamPlayOptions_oldStreamName; +static varinfo_t flash_net_NetStreamPlayOptions_transition; static classinfo_t flash_net_Responder; static classinfo_t flash_net_XMLSocket; static methodinfo_t flash_net_XMLSocket_close; @@ -2000,6 +2816,11 @@ static methodinfo_t flash_net_XMLSocket_send; static varinfo_t flash_net_XMLSocket_connected; static varinfo_t flash_net_XMLSocket_timeout; +static methodinfo_t flash_net_XMLSocket_close; +static methodinfo_t flash_net_XMLSocket_connect; +static methodinfo_t flash_net_XMLSocket_send; +static varinfo_t flash_net_XMLSocket_connected; +static varinfo_t flash_net_XMLSocket_timeout; static classinfo_t flash_filters_ConvolutionFilter; static varinfo_t flash_filters_ConvolutionFilter_alpha; static varinfo_t flash_filters_ConvolutionFilter_matrixX; @@ -2011,6 +2832,16 @@ static methodinfo_t flash_filters_ConvolutionFilter_clone; static varinfo_t flash_filters_ConvolutionFilter_clamp; static varinfo_t flash_filters_ConvolutionFilter_matrixY; +static varinfo_t flash_filters_ConvolutionFilter_alpha; +static varinfo_t flash_filters_ConvolutionFilter_matrixX; +static varinfo_t flash_filters_ConvolutionFilter_matrix; +static varinfo_t flash_filters_ConvolutionFilter_bias; +static varinfo_t flash_filters_ConvolutionFilter_color; +static varinfo_t flash_filters_ConvolutionFilter_preserveAlpha; +static varinfo_t flash_filters_ConvolutionFilter_divisor; +static methodinfo_t flash_filters_ConvolutionFilter_clone; +static varinfo_t flash_filters_ConvolutionFilter_clamp; +static varinfo_t flash_filters_ConvolutionFilter_matrixY; static classinfo_t flash_text_engine_ElementFormat; static methodinfo_t flash_text_engine_ElementFormat_getFontMetrics; static varinfo_t flash_text_engine_ElementFormat_digitCase; @@ -2032,6 +2863,26 @@ static varinfo_t flash_text_engine_ElementFormat_alpha; static varinfo_t flash_text_engine_ElementFormat_textRotation; static varinfo_t flash_text_engine_ElementFormat_trackingRight; +static methodinfo_t flash_text_engine_ElementFormat_getFontMetrics; +static varinfo_t flash_text_engine_ElementFormat_digitCase; +static varinfo_t flash_text_engine_ElementFormat_breakOpportunity; +static varinfo_t flash_text_engine_ElementFormat_ligatureLevel; +static varinfo_t flash_text_engine_ElementFormat_dominantBaseline; +static varinfo_t flash_text_engine_ElementFormat_alignmentBaseline; +static varinfo_t flash_text_engine_ElementFormat_color; +static varinfo_t flash_text_engine_ElementFormat_digitWidth; +static varinfo_t flash_text_engine_ElementFormat_kerning; +static varinfo_t flash_text_engine_ElementFormat_fontSize; +static varinfo_t flash_text_engine_ElementFormat_fontDescription; +static varinfo_t flash_text_engine_ElementFormat_baselineShift; +static varinfo_t flash_text_engine_ElementFormat_locale; +static varinfo_t flash_text_engine_ElementFormat_typographicCase; +static varinfo_t flash_text_engine_ElementFormat_trackingLeft; +static varinfo_t flash_text_engine_ElementFormat_locked; +static methodinfo_t flash_text_engine_ElementFormat_clone; +static varinfo_t flash_text_engine_ElementFormat_alpha; +static varinfo_t flash_text_engine_ElementFormat_textRotation; +static varinfo_t flash_text_engine_ElementFormat_trackingRight; static classinfo_t flash_display_GraphicsGradientFill; static varinfo_t flash_display_GraphicsGradientFill_interpolationMethod; static varinfo_t flash_display_GraphicsGradientFill_focalPointRatio; @@ -2041,9 +2892,19 @@ static varinfo_t flash_display_GraphicsGradientFill_ratios; static varinfo_t flash_display_GraphicsGradientFill_spreadMethod; static varinfo_t flash_display_GraphicsGradientFill_alphas; +static varinfo_t flash_display_GraphicsGradientFill_interpolationMethod; +static varinfo_t flash_display_GraphicsGradientFill_focalPointRatio; +static varinfo_t flash_display_GraphicsGradientFill_colors; +static varinfo_t flash_display_GraphicsGradientFill_matrix; +static varinfo_t flash_display_GraphicsGradientFill_type; +static varinfo_t flash_display_GraphicsGradientFill_ratios; +static varinfo_t flash_display_GraphicsGradientFill_spreadMethod; +static varinfo_t flash_display_GraphicsGradientFill_alphas; static classinfo_t flash_display_FrameLabel; static varinfo_t flash_display_FrameLabel_frame; static varinfo_t flash_display_FrameLabel_name; +static varinfo_t flash_display_FrameLabel_frame; +static varinfo_t flash_display_FrameLabel_name; static classinfo_t flash_media_SoundTransform; static varinfo_t flash_media_SoundTransform_pan; static varinfo_t flash_media_SoundTransform_leftToRight; @@ -2051,6 +2912,12 @@ static varinfo_t flash_media_SoundTransform_volume; static varinfo_t flash_media_SoundTransform_leftToLeft; static varinfo_t flash_media_SoundTransform_rightToRight; +static varinfo_t flash_media_SoundTransform_pan; +static varinfo_t flash_media_SoundTransform_leftToRight; +static varinfo_t flash_media_SoundTransform_rightToLeft; +static varinfo_t flash_media_SoundTransform_volume; +static varinfo_t flash_media_SoundTransform_leftToLeft; +static varinfo_t flash_media_SoundTransform_rightToRight; static varinfo_t _AS3; static classinfo_t flash_net_LocalConnection; static varinfo_t flash_net_LocalConnection_client; @@ -2060,57 +2927,41 @@ static methodinfo_t flash_net_LocalConnection_allowInsecureDomain; static methodinfo_t flash_net_LocalConnection_send; static methodinfo_t flash_net_LocalConnection_close; +static varinfo_t flash_net_LocalConnection_client; +static methodinfo_t flash_net_LocalConnection_allowDomain; +static methodinfo_t flash_net_LocalConnection_connect; +static varinfo_t flash_net_LocalConnection_domain; +static methodinfo_t flash_net_LocalConnection_allowInsecureDomain; +static methodinfo_t flash_net_LocalConnection_send; +static methodinfo_t flash_net_LocalConnection_close; static classinfo_t flash_display_ShaderParameterType; -static varinfo_t flash_display_ShaderParameterType_FLOAT; -static varinfo_t flash_display_ShaderParameterType_BOOL; -static varinfo_t flash_display_ShaderParameterType_FLOAT2; -static varinfo_t flash_display_ShaderParameterType_MATRIX2X2; -static varinfo_t flash_display_ShaderParameterType_INT; -static varinfo_t flash_display_ShaderParameterType_INT4; -static varinfo_t flash_display_ShaderParameterType_MATRIX4X4; -static varinfo_t flash_display_ShaderParameterType_FLOAT3; -static varinfo_t flash_display_ShaderParameterType_BOOL2; -static varinfo_t flash_display_ShaderParameterType_INT3; -static varinfo_t flash_display_ShaderParameterType_BOOL3; -static varinfo_t flash_display_ShaderParameterType_BOOL4; -static varinfo_t flash_display_ShaderParameterType_FLOAT4; -static varinfo_t flash_display_ShaderParameterType_INT2; -static varinfo_t flash_display_ShaderParameterType_MATRIX3X3; static classinfo_t flash_events_IMEEvent; static methodinfo_t flash_events_IMEEvent_toString; static methodinfo_t flash_events_IMEEvent_clone; -static varinfo_t flash_events_IMEEvent_IME_COMPOSITION; +static methodinfo_t flash_events_IMEEvent_toString; +static methodinfo_t flash_events_IMEEvent_clone; static classinfo_t flash_text_TextFormatDisplay; -static varinfo_t flash_text_TextFormatDisplay_INLINE; -static varinfo_t flash_text_TextFormatDisplay_BLOCK; static methodinfo_t flash_profiler_profile; static classinfo_t flash_display_AVM1Movie; static methodinfo_t flash_display_AVM1Movie_call; static methodinfo_t flash_display_AVM1Movie_addCallback; +static methodinfo_t flash_display_AVM1Movie_call; +static methodinfo_t flash_display_AVM1Movie_addCallback; static classinfo_t flash_events_ContextMenuEvent; -static varinfo_t flash_events_ContextMenuEvent_isMouseTargetInaccessible; static varinfo_t flash_events_ContextMenuEvent_mouseTarget; +static varinfo_t flash_events_ContextMenuEvent_isMouseTargetInaccessible; +static methodinfo_t flash_events_ContextMenuEvent_toString; static varinfo_t flash_events_ContextMenuEvent_contextMenuOwner; -static varinfo_t flash_events_ContextMenuEvent_MENU_ITEM_SELECT; -static varinfo_t flash_events_ContextMenuEvent_MENU_SELECT; +static methodinfo_t flash_events_ContextMenuEvent_clone; +static varinfo_t flash_events_ContextMenuEvent_mouseTarget; +static varinfo_t flash_events_ContextMenuEvent_isMouseTargetInaccessible; static methodinfo_t flash_events_ContextMenuEvent_toString; +static varinfo_t flash_events_ContextMenuEvent_contextMenuOwner; static methodinfo_t flash_events_ContextMenuEvent_clone; static classinfo_t flash_events_EventPhase; -static varinfo_t flash_events_EventPhase_BUBBLING_PHASE; -static varinfo_t flash_events_EventPhase_CAPTURING_PHASE; -static varinfo_t flash_events_EventPhase_AT_TARGET; static classinfo_t flash_display_JointStyle; -static varinfo_t flash_display_JointStyle_ROUND; -static varinfo_t flash_display_JointStyle_MITER; -static varinfo_t flash_display_JointStyle_BEVEL; static classinfo_t flash_utils_Dictionary; static classinfo_t flash_display_GraphicsPathCommand; -static varinfo_t flash_display_GraphicsPathCommand_NO_OP; -static varinfo_t flash_display_GraphicsPathCommand_MOVE_TO; -static varinfo_t flash_display_GraphicsPathCommand_WIDE_MOVE_TO; -static varinfo_t flash_display_GraphicsPathCommand_CURVE_TO; -static varinfo_t flash_display_GraphicsPathCommand_LINE_TO; -static varinfo_t flash_display_GraphicsPathCommand_WIDE_LINE_TO; static classinfo_t flash_filters_BevelFilter; static varinfo_t flash_filters_BevelFilter_type; static varinfo_t flash_filters_BevelFilter_highlightColor; @@ -2125,6 +2976,19 @@ static varinfo_t flash_filters_BevelFilter_shadowAlpha; static varinfo_t flash_filters_BevelFilter_quality; static methodinfo_t flash_filters_BevelFilter_clone; +static varinfo_t flash_filters_BevelFilter_type; +static varinfo_t flash_filters_BevelFilter_highlightColor; +static varinfo_t flash_filters_BevelFilter_knockout; +static varinfo_t flash_filters_BevelFilter_distance; +static varinfo_t flash_filters_BevelFilter_strength; +static varinfo_t flash_filters_BevelFilter_highlightAlpha; +static varinfo_t flash_filters_BevelFilter_blurY; +static varinfo_t flash_filters_BevelFilter_shadowColor; +static varinfo_t flash_filters_BevelFilter_angle; +static varinfo_t flash_filters_BevelFilter_blurX; +static varinfo_t flash_filters_BevelFilter_shadowAlpha; +static varinfo_t flash_filters_BevelFilter_quality; +static methodinfo_t flash_filters_BevelFilter_clone; static methodinfo_t flash_utils_getTimer; static classinfo_t flash_display_Loader; static varinfo_t flash_display_Loader_content; @@ -2139,11 +3003,27 @@ static methodinfo_t flash_display_Loader_addChild; static methodinfo_t flash_display_Loader_close; static methodinfo_t flash_display_Loader_setChildIndex; +static varinfo_t flash_display_Loader_content; +static methodinfo_t flash_display_Loader_unloadAndStop; +static methodinfo_t flash_display_Loader_unload; +static methodinfo_t flash_display_Loader_removeChildAt; +static methodinfo_t flash_display_Loader_addChildAt; +static varinfo_t flash_display_Loader_contentLoaderInfo; +static methodinfo_t flash_display_Loader_loadBytes; +static methodinfo_t flash_display_Loader_removeChild; +static methodinfo_t flash_display_Loader_load; +static methodinfo_t flash_display_Loader_addChild; +static methodinfo_t flash_display_Loader_close; +static methodinfo_t flash_display_Loader_setChildIndex; static classinfo_t flash_display_GraphicsBitmapFill; static varinfo_t flash_display_GraphicsBitmapFill_smooth; static varinfo_t flash_display_GraphicsBitmapFill_repeat; static varinfo_t flash_display_GraphicsBitmapFill_bitmapData; static varinfo_t flash_display_GraphicsBitmapFill_matrix; +static varinfo_t flash_display_GraphicsBitmapFill_smooth; +static varinfo_t flash_display_GraphicsBitmapFill_repeat; +static varinfo_t flash_display_GraphicsBitmapFill_bitmapData; +static varinfo_t flash_display_GraphicsBitmapFill_matrix; static varinfo_t _undefined; static classinfo_t flash_display_SimpleButton; static varinfo_t flash_display_SimpleButton_overState; @@ -2154,91 +3034,75 @@ static varinfo_t flash_display_SimpleButton_useHandCursor; static varinfo_t flash_display_SimpleButton_upState; static varinfo_t flash_display_SimpleButton_hitTestState; +static varinfo_t flash_display_SimpleButton_overState; +static varinfo_t flash_display_SimpleButton_downState; +static varinfo_t flash_display_SimpleButton_enabled; +static varinfo_t flash_display_SimpleButton_trackAsMenu; +static varinfo_t flash_display_SimpleButton_soundTransform; +static varinfo_t flash_display_SimpleButton_useHandCursor; +static varinfo_t flash_display_SimpleButton_upState; +static varinfo_t flash_display_SimpleButton_hitTestState; static classinfo_t flash_text_engine_TabAlignment; -static varinfo_t flash_text_engine_TabAlignment_END; -static varinfo_t flash_text_engine_TabAlignment_CENTER; -static varinfo_t flash_text_engine_TabAlignment_START; -static varinfo_t flash_text_engine_TabAlignment_DECIMAL; static classinfo_t flash_text_engine_FontWeight; -static varinfo_t flash_text_engine_FontWeight_NORMAL; -static varinfo_t flash_text_engine_FontWeight_BOLD; static methodinfo_t flash_utils_describeType; static classinfo_t flash_display_PixelSnapping; -static varinfo_t flash_display_PixelSnapping_AUTO; -static varinfo_t flash_display_PixelSnapping_NEVER; -static varinfo_t flash_display_PixelSnapping_ALWAYS; static classinfo_t flash_events_FocusEvent; -static varinfo_t flash_events_FocusEvent_FOCUS_OUT; -static varinfo_t flash_events_FocusEvent_KEY_FOCUS_CHANGE; -static varinfo_t flash_events_FocusEvent_shiftKey; -static varinfo_t flash_events_FocusEvent_isRelatedObjectInaccessible; static varinfo_t flash_events_FocusEvent_keyCode; +static methodinfo_t flash_events_FocusEvent_toString; +static varinfo_t flash_events_FocusEvent_isRelatedObjectInaccessible; +static methodinfo_t flash_events_FocusEvent_clone; +static varinfo_t flash_events_FocusEvent_shiftKey; static varinfo_t flash_events_FocusEvent_relatedObject; -static varinfo_t flash_events_FocusEvent_FOCUS_IN; -static varinfo_t flash_events_FocusEvent_MOUSE_FOCUS_CHANGE; +static varinfo_t flash_events_FocusEvent_keyCode; static methodinfo_t flash_events_FocusEvent_toString; +static varinfo_t flash_events_FocusEvent_isRelatedObjectInaccessible; static methodinfo_t flash_events_FocusEvent_clone; +static varinfo_t flash_events_FocusEvent_shiftKey; +static varinfo_t flash_events_FocusEvent_relatedObject; static classinfo_t flash_errors_MemoryError; static classinfo_t flash_events_NetFilterEvent; static varinfo_t flash_events_NetFilterEvent_header; static methodinfo_t flash_events_NetFilterEvent_toString; static methodinfo_t flash_events_NetFilterEvent_clone; static varinfo_t flash_events_NetFilterEvent_data; +static varinfo_t flash_events_NetFilterEvent_header; +static methodinfo_t flash_events_NetFilterEvent_toString; +static methodinfo_t flash_events_NetFilterEvent_clone; +static varinfo_t flash_events_NetFilterEvent_data; static methodinfo_t _decodeURI; static methodinfo_t _encodeURI; static classinfo_t flash_text_engine_TextBaseline; -static varinfo_t flash_text_engine_TextBaseline_ROMAN; -static varinfo_t flash_text_engine_TextBaseline_DESCENT; -static varinfo_t flash_text_engine_TextBaseline_IDEOGRAPHIC_CENTER; -static varinfo_t flash_text_engine_TextBaseline_USE_DOMINANT_BASELINE; -static varinfo_t flash_text_engine_TextBaseline_IDEOGRAPHIC_BOTTOM; -static varinfo_t flash_text_engine_TextBaseline_ASCENT; -static varinfo_t flash_text_engine_TextBaseline_IDEOGRAPHIC_TOP; static classinfo_t flash_external_ExternalInterface; -static methodinfo_t flash_external_ExternalInterface_call; -static varinfo_t flash_external_ExternalInterface_available; -static methodinfo_t flash_external_ExternalInterface_addCallback; -static varinfo_t flash_external_ExternalInterface_marshallExceptions; -static varinfo_t flash_external_ExternalInterface_objectID; static classinfo_t _EvalError; -static varinfo_t _EvalError_length; static classinfo_t flash_text_engine_DigitCase; -static varinfo_t flash_text_engine_DigitCase_OLD_STYLE; -static varinfo_t flash_text_engine_DigitCase_DEFAULT; -static varinfo_t flash_text_engine_DigitCase_LINING; static classinfo_t flash_text_TextFormatAlign; -static varinfo_t flash_text_TextFormatAlign_LEFT; -static varinfo_t flash_text_TextFormatAlign_RIGHT; -static varinfo_t flash_text_TextFormatAlign_CENTER; -static varinfo_t flash_text_TextFormatAlign_JUSTIFY; static classinfo_t flash_errors_ScriptTimeoutError; static classinfo_t _uint; -static varinfo_t _uint_MAX_VALUE; static methodinfo_t _uint_valueOf; -static varinfo_t _uint_length; -static varinfo_t _uint_MIN_VALUE; +static methodinfo_t _uint_toString; +static methodinfo_t _uint_toExponential; +static methodinfo_t _uint_toFixed; +static methodinfo_t _uint_toPrecision; +static methodinfo_t _uint_valueOf; static methodinfo_t _uint_toString; static methodinfo_t _uint_toExponential; static methodinfo_t _uint_toFixed; static methodinfo_t _uint_toPrecision; static methodinfo_t flash_debugger_enterDebugger; static classinfo_t flash_geom_Orientation3D; -static varinfo_t flash_geom_Orientation3D_QUATERNION; -static varinfo_t flash_geom_Orientation3D_EULER_ANGLES; -static varinfo_t flash_geom_Orientation3D_AXIS_ANGLE; static classinfo_t flash_text_engine_CFFHinting; -static varinfo_t flash_text_engine_CFFHinting_HORIZONTAL_STEM; -static varinfo_t flash_text_engine_CFFHinting_NONE; static classinfo_t flash_text_FontType; -static varinfo_t flash_text_FontType_EMBEDDED; -static varinfo_t flash_text_FontType_DEVICE; -static varinfo_t flash_text_FontType_EMBEDDED_CFF; static classinfo_t flash_filters_ShaderFilter; static varinfo_t flash_filters_ShaderFilter_bottomExtension; static varinfo_t flash_filters_ShaderFilter_shader; static varinfo_t flash_filters_ShaderFilter_rightExtension; static varinfo_t flash_filters_ShaderFilter_leftExtension; static varinfo_t flash_filters_ShaderFilter_topExtension; +static varinfo_t flash_filters_ShaderFilter_bottomExtension; +static varinfo_t flash_filters_ShaderFilter_shader; +static varinfo_t flash_filters_ShaderFilter_rightExtension; +static varinfo_t flash_filters_ShaderFilter_leftExtension; +static varinfo_t flash_filters_ShaderFilter_topExtension; static classinfo_t flash_display_GraphicsPath; static methodinfo_t flash_display_GraphicsPath_wideMoveTo; static varinfo_t flash_display_GraphicsPath_winding; @@ -2248,89 +3112,81 @@ static methodinfo_t flash_display_GraphicsPath_curveTo; static methodinfo_t flash_display_GraphicsPath_lineTo; static varinfo_t flash_display_GraphicsPath_data; +static methodinfo_t flash_display_GraphicsPath_wideMoveTo; +static varinfo_t flash_display_GraphicsPath_winding; +static methodinfo_t flash_display_GraphicsPath_moveTo; +static methodinfo_t flash_display_GraphicsPath_wideLineTo; +static varinfo_t flash_display_GraphicsPath_commands; +static methodinfo_t flash_display_GraphicsPath_curveTo; +static methodinfo_t flash_display_GraphicsPath_lineTo; +static varinfo_t flash_display_GraphicsPath_data; static classinfo_t flash_system_ApplicationDomain; static methodinfo_t flash_system_ApplicationDomain_hasDefinition; static methodinfo_t flash_system_ApplicationDomain_getDefinition; -static varinfo_t flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH; static varinfo_t flash_system_ApplicationDomain_parentDomain; static varinfo_t flash_system_ApplicationDomain_domainMemory; -static varinfo_t flash_system_ApplicationDomain_currentDomain; +static methodinfo_t flash_system_ApplicationDomain_hasDefinition; +static methodinfo_t flash_system_ApplicationDomain_getDefinition; +static varinfo_t flash_system_ApplicationDomain_parentDomain; +static varinfo_t flash_system_ApplicationDomain_domainMemory; static classinfo_t flash_events_KeyboardEvent; +static varinfo_t flash_events_KeyboardEvent_shiftKey; +static varinfo_t flash_events_KeyboardEvent_keyCode; +static varinfo_t flash_events_KeyboardEvent_keyLocation; static methodinfo_t flash_events_KeyboardEvent_updateAfterEvent; -static varinfo_t flash_events_KeyboardEvent_charCode; -static varinfo_t flash_events_KeyboardEvent_KEY_UP; -static varinfo_t flash_events_KeyboardEvent_KEY_DOWN; static methodinfo_t flash_events_KeyboardEvent_toString; -static varinfo_t flash_events_KeyboardEvent_keyLocation; -static varinfo_t flash_events_KeyboardEvent_shiftKey; -static methodinfo_t flash_events_KeyboardEvent_clone; -static varinfo_t flash_events_KeyboardEvent_ctrlKey; static varinfo_t flash_events_KeyboardEvent_altKey; +static varinfo_t flash_events_KeyboardEvent_ctrlKey; +static methodinfo_t flash_events_KeyboardEvent_clone; +static varinfo_t flash_events_KeyboardEvent_charCode; +static varinfo_t flash_events_KeyboardEvent_shiftKey; static varinfo_t flash_events_KeyboardEvent_keyCode; +static varinfo_t flash_events_KeyboardEvent_keyLocation; +static methodinfo_t flash_events_KeyboardEvent_updateAfterEvent; +static methodinfo_t flash_events_KeyboardEvent_toString; +static varinfo_t flash_events_KeyboardEvent_altKey; +static varinfo_t flash_events_KeyboardEvent_ctrlKey; +static methodinfo_t flash_events_KeyboardEvent_clone; +static varinfo_t flash_events_KeyboardEvent_charCode; static classinfo_t adobe_utils_ProductManager; static varinfo_t adobe_utils_ProductManager_running; static methodinfo_t adobe_utils_ProductManager_download; static varinfo_t adobe_utils_ProductManager_installedVersion; static varinfo_t adobe_utils_ProductManager_installed; static methodinfo_t adobe_utils_ProductManager_launch; +static varinfo_t adobe_utils_ProductManager_running; +static methodinfo_t adobe_utils_ProductManager_download; +static varinfo_t adobe_utils_ProductManager_installedVersion; +static varinfo_t adobe_utils_ProductManager_installed; +static methodinfo_t adobe_utils_ProductManager_launch; static classinfo_t flash_events_Event; -static varinfo_t flash_events_Event_CLEAR; -static methodinfo_t flash_events_Event_toString; +static varinfo_t flash_events_Event_type; static varinfo_t flash_events_Event_cancelable; -static varinfo_t flash_events_Event_CANCEL; -static methodinfo_t flash_events_Event_clone; -static varinfo_t flash_events_Event_CONNECT; -static varinfo_t flash_events_Event_REMOVED_FROM_STAGE; -static varinfo_t flash_events_Event_FRAME_CONSTRUCTED; -static varinfo_t flash_events_Event_TAB_INDEX_CHANGE; +static methodinfo_t flash_events_Event_isDefaultPrevented; +static varinfo_t flash_events_Event_target; +static varinfo_t flash_events_Event_eventPhase; static varinfo_t flash_events_Event_currentTarget; -static varinfo_t flash_events_Event_ADDED; -static varinfo_t flash_events_Event_OPEN; -static varinfo_t flash_events_Event_TAB_CHILDREN_CHANGE; -static varinfo_t flash_events_Event_COMPLETE; -static varinfo_t flash_events_Event_ACTIVATE; -static varinfo_t flash_events_Event_RENDER; -static varinfo_t flash_events_Event_EXIT_FRAME; -static varinfo_t flash_events_Event_type; -static varinfo_t flash_events_Event_DEACTIVATE; +static methodinfo_t flash_events_Event_toString; static methodinfo_t flash_events_Event_stopImmediatePropagation; -static varinfo_t flash_events_Event_SELECT_ALL; -static varinfo_t flash_events_Event_CUT; -static varinfo_t flash_events_Event_ENTER_FRAME; -static varinfo_t flash_events_Event_INIT; -static varinfo_t flash_events_Event_SOUND_COMPLETE; -static varinfo_t flash_events_Event_COPY; -static methodinfo_t flash_events_Event_isDefaultPrevented; -static varinfo_t flash_events_Event_PASTE; +static varinfo_t flash_events_Event_bubbles; static methodinfo_t flash_events_Event_stopPropagation; -static varinfo_t flash_events_Event_CLOSE; -static varinfo_t flash_events_Event_REMOVED; -static varinfo_t flash_events_Event_TAB_ENABLED_CHANGE; +static methodinfo_t flash_events_Event_clone; +static methodinfo_t flash_events_Event_preventDefault; +static methodinfo_t flash_events_Event_formatToString; +static varinfo_t flash_events_Event_type; +static varinfo_t flash_events_Event_cancelable; +static methodinfo_t flash_events_Event_isDefaultPrevented; +static varinfo_t flash_events_Event_target; static varinfo_t flash_events_Event_eventPhase; -static varinfo_t flash_events_Event_UNLOAD; +static varinfo_t flash_events_Event_currentTarget; +static methodinfo_t flash_events_Event_toString; +static methodinfo_t flash_events_Event_stopImmediatePropagation; static varinfo_t flash_events_Event_bubbles; -static methodinfo_t flash_events_Event_formatToString; -static varinfo_t flash_events_Event_FULLSCREEN; -static varinfo_t flash_events_Event_MOUSE_LEAVE; -static varinfo_t flash_events_Event_ID3; -static varinfo_t flash_events_Event_RESIZE; -static varinfo_t flash_events_Event_CHANGE; -static varinfo_t flash_events_Event_SELECT; -static varinfo_t flash_events_Event_SCROLL; -static varinfo_t flash_events_Event_ADDED_TO_STAGE; +static methodinfo_t flash_events_Event_stopPropagation; +static methodinfo_t flash_events_Event_clone; static methodinfo_t flash_events_Event_preventDefault; -static varinfo_t flash_events_Event_target; +static methodinfo_t flash_events_Event_formatToString; static classinfo_t flash_desktop_ClipboardFormats; -static varinfo_t flash_desktop_ClipboardFormats_TEXT_FORMAT; -static varinfo_t flash_desktop_ClipboardFormats_BITMAP_FORMAT; -static varinfo_t flash_desktop_ClipboardFormats_FLASH_PREFIX; -static varinfo_t flash_desktop_ClipboardFormats_HTML_FORMAT; -static varinfo_t flash_desktop_ClipboardFormats_REFERENCE_PREFIX; -static varinfo_t flash_desktop_ClipboardFormats_AIR_PREFIX; -static varinfo_t flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX; -static varinfo_t flash_desktop_ClipboardFormats_RICH_TEXT_FORMAT; -static varinfo_t flash_desktop_ClipboardFormats_URL_FORMAT; -static varinfo_t flash_desktop_ClipboardFormats_FILE_LIST_FORMAT; static classinfo_t flash_display_MovieClip; static methodinfo_t flash_display_MovieClip_prevScene; static methodinfo_t flash_display_MovieClip_gotoAndPlay; @@ -2351,6 +3207,25 @@ static varinfo_t flash_display_MovieClip_totalFrames; static varinfo_t flash_display_MovieClip_trackAsMenu; static methodinfo_t flash_display_MovieClip_stop; +static methodinfo_t flash_display_MovieClip_prevScene; +static methodinfo_t flash_display_MovieClip_gotoAndPlay; +static varinfo_t flash_display_MovieClip_currentLabels; +static methodinfo_t flash_display_MovieClip_nextFrame; +static varinfo_t flash_display_MovieClip_currentScene; +static varinfo_t flash_display_MovieClip_enabled; +static varinfo_t flash_display_MovieClip_currentFrameLabel; +static methodinfo_t flash_display_MovieClip_play; +static varinfo_t flash_display_MovieClip_framesLoaded; +static varinfo_t flash_display_MovieClip_scenes; +static methodinfo_t flash_display_MovieClip_addFrameScript; +static varinfo_t flash_display_MovieClip_currentLabel; +static methodinfo_t flash_display_MovieClip_prevFrame; +static methodinfo_t flash_display_MovieClip_gotoAndStop; +static varinfo_t flash_display_MovieClip_currentFrame; +static methodinfo_t flash_display_MovieClip_nextScene; +static varinfo_t flash_display_MovieClip_totalFrames; +static varinfo_t flash_display_MovieClip_trackAsMenu; +static methodinfo_t flash_display_MovieClip_stop; static classinfo_t flash_display_BitmapData; static methodinfo_t flash_display_BitmapData_getPixel32; static methodinfo_t flash_display_BitmapData_draw; @@ -2387,15 +3262,52 @@ static varinfo_t flash_display_BitmapData_rect; static methodinfo_t flash_display_BitmapData_applyFilter; static methodinfo_t flash_display_BitmapData_dispose; +static methodinfo_t flash_display_BitmapData_getPixel32; +static methodinfo_t flash_display_BitmapData_draw; +static methodinfo_t flash_display_BitmapData_setPixels; +static methodinfo_t flash_display_BitmapData_copyPixels; +static methodinfo_t flash_display_BitmapData_histogram; +static methodinfo_t flash_display_BitmapData_scroll; +static varinfo_t flash_display_BitmapData_transparent; +static methodinfo_t flash_display_BitmapData_noise; +static methodinfo_t flash_display_BitmapData_threshold; +static methodinfo_t flash_display_BitmapData_paletteMap; +static methodinfo_t flash_display_BitmapData_perlinNoise; +static methodinfo_t flash_display_BitmapData_hitTest; +static methodinfo_t flash_display_BitmapData_getPixel; +static methodinfo_t flash_display_BitmapData_unlock; +static varinfo_t flash_display_BitmapData_height; +static methodinfo_t flash_display_BitmapData_copyChannel; +static varinfo_t flash_display_BitmapData_width; +static methodinfo_t flash_display_BitmapData_clone; +static methodinfo_t flash_display_BitmapData_colorTransform; +static methodinfo_t flash_display_BitmapData_generateFilterRect; +static methodinfo_t flash_display_BitmapData_compare; +static methodinfo_t flash_display_BitmapData_fillRect; +static methodinfo_t flash_display_BitmapData_setVector; +static methodinfo_t flash_display_BitmapData_floodFill; +static methodinfo_t flash_display_BitmapData_pixelDissolve; +static methodinfo_t flash_display_BitmapData_setPixel; +static methodinfo_t flash_display_BitmapData_setPixel32; +static methodinfo_t flash_display_BitmapData_lock; +static methodinfo_t flash_display_BitmapData_getVector; +static methodinfo_t flash_display_BitmapData_getColorBoundsRect; +static methodinfo_t flash_display_BitmapData_getPixels; +static methodinfo_t flash_display_BitmapData_merge; +static varinfo_t flash_display_BitmapData_rect; +static methodinfo_t flash_display_BitmapData_applyFilter; +static methodinfo_t flash_display_BitmapData_dispose; static classinfo_t flash_text_engine_LigatureLevel; -static varinfo_t flash_text_engine_LigatureLevel_UNCOMMON; -static varinfo_t flash_text_engine_LigatureLevel_COMMON; -static varinfo_t flash_text_engine_LigatureLevel_EXOTIC; -static varinfo_t flash_text_engine_LigatureLevel_MINIMUM; -static varinfo_t flash_text_engine_LigatureLevel_NONE; static varinfo_t _Infinity; static classinfo_t flash_text_engine_FontDescription; -static methodinfo_t flash_text_engine_FontDescription_isFontCompatible; +static varinfo_t flash_text_engine_FontDescription_renderingMode; +static varinfo_t flash_text_engine_FontDescription_cffHinting; +static varinfo_t flash_text_engine_FontDescription_fontPosture; +static varinfo_t flash_text_engine_FontDescription_fontName; +static varinfo_t flash_text_engine_FontDescription_fontLookup; +static varinfo_t flash_text_engine_FontDescription_locked; +static varinfo_t flash_text_engine_FontDescription_fontWeight; +static methodinfo_t flash_text_engine_FontDescription_clone; static varinfo_t flash_text_engine_FontDescription_renderingMode; static varinfo_t flash_text_engine_FontDescription_cffHinting; static varinfo_t flash_text_engine_FontDescription_fontPosture; @@ -2406,17 +3318,8 @@ static methodinfo_t flash_text_engine_FontDescription_clone; static classinfo_t flash_text_engine_TextElement; static methodinfo_t flash_text_engine_TextElement_replaceText; +static methodinfo_t flash_text_engine_TextElement_replaceText; static classinfo_t flash_display_SWFVersion; -static varinfo_t flash_display_SWFVersion_FLASH4; -static varinfo_t flash_display_SWFVersion_FLASH7; -static varinfo_t flash_display_SWFVersion_FLASH8; -static varinfo_t flash_display_SWFVersion_FLASH3; -static varinfo_t flash_display_SWFVersion_FLASH6; -static varinfo_t flash_display_SWFVersion_FLASH9; -static varinfo_t flash_display_SWFVersion_FLASH2; -static varinfo_t flash_display_SWFVersion_FLASH5; -static varinfo_t flash_display_SWFVersion_FLASH10; -static varinfo_t flash_display_SWFVersion_FLASH1; static classinfo_t flash_net_URLLoader; static methodinfo_t flash_net_URLLoader_close; static varinfo_t flash_net_URLLoader_bytesLoaded; @@ -2424,6 +3327,12 @@ static varinfo_t flash_net_URLLoader_bytesTotal; static varinfo_t flash_net_URLLoader_dataFormat; static varinfo_t flash_net_URLLoader_data; +static methodinfo_t flash_net_URLLoader_close; +static varinfo_t flash_net_URLLoader_bytesLoaded; +static methodinfo_t flash_net_URLLoader_load; +static varinfo_t flash_net_URLLoader_bytesTotal; +static varinfo_t flash_net_URLLoader_dataFormat; +static varinfo_t flash_net_URLLoader_data; static classinfo_t flash_geom_Matrix; static varinfo_t flash_geom_Matrix_b; static methodinfo_t flash_geom_Matrix_deltaTransformPoint; @@ -2443,10 +3352,25 @@ static methodinfo_t flash_geom_Matrix_clone; static varinfo_t flash_geom_Matrix_tx; static methodinfo_t flash_geom_Matrix_createBox; +static varinfo_t flash_geom_Matrix_b; +static methodinfo_t flash_geom_Matrix_deltaTransformPoint; +static methodinfo_t flash_geom_Matrix_identity; +static varinfo_t flash_geom_Matrix_ty; +static methodinfo_t flash_geom_Matrix_translate; +static methodinfo_t flash_geom_Matrix_concat; +static varinfo_t flash_geom_Matrix_c; +static varinfo_t flash_geom_Matrix_a; +static methodinfo_t flash_geom_Matrix_scale; +static varinfo_t flash_geom_Matrix_d; +static methodinfo_t flash_geom_Matrix_transformPoint; +static methodinfo_t flash_geom_Matrix_rotate; +static methodinfo_t flash_geom_Matrix_createGradientBox; +static methodinfo_t flash_geom_Matrix_toString; +static methodinfo_t flash_geom_Matrix_invert; +static methodinfo_t flash_geom_Matrix_clone; +static varinfo_t flash_geom_Matrix_tx; +static methodinfo_t flash_geom_Matrix_createBox; static classinfo_t flash_accessibility_Accessibility; -static varinfo_t flash_accessibility_Accessibility_active; -static methodinfo_t flash_accessibility_Accessibility_updateProperties; -static methodinfo_t flash_accessibility_Accessibility_sendEvent; static methodinfo_t flash_net_sendToURL; static classinfo_t flash_filters_GlowFilter; static varinfo_t flash_filters_GlowFilter_blurY; @@ -2458,33 +3382,36 @@ static varinfo_t flash_filters_GlowFilter_knockout; static varinfo_t flash_filters_GlowFilter_alpha; static varinfo_t flash_filters_GlowFilter_blurX; +static varinfo_t flash_filters_GlowFilter_blurY; +static varinfo_t flash_filters_GlowFilter_strength; +static varinfo_t flash_filters_GlowFilter_inner; +static varinfo_t flash_filters_GlowFilter_color; +static methodinfo_t flash_filters_GlowFilter_clone; +static varinfo_t flash_filters_GlowFilter_quality; +static varinfo_t flash_filters_GlowFilter_knockout; +static varinfo_t flash_filters_GlowFilter_alpha; +static varinfo_t flash_filters_GlowFilter_blurX; static classinfo_t flash_events_FullScreenEvent; -static varinfo_t flash_events_FullScreenEvent_FULL_SCREEN; +static methodinfo_t flash_events_FullScreenEvent_toString; +static methodinfo_t flash_events_FullScreenEvent_clone; +static varinfo_t flash_events_FullScreenEvent_fullScreen; static methodinfo_t flash_events_FullScreenEvent_toString; static methodinfo_t flash_events_FullScreenEvent_clone; static varinfo_t flash_events_FullScreenEvent_fullScreen; static classinfo_t flash_display_StageDisplayState; -static varinfo_t flash_display_StageDisplayState_NORMAL; -static varinfo_t flash_display_StageDisplayState_FULL_SCREEN; static classinfo_t flash_text_engine_TextJustifier; -static methodinfo_t flash_text_engine_TextJustifier_getJustifierForLocale; +static varinfo_t flash_text_engine_TextJustifier_lineJustification; +static varinfo_t flash_text_engine_TextJustifier_locale; +static methodinfo_t flash_text_engine_TextJustifier_clone; static varinfo_t flash_text_engine_TextJustifier_lineJustification; static varinfo_t flash_text_engine_TextJustifier_locale; static methodinfo_t flash_text_engine_TextJustifier_clone; static classinfo_t flash_display_StageAlign; -static varinfo_t flash_display_StageAlign_RIGHT; -static varinfo_t flash_display_StageAlign_BOTTOM; -static varinfo_t flash_display_StageAlign_BOTTOM_LEFT; -static varinfo_t flash_display_StageAlign_TOP_RIGHT; -static varinfo_t flash_display_StageAlign_TOP; -static varinfo_t flash_display_StageAlign_LEFT; -static varinfo_t flash_display_StageAlign_BOTTOM_RIGHT; -static varinfo_t flash_display_StageAlign_TOP_LEFT; static varinfo_t _NaN; static classinfo_t _ReferenceError; -static varinfo_t _ReferenceError_length; static classinfo_t flash_display_Shape; static varinfo_t flash_display_Shape_graphics; +static varinfo_t flash_display_Shape_graphics; static classinfo_t flash_text_TextFormat = {0x03, 0x00, 0x80, 0x16, "flash.text", "TextFormat", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_TextFormat_leading = {0x01, 0x00, 0x80, 0x16, "", "leading", 0, &_Object, &flash_text_TextFormat, 0}; static varinfo_t flash_text_TextFormat_bold = {0x01, 0x00, 0x80, 0x16, "", "bold", 0, &_Object, &flash_text_TextFormat, 0}; @@ -2522,9 +3449,9 @@ static methodinfo_t flash_filters_DropShadowFilter_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_filters_BitmapFilter, &flash_filters_DropShadowFilter, 0}; static classinfo_t adobe_utils_CustomActions = {0x03, 0x00, 0x81, 0x16, "adobe.utils", "CustomActions", 0, &_Object, interfaces: {0}}; static varinfo_t adobe_utils_CustomActions_actionsList = {0x01, 0x00, 0x82, 0x16, "", "actionsList", 0, &_Array, &adobe_utils_CustomActions, 0}; -static methodinfo_t adobe_utils_CustomActions_uninstallActions = {0x02, 0x00, 0x82, 0x16, "", "uninstallActions", 0, 0, &adobe_utils_CustomActions, 0}; +static methodinfo_t adobe_utils_CustomActions_uninstallActions = {0x02, 0x00, 0x82, 0x16, "", "uninstallActions", 0, &voidclass, &adobe_utils_CustomActions, 0}; static methodinfo_t adobe_utils_CustomActions_getActions = {0x02, 0x00, 0x82, 0x16, "", "getActions", 0, &_String, &adobe_utils_CustomActions, 0}; -static methodinfo_t adobe_utils_CustomActions_installActions = {0x02, 0x00, 0x82, 0x16, "", "installActions", 0, 0, &adobe_utils_CustomActions, 0}; +static methodinfo_t adobe_utils_CustomActions_installActions = {0x02, 0x00, 0x82, 0x16, "", "installActions", 0, &voidclass, &adobe_utils_CustomActions, 0}; static classinfo_t flash_text_engine_TextLineValidity = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "TextLineValidity", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_engine_TextLineValidity_STATIC = {0x01, 0x00, 0x82, 0x16, "", "STATIC", 0, &_String, &flash_text_engine_TextLineValidity, 0}; static varinfo_t flash_text_engine_TextLineValidity_VALID = {0x01, 0x00, 0x82, 0x16, "", "VALID", 0, &_String, &flash_text_engine_TextLineValidity, 0}; @@ -2551,65 +3478,65 @@ static varinfo_t flash_ui_KeyLocation_STANDARD = {0x01, 0x00, 0x82, 0x16, "", "STANDARD", 0, &_uint, &flash_ui_KeyLocation, 0}; static classinfo_t flash_events_MouseEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "MouseEvent", 0, &flash_events_Event, interfaces: {0}}; static varinfo_t flash_events_MouseEvent_localY = {0x01, 0x00, 0x80, 0x16, "", "localY", 0, &_Number, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_MOUSE_OUT = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_OUT", 0, &_String, &flash_events_MouseEvent, 0}; -static methodinfo_t flash_events_MouseEvent_updateAfterEvent = {0x02, 0x00, 0x80, 0x16, "", "updateAfterEvent", 0, 0, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_MOUSE_MOVE = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_MOVE", 0, &_String, &flash_events_MouseEvent, 0}; +static methodinfo_t flash_events_MouseEvent_updateAfterEvent = {0x02, 0x00, 0x80, 0x16, "", "updateAfterEvent", 0, &voidclass, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_delta = {0x01, 0x00, 0x80, 0x16, "", "delta", 0, &_int, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_MOUSE_WHEEL = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_WHEEL", 0, &_String, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_stageX = {0x01, 0x00, 0x80, 0x16, "", "stageX", 0, &_Number, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_CLICK = {0x01, 0x00, 0x82, 0x16, "", "CLICK", 0, &_String, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_ROLL_OUT = {0x01, 0x00, 0x82, 0x16, "", "ROLL_OUT", 0, &_String, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_MOUSE_OVER = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_OVER", 0, &_String, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_ROLL_OVER = {0x01, 0x00, 0x82, 0x16, "", "ROLL_OVER", 0, &_String, &flash_events_MouseEvent, 0}; static methodinfo_t flash_events_MouseEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_MOUSE_DOWN = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_DOWN", 0, &_String, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_relatedObject = {0x01, 0x00, 0x80, 0x16, "", "relatedObject", 0, &flash_display_InteractiveObject, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_isRelatedObjectInaccessible = {0x01, 0x00, 0x80, 0x16, "", "isRelatedObjectInaccessible", 0, &_Boolean, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_shiftKey = {0x01, 0x00, 0x80, 0x16, "", "shiftKey", 0, &_Boolean, &flash_events_MouseEvent, 0}; -static varinfo_t flash_events_MouseEvent_DOUBLE_CLICK = {0x01, 0x00, 0x82, 0x16, "", "DOUBLE_CLICK", 0, &_String, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_stageY = {0x01, 0x00, 0x80, 0x16, "", "stageY", 0, &_Number, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_altKey = {0x01, 0x00, 0x80, 0x16, "", "altKey", 0, &_Boolean, &flash_events_MouseEvent, 0}; static methodinfo_t flash_events_MouseEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_ctrlKey = {0x01, 0x00, 0x80, 0x16, "", "ctrlKey", 0, &_Boolean, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_localX = {0x01, 0x00, 0x80, 0x16, "", "localX", 0, &_Number, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_buttonDown = {0x01, 0x00, 0x80, 0x16, "", "buttonDown", 0, &_Boolean, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_ROLL_OVER = {0x01, 0x00, 0x82, 0x16, "", "ROLL_OVER", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_ROLL_OUT = {0x01, 0x00, 0x82, 0x16, "", "ROLL_OUT", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_MOUSE_DOWN = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_DOWN", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_DOUBLE_CLICK = {0x01, 0x00, 0x82, 0x16, "", "DOUBLE_CLICK", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_MOUSE_WHEEL = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_WHEEL", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_CLICK = {0x01, 0x00, 0x82, 0x16, "", "CLICK", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_MOUSE_MOVE = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_MOVE", 0, &_String, &flash_events_MouseEvent, 0}; static varinfo_t flash_events_MouseEvent_MOUSE_UP = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_UP", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_MOUSE_OVER = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_OVER", 0, &_String, &flash_events_MouseEvent, 0}; +static varinfo_t flash_events_MouseEvent_MOUSE_OUT = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_OUT", 0, &_String, &flash_events_MouseEvent, 0}; static classinfo_t flash_text_engine_LineJustification = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "LineJustification", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_engine_LineJustification_ALL_INCLUDING_LAST = {0x01, 0x00, 0x82, 0x16, "", "ALL_INCLUDING_LAST", 0, &_String, &flash_text_engine_LineJustification, 0}; static varinfo_t flash_text_engine_LineJustification_UNJUSTIFIED = {0x01, 0x00, 0x82, 0x16, "", "UNJUSTIFIED", 0, &_String, &flash_text_engine_LineJustification, 0}; static varinfo_t flash_text_engine_LineJustification_ALL_BUT_LAST = {0x01, 0x00, 0x82, 0x16, "", "ALL_BUT_LAST", 0, &_String, &flash_text_engine_LineJustification, 0}; static classinfo_t flash_media_Camera = {0x03, 0x00, 0x81, 0x16, "flash.media", "Camera", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_media_Camera_getCamera = {0x02, 0x00, 0x82, 0x16, "", "getCamera", 0, &flash_media_Camera, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_fps = {0x01, 0x00, 0x80, 0x16, "", "fps", 0, &_Number, &flash_media_Camera, 0}; -static methodinfo_t flash_media_Camera_setMode = {0x02, 0x00, 0x80, 0x16, "", "setMode", 0, 0, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_setMode = {0x02, 0x00, 0x80, 0x16, "", "setMode", 0, &voidclass, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_keyFrameInterval = {0x01, 0x00, 0x80, 0x16, "", "keyFrameInterval", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_motionTimeout = {0x01, 0x00, 0x80, 0x16, "", "motionTimeout", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_width = {0x01, 0x00, 0x80, 0x16, "", "width", 0, &_int, &flash_media_Camera, 0}; -static methodinfo_t flash_media_Camera_setCursor = {0x02, 0x00, 0x80, 0x16, "", "setCursor", 0, 0, &flash_media_Camera, 0}; -static methodinfo_t flash_media_Camera_setLoopback = {0x02, 0x00, 0x80, 0x16, "", "setLoopback", 0, 0, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_setCursor = {0x02, 0x00, 0x80, 0x16, "", "setCursor", 0, &voidclass, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_setLoopback = {0x02, 0x00, 0x80, 0x16, "", "setLoopback", 0, &voidclass, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_height = {0x01, 0x00, 0x80, 0x16, "", "height", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_index = {0x01, 0x00, 0x80, 0x16, "", "index", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, &_String, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_currentFPS = {0x01, 0x00, 0x80, 0x16, "", "currentFPS", 0, &_Number, &flash_media_Camera, 0}; -static methodinfo_t flash_media_Camera_setKeyFrameInterval = {0x02, 0x00, 0x80, 0x16, "", "setKeyFrameInterval", 0, 0, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_setKeyFrameInterval = {0x02, 0x00, 0x80, 0x16, "", "setKeyFrameInterval", 0, &voidclass, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_quality = {0x01, 0x00, 0x80, 0x16, "", "quality", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_motionLevel = {0x01, 0x00, 0x80, 0x16, "", "motionLevel", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_bandwidth = {0x01, 0x00, 0x80, 0x16, "", "bandwidth", 0, &_int, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_muted = {0x01, 0x00, 0x80, 0x16, "", "muted", 0, &_Boolean, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_activityLevel = {0x01, 0x00, 0x80, 0x16, "", "activityLevel", 0, &_Number, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_loopback = {0x01, 0x00, 0x80, 0x16, "", "loopback", 0, &_Boolean, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_setQuality = {0x02, 0x00, 0x80, 0x16, "", "setQuality", 0, &voidclass, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_setMotionLevel = {0x02, 0x00, 0x80, 0x16, "", "setMotionLevel", 0, &voidclass, &flash_media_Camera, 0}; +static methodinfo_t flash_media_Camera_getCamera = {0x02, 0x00, 0x82, 0x16, "", "getCamera", 0, &flash_media_Camera, &flash_media_Camera, 0}; static varinfo_t flash_media_Camera_names = {0x01, 0x00, 0x82, 0x16, "", "names", 0, &_Array, &flash_media_Camera, 0}; -static methodinfo_t flash_media_Camera_setQuality = {0x02, 0x00, 0x80, 0x16, "", "setQuality", 0, 0, &flash_media_Camera, 0}; -static methodinfo_t flash_media_Camera_setMotionLevel = {0x02, 0x00, 0x80, 0x16, "", "setMotionLevel", 0, 0, &flash_media_Camera, 0}; -static methodinfo_t flash_net_registerClassAlias = {0x02, 0x00, 0x82, 0x16, "flash.net", "registerClassAlias", 0, 0, 0, 0}; +static methodinfo_t flash_net_registerClassAlias = {0x02, 0x00, 0x82, 0x16, "flash.net", "registerClassAlias", 0, &voidclass, 0, 0}; static classinfo_t flash_accessibility_AccessibilityImplementation = {0x03, 0x00, 0x80, 0x16, "flash.accessibility", "AccessibilityImplementation", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accState = {0x02, 0x00, 0x80, 0x16, "", "get_accState", 0, &_uint, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accName = {0x02, 0x00, 0x80, 0x16, "", "get_accName", 0, &_String, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accSelection = {0x02, 0x00, 0x80, 0x16, "", "get_accSelection", 0, &_Array, &flash_accessibility_AccessibilityImplementation, 0}; -static methodinfo_t flash_accessibility_AccessibilityImplementation_accDoDefaultAction = {0x02, 0x00, 0x80, 0x16, "", "accDoDefaultAction", 0, 0, &flash_accessibility_AccessibilityImplementation, 0}; +static methodinfo_t flash_accessibility_AccessibilityImplementation_accDoDefaultAction = {0x02, 0x00, 0x80, 0x16, "", "accDoDefaultAction", 0, &voidclass, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accFocus = {0x02, 0x00, 0x80, 0x16, "", "get_accFocus", 0, &_uint, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accDefaultAction = {0x02, 0x00, 0x80, 0x16, "", "get_accDefaultAction", 0, &_String, &flash_accessibility_AccessibilityImplementation, 0}; -static methodinfo_t flash_accessibility_AccessibilityImplementation_accSelect = {0x02, 0x00, 0x80, 0x16, "", "accSelect", 0, 0, &flash_accessibility_AccessibilityImplementation, 0}; +static methodinfo_t flash_accessibility_AccessibilityImplementation_accSelect = {0x02, 0x00, 0x80, 0x16, "", "accSelect", 0, &voidclass, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accValue = {0x02, 0x00, 0x80, 0x16, "", "get_accValue", 0, &_String, &flash_accessibility_AccessibilityImplementation, 0}; static varinfo_t flash_accessibility_AccessibilityImplementation_stub = {0x01, 0x00, 0x80, 0x16, "", "stub", 0, &_Boolean, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_get_accRole = {0x02, 0x00, 0x80, 0x16, "", "get_accRole", 0, &_uint, &flash_accessibility_AccessibilityImplementation, 0}; @@ -2618,76 +3545,76 @@ static methodinfo_t flash_accessibility_AccessibilityImplementation_accLocation = {0x02, 0x00, 0x80, 0x16, "", "accLocation", 0, 0, &flash_accessibility_AccessibilityImplementation, 0}; static methodinfo_t flash_accessibility_AccessibilityImplementation_getChildIDArray = {0x02, 0x00, 0x80, 0x16, "", "getChildIDArray", 0, &_Array, &flash_accessibility_AccessibilityImplementation, 0}; static classinfo_t flash_utils_ByteArray = {0x03, 0x00, 0x80, 0x16, "flash.utils", "ByteArray", 0, &_Object, interfaces: {&flash_utils_IDataInput, &flash_utils_IDataOutput, 0}}; -static methodinfo_t flash_utils_ByteArray_writeBoolean = {0x02, 0x00, 0x80, 0x16, "", "writeBoolean", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeBoolean = {0x02, 0x00, 0x80, 0x16, "", "writeBoolean", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readDouble = {0x02, 0x00, 0x80, 0x16, "", "readDouble", 0, &_Number, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeByte = {0x02, 0x00, 0x80, 0x16, "", "writeByte", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeObject = {0x02, 0x00, 0x80, 0x16, "", "writeObject", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeByte = {0x02, 0x00, 0x80, 0x16, "", "writeByte", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeObject = {0x02, 0x00, 0x80, 0x16, "", "writeObject", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readUTFBytes = {0x02, 0x00, 0x80, 0x16, "", "readUTFBytes", 0, &_String, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeMultiByte = {0x02, 0x00, 0x80, 0x16, "", "writeMultiByte", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_uncompress = {0x02, 0x00, 0x80, 0x16, "", "uncompress", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeMultiByte = {0x02, 0x00, 0x80, 0x16, "", "writeMultiByte", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_uncompress = {0x02, 0x00, 0x80, 0x16, "", "uncompress", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readUnsignedByte = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedByte", 0, &_uint, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeInt = {0x02, 0x00, 0x80, 0x16, "", "writeInt", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_deflate = {0x02, 0x00, 0x80, 0x16, "", "deflate", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeInt = {0x02, 0x00, 0x80, 0x16, "", "writeInt", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_deflate = {0x02, 0x00, 0x80, 0x16, "", "deflate", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readMultiByte = {0x02, 0x00, 0x80, 0x16, "", "readMultiByte", 0, &_String, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_readBytes = {0x02, 0x00, 0x80, 0x16, "", "readBytes", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeShort = {0x02, 0x00, 0x80, 0x16, "", "writeShort", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_readBytes = {0x02, 0x00, 0x80, 0x16, "", "readBytes", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeShort = {0x02, 0x00, 0x80, 0x16, "", "writeShort", 0, &voidclass, &flash_utils_ByteArray, 0}; static varinfo_t flash_utils_ByteArray_position = {0x01, 0x00, 0x80, 0x16, "", "position", 0, &_uint, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readShort = {0x02, 0x00, 0x80, 0x16, "", "readShort", 0, &_int, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeUTF = {0x02, 0x00, 0x80, 0x16, "", "writeUTF", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeBytes = {0x02, 0x00, 0x80, 0x16, "", "writeBytes", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeUTF = {0x02, 0x00, 0x80, 0x16, "", "writeUTF", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeBytes = {0x02, 0x00, 0x80, 0x16, "", "writeBytes", 0, &voidclass, &flash_utils_ByteArray, 0}; static varinfo_t flash_utils_ByteArray_objectEncoding = {0x01, 0x00, 0x80, 0x16, "", "objectEncoding", 0, &_uint, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readObject = {0x02, 0x00, 0x80, 0x16, "", "readObject", 0, 0, &flash_utils_ByteArray, 0}; static varinfo_t flash_utils_ByteArray_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_uint, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "writeUnsignedInt", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeDouble = {0x02, 0x00, 0x80, 0x16, "", "writeDouble", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeFloat = {0x02, 0x00, 0x80, 0x16, "", "writeFloat", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "writeUnsignedInt", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeDouble = {0x02, 0x00, 0x80, 0x16, "", "writeDouble", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeFloat = {0x02, 0x00, 0x80, 0x16, "", "writeFloat", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readInt = {0x02, 0x00, 0x80, 0x16, "", "readInt", 0, &_int, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readByte = {0x02, 0x00, 0x80, 0x16, "", "readByte", 0, &_int, &flash_utils_ByteArray, 0}; static varinfo_t flash_utils_ByteArray_bytesAvailable = {0x01, 0x00, 0x80, 0x16, "", "bytesAvailable", 0, &_uint, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, &voidclass, &flash_utils_ByteArray, 0}; static varinfo_t flash_utils_ByteArray_endian = {0x01, 0x00, 0x80, 0x16, "", "endian", 0, &_String, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readUnsignedShort = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedShort", 0, &_uint, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedInt", 0, &_uint, &flash_utils_ByteArray, 0}; -static varinfo_t flash_utils_ByteArray_defaultObjectEncoding = {0x01, 0x00, 0x82, 0x16, "", "defaultObjectEncoding", 0, &_uint, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readFloat = {0x02, 0x00, 0x80, 0x16, "", "readFloat", 0, &_Number, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_compress = {0x02, 0x00, 0x80, 0x16, "", "compress", 0, 0, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_writeUTFBytes = {0x02, 0x00, 0x80, 0x16, "", "writeUTFBytes", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_compress = {0x02, 0x00, 0x80, 0x16, "", "compress", 0, &voidclass, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_writeUTFBytes = {0x02, 0x00, 0x80, 0x16, "", "writeUTFBytes", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readBoolean = {0x02, 0x00, 0x80, 0x16, "", "readBoolean", 0, &_Boolean, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_utils_ByteArray_inflate = {0x02, 0x00, 0x80, 0x16, "", "inflate", 0, 0, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_utils_ByteArray_inflate = {0x02, 0x00, 0x80, 0x16, "", "inflate", 0, &voidclass, &flash_utils_ByteArray, 0}; static methodinfo_t flash_utils_ByteArray_readUTF = {0x02, 0x00, 0x80, 0x16, "", "readUTF", 0, &_String, &flash_utils_ByteArray, 0}; -static methodinfo_t flash_sampler_stopSampling = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "stopSampling", 0, 0, 0, 0}; +static varinfo_t flash_utils_ByteArray_defaultObjectEncoding = {0x01, 0x00, 0x82, 0x16, "", "defaultObjectEncoding", 0, &_uint, &flash_utils_ByteArray, 0}; +static methodinfo_t flash_sampler_stopSampling = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "stopSampling", 0, &voidclass, 0, 0}; static classinfo_t flash_events_SyncEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "SyncEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_SyncEvent_SYNC = {0x01, 0x00, 0x82, 0x16, "", "SYNC", 0, &_String, &flash_events_SyncEvent, 0}; static methodinfo_t flash_events_SyncEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_SyncEvent, 0}; static methodinfo_t flash_events_SyncEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_SyncEvent, 0}; static varinfo_t flash_events_SyncEvent_changeList = {0x01, 0x00, 0x80, 0x16, "", "changeList", 0, &_Array, &flash_events_SyncEvent, 0}; +static varinfo_t flash_events_SyncEvent_SYNC = {0x01, 0x00, 0x82, 0x16, "", "SYNC", 0, &_String, &flash_events_SyncEvent, 0}; static methodinfo_t _encodeURIComponent = {0x02, 0x00, 0x82, 0x16, "", "encodeURIComponent", 0, &_String, 0, 0}; static classinfo_t flash_net_Socket = {0x03, 0x00, 0x80, 0x16, "flash.net", "Socket", 0, &flash_events_EventDispatcher, interfaces: {&flash_utils_IDataInput, &flash_utils_IDataOutput, 0}}; -static methodinfo_t flash_net_Socket_writeBoolean = {0x02, 0x00, 0x80, 0x16, "", "writeBoolean", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeBoolean = {0x02, 0x00, 0x80, 0x16, "", "writeBoolean", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readDouble = {0x02, 0x00, 0x80, 0x16, "", "readDouble", 0, &_Number, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeByte = {0x02, 0x00, 0x80, 0x16, "", "writeByte", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeObject = {0x02, 0x00, 0x80, 0x16, "", "writeObject", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeByte = {0x02, 0x00, 0x80, 0x16, "", "writeByte", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeObject = {0x02, 0x00, 0x80, 0x16, "", "writeObject", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readUTFBytes = {0x02, 0x00, 0x80, 0x16, "", "readUTFBytes", 0, &_String, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeMultiByte = {0x02, 0x00, 0x80, 0x16, "", "writeMultiByte", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeMultiByte = {0x02, 0x00, 0x80, 0x16, "", "writeMultiByte", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readUnsignedByte = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedByte", 0, &_uint, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeInt = {0x02, 0x00, 0x80, 0x16, "", "writeInt", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeInt = {0x02, 0x00, 0x80, 0x16, "", "writeInt", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readMultiByte = {0x02, 0x00, 0x80, 0x16, "", "readMultiByte", 0, &_String, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_readBytes = {0x02, 0x00, 0x80, 0x16, "", "readBytes", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeShort = {0x02, 0x00, 0x80, 0x16, "", "writeShort", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_readBytes = {0x02, 0x00, 0x80, 0x16, "", "readBytes", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeShort = {0x02, 0x00, 0x80, 0x16, "", "writeShort", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readShort = {0x02, 0x00, 0x80, 0x16, "", "readShort", 0, &_int, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeUTF = {0x02, 0x00, 0x80, 0x16, "", "writeUTF", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeUTF = {0x02, 0x00, 0x80, 0x16, "", "writeUTF", 0, &voidclass, &flash_net_Socket, 0}; static varinfo_t flash_net_Socket_timeout = {0x01, 0x00, 0x80, 0x16, "", "timeout", 0, &_uint, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeBytes = {0x02, 0x00, 0x80, 0x16, "", "writeBytes", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeBytes = {0x02, 0x00, 0x80, 0x16, "", "writeBytes", 0, &voidclass, &flash_net_Socket, 0}; static varinfo_t flash_net_Socket_connected = {0x01, 0x00, 0x80, 0x16, "", "connected", 0, &_Boolean, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readObject = {0x02, 0x00, 0x80, 0x16, "", "readObject", 0, 0, &flash_net_Socket, 0}; static varinfo_t flash_net_Socket_objectEncoding = {0x01, 0x00, 0x80, 0x16, "", "objectEncoding", 0, &_uint, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_flush = {0x02, 0x00, 0x80, 0x16, "", "flush", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "writeUnsignedInt", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeDouble = {0x02, 0x00, 0x80, 0x16, "", "writeDouble", 0, 0, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeFloat = {0x02, 0x00, 0x80, 0x16, "", "writeFloat", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_flush = {0x02, 0x00, 0x80, 0x16, "", "flush", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "writeUnsignedInt", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeDouble = {0x02, 0x00, 0x80, 0x16, "", "writeDouble", 0, &voidclass, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeFloat = {0x02, 0x00, 0x80, 0x16, "", "writeFloat", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readInt = {0x02, 0x00, 0x80, 0x16, "", "readInt", 0, &_int, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readByte = {0x02, 0x00, 0x80, 0x16, "", "readByte", 0, &_int, &flash_net_Socket, 0}; static varinfo_t flash_net_Socket_bytesAvailable = {0x01, 0x00, 0x80, 0x16, "", "bytesAvailable", 0, &_uint, &flash_net_Socket, 0}; @@ -2695,50 +3622,50 @@ static methodinfo_t flash_net_Socket_readUnsignedShort = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedShort", 0, &_uint, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedInt", 0, &_uint, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readFloat = {0x02, 0x00, 0x80, 0x16, "", "readFloat", 0, &_Number, &flash_net_Socket, 0}; -static methodinfo_t flash_net_Socket_writeUTFBytes = {0x02, 0x00, 0x80, 0x16, "", "writeUTFBytes", 0, 0, &flash_net_Socket, 0}; +static methodinfo_t flash_net_Socket_writeUTFBytes = {0x02, 0x00, 0x80, 0x16, "", "writeUTFBytes", 0, &voidclass, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readBoolean = {0x02, 0x00, 0x80, 0x16, "", "readBoolean", 0, &_Boolean, &flash_net_Socket, 0}; static methodinfo_t flash_net_Socket_readUTF = {0x02, 0x00, 0x80, 0x16, "", "readUTF", 0, &_String, &flash_net_Socket, 0}; static methodinfo_t _unescape = {0x02, 0x00, 0x82, 0x16, "", "unescape", 0, &_String, 0, 0}; static classinfo_t flash_utils_Timer = {0x03, 0x00, 0x80, 0x16, "flash.utils", "Timer", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_utils_Timer_reset = {0x02, 0x00, 0x80, 0x16, "", "reset", 0, 0, &flash_utils_Timer, 0}; +static methodinfo_t flash_utils_Timer_reset = {0x02, 0x00, 0x80, 0x16, "", "reset", 0, &voidclass, &flash_utils_Timer, 0}; static varinfo_t flash_utils_Timer_running = {0x01, 0x00, 0x80, 0x16, "", "running", 0, &_Boolean, &flash_utils_Timer, 0}; static varinfo_t flash_utils_Timer_repeatCount = {0x01, 0x00, 0x80, 0x16, "", "repeatCount", 0, &_int, &flash_utils_Timer, 0}; -static methodinfo_t flash_utils_Timer_stop = {0x02, 0x00, 0x80, 0x16, "", "stop", 0, 0, &flash_utils_Timer, 0}; -static methodinfo_t flash_utils_Timer_start = {0x02, 0x00, 0x80, 0x16, "", "start", 0, 0, &flash_utils_Timer, 0}; +static methodinfo_t flash_utils_Timer_stop = {0x02, 0x00, 0x80, 0x16, "", "stop", 0, &voidclass, &flash_utils_Timer, 0}; +static methodinfo_t flash_utils_Timer_start = {0x02, 0x00, 0x80, 0x16, "", "start", 0, &voidclass, &flash_utils_Timer, 0}; static varinfo_t flash_utils_Timer_currentCount = {0x01, 0x00, 0x80, 0x16, "", "currentCount", 0, &_int, &flash_utils_Timer, 0}; static varinfo_t flash_utils_Timer_delay = {0x01, 0x00, 0x80, 0x16, "", "delay", 0, &_Number, &flash_utils_Timer, 0}; static classinfo_t _Array = {0x03, 0x00, 0x88, 0x16, "", "Array", 0, &_Object, interfaces: {0}}; -static methodinfo_t _Array_sort = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "sort", 0, 0, &_Array, 0}; -static methodinfo_t _Array_unshift = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "unshift", 0, &_uint, &_Array, 0}; -static varinfo_t _Array_RETURNINDEXEDARRAY = {0x01, 0x00, 0x82, 0x16, "", "RETURNINDEXEDARRAY", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_indexOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "indexOf", 0, &_int, &_Array, 0}; -static methodinfo_t _Array_join = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "join", 0, &_String, &_Array, 0}; +static methodinfo_t _Array_forEach = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "forEach", 0, &voidclass, &_Array, 0}; static methodinfo_t _Array_sortOn = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "sortOn", 0, 0, &_Array, 0}; -static varinfo_t _Array_UNIQUESORT = {0x01, 0x00, 0x82, 0x16, "", "UNIQUESORT", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_shift = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "shift", 0, 0, &_Array, 0}; -static methodinfo_t _Array_reverse = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "reverse", 0, &_Array, &_Array, 0}; -static varinfo_t _Array_CASEINSENSITIVE = {0x01, 0x00, 0x82, 0x16, "", "CASEINSENSITIVE", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_forEach = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "forEach", 0, 0, &_Array, 0}; -static varinfo_t _Array_DESCENDING = {0x01, 0x00, 0x82, 0x16, "", "DESCENDING", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_pop = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "pop", 0, 0, &_Array, 0}; -static methodinfo_t _Array_slice = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "slice", 0, &_Array, &_Array, 0}; -static varinfo_t _Array_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_map = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "map", 0, &_Array, &_Array, 0}; -static methodinfo_t _Array_push = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "push", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_lastIndexOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "lastIndexOf", 0, &_int, &_Array, 0}; +static methodinfo_t _Array_indexOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "indexOf", 0, &_int, &_Array, 0}; static methodinfo_t _Array_splice = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "splice", 0, 0, &_Array, 0}; +static methodinfo_t _Array_lastIndexOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "lastIndexOf", 0, &_int, &_Array, 0}; +static methodinfo_t _Array_map = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "map", 0, &_Array, &_Array, 0}; +static methodinfo_t _Array_concat = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "concat", 0, &_Array, &_Array, 0}; +static methodinfo_t _Array_shift = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "shift", 0, 0, &_Array, 0}; +static methodinfo_t _Array_unshift = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "unshift", 0, &_uint, &_Array, 0}; +static methodinfo_t _Array_some = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "some", 0, &_Boolean, &_Array, 0}; +static methodinfo_t _Array_filter = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "filter", 0, &_Array, &_Array, 0}; +static methodinfo_t _Array_join = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "join", 0, &_String, &_Array, 0}; +static methodinfo_t _Array_slice = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "slice", 0, &_Array, &_Array, 0}; static methodinfo_t _Array_every = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "every", 0, &_Boolean, &_Array, 0}; -static methodinfo_t _Array_concat = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "concat", 0, &_Array, &_Array, 0}; +static methodinfo_t _Array_pop = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "pop", 0, 0, &_Array, 0}; +static methodinfo_t _Array_sort = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "sort", 0, 0, &_Array, 0}; +static methodinfo_t _Array_reverse = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "reverse", 0, &_Array, &_Array, 0}; +static methodinfo_t _Array_push = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "push", 0, &_uint, &_Array, 0}; +static varinfo_t _Array_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_uint, &_Array, 0}; +static varinfo_t _Array_DESCENDING = {0x01, 0x00, 0x82, 0x16, "", "DESCENDING", 0, &_uint, &_Array, 0}; +static varinfo_t _Array_UNIQUESORT = {0x01, 0x00, 0x82, 0x16, "", "UNIQUESORT", 0, &_uint, &_Array, 0}; +static varinfo_t _Array_RETURNINDEXEDARRAY = {0x01, 0x00, 0x82, 0x16, "", "RETURNINDEXEDARRAY", 0, &_uint, &_Array, 0}; +static varinfo_t _Array_CASEINSENSITIVE = {0x01, 0x00, 0x82, 0x16, "", "CASEINSENSITIVE", 0, &_uint, &_Array, 0}; static varinfo_t _Array_NUMERIC = {0x01, 0x00, 0x82, 0x16, "", "NUMERIC", 0, &_uint, &_Array, 0}; -static methodinfo_t _Array_filter = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "filter", 0, &_Array, &_Array, 0}; -static methodinfo_t _Array_some = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "some", 0, &_Boolean, &_Array, 0}; static classinfo_t flash_geom_ColorTransform = {0x03, 0x00, 0x80, 0x16, "flash.geom", "ColorTransform", 0, &_Object, interfaces: {0}}; static varinfo_t flash_geom_ColorTransform_blueOffset = {0x01, 0x00, 0x80, 0x16, "", "blueOffset", 0, &_Number, &flash_geom_ColorTransform, 0}; static varinfo_t flash_geom_ColorTransform_greenOffset = {0x01, 0x00, 0x80, 0x16, "", "greenOffset", 0, &_Number, &flash_geom_ColorTransform, 0}; static varinfo_t flash_geom_ColorTransform_greenMultiplier = {0x01, 0x00, 0x80, 0x16, "", "greenMultiplier", 0, &_Number, &flash_geom_ColorTransform, 0}; static varinfo_t flash_geom_ColorTransform_redMultiplier = {0x01, 0x00, 0x80, 0x16, "", "redMultiplier", 0, &_Number, &flash_geom_ColorTransform, 0}; static varinfo_t flash_geom_ColorTransform_color = {0x01, 0x00, 0x80, 0x16, "", "color", 0, &_uint, &flash_geom_ColorTransform, 0}; -static methodinfo_t flash_geom_ColorTransform_concat = {0x02, 0x00, 0x80, 0x16, "", "concat", 0, 0, &flash_geom_ColorTransform, 0}; +static methodinfo_t flash_geom_ColorTransform_concat = {0x02, 0x00, 0x80, 0x16, "", "concat", 0, &voidclass, &flash_geom_ColorTransform, 0}; static varinfo_t flash_geom_ColorTransform_alphaOffset = {0x01, 0x00, 0x80, 0x16, "", "alphaOffset", 0, &_Number, &flash_geom_ColorTransform, 0}; static varinfo_t flash_geom_ColorTransform_blueMultiplier = {0x01, 0x00, 0x80, 0x16, "", "blueMultiplier", 0, &_Number, &flash_geom_ColorTransform, 0}; static methodinfo_t flash_geom_ColorTransform_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_geom_ColorTransform, 0}; @@ -2761,7 +3688,7 @@ static varinfo_t flash_media_SoundLoaderContext_checkPolicyFile = {0x01, 0x00, 0x80, 0x16, "", "checkPolicyFile", 0, &_Boolean, &flash_media_SoundLoaderContext, 0}; static varinfo_t flash_media_SoundLoaderContext_bufferTime = {0x01, 0x00, 0x80, 0x16, "", "bufferTime", 0, &_Number, &flash_media_SoundLoaderContext, 0}; static classinfo_t flash_net_IDynamicPropertyOutput = {0x03, 0x00, 0x90, 0x16, "flash.net", "IDynamicPropertyOutput", 0, 0, interfaces: {0}}; -static methodinfo_t flash_net_IDynamicPropertyOutput_writeDynamicProperty = {0x02, 0x00, 0x80, 0x08, "flash.net:IDynamicPropertyOutput", "writeDynamicProperty", 0, 0, &flash_net_IDynamicPropertyOutput, 0}; +static methodinfo_t flash_net_IDynamicPropertyOutput_writeDynamicProperty = {0x02, 0x00, 0x80, 0x08, "flash.net:IDynamicPropertyOutput", "writeDynamicProperty", 0, &voidclass, &flash_net_IDynamicPropertyOutput, 0}; static classinfo_t flash_display_IGraphicsData = {0x03, 0x00, 0x90, 0x16, "flash.display", "IGraphicsData", 0, 0, interfaces: {0}}; static methodinfo_t flash_utils_getDefinitionByName = {0x02, 0x00, 0x82, 0x16, "flash.utils", "getDefinitionByName", 0, &_Object, 0, 0}; static classinfo_t _Function = {0x03, 0x00, 0x88, 0x16, "", "Function", 0, &_Object, interfaces: {0}}; @@ -2782,14 +3709,14 @@ static methodinfo_t flash_sampler__getInvocationCount = {0x02, 0x00, 0x82, 0x17, "flash.sampler", "_getInvocationCount", 0, &_Number, 0, 0}; static methodinfo_t _parseFloat = {0x02, 0x00, 0x82, 0x16, "", "parseFloat", 0, &_Number, 0, 0}; static classinfo_t flash_events_NetStatusEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "NetStatusEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_NetStatusEvent_NET_STATUS = {0x01, 0x00, 0x82, 0x16, "", "NET_STATUS", 0, &_String, &flash_events_NetStatusEvent, 0}; static methodinfo_t flash_events_NetStatusEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_NetStatusEvent, 0}; static varinfo_t flash_events_NetStatusEvent_info = {0x01, 0x00, 0x80, 0x16, "", "info", 0, &_Object, &flash_events_NetStatusEvent, 0}; static methodinfo_t flash_events_NetStatusEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_NetStatusEvent, 0}; +static varinfo_t flash_events_NetStatusEvent_NET_STATUS = {0x01, 0x00, 0x82, 0x16, "", "NET_STATUS", 0, &_String, &flash_events_NetStatusEvent, 0}; static classinfo_t flash_display_ShaderJob = {0x03, 0x00, 0x80, 0x16, "flash.display", "ShaderJob", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_display_ShaderJob_cancel = {0x02, 0x00, 0x80, 0x16, "", "cancel", 0, 0, &flash_display_ShaderJob, 0}; +static methodinfo_t flash_display_ShaderJob_cancel = {0x02, 0x00, 0x80, 0x16, "", "cancel", 0, &voidclass, &flash_display_ShaderJob, 0}; static varinfo_t flash_display_ShaderJob_width = {0x01, 0x00, 0x80, 0x16, "", "width", 0, &_int, &flash_display_ShaderJob, 0}; -static methodinfo_t flash_display_ShaderJob_start = {0x02, 0x00, 0x80, 0x16, "", "start", 0, 0, &flash_display_ShaderJob, 0}; +static methodinfo_t flash_display_ShaderJob_start = {0x02, 0x00, 0x80, 0x16, "", "start", 0, &voidclass, &flash_display_ShaderJob, 0}; static varinfo_t flash_display_ShaderJob_shader = {0x01, 0x00, 0x80, 0x16, "", "shader", 0, &flash_display_Shader, &flash_display_ShaderJob, 0}; static varinfo_t flash_display_ShaderJob_height = {0x01, 0x00, 0x80, 0x16, "", "height", 0, &_int, &flash_display_ShaderJob, 0}; static varinfo_t flash_display_ShaderJob_target = {0x01, 0x00, 0x80, 0x16, "", "target", 0, &_Object, &flash_display_ShaderJob, 0}; @@ -2798,58 +3725,58 @@ static varinfo_t _VerifyError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_VerifyError, 0}; static classinfo_t flash_events_AsyncErrorEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "AsyncErrorEvent", 0, &flash_events_ErrorEvent, interfaces: {0}}; static methodinfo_t flash_events_AsyncErrorEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_AsyncErrorEvent, 0}; -static varinfo_t flash_events_AsyncErrorEvent_ASYNC_ERROR = {0x01, 0x00, 0x82, 0x16, "", "ASYNC_ERROR", 0, &_String, &flash_events_AsyncErrorEvent, 0}; static varinfo_t flash_events_AsyncErrorEvent_error = {0x01, 0x00, 0x80, 0x16, "", "error", 0, &_Error, &flash_events_AsyncErrorEvent, 0}; static methodinfo_t flash_events_AsyncErrorEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_AsyncErrorEvent, 0}; +static varinfo_t flash_events_AsyncErrorEvent_ASYNC_ERROR = {0x01, 0x00, 0x82, 0x16, "", "ASYNC_ERROR", 0, &_String, &flash_events_AsyncErrorEvent, 0}; static classinfo_t flash_net_SharedObject = {0x03, 0x00, 0x80, 0x16, "flash.net", "SharedObject", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_net_SharedObject_getLocal = {0x02, 0x00, 0x82, 0x16, "", "getLocal", 0, &flash_net_SharedObject, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_getDiskUsage = {0x02, 0x00, 0x82, 0x16, "", "getDiskUsage", 0, &_int, &flash_net_SharedObject, 0}; static varinfo_t flash_net_SharedObject_objectEncoding = {0x01, 0x00, 0x80, 0x16, "", "objectEncoding", 0, &_uint, &flash_net_SharedObject, 0}; static varinfo_t flash_net_SharedObject_client = {0x01, 0x00, 0x80, 0x16, "", "client", 0, &_Object, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_setProperty = {0x02, 0x00, 0x80, 0x16, "", "setProperty", 0, 0, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, 0, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_setProperty = {0x02, 0x00, 0x80, 0x16, "", "setProperty", 0, &voidclass, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, &voidclass, &flash_net_SharedObject, 0}; static methodinfo_t flash_net_SharedObject_flush = {0x02, 0x00, 0x80, 0x16, "", "flush", 0, &_String, &flash_net_SharedObject, 0}; -static varinfo_t flash_net_SharedObject_defaultObjectEncoding = {0x01, 0x00, 0x82, 0x16, "", "defaultObjectEncoding", 0, &_uint, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, 0, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, &voidclass, &flash_net_SharedObject, 0}; static varinfo_t flash_net_SharedObject_size = {0x01, 0x00, 0x80, 0x16, "", "size", 0, &_uint, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_setDirty = {0x02, 0x00, 0x80, 0x16, "", "setDirty", 0, 0, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_setDirty = {0x02, 0x00, 0x80, 0x16, "", "setDirty", 0, &voidclass, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, &voidclass, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_SharedObject, 0}; +static varinfo_t flash_net_SharedObject_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &_Object, &flash_net_SharedObject, 0}; +static varinfo_t flash_net_SharedObject_defaultObjectEncoding = {0x01, 0x00, 0x82, 0x16, "", "defaultObjectEncoding", 0, &_uint, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_getDiskUsage = {0x02, 0x00, 0x82, 0x16, "", "getDiskUsage", 0, &_int, &flash_net_SharedObject, 0}; static methodinfo_t flash_net_SharedObject_getRemote = {0x02, 0x00, 0x82, 0x16, "", "getRemote", 0, &flash_net_SharedObject, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, 0, &flash_net_SharedObject, 0}; -static methodinfo_t flash_net_SharedObject_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_SharedObject, 0}; static methodinfo_t flash_net_SharedObject_deleteAll = {0x02, 0x00, 0x82, 0x16, "", "deleteAll", 0, &_int, &flash_net_SharedObject, 0}; -static varinfo_t flash_net_SharedObject_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &_Object, &flash_net_SharedObject, 0}; +static methodinfo_t flash_net_SharedObject_getLocal = {0x02, 0x00, 0x82, 0x16, "", "getLocal", 0, &flash_net_SharedObject, &flash_net_SharedObject, 0}; static classinfo_t _Namespace = {0x03, 0x00, 0x81, 0x16, "", "Namespace", 0, &_Object, interfaces: {0}}; static methodinfo_t _Namespace_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_String, &_Namespace, 0}; -static varinfo_t _Namespace_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, 0, &_Namespace, 0}; static methodinfo_t _Namespace_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_Namespace, 0}; static varinfo_t _Namespace_uri = {0x01, 0x00, 0x80, 0x16, "", "uri", 0, &_String, &_Namespace, 0}; static varinfo_t _Namespace_prefix = {0x01, 0x00, 0x80, 0x16, "", "prefix", 0, 0, &_Namespace, 0}; +static varinfo_t _Namespace_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, 0, &_Namespace, 0}; static methodinfo_t flash_utils_setTimeout = {0x02, 0x00, 0x82, 0x16, "flash.utils", "setTimeout", 0, &_uint, 0, 0}; static classinfo_t flash_geom_Matrix3D = {0x03, 0x00, 0x80, 0x16, "flash.geom", "Matrix3D", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_geom_Matrix3D_interpolateTo = {0x02, 0x00, 0x80, 0x16, "", "interpolateTo", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_pointAt = {0x02, 0x00, 0x80, 0x16, "", "pointAt", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_interpolate = {0x02, 0x00, 0x82, 0x16, "", "interpolate", 0, &flash_geom_Matrix3D, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_prependRotation = {0x02, 0x00, 0x80, 0x16, "", "prependRotation", 0, 0, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_decompose = {0x02, 0x00, 0x80, 0x16, "", "decompose", 0, &__AS3___vec_Vector, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_pointAt = {0x02, 0x00, 0x80, 0x16, "", "pointAt", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_identity = {0x02, 0x00, 0x80, 0x16, "", "identity", 0, &voidclass, &flash_geom_Matrix3D, 0}; static methodinfo_t flash_geom_Matrix3D_transformVector = {0x02, 0x00, 0x80, 0x16, "", "transformVector", 0, &flash_geom_Vector3D, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_transpose = {0x02, 0x00, 0x80, 0x16, "", "transpose", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_prependScale = {0x02, 0x00, 0x80, 0x16, "", "prependScale", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_deltaTransformVector = {0x02, 0x00, 0x80, 0x16, "", "deltaTransformVector", 0, &flash_geom_Vector3D, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_appendRotation = {0x02, 0x00, 0x80, 0x16, "", "appendRotation", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static varinfo_t flash_geom_Matrix3D_determinant = {0x01, 0x00, 0x80, 0x16, "", "determinant", 0, &_Number, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_prependRotation = {0x02, 0x00, 0x80, 0x16, "", "prependRotation", 0, &voidclass, &flash_geom_Matrix3D, 0}; static varinfo_t flash_geom_Matrix3D_position = {0x01, 0x00, 0x80, 0x16, "", "position", 0, &flash_geom_Vector3D, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_decompose = {0x02, 0x00, 0x80, 0x16, "", "decompose", 0, &__AS3___vec_Vector, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_append = {0x02, 0x00, 0x80, 0x16, "", "append", 0, 0, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_interpolateTo = {0x02, 0x00, 0x80, 0x16, "", "interpolateTo", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_appendScale = {0x02, 0x00, 0x80, 0x16, "", "appendScale", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_prepend = {0x02, 0x00, 0x80, 0x16, "", "prepend", 0, &voidclass, &flash_geom_Matrix3D, 0}; static methodinfo_t flash_geom_Matrix3D_recompose = {0x02, 0x00, 0x80, 0x16, "", "recompose", 0, &_Boolean, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_geom_Matrix3D, &flash_geom_Matrix3D, 0}; -static varinfo_t flash_geom_Matrix3D_rawData = {0x01, 0x00, 0x80, 0x16, "", "rawData", 0, &__AS3___vec_Vector, &flash_geom_Matrix3D, 0}; -static varinfo_t flash_geom_Matrix3D_determinant = {0x01, 0x00, 0x80, 0x16, "", "determinant", 0, &_Number, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_appendTranslation = {0x02, 0x00, 0x80, 0x16, "", "appendTranslation", 0, &voidclass, &flash_geom_Matrix3D, 0}; static methodinfo_t flash_geom_Matrix3D_invert = {0x02, 0x00, 0x80, 0x16, "", "invert", 0, &_Boolean, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_appendScale = {0x02, 0x00, 0x80, 0x16, "", "appendScale", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_transformVectors = {0x02, 0x00, 0x80, 0x16, "", "transformVectors", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_appendTranslation = {0x02, 0x00, 0x80, 0x16, "", "appendTranslation", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_appendRotation = {0x02, 0x00, 0x80, 0x16, "", "appendRotation", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_prepend = {0x02, 0x00, 0x80, 0x16, "", "prepend", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_identity = {0x02, 0x00, 0x80, 0x16, "", "identity", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_geom_Matrix3D_prependTranslation = {0x02, 0x00, 0x80, 0x16, "", "prependTranslation", 0, 0, &flash_geom_Matrix3D, 0}; -static methodinfo_t flash_sampler_pauseSampling = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "pauseSampling", 0, 0, 0, 0}; +static varinfo_t flash_geom_Matrix3D_rawData = {0x01, 0x00, 0x80, 0x16, "", "rawData", 0, &__AS3___vec_Vector, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_prependTranslation = {0x02, 0x00, 0x80, 0x16, "", "prependTranslation", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_append = {0x02, 0x00, 0x80, 0x16, "", "append", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_geom_Matrix3D, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_prependScale = {0x02, 0x00, 0x80, 0x16, "", "prependScale", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_deltaTransformVector = {0x02, 0x00, 0x80, 0x16, "", "deltaTransformVector", 0, &flash_geom_Vector3D, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_transformVectors = {0x02, 0x00, 0x80, 0x16, "", "transformVectors", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_transpose = {0x02, 0x00, 0x80, 0x16, "", "transpose", 0, &voidclass, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_geom_Matrix3D_interpolate = {0x02, 0x00, 0x82, 0x16, "", "interpolate", 0, &flash_geom_Matrix3D, &flash_geom_Matrix3D, 0}; +static methodinfo_t flash_sampler_pauseSampling = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "pauseSampling", 0, &voidclass, 0, 0}; static classinfo_t flash_system_Capabilities = {0x03, 0x00, 0x81, 0x16, "flash.system", "Capabilities", 0, &_Object, interfaces: {0}}; static varinfo_t flash_system_Capabilities_maxLevelIDC = {0x01, 0x00, 0x82, 0x16, "", "maxLevelIDC", 0, &_String, &flash_system_Capabilities, 0}; static varinfo_t flash_system_Capabilities_isDebugger = {0x01, 0x00, 0x82, 0x16, "", "isDebugger", 0, &_Boolean, &flash_system_Capabilities, 0}; @@ -2890,12 +3817,12 @@ static varinfo_t flash_filters_BlurFilter_blurX = {0x01, 0x00, 0x80, 0x16, "", "blurX", 0, &_Number, &flash_filters_BlurFilter, 0}; static methodinfo_t _isFinite = {0x02, 0x00, 0x82, 0x16, "", "isFinite", 0, &_Boolean, 0, 0}; static classinfo_t flash_media_Video = {0x03, 0x00, 0x80, 0x16, "flash.media", "Video", 0, &flash_display_DisplayObject, interfaces: {0}}; -static methodinfo_t flash_media_Video_attachCamera = {0x02, 0x00, 0x80, 0x16, "", "attachCamera", 0, 0, &flash_media_Video, 0}; +static methodinfo_t flash_media_Video_attachCamera = {0x02, 0x00, 0x80, 0x16, "", "attachCamera", 0, &voidclass, &flash_media_Video, 0}; static varinfo_t flash_media_Video_videoWidth = {0x01, 0x00, 0x80, 0x16, "", "videoWidth", 0, &_int, &flash_media_Video, 0}; -static methodinfo_t flash_media_Video_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, 0, &flash_media_Video, 0}; +static methodinfo_t flash_media_Video_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, &voidclass, &flash_media_Video, 0}; static varinfo_t flash_media_Video_deblocking = {0x01, 0x00, 0x80, 0x16, "", "deblocking", 0, &_int, &flash_media_Video, 0}; static varinfo_t flash_media_Video_videoHeight = {0x01, 0x00, 0x80, 0x16, "", "videoHeight", 0, &_int, &flash_media_Video, 0}; -static methodinfo_t flash_media_Video_attachNetStream = {0x02, 0x00, 0x80, 0x16, "", "attachNetStream", 0, 0, &flash_media_Video, 0}; +static methodinfo_t flash_media_Video_attachNetStream = {0x02, 0x00, 0x80, 0x16, "", "attachNetStream", 0, &voidclass, &flash_media_Video, 0}; static varinfo_t flash_media_Video_smoothing = {0x01, 0x00, 0x80, 0x16, "", "smoothing", 0, &_Boolean, &flash_media_Video, 0}; static classinfo_t flash_text_engine_TextLineCreationResult = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "TextLineCreationResult", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_engine_TextLineCreationResult_EMERGENCY = {0x01, 0x00, 0x82, 0x16, "", "EMERGENCY", 0, &_String, &flash_text_engine_TextLineCreationResult, 0}; @@ -2903,16 +3830,16 @@ static varinfo_t flash_text_engine_TextLineCreationResult_SUCCESS = {0x01, 0x00, 0x82, 0x16, "", "SUCCESS", 0, &_String, &flash_text_engine_TextLineCreationResult, 0}; static varinfo_t flash_text_engine_TextLineCreationResult_INSUFFICIENT_WIDTH = {0x01, 0x00, 0x82, 0x16, "", "INSUFFICIENT_WIDTH", 0, &_String, &flash_text_engine_TextLineCreationResult, 0}; static classinfo_t _Error = {0x03, 0x00, 0x88, 0x16, "", "Error", 0, &_Object, interfaces: {0}}; -static methodinfo_t _Error_getErrorMessage = {0x02, 0x00, 0x82, 0x16, "", "getErrorMessage", 0, &_String, &_Error, 0}; -static methodinfo_t _Error_throwError = {0x02, 0x00, 0x82, 0x16, "", "throwError", 0, 0, &_Error, 0}; -static varinfo_t _Error_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Error, 0}; -static varinfo_t _Error_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, 0, &_Error, 0}; static varinfo_t _Error_message = {0x01, 0x00, 0x80, 0x16, "", "message", 0, 0, &_Error, 0}; -static methodinfo_t _Error_getStackTrace = {0x02, 0x00, 0x80, 0x16, "", "getStackTrace", 0, &_String, &_Error, 0}; static varinfo_t _Error_errorID = {0x01, 0x00, 0x80, 0x16, "", "errorID", 0, &_int, &_Error, 0}; +static methodinfo_t _Error_getStackTrace = {0x02, 0x00, 0x80, 0x16, "", "getStackTrace", 0, &_String, &_Error, 0}; +static varinfo_t _Error_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, 0, &_Error, 0}; +static varinfo_t _Error_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Error, 0}; +static methodinfo_t _Error_getErrorMessage = {0x02, 0x00, 0x82, 0x16, "", "getErrorMessage", 0, &_String, &_Error, 0}; +static methodinfo_t _Error_throwError = {0x02, 0x00, 0x82, 0x16, "", "throwError", 0, 0, &_Error, 0}; static classinfo_t flash_xml_XMLNode = {0x03, 0x00, 0x80, 0x16, "flash.xml", "XMLNode", 0, &_Object, interfaces: {0}}; static varinfo_t flash_xml_XMLNode_childNodes = {0x01, 0x00, 0x80, 0x16, "", "childNodes", 0, &_Array, &flash_xml_XMLNode, 0}; -static methodinfo_t flash_xml_XMLNode_appendChild = {0x02, 0x00, 0x80, 0x16, "", "appendChild", 0, 0, &flash_xml_XMLNode, 0}; +static methodinfo_t flash_xml_XMLNode_appendChild = {0x02, 0x00, 0x80, 0x16, "", "appendChild", 0, &voidclass, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_nextSibling = {0x01, 0x00, 0x80, 0x16, "", "nextSibling", 0, &flash_xml_XMLNode, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_nodeType = {0x01, 0x00, 0x80, 0x16, "", "nodeType", 0, &_uint, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_attributes = {0x01, 0x00, 0x80, 0x16, "", "attributes", 0, &_Object, &flash_xml_XMLNode, 0}; @@ -2923,10 +3850,10 @@ static varinfo_t flash_xml_XMLNode_localName = {0x01, 0x00, 0x80, 0x16, "", "localName", 0, &_String, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_nodeName = {0x01, 0x00, 0x80, 0x16, "", "nodeName", 0, &_String, &flash_xml_XMLNode, 0}; static methodinfo_t flash_xml_XMLNode_getNamespaceForPrefix = {0x02, 0x00, 0x80, 0x16, "", "getNamespaceForPrefix", 0, &_String, &flash_xml_XMLNode, 0}; -static methodinfo_t flash_xml_XMLNode_insertBefore = {0x02, 0x00, 0x80, 0x16, "", "insertBefore", 0, 0, &flash_xml_XMLNode, 0}; +static methodinfo_t flash_xml_XMLNode_insertBefore = {0x02, 0x00, 0x80, 0x16, "", "insertBefore", 0, &voidclass, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_lastChild = {0x01, 0x00, 0x80, 0x16, "", "lastChild", 0, &flash_xml_XMLNode, &flash_xml_XMLNode, 0}; static methodinfo_t flash_xml_XMLNode_cloneNode = {0x02, 0x00, 0x80, 0x16, "", "cloneNode", 0, &flash_xml_XMLNode, &flash_xml_XMLNode, 0}; -static methodinfo_t flash_xml_XMLNode_removeNode = {0x02, 0x00, 0x80, 0x16, "", "removeNode", 0, 0, &flash_xml_XMLNode, 0}; +static methodinfo_t flash_xml_XMLNode_removeNode = {0x02, 0x00, 0x80, 0x16, "", "removeNode", 0, &voidclass, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_namespaceURI = {0x01, 0x00, 0x80, 0x16, "", "namespaceURI", 0, &_String, &flash_xml_XMLNode, 0}; static varinfo_t flash_xml_XMLNode_previousSibling = {0x01, 0x00, 0x80, 0x16, "", "previousSibling", 0, &flash_xml_XMLNode, &flash_xml_XMLNode, 0}; static methodinfo_t flash_xml_XMLNode_hasChildNodes = {0x02, 0x00, 0x80, 0x16, "", "hasChildNodes", 0, &_Boolean, &flash_xml_XMLNode, 0}; @@ -2934,9 +3861,8 @@ static varinfo_t flash_xml_XMLNode_nodeValue = {0x01, 0x00, 0x80, 0x16, "", "nodeValue", 0, &_String, &flash_xml_XMLNode, 0}; static classinfo_t flash_net_URLVariables = {0x03, 0x00, 0x88, 0x16, "flash.net", "URLVariables", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_net_URLVariables_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_net_URLVariables, 0}; -static methodinfo_t flash_net_URLVariables_decode = {0x02, 0x00, 0x80, 0x16, "", "decode", 0, 0, &flash_net_URLVariables, 0}; +static methodinfo_t flash_net_URLVariables_decode = {0x02, 0x00, 0x80, 0x16, "", "decode", 0, &voidclass, &flash_net_URLVariables, 0}; static classinfo_t flash_display_LoaderInfo = {0x03, 0x00, 0x80, 0x16, "flash.display", "LoaderInfo", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_display_LoaderInfo_getLoaderInfoByDefinition = {0x02, 0x00, 0x82, 0x16, "", "getLoaderInfoByDefinition", 0, &flash_display_LoaderInfo, &flash_display_LoaderInfo, 0}; static varinfo_t flash_display_LoaderInfo_actionScriptVersion = {0x01, 0x00, 0x80, 0x16, "", "actionScriptVersion", 0, &_uint, &flash_display_LoaderInfo, 0}; static varinfo_t flash_display_LoaderInfo_contentType = {0x01, 0x00, 0x80, 0x16, "", "contentType", 0, &_String, &flash_display_LoaderInfo, 0}; static varinfo_t flash_display_LoaderInfo_sameDomain = {0x01, 0x00, 0x80, 0x16, "", "sameDomain", 0, &_Boolean, &flash_display_LoaderInfo, 0}; @@ -2957,6 +3883,7 @@ static varinfo_t flash_display_LoaderInfo_parentAllowsChild = {0x01, 0x00, 0x80, 0x16, "", "parentAllowsChild", 0, &_Boolean, &flash_display_LoaderInfo, 0}; static varinfo_t flash_display_LoaderInfo_childAllowsParent = {0x01, 0x00, 0x80, 0x16, "", "childAllowsParent", 0, &_Boolean, &flash_display_LoaderInfo, 0}; static varinfo_t flash_display_LoaderInfo_sharedEvents = {0x01, 0x00, 0x80, 0x16, "", "sharedEvents", 0, &flash_events_EventDispatcher, &flash_display_LoaderInfo, 0}; +static methodinfo_t flash_display_LoaderInfo_getLoaderInfoByDefinition = {0x02, 0x00, 0x82, 0x16, "", "getLoaderInfoByDefinition", 0, &flash_display_LoaderInfo, &flash_display_LoaderInfo, 0}; static classinfo_t flash_sampler_Sample = {0x03, 0x00, 0x80, 0x16, "flash.sampler", "Sample", 0, &_Object, interfaces: {0}}; static varinfo_t flash_sampler_Sample_time = {0x01, 0x00, 0x80, 0x16, "", "time", 0, &_Number, &flash_sampler_Sample, 0}; static varinfo_t flash_sampler_Sample_stack = {0x01, 0x00, 0x80, 0x16, "", "stack", 0, &_Array, &flash_sampler_Sample, 0}; @@ -2969,13 +3896,13 @@ static varinfo_t flash_net_URLRequestMethod_POST = {0x01, 0x00, 0x82, 0x16, "", "POST", 0, &_String, &flash_net_URLRequestMethod, 0}; static methodinfo_t adobe_utils_MMExecute = {0x02, 0x00, 0x82, 0x16, "adobe.utils", "MMExecute", 0, &_String, 0, 0}; static classinfo_t flash_system_System = {0x03, 0x00, 0x81, 0x16, "flash.system", "System", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_system_System_pause = {0x02, 0x00, 0x82, 0x16, "", "pause", 0, 0, &flash_system_System, 0}; +static methodinfo_t flash_system_System_pause = {0x02, 0x00, 0x82, 0x16, "", "pause", 0, &voidclass, &flash_system_System, 0}; static varinfo_t flash_system_System_useCodePage = {0x01, 0x00, 0x82, 0x16, "", "useCodePage", 0, &_Boolean, &flash_system_System, 0}; -static methodinfo_t flash_system_System_exit = {0x02, 0x00, 0x82, 0x16, "", "exit", 0, 0, &flash_system_System, 0}; -static methodinfo_t flash_system_System_setClipboard = {0x02, 0x00, 0x82, 0x16, "", "setClipboard", 0, 0, &flash_system_System, 0}; +static methodinfo_t flash_system_System_exit = {0x02, 0x00, 0x82, 0x16, "", "exit", 0, &voidclass, &flash_system_System, 0}; +static methodinfo_t flash_system_System_setClipboard = {0x02, 0x00, 0x82, 0x16, "", "setClipboard", 0, &voidclass, &flash_system_System, 0}; static varinfo_t flash_system_System_totalMemory = {0x01, 0x00, 0x82, 0x16, "", "totalMemory", 0, &_uint, &flash_system_System, 0}; -static methodinfo_t flash_system_System_gc = {0x02, 0x00, 0x82, 0x16, "", "gc", 0, 0, &flash_system_System, 0}; -static methodinfo_t flash_system_System_resume = {0x02, 0x00, 0x82, 0x16, "", "resume", 0, 0, &flash_system_System, 0}; +static methodinfo_t flash_system_System_gc = {0x02, 0x00, 0x82, 0x16, "", "gc", 0, &voidclass, &flash_system_System, 0}; +static methodinfo_t flash_system_System_resume = {0x02, 0x00, 0x82, 0x16, "", "resume", 0, &voidclass, &flash_system_System, 0}; static varinfo_t flash_system_System_vmVersion = {0x01, 0x00, 0x82, 0x16, "", "vmVersion", 0, &_String, &flash_system_System, 0}; static varinfo_t flash_system_System_ime = {0x01, 0x00, 0x82, 0x16, "", "ime", 0, &flash_system_IME, &flash_system_System, 0}; static classinfo_t flash_filters_BitmapFilterQuality = {0x03, 0x00, 0x81, 0x16, "flash.filters", "BitmapFilterQuality", 0, &_Object, interfaces: {0}}; @@ -2986,9 +3913,9 @@ static methodinfo_t flash_display_DisplayObjectContainer_addChild = {0x02, 0x00, 0x80, 0x16, "", "addChild", 0, &flash_display_DisplayObject, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_getObjectsUnderPoint = {0x02, 0x00, 0x80, 0x16, "", "getObjectsUnderPoint", 0, &_Array, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_removeChildAt = {0x02, 0x00, 0x80, 0x16, "", "removeChildAt", 0, &flash_display_DisplayObject, &flash_display_DisplayObjectContainer, 0}; -static methodinfo_t flash_display_DisplayObjectContainer_swapChildren = {0x02, 0x00, 0x80, 0x16, "", "swapChildren", 0, 0, &flash_display_DisplayObjectContainer, 0}; +static methodinfo_t flash_display_DisplayObjectContainer_swapChildren = {0x02, 0x00, 0x80, 0x16, "", "swapChildren", 0, &voidclass, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_areInaccessibleObjectsUnderPoint = {0x02, 0x00, 0x80, 0x16, "", "areInaccessibleObjectsUnderPoint", 0, &_Boolean, &flash_display_DisplayObjectContainer, 0}; -static methodinfo_t flash_display_DisplayObjectContainer_setChildIndex = {0x02, 0x00, 0x80, 0x16, "", "setChildIndex", 0, 0, &flash_display_DisplayObjectContainer, 0}; +static methodinfo_t flash_display_DisplayObjectContainer_setChildIndex = {0x02, 0x00, 0x80, 0x16, "", "setChildIndex", 0, &voidclass, &flash_display_DisplayObjectContainer, 0}; static varinfo_t flash_display_DisplayObjectContainer_numChildren = {0x01, 0x00, 0x80, 0x16, "", "numChildren", 0, &_int, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_getChildIndex = {0x02, 0x00, 0x80, 0x16, "", "getChildIndex", 0, &_int, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_getChildAt = {0x02, 0x00, 0x80, 0x16, "", "getChildAt", 0, &flash_display_DisplayObject, &flash_display_DisplayObjectContainer, 0}; @@ -2996,7 +3923,7 @@ static methodinfo_t flash_display_DisplayObjectContainer_addChildAt = {0x02, 0x00, 0x80, 0x16, "", "addChildAt", 0, &flash_display_DisplayObject, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_contains = {0x02, 0x00, 0x80, 0x16, "", "contains", 0, &_Boolean, &flash_display_DisplayObjectContainer, 0}; static methodinfo_t flash_display_DisplayObjectContainer_getChildByName = {0x02, 0x00, 0x80, 0x16, "", "getChildByName", 0, &flash_display_DisplayObject, &flash_display_DisplayObjectContainer, 0}; -static methodinfo_t flash_display_DisplayObjectContainer_swapChildrenAt = {0x02, 0x00, 0x80, 0x16, "", "swapChildrenAt", 0, 0, &flash_display_DisplayObjectContainer, 0}; +static methodinfo_t flash_display_DisplayObjectContainer_swapChildrenAt = {0x02, 0x00, 0x80, 0x16, "", "swapChildrenAt", 0, &voidclass, &flash_display_DisplayObjectContainer, 0}; static varinfo_t flash_display_DisplayObjectContainer_mouseChildren = {0x01, 0x00, 0x80, 0x16, "", "mouseChildren", 0, &_Boolean, &flash_display_DisplayObjectContainer, 0}; static varinfo_t flash_display_DisplayObjectContainer_tabChildren = {0x01, 0x00, 0x80, 0x16, "", "tabChildren", 0, &_Boolean, &flash_display_DisplayObjectContainer, 0}; static varinfo_t flash_display_DisplayObjectContainer_textSnapshot = {0x01, 0x00, 0x80, 0x16, "", "textSnapshot", 0, &flash_text_TextSnapshot, &flash_display_DisplayObjectContainer, 0}; @@ -3004,7 +3931,7 @@ static varinfo_t flash_system_LoaderContext_checkPolicyFile = {0x01, 0x00, 0x80, 0x16, "", "checkPolicyFile", 0, &_Boolean, &flash_system_LoaderContext, 0}; static varinfo_t flash_system_LoaderContext_securityDomain = {0x01, 0x00, 0x80, 0x16, "", "securityDomain", 0, &flash_system_SecurityDomain, &flash_system_LoaderContext, 0}; static varinfo_t flash_system_LoaderContext_applicationDomain = {0x01, 0x00, 0x80, 0x16, "", "applicationDomain", 0, &flash_system_ApplicationDomain, &flash_system_LoaderContext, 0}; -static methodinfo_t flash_utils_clearTimeout = {0x02, 0x00, 0x82, 0x16, "flash.utils", "clearTimeout", 0, 0, 0, 0}; +static methodinfo_t flash_utils_clearTimeout = {0x02, 0x00, 0x82, 0x16, "flash.utils", "clearTimeout", 0, &voidclass, 0, 0}; static methodinfo_t _isXMLName = {0x02, 0x00, 0x82, 0x16, "", "isXMLName", 0, &_Boolean, 0, 0}; static classinfo_t flash_xml_XMLNodeType = {0x03, 0x00, 0x81, 0x16, "flash.xml", "XMLNodeType", 0, &_Object, interfaces: {0}}; static varinfo_t flash_xml_XMLNodeType_PROCESSING_INSTRUCTION_NODE = {0x01, 0x00, 0x82, 0x16, "", "PROCESSING_INSTRUCTION_NODE", 0, &_uint, &flash_xml_XMLNodeType, 0}; @@ -3016,36 +3943,36 @@ static varinfo_t flash_xml_XMLNodeType_ELEMENT_NODE = {0x01, 0x00, 0x82, 0x16, "", "ELEMENT_NODE", 0, &_uint, &flash_xml_XMLNodeType, 0}; static classinfo_t flash_events_ErrorEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "ErrorEvent", 0, &flash_events_TextEvent, interfaces: {0}}; static methodinfo_t flash_events_ErrorEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_ErrorEvent, 0}; -static varinfo_t flash_events_ErrorEvent_ERROR = {0x01, 0x00, 0x82, 0x16, "", "ERROR", 0, &_String, &flash_events_ErrorEvent, 0}; static methodinfo_t flash_events_ErrorEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_ErrorEvent, 0}; +static varinfo_t flash_events_ErrorEvent_ERROR = {0x01, 0x00, 0x82, 0x16, "", "ERROR", 0, &_String, &flash_events_ErrorEvent, 0}; static classinfo_t flash_utils_IDataOutput = {0x03, 0x00, 0x90, 0x16, "flash.utils", "IDataOutput", 0, 0, interfaces: {0}}; -static methodinfo_t flash_utils_IDataOutput_writeUnsignedInt = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeUnsignedInt", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeInt = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeInt", 0, 0, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeUnsignedInt = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeUnsignedInt", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeInt = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeInt", 0, &voidclass, &flash_utils_IDataOutput, 0}; static varinfo_t flash_utils_IDataOutput_objectEncoding = {0x01, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "objectEncoding", 0, &_uint, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeUTFBytes = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeUTFBytes", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeObject = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeObject", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeMultiByte = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeMultiByte", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeShort = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeShort", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeFloat = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeFloat", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeUTF = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeUTF", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeByte = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeByte", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeBoolean = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeBoolean", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeDouble = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeDouble", 0, 0, &flash_utils_IDataOutput, 0}; -static methodinfo_t flash_utils_IDataOutput_writeBytes = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeBytes", 0, 0, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeUTFBytes = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeUTFBytes", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeObject = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeObject", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeMultiByte = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeMultiByte", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeShort = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeShort", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeFloat = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeFloat", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeUTF = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeUTF", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeByte = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeByte", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeBoolean = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeBoolean", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeDouble = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeDouble", 0, &voidclass, &flash_utils_IDataOutput, 0}; +static methodinfo_t flash_utils_IDataOutput_writeBytes = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "writeBytes", 0, &voidclass, &flash_utils_IDataOutput, 0}; static varinfo_t flash_utils_IDataOutput_endian = {0x01, 0x00, 0x80, 0x08, "flash.utils:IDataOutput", "endian", 0, &_String, &flash_utils_IDataOutput, 0}; static classinfo_t flash_geom_Utils3D = {0x03, 0x00, 0x80, 0x16, "flash.geom", "Utils3D", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_geom_Utils3D_projectVectors = {0x02, 0x00, 0x82, 0x16, "", "projectVectors", 0, 0, &flash_geom_Utils3D, 0}; +static methodinfo_t flash_geom_Utils3D_projectVectors = {0x02, 0x00, 0x82, 0x16, "", "projectVectors", 0, &voidclass, &flash_geom_Utils3D, 0}; static methodinfo_t flash_geom_Utils3D_projectVector = {0x02, 0x00, 0x82, 0x16, "", "projectVector", 0, &flash_geom_Vector3D, &flash_geom_Utils3D, 0}; static methodinfo_t flash_geom_Utils3D_pointTowards = {0x02, 0x00, 0x82, 0x16, "", "pointTowards", 0, &flash_geom_Matrix3D, &flash_geom_Utils3D, 0}; static classinfo_t flash_events_TextEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "TextEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_TextEvent_LINK = {0x01, 0x00, 0x82, 0x16, "", "LINK", 0, &_String, &flash_events_TextEvent, 0}; static methodinfo_t flash_events_TextEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_TextEvent, 0}; static varinfo_t flash_events_TextEvent_text = {0x01, 0x00, 0x80, 0x16, "", "text", 0, &_String, &flash_events_TextEvent, 0}; -static varinfo_t flash_events_TextEvent_TEXT_INPUT = {0x01, 0x00, 0x82, 0x16, "", "TEXT_INPUT", 0, &_String, &flash_events_TextEvent, 0}; static methodinfo_t flash_events_TextEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_TextEvent, 0}; +static varinfo_t flash_events_TextEvent_LINK = {0x01, 0x00, 0x82, 0x16, "", "LINK", 0, &_String, &flash_events_TextEvent, 0}; +static varinfo_t flash_events_TextEvent_TEXT_INPUT = {0x01, 0x00, 0x82, 0x16, "", "TEXT_INPUT", 0, &_String, &flash_events_TextEvent, 0}; static classinfo_t flash_utils_Proxy = {0x03, 0x00, 0x80, 0x16, "flash.utils", "Proxy", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_utils_Proxy_callProperty = {0x02, 0x00, 0x80, 0x08, "http://www.adobe.com/2006/actionscript/flash/proxy", "callProperty", 0, 0, &flash_utils_Proxy, 0}; -static methodinfo_t flash_utils_Proxy_setProperty = {0x02, 0x00, 0x80, 0x08, "http://www.adobe.com/2006/actionscript/flash/proxy", "setProperty", 0, 0, &flash_utils_Proxy, 0}; +static methodinfo_t flash_utils_Proxy_setProperty = {0x02, 0x00, 0x80, 0x08, "http://www.adobe.com/2006/actionscript/flash/proxy", "setProperty", 0, &voidclass, &flash_utils_Proxy, 0}; static methodinfo_t flash_utils_Proxy_getProperty = {0x02, 0x00, 0x80, 0x08, "http://www.adobe.com/2006/actionscript/flash/proxy", "getProperty", 0, 0, &flash_utils_Proxy, 0}; static methodinfo_t flash_utils_Proxy_nextName = {0x02, 0x00, 0x80, 0x08, "http://www.adobe.com/2006/actionscript/flash/proxy", "nextName", 0, &_String, &flash_utils_Proxy, 0}; static methodinfo_t flash_utils_Proxy_nextNameIndex = {0x02, 0x00, 0x80, 0x08, "http://www.adobe.com/2006/actionscript/flash/proxy", "nextNameIndex", 0, &_int, &flash_utils_Proxy, 0}; @@ -3065,7 +3992,7 @@ static methodinfo_t flash_xml_XMLDocument_createElement = {0x02, 0x00, 0x80, 0x16, "", "createElement", 0, &flash_xml_XMLNode, &flash_xml_XMLDocument, 0}; static varinfo_t flash_xml_XMLDocument_ignoreWhite = {0x01, 0x00, 0x80, 0x16, "", "ignoreWhite", 0, &_Boolean, &flash_xml_XMLDocument, 0}; static methodinfo_t flash_xml_XMLDocument_createTextNode = {0x02, 0x00, 0x80, 0x16, "", "createTextNode", 0, &flash_xml_XMLNode, &flash_xml_XMLDocument, 0}; -static methodinfo_t flash_xml_XMLDocument_parseXML = {0x02, 0x00, 0x80, 0x16, "", "parseXML", 0, 0, &flash_xml_XMLDocument, 0}; +static methodinfo_t flash_xml_XMLDocument_parseXML = {0x02, 0x00, 0x80, 0x16, "", "parseXML", 0, &voidclass, &flash_xml_XMLDocument, 0}; static classinfo_t flash_display_ShaderInput = {0x03, 0x00, 0x89, 0x16, "flash.display", "ShaderInput", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_ShaderInput_width = {0x01, 0x00, 0x80, 0x16, "", "width", 0, &_int, &flash_display_ShaderInput, 0}; static varinfo_t flash_display_ShaderInput_input = {0x01, 0x00, 0x80, 0x16, "", "input", 0, &_Object, &flash_display_ShaderInput, 0}; @@ -3083,7 +4010,7 @@ static varinfo_t flash_text_engine_TextBlock_applyNonLinearFontScaling = {0x01, 0x00, 0x80, 0x16, "", "applyNonLinearFontScaling", 0, &_Boolean, &flash_text_engine_TextBlock, 0}; static varinfo_t flash_text_engine_TextBlock_firstLine = {0x01, 0x00, 0x80, 0x16, "", "firstLine", 0, &flash_text_engine_TextLine, &flash_text_engine_TextBlock, 0}; static varinfo_t flash_text_engine_TextBlock_textJustifier = {0x01, 0x00, 0x80, 0x16, "", "textJustifier", 0, &flash_text_engine_TextJustifier, &flash_text_engine_TextBlock, 0}; -static methodinfo_t flash_text_engine_TextBlock_releaseLines = {0x02, 0x00, 0x80, 0x16, "", "releaseLines", 0, 0, &flash_text_engine_TextBlock, 0}; +static methodinfo_t flash_text_engine_TextBlock_releaseLines = {0x02, 0x00, 0x80, 0x16, "", "releaseLines", 0, &voidclass, &flash_text_engine_TextBlock, 0}; static varinfo_t flash_text_engine_TextBlock_firstInvalidLine = {0x01, 0x00, 0x80, 0x16, "", "firstInvalidLine", 0, &flash_text_engine_TextLine, &flash_text_engine_TextBlock, 0}; static varinfo_t flash_text_engine_TextBlock_baselineFontSize = {0x01, 0x00, 0x80, 0x16, "", "baselineFontSize", 0, &_Number, &flash_text_engine_TextBlock, 0}; static varinfo_t flash_text_engine_TextBlock_lineRotation = {0x01, 0x00, 0x80, 0x16, "", "lineRotation", 0, &_String, &flash_text_engine_TextBlock, 0}; @@ -3119,13 +4046,13 @@ static varinfo_t flash_display_StageQuality_HIGH = {0x01, 0x00, 0x82, 0x16, "", "HIGH", 0, &_String, &flash_display_StageQuality, 0}; static varinfo_t flash_display_StageQuality_BEST = {0x01, 0x00, 0x82, 0x16, "", "BEST", 0, &_String, &flash_display_StageQuality, 0}; static classinfo_t flash_display_Sprite = {0x03, 0x00, 0x80, 0x16, "flash.display", "Sprite", 0, &flash_display_DisplayObjectContainer, interfaces: {0}}; -static methodinfo_t flash_display_Sprite_stopDrag = {0x02, 0x00, 0x80, 0x16, "", "stopDrag", 0, 0, &flash_display_Sprite, 0}; +static methodinfo_t flash_display_Sprite_stopDrag = {0x02, 0x00, 0x80, 0x16, "", "stopDrag", 0, &voidclass, &flash_display_Sprite, 0}; static varinfo_t flash_display_Sprite_buttonMode = {0x01, 0x00, 0x80, 0x16, "", "buttonMode", 0, &_Boolean, &flash_display_Sprite, 0}; static varinfo_t flash_display_Sprite_soundTransform = {0x01, 0x00, 0x80, 0x16, "", "soundTransform", 0, &flash_media_SoundTransform, &flash_display_Sprite, 0}; static varinfo_t flash_display_Sprite_hitArea = {0x01, 0x00, 0x80, 0x16, "", "hitArea", 0, &flash_display_Sprite, &flash_display_Sprite, 0}; static varinfo_t flash_display_Sprite_useHandCursor = {0x01, 0x00, 0x80, 0x16, "", "useHandCursor", 0, &_Boolean, &flash_display_Sprite, 0}; static varinfo_t flash_display_Sprite_graphics = {0x01, 0x00, 0x80, 0x16, "", "graphics", 0, &flash_display_Graphics, &flash_display_Sprite, 0}; -static methodinfo_t flash_display_Sprite_startDrag = {0x02, 0x00, 0x80, 0x16, "", "startDrag", 0, 0, &flash_display_Sprite, 0}; +static methodinfo_t flash_display_Sprite_startDrag = {0x02, 0x00, 0x80, 0x16, "", "startDrag", 0, &voidclass, &flash_display_Sprite, 0}; static varinfo_t flash_display_Sprite_dropTarget = {0x01, 0x00, 0x80, 0x16, "", "dropTarget", 0, &flash_display_DisplayObject, &flash_display_Sprite, 0}; static classinfo_t flash_ui_Keyboard = {0x03, 0x00, 0x81, 0x16, "flash.ui", "Keyboard", 0, &_Object, interfaces: {0}}; static varinfo_t flash_ui_Keyboard_PAGE_DOWN = {0x01, 0x00, 0x82, 0x16, "", "PAGE_DOWN", 0, &_uint, &flash_ui_Keyboard, 0}; @@ -3192,7 +4119,7 @@ static varinfo_t flash_filters_DisplacementMapFilter_alpha = {0x01, 0x00, 0x80, 0x16, "", "alpha", 0, &_Number, &flash_filters_DisplacementMapFilter, 0}; static varinfo_t flash_filters_DisplacementMapFilter_componentY = {0x01, 0x00, 0x80, 0x16, "", "componentY", 0, &_uint, &flash_filters_DisplacementMapFilter, 0}; static methodinfo_t flash_utils_escapeMultiByte = {0x02, 0x00, 0x82, 0x16, "flash.utils", "escapeMultiByte", 0, &_String, 0, 0}; -static methodinfo_t adobe_utils_MMEndCommand = {0x02, 0x00, 0x82, 0x16, "adobe.utils", "MMEndCommand", 0, 0, 0, 0}; +static methodinfo_t adobe_utils_MMEndCommand = {0x02, 0x00, 0x82, 0x16, "adobe.utils", "MMEndCommand", 0, &voidclass, 0, 0}; static classinfo_t flash_display_GradientType = {0x03, 0x00, 0x81, 0x16, "flash.display", "GradientType", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_GradientType_LINEAR = {0x01, 0x00, 0x82, 0x16, "", "LINEAR", 0, &_String, &flash_display_GradientType, 0}; static varinfo_t flash_display_GradientType_RADIAL = {0x01, 0x00, 0x82, 0x16, "", "RADIAL", 0, &_String, &flash_display_GradientType, 0}; @@ -3230,18 +4157,18 @@ static methodinfo_t flash_text_engine_GroupElement_mergeTextElements = {0x02, 0x00, 0x80, 0x16, "", "mergeTextElements", 0, &flash_text_engine_TextElement, &flash_text_engine_GroupElement, 0}; static methodinfo_t flash_text_engine_GroupElement_getElementAtCharIndex = {0x02, 0x00, 0x80, 0x16, "", "getElementAtCharIndex", 0, &flash_text_engine_ContentElement, &flash_text_engine_GroupElement, 0}; static varinfo_t flash_text_engine_GroupElement_elementCount = {0x01, 0x00, 0x80, 0x16, "", "elementCount", 0, &_int, &flash_text_engine_GroupElement, 0}; -static methodinfo_t flash_text_engine_GroupElement_setElements = {0x02, 0x00, 0x80, 0x16, "", "setElements", 0, 0, &flash_text_engine_GroupElement, 0}; +static methodinfo_t flash_text_engine_GroupElement_setElements = {0x02, 0x00, 0x80, 0x16, "", "setElements", 0, &voidclass, &flash_text_engine_GroupElement, 0}; static methodinfo_t flash_text_engine_GroupElement_getElementAt = {0x02, 0x00, 0x80, 0x16, "", "getElementAt", 0, &flash_text_engine_ContentElement, &flash_text_engine_GroupElement, 0}; -static methodinfo_t flash_text_engine_GroupElement_ungroupElements = {0x02, 0x00, 0x80, 0x16, "", "ungroupElements", 0, 0, &flash_text_engine_GroupElement, 0}; +static methodinfo_t flash_text_engine_GroupElement_ungroupElements = {0x02, 0x00, 0x80, 0x16, "", "ungroupElements", 0, &voidclass, &flash_text_engine_GroupElement, 0}; static methodinfo_t flash_text_engine_GroupElement_replaceElements = {0x02, 0x00, 0x80, 0x16, "", "replaceElements", 0, &__AS3___vec_Vector, &flash_text_engine_GroupElement, 0}; static methodinfo_t flash_text_engine_GroupElement_getElementIndex = {0x02, 0x00, 0x80, 0x16, "", "getElementIndex", 0, &_int, &flash_text_engine_GroupElement, 0}; static methodinfo_t _parseInt = {0x02, 0x00, 0x82, 0x16, "", "parseInt", 0, &_Number, 0, 0}; static classinfo_t _QName = {0x03, 0x00, 0x81, 0x16, "", "QName", 0, &_Object, interfaces: {0}}; static varinfo_t _QName_localName = {0x01, 0x00, 0x80, 0x16, "", "localName", 0, &_String, &_QName, 0}; static methodinfo_t _QName_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_QName, &_QName, 0}; -static varinfo_t _QName_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, 0, &_QName, 0}; static methodinfo_t _QName_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_QName, 0}; static varinfo_t _QName_uri = {0x01, 0x00, 0x80, 0x16, "", "uri", 0, 0, &_QName, 0}; +static varinfo_t _QName_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, 0, &_QName, 0}; static classinfo_t _UninitializedError = {0x03, 0x00, 0x88, 0x16, "", "UninitializedError", 0, &_Error, interfaces: {0}}; static varinfo_t _UninitializedError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_UninitializedError, 0}; static classinfo_t _Date = {0x03, 0x00, 0x89, 0x16, "", "Date", 0, &_Object, interfaces: {0}}; @@ -3263,10 +4190,8 @@ static varinfo_t _Date_minutes = {0x01, 0x00, 0x80, 0x16, "", "minutes", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_setUTCHours = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setUTCHours", 0, &_Number, &_Date, 0}; static varinfo_t _Date_minutesUTC = {0x01, 0x00, 0x80, 0x16, "", "minutesUTC", 0, &_Number, &_Date, 0}; -static varinfo_t _Date_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Date, 0}; static methodinfo_t _Date_toLocaleTimeString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toLocaleTimeString", 0, &_String, &_Date, 0}; static varinfo_t _Date_fullYearUTC = {0x01, 0x00, 0x80, 0x16, "", "fullYearUTC", 0, &_Number, &_Date, 0}; -static methodinfo_t _Date_UTC = {0x02, 0x00, 0x82, 0x16, "", "UTC", 0, &_Number, &_Date, 0}; static varinfo_t _Date_time = {0x01, 0x00, 0x80, 0x16, "", "time", 0, &_Number, &_Date, 0}; static varinfo_t _Date_monthUTC = {0x01, 0x00, 0x80, 0x16, "", "monthUTC", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_getUTCMilliseconds = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "getUTCMilliseconds", 0, &_Number, &_Date, 0}; @@ -3292,7 +4217,6 @@ static methodinfo_t _Date_setFullYear = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setFullYear", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_setHours = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setHours", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_setMonth = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setMonth", 0, &_Number, &_Date, 0}; -static methodinfo_t _Date_parse = {0x02, 0x00, 0x82, 0x16, "", "parse", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_getUTCSeconds = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "getUTCSeconds", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_getMinutes = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "getMinutes", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_toLocaleString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toLocaleString", 0, &_String, &_Date, 0}; @@ -3307,13 +4231,16 @@ static methodinfo_t _Date_toTimeString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toTimeString", 0, &_String, &_Date, 0}; static methodinfo_t _Date_setMilliseconds = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setMilliseconds", 0, &_Number, &_Date, 0}; static methodinfo_t _Date_getUTCHours = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "getUTCHours", 0, &_Number, &_Date, 0}; +static varinfo_t _Date_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Date, 0}; +static methodinfo_t _Date_UTC = {0x02, 0x00, 0x82, 0x16, "", "UTC", 0, &_Number, &_Date, 0}; +static methodinfo_t _Date_parse = {0x02, 0x00, 0x82, 0x16, "", "parse", 0, &_Number, &_Date, 0}; static classinfo_t flash_text_StyleSheet = {0x03, 0x00, 0x88, 0x16, "flash.text", "StyleSheet", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_text_StyleSheet_styleNames = {0x01, 0x00, 0x80, 0x16, "", "styleNames", 0, &_Array, &flash_text_StyleSheet, 0}; -static methodinfo_t flash_text_StyleSheet_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, 0, &flash_text_StyleSheet, 0}; +static methodinfo_t flash_text_StyleSheet_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, &voidclass, &flash_text_StyleSheet, 0}; static methodinfo_t flash_text_StyleSheet_transform = {0x02, 0x00, 0x80, 0x16, "", "transform", 0, &flash_text_TextFormat, &flash_text_StyleSheet, 0}; static methodinfo_t flash_text_StyleSheet_getStyle = {0x02, 0x00, 0x80, 0x16, "", "getStyle", 0, &_Object, &flash_text_StyleSheet, 0}; -static methodinfo_t flash_text_StyleSheet_parseCSS = {0x02, 0x00, 0x80, 0x16, "", "parseCSS", 0, 0, &flash_text_StyleSheet, 0}; -static methodinfo_t flash_text_StyleSheet_setStyle = {0x02, 0x00, 0x80, 0x16, "", "setStyle", 0, 0, &flash_text_StyleSheet, 0}; +static methodinfo_t flash_text_StyleSheet_parseCSS = {0x02, 0x00, 0x80, 0x16, "", "parseCSS", 0, &voidclass, &flash_text_StyleSheet, 0}; +static methodinfo_t flash_text_StyleSheet_setStyle = {0x02, 0x00, 0x80, 0x16, "", "setStyle", 0, &voidclass, &flash_text_StyleSheet, 0}; static classinfo_t flash_display_ActionScriptVersion = {0x03, 0x00, 0x81, 0x16, "flash.display", "ActionScriptVersion", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_ActionScriptVersion_ACTIONSCRIPT3 = {0x01, 0x00, 0x82, 0x16, "", "ACTIONSCRIPT3", 0, &_uint, &flash_display_ActionScriptVersion, 0}; static varinfo_t flash_display_ActionScriptVersion_ACTIONSCRIPT2 = {0x01, 0x00, 0x82, 0x16, "", "ACTIONSCRIPT2", 0, &_uint, &flash_display_ActionScriptVersion, 0}; @@ -3329,7 +4256,6 @@ static methodinfo_t _String_substr = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "substr", 0, &_String, &_String, 0}; static methodinfo_t _String_slice = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "slice", 0, &_String, &_String, 0}; static methodinfo_t _String_search = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "search", 0, &_int, &_String, 0}; -static methodinfo_t _String_fromCharCode = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "fromCharCode", 0, &_String, &_String, 0}; static methodinfo_t _String_toLocaleUpperCase = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toLocaleUpperCase", 0, &_String, &_String, 0}; static methodinfo_t _String_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_String, 0}; static methodinfo_t _String_toUpperCase = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toUpperCase", 0, &_String, &_String, 0}; @@ -3342,33 +4268,34 @@ static methodinfo_t _String_toLocaleLowerCase = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toLocaleLowerCase", 0, &_String, &_String, 0}; static varinfo_t _String_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_int, &_String, 0}; static methodinfo_t _String_toLowerCase = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toLowerCase", 0, &_String, &_String, 0}; +static methodinfo_t _String_fromCharCode = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "fromCharCode", 0, &_String, &_String, 0}; static classinfo_t flash_media_SoundChannel = {0x03, 0x00, 0x81, 0x16, "flash.media", "SoundChannel", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_media_SoundChannel_leftPeak = {0x01, 0x00, 0x80, 0x16, "", "leftPeak", 0, &_Number, &flash_media_SoundChannel, 0}; -static methodinfo_t flash_media_SoundChannel_stop = {0x02, 0x00, 0x80, 0x16, "", "stop", 0, 0, &flash_media_SoundChannel, 0}; +static methodinfo_t flash_media_SoundChannel_stop = {0x02, 0x00, 0x80, 0x16, "", "stop", 0, &voidclass, &flash_media_SoundChannel, 0}; static varinfo_t flash_media_SoundChannel_position = {0x01, 0x00, 0x80, 0x16, "", "position", 0, &_Number, &flash_media_SoundChannel, 0}; static varinfo_t flash_media_SoundChannel_soundTransform = {0x01, 0x00, 0x80, 0x16, "", "soundTransform", 0, &flash_media_SoundTransform, &flash_media_SoundChannel, 0}; static varinfo_t flash_media_SoundChannel_rightPeak = {0x01, 0x00, 0x80, 0x16, "", "rightPeak", 0, &_Number, &flash_media_SoundChannel, 0}; static classinfo_t flash_desktop_Clipboard = {0x03, 0x00, 0x80, 0x16, "flash.desktop", "Clipboard", 0, &_Object, interfaces: {0}}; -static varinfo_t flash_desktop_Clipboard_generalClipboard = {0x01, 0x00, 0x82, 0x16, "", "generalClipboard", 0, &flash_desktop_Clipboard, &flash_desktop_Clipboard, 0}; static methodinfo_t flash_desktop_Clipboard_setDataHandler = {0x02, 0x00, 0x80, 0x16, "", "setDataHandler", 0, &_Boolean, &flash_desktop_Clipboard, 0}; static methodinfo_t flash_desktop_Clipboard_setData = {0x02, 0x00, 0x80, 0x16, "", "setData", 0, &_Boolean, &flash_desktop_Clipboard, 0}; static varinfo_t flash_desktop_Clipboard_formats = {0x01, 0x00, 0x80, 0x16, "", "formats", 0, &_Array, &flash_desktop_Clipboard, 0}; -static methodinfo_t flash_desktop_Clipboard_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, 0, &flash_desktop_Clipboard, 0}; +static methodinfo_t flash_desktop_Clipboard_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, &voidclass, &flash_desktop_Clipboard, 0}; static methodinfo_t flash_desktop_Clipboard_getData = {0x02, 0x00, 0x80, 0x16, "", "getData", 0, &_Object, &flash_desktop_Clipboard, 0}; static methodinfo_t flash_desktop_Clipboard_hasFormat = {0x02, 0x00, 0x80, 0x16, "", "hasFormat", 0, &_Boolean, &flash_desktop_Clipboard, 0}; -static methodinfo_t flash_desktop_Clipboard_clearData = {0x02, 0x00, 0x80, 0x16, "", "clearData", 0, 0, &flash_desktop_Clipboard, 0}; +static methodinfo_t flash_desktop_Clipboard_clearData = {0x02, 0x00, 0x80, 0x16, "", "clearData", 0, &voidclass, &flash_desktop_Clipboard, 0}; +static varinfo_t flash_desktop_Clipboard_generalClipboard = {0x01, 0x00, 0x82, 0x16, "", "generalClipboard", 0, &flash_desktop_Clipboard, &flash_desktop_Clipboard, 0}; static classinfo_t flash_display_IBitmapDrawable = {0x03, 0x00, 0x90, 0x16, "flash.display", "IBitmapDrawable", 0, 0, interfaces: {0}}; static classinfo_t _TypeError = {0x03, 0x00, 0x88, 0x16, "", "TypeError", 0, &_Error, interfaces: {0}}; static varinfo_t _TypeError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_TypeError, 0}; static classinfo_t _int = {0x03, 0x00, 0x81, 0x16, "", "int", 0, &_Object, interfaces: {0}}; -static varinfo_t _int_MAX_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MAX_VALUE", 0, &_int, &_int, 0}; static methodinfo_t _int_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_int, &_int, 0}; -static varinfo_t _int_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_int, 0}; -static varinfo_t _int_MIN_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MIN_VALUE", 0, &_int, &_int, 0}; static methodinfo_t _int_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_int, 0}; static methodinfo_t _int_toExponential = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toExponential", 0, &_String, &_int, 0}; static methodinfo_t _int_toFixed = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toFixed", 0, &_String, &_int, 0}; static methodinfo_t _int_toPrecision = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toPrecision", 0, &_String, &_int, 0}; +static varinfo_t _int_MAX_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MAX_VALUE", 0, &_int, &_int, 0}; +static varinfo_t _int_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_int, 0}; +static varinfo_t _int_MIN_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MIN_VALUE", 0, &_int, &_int, 0}; static classinfo_t flash_display_Scene = {0x03, 0x00, 0x81, 0x16, "flash.display", "Scene", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_Scene_numFrames = {0x01, 0x00, 0x80, 0x16, "", "numFrames", 0, &_int, &flash_display_Scene, 0}; static varinfo_t flash_display_Scene_labels = {0x01, 0x00, 0x80, 0x16, "", "labels", 0, &_Array, &flash_display_Scene, 0}; @@ -3384,8 +4311,8 @@ static varinfo_t flash_text_engine_FontMetrics_subscriptOffset = {0x01, 0x00, 0x80, 0x16, "", "subscriptOffset", 0, &_Number, &flash_text_engine_FontMetrics, 0}; static varinfo_t flash_text_engine_FontMetrics_underlineOffset = {0x01, 0x00, 0x80, 0x16, "", "underlineOffset", 0, &_Number, &flash_text_engine_FontMetrics, 0}; static classinfo_t flash_utils_IExternalizable = {0x03, 0x00, 0x90, 0x16, "flash.utils", "IExternalizable", 0, 0, interfaces: {0}}; -static methodinfo_t flash_utils_IExternalizable_readExternal = {0x02, 0x00, 0x80, 0x08, "flash.utils:IExternalizable", "readExternal", 0, 0, &flash_utils_IExternalizable, 0}; -static methodinfo_t flash_utils_IExternalizable_writeExternal = {0x02, 0x00, 0x80, 0x08, "flash.utils:IExternalizable", "writeExternal", 0, 0, &flash_utils_IExternalizable, 0}; +static methodinfo_t flash_utils_IExternalizable_readExternal = {0x02, 0x00, 0x80, 0x08, "flash.utils:IExternalizable", "readExternal", 0, &voidclass, &flash_utils_IExternalizable, 0}; +static methodinfo_t flash_utils_IExternalizable_writeExternal = {0x02, 0x00, 0x80, 0x08, "flash.utils:IExternalizable", "writeExternal", 0, &voidclass, &flash_utils_IExternalizable, 0}; static classinfo_t __AS3___vec_Vector = {0x03, 0x00, 0x89, 0x16, "__AS3__.vec", "Vector", 0, &_Object, interfaces: {0}}; static classinfo_t flash_filters_GradientBevelFilter = {0x03, 0x00, 0x81, 0x16, "flash.filters", "GradientBevelFilter", 0, &flash_filters_BitmapFilter, interfaces: {0}}; static varinfo_t flash_filters_GradientBevelFilter_strength = {0x01, 0x00, 0x80, 0x16, "", "strength", 0, &_Number, &flash_filters_GradientBevelFilter, 0}; @@ -3411,14 +4338,13 @@ static classinfo_t flash_net_URLRequestHeader = {0x03, 0x00, 0x81, 0x16, "flash.net", "URLRequestHeader", 0, &_Object, interfaces: {0}}; static varinfo_t flash_net_URLRequestHeader_value = {0x01, 0x00, 0x80, 0x16, "", "value", 0, &_String, &flash_net_URLRequestHeader, 0}; static varinfo_t flash_net_URLRequestHeader_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, &_String, &flash_net_URLRequestHeader, 0}; -static methodinfo_t flash_profiler_showRedrawRegions = {0x02, 0x00, 0x82, 0x16, "flash.profiler", "showRedrawRegions", 0, 0, 0, 0}; +static methodinfo_t flash_profiler_showRedrawRegions = {0x02, 0x00, 0x82, 0x16, "flash.profiler", "showRedrawRegions", 0, &voidclass, 0, 0}; static classinfo_t flash_display_ShaderData = {0x03, 0x00, 0x89, 0x16, "flash.display", "ShaderData", 0, &_Object, interfaces: {0}}; static classinfo_t flash_text_engine_TextLine = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "TextLine", 0, &flash_display_DisplayObjectContainer, interfaces: {0}}; static varinfo_t flash_text_engine_TextLine_previousLine = {0x01, 0x00, 0x80, 0x16, "", "previousLine", 0, &flash_text_engine_TextLine, &flash_text_engine_TextLine, 0}; static varinfo_t flash_text_engine_TextLine_validity = {0x01, 0x00, 0x80, 0x16, "", "validity", 0, &_String, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomTextBlockBeginIndex = {0x02, 0x00, 0x80, 0x16, "", "getAtomTextBlockBeginIndex", 0, &_int, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomWordBoundaryOnLeft = {0x02, 0x00, 0x80, 0x16, "", "getAtomWordBoundaryOnLeft", 0, &_Boolean, &flash_text_engine_TextLine, 0}; -static varinfo_t flash_text_engine_TextLine_MAX_LINE_WIDTH = {0x01, 0x00, 0x82, 0x16, "", "MAX_LINE_WIDTH", 0, &_int, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomTextRotation = {0x02, 0x00, 0x80, 0x16, "", "getAtomTextRotation", 0, &_String, &flash_text_engine_TextLine, 0}; static varinfo_t flash_text_engine_TextLine_textHeight = {0x01, 0x00, 0x80, 0x16, "", "textHeight", 0, &_Number, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomCenter = {0x02, 0x00, 0x80, 0x16, "", "getAtomCenter", 0, &_Number, &flash_text_engine_TextLine, 0}; @@ -3436,7 +4362,7 @@ static methodinfo_t flash_text_engine_TextLine_getMirrorRegion = {0x02, 0x00, 0x80, 0x16, "", "getMirrorRegion", 0, &flash_text_engine_TextLineMirrorRegion, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomGraphic = {0x02, 0x00, 0x80, 0x16, "", "getAtomGraphic", 0, &flash_display_DisplayObject, &flash_text_engine_TextLine, 0}; static varinfo_t flash_text_engine_TextLine_hasGraphicElement = {0x01, 0x00, 0x80, 0x16, "", "hasGraphicElement", 0, &_Boolean, &flash_text_engine_TextLine, 0}; -static methodinfo_t flash_text_engine_TextLine_flushAtomData = {0x02, 0x00, 0x80, 0x16, "", "flushAtomData", 0, 0, &flash_text_engine_TextLine, 0}; +static methodinfo_t flash_text_engine_TextLine_flushAtomData = {0x02, 0x00, 0x80, 0x16, "", "flushAtomData", 0, &voidclass, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_dump = {0x02, 0x00, 0x80, 0x16, "", "dump", 0, &_String, &flash_text_engine_TextLine, 0}; static varinfo_t flash_text_engine_TextLine_nextLine = {0x01, 0x00, 0x80, 0x16, "", "nextLine", 0, &flash_text_engine_TextLine, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomIndexAtCharIndex = {0x02, 0x00, 0x80, 0x16, "", "getAtomIndexAtCharIndex", 0, &_int, &flash_text_engine_TextLine, 0}; @@ -3445,6 +4371,7 @@ static varinfo_t flash_text_engine_TextLine_descent = {0x01, 0x00, 0x80, 0x16, "", "descent", 0, &_Number, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomBidiLevel = {0x02, 0x00, 0x80, 0x16, "", "getAtomBidiLevel", 0, &_int, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_text_engine_TextLine_getAtomIndexAtPoint = {0x02, 0x00, 0x80, 0x16, "", "getAtomIndexAtPoint", 0, &_int, &flash_text_engine_TextLine, 0}; +static varinfo_t flash_text_engine_TextLine_MAX_LINE_WIDTH = {0x01, 0x00, 0x82, 0x16, "", "MAX_LINE_WIDTH", 0, &_int, &flash_text_engine_TextLine, 0}; static methodinfo_t flash_sampler_getSamples = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "getSamples", 0, &_Object, 0, 0}; static classinfo_t flash_net_URLRequest = {0x03, 0x00, 0x81, 0x16, "flash.net", "URLRequest", 0, &_Object, interfaces: {0}}; static varinfo_t flash_net_URLRequest_contentType = {0x01, 0x00, 0x80, 0x16, "", "contentType", 0, &_String, &flash_net_URLRequest, 0}; @@ -3474,7 +4401,7 @@ static varinfo_t flash_utils_IDataInput_objectEncoding = {0x01, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "objectEncoding", 0, &_uint, &flash_utils_IDataInput, 0}; static methodinfo_t flash_utils_IDataInput_readUnsignedInt = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readUnsignedInt", 0, &_uint, &flash_utils_IDataInput, 0}; static methodinfo_t flash_utils_IDataInput_readDouble = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readDouble", 0, &_Number, &flash_utils_IDataInput, 0}; -static methodinfo_t flash_utils_IDataInput_readBytes = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readBytes", 0, 0, &flash_utils_IDataInput, 0}; +static methodinfo_t flash_utils_IDataInput_readBytes = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readBytes", 0, &voidclass, &flash_utils_IDataInput, 0}; static methodinfo_t flash_utils_IDataInput_readUnsignedByte = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readUnsignedByte", 0, &_uint, &flash_utils_IDataInput, 0}; static methodinfo_t flash_utils_IDataInput_readMultiByte = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readMultiByte", 0, &_String, &flash_utils_IDataInput, 0}; static methodinfo_t flash_utils_IDataInput_readInt = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readInt", 0, &_int, &flash_utils_IDataInput, 0}; @@ -3486,19 +4413,19 @@ static methodinfo_t flash_utils_IDataInput_readBoolean = {0x02, 0x00, 0x80, 0x08, "flash.utils:IDataInput", "readBoolean", 0, &_Boolean, &flash_utils_IDataInput, 0}; static classinfo_t flash_events_IEventDispatcher = {0x03, 0x00, 0x90, 0x16, "flash.events", "IEventDispatcher", 0, 0, interfaces: {0}}; static methodinfo_t flash_events_IEventDispatcher_willTrigger = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "willTrigger", 0, &_Boolean, &flash_events_IEventDispatcher, 0}; -static methodinfo_t flash_events_IEventDispatcher_removeEventListener = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "removeEventListener", 0, 0, &flash_events_IEventDispatcher, 0}; +static methodinfo_t flash_events_IEventDispatcher_removeEventListener = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "removeEventListener", 0, &voidclass, &flash_events_IEventDispatcher, 0}; static methodinfo_t flash_events_IEventDispatcher_hasEventListener = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "hasEventListener", 0, &_Boolean, &flash_events_IEventDispatcher, 0}; -static methodinfo_t flash_events_IEventDispatcher_addEventListener = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "addEventListener", 0, 0, &flash_events_IEventDispatcher, 0}; +static methodinfo_t flash_events_IEventDispatcher_addEventListener = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "addEventListener", 0, &voidclass, &flash_events_IEventDispatcher, 0}; static methodinfo_t flash_events_IEventDispatcher_dispatchEvent = {0x02, 0x00, 0x80, 0x08, "flash.events:IEventDispatcher", "dispatchEvent", 0, &_Boolean, &flash_events_IEventDispatcher, 0}; static classinfo_t _Class = {0x03, 0x00, 0x88, 0x16, "", "Class", 0, &_Object, interfaces: {0}}; -static varinfo_t _Class_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Class, 0}; static varinfo_t _Class_prototype = {0x01, 0x00, 0x80, 0x16, "", "prototype", 0, 0, &_Class, 0}; +static varinfo_t _Class_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Class, 0}; static classinfo_t flash_geom_Rectangle = {0x03, 0x00, 0x80, 0x16, "flash.geom", "Rectangle", 0, &_Object, interfaces: {0}}; static varinfo_t flash_geom_Rectangle_top = {0x01, 0x00, 0x80, 0x16, "", "top", 0, &_Number, &flash_geom_Rectangle, 0}; static methodinfo_t flash_geom_Rectangle_intersection = {0x02, 0x00, 0x80, 0x16, "", "intersection", 0, &flash_geom_Rectangle, &flash_geom_Rectangle, 0}; static methodinfo_t flash_geom_Rectangle_intersects = {0x02, 0x00, 0x80, 0x16, "", "intersects", 0, &_Boolean, &flash_geom_Rectangle, 0}; static methodinfo_t flash_geom_Rectangle_containsPoint = {0x02, 0x00, 0x80, 0x16, "", "containsPoint", 0, &_Boolean, &flash_geom_Rectangle, 0}; -static methodinfo_t flash_geom_Rectangle_setEmpty = {0x02, 0x00, 0x80, 0x16, "", "setEmpty", 0, 0, &flash_geom_Rectangle, 0}; +static methodinfo_t flash_geom_Rectangle_setEmpty = {0x02, 0x00, 0x80, 0x16, "", "setEmpty", 0, &voidclass, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_topLeft = {0x01, 0x00, 0x80, 0x16, "", "topLeft", 0, &flash_geom_Point, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_width = {0x01, 0x00, 0x80, 0x16, "", "width", 0, &_Number, &flash_geom_Rectangle, 0}; static methodinfo_t flash_geom_Rectangle_containsRect = {0x02, 0x00, 0x80, 0x16, "", "containsRect", 0, &_Boolean, &flash_geom_Rectangle, 0}; @@ -3506,10 +4433,10 @@ static methodinfo_t flash_geom_Rectangle_equals = {0x02, 0x00, 0x80, 0x16, "", "equals", 0, &_Boolean, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_height = {0x01, 0x00, 0x80, 0x16, "", "height", 0, &_Number, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_left = {0x01, 0x00, 0x80, 0x16, "", "left", 0, &_Number, &flash_geom_Rectangle, 0}; -static methodinfo_t flash_geom_Rectangle_inflate = {0x02, 0x00, 0x80, 0x16, "", "inflate", 0, 0, &flash_geom_Rectangle, 0}; -static methodinfo_t flash_geom_Rectangle_inflatePoint = {0x02, 0x00, 0x80, 0x16, "", "inflatePoint", 0, 0, &flash_geom_Rectangle, 0}; +static methodinfo_t flash_geom_Rectangle_inflate = {0x02, 0x00, 0x80, 0x16, "", "inflate", 0, &voidclass, &flash_geom_Rectangle, 0}; +static methodinfo_t flash_geom_Rectangle_inflatePoint = {0x02, 0x00, 0x80, 0x16, "", "inflatePoint", 0, &voidclass, &flash_geom_Rectangle, 0}; static methodinfo_t flash_geom_Rectangle_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_geom_Rectangle, 0}; -static methodinfo_t flash_geom_Rectangle_offsetPoint = {0x02, 0x00, 0x80, 0x16, "", "offsetPoint", 0, 0, &flash_geom_Rectangle, 0}; +static methodinfo_t flash_geom_Rectangle_offsetPoint = {0x02, 0x00, 0x80, 0x16, "", "offsetPoint", 0, &voidclass, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_x = {0x01, 0x00, 0x80, 0x16, "", "x", 0, &_Number, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_size = {0x01, 0x00, 0x80, 0x16, "", "size", 0, &flash_geom_Point, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_bottomRight = {0x01, 0x00, 0x80, 0x16, "", "bottomRight", 0, &flash_geom_Point, &flash_geom_Rectangle, 0}; @@ -3519,63 +4446,63 @@ static varinfo_t flash_geom_Rectangle_bottom = {0x01, 0x00, 0x80, 0x16, "", "bottom", 0, &_Number, &flash_geom_Rectangle, 0}; static methodinfo_t flash_geom_Rectangle_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_geom_Rectangle, &flash_geom_Rectangle, 0}; static varinfo_t flash_geom_Rectangle_y = {0x01, 0x00, 0x80, 0x16, "", "y", 0, &_Number, &flash_geom_Rectangle, 0}; -static methodinfo_t flash_geom_Rectangle_offset = {0x02, 0x00, 0x80, 0x16, "", "offset", 0, 0, &flash_geom_Rectangle, 0}; +static methodinfo_t flash_geom_Rectangle_offset = {0x02, 0x00, 0x80, 0x16, "", "offset", 0, &voidclass, &flash_geom_Rectangle, 0}; static classinfo_t flash_events_SecurityErrorEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "SecurityErrorEvent", 0, &flash_events_ErrorEvent, interfaces: {0}}; static methodinfo_t flash_events_SecurityErrorEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_SecurityErrorEvent, 0}; static methodinfo_t flash_events_SecurityErrorEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_SecurityErrorEvent, 0}; static varinfo_t flash_events_SecurityErrorEvent_SECURITY_ERROR = {0x01, 0x00, 0x82, 0x16, "", "SECURITY_ERROR", 0, &_String, &flash_events_SecurityErrorEvent, 0}; static classinfo_t flash_net_IDynamicPropertyWriter = {0x03, 0x00, 0x90, 0x16, "flash.net", "IDynamicPropertyWriter", 0, 0, interfaces: {0}}; -static methodinfo_t flash_net_IDynamicPropertyWriter_writeDynamicProperties = {0x02, 0x00, 0x80, 0x08, "flash.net:IDynamicPropertyWriter", "writeDynamicProperties", 0, 0, &flash_net_IDynamicPropertyWriter, 0}; +static methodinfo_t flash_net_IDynamicPropertyWriter_writeDynamicProperties = {0x02, 0x00, 0x80, 0x08, "flash.net:IDynamicPropertyWriter", "writeDynamicProperties", 0, &voidclass, &flash_net_IDynamicPropertyWriter, 0}; static classinfo_t flash_display_InterpolationMethod = {0x03, 0x00, 0x81, 0x16, "flash.display", "InterpolationMethod", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_InterpolationMethod_RGB = {0x01, 0x00, 0x82, 0x16, "", "RGB", 0, &_String, &flash_display_InterpolationMethod, 0}; static varinfo_t flash_display_InterpolationMethod_LINEAR_RGB = {0x01, 0x00, 0x82, 0x16, "", "LINEAR_RGB", 0, &_String, &flash_display_InterpolationMethod, 0}; static classinfo_t _Object = {0x03, 0x00, 0x88, 0x16, "", "Object", 0, 0, interfaces: {0}}; -static methodinfo_t _Object_init = {0x02, 0x00, 0x82, 0x17, "", "init", 0, 0, &_Object, 0}; static methodinfo_t _Object_propertyIsEnumerable = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "propertyIsEnumerable", 0, &_Boolean, &_Object, 0}; -static varinfo_t _Object_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Object, 0}; -static methodinfo_t _Object__setPropertyIsEnumerable = {0x02, 0x00, 0x82, 0x1a, "Object", "_setPropertyIsEnumerable", 0, 0, &_Object, 0}; static methodinfo_t _Object_isPrototypeOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "isPrototypeOf", 0, &_Boolean, &_Object, 0}; -static methodinfo_t _Object__dontEnumPrototype = {0x02, 0x00, 0x82, 0x1a, "Object", "_dontEnumPrototype", 0, 0, &_Object, 0}; static methodinfo_t _Object_hasOwnProperty = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasOwnProperty", 0, &_Boolean, &_Object, 0}; +static methodinfo_t _Object_init = {0x02, 0x00, 0x82, 0x17, "", "init", 0, 0, &_Object, 0}; +static varinfo_t _Object_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Object, 0}; +static methodinfo_t _Object__setPropertyIsEnumerable = {0x02, 0x00, 0x82, 0x1a, "", "_setPropertyIsEnumerable", 0, &voidclass, &_Object, 0}; +static methodinfo_t _Object__dontEnumPrototype = {0x02, 0x00, 0x82, 0x1a, "", "_dontEnumPrototype", 0, &voidclass, &_Object, 0}; static classinfo_t flash_errors_EOFError = {0x03, 0x00, 0x88, 0x16, "flash.errors", "EOFError", 0, &flash_errors_IOError, interfaces: {0}}; static classinfo_t flash_net_NetStream = {0x03, 0x00, 0x80, 0x16, "flash.net", "NetStream", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_net_NetStream_videoCodec = {0x01, 0x00, 0x80, 0x16, "", "videoCodec", 0, &_uint, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_info = {0x01, 0x00, 0x80, 0x16, "", "info", 0, &flash_net_NetStreamInfo, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_attachCamera = {0x02, 0x00, 0x80, 0x16, "", "attachCamera", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_attachCamera = {0x02, 0x00, 0x80, 0x16, "", "attachCamera", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_farNonce = {0x01, 0x00, 0x80, 0x16, "", "farNonce", 0, &_String, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_pause = {0x02, 0x00, 0x80, 0x16, "", "pause", 0, 0, &flash_net_NetStream, 0}; -static varinfo_t flash_net_NetStream_CONNECT_TO_FMS = {0x01, 0x00, 0x82, 0x16, "", "CONNECT_TO_FMS", 0, &_String, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_pause = {0x02, 0x00, 0x80, 0x16, "", "pause", 0, &voidclass, &flash_net_NetStream, 0}; static methodinfo_t flash_net_NetStream_onPeerConnect = {0x02, 0x00, 0x80, 0x16, "", "onPeerConnect", 0, &_Boolean, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_client = {0x01, 0x00, 0x80, 0x16, "", "client", 0, &_Object, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_resume = {0x02, 0x00, 0x80, 0x16, "", "resume", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_resume = {0x02, 0x00, 0x80, 0x16, "", "resume", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_liveDelay = {0x01, 0x00, 0x80, 0x16, "", "liveDelay", 0, &_Number, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_peerStreams = {0x01, 0x00, 0x80, 0x16, "", "peerStreams", 0, &_Array, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_objectEncoding = {0x01, 0x00, 0x80, 0x16, "", "objectEncoding", 0, &_uint, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_bytesLoaded = {0x01, 0x00, 0x80, 0x16, "", "bytesLoaded", 0, &_uint, &flash_net_NetStream, 0}; -static varinfo_t flash_net_NetStream_DIRECT_CONNECTIONS = {0x01, 0x00, 0x82, 0x16, "", "DIRECT_CONNECTIONS", 0, &_String, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_receiveVideo = {0x02, 0x00, 0x80, 0x16, "", "receiveVideo", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_receiveVideo = {0x02, 0x00, 0x80, 0x16, "", "receiveVideo", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_maxPauseBufferTime = {0x01, 0x00, 0x80, 0x16, "", "maxPauseBufferTime", 0, &_Number, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_play2 = {0x02, 0x00, 0x80, 0x16, "", "play2", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_play2 = {0x02, 0x00, 0x80, 0x16, "", "play2", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_audioCodec = {0x01, 0x00, 0x80, 0x16, "", "audioCodec", 0, &_uint, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_receiveVideoFPS = {0x02, 0x00, 0x80, 0x16, "", "receiveVideoFPS", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_receiveVideoFPS = {0x02, 0x00, 0x80, 0x16, "", "receiveVideoFPS", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_bytesTotal = {0x01, 0x00, 0x80, 0x16, "", "bytesTotal", 0, &_uint, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_farID = {0x01, 0x00, 0x80, 0x16, "", "farID", 0, &_String, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_receiveAudio = {0x02, 0x00, 0x80, 0x16, "", "receiveAudio", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_receiveAudio = {0x02, 0x00, 0x80, 0x16, "", "receiveAudio", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_bufferLength = {0x01, 0x00, 0x80, 0x16, "", "bufferLength", 0, &_Number, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_seek = {0x02, 0x00, 0x80, 0x16, "", "seek", 0, 0, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_attachAudio = {0x02, 0x00, 0x80, 0x16, "", "attachAudio", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_seek = {0x02, 0x00, 0x80, 0x16, "", "seek", 0, &voidclass, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_attachAudio = {0x02, 0x00, 0x80, 0x16, "", "attachAudio", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_bufferTime = {0x01, 0x00, 0x80, 0x16, "", "bufferTime", 0, &_Number, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_play = {0x02, 0x00, 0x80, 0x16, "", "play", 0, 0, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_publish = {0x02, 0x00, 0x80, 0x16, "", "publish", 0, 0, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_togglePause = {0x02, 0x00, 0x80, 0x16, "", "togglePause", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_play = {0x02, 0x00, 0x80, 0x16, "", "play", 0, &voidclass, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_publish = {0x02, 0x00, 0x80, 0x16, "", "publish", 0, &voidclass, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_togglePause = {0x02, 0x00, 0x80, 0x16, "", "togglePause", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_checkPolicyFile = {0x01, 0x00, 0x80, 0x16, "", "checkPolicyFile", 0, &_Boolean, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_nearNonce = {0x01, 0x00, 0x80, 0x16, "", "nearNonce", 0, &_String, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_decodedFrames = {0x01, 0x00, 0x80, 0x16, "", "decodedFrames", 0, &_uint, &flash_net_NetStream, 0}; -static methodinfo_t flash_net_NetStream_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, 0, &flash_net_NetStream, 0}; +static methodinfo_t flash_net_NetStream_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, &voidclass, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_currentFPS = {0x01, 0x00, 0x80, 0x16, "", "currentFPS", 0, &_Number, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_time = {0x01, 0x00, 0x80, 0x16, "", "time", 0, &_Number, &flash_net_NetStream, 0}; static varinfo_t flash_net_NetStream_soundTransform = {0x01, 0x00, 0x80, 0x16, "", "soundTransform", 0, &flash_media_SoundTransform, &flash_net_NetStream, 0}; +static varinfo_t flash_net_NetStream_CONNECT_TO_FMS = {0x01, 0x00, 0x82, 0x16, "", "CONNECT_TO_FMS", 0, &_String, &flash_net_NetStream, 0}; +static varinfo_t flash_net_NetStream_DIRECT_CONNECTIONS = {0x01, 0x00, 0x82, 0x16, "", "DIRECT_CONNECTIONS", 0, &_String, &flash_net_NetStream, 0}; static classinfo_t _ArgumentError = {0x03, 0x00, 0x88, 0x16, "", "ArgumentError", 0, &_Error, interfaces: {0}}; static varinfo_t _ArgumentError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_ArgumentError, 0}; static classinfo_t _XMLList = {0x03, 0x00, 0x89, 0x16, "", "XMLList", 0, &_Object, interfaces: {0}}; @@ -3588,8 +4515,8 @@ static methodinfo_t _XMLList_text = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "text", 0, &_XMLList, &_XMLList, 0}; static methodinfo_t _XMLList_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_XMLList, 0}; static methodinfo_t _XMLList_childIndex = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "childIndex", 0, &_int, &_XMLList, 0}; -static methodinfo_t _XMLList_setName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setName", 0, 0, &_XMLList, 0}; -static methodinfo_t _XMLList_setLocalName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setLocalName", 0, 0, &_XMLList, 0}; +static methodinfo_t _XMLList_setName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setName", 0, &voidclass, &_XMLList, 0}; +static methodinfo_t _XMLList_setLocalName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setLocalName", 0, &voidclass, &_XMLList, 0}; static methodinfo_t _XMLList_namespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "namespace", 0, 0, &_XMLList, 0}; static methodinfo_t _XMLList_insertChildBefore = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "insertChildBefore", 0, 0, &_XMLList, 0}; static methodinfo_t _XMLList_addNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "addNamespace", 0, &_XML, &_XMLList, 0}; @@ -3613,25 +4540,25 @@ static methodinfo_t _XMLList_localName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "localName", 0, &_Object, &_XMLList, 0}; static methodinfo_t _XMLList_inScopeNamespaces = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "inScopeNamespaces", 0, &_Array, &_XMLList, 0}; static methodinfo_t _XMLList_hasOwnProperty = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasOwnProperty", 0, &_Boolean, &_XMLList, 0}; -static methodinfo_t _XMLList_setNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setNamespace", 0, 0, &_XMLList, 0}; +static methodinfo_t _XMLList_setNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setNamespace", 0, &voidclass, &_XMLList, 0}; static methodinfo_t _XMLList_namespaceDeclarations = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "namespaceDeclarations", 0, &_Array, &_XMLList, 0}; static methodinfo_t _XMLList_name = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "name", 0, &_Object, &_XMLList, 0}; static methodinfo_t _XMLList_setChildren = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setChildren", 0, &_XML, &_XMLList, 0}; static methodinfo_t _XMLList_attribute = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "attribute", 0, &_XMLList, &_XMLList, 0}; static classinfo_t flash_geom_Point = {0x03, 0x00, 0x80, 0x16, "flash.geom", "Point", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_geom_Point_subtract = {0x02, 0x00, 0x80, 0x16, "", "subtract", 0, &flash_geom_Point, &flash_geom_Point, 0}; -static methodinfo_t flash_geom_Point_distance = {0x02, 0x00, 0x82, 0x16, "", "distance", 0, &_Number, &flash_geom_Point, 0}; -static methodinfo_t flash_geom_Point_normalize = {0x02, 0x00, 0x80, 0x16, "", "normalize", 0, 0, &flash_geom_Point, 0}; static methodinfo_t flash_geom_Point_equals = {0x02, 0x00, 0x80, 0x16, "", "equals", 0, &_Boolean, &flash_geom_Point, 0}; -static methodinfo_t flash_geom_Point_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_geom_Point, 0}; +static methodinfo_t flash_geom_Point_normalize = {0x02, 0x00, 0x80, 0x16, "", "normalize", 0, &voidclass, &flash_geom_Point, 0}; static varinfo_t flash_geom_Point_x = {0x01, 0x00, 0x80, 0x16, "", "x", 0, &_Number, &flash_geom_Point, 0}; +static methodinfo_t flash_geom_Point_offset = {0x02, 0x00, 0x80, 0x16, "", "offset", 0, &voidclass, &flash_geom_Point, 0}; +static methodinfo_t flash_geom_Point_subtract = {0x02, 0x00, 0x80, 0x16, "", "subtract", 0, &flash_geom_Point, &flash_geom_Point, 0}; +static varinfo_t flash_geom_Point_y = {0x01, 0x00, 0x80, 0x16, "", "y", 0, &_Number, &flash_geom_Point, 0}; +static varinfo_t flash_geom_Point_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_Number, &flash_geom_Point, 0}; static methodinfo_t flash_geom_Point_add = {0x02, 0x00, 0x80, 0x16, "", "add", 0, &flash_geom_Point, &flash_geom_Point, 0}; -static methodinfo_t flash_geom_Point_polar = {0x02, 0x00, 0x82, 0x16, "", "polar", 0, &flash_geom_Point, &flash_geom_Point, 0}; +static methodinfo_t flash_geom_Point_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_geom_Point, 0}; static methodinfo_t flash_geom_Point_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_geom_Point, &flash_geom_Point, 0}; +static methodinfo_t flash_geom_Point_polar = {0x02, 0x00, 0x82, 0x16, "", "polar", 0, &flash_geom_Point, &flash_geom_Point, 0}; +static methodinfo_t flash_geom_Point_distance = {0x02, 0x00, 0x82, 0x16, "", "distance", 0, &_Number, &flash_geom_Point, 0}; static methodinfo_t flash_geom_Point_interpolate = {0x02, 0x00, 0x82, 0x16, "", "interpolate", 0, &flash_geom_Point, &flash_geom_Point, 0}; -static varinfo_t flash_geom_Point_y = {0x01, 0x00, 0x80, 0x16, "", "y", 0, &_Number, &flash_geom_Point, 0}; -static varinfo_t flash_geom_Point_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_Number, &flash_geom_Point, 0}; -static methodinfo_t flash_geom_Point_offset = {0x02, 0x00, 0x80, 0x16, "", "offset", 0, 0, &flash_geom_Point, 0}; static classinfo_t flash_printing_PrintJobOptions = {0x03, 0x00, 0x80, 0x16, "flash.printing", "PrintJobOptions", 0, &_Object, interfaces: {0}}; static varinfo_t flash_printing_PrintJobOptions_printAsBitmap = {0x01, 0x00, 0x80, 0x16, "", "printAsBitmap", 0, &_Boolean, &flash_printing_PrintJobOptions, 0}; static classinfo_t flash_display_DisplayObject = {0x03, 0x00, 0x80, 0x16, "flash.display", "DisplayObject", 0, &flash_events_EventDispatcher, interfaces: {&flash_display_IBitmapDrawable, 0}}; @@ -3676,7 +4603,7 @@ static classinfo_t flash_sampler_DeleteObjectSample = {0x03, 0x00, 0x81, 0x16, "flash.sampler", "DeleteObjectSample", 0, &flash_sampler_Sample, interfaces: {0}}; static varinfo_t flash_sampler_DeleteObjectSample_size = {0x01, 0x00, 0x80, 0x16, "", "size", 0, &_Number, &flash_sampler_DeleteObjectSample, 0}; static varinfo_t flash_sampler_DeleteObjectSample_id = {0x01, 0x00, 0x80, 0x16, "", "id", 0, &_Number, &flash_sampler_DeleteObjectSample, 0}; -static methodinfo_t flash_system_fscommand = {0x02, 0x00, 0x82, 0x16, "flash.system", "fscommand", 0, 0, 0, 0}; +static methodinfo_t flash_system_fscommand = {0x02, 0x00, 0x82, 0x16, "flash.system", "fscommand", 0, &voidclass, 0, 0}; static methodinfo_t flash_utils_unescapeMultiByte = {0x02, 0x00, 0x82, 0x16, "flash.utils", "unescapeMultiByte", 0, &_String, 0, 0}; static classinfo_t flash_sampler_StackFrame = {0x03, 0x00, 0x81, 0x16, "flash.sampler", "StackFrame", 0, &_Object, interfaces: {0}}; static varinfo_t flash_sampler_StackFrame_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, &_String, &flash_sampler_StackFrame, 0}; @@ -3686,20 +4613,20 @@ static classinfo_t flash_system_JPEGLoaderContext = {0x03, 0x00, 0x80, 0x16, "flash.system", "JPEGLoaderContext", 0, &flash_system_LoaderContext, interfaces: {0}}; static varinfo_t flash_system_JPEGLoaderContext_deblockingFilter = {0x01, 0x00, 0x80, 0x16, "", "deblockingFilter", 0, &_Number, &flash_system_JPEGLoaderContext, 0}; static classinfo_t flash_system_IME = {0x03, 0x00, 0x81, 0x16, "flash.system", "IME", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_system_IME_setCompositionString = {0x02, 0x00, 0x82, 0x16, "", "setCompositionString", 0, 0, &flash_system_IME, 0}; +static methodinfo_t flash_system_IME_setCompositionString = {0x02, 0x00, 0x82, 0x16, "", "setCompositionString", 0, &voidclass, &flash_system_IME, 0}; static varinfo_t flash_system_IME_enabled = {0x01, 0x00, 0x82, 0x16, "", "enabled", 0, &_Boolean, &flash_system_IME, 0}; -static methodinfo_t flash_system_IME_doConversion = {0x02, 0x00, 0x82, 0x16, "", "doConversion", 0, 0, &flash_system_IME, 0}; +static methodinfo_t flash_system_IME_doConversion = {0x02, 0x00, 0x82, 0x16, "", "doConversion", 0, &voidclass, &flash_system_IME, 0}; static varinfo_t flash_system_IME_conversionMode = {0x01, 0x00, 0x82, 0x16, "", "conversionMode", 0, &_String, &flash_system_IME, 0}; static methodinfo_t _isNaN = {0x02, 0x00, 0x82, 0x16, "", "isNaN", 0, &_Boolean, 0, 0}; static classinfo_t flash_system_Security = {0x03, 0x00, 0x81, 0x16, "flash.system", "Security", 0, &_Object, interfaces: {0}}; static varinfo_t flash_system_Security_sandboxType = {0x01, 0x00, 0x82, 0x16, "", "sandboxType", 0, &_String, &flash_system_Security, 0}; static varinfo_t flash_system_Security_LOCAL_WITH_NETWORK = {0x01, 0x00, 0x82, 0x16, "", "LOCAL_WITH_NETWORK", 0, &_String, &flash_system_Security, 0}; -static methodinfo_t flash_system_Security_loadPolicyFile = {0x02, 0x00, 0x82, 0x16, "", "loadPolicyFile", 0, 0, &flash_system_Security, 0}; -static methodinfo_t flash_system_Security_allowDomain = {0x02, 0x00, 0x82, 0x16, "", "allowDomain", 0, 0, &flash_system_Security, 0}; -static methodinfo_t flash_system_Security_showSettings = {0x02, 0x00, 0x82, 0x16, "", "showSettings", 0, 0, &flash_system_Security, 0}; +static methodinfo_t flash_system_Security_loadPolicyFile = {0x02, 0x00, 0x82, 0x16, "", "loadPolicyFile", 0, &voidclass, &flash_system_Security, 0}; +static methodinfo_t flash_system_Security_allowDomain = {0x02, 0x00, 0x82, 0x16, "", "allowDomain", 0, &voidclass, &flash_system_Security, 0}; +static methodinfo_t flash_system_Security_showSettings = {0x02, 0x00, 0x82, 0x16, "", "showSettings", 0, &voidclass, &flash_system_Security, 0}; static varinfo_t flash_system_Security_LOCAL_TRUSTED = {0x01, 0x00, 0x82, 0x16, "", "LOCAL_TRUSTED", 0, &_String, &flash_system_Security, 0}; static varinfo_t flash_system_Security_disableAVM1Loading = {0x01, 0x00, 0x82, 0x16, "", "disableAVM1Loading", 0, &_Boolean, &flash_system_Security, 0}; -static methodinfo_t flash_system_Security_allowInsecureDomain = {0x02, 0x00, 0x82, 0x16, "", "allowInsecureDomain", 0, 0, &flash_system_Security, 0}; +static methodinfo_t flash_system_Security_allowInsecureDomain = {0x02, 0x00, 0x82, 0x16, "", "allowInsecureDomain", 0, &voidclass, &flash_system_Security, 0}; static varinfo_t flash_system_Security_exactSettings = {0x01, 0x00, 0x82, 0x16, "", "exactSettings", 0, &_Boolean, &flash_system_Security, 0}; static varinfo_t flash_system_Security_REMOTE = {0x01, 0x00, 0x82, 0x16, "", "REMOTE", 0, &_String, &flash_system_Security, 0}; static varinfo_t flash_system_Security_LOCAL_WITH_FILE = {0x01, 0x00, 0x82, 0x16, "", "LOCAL_WITH_FILE", 0, &_String, &flash_system_Security, 0}; @@ -3709,11 +4636,11 @@ static varinfo_t flash_display_Bitmap_smoothing = {0x01, 0x00, 0x80, 0x16, "", "smoothing", 0, &_Boolean, &flash_display_Bitmap, 0}; static classinfo_t flash_printing_PrintJob = {0x03, 0x00, 0x80, 0x16, "flash.printing", "PrintJob", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_printing_PrintJob_paperWidth = {0x01, 0x00, 0x80, 0x16, "", "paperWidth", 0, &_int, &flash_printing_PrintJob, 0}; -static methodinfo_t flash_printing_PrintJob_addPage = {0x02, 0x00, 0x80, 0x16, "", "addPage", 0, 0, &flash_printing_PrintJob, 0}; +static methodinfo_t flash_printing_PrintJob_addPage = {0x02, 0x00, 0x80, 0x16, "", "addPage", 0, &voidclass, &flash_printing_PrintJob, 0}; static varinfo_t flash_printing_PrintJob_pageHeight = {0x01, 0x00, 0x80, 0x16, "", "pageHeight", 0, &_int, &flash_printing_PrintJob, 0}; static methodinfo_t flash_printing_PrintJob_start = {0x02, 0x00, 0x80, 0x16, "", "start", 0, &_Boolean, &flash_printing_PrintJob, 0}; static varinfo_t flash_printing_PrintJob_pageWidth = {0x01, 0x00, 0x80, 0x16, "", "pageWidth", 0, &_int, &flash_printing_PrintJob, 0}; -static methodinfo_t flash_printing_PrintJob_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, 0, &flash_printing_PrintJob, 0}; +static methodinfo_t flash_printing_PrintJob_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, &voidclass, &flash_printing_PrintJob, 0}; static varinfo_t flash_printing_PrintJob_paperHeight = {0x01, 0x00, 0x80, 0x16, "", "paperHeight", 0, &_int, &flash_printing_PrintJob, 0}; static varinfo_t flash_printing_PrintJob_orientation = {0x01, 0x00, 0x80, 0x16, "", "orientation", 0, &_String, &flash_printing_PrintJob, 0}; static classinfo_t flash_text_StaticText = {0x03, 0x00, 0x81, 0x16, "flash.text", "StaticText", 0, &flash_display_DisplayObject, interfaces: {0}}; @@ -3723,10 +4650,10 @@ static varinfo_t flash_text_engine_SpaceJustifier_letterSpacing = {0x01, 0x00, 0x80, 0x16, "", "letterSpacing", 0, &_Boolean, &flash_text_engine_SpaceJustifier, 0}; static classinfo_t flash_events_DataEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "DataEvent", 0, &flash_events_TextEvent, interfaces: {0}}; static methodinfo_t flash_events_DataEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_DataEvent, 0}; -static varinfo_t flash_events_DataEvent_DATA = {0x01, 0x00, 0x82, 0x16, "", "DATA", 0, &_String, &flash_events_DataEvent, 0}; static methodinfo_t flash_events_DataEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_DataEvent, 0}; -static varinfo_t flash_events_DataEvent_UPLOAD_COMPLETE_DATA = {0x01, 0x00, 0x82, 0x16, "", "UPLOAD_COMPLETE_DATA", 0, &_String, &flash_events_DataEvent, 0}; static varinfo_t flash_events_DataEvent_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &_String, &flash_events_DataEvent, 0}; +static varinfo_t flash_events_DataEvent_DATA = {0x01, 0x00, 0x82, 0x16, "", "DATA", 0, &_String, &flash_events_DataEvent, 0}; +static varinfo_t flash_events_DataEvent_UPLOAD_COMPLETE_DATA = {0x01, 0x00, 0x82, 0x16, "", "UPLOAD_COMPLETE_DATA", 0, &_String, &flash_events_DataEvent, 0}; static classinfo_t flash_events_ActivityEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "ActivityEvent", 0, &flash_events_Event, interfaces: {0}}; static methodinfo_t flash_events_ActivityEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_ActivityEvent, 0}; static varinfo_t flash_events_ActivityEvent_activating = {0x01, 0x00, 0x80, 0x16, "", "activating", 0, &_Boolean, &flash_events_ActivityEvent, 0}; @@ -3738,11 +4665,11 @@ static varinfo_t flash_display_ColorCorrection_DEFAULT = {0x01, 0x00, 0x82, 0x16, "", "DEFAULT", 0, &_String, &flash_display_ColorCorrection, 0}; static varinfo_t flash_display_ColorCorrection_ON = {0x01, 0x00, 0x82, 0x16, "", "ON", 0, &_String, &flash_display_ColorCorrection, 0}; static classinfo_t flash_events_IOErrorEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "IOErrorEvent", 0, &flash_events_ErrorEvent, interfaces: {0}}; +static methodinfo_t flash_events_IOErrorEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_IOErrorEvent, 0}; +static methodinfo_t flash_events_IOErrorEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_IOErrorEvent, 0}; static varinfo_t flash_events_IOErrorEvent_IO_ERROR = {0x01, 0x00, 0x82, 0x16, "", "IO_ERROR", 0, &_String, &flash_events_IOErrorEvent, 0}; static varinfo_t flash_events_IOErrorEvent_VERIFY_ERROR = {0x01, 0x00, 0x82, 0x16, "", "VERIFY_ERROR", 0, &_String, &flash_events_IOErrorEvent, 0}; -static methodinfo_t flash_events_IOErrorEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_IOErrorEvent, 0}; static varinfo_t flash_events_IOErrorEvent_NETWORK_ERROR = {0x01, 0x00, 0x82, 0x16, "", "NETWORK_ERROR", 0, &_String, &flash_events_IOErrorEvent, 0}; -static methodinfo_t flash_events_IOErrorEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_IOErrorEvent, 0}; static varinfo_t flash_events_IOErrorEvent_DISK_ERROR = {0x01, 0x00, 0x82, 0x16, "", "DISK_ERROR", 0, &_String, &flash_events_IOErrorEvent, 0}; static classinfo_t flash_display_GraphicsStroke = {0x03, 0x00, 0x81, 0x16, "flash.display", "GraphicsStroke", 0, &_Object, interfaces: {&flash_display_IGraphicsStroke, &flash_display_IGraphicsData, 0}}; static varinfo_t flash_display_GraphicsStroke_scaleMode = {0x01, 0x00, 0x80, 0x16, "", "scaleMode", 0, &_String, &flash_display_GraphicsStroke, 0}; @@ -3754,8 +4681,8 @@ static varinfo_t flash_display_GraphicsStroke_caps = {0x01, 0x00, 0x80, 0x16, "", "caps", 0, &_String, &flash_display_GraphicsStroke, 0}; static classinfo_t _Boolean = {0x03, 0x00, 0x81, 0x16, "", "Boolean", 0, &_Object, interfaces: {0}}; static methodinfo_t _Boolean_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_Boolean, &_Boolean, 0}; -static varinfo_t _Boolean_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Boolean, 0}; static methodinfo_t _Boolean_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_Boolean, 0}; +static varinfo_t _Boolean_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Boolean, 0}; static methodinfo_t flash_sampler_getMemberNames = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "getMemberNames", 0, &_Object, 0, 0}; static methodinfo_t flash_utils_getQualifiedClassName = {0x02, 0x00, 0x82, 0x16, "flash.utils", "getQualifiedClassName", 0, &_String, 0, 0}; static classinfo_t flash_text_engine_GraphicElement = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "GraphicElement", 0, &flash_text_engine_ContentElement, interfaces: {0}}; @@ -3766,11 +4693,10 @@ static varinfo_t flash_media_Microphone_codec = {0x01, 0x00, 0x80, 0x16, "", "codec", 0, &_String, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_gain = {0x01, 0x00, 0x80, 0x16, "", "gain", 0, &_Number, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_index = {0x01, 0x00, 0x80, 0x16, "", "index", 0, &_int, &flash_media_Microphone, 0}; -static methodinfo_t flash_media_Microphone_setLoopBack = {0x02, 0x00, 0x80, 0x16, "", "setLoopBack", 0, 0, &flash_media_Microphone, 0}; -static methodinfo_t flash_media_Microphone_setSilenceLevel = {0x02, 0x00, 0x80, 0x16, "", "setSilenceLevel", 0, 0, &flash_media_Microphone, 0}; +static methodinfo_t flash_media_Microphone_setLoopBack = {0x02, 0x00, 0x80, 0x16, "", "setLoopBack", 0, &voidclass, &flash_media_Microphone, 0}; +static methodinfo_t flash_media_Microphone_setSilenceLevel = {0x02, 0x00, 0x80, 0x16, "", "setSilenceLevel", 0, &voidclass, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, &_String, &flash_media_Microphone, 0}; -static methodinfo_t flash_media_Microphone_getMicrophone = {0x02, 0x00, 0x82, 0x16, "", "getMicrophone", 0, &flash_media_Microphone, &flash_media_Microphone, 0}; -static methodinfo_t flash_media_Microphone_setUseEchoSuppression = {0x02, 0x00, 0x80, 0x16, "", "setUseEchoSuppression", 0, 0, &flash_media_Microphone, 0}; +static methodinfo_t flash_media_Microphone_setUseEchoSuppression = {0x02, 0x00, 0x80, 0x16, "", "setUseEchoSuppression", 0, &voidclass, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_framesPerPacket = {0x01, 0x00, 0x80, 0x16, "", "framesPerPacket", 0, &_int, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_muted = {0x01, 0x00, 0x80, 0x16, "", "muted", 0, &_Boolean, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_soundTransform = {0x01, 0x00, 0x80, 0x16, "", "soundTransform", 0, &flash_media_SoundTransform, &flash_media_Microphone, 0}; @@ -3781,6 +4707,7 @@ static varinfo_t flash_media_Microphone_rate = {0x01, 0x00, 0x80, 0x16, "", "rate", 0, &_int, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_activityLevel = {0x01, 0x00, 0x80, 0x16, "", "activityLevel", 0, &_Number, &flash_media_Microphone, 0}; static varinfo_t flash_media_Microphone_names = {0x01, 0x00, 0x82, 0x16, "", "names", 0, &_Array, &flash_media_Microphone, 0}; +static methodinfo_t flash_media_Microphone_getMicrophone = {0x02, 0x00, 0x82, 0x16, "", "getMicrophone", 0, &flash_media_Microphone, &flash_media_Microphone, 0}; static classinfo_t flash_ui_ContextMenuClipboardItems = {0x03, 0x00, 0x81, 0x16, "flash.ui", "ContextMenuClipboardItems", 0, &_Object, interfaces: {0}}; static varinfo_t flash_ui_ContextMenuClipboardItems_clear = {0x01, 0x00, 0x80, 0x16, "", "clear", 0, &_Boolean, &flash_ui_ContextMenuClipboardItems, 0}; static methodinfo_t flash_ui_ContextMenuClipboardItems_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_ui_ContextMenuClipboardItems, &flash_ui_ContextMenuClipboardItems, 0}; @@ -3810,8 +4737,8 @@ static varinfo_t flash_display_CapsStyle_SQUARE = {0x01, 0x00, 0x82, 0x16, "", "SQUARE", 0, &_String, &flash_display_CapsStyle, 0}; static varinfo_t flash_display_CapsStyle_NONE = {0x01, 0x00, 0x82, 0x16, "", "NONE", 0, &_String, &flash_display_CapsStyle, 0}; static classinfo_t flash_text_TextSnapshot = {0x03, 0x00, 0x80, 0x16, "flash.text", "TextSnapshot", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_text_TextSnapshot_setSelectColor = {0x02, 0x00, 0x80, 0x16, "", "setSelectColor", 0, 0, &flash_text_TextSnapshot, 0}; -static methodinfo_t flash_text_TextSnapshot_setSelected = {0x02, 0x00, 0x80, 0x16, "", "setSelected", 0, 0, &flash_text_TextSnapshot, 0}; +static methodinfo_t flash_text_TextSnapshot_setSelectColor = {0x02, 0x00, 0x80, 0x16, "", "setSelectColor", 0, &voidclass, &flash_text_TextSnapshot, 0}; +static methodinfo_t flash_text_TextSnapshot_setSelected = {0x02, 0x00, 0x80, 0x16, "", "setSelected", 0, &voidclass, &flash_text_TextSnapshot, 0}; static methodinfo_t flash_text_TextSnapshot_getSelectedText = {0x02, 0x00, 0x80, 0x16, "", "getSelectedText", 0, &_String, &flash_text_TextSnapshot, 0}; static methodinfo_t flash_text_TextSnapshot_getTextRunInfo = {0x02, 0x00, 0x80, 0x16, "", "getTextRunInfo", 0, &_Array, &flash_text_TextSnapshot, 0}; static varinfo_t flash_text_TextSnapshot_charCount = {0x01, 0x00, 0x80, 0x16, "", "charCount", 0, &_int, &flash_text_TextSnapshot, 0}; @@ -3831,24 +4758,23 @@ static varinfo_t flash_display_InteractiveObject_focusRect = {0x01, 0x00, 0x80, 0x16, "", "focusRect", 0, &_Object, &flash_display_InteractiveObject, 0}; static varinfo_t flash_display_InteractiveObject_accessibilityImplementation = {0x01, 0x00, 0x80, 0x16, "", "accessibilityImplementation", 0, &flash_accessibility_AccessibilityImplementation, &flash_display_InteractiveObject, 0}; static classinfo_t flash_text_TextField = {0x03, 0x00, 0x80, 0x16, "flash.text", "TextField", 0, &flash_display_InteractiveObject, interfaces: {0}}; -static methodinfo_t flash_text_TextField_isFontCompatible = {0x02, 0x00, 0x82, 0x16, "", "isFontCompatible", 0, &_Boolean, &flash_text_TextField, 0}; static methodinfo_t flash_text_TextField_getTextFormat = {0x02, 0x00, 0x80, 0x16, "", "getTextFormat", 0, &flash_text_TextFormat, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_border = {0x01, 0x00, 0x80, 0x16, "", "border", 0, &_Boolean, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_selectedText = {0x01, 0x00, 0x80, 0x16, "", "selectedText", 0, &_String, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_pasteRichText = {0x02, 0x00, 0x80, 0x17, "flash.text", "pasteRichText", 0, &_Boolean, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_pasteRichText = {0x02, 0x00, 0x80, 0x17, "", "pasteRichText", 0, &_Boolean, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_bottomScrollV = {0x01, 0x00, 0x80, 0x16, "", "bottomScrollV", 0, &_int, &flash_text_TextField, 0}; static methodinfo_t flash_text_TextField_getLineIndexOfChar = {0x02, 0x00, 0x80, 0x16, "", "getLineIndexOfChar", 0, &_int, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_replaceText = {0x02, 0x00, 0x80, 0x16, "", "replaceText", 0, 0, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_replaceText = {0x02, 0x00, 0x80, 0x16, "", "replaceText", 0, &voidclass, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_defaultTextFormat = {0x01, 0x00, 0x80, 0x16, "", "defaultTextFormat", 0, &flash_text_TextFormat, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_restrict = {0x01, 0x00, 0x80, 0x16, "", "restrict", 0, &_String, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_htmlText = {0x01, 0x00, 0x80, 0x16, "", "htmlText", 0, &_String, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_copyRichText = {0x02, 0x00, 0x80, 0x17, "flash.text", "copyRichText", 0, &_String, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_copyRichText = {0x02, 0x00, 0x80, 0x17, "", "copyRichText", 0, &_String, &flash_text_TextField, 0}; static methodinfo_t flash_text_TextField_getLineText = {0x02, 0x00, 0x80, 0x16, "", "getLineText", 0, &_String, &flash_text_TextField, 0}; static methodinfo_t flash_text_TextField_getFirstCharInParagraph = {0x02, 0x00, 0x80, 0x16, "", "getFirstCharInParagraph", 0, &_int, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_setSelection = {0x02, 0x00, 0x80, 0x16, "", "setSelection", 0, 0, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_setSelection = {0x02, 0x00, 0x80, 0x16, "", "setSelection", 0, &voidclass, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_int, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_wordWrap = {0x01, 0x00, 0x80, 0x16, "", "wordWrap", 0, &_Boolean, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_appendText = {0x02, 0x00, 0x80, 0x16, "", "appendText", 0, 0, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_appendText = {0x02, 0x00, 0x80, 0x16, "", "appendText", 0, &voidclass, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_caretIndex = {0x01, 0x00, 0x80, 0x16, "", "caretIndex", 0, &_int, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_mouseWheelEnabled = {0x01, 0x00, 0x80, 0x16, "", "mouseWheelEnabled", 0, &_Boolean, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_selectionBeginIndex = {0x01, 0x00, 0x80, 0x16, "", "selectionBeginIndex", 0, &_int, &flash_text_TextField, 0}; @@ -3875,7 +4801,7 @@ static varinfo_t flash_text_TextField_useRichTextClipboard = {0x01, 0x00, 0x80, 0x16, "", "useRichTextClipboard", 0, &_Boolean, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_scrollV = {0x01, 0x00, 0x80, 0x16, "", "scrollV", 0, &_int, &flash_text_TextField, 0}; static methodinfo_t flash_text_TextField_getTextRuns = {0x02, 0x00, 0x80, 0x16, "", "getTextRuns", 0, &_Array, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_setTextFormat = {0x02, 0x00, 0x80, 0x16, "", "setTextFormat", 0, 0, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_setTextFormat = {0x02, 0x00, 0x80, 0x16, "", "setTextFormat", 0, &voidclass, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_textColor = {0x01, 0x00, 0x80, 0x16, "", "textColor", 0, &_uint, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_maxScrollV = {0x01, 0x00, 0x80, 0x16, "", "maxScrollV", 0, &_int, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_embedFonts = {0x01, 0x00, 0x80, 0x16, "", "embedFonts", 0, &_Boolean, &flash_text_TextField, 0}; @@ -3886,14 +4812,15 @@ static varinfo_t flash_text_TextField_antiAliasType = {0x01, 0x00, 0x80, 0x16, "", "antiAliasType", 0, &_String, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_styleSheet = {0x01, 0x00, 0x80, 0x16, "", "styleSheet", 0, &flash_text_StyleSheet, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_background = {0x01, 0x00, 0x80, 0x16, "", "background", 0, &_Boolean, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_replaceSelectedText = {0x02, 0x00, 0x80, 0x16, "", "replaceSelectedText", 0, 0, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_replaceSelectedText = {0x02, 0x00, 0x80, 0x16, "", "replaceSelectedText", 0, &voidclass, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_borderColor = {0x01, 0x00, 0x80, 0x16, "", "borderColor", 0, &_uint, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_maxScrollH = {0x01, 0x00, 0x80, 0x16, "", "maxScrollH", 0, &_int, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_maxChars = {0x01, 0x00, 0x80, 0x16, "", "maxChars", 0, &_int, &flash_text_TextField, 0}; static methodinfo_t flash_text_TextField_getLineMetrics = {0x02, 0x00, 0x80, 0x16, "", "getLineMetrics", 0, &flash_text_TextLineMetrics, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_selectionEndIndex = {0x01, 0x00, 0x80, 0x16, "", "selectionEndIndex", 0, &_int, &flash_text_TextField, 0}; -static methodinfo_t flash_text_TextField_insertXMLText = {0x02, 0x00, 0x80, 0x16, "", "insertXMLText", 0, 0, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_insertXMLText = {0x02, 0x00, 0x80, 0x16, "", "insertXMLText", 0, &voidclass, &flash_text_TextField, 0}; static varinfo_t flash_text_TextField_condenseWhite = {0x01, 0x00, 0x80, 0x16, "", "condenseWhite", 0, &_Boolean, &flash_text_TextField, 0}; +static methodinfo_t flash_text_TextField_isFontCompatible = {0x02, 0x00, 0x82, 0x16, "", "isFontCompatible", 0, &_Boolean, &flash_text_TextField, 0}; static classinfo_t flash_printing_PrintJobOrientation = {0x03, 0x00, 0x81, 0x16, "flash.printing", "PrintJobOrientation", 0, &_Object, interfaces: {0}}; static varinfo_t flash_printing_PrintJobOrientation_LANDSCAPE = {0x01, 0x00, 0x82, 0x16, "", "LANDSCAPE", 0, &_String, &flash_printing_PrintJobOrientation, 0}; static varinfo_t flash_printing_PrintJobOrientation_PORTRAIT = {0x01, 0x00, 0x82, 0x16, "", "PORTRAIT", 0, &_String, &flash_printing_PrintJobOrientation, 0}; @@ -3901,27 +4828,27 @@ static varinfo_t flash_text_TextRenderer_displayMode = {0x01, 0x00, 0x82, 0x16, "", "displayMode", 0, &_String, &flash_text_TextRenderer, 0}; static varinfo_t flash_text_TextRenderer_antiAliasType = {0x01, 0x00, 0x82, 0x16, "", "antiAliasType", 0, &_String, &flash_text_TextRenderer, 0}; static varinfo_t flash_text_TextRenderer_maxLevel = {0x01, 0x00, 0x82, 0x16, "", "maxLevel", 0, &_int, &flash_text_TextRenderer, 0}; -static methodinfo_t flash_text_TextRenderer_setAdvancedAntiAliasingTable = {0x02, 0x00, 0x82, 0x16, "", "setAdvancedAntiAliasingTable", 0, 0, &flash_text_TextRenderer, 0}; +static methodinfo_t flash_text_TextRenderer_setAdvancedAntiAliasingTable = {0x02, 0x00, 0x82, 0x16, "", "setAdvancedAntiAliasingTable", 0, &voidclass, &flash_text_TextRenderer, 0}; static classinfo_t flash_net_NetConnection = {0x03, 0x00, 0x80, 0x16, "flash.net", "NetConnection", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static varinfo_t flash_net_NetConnection_defaultObjectEncoding = {0x01, 0x00, 0x82, 0x16, "", "defaultObjectEncoding", 0, &_uint, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_nearID = {0x01, 0x00, 0x80, 0x16, "", "nearID", 0, &_String, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_client = {0x01, 0x00, 0x80, 0x16, "", "client", 0, &_Object, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_farNonce = {0x01, 0x00, 0x80, 0x16, "", "farNonce", 0, &_String, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_objectEncoding = {0x01, 0x00, 0x80, 0x16, "", "objectEncoding", 0, &_uint, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_farID = {0x01, 0x00, 0x80, 0x16, "", "farID", 0, &_String, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_connected = {0x01, 0x00, 0x80, 0x16, "", "connected", 0, &_Boolean, &flash_net_NetConnection, 0}; -static methodinfo_t flash_net_NetConnection_call = {0x02, 0x00, 0x80, 0x16, "", "call", 0, 0, &flash_net_NetConnection, 0}; +static methodinfo_t flash_net_NetConnection_call = {0x02, 0x00, 0x80, 0x16, "", "call", 0, &voidclass, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_usingTLS = {0x01, 0x00, 0x80, 0x16, "", "usingTLS", 0, &_Boolean, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_proxyType = {0x01, 0x00, 0x80, 0x16, "", "proxyType", 0, &_String, &flash_net_NetConnection, 0}; -static methodinfo_t flash_net_NetConnection_addHeader = {0x02, 0x00, 0x80, 0x16, "", "addHeader", 0, 0, &flash_net_NetConnection, 0}; +static methodinfo_t flash_net_NetConnection_addHeader = {0x02, 0x00, 0x80, 0x16, "", "addHeader", 0, &voidclass, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_protocol = {0x01, 0x00, 0x80, 0x16, "", "protocol", 0, &_String, &flash_net_NetConnection, 0}; -static methodinfo_t flash_net_NetConnection_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_NetConnection, 0}; +static methodinfo_t flash_net_NetConnection_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_nearNonce = {0x01, 0x00, 0x80, 0x16, "", "nearNonce", 0, &_String, &flash_net_NetConnection, 0}; -static methodinfo_t flash_net_NetConnection_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, 0, &flash_net_NetConnection, 0}; +static methodinfo_t flash_net_NetConnection_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, &voidclass, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_unconnectedPeerStreams = {0x01, 0x00, 0x80, 0x16, "", "unconnectedPeerStreams", 0, &_Array, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_maxPeerConnections = {0x01, 0x00, 0x80, 0x16, "", "maxPeerConnections", 0, &_uint, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_connectedProxyType = {0x01, 0x00, 0x80, 0x16, "", "connectedProxyType", 0, &_String, &flash_net_NetConnection, 0}; static varinfo_t flash_net_NetConnection_uri = {0x01, 0x00, 0x80, 0x16, "", "uri", 0, &_String, &flash_net_NetConnection, 0}; +static varinfo_t flash_net_NetConnection_defaultObjectEncoding = {0x01, 0x00, 0x82, 0x16, "", "defaultObjectEncoding", 0, &_uint, &flash_net_NetConnection, 0}; static methodinfo_t _decodeURIComponent = {0x02, 0x00, 0x82, 0x16, "", "decodeURIComponent", 0, &_String, 0, 0}; static methodinfo_t flash_sampler_isGetterSetter = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "isGetterSetter", 0, &_Boolean, 0, 0}; static methodinfo_t flash_utils_getQualifiedSuperclassName = {0x02, 0x00, 0x82, 0x16, "flash.utils", "getQualifiedSuperclassName", 0, &_String, 0, 0}; @@ -3936,14 +4863,14 @@ static varinfo_t flash_text_engine_JustificationStyle_PUSH_OUT_ONLY = {0x01, 0x00, 0x82, 0x16, "", "PUSH_OUT_ONLY", 0, &_String, &flash_text_engine_JustificationStyle, 0}; static varinfo_t flash_text_engine_JustificationStyle_PRIORITIZE_LEAST_ADJUSTMENT = {0x01, 0x00, 0x82, 0x16, "", "PRIORITIZE_LEAST_ADJUSTMENT", 0, &_String, &flash_text_engine_JustificationStyle, 0}; static varinfo_t flash_text_engine_JustificationStyle_PUSH_IN_KINSOKU = {0x01, 0x00, 0x82, 0x16, "", "PUSH_IN_KINSOKU", 0, &_String, &flash_text_engine_JustificationStyle, 0}; -static methodinfo_t flash_sampler_startSampling = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "startSampling", 0, 0, 0, 0}; +static methodinfo_t flash_sampler_startSampling = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "startSampling", 0, &voidclass, 0, 0}; static classinfo_t flash_text_engine_TextRotation = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "TextRotation", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_engine_TextRotation_ROTATE_270 = {0x01, 0x00, 0x82, 0x16, "", "ROTATE_270", 0, &_String, &flash_text_engine_TextRotation, 0}; static varinfo_t flash_text_engine_TextRotation_AUTO = {0x01, 0x00, 0x82, 0x16, "", "AUTO", 0, &_String, &flash_text_engine_TextRotation, 0}; static varinfo_t flash_text_engine_TextRotation_ROTATE_0 = {0x01, 0x00, 0x82, 0x16, "", "ROTATE_0", 0, &_String, &flash_text_engine_TextRotation, 0}; static varinfo_t flash_text_engine_TextRotation_ROTATE_90 = {0x01, 0x00, 0x82, 0x16, "", "ROTATE_90", 0, &_String, &flash_text_engine_TextRotation, 0}; static varinfo_t flash_text_engine_TextRotation_ROTATE_180 = {0x01, 0x00, 0x82, 0x16, "", "ROTATE_180", 0, &_String, &flash_text_engine_TextRotation, 0}; -static methodinfo_t flash_sampler_clearSamples = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "clearSamples", 0, 0, 0, 0}; +static methodinfo_t flash_sampler_clearSamples = {0x02, 0x00, 0x82, 0x16, "flash.sampler", "clearSamples", 0, &voidclass, 0, 0}; static classinfo_t flash_system_IMEConversionMode = {0x03, 0x00, 0x81, 0x16, "flash.system", "IMEConversionMode", 0, &_Object, interfaces: {0}}; static varinfo_t flash_system_IMEConversionMode_JAPANESE_KATAKANA_FULL = {0x01, 0x00, 0x82, 0x16, "", "JAPANESE_KATAKANA_FULL", 0, &_String, &flash_system_IMEConversionMode, 0}; static varinfo_t flash_system_IMEConversionMode_CHINESE = {0x01, 0x00, 0x82, 0x16, "", "CHINESE", 0, &_String, &flash_system_IMEConversionMode, 0}; @@ -3968,13 +4895,13 @@ static varinfo_t flash_net_URLStream_connected = {0x01, 0x00, 0x80, 0x16, "", "connected", 0, &_Boolean, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readUnsignedInt = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedInt", 0, &_uint, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readDouble = {0x02, 0x00, 0x80, 0x16, "", "readDouble", 0, &_Number, &flash_net_URLStream, 0}; -static methodinfo_t flash_net_URLStream_readBytes = {0x02, 0x00, 0x80, 0x16, "", "readBytes", 0, 0, &flash_net_URLStream, 0}; +static methodinfo_t flash_net_URLStream_readBytes = {0x02, 0x00, 0x80, 0x16, "", "readBytes", 0, &voidclass, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readUnsignedByte = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedByte", 0, &_uint, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readMultiByte = {0x02, 0x00, 0x80, 0x16, "", "readMultiByte", 0, &_String, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readInt = {0x02, 0x00, 0x80, 0x16, "", "readInt", 0, &_int, &flash_net_URLStream, 0}; static varinfo_t flash_net_URLStream_bytesAvailable = {0x01, 0x00, 0x80, 0x16, "", "bytesAvailable", 0, &_uint, &flash_net_URLStream, 0}; -static methodinfo_t flash_net_URLStream_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, 0, &flash_net_URLStream, 0}; -static methodinfo_t flash_net_URLStream_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_URLStream, 0}; +static methodinfo_t flash_net_URLStream_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, &voidclass, &flash_net_URLStream, 0}; +static methodinfo_t flash_net_URLStream_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readUnsignedShort = {0x02, 0x00, 0x80, 0x16, "", "readUnsignedShort", 0, &_uint, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readObject = {0x02, 0x00, 0x80, 0x16, "", "readObject", 0, 0, &flash_net_URLStream, 0}; static methodinfo_t flash_net_URLStream_readFloat = {0x02, 0x00, 0x80, 0x16, "", "readFloat", 0, &_Number, &flash_net_URLStream, 0}; @@ -3998,8 +4925,8 @@ static varinfo_t flash_display_BlendMode_LIGHTEN = {0x01, 0x00, 0x82, 0x16, "", "LIGHTEN", 0, &_String, &flash_display_BlendMode, 0}; static classinfo_t flash_ui_Mouse = {0x03, 0x00, 0x81, 0x16, "flash.ui", "Mouse", 0, &_Object, interfaces: {0}}; static varinfo_t flash_ui_Mouse_cursor = {0x01, 0x00, 0x82, 0x16, "", "cursor", 0, &_String, &flash_ui_Mouse, 0}; -static methodinfo_t flash_ui_Mouse_show = {0x02, 0x00, 0x82, 0x16, "", "show", 0, 0, &flash_ui_Mouse, 0}; -static methodinfo_t flash_ui_Mouse_hide = {0x02, 0x00, 0x82, 0x16, "", "hide", 0, 0, &flash_ui_Mouse, 0}; +static methodinfo_t flash_ui_Mouse_show = {0x02, 0x00, 0x82, 0x16, "", "show", 0, &voidclass, &flash_ui_Mouse, 0}; +static methodinfo_t flash_ui_Mouse_hide = {0x02, 0x00, 0x82, 0x16, "", "hide", 0, &voidclass, &flash_ui_Mouse, 0}; static classinfo_t flash_errors_InvalidSWFError = {0x03, 0x00, 0x88, 0x16, "flash.errors", "InvalidSWFError", 0, &_Error, interfaces: {0}}; static classinfo_t flash_text_engine_RenderingMode = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "RenderingMode", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_engine_RenderingMode_NORMAL = {0x01, 0x00, 0x82, 0x16, "", "NORMAL", 0, &_String, &flash_text_engine_RenderingMode, 0}; @@ -4019,55 +4946,55 @@ static varinfo_t flash_text_engine_TypographicCase_CAPS = {0x01, 0x00, 0x82, 0x16, "", "CAPS", 0, &_String, &flash_text_engine_TypographicCase, 0}; static varinfo_t flash_text_engine_TypographicCase_CAPS_AND_SMALL_CAPS = {0x01, 0x00, 0x82, 0x16, "", "CAPS_AND_SMALL_CAPS", 0, &_String, &flash_text_engine_TypographicCase, 0}; static classinfo_t _XML = {0x03, 0x00, 0x89, 0x16, "", "XML", 0, &_Object, interfaces: {0}}; -static methodinfo_t _XML_attribute = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "attribute", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_normalize = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "normalize", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_removeNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "removeNamespace", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_prependChild = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "prependChild", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_toXMLString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toXMLString", 0, &_String, &_XML, 0}; +static methodinfo_t _XML_text = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "text", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_nodeKind = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "nodeKind", 0, &_String, &_XML, 0}; +static methodinfo_t _XML_copy = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "copy", 0, &_XML, &_XML, 0}; static methodinfo_t _XML_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_XML, 0}; static methodinfo_t _XML_childIndex = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "childIndex", 0, &_int, &_XML, 0}; -static methodinfo_t _XML_parent = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "parent", 0, 0, &_XML, 0}; -static methodinfo_t _XML_appendChild = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "appendChild", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_setName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setName", 0, &voidclass, &_XML, 0}; +static methodinfo_t _XML_setLocalName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setLocalName", 0, &voidclass, &_XML, 0}; +static methodinfo_t _XML_namespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "namespace", 0, 0, &_XML, 0}; +static methodinfo_t _XML_insertChildBefore = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "insertChildBefore", 0, 0, &_XML, 0}; +static methodinfo_t _XML_addNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "addNamespace", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_propertyIsEnumerable = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "propertyIsEnumerable", 0, &_Boolean, &_XML, 0}; +static methodinfo_t _XML_comments = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "comments", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_attributes = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "attributes", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_descendants = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "descendants", 0, &_XMLList, &_XML, 0}; static methodinfo_t _XML_replace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "replace", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_elements = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "elements", 0, &_XMLList, &_XML, 0}; static methodinfo_t _XML_setNotification = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setNotification", 0, 0, &_XML, 0}; -static methodinfo_t _XML_namespaceDeclarations = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "namespaceDeclarations", 0, &_Array, &_XML, 0}; +static methodinfo_t _XML_children = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "children", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_contains = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "contains", 0, &_Boolean, &_XML, 0}; +static methodinfo_t _XML_hasSimpleContent = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasSimpleContent", 0, &_Boolean, &_XML, 0}; +static methodinfo_t _XML_elements = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "elements", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_hasComplexContent = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasComplexContent", 0, &_Boolean, &_XML, 0}; +static methodinfo_t _XML_insertChildAfter = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "insertChildAfter", 0, 0, &_XML, 0}; +static methodinfo_t _XML_parent = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "parent", 0, 0, &_XML, 0}; static methodinfo_t _XML_length = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "length", 0, &_int, &_XML, 0}; -static methodinfo_t _XML_comments = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "comments", 0, &_XMLList, &_XML, 0}; static methodinfo_t _XML_processingInstructions = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "processingInstructions", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_child = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "child", 0, &_XMLList, &_XML, 0}; +static methodinfo_t _XML_appendChild = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "appendChild", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_localName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "localName", 0, &_Object, &_XML, 0}; +static methodinfo_t _XML_notification = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "notification", 0, &_Function, &_XML, 0}; static methodinfo_t _XML_inScopeNamespaces = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "inScopeNamespaces", 0, &_Array, &_XML, 0}; +static methodinfo_t _XML_hasOwnProperty = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasOwnProperty", 0, &_Boolean, &_XML, 0}; +static methodinfo_t _XML_namespaceDeclarations = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "namespaceDeclarations", 0, &_Array, &_XML, 0}; +static methodinfo_t _XML_setNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setNamespace", 0, &voidclass, &_XML, 0}; +static methodinfo_t _XML_name = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "name", 0, &_Object, &_XML, 0}; +static methodinfo_t _XML_setChildren = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setChildren", 0, &_XML, &_XML, 0}; +static methodinfo_t _XML_attribute = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "attribute", 0, &_XMLList, &_XML, 0}; static varinfo_t _XML_prettyPrinting = {0x01, 0x00, 0x82, 0x16, "", "prettyPrinting", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_children = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "children", 0, &_XMLList, &_XML, 0}; -static methodinfo_t _XML_setLocalName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setLocalName", 0, 0, &_XML, 0}; -static methodinfo_t _XML_setSettings = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "setSettings", 0, 0, &_XML, 0}; +static methodinfo_t _XML_setSettings = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "setSettings", 0, &voidclass, &_XML, 0}; static varinfo_t _XML_ignoreComments = {0x01, 0x00, 0x82, 0x16, "", "ignoreComments", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_notification = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "notification", 0, &_Function, &_XML, 0}; -static varinfo_t _XML_ignoreWhitespace = {0x01, 0x00, 0x82, 0x16, "", "ignoreWhitespace", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_setNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setNamespace", 0, 0, &_XML, 0}; -static methodinfo_t _XML_prependChild = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "prependChild", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_hasSimpleContent = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasSimpleContent", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_insertChildBefore = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "insertChildBefore", 0, 0, &_XML, 0}; -static methodinfo_t _XML_hasOwnProperty = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasOwnProperty", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_normalize = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "normalize", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_copy = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "copy", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_localName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "localName", 0, &_Object, &_XML, 0}; -static methodinfo_t _XML_contains = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "contains", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_propertyIsEnumerable = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "propertyIsEnumerable", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_defaultSettings = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "defaultSettings", 0, &_Object, &_XML, 0}; +static varinfo_t _XML_prettyIndent = {0x01, 0x00, 0x82, 0x16, "", "prettyIndent", 0, &_int, &_XML, 0}; static methodinfo_t _XML_settings = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "settings", 0, &_Object, &_XML, 0}; -static methodinfo_t _XML_namespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "namespace", 0, 0, &_XML, 0}; -static methodinfo_t _XML_attributes = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "attributes", 0, &_XMLList, &_XML, 0}; -static methodinfo_t _XML_setName = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setName", 0, 0, &_XML, 0}; -static methodinfo_t _XML_text = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "text", 0, &_XMLList, &_XML, 0}; -static methodinfo_t _XML_insertChildAfter = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "insertChildAfter", 0, 0, &_XML, 0}; static varinfo_t _XML_ignoreProcessingInstructions = {0x01, 0x00, 0x82, 0x16, "", "ignoreProcessingInstructions", 0, &_Boolean, &_XML, 0}; -static varinfo_t _XML_prettyIndent = {0x01, 0x00, 0x82, 0x16, "", "prettyIndent", 0, &_int, &_XML, 0}; -static methodinfo_t _XML_descendants = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "descendants", 0, &_XMLList, &_XML, 0}; -static methodinfo_t _XML_toXMLString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toXMLString", 0, &_String, &_XML, 0}; -static methodinfo_t _XML_hasComplexContent = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "hasComplexContent", 0, &_Boolean, &_XML, 0}; -static methodinfo_t _XML_child = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "child", 0, &_XMLList, &_XML, 0}; -static methodinfo_t _XML_removeNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "removeNamespace", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_addNamespace = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "addNamespace", 0, &_XML, &_XML, 0}; -static methodinfo_t _XML_nodeKind = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "nodeKind", 0, &_String, &_XML, 0}; -static methodinfo_t _XML_name = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "name", 0, &_Object, &_XML, 0}; -static methodinfo_t _XML_setChildren = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "setChildren", 0, &_XML, &_XML, 0}; +static varinfo_t _XML_ignoreWhitespace = {0x01, 0x00, 0x82, 0x16, "", "ignoreWhitespace", 0, &_Boolean, &_XML, 0}; +static methodinfo_t _XML_defaultSettings = {0x02, 0x00, 0x82, 0x08, "http://adobe.com/AS3/2006/builtin", "defaultSettings", 0, &_Object, &_XML, 0}; static classinfo_t flash_net_NetStreamInfo = {0x03, 0x00, 0x81, 0x16, "flash.net", "NetStreamInfo", 0, &_Object, interfaces: {0}}; static varinfo_t flash_net_NetStreamInfo_maxBytesPerSecond = {0x01, 0x00, 0x80, 0x16, "", "maxBytesPerSecond", 0, &_Number, &flash_net_NetStreamInfo, 0}; static varinfo_t flash_net_NetStreamInfo_dataBufferByteLength = {0x01, 0x00, 0x80, 0x16, "", "dataBufferByteLength", 0, &_Number, &flash_net_NetStreamInfo, 0}; @@ -4090,10 +5017,10 @@ static varinfo_t flash_net_NetStreamInfo_audioBytesPerSecond = {0x01, 0x00, 0x80, 0x16, "", "audioBytesPerSecond", 0, &_Number, &flash_net_NetStreamInfo, 0}; static varinfo_t flash_net_NetStreamInfo_playbackBytesPerSecond = {0x01, 0x00, 0x80, 0x16, "", "playbackBytesPerSecond", 0, &_Number, &flash_net_NetStreamInfo, 0}; static classinfo_t flash_display_Stage = {0x03, 0x00, 0x80, 0x16, "flash.display", "Stage", 0, &flash_display_DisplayObjectContainer, interfaces: {0}}; -static methodinfo_t flash_display_Stage_setChildIndex = {0x02, 0x00, 0x80, 0x16, "", "setChildIndex", 0, 0, &flash_display_Stage, 0}; +static methodinfo_t flash_display_Stage_setChildIndex = {0x02, 0x00, 0x80, 0x16, "", "setChildIndex", 0, &voidclass, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_stageFocusRect = {0x01, 0x00, 0x80, 0x16, "", "stageFocusRect", 0, &_Boolean, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_frameRate = {0x01, 0x00, 0x80, 0x16, "", "frameRate", 0, &_Number, &flash_display_Stage, 0}; -static methodinfo_t flash_display_Stage_invalidate = {0x02, 0x00, 0x80, 0x16, "", "invalidate", 0, 0, &flash_display_Stage, 0}; +static methodinfo_t flash_display_Stage_invalidate = {0x02, 0x00, 0x80, 0x16, "", "invalidate", 0, &voidclass, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_textSnapshot = {0x01, 0x00, 0x80, 0x16, "", "textSnapshot", 0, &flash_text_TextSnapshot, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_quality = {0x01, 0x00, 0x80, 0x16, "", "quality", 0, &_String, &flash_display_Stage, 0}; static methodinfo_t flash_display_Stage_willTrigger = {0x02, 0x00, 0x80, 0x16, "", "willTrigger", 0, &_Boolean, &flash_display_Stage, 0}; @@ -4108,9 +5035,9 @@ static methodinfo_t flash_display_Stage_addChild = {0x02, 0x00, 0x80, 0x16, "", "addChild", 0, &flash_display_DisplayObject, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_numChildren = {0x01, 0x00, 0x80, 0x16, "", "numChildren", 0, &_int, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_mouseChildren = {0x01, 0x00, 0x80, 0x16, "", "mouseChildren", 0, &_Boolean, &flash_display_Stage, 0}; -static methodinfo_t flash_display_Stage_swapChildrenAt = {0x02, 0x00, 0x80, 0x16, "", "swapChildrenAt", 0, 0, &flash_display_Stage, 0}; +static methodinfo_t flash_display_Stage_swapChildrenAt = {0x02, 0x00, 0x80, 0x16, "", "swapChildrenAt", 0, &voidclass, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_showDefaultContextMenu = {0x01, 0x00, 0x80, 0x16, "", "showDefaultContextMenu", 0, &_Boolean, &flash_display_Stage, 0}; -static methodinfo_t flash_display_Stage_addEventListener = {0x02, 0x00, 0x80, 0x16, "", "addEventListener", 0, 0, &flash_display_Stage, 0}; +static methodinfo_t flash_display_Stage_addEventListener = {0x02, 0x00, 0x80, 0x16, "", "addEventListener", 0, &voidclass, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_stageHeight = {0x01, 0x00, 0x80, 0x16, "", "stageHeight", 0, &_int, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_fullScreenHeight = {0x01, 0x00, 0x80, 0x16, "", "fullScreenHeight", 0, &_uint, &flash_display_Stage, 0}; static varinfo_t flash_display_Stage_align = {0x01, 0x00, 0x80, 0x16, "", "align", 0, &_String, &flash_display_Stage, 0}; @@ -4141,17 +5068,17 @@ static methodinfo_t flash_trace_Trace_getListener = {0x02, 0x00, 0x82, 0x16, "", "getListener", 0, &_Function, &flash_trace_Trace, 0}; static varinfo_t flash_trace_Trace_METHODS = {0x01, 0x00, 0x82, 0x16, "", "METHODS", 0, &_int, &flash_trace_Trace, 0}; static classinfo_t flash_events_TimerEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "TimerEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_TimerEvent_TIMER_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "TIMER_COMPLETE", 0, &_String, &flash_events_TimerEvent, 0}; static methodinfo_t flash_events_TimerEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_TimerEvent, 0}; static methodinfo_t flash_events_TimerEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_TimerEvent, 0}; +static methodinfo_t flash_events_TimerEvent_updateAfterEvent = {0x02, 0x00, 0x80, 0x16, "", "updateAfterEvent", 0, &voidclass, &flash_events_TimerEvent, 0}; +static varinfo_t flash_events_TimerEvent_TIMER_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "TIMER_COMPLETE", 0, &_String, &flash_events_TimerEvent, 0}; static varinfo_t flash_events_TimerEvent_TIMER = {0x01, 0x00, 0x82, 0x16, "", "TIMER", 0, &_String, &flash_events_TimerEvent, 0}; -static methodinfo_t flash_events_TimerEvent_updateAfterEvent = {0x02, 0x00, 0x80, 0x16, "", "updateAfterEvent", 0, 0, &flash_events_TimerEvent, 0}; static classinfo_t flash_events_SampleDataEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "SampleDataEvent", 0, &flash_events_Event, interfaces: {0}}; static methodinfo_t flash_events_SampleDataEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_SampleDataEvent, 0}; static varinfo_t flash_events_SampleDataEvent_position = {0x01, 0x00, 0x80, 0x16, "", "position", 0, &_Number, &flash_events_SampleDataEvent, 0}; static methodinfo_t flash_events_SampleDataEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_SampleDataEvent, 0}; -static varinfo_t flash_events_SampleDataEvent_SAMPLE_DATA = {0x01, 0x00, 0x82, 0x16, "", "SAMPLE_DATA", 0, &_String, &flash_events_SampleDataEvent, 0}; static varinfo_t flash_events_SampleDataEvent_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &flash_utils_ByteArray, &flash_events_SampleDataEvent, 0}; +static varinfo_t flash_events_SampleDataEvent_SAMPLE_DATA = {0x01, 0x00, 0x82, 0x16, "", "SAMPLE_DATA", 0, &_String, &flash_events_SampleDataEvent, 0}; static classinfo_t flash_display_ShaderPrecision = {0x03, 0x00, 0x81, 0x16, "flash.display", "ShaderPrecision", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_ShaderPrecision_FULL = {0x01, 0x00, 0x82, 0x16, "", "FULL", 0, &_String, &flash_display_ShaderPrecision, 0}; static varinfo_t flash_display_ShaderPrecision_FAST = {0x01, 0x00, 0x82, 0x16, "", "FAST", 0, &_String, &flash_display_ShaderPrecision, 0}; @@ -4159,24 +5086,24 @@ static varinfo_t flash_net_FileReference_type = {0x01, 0x00, 0x80, 0x16, "", "type", 0, &_String, &flash_net_FileReference, 0}; static methodinfo_t flash_net_FileReference_browse = {0x02, 0x00, 0x80, 0x16, "", "browse", 0, &_Boolean, &flash_net_FileReference, 0}; static varinfo_t flash_net_FileReference_creationDate = {0x01, 0x00, 0x80, 0x16, "", "creationDate", 0, &_Date, &flash_net_FileReference, 0}; -static methodinfo_t flash_net_FileReference_upload = {0x02, 0x00, 0x80, 0x16, "", "upload", 0, 0, &flash_net_FileReference, 0}; -static methodinfo_t flash_net_FileReference_download = {0x02, 0x00, 0x80, 0x16, "", "download", 0, 0, &flash_net_FileReference, 0}; -static methodinfo_t flash_net_FileReference_save = {0x02, 0x00, 0x80, 0x16, "", "save", 0, 0, &flash_net_FileReference, 0}; -static methodinfo_t flash_net_FileReference_cancel = {0x02, 0x00, 0x80, 0x16, "", "cancel", 0, 0, &flash_net_FileReference, 0}; +static methodinfo_t flash_net_FileReference_upload = {0x02, 0x00, 0x80, 0x16, "", "upload", 0, &voidclass, &flash_net_FileReference, 0}; +static methodinfo_t flash_net_FileReference_download = {0x02, 0x00, 0x80, 0x16, "", "download", 0, &voidclass, &flash_net_FileReference, 0}; +static methodinfo_t flash_net_FileReference_save = {0x02, 0x00, 0x80, 0x16, "", "save", 0, &voidclass, &flash_net_FileReference, 0}; +static methodinfo_t flash_net_FileReference_cancel = {0x02, 0x00, 0x80, 0x16, "", "cancel", 0, &voidclass, &flash_net_FileReference, 0}; static varinfo_t flash_net_FileReference_creator = {0x01, 0x00, 0x80, 0x16, "", "creator", 0, &_String, &flash_net_FileReference, 0}; static varinfo_t flash_net_FileReference_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &flash_utils_ByteArray, &flash_net_FileReference, 0}; static varinfo_t flash_net_FileReference_size = {0x01, 0x00, 0x80, 0x16, "", "size", 0, &_uint, &flash_net_FileReference, 0}; static varinfo_t flash_net_FileReference_name = {0x01, 0x00, 0x80, 0x16, "", "name", 0, &_String, &flash_net_FileReference, 0}; -static methodinfo_t flash_net_FileReference_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, 0, &flash_net_FileReference, 0}; +static methodinfo_t flash_net_FileReference_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, &voidclass, &flash_net_FileReference, 0}; static varinfo_t flash_net_FileReference_modificationDate = {0x01, 0x00, 0x80, 0x16, "", "modificationDate", 0, &_Date, &flash_net_FileReference, 0}; static classinfo_t _DefinitionError = {0x03, 0x00, 0x88, 0x16, "", "DefinitionError", 0, &_Error, interfaces: {0}}; static varinfo_t _DefinitionError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_DefinitionError, 0}; static classinfo_t flash_events_EventDispatcher = {0x03, 0x00, 0x80, 0x16, "flash.events", "EventDispatcher", 0, &_Object, interfaces: {&flash_events_IEventDispatcher, 0}}; static methodinfo_t flash_events_EventDispatcher_willTrigger = {0x02, 0x00, 0x80, 0x16, "", "willTrigger", 0, &_Boolean, &flash_events_EventDispatcher, 0}; static methodinfo_t flash_events_EventDispatcher_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_EventDispatcher, 0}; -static methodinfo_t flash_events_EventDispatcher_removeEventListener = {0x02, 0x00, 0x80, 0x16, "", "removeEventListener", 0, 0, &flash_events_EventDispatcher, 0}; +static methodinfo_t flash_events_EventDispatcher_removeEventListener = {0x02, 0x00, 0x80, 0x16, "", "removeEventListener", 0, &voidclass, &flash_events_EventDispatcher, 0}; static methodinfo_t flash_events_EventDispatcher_hasEventListener = {0x02, 0x00, 0x80, 0x16, "", "hasEventListener", 0, &_Boolean, &flash_events_EventDispatcher, 0}; -static methodinfo_t flash_events_EventDispatcher_addEventListener = {0x02, 0x00, 0x80, 0x16, "", "addEventListener", 0, 0, &flash_events_EventDispatcher, 0}; +static methodinfo_t flash_events_EventDispatcher_addEventListener = {0x02, 0x00, 0x80, 0x16, "", "addEventListener", 0, &voidclass, &flash_events_EventDispatcher, 0}; static methodinfo_t flash_events_EventDispatcher_dispatchEvent = {0x02, 0x00, 0x80, 0x16, "", "dispatchEvent", 0, &_Boolean, &flash_events_EventDispatcher, 0}; static classinfo_t flash_net_SharedObjectFlushStatus = {0x03, 0x00, 0x81, 0x16, "flash.net", "SharedObjectFlushStatus", 0, &_Object, interfaces: {0}}; static varinfo_t flash_net_SharedObjectFlushStatus_FLUSHED = {0x01, 0x00, 0x82, 0x16, "", "FLUSHED", 0, &_String, &flash_net_SharedObjectFlushStatus, 0}; @@ -4194,23 +5121,23 @@ static classinfo_t flash_system_SecurityDomain = {0x03, 0x00, 0x80, 0x16, "flash.system", "SecurityDomain", 0, &_Object, interfaces: {0}}; static varinfo_t flash_system_SecurityDomain_currentDomain = {0x01, 0x00, 0x82, 0x16, "", "currentDomain", 0, &flash_system_SecurityDomain, &flash_system_SecurityDomain, 0}; static classinfo_t flash_text_Font = {0x03, 0x00, 0x80, 0x16, "flash.text", "Font", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_text_Font_enumerateFonts = {0x02, 0x00, 0x82, 0x16, "", "enumerateFonts", 0, &_Array, &flash_text_Font, 0}; static methodinfo_t flash_text_Font_hasGlyphs = {0x02, 0x00, 0x80, 0x16, "", "hasGlyphs", 0, &_Boolean, &flash_text_Font, 0}; static varinfo_t flash_text_Font_fontName = {0x01, 0x00, 0x80, 0x16, "", "fontName", 0, &_String, &flash_text_Font, 0}; -static methodinfo_t flash_text_Font_registerFont = {0x02, 0x00, 0x82, 0x16, "", "registerFont", 0, 0, &flash_text_Font, 0}; static varinfo_t flash_text_Font_fontStyle = {0x01, 0x00, 0x80, 0x16, "", "fontStyle", 0, &_String, &flash_text_Font, 0}; static varinfo_t flash_text_Font_fontType = {0x01, 0x00, 0x80, 0x16, "", "fontType", 0, &_String, &flash_text_Font, 0}; +static methodinfo_t flash_text_Font_enumerateFonts = {0x02, 0x00, 0x82, 0x16, "", "enumerateFonts", 0, &_Array, &flash_text_Font, 0}; +static methodinfo_t flash_text_Font_registerFont = {0x02, 0x00, 0x82, 0x16, "", "registerFont", 0, &voidclass, &flash_text_Font, 0}; static classinfo_t _RegExp = {0x03, 0x00, 0x88, 0x16, "", "RegExp", 0, &_Object, interfaces: {0}}; static varinfo_t _RegExp_source = {0x01, 0x00, 0x80, 0x16, "", "source", 0, &_String, &_RegExp, 0}; static methodinfo_t _RegExp_test = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "test", 0, &_Boolean, &_RegExp, 0}; static varinfo_t _RegExp_global = {0x01, 0x00, 0x80, 0x16, "", "global", 0, &_Boolean, &_RegExp, 0}; -static varinfo_t _RegExp_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_RegExp, 0}; static methodinfo_t _RegExp_exec = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "exec", 0, 0, &_RegExp, 0}; static varinfo_t _RegExp_ignoreCase = {0x01, 0x00, 0x80, 0x16, "", "ignoreCase", 0, &_Boolean, &_RegExp, 0}; static varinfo_t _RegExp_dotall = {0x01, 0x00, 0x80, 0x16, "", "dotall", 0, &_Boolean, &_RegExp, 0}; static varinfo_t _RegExp_lastIndex = {0x01, 0x00, 0x80, 0x16, "", "lastIndex", 0, &_int, &_RegExp, 0}; static varinfo_t _RegExp_extended = {0x01, 0x00, 0x80, 0x16, "", "extended", 0, &_Boolean, &_RegExp, 0}; static varinfo_t _RegExp_multiline = {0x01, 0x00, 0x80, 0x16, "", "multiline", 0, &_Boolean, &_RegExp, 0}; +static varinfo_t _RegExp_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_RegExp, 0}; static classinfo_t flash_accessibility_AccessibilityProperties = {0x03, 0x00, 0x80, 0x16, "flash.accessibility", "AccessibilityProperties", 0, &_Object, interfaces: {0}}; static varinfo_t flash_accessibility_AccessibilityProperties_forceSimple = {0x01, 0x00, 0x80, 0x16, "", "forceSimple", 0, &_Boolean, &flash_accessibility_AccessibilityProperties, 0}; static varinfo_t flash_accessibility_AccessibilityProperties_noAutoLabeling = {0x01, 0x00, 0x80, 0x16, "", "noAutoLabeling", 0, &_Boolean, &flash_accessibility_AccessibilityProperties, 0}; @@ -4219,7 +5146,7 @@ static varinfo_t flash_accessibility_AccessibilityProperties_shortcut = {0x01, 0x00, 0x80, 0x16, "", "shortcut", 0, &_String, &flash_accessibility_AccessibilityProperties, 0}; static varinfo_t flash_accessibility_AccessibilityProperties_silent = {0x01, 0x00, 0x80, 0x16, "", "silent", 0, &_Boolean, &flash_accessibility_AccessibilityProperties, 0}; static classinfo_t flash_ui_ContextMenu = {0x03, 0x00, 0x81, 0x16, "flash.ui", "ContextMenu", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_ui_ContextMenu_hideBuiltInItems = {0x02, 0x00, 0x80, 0x16, "", "hideBuiltInItems", 0, 0, &flash_ui_ContextMenu, 0}; +static methodinfo_t flash_ui_ContextMenu_hideBuiltInItems = {0x02, 0x00, 0x80, 0x16, "", "hideBuiltInItems", 0, &voidclass, &flash_ui_ContextMenu, 0}; static varinfo_t flash_ui_ContextMenu_clipboardItems = {0x01, 0x00, 0x80, 0x16, "", "clipboardItems", 0, &flash_ui_ContextMenuClipboardItems, &flash_ui_ContextMenu, 0}; static varinfo_t flash_ui_ContextMenu_builtInItems = {0x01, 0x00, 0x80, 0x16, "", "builtInItems", 0, &flash_ui_ContextMenuBuiltInItems, &flash_ui_ContextMenu, 0}; static varinfo_t flash_ui_ContextMenu_customItems = {0x01, 0x00, 0x80, 0x16, "", "customItems", 0, &_Array, &flash_ui_ContextMenu, 0}; @@ -4263,7 +5190,7 @@ static varinfo_t flash_display_ColorCorrectionSupport_DEFAULT_ON = {0x01, 0x00, 0x82, 0x16, "", "DEFAULT_ON", 0, &_String, &flash_display_ColorCorrectionSupport, 0}; static varinfo_t flash_display_ColorCorrectionSupport_DEFAULT_OFF = {0x01, 0x00, 0x82, 0x16, "", "DEFAULT_OFF", 0, &_String, &flash_display_ColorCorrectionSupport, 0}; static classinfo_t flash_errors_IOError = {0x03, 0x00, 0x88, 0x16, "flash.errors", "IOError", 0, &_Error, interfaces: {0}}; -static methodinfo_t _trace = {0x02, 0x00, 0x82, 0x16, "", "trace", 0, 0, 0, 0}; +static methodinfo_t _trace = {0x02, 0x00, 0x82, 0x16, "", "trace", 0, &voidclass, 0, 0}; static classinfo_t flash_ui_ContextMenuBuiltInItems = {0x03, 0x00, 0x81, 0x16, "flash.ui", "ContextMenuBuiltInItems", 0, &_Object, interfaces: {0}}; static varinfo_t flash_ui_ContextMenuBuiltInItems_zoom = {0x01, 0x00, 0x80, 0x16, "", "zoom", 0, &_Boolean, &flash_ui_ContextMenuBuiltInItems, 0}; static varinfo_t flash_ui_ContextMenuBuiltInItems_save = {0x01, 0x00, 0x80, 0x16, "", "save", 0, &_Boolean, &flash_ui_ContextMenuBuiltInItems, 0}; @@ -4282,32 +5209,32 @@ static varinfo_t flash_display_TriangleCulling_NEGATIVE = {0x01, 0x00, 0x82, 0x16, "", "NEGATIVE", 0, &_String, &flash_display_TriangleCulling, 0}; static varinfo_t flash_display_TriangleCulling_NONE = {0x01, 0x00, 0x82, 0x16, "", "NONE", 0, &_String, &flash_display_TriangleCulling, 0}; static classinfo_t flash_media_SoundMixer = {0x03, 0x00, 0x81, 0x16, "flash.media", "SoundMixer", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_media_SoundMixer_computeSpectrum = {0x02, 0x00, 0x82, 0x16, "", "computeSpectrum", 0, 0, &flash_media_SoundMixer, 0}; +static methodinfo_t flash_media_SoundMixer_computeSpectrum = {0x02, 0x00, 0x82, 0x16, "", "computeSpectrum", 0, &voidclass, &flash_media_SoundMixer, 0}; static methodinfo_t flash_media_SoundMixer_areSoundsInaccessible = {0x02, 0x00, 0x82, 0x16, "", "areSoundsInaccessible", 0, &_Boolean, &flash_media_SoundMixer, 0}; static varinfo_t flash_media_SoundMixer_soundTransform = {0x01, 0x00, 0x82, 0x16, "", "soundTransform", 0, &flash_media_SoundTransform, &flash_media_SoundMixer, 0}; static varinfo_t flash_media_SoundMixer_bufferTime = {0x01, 0x00, 0x82, 0x16, "", "bufferTime", 0, &_int, &flash_media_SoundMixer, 0}; -static methodinfo_t flash_media_SoundMixer_stopAll = {0x02, 0x00, 0x82, 0x16, "", "stopAll", 0, 0, &flash_media_SoundMixer, 0}; +static methodinfo_t flash_media_SoundMixer_stopAll = {0x02, 0x00, 0x82, 0x16, "", "stopAll", 0, &voidclass, &flash_media_SoundMixer, 0}; static classinfo_t adobe_utils_XMLUI = {0x03, 0x00, 0x81, 0x16, "adobe.utils", "XMLUI", 0, &_Object, interfaces: {0}}; -static methodinfo_t adobe_utils_XMLUI_cancel = {0x02, 0x00, 0x82, 0x16, "", "cancel", 0, 0, &adobe_utils_XMLUI, 0}; -static methodinfo_t adobe_utils_XMLUI_setProperty = {0x02, 0x00, 0x82, 0x16, "", "setProperty", 0, 0, &adobe_utils_XMLUI, 0}; +static methodinfo_t adobe_utils_XMLUI_cancel = {0x02, 0x00, 0x82, 0x16, "", "cancel", 0, &voidclass, &adobe_utils_XMLUI, 0}; +static methodinfo_t adobe_utils_XMLUI_setProperty = {0x02, 0x00, 0x82, 0x16, "", "setProperty", 0, &voidclass, &adobe_utils_XMLUI, 0}; static methodinfo_t adobe_utils_XMLUI_getProperty = {0x02, 0x00, 0x82, 0x16, "", "getProperty", 0, &_String, &adobe_utils_XMLUI, 0}; -static methodinfo_t adobe_utils_XMLUI_accept = {0x02, 0x00, 0x82, 0x16, "", "accept", 0, 0, &adobe_utils_XMLUI, 0}; +static methodinfo_t adobe_utils_XMLUI_accept = {0x02, 0x00, 0x82, 0x16, "", "accept", 0, &voidclass, &adobe_utils_XMLUI, 0}; static methodinfo_t _escape = {0x02, 0x00, 0x82, 0x16, "", "escape", 0, &_String, 0, 0}; static methodinfo_t flash_utils_setInterval = {0x02, 0x00, 0x82, 0x16, "flash.utils", "setInterval", 0, &_uint, 0, 0}; static classinfo_t flash_events_StatusEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "StatusEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_StatusEvent_STATUS = {0x01, 0x00, 0x82, 0x16, "", "STATUS", 0, &_String, &flash_events_StatusEvent, 0}; static methodinfo_t flash_events_StatusEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_StatusEvent, 0}; static varinfo_t flash_events_StatusEvent_code = {0x01, 0x00, 0x80, 0x16, "", "code", 0, &_String, &flash_events_StatusEvent, 0}; static methodinfo_t flash_events_StatusEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_StatusEvent, 0}; static varinfo_t flash_events_StatusEvent_level = {0x01, 0x00, 0x80, 0x16, "", "level", 0, &_String, &flash_events_StatusEvent, 0}; +static varinfo_t flash_events_StatusEvent_STATUS = {0x01, 0x00, 0x82, 0x16, "", "STATUS", 0, &_String, &flash_events_StatusEvent, 0}; static classinfo_t flash_display_IGraphicsPath = {0x03, 0x00, 0x90, 0x16, "flash.display", "IGraphicsPath", 0, 0, interfaces: {0}}; static classinfo_t flash_events_ShaderEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "ShaderEvent", 0, &flash_events_Event, interfaces: {0}}; static varinfo_t flash_events_ShaderEvent_vector = {0x01, 0x00, 0x80, 0x16, "", "vector", 0, &__AS3___vec_Vector, &flash_events_ShaderEvent, 0}; static methodinfo_t flash_events_ShaderEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_ShaderEvent, 0}; static varinfo_t flash_events_ShaderEvent_bitmapData = {0x01, 0x00, 0x80, 0x16, "", "bitmapData", 0, &flash_display_BitmapData, &flash_events_ShaderEvent, 0}; static methodinfo_t flash_events_ShaderEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_ShaderEvent, 0}; -static varinfo_t flash_events_ShaderEvent_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "COMPLETE", 0, &_String, &flash_events_ShaderEvent, 0}; static varinfo_t flash_events_ShaderEvent_byteArray = {0x01, 0x00, 0x80, 0x16, "", "byteArray", 0, &flash_utils_ByteArray, &flash_events_ShaderEvent, 0}; +static varinfo_t flash_events_ShaderEvent_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "COMPLETE", 0, &_String, &flash_events_ShaderEvent, 0}; static classinfo_t flash_display_Shader = {0x03, 0x00, 0x80, 0x16, "flash.display", "Shader", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_Shader_precisionHint = {0x01, 0x00, 0x80, 0x16, "", "precisionHint", 0, &_String, &flash_display_Shader, 0}; static varinfo_t flash_display_Shader_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &flash_display_ShaderData, &flash_display_Shader, 0}; @@ -4324,40 +5251,40 @@ static classinfo_t _RangeError = {0x03, 0x00, 0x88, 0x16, "", "RangeError", 0, &_Error, interfaces: {0}}; static varinfo_t _RangeError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_RangeError, 0}; static classinfo_t _Number = {0x03, 0x00, 0x81, 0x16, "", "Number", 0, &_Object, interfaces: {0}}; -static varinfo_t _Number_MAX_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MAX_VALUE", 0, &_Number, &_Number, 0}; static methodinfo_t _Number_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_Number, &_Number, 0}; +static methodinfo_t _Number_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_Number, 0}; +static methodinfo_t _Number_toExponential = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toExponential", 0, &_String, &_Number, 0}; +static methodinfo_t _Number_toFixed = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toFixed", 0, &_String, &_Number, 0}; +static methodinfo_t _Number_toPrecision = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toPrecision", 0, &_String, &_Number, 0}; +static varinfo_t _Number_MAX_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MAX_VALUE", 0, &_Number, &_Number, 0}; static varinfo_t _Number_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_Number, 0}; static varinfo_t _Number_MIN_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MIN_VALUE", 0, &_Number, &_Number, 0}; -static methodinfo_t _Number_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_Number, 0}; static varinfo_t _Number_NaN = {0x01, 0x00, 0x82, 0x16, "", "NaN", 0, &_Number, &_Number, 0}; static varinfo_t _Number_POSITIVE_INFINITY = {0x01, 0x00, 0x82, 0x16, "", "POSITIVE_INFINITY", 0, &_Number, &_Number, 0}; -static methodinfo_t _Number_toExponential = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toExponential", 0, &_String, &_Number, 0}; -static methodinfo_t _Number_toFixed = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toFixed", 0, &_String, &_Number, 0}; static varinfo_t _Number_NEGATIVE_INFINITY = {0x01, 0x00, 0x82, 0x16, "", "NEGATIVE_INFINITY", 0, &_Number, &_Number, 0}; -static methodinfo_t _Number_toPrecision = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toPrecision", 0, &_String, &_Number, 0}; static classinfo_t flash_display_Graphics = {0x03, 0x00, 0x81, 0x16, "flash.display", "Graphics", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_display_Graphics_drawPath = {0x02, 0x00, 0x80, 0x16, "", "drawPath", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawEllipse = {0x02, 0x00, 0x80, 0x16, "", "drawEllipse", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawRoundRectComplex = {0x02, 0x00, 0x80, 0x16, "", "drawRoundRectComplex", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_moveTo = {0x02, 0x00, 0x80, 0x16, "", "moveTo", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_lineShaderStyle = {0x02, 0x00, 0x80, 0x16, "", "lineShaderStyle", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_beginFill = {0x02, 0x00, 0x80, 0x16, "", "beginFill", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_beginGradientFill = {0x02, 0x00, 0x80, 0x16, "", "beginGradientFill", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawGraphicsData = {0x02, 0x00, 0x80, 0x16, "", "drawGraphicsData", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_lineGradientStyle = {0x02, 0x00, 0x80, 0x16, "", "lineGradientStyle", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawRoundRect = {0x02, 0x00, 0x80, 0x16, "", "drawRoundRect", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_beginBitmapFill = {0x02, 0x00, 0x80, 0x16, "", "beginBitmapFill", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_lineStyle = {0x02, 0x00, 0x80, 0x16, "", "lineStyle", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_lineTo = {0x02, 0x00, 0x80, 0x16, "", "lineTo", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_endFill = {0x02, 0x00, 0x80, 0x16, "", "endFill", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_copyFrom = {0x02, 0x00, 0x80, 0x16, "", "copyFrom", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_lineBitmapStyle = {0x02, 0x00, 0x80, 0x16, "", "lineBitmapStyle", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_curveTo = {0x02, 0x00, 0x80, 0x16, "", "curveTo", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawCircle = {0x02, 0x00, 0x80, 0x16, "", "drawCircle", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_beginShaderFill = {0x02, 0x00, 0x80, 0x16, "", "beginShaderFill", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawTriangles = {0x02, 0x00, 0x80, 0x16, "", "drawTriangles", 0, 0, &flash_display_Graphics, 0}; -static methodinfo_t flash_display_Graphics_drawRect = {0x02, 0x00, 0x80, 0x16, "", "drawRect", 0, 0, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawPath = {0x02, 0x00, 0x80, 0x16, "", "drawPath", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawEllipse = {0x02, 0x00, 0x80, 0x16, "", "drawEllipse", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawRoundRectComplex = {0x02, 0x00, 0x80, 0x16, "", "drawRoundRectComplex", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_moveTo = {0x02, 0x00, 0x80, 0x16, "", "moveTo", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_lineShaderStyle = {0x02, 0x00, 0x80, 0x16, "", "lineShaderStyle", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_beginFill = {0x02, 0x00, 0x80, 0x16, "", "beginFill", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_beginGradientFill = {0x02, 0x00, 0x80, 0x16, "", "beginGradientFill", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawGraphicsData = {0x02, 0x00, 0x80, 0x16, "", "drawGraphicsData", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_lineGradientStyle = {0x02, 0x00, 0x80, 0x16, "", "lineGradientStyle", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawRoundRect = {0x02, 0x00, 0x80, 0x16, "", "drawRoundRect", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_beginBitmapFill = {0x02, 0x00, 0x80, 0x16, "", "beginBitmapFill", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_lineStyle = {0x02, 0x00, 0x80, 0x16, "", "lineStyle", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_lineTo = {0x02, 0x00, 0x80, 0x16, "", "lineTo", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_endFill = {0x02, 0x00, 0x80, 0x16, "", "endFill", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_copyFrom = {0x02, 0x00, 0x80, 0x16, "", "copyFrom", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_lineBitmapStyle = {0x02, 0x00, 0x80, 0x16, "", "lineBitmapStyle", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_curveTo = {0x02, 0x00, 0x80, 0x16, "", "curveTo", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_clear = {0x02, 0x00, 0x80, 0x16, "", "clear", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawCircle = {0x02, 0x00, 0x80, 0x16, "", "drawCircle", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_beginShaderFill = {0x02, 0x00, 0x80, 0x16, "", "beginShaderFill", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawTriangles = {0x02, 0x00, 0x80, 0x16, "", "drawTriangles", 0, &voidclass, &flash_display_Graphics, 0}; +static methodinfo_t flash_display_Graphics_drawRect = {0x02, 0x00, 0x80, 0x16, "", "drawRect", 0, &voidclass, &flash_display_Graphics, 0}; static classinfo_t _SyntaxError = {0x03, 0x00, 0x88, 0x16, "", "SyntaxError", 0, &_Error, interfaces: {0}}; static varinfo_t _SyntaxError_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_SyntaxError, 0}; static classinfo_t flash_sampler_NewObjectSample = {0x03, 0x00, 0x81, 0x16, "flash.sampler", "NewObjectSample", 0, &flash_sampler_Sample, interfaces: {0}}; @@ -4373,9 +5300,8 @@ static varinfo_t flash_display_BitmapDataChannel_GREEN = {0x01, 0x00, 0x82, 0x16, "", "GREEN", 0, &_uint, &flash_display_BitmapDataChannel, 0}; static varinfo_t flash_display_BitmapDataChannel_ALPHA = {0x01, 0x00, 0x82, 0x16, "", "ALPHA", 0, &_uint, &flash_display_BitmapDataChannel, 0}; static varinfo_t flash_display_BitmapDataChannel_RED = {0x01, 0x00, 0x82, 0x16, "", "RED", 0, &_uint, &flash_display_BitmapDataChannel, 0}; -static methodinfo_t flash_utils_clearInterval = {0x02, 0x00, 0x82, 0x16, "flash.utils", "clearInterval", 0, 0, 0, 0}; +static methodinfo_t flash_utils_clearInterval = {0x02, 0x00, 0x82, 0x16, "flash.utils", "clearInterval", 0, &voidclass, 0, 0}; static classinfo_t flash_text_engine_ContentElement = {0x03, 0x00, 0x80, 0x16, "flash.text.engine", "ContentElement", 0, &_Object, interfaces: {0}}; -static varinfo_t flash_text_engine_ContentElement_GRAPHIC_ELEMENT = {0x01, 0x00, 0x82, 0x16, "", "GRAPHIC_ELEMENT", 0, &_uint, &flash_text_engine_ContentElement, 0}; static varinfo_t flash_text_engine_ContentElement_eventMirror = {0x01, 0x00, 0x80, 0x16, "", "eventMirror", 0, &flash_events_EventDispatcher, &flash_text_engine_ContentElement, 0}; static varinfo_t flash_text_engine_ContentElement_groupElement = {0x01, 0x00, 0x80, 0x16, "", "groupElement", 0, &flash_text_engine_GroupElement, &flash_text_engine_ContentElement, 0}; static varinfo_t flash_text_engine_ContentElement_textRotation = {0x01, 0x00, 0x80, 0x16, "", "textRotation", 0, &_String, &flash_text_engine_ContentElement, 0}; @@ -4385,16 +5311,17 @@ static varinfo_t flash_text_engine_ContentElement_textBlock = {0x01, 0x00, 0x80, 0x16, "", "textBlock", 0, &flash_text_engine_TextBlock, &flash_text_engine_ContentElement, 0}; static varinfo_t flash_text_engine_ContentElement_rawText = {0x01, 0x00, 0x80, 0x16, "", "rawText", 0, &_String, &flash_text_engine_ContentElement, 0}; static varinfo_t flash_text_engine_ContentElement_textBlockBeginIndex = {0x01, 0x00, 0x80, 0x16, "", "textBlockBeginIndex", 0, &_int, &flash_text_engine_ContentElement, 0}; +static varinfo_t flash_text_engine_ContentElement_GRAPHIC_ELEMENT = {0x01, 0x00, 0x82, 0x16, "", "GRAPHIC_ELEMENT", 0, &_uint, &flash_text_engine_ContentElement, 0}; static classinfo_t flash_utils_Endian = {0x03, 0x00, 0x81, 0x16, "flash.utils", "Endian", 0, &_Object, interfaces: {0}}; static varinfo_t flash_utils_Endian_LITTLE_ENDIAN = {0x01, 0x00, 0x82, 0x16, "", "LITTLE_ENDIAN", 0, &_String, &flash_utils_Endian, 0}; static varinfo_t flash_utils_Endian_BIG_ENDIAN = {0x01, 0x00, 0x82, 0x16, "", "BIG_ENDIAN", 0, &_String, &flash_utils_Endian, 0}; -static methodinfo_t flash_net_navigateToURL = {0x02, 0x00, 0x82, 0x16, "flash.net", "navigateToURL", 0, 0, 0, 0}; +static methodinfo_t flash_net_navigateToURL = {0x02, 0x00, 0x82, 0x16, "flash.net", "navigateToURL", 0, &voidclass, 0, 0}; static classinfo_t flash_events_ProgressEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "ProgressEvent", 0, &flash_events_Event, interfaces: {0}}; static varinfo_t flash_events_ProgressEvent_bytesLoaded = {0x01, 0x00, 0x80, 0x16, "", "bytesLoaded", 0, &_uint, &flash_events_ProgressEvent, 0}; static methodinfo_t flash_events_ProgressEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_ProgressEvent, 0}; -static varinfo_t flash_events_ProgressEvent_PROGRESS = {0x01, 0x00, 0x82, 0x16, "", "PROGRESS", 0, &_String, &flash_events_ProgressEvent, 0}; static varinfo_t flash_events_ProgressEvent_bytesTotal = {0x01, 0x00, 0x80, 0x16, "", "bytesTotal", 0, &_uint, &flash_events_ProgressEvent, 0}; static methodinfo_t flash_events_ProgressEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_ProgressEvent, 0}; +static varinfo_t flash_events_ProgressEvent_PROGRESS = {0x01, 0x00, 0x82, 0x16, "", "PROGRESS", 0, &_String, &flash_events_ProgressEvent, 0}; static varinfo_t flash_events_ProgressEvent_SOCKET_DATA = {0x01, 0x00, 0x82, 0x16, "", "SOCKET_DATA", 0, &_String, &flash_events_ProgressEvent, 0}; static classinfo_t flash_media_Sound = {0x03, 0x00, 0x80, 0x16, "flash.media", "Sound", 0, &flash_events_EventDispatcher, interfaces: {0}}; static methodinfo_t flash_media_Sound_extract = {0x02, 0x00, 0x80, 0x16, "", "extract", 0, &_Number, &flash_media_Sound, 0}; @@ -4403,10 +5330,10 @@ static methodinfo_t flash_media_Sound_play = {0x02, 0x00, 0x80, 0x16, "", "play", 0, &flash_media_SoundChannel, &flash_media_Sound, 0}; static varinfo_t flash_media_Sound_url = {0x01, 0x00, 0x80, 0x16, "", "url", 0, &_String, &flash_media_Sound, 0}; static varinfo_t flash_media_Sound_isBuffering = {0x01, 0x00, 0x80, 0x16, "", "isBuffering", 0, &_Boolean, &flash_media_Sound, 0}; -static methodinfo_t flash_media_Sound_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, 0, &flash_media_Sound, 0}; +static methodinfo_t flash_media_Sound_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, &voidclass, &flash_media_Sound, 0}; static varinfo_t flash_media_Sound_bytesTotal = {0x01, 0x00, 0x80, 0x16, "", "bytesTotal", 0, &_int, &flash_media_Sound, 0}; static varinfo_t flash_media_Sound_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_Number, &flash_media_Sound, 0}; -static methodinfo_t flash_media_Sound_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_media_Sound, 0}; +static methodinfo_t flash_media_Sound_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_media_Sound, 0}; static classinfo_t flash_text_TextExtent = {0x03, 0x00, 0x80, 0x16, "flash.text", "TextExtent", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_TextExtent_descent = {0x01, 0x00, 0x80, 0x16, "", "descent", 0, &_Number, &flash_text_TextExtent, 0}; static varinfo_t flash_text_TextExtent_width = {0x01, 0x00, 0x80, 0x16, "", "width", 0, &_Number, &flash_text_TextExtent, 0}; @@ -4428,30 +5355,30 @@ static varinfo_t flash_text_engine_TextLineMirrorRegion_textLine = {0x01, 0x00, 0x80, 0x16, "", "textLine", 0, &flash_text_engine_TextLine, &flash_text_engine_TextLineMirrorRegion, 0}; static classinfo_t flash_geom_Vector3D = {0x03, 0x00, 0x80, 0x16, "flash.geom", "Vector3D", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_geom_Vector3D_subtract = {0x02, 0x00, 0x80, 0x16, "", "subtract", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_distance = {0x02, 0x00, 0x82, 0x16, "", "distance", 0, &_Number, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_scaleBy = {0x02, 0x00, 0x80, 0x16, "", "scaleBy", 0, 0, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_decrementBy = {0x02, 0x00, 0x80, 0x16, "", "decrementBy", 0, 0, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_scaleBy = {0x02, 0x00, 0x80, 0x16, "", "scaleBy", 0, &voidclass, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_decrementBy = {0x02, 0x00, 0x80, 0x16, "", "decrementBy", 0, &voidclass, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_equals = {0x02, 0x00, 0x80, 0x16, "", "equals", 0, &_Boolean, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_normalize = {0x02, 0x00, 0x80, 0x16, "", "normalize", 0, &_Number, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_dotProduct = {0x02, 0x00, 0x80, 0x16, "", "dotProduct", 0, &_Number, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_negate = {0x02, 0x00, 0x80, 0x16, "", "negate", 0, 0, &flash_geom_Vector3D, 0}; -static varinfo_t flash_geom_Vector3D_X_AXIS = {0x01, 0x00, 0x82, 0x16, "", "X_AXIS", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_angleBetween = {0x02, 0x00, 0x82, 0x16, "", "angleBetween", 0, &_Number, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_negate = {0x02, 0x00, 0x80, 0x16, "", "negate", 0, &voidclass, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_geom_Vector3D, 0}; static varinfo_t flash_geom_Vector3D_lengthSquared = {0x01, 0x00, 0x80, 0x16, "", "lengthSquared", 0, &_Number, &flash_geom_Vector3D, 0}; static varinfo_t flash_geom_Vector3D_x = {0x01, 0x00, 0x80, 0x16, "", "x", 0, &_Number, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_incrementBy = {0x02, 0x00, 0x80, 0x16, "", "incrementBy", 0, 0, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_incrementBy = {0x02, 0x00, 0x80, 0x16, "", "incrementBy", 0, &voidclass, &flash_geom_Vector3D, 0}; static varinfo_t flash_geom_Vector3D_w = {0x01, 0x00, 0x80, 0x16, "", "w", 0, &_Number, &flash_geom_Vector3D, 0}; static varinfo_t flash_geom_Vector3D_z = {0x01, 0x00, 0x80, 0x16, "", "z", 0, &_Number, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_add = {0x02, 0x00, 0x80, 0x16, "", "add", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; -static varinfo_t flash_geom_Vector3D_Z_AXIS = {0x01, 0x00, 0x82, 0x16, "", "Z_AXIS", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; -static methodinfo_t flash_geom_Vector3D_project = {0x02, 0x00, 0x80, 0x16, "", "project", 0, 0, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_project = {0x02, 0x00, 0x80, 0x16, "", "project", 0, &voidclass, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_crossProduct = {0x02, 0x00, 0x80, 0x16, "", "crossProduct", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_nearEquals = {0x02, 0x00, 0x80, 0x16, "", "nearEquals", 0, &_Boolean, &flash_geom_Vector3D, 0}; static methodinfo_t flash_geom_Vector3D_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; -static varinfo_t flash_geom_Vector3D_Y_AXIS = {0x01, 0x00, 0x82, 0x16, "", "Y_AXIS", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; static varinfo_t flash_geom_Vector3D_y = {0x01, 0x00, 0x80, 0x16, "", "y", 0, &_Number, &flash_geom_Vector3D, 0}; static varinfo_t flash_geom_Vector3D_length = {0x01, 0x00, 0x80, 0x16, "", "length", 0, &_Number, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_distance = {0x02, 0x00, 0x82, 0x16, "", "distance", 0, &_Number, &flash_geom_Vector3D, 0}; +static varinfo_t flash_geom_Vector3D_Z_AXIS = {0x01, 0x00, 0x82, 0x16, "", "Z_AXIS", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; +static varinfo_t flash_geom_Vector3D_X_AXIS = {0x01, 0x00, 0x82, 0x16, "", "X_AXIS", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; +static methodinfo_t flash_geom_Vector3D_angleBetween = {0x02, 0x00, 0x82, 0x16, "", "angleBetween", 0, &_Number, &flash_geom_Vector3D, 0}; +static varinfo_t flash_geom_Vector3D_Y_AXIS = {0x01, 0x00, 0x82, 0x16, "", "Y_AXIS", 0, &flash_geom_Vector3D, &flash_geom_Vector3D, 0}; static classinfo_t flash_desktop_ClipboardTransferMode = {0x03, 0x00, 0x80, 0x16, "flash.desktop", "ClipboardTransferMode", 0, &_Object, interfaces: {0}}; static varinfo_t flash_desktop_ClipboardTransferMode_CLONE_ONLY = {0x01, 0x00, 0x82, 0x16, "", "CLONE_ONLY", 0, &_String, &flash_desktop_ClipboardTransferMode, 0}; static varinfo_t flash_desktop_ClipboardTransferMode_ORIGINAL_PREFERRED = {0x01, 0x00, 0x82, 0x16, "", "ORIGINAL_PREFERRED", 0, &_String, &flash_desktop_ClipboardTransferMode, 0}; @@ -4471,9 +5398,9 @@ static varinfo_t flash_system_SecurityPanel_DISPLAY = {0x01, 0x00, 0x82, 0x16, "", "DISPLAY", 0, &_String, &flash_system_SecurityPanel, 0}; static classinfo_t flash_events_HTTPStatusEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "HTTPStatusEvent", 0, &flash_events_Event, interfaces: {0}}; static methodinfo_t flash_events_HTTPStatusEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_HTTPStatusEvent, 0}; -static varinfo_t flash_events_HTTPStatusEvent_HTTP_STATUS = {0x01, 0x00, 0x82, 0x16, "", "HTTP_STATUS", 0, &_String, &flash_events_HTTPStatusEvent, 0}; static methodinfo_t flash_events_HTTPStatusEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_HTTPStatusEvent, 0}; static varinfo_t flash_events_HTTPStatusEvent_status = {0x01, 0x00, 0x80, 0x16, "", "status", 0, &_int, &flash_events_HTTPStatusEvent, 0}; +static varinfo_t flash_events_HTTPStatusEvent_HTTP_STATUS = {0x01, 0x00, 0x82, 0x16, "", "HTTP_STATUS", 0, &_String, &flash_events_HTTPStatusEvent, 0}; static classinfo_t flash_net_NetStreamPlayOptions = {0x03, 0x00, 0x88, 0x16, "flash.net", "NetStreamPlayOptions", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_net_NetStreamPlayOptions_len = {0x01, 0x00, 0x80, 0x16, "", "len", 0, &_Number, &flash_net_NetStreamPlayOptions, 0}; static varinfo_t flash_net_NetStreamPlayOptions_streamName = {0x01, 0x00, 0x80, 0x16, "", "streamName", 0, &_String, &flash_net_NetStreamPlayOptions, 0}; @@ -4482,9 +5409,9 @@ static varinfo_t flash_net_NetStreamPlayOptions_transition = {0x01, 0x00, 0x80, 0x16, "", "transition", 0, &_String, &flash_net_NetStreamPlayOptions, 0}; static classinfo_t flash_net_Responder = {0x03, 0x00, 0x80, 0x16, "flash.net", "Responder", 0, &_Object, interfaces: {0}}; static classinfo_t flash_net_XMLSocket = {0x03, 0x00, 0x80, 0x16, "flash.net", "XMLSocket", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_net_XMLSocket_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_XMLSocket, 0}; -static methodinfo_t flash_net_XMLSocket_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, 0, &flash_net_XMLSocket, 0}; -static methodinfo_t flash_net_XMLSocket_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, 0, &flash_net_XMLSocket, 0}; +static methodinfo_t flash_net_XMLSocket_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_XMLSocket, 0}; +static methodinfo_t flash_net_XMLSocket_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, &voidclass, &flash_net_XMLSocket, 0}; +static methodinfo_t flash_net_XMLSocket_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, &voidclass, &flash_net_XMLSocket, 0}; static varinfo_t flash_net_XMLSocket_connected = {0x01, 0x00, 0x80, 0x16, "", "connected", 0, &_Boolean, &flash_net_XMLSocket, 0}; static varinfo_t flash_net_XMLSocket_timeout = {0x01, 0x00, 0x80, 0x16, "", "timeout", 0, &_int, &flash_net_XMLSocket, 0}; static classinfo_t flash_filters_ConvolutionFilter = {0x03, 0x00, 0x80, 0x16, "flash.filters", "ConvolutionFilter", 0, &flash_filters_BitmapFilter, interfaces: {0}}; @@ -4543,12 +5470,12 @@ static varinfo_t _AS3 = {0x01, 0x00, 0xa2, 0x16, "", "AS3", 0, 0, 0, &_AS3_constant}; static classinfo_t flash_net_LocalConnection = {0x03, 0x00, 0x80, 0x16, "flash.net", "LocalConnection", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t flash_net_LocalConnection_client = {0x01, 0x00, 0x80, 0x16, "", "client", 0, &_Object, &flash_net_LocalConnection, 0}; -static methodinfo_t flash_net_LocalConnection_allowDomain = {0x02, 0x00, 0x80, 0x16, "", "allowDomain", 0, 0, &flash_net_LocalConnection, 0}; -static methodinfo_t flash_net_LocalConnection_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, 0, &flash_net_LocalConnection, 0}; +static methodinfo_t flash_net_LocalConnection_allowDomain = {0x02, 0x00, 0x80, 0x16, "", "allowDomain", 0, &voidclass, &flash_net_LocalConnection, 0}; +static methodinfo_t flash_net_LocalConnection_connect = {0x02, 0x00, 0x80, 0x16, "", "connect", 0, &voidclass, &flash_net_LocalConnection, 0}; static varinfo_t flash_net_LocalConnection_domain = {0x01, 0x00, 0x80, 0x16, "", "domain", 0, &_String, &flash_net_LocalConnection, 0}; -static methodinfo_t flash_net_LocalConnection_allowInsecureDomain = {0x02, 0x00, 0x80, 0x16, "", "allowInsecureDomain", 0, 0, &flash_net_LocalConnection, 0}; -static methodinfo_t flash_net_LocalConnection_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, 0, &flash_net_LocalConnection, 0}; -static methodinfo_t flash_net_LocalConnection_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_LocalConnection, 0}; +static methodinfo_t flash_net_LocalConnection_allowInsecureDomain = {0x02, 0x00, 0x80, 0x16, "", "allowInsecureDomain", 0, &voidclass, &flash_net_LocalConnection, 0}; +static methodinfo_t flash_net_LocalConnection_send = {0x02, 0x00, 0x80, 0x16, "", "send", 0, &voidclass, &flash_net_LocalConnection, 0}; +static methodinfo_t flash_net_LocalConnection_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_LocalConnection, 0}; static classinfo_t flash_display_ShaderParameterType = {0x03, 0x00, 0x81, 0x16, "flash.display", "ShaderParameterType", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_ShaderParameterType_FLOAT = {0x01, 0x00, 0x82, 0x16, "", "FLOAT", 0, &_String, &flash_display_ShaderParameterType, 0}; static varinfo_t flash_display_ShaderParameterType_BOOL = {0x01, 0x00, 0x82, 0x16, "", "BOOL", 0, &_String, &flash_display_ShaderParameterType, 0}; @@ -4572,18 +5499,18 @@ static classinfo_t flash_text_TextFormatDisplay = {0x03, 0x00, 0x81, 0x16, "flash.text", "TextFormatDisplay", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_TextFormatDisplay_INLINE = {0x01, 0x00, 0x82, 0x16, "", "INLINE", 0, &_String, &flash_text_TextFormatDisplay, 0}; static varinfo_t flash_text_TextFormatDisplay_BLOCK = {0x01, 0x00, 0x82, 0x16, "", "BLOCK", 0, &_String, &flash_text_TextFormatDisplay, 0}; -static methodinfo_t flash_profiler_profile = {0x02, 0x00, 0x82, 0x16, "flash.profiler", "profile", 0, 0, 0, 0}; +static methodinfo_t flash_profiler_profile = {0x02, 0x00, 0x82, 0x16, "flash.profiler", "profile", 0, &voidclass, 0, 0}; static classinfo_t flash_display_AVM1Movie = {0x03, 0x00, 0x80, 0x16, "flash.display", "AVM1Movie", 0, &flash_display_DisplayObject, interfaces: {0}}; static methodinfo_t flash_display_AVM1Movie_call = {0x02, 0x00, 0x80, 0x16, "", "call", 0, 0, &flash_display_AVM1Movie, 0}; -static methodinfo_t flash_display_AVM1Movie_addCallback = {0x02, 0x00, 0x80, 0x16, "", "addCallback", 0, 0, &flash_display_AVM1Movie, 0}; +static methodinfo_t flash_display_AVM1Movie_addCallback = {0x02, 0x00, 0x80, 0x16, "", "addCallback", 0, &voidclass, &flash_display_AVM1Movie, 0}; static classinfo_t flash_events_ContextMenuEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "ContextMenuEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_ContextMenuEvent_isMouseTargetInaccessible = {0x01, 0x00, 0x80, 0x16, "", "isMouseTargetInaccessible", 0, &_Boolean, &flash_events_ContextMenuEvent, 0}; static varinfo_t flash_events_ContextMenuEvent_mouseTarget = {0x01, 0x00, 0x80, 0x16, "", "mouseTarget", 0, &flash_display_InteractiveObject, &flash_events_ContextMenuEvent, 0}; -static varinfo_t flash_events_ContextMenuEvent_contextMenuOwner = {0x01, 0x00, 0x80, 0x16, "", "contextMenuOwner", 0, &flash_display_InteractiveObject, &flash_events_ContextMenuEvent, 0}; -static varinfo_t flash_events_ContextMenuEvent_MENU_ITEM_SELECT = {0x01, 0x00, 0x82, 0x16, "", "MENU_ITEM_SELECT", 0, &_String, &flash_events_ContextMenuEvent, 0}; -static varinfo_t flash_events_ContextMenuEvent_MENU_SELECT = {0x01, 0x00, 0x82, 0x16, "", "MENU_SELECT", 0, &_String, &flash_events_ContextMenuEvent, 0}; +static varinfo_t flash_events_ContextMenuEvent_isMouseTargetInaccessible = {0x01, 0x00, 0x80, 0x16, "", "isMouseTargetInaccessible", 0, &_Boolean, &flash_events_ContextMenuEvent, 0}; static methodinfo_t flash_events_ContextMenuEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_ContextMenuEvent, 0}; +static varinfo_t flash_events_ContextMenuEvent_contextMenuOwner = {0x01, 0x00, 0x80, 0x16, "", "contextMenuOwner", 0, &flash_display_InteractiveObject, &flash_events_ContextMenuEvent, 0}; static methodinfo_t flash_events_ContextMenuEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_ContextMenuEvent, 0}; +static varinfo_t flash_events_ContextMenuEvent_MENU_SELECT = {0x01, 0x00, 0x82, 0x16, "", "MENU_SELECT", 0, &_String, &flash_events_ContextMenuEvent, 0}; +static varinfo_t flash_events_ContextMenuEvent_MENU_ITEM_SELECT = {0x01, 0x00, 0x82, 0x16, "", "MENU_ITEM_SELECT", 0, &_String, &flash_events_ContextMenuEvent, 0}; static classinfo_t flash_events_EventPhase = {0x03, 0x00, 0x81, 0x16, "flash.events", "EventPhase", 0, &_Object, interfaces: {0}}; static varinfo_t flash_events_EventPhase_BUBBLING_PHASE = {0x01, 0x00, 0x82, 0x16, "", "BUBBLING_PHASE", 0, &_uint, &flash_events_EventPhase, 0}; static varinfo_t flash_events_EventPhase_CAPTURING_PHASE = {0x01, 0x00, 0x82, 0x16, "", "CAPTURING_PHASE", 0, &_uint, &flash_events_EventPhase, 0}; @@ -4617,17 +5544,17 @@ static methodinfo_t flash_utils_getTimer = {0x02, 0x00, 0x82, 0x16, "flash.utils", "getTimer", 0, &_int, 0, 0}; static classinfo_t flash_display_Loader = {0x03, 0x00, 0x80, 0x16, "flash.display", "Loader", 0, &flash_display_DisplayObjectContainer, interfaces: {0}}; static varinfo_t flash_display_Loader_content = {0x01, 0x00, 0x80, 0x16, "", "content", 0, &flash_display_DisplayObject, &flash_display_Loader, 0}; -static methodinfo_t flash_display_Loader_unloadAndStop = {0x02, 0x00, 0x80, 0x16, "", "unloadAndStop", 0, 0, &flash_display_Loader, 0}; -static methodinfo_t flash_display_Loader_unload = {0x02, 0x00, 0x80, 0x16, "", "unload", 0, 0, &flash_display_Loader, 0}; +static methodinfo_t flash_display_Loader_unloadAndStop = {0x02, 0x00, 0x80, 0x16, "", "unloadAndStop", 0, &voidclass, &flash_display_Loader, 0}; +static methodinfo_t flash_display_Loader_unload = {0x02, 0x00, 0x80, 0x16, "", "unload", 0, &voidclass, &flash_display_Loader, 0}; static methodinfo_t flash_display_Loader_removeChildAt = {0x02, 0x00, 0x80, 0x16, "", "removeChildAt", 0, &flash_display_DisplayObject, &flash_display_Loader, 0}; static methodinfo_t flash_display_Loader_addChildAt = {0x02, 0x00, 0x80, 0x16, "", "addChildAt", 0, &flash_display_DisplayObject, &flash_display_Loader, 0}; static varinfo_t flash_display_Loader_contentLoaderInfo = {0x01, 0x00, 0x80, 0x16, "", "contentLoaderInfo", 0, &flash_display_LoaderInfo, &flash_display_Loader, 0}; -static methodinfo_t flash_display_Loader_loadBytes = {0x02, 0x00, 0x80, 0x16, "", "loadBytes", 0, 0, &flash_display_Loader, 0}; +static methodinfo_t flash_display_Loader_loadBytes = {0x02, 0x00, 0x80, 0x16, "", "loadBytes", 0, &voidclass, &flash_display_Loader, 0}; static methodinfo_t flash_display_Loader_removeChild = {0x02, 0x00, 0x80, 0x16, "", "removeChild", 0, &flash_display_DisplayObject, &flash_display_Loader, 0}; -static methodinfo_t flash_display_Loader_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, 0, &flash_display_Loader, 0}; +static methodinfo_t flash_display_Loader_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, &voidclass, &flash_display_Loader, 0}; static methodinfo_t flash_display_Loader_addChild = {0x02, 0x00, 0x80, 0x16, "", "addChild", 0, &flash_display_DisplayObject, &flash_display_Loader, 0}; -static methodinfo_t flash_display_Loader_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_display_Loader, 0}; -static methodinfo_t flash_display_Loader_setChildIndex = {0x02, 0x00, 0x80, 0x16, "", "setChildIndex", 0, 0, &flash_display_Loader, 0}; +static methodinfo_t flash_display_Loader_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_display_Loader, 0}; +static methodinfo_t flash_display_Loader_setChildIndex = {0x02, 0x00, 0x80, 0x16, "", "setChildIndex", 0, &voidclass, &flash_display_Loader, 0}; static classinfo_t flash_display_GraphicsBitmapFill = {0x03, 0x00, 0x81, 0x16, "flash.display", "GraphicsBitmapFill", 0, &_Object, interfaces: {&flash_display_IGraphicsFill, &flash_display_IGraphicsData, 0}}; static varinfo_t flash_display_GraphicsBitmapFill_smooth = {0x01, 0x00, 0x80, 0x16, "", "smooth", 0, &_Boolean, &flash_display_GraphicsBitmapFill, 0}; static varinfo_t flash_display_GraphicsBitmapFill_repeat = {0x01, 0x00, 0x80, 0x16, "", "repeat", 0, &_Boolean, &flash_display_GraphicsBitmapFill, 0}; @@ -4657,16 +5584,16 @@ static varinfo_t flash_display_PixelSnapping_NEVER = {0x01, 0x00, 0x82, 0x16, "", "NEVER", 0, &_String, &flash_display_PixelSnapping, 0}; static varinfo_t flash_display_PixelSnapping_ALWAYS = {0x01, 0x00, 0x82, 0x16, "", "ALWAYS", 0, &_String, &flash_display_PixelSnapping, 0}; static classinfo_t flash_events_FocusEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "FocusEvent", 0, &flash_events_Event, interfaces: {0}}; -static varinfo_t flash_events_FocusEvent_FOCUS_OUT = {0x01, 0x00, 0x82, 0x16, "", "FOCUS_OUT", 0, &_String, &flash_events_FocusEvent, 0}; -static varinfo_t flash_events_FocusEvent_KEY_FOCUS_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "KEY_FOCUS_CHANGE", 0, &_String, &flash_events_FocusEvent, 0}; -static varinfo_t flash_events_FocusEvent_shiftKey = {0x01, 0x00, 0x80, 0x16, "", "shiftKey", 0, &_Boolean, &flash_events_FocusEvent, 0}; -static varinfo_t flash_events_FocusEvent_isRelatedObjectInaccessible = {0x01, 0x00, 0x80, 0x16, "", "isRelatedObjectInaccessible", 0, &_Boolean, &flash_events_FocusEvent, 0}; static varinfo_t flash_events_FocusEvent_keyCode = {0x01, 0x00, 0x80, 0x16, "", "keyCode", 0, &_uint, &flash_events_FocusEvent, 0}; +static methodinfo_t flash_events_FocusEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_FocusEvent, 0}; +static varinfo_t flash_events_FocusEvent_isRelatedObjectInaccessible = {0x01, 0x00, 0x80, 0x16, "", "isRelatedObjectInaccessible", 0, &_Boolean, &flash_events_FocusEvent, 0}; +static methodinfo_t flash_events_FocusEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_FocusEvent, 0}; +static varinfo_t flash_events_FocusEvent_shiftKey = {0x01, 0x00, 0x80, 0x16, "", "shiftKey", 0, &_Boolean, &flash_events_FocusEvent, 0}; static varinfo_t flash_events_FocusEvent_relatedObject = {0x01, 0x00, 0x80, 0x16, "", "relatedObject", 0, &flash_display_InteractiveObject, &flash_events_FocusEvent, 0}; static varinfo_t flash_events_FocusEvent_FOCUS_IN = {0x01, 0x00, 0x82, 0x16, "", "FOCUS_IN", 0, &_String, &flash_events_FocusEvent, 0}; +static varinfo_t flash_events_FocusEvent_FOCUS_OUT = {0x01, 0x00, 0x82, 0x16, "", "FOCUS_OUT", 0, &_String, &flash_events_FocusEvent, 0}; +static varinfo_t flash_events_FocusEvent_KEY_FOCUS_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "KEY_FOCUS_CHANGE", 0, &_String, &flash_events_FocusEvent, 0}; static varinfo_t flash_events_FocusEvent_MOUSE_FOCUS_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_FOCUS_CHANGE", 0, &_String, &flash_events_FocusEvent, 0}; -static methodinfo_t flash_events_FocusEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_FocusEvent, 0}; -static methodinfo_t flash_events_FocusEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_FocusEvent, 0}; static classinfo_t flash_errors_MemoryError = {0x03, 0x00, 0x88, 0x16, "flash.errors", "MemoryError", 0, &_Error, interfaces: {0}}; static classinfo_t flash_events_NetFilterEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "NetFilterEvent", 0, &flash_events_Event, interfaces: {0}}; static varinfo_t flash_events_NetFilterEvent_header = {0x01, 0x00, 0x80, 0x16, "", "header", 0, &flash_utils_ByteArray, &flash_events_NetFilterEvent, 0}; @@ -4686,7 +5613,7 @@ static classinfo_t flash_external_ExternalInterface = {0x03, 0x00, 0x81, 0x16, "flash.external", "ExternalInterface", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_external_ExternalInterface_call = {0x02, 0x00, 0x82, 0x16, "", "call", 0, 0, &flash_external_ExternalInterface, 0}; static varinfo_t flash_external_ExternalInterface_available = {0x01, 0x00, 0x82, 0x16, "", "available", 0, &_Boolean, &flash_external_ExternalInterface, 0}; -static methodinfo_t flash_external_ExternalInterface_addCallback = {0x02, 0x00, 0x82, 0x16, "", "addCallback", 0, 0, &flash_external_ExternalInterface, 0}; +static methodinfo_t flash_external_ExternalInterface_addCallback = {0x02, 0x00, 0x82, 0x16, "", "addCallback", 0, &voidclass, &flash_external_ExternalInterface, 0}; static varinfo_t flash_external_ExternalInterface_marshallExceptions = {0x01, 0x00, 0x82, 0x16, "", "marshallExceptions", 0, &_Boolean, &flash_external_ExternalInterface, 0}; static varinfo_t flash_external_ExternalInterface_objectID = {0x01, 0x00, 0x82, 0x16, "", "objectID", 0, &_String, &flash_external_ExternalInterface, 0}; static classinfo_t _EvalError = {0x03, 0x00, 0x88, 0x16, "", "EvalError", 0, &_Error, interfaces: {0}}; @@ -4702,15 +5629,15 @@ static varinfo_t flash_text_TextFormatAlign_JUSTIFY = {0x01, 0x00, 0x82, 0x16, "", "JUSTIFY", 0, &_String, &flash_text_TextFormatAlign, 0}; static classinfo_t flash_errors_ScriptTimeoutError = {0x03, 0x00, 0x88, 0x16, "flash.errors", "ScriptTimeoutError", 0, &_Error, interfaces: {0}}; static classinfo_t _uint = {0x03, 0x00, 0x81, 0x16, "", "uint", 0, &_Object, interfaces: {0}}; -static varinfo_t _uint_MAX_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MAX_VALUE", 0, &_uint, &_uint, 0}; static methodinfo_t _uint_valueOf = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "valueOf", 0, &_uint, &_uint, 0}; -static varinfo_t _uint_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_uint, 0}; -static varinfo_t _uint_MIN_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MIN_VALUE", 0, &_uint, &_uint, 0}; static methodinfo_t _uint_toString = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toString", 0, &_String, &_uint, 0}; static methodinfo_t _uint_toExponential = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toExponential", 0, &_String, &_uint, 0}; static methodinfo_t _uint_toFixed = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toFixed", 0, &_String, &_uint, 0}; static methodinfo_t _uint_toPrecision = {0x02, 0x00, 0x80, 0x08, "http://adobe.com/AS3/2006/builtin", "toPrecision", 0, &_String, &_uint, 0}; -static methodinfo_t flash_debugger_enterDebugger = {0x02, 0x00, 0x82, 0x16, "flash.debugger", "enterDebugger", 0, 0, 0, 0}; +static varinfo_t _uint_MAX_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MAX_VALUE", 0, &_uint, &_uint, 0}; +static varinfo_t _uint_length = {0x01, 0x00, 0x82, 0x16, "", "length", 0, &_int, &_uint, 0}; +static varinfo_t _uint_MIN_VALUE = {0x01, 0x00, 0x82, 0x16, "", "MIN_VALUE", 0, &_uint, &_uint, 0}; +static methodinfo_t flash_debugger_enterDebugger = {0x02, 0x00, 0x82, 0x16, "flash.debugger", "enterDebugger", 0, &voidclass, 0, 0}; static classinfo_t flash_geom_Orientation3D = {0x03, 0x00, 0x81, 0x16, "flash.geom", "Orientation3D", 0, &_Object, interfaces: {0}}; static varinfo_t flash_geom_Orientation3D_QUATERNION = {0x01, 0x00, 0x82, 0x16, "", "QUATERNION", 0, &_String, &flash_geom_Orientation3D, 0}; static varinfo_t flash_geom_Orientation3D_EULER_ANGLES = {0x01, 0x00, 0x82, 0x16, "", "EULER_ANGLES", 0, &_String, &flash_geom_Orientation3D, 0}; @@ -4729,33 +5656,33 @@ static varinfo_t flash_filters_ShaderFilter_leftExtension = {0x01, 0x00, 0x80, 0x16, "", "leftExtension", 0, &_int, &flash_filters_ShaderFilter, 0}; static varinfo_t flash_filters_ShaderFilter_topExtension = {0x01, 0x00, 0x80, 0x16, "", "topExtension", 0, &_int, &flash_filters_ShaderFilter, 0}; static classinfo_t flash_display_GraphicsPath = {0x03, 0x00, 0x81, 0x16, "flash.display", "GraphicsPath", 0, &_Object, interfaces: {&flash_display_IGraphicsPath, &flash_display_IGraphicsData, 0}}; -static methodinfo_t flash_display_GraphicsPath_wideMoveTo = {0x02, 0x00, 0x80, 0x16, "", "wideMoveTo", 0, 0, &flash_display_GraphicsPath, 0}; +static methodinfo_t flash_display_GraphicsPath_wideMoveTo = {0x02, 0x00, 0x80, 0x16, "", "wideMoveTo", 0, &voidclass, &flash_display_GraphicsPath, 0}; static varinfo_t flash_display_GraphicsPath_winding = {0x01, 0x00, 0x80, 0x16, "", "winding", 0, &_String, &flash_display_GraphicsPath, 0}; -static methodinfo_t flash_display_GraphicsPath_moveTo = {0x02, 0x00, 0x80, 0x16, "", "moveTo", 0, 0, &flash_display_GraphicsPath, 0}; -static methodinfo_t flash_display_GraphicsPath_wideLineTo = {0x02, 0x00, 0x80, 0x16, "", "wideLineTo", 0, 0, &flash_display_GraphicsPath, 0}; +static methodinfo_t flash_display_GraphicsPath_moveTo = {0x02, 0x00, 0x80, 0x16, "", "moveTo", 0, &voidclass, &flash_display_GraphicsPath, 0}; +static methodinfo_t flash_display_GraphicsPath_wideLineTo = {0x02, 0x00, 0x80, 0x16, "", "wideLineTo", 0, &voidclass, &flash_display_GraphicsPath, 0}; static varinfo_t flash_display_GraphicsPath_commands = {0x01, 0x00, 0x80, 0x16, "", "commands", 0, &__AS3___vec_Vector, &flash_display_GraphicsPath, 0}; -static methodinfo_t flash_display_GraphicsPath_curveTo = {0x02, 0x00, 0x80, 0x16, "", "curveTo", 0, 0, &flash_display_GraphicsPath, 0}; -static methodinfo_t flash_display_GraphicsPath_lineTo = {0x02, 0x00, 0x80, 0x16, "", "lineTo", 0, 0, &flash_display_GraphicsPath, 0}; +static methodinfo_t flash_display_GraphicsPath_curveTo = {0x02, 0x00, 0x80, 0x16, "", "curveTo", 0, &voidclass, &flash_display_GraphicsPath, 0}; +static methodinfo_t flash_display_GraphicsPath_lineTo = {0x02, 0x00, 0x80, 0x16, "", "lineTo", 0, &voidclass, &flash_display_GraphicsPath, 0}; static varinfo_t flash_display_GraphicsPath_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, &__AS3___vec_Vector, &flash_display_GraphicsPath, 0}; static classinfo_t flash_system_ApplicationDomain = {0x03, 0x00, 0x81, 0x16, "flash.system", "ApplicationDomain", 0, &_Object, interfaces: {0}}; static methodinfo_t flash_system_ApplicationDomain_hasDefinition = {0x02, 0x00, 0x80, 0x16, "", "hasDefinition", 0, &_Boolean, &flash_system_ApplicationDomain, 0}; static methodinfo_t flash_system_ApplicationDomain_getDefinition = {0x02, 0x00, 0x80, 0x16, "", "getDefinition", 0, &_Object, &flash_system_ApplicationDomain, 0}; -static varinfo_t flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH = {0x01, 0x00, 0x82, 0x16, "", "MIN_DOMAIN_MEMORY_LENGTH", 0, &_uint, &flash_system_ApplicationDomain, 0}; static varinfo_t flash_system_ApplicationDomain_parentDomain = {0x01, 0x00, 0x80, 0x16, "", "parentDomain", 0, &flash_system_ApplicationDomain, &flash_system_ApplicationDomain, 0}; static varinfo_t flash_system_ApplicationDomain_domainMemory = {0x01, 0x00, 0x80, 0x16, "", "domainMemory", 0, &flash_utils_ByteArray, &flash_system_ApplicationDomain, 0}; +static varinfo_t flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH = {0x01, 0x00, 0x82, 0x16, "", "MIN_DOMAIN_MEMORY_LENGTH", 0, &_uint, &flash_system_ApplicationDomain, 0}; static varinfo_t flash_system_ApplicationDomain_currentDomain = {0x01, 0x00, 0x82, 0x16, "", "currentDomain", 0, &flash_system_ApplicationDomain, &flash_system_ApplicationDomain, 0}; static classinfo_t flash_events_KeyboardEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "KeyboardEvent", 0, &flash_events_Event, interfaces: {0}}; -static methodinfo_t flash_events_KeyboardEvent_updateAfterEvent = {0x02, 0x00, 0x80, 0x16, "", "updateAfterEvent", 0, 0, &flash_events_KeyboardEvent, 0}; -static varinfo_t flash_events_KeyboardEvent_charCode = {0x01, 0x00, 0x80, 0x16, "", "charCode", 0, &_uint, &flash_events_KeyboardEvent, 0}; -static varinfo_t flash_events_KeyboardEvent_KEY_UP = {0x01, 0x00, 0x82, 0x16, "", "KEY_UP", 0, &_String, &flash_events_KeyboardEvent, 0}; -static varinfo_t flash_events_KeyboardEvent_KEY_DOWN = {0x01, 0x00, 0x82, 0x16, "", "KEY_DOWN", 0, &_String, &flash_events_KeyboardEvent, 0}; -static methodinfo_t flash_events_KeyboardEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_KeyboardEvent, 0}; +static varinfo_t flash_events_KeyboardEvent_shiftKey = {0x01, 0x00, 0x80, 0x16, "", "shiftKey", 0, &_Boolean, &flash_events_KeyboardEvent, 0}; +static varinfo_t flash_events_KeyboardEvent_keyCode = {0x01, 0x00, 0x80, 0x16, "", "keyCode", 0, &_uint, &flash_events_KeyboardEvent, 0}; static varinfo_t flash_events_KeyboardEvent_keyLocation = {0x01, 0x00, 0x80, 0x16, "", "keyLocation", 0, &_uint, &flash_events_KeyboardEvent, 0}; -static varinfo_t flash_events_KeyboardEvent_shiftKey = {0x01, 0x00, 0x80, 0x16, "", "shiftKey", 0, &_Boolean, &flash_events_KeyboardEvent, 0}; -static methodinfo_t flash_events_KeyboardEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_KeyboardEvent, 0}; -static varinfo_t flash_events_KeyboardEvent_ctrlKey = {0x01, 0x00, 0x80, 0x16, "", "ctrlKey", 0, &_Boolean, &flash_events_KeyboardEvent, 0}; +static methodinfo_t flash_events_KeyboardEvent_updateAfterEvent = {0x02, 0x00, 0x80, 0x16, "", "updateAfterEvent", 0, &voidclass, &flash_events_KeyboardEvent, 0}; +static methodinfo_t flash_events_KeyboardEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_KeyboardEvent, 0}; static varinfo_t flash_events_KeyboardEvent_altKey = {0x01, 0x00, 0x80, 0x16, "", "altKey", 0, &_Boolean, &flash_events_KeyboardEvent, 0}; -static varinfo_t flash_events_KeyboardEvent_keyCode = {0x01, 0x00, 0x80, 0x16, "", "keyCode", 0, &_uint, &flash_events_KeyboardEvent, 0}; +static varinfo_t flash_events_KeyboardEvent_ctrlKey = {0x01, 0x00, 0x80, 0x16, "", "ctrlKey", 0, &_Boolean, &flash_events_KeyboardEvent, 0}; +static methodinfo_t flash_events_KeyboardEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_KeyboardEvent, 0}; +static varinfo_t flash_events_KeyboardEvent_charCode = {0x01, 0x00, 0x80, 0x16, "", "charCode", 0, &_uint, &flash_events_KeyboardEvent, 0}; +static varinfo_t flash_events_KeyboardEvent_KEY_DOWN = {0x01, 0x00, 0x82, 0x16, "", "KEY_DOWN", 0, &_String, &flash_events_KeyboardEvent, 0}; +static varinfo_t flash_events_KeyboardEvent_KEY_UP = {0x01, 0x00, 0x82, 0x16, "", "KEY_UP", 0, &_String, &flash_events_KeyboardEvent, 0}; static classinfo_t adobe_utils_ProductManager = {0x03, 0x00, 0x81, 0x16, "adobe.utils", "ProductManager", 0, &flash_events_EventDispatcher, interfaces: {0}}; static varinfo_t adobe_utils_ProductManager_running = {0x01, 0x00, 0x80, 0x16, "", "running", 0, &_Boolean, &adobe_utils_ProductManager, 0}; static methodinfo_t adobe_utils_ProductManager_download = {0x02, 0x00, 0x80, 0x16, "", "download", 0, &_Boolean, &adobe_utils_ProductManager, 0}; @@ -4763,119 +5690,119 @@ static varinfo_t adobe_utils_ProductManager_installed = {0x01, 0x00, 0x80, 0x16, "", "installed", 0, &_Boolean, &adobe_utils_ProductManager, 0}; static methodinfo_t adobe_utils_ProductManager_launch = {0x02, 0x00, 0x80, 0x16, "", "launch", 0, &_Boolean, &adobe_utils_ProductManager, 0}; static classinfo_t flash_events_Event = {0x03, 0x00, 0x80, 0x16, "flash.events", "Event", 0, &_Object, interfaces: {0}}; -static varinfo_t flash_events_Event_CLEAR = {0x01, 0x00, 0x82, 0x16, "", "CLEAR", 0, &_String, &flash_events_Event, 0}; -static methodinfo_t flash_events_Event_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_type = {0x01, 0x00, 0x80, 0x16, "", "type", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_cancelable = {0x01, 0x00, 0x80, 0x16, "", "cancelable", 0, &_Boolean, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_CANCEL = {0x01, 0x00, 0x82, 0x16, "", "CANCEL", 0, &_String, &flash_events_Event, 0}; +static methodinfo_t flash_events_Event_isDefaultPrevented = {0x02, 0x00, 0x80, 0x16, "", "isDefaultPrevented", 0, &_Boolean, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_target = {0x01, 0x00, 0x80, 0x16, "", "target", 0, &_Object, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_eventPhase = {0x01, 0x00, 0x80, 0x16, "", "eventPhase", 0, &_uint, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_currentTarget = {0x01, 0x00, 0x80, 0x16, "", "currentTarget", 0, &_Object, &flash_events_Event, 0}; +static methodinfo_t flash_events_Event_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_Event, 0}; +static methodinfo_t flash_events_Event_stopImmediatePropagation = {0x02, 0x00, 0x80, 0x16, "", "stopImmediatePropagation", 0, &voidclass, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_bubbles = {0x01, 0x00, 0x80, 0x16, "", "bubbles", 0, &_Boolean, &flash_events_Event, 0}; +static methodinfo_t flash_events_Event_stopPropagation = {0x02, 0x00, 0x80, 0x16, "", "stopPropagation", 0, &voidclass, &flash_events_Event, 0}; static methodinfo_t flash_events_Event_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_CONNECT = {0x01, 0x00, 0x82, 0x16, "", "CONNECT", 0, &_String, &flash_events_Event, 0}; +static methodinfo_t flash_events_Event_preventDefault = {0x02, 0x00, 0x80, 0x16, "", "preventDefault", 0, &voidclass, &flash_events_Event, 0}; +static methodinfo_t flash_events_Event_formatToString = {0x02, 0x00, 0x80, 0x16, "", "formatToString", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_REMOVED_FROM_STAGE = {0x01, 0x00, 0x82, 0x16, "", "REMOVED_FROM_STAGE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_FRAME_CONSTRUCTED = {0x01, 0x00, 0x82, 0x16, "", "FRAME_CONSTRUCTED", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_TAB_INDEX_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "TAB_INDEX_CHANGE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_currentTarget = {0x01, 0x00, 0x80, 0x16, "", "currentTarget", 0, &_Object, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_ADDED = {0x01, 0x00, 0x82, 0x16, "", "ADDED", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_CLEAR = {0x01, 0x00, 0x82, 0x16, "", "CLEAR", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_OPEN = {0x01, 0x00, 0x82, 0x16, "", "OPEN", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_TAB_CHILDREN_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "TAB_CHILDREN_CHANGE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "COMPLETE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_ACTIVATE = {0x01, 0x00, 0x82, 0x16, "", "ACTIVATE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_RENDER = {0x01, 0x00, 0x82, 0x16, "", "RENDER", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_EXIT_FRAME = {0x01, 0x00, 0x82, 0x16, "", "EXIT_FRAME", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_type = {0x01, 0x00, 0x80, 0x16, "", "type", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_DEACTIVATE = {0x01, 0x00, 0x82, 0x16, "", "DEACTIVATE", 0, &_String, &flash_events_Event, 0}; -static methodinfo_t flash_events_Event_stopImmediatePropagation = {0x02, 0x00, 0x80, 0x16, "", "stopImmediatePropagation", 0, 0, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_SELECT_ALL = {0x01, 0x00, 0x82, 0x16, "", "SELECT_ALL", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_CUT = {0x01, 0x00, 0x82, 0x16, "", "CUT", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_ENTER_FRAME = {0x01, 0x00, 0x82, 0x16, "", "ENTER_FRAME", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_INIT = {0x01, 0x00, 0x82, 0x16, "", "INIT", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_ACTIVATE = {0x01, 0x00, 0x82, 0x16, "", "ACTIVATE", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_SOUND_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "SOUND_COMPLETE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_COPY = {0x01, 0x00, 0x82, 0x16, "", "COPY", 0, &_String, &flash_events_Event, 0}; -static methodinfo_t flash_events_Event_isDefaultPrevented = {0x02, 0x00, 0x80, 0x16, "", "isDefaultPrevented", 0, &_Boolean, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_PASTE = {0x01, 0x00, 0x82, 0x16, "", "PASTE", 0, &_String, &flash_events_Event, 0}; -static methodinfo_t flash_events_Event_stopPropagation = {0x02, 0x00, 0x80, 0x16, "", "stopPropagation", 0, 0, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_CLOSE = {0x01, 0x00, 0x82, 0x16, "", "CLOSE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_CANCEL = {0x01, 0x00, 0x82, 0x16, "", "CANCEL", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_REMOVED = {0x01, 0x00, 0x82, 0x16, "", "REMOVED", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_TAB_ENABLED_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "TAB_ENABLED_CHANGE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_eventPhase = {0x01, 0x00, 0x80, 0x16, "", "eventPhase", 0, &_uint, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_INIT = {0x01, 0x00, 0x82, 0x16, "", "INIT", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_FRAME_CONSTRUCTED = {0x01, 0x00, 0x82, 0x16, "", "FRAME_CONSTRUCTED", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_SCROLL = {0x01, 0x00, 0x82, 0x16, "", "SCROLL", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_TAB_INDEX_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "TAB_INDEX_CHANGE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "CHANGE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_ADDED_TO_STAGE = {0x01, 0x00, 0x82, 0x16, "", "ADDED_TO_STAGE", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_UNLOAD = {0x01, 0x00, 0x82, 0x16, "", "UNLOAD", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_bubbles = {0x01, 0x00, 0x80, 0x16, "", "bubbles", 0, &_Boolean, &flash_events_Event, 0}; -static methodinfo_t flash_events_Event_formatToString = {0x02, 0x00, 0x80, 0x16, "", "formatToString", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_FULLSCREEN = {0x01, 0x00, 0x82, 0x16, "", "FULLSCREEN", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_MOUSE_LEAVE = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_LEAVE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_SELECT = {0x01, 0x00, 0x82, 0x16, "", "SELECT", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_CONNECT = {0x01, 0x00, 0x82, 0x16, "", "CONNECT", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_CUT = {0x01, 0x00, 0x82, 0x16, "", "CUT", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_PASTE = {0x01, 0x00, 0x82, 0x16, "", "PASTE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_ADDED = {0x01, 0x00, 0x82, 0x16, "", "ADDED", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_ID3 = {0x01, 0x00, 0x82, 0x16, "", "ID3", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_ENTER_FRAME = {0x01, 0x00, 0x82, 0x16, "", "ENTER_FRAME", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_RENDER = {0x01, 0x00, 0x82, 0x16, "", "RENDER", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_EXIT_FRAME = {0x01, 0x00, 0x82, 0x16, "", "EXIT_FRAME", 0, &_String, &flash_events_Event, 0}; static varinfo_t flash_events_Event_RESIZE = {0x01, 0x00, 0x82, 0x16, "", "RESIZE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "CHANGE", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_SELECT = {0x01, 0x00, 0x82, 0x16, "", "SELECT", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_SCROLL = {0x01, 0x00, 0x82, 0x16, "", "SCROLL", 0, &_String, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_ADDED_TO_STAGE = {0x01, 0x00, 0x82, 0x16, "", "ADDED_TO_STAGE", 0, &_String, &flash_events_Event, 0}; -static methodinfo_t flash_events_Event_preventDefault = {0x02, 0x00, 0x80, 0x16, "", "preventDefault", 0, 0, &flash_events_Event, 0}; -static varinfo_t flash_events_Event_target = {0x01, 0x00, 0x80, 0x16, "", "target", 0, &_Object, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_FULLSCREEN = {0x01, 0x00, 0x82, 0x16, "", "FULLSCREEN", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_MOUSE_LEAVE = {0x01, 0x00, 0x82, 0x16, "", "MOUSE_LEAVE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_CLOSE = {0x01, 0x00, 0x82, 0x16, "", "CLOSE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_SELECT_ALL = {0x01, 0x00, 0x82, 0x16, "", "SELECT_ALL", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_TAB_ENABLED_CHANGE = {0x01, 0x00, 0x82, 0x16, "", "TAB_ENABLED_CHANGE", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_COPY = {0x01, 0x00, 0x82, 0x16, "", "COPY", 0, &_String, &flash_events_Event, 0}; +static varinfo_t flash_events_Event_COMPLETE = {0x01, 0x00, 0x82, 0x16, "", "COMPLETE", 0, &_String, &flash_events_Event, 0}; static classinfo_t flash_desktop_ClipboardFormats = {0x03, 0x00, 0x80, 0x16, "flash.desktop", "ClipboardFormats", 0, &_Object, interfaces: {0}}; static varinfo_t flash_desktop_ClipboardFormats_TEXT_FORMAT = {0x01, 0x00, 0x82, 0x16, "", "TEXT_FORMAT", 0, &_String, &flash_desktop_ClipboardFormats, 0}; static varinfo_t flash_desktop_ClipboardFormats_BITMAP_FORMAT = {0x01, 0x00, 0x82, 0x16, "", "BITMAP_FORMAT", 0, &_String, &flash_desktop_ClipboardFormats, 0}; -static varinfo_t flash_desktop_ClipboardFormats_FLASH_PREFIX = {0x01, 0x00, 0x82, 0x17, "flash.desktop", "FLASH_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; +static varinfo_t flash_desktop_ClipboardFormats_FLASH_PREFIX = {0x01, 0x00, 0x82, 0x17, "", "FLASH_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; static varinfo_t flash_desktop_ClipboardFormats_HTML_FORMAT = {0x01, 0x00, 0x82, 0x16, "", "HTML_FORMAT", 0, &_String, &flash_desktop_ClipboardFormats, 0}; -static varinfo_t flash_desktop_ClipboardFormats_REFERENCE_PREFIX = {0x01, 0x00, 0x82, 0x17, "flash.desktop", "REFERENCE_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; -static varinfo_t flash_desktop_ClipboardFormats_AIR_PREFIX = {0x01, 0x00, 0x82, 0x17, "flash.desktop", "AIR_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; -static varinfo_t flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX = {0x01, 0x00, 0x82, 0x17, "flash.desktop", "SERIALIZATION_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; +static varinfo_t flash_desktop_ClipboardFormats_REFERENCE_PREFIX = {0x01, 0x00, 0x82, 0x17, "", "REFERENCE_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; +static varinfo_t flash_desktop_ClipboardFormats_AIR_PREFIX = {0x01, 0x00, 0x82, 0x17, "", "AIR_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; +static varinfo_t flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX = {0x01, 0x00, 0x82, 0x17, "", "SERIALIZATION_PREFIX", 0, &_String, &flash_desktop_ClipboardFormats, 0}; static varinfo_t flash_desktop_ClipboardFormats_RICH_TEXT_FORMAT = {0x01, 0x00, 0x82, 0x16, "", "RICH_TEXT_FORMAT", 0, &_String, &flash_desktop_ClipboardFormats, 0}; static varinfo_t flash_desktop_ClipboardFormats_URL_FORMAT = {0x01, 0x00, 0x82, 0x16, "", "URL_FORMAT", 0, &_String, &flash_desktop_ClipboardFormats, 0}; static varinfo_t flash_desktop_ClipboardFormats_FILE_LIST_FORMAT = {0x01, 0x00, 0x82, 0x16, "", "FILE_LIST_FORMAT", 0, &_String, &flash_desktop_ClipboardFormats, 0}; static classinfo_t flash_display_MovieClip = {0x03, 0x00, 0x88, 0x16, "flash.display", "MovieClip", 0, &flash_display_Sprite, interfaces: {0}}; -static methodinfo_t flash_display_MovieClip_prevScene = {0x02, 0x00, 0x80, 0x16, "", "prevScene", 0, 0, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_gotoAndPlay = {0x02, 0x00, 0x80, 0x16, "", "gotoAndPlay", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_prevScene = {0x02, 0x00, 0x80, 0x16, "", "prevScene", 0, &voidclass, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_gotoAndPlay = {0x02, 0x00, 0x80, 0x16, "", "gotoAndPlay", 0, &voidclass, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_currentLabels = {0x01, 0x00, 0x80, 0x16, "", "currentLabels", 0, &_Array, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_nextFrame = {0x02, 0x00, 0x80, 0x16, "", "nextFrame", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_nextFrame = {0x02, 0x00, 0x80, 0x16, "", "nextFrame", 0, &voidclass, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_currentScene = {0x01, 0x00, 0x80, 0x16, "", "currentScene", 0, &flash_display_Scene, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_enabled = {0x01, 0x00, 0x80, 0x16, "", "enabled", 0, &_Boolean, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_currentFrameLabel = {0x01, 0x00, 0x80, 0x16, "", "currentFrameLabel", 0, &_String, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_play = {0x02, 0x00, 0x80, 0x16, "", "play", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_play = {0x02, 0x00, 0x80, 0x16, "", "play", 0, &voidclass, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_framesLoaded = {0x01, 0x00, 0x80, 0x16, "", "framesLoaded", 0, &_int, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_scenes = {0x01, 0x00, 0x80, 0x16, "", "scenes", 0, &_Array, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_addFrameScript = {0x02, 0x00, 0x80, 0x16, "", "addFrameScript", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_addFrameScript = {0x02, 0x00, 0x80, 0x16, "", "addFrameScript", 0, &voidclass, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_currentLabel = {0x01, 0x00, 0x80, 0x16, "", "currentLabel", 0, &_String, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_prevFrame = {0x02, 0x00, 0x80, 0x16, "", "prevFrame", 0, 0, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_gotoAndStop = {0x02, 0x00, 0x80, 0x16, "", "gotoAndStop", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_prevFrame = {0x02, 0x00, 0x80, 0x16, "", "prevFrame", 0, &voidclass, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_gotoAndStop = {0x02, 0x00, 0x80, 0x16, "", "gotoAndStop", 0, &voidclass, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_currentFrame = {0x01, 0x00, 0x80, 0x16, "", "currentFrame", 0, &_int, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_nextScene = {0x02, 0x00, 0x80, 0x16, "", "nextScene", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_nextScene = {0x02, 0x00, 0x80, 0x16, "", "nextScene", 0, &voidclass, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_totalFrames = {0x01, 0x00, 0x80, 0x16, "", "totalFrames", 0, &_int, &flash_display_MovieClip, 0}; static varinfo_t flash_display_MovieClip_trackAsMenu = {0x01, 0x00, 0x80, 0x16, "", "trackAsMenu", 0, &_Boolean, &flash_display_MovieClip, 0}; -static methodinfo_t flash_display_MovieClip_stop = {0x02, 0x00, 0x80, 0x16, "", "stop", 0, 0, &flash_display_MovieClip, 0}; +static methodinfo_t flash_display_MovieClip_stop = {0x02, 0x00, 0x80, 0x16, "", "stop", 0, &voidclass, &flash_display_MovieClip, 0}; static classinfo_t flash_display_BitmapData = {0x03, 0x00, 0x80, 0x16, "flash.display", "BitmapData", 0, &_Object, interfaces: {&flash_display_IBitmapDrawable, 0}}; static methodinfo_t flash_display_BitmapData_getPixel32 = {0x02, 0x00, 0x80, 0x16, "", "getPixel32", 0, &_uint, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_draw = {0x02, 0x00, 0x80, 0x16, "", "draw", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_setPixels = {0x02, 0x00, 0x80, 0x16, "", "setPixels", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_copyPixels = {0x02, 0x00, 0x80, 0x16, "", "copyPixels", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_draw = {0x02, 0x00, 0x80, 0x16, "", "draw", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_setPixels = {0x02, 0x00, 0x80, 0x16, "", "setPixels", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_copyPixels = {0x02, 0x00, 0x80, 0x16, "", "copyPixels", 0, &voidclass, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_histogram = {0x02, 0x00, 0x80, 0x16, "", "histogram", 0, &__AS3___vec_Vector, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_scroll = {0x02, 0x00, 0x80, 0x16, "", "scroll", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_scroll = {0x02, 0x00, 0x80, 0x16, "", "scroll", 0, &voidclass, &flash_display_BitmapData, 0}; static varinfo_t flash_display_BitmapData_transparent = {0x01, 0x00, 0x80, 0x16, "", "transparent", 0, &_Boolean, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_noise = {0x02, 0x00, 0x80, 0x16, "", "noise", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_noise = {0x02, 0x00, 0x80, 0x16, "", "noise", 0, &voidclass, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_threshold = {0x02, 0x00, 0x80, 0x16, "", "threshold", 0, &_uint, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_paletteMap = {0x02, 0x00, 0x80, 0x16, "", "paletteMap", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_perlinNoise = {0x02, 0x00, 0x80, 0x16, "", "perlinNoise", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_paletteMap = {0x02, 0x00, 0x80, 0x16, "", "paletteMap", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_perlinNoise = {0x02, 0x00, 0x80, 0x16, "", "perlinNoise", 0, &voidclass, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_hitTest = {0x02, 0x00, 0x80, 0x16, "", "hitTest", 0, &_Boolean, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_getPixel = {0x02, 0x00, 0x80, 0x16, "", "getPixel", 0, &_uint, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_unlock = {0x02, 0x00, 0x80, 0x16, "", "unlock", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_unlock = {0x02, 0x00, 0x80, 0x16, "", "unlock", 0, &voidclass, &flash_display_BitmapData, 0}; static varinfo_t flash_display_BitmapData_height = {0x01, 0x00, 0x80, 0x16, "", "height", 0, &_int, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_copyChannel = {0x02, 0x00, 0x80, 0x16, "", "copyChannel", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_copyChannel = {0x02, 0x00, 0x80, 0x16, "", "copyChannel", 0, &voidclass, &flash_display_BitmapData, 0}; static varinfo_t flash_display_BitmapData_width = {0x01, 0x00, 0x80, 0x16, "", "width", 0, &_int, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_display_BitmapData, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_colorTransform = {0x02, 0x00, 0x80, 0x16, "", "colorTransform", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_colorTransform = {0x02, 0x00, 0x80, 0x16, "", "colorTransform", 0, &voidclass, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_generateFilterRect = {0x02, 0x00, 0x80, 0x16, "", "generateFilterRect", 0, &flash_geom_Rectangle, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_compare = {0x02, 0x00, 0x80, 0x16, "", "compare", 0, &_Object, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_fillRect = {0x02, 0x00, 0x80, 0x16, "", "fillRect", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_setVector = {0x02, 0x00, 0x80, 0x16, "", "setVector", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_floodFill = {0x02, 0x00, 0x80, 0x16, "", "floodFill", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_fillRect = {0x02, 0x00, 0x80, 0x16, "", "fillRect", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_setVector = {0x02, 0x00, 0x80, 0x16, "", "setVector", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_floodFill = {0x02, 0x00, 0x80, 0x16, "", "floodFill", 0, &voidclass, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_pixelDissolve = {0x02, 0x00, 0x80, 0x16, "", "pixelDissolve", 0, &_int, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_setPixel = {0x02, 0x00, 0x80, 0x16, "", "setPixel", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_setPixel32 = {0x02, 0x00, 0x80, 0x16, "", "setPixel32", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_lock = {0x02, 0x00, 0x80, 0x16, "", "lock", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_setPixel = {0x02, 0x00, 0x80, 0x16, "", "setPixel", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_setPixel32 = {0x02, 0x00, 0x80, 0x16, "", "setPixel32", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_lock = {0x02, 0x00, 0x80, 0x16, "", "lock", 0, &voidclass, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_getVector = {0x02, 0x00, 0x80, 0x16, "", "getVector", 0, &__AS3___vec_Vector, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_getColorBoundsRect = {0x02, 0x00, 0x80, 0x16, "", "getColorBoundsRect", 0, &flash_geom_Rectangle, &flash_display_BitmapData, 0}; static methodinfo_t flash_display_BitmapData_getPixels = {0x02, 0x00, 0x80, 0x16, "", "getPixels", 0, &flash_utils_ByteArray, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_merge = {0x02, 0x00, 0x80, 0x16, "", "merge", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_merge = {0x02, 0x00, 0x80, 0x16, "", "merge", 0, &voidclass, &flash_display_BitmapData, 0}; static varinfo_t flash_display_BitmapData_rect = {0x01, 0x00, 0x80, 0x16, "", "rect", 0, &flash_geom_Rectangle, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_applyFilter = {0x02, 0x00, 0x80, 0x16, "", "applyFilter", 0, 0, &flash_display_BitmapData, 0}; -static methodinfo_t flash_display_BitmapData_dispose = {0x02, 0x00, 0x80, 0x16, "", "dispose", 0, 0, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_applyFilter = {0x02, 0x00, 0x80, 0x16, "", "applyFilter", 0, &voidclass, &flash_display_BitmapData, 0}; +static methodinfo_t flash_display_BitmapData_dispose = {0x02, 0x00, 0x80, 0x16, "", "dispose", 0, &voidclass, &flash_display_BitmapData, 0}; static classinfo_t flash_text_engine_LigatureLevel = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "LigatureLevel", 0, &_Object, interfaces: {0}}; static varinfo_t flash_text_engine_LigatureLevel_UNCOMMON = {0x01, 0x00, 0x82, 0x16, "", "UNCOMMON", 0, &_String, &flash_text_engine_LigatureLevel, 0}; static varinfo_t flash_text_engine_LigatureLevel_COMMON = {0x01, 0x00, 0x82, 0x16, "", "COMMON", 0, &_String, &flash_text_engine_LigatureLevel, 0}; @@ -4885,7 +5812,6 @@ static constant_t _Infinity_constant = {type: 6}; static varinfo_t _Infinity = {0x01, 0x00, 0xa2, 0x16, "", "Infinity", 0, &_Number, 0, &_Infinity_constant}; static classinfo_t flash_text_engine_FontDescription = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "FontDescription", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_text_engine_FontDescription_isFontCompatible = {0x02, 0x00, 0x82, 0x16, "", "isFontCompatible", 0, &_Boolean, &flash_text_engine_FontDescription, 0}; static varinfo_t flash_text_engine_FontDescription_renderingMode = {0x01, 0x00, 0x80, 0x16, "", "renderingMode", 0, &_String, &flash_text_engine_FontDescription, 0}; static varinfo_t flash_text_engine_FontDescription_cffHinting = {0x01, 0x00, 0x80, 0x16, "", "cffHinting", 0, &_String, &flash_text_engine_FontDescription, 0}; static varinfo_t flash_text_engine_FontDescription_fontPosture = {0x01, 0x00, 0x80, 0x16, "", "fontPosture", 0, &_String, &flash_text_engine_FontDescription, 0}; @@ -4894,8 +5820,9 @@ static varinfo_t flash_text_engine_FontDescription_locked = {0x01, 0x00, 0x80, 0x16, "", "locked", 0, &_Boolean, &flash_text_engine_FontDescription, 0}; static varinfo_t flash_text_engine_FontDescription_fontWeight = {0x01, 0x00, 0x80, 0x16, "", "fontWeight", 0, &_String, &flash_text_engine_FontDescription, 0}; static methodinfo_t flash_text_engine_FontDescription_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_text_engine_FontDescription, &flash_text_engine_FontDescription, 0}; +static methodinfo_t flash_text_engine_FontDescription_isFontCompatible = {0x02, 0x00, 0x82, 0x16, "", "isFontCompatible", 0, &_Boolean, &flash_text_engine_FontDescription, 0}; static classinfo_t flash_text_engine_TextElement = {0x03, 0x00, 0x81, 0x16, "flash.text.engine", "TextElement", 0, &flash_text_engine_ContentElement, interfaces: {0}}; -static methodinfo_t flash_text_engine_TextElement_replaceText = {0x02, 0x00, 0x80, 0x16, "", "replaceText", 0, 0, &flash_text_engine_TextElement, 0}; +static methodinfo_t flash_text_engine_TextElement_replaceText = {0x02, 0x00, 0x80, 0x16, "", "replaceText", 0, &voidclass, &flash_text_engine_TextElement, 0}; static classinfo_t flash_display_SWFVersion = {0x03, 0x00, 0x81, 0x16, "flash.display", "SWFVersion", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_SWFVersion_FLASH4 = {0x01, 0x00, 0x82, 0x16, "", "FLASH4", 0, &_uint, &flash_display_SWFVersion, 0}; static varinfo_t flash_display_SWFVersion_FLASH7 = {0x01, 0x00, 0x82, 0x16, "", "FLASH7", 0, &_uint, &flash_display_SWFVersion, 0}; @@ -4908,36 +5835,36 @@ static varinfo_t flash_display_SWFVersion_FLASH10 = {0x01, 0x00, 0x82, 0x16, "", "FLASH10", 0, &_uint, &flash_display_SWFVersion, 0}; static varinfo_t flash_display_SWFVersion_FLASH1 = {0x01, 0x00, 0x82, 0x16, "", "FLASH1", 0, &_uint, &flash_display_SWFVersion, 0}; static classinfo_t flash_net_URLLoader = {0x03, 0x00, 0x80, 0x16, "flash.net", "URLLoader", 0, &flash_events_EventDispatcher, interfaces: {0}}; -static methodinfo_t flash_net_URLLoader_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, 0, &flash_net_URLLoader, 0}; +static methodinfo_t flash_net_URLLoader_close = {0x02, 0x00, 0x80, 0x16, "", "close", 0, &voidclass, &flash_net_URLLoader, 0}; static varinfo_t flash_net_URLLoader_bytesLoaded = {0x01, 0x00, 0x80, 0x16, "", "bytesLoaded", 0, &_uint, &flash_net_URLLoader, 0}; -static methodinfo_t flash_net_URLLoader_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, 0, &flash_net_URLLoader, 0}; +static methodinfo_t flash_net_URLLoader_load = {0x02, 0x00, 0x80, 0x16, "", "load", 0, &voidclass, &flash_net_URLLoader, 0}; static varinfo_t flash_net_URLLoader_bytesTotal = {0x01, 0x00, 0x80, 0x16, "", "bytesTotal", 0, &_uint, &flash_net_URLLoader, 0}; static varinfo_t flash_net_URLLoader_dataFormat = {0x01, 0x00, 0x80, 0x16, "", "dataFormat", 0, &_String, &flash_net_URLLoader, 0}; static varinfo_t flash_net_URLLoader_data = {0x01, 0x00, 0x80, 0x16, "", "data", 0, 0, &flash_net_URLLoader, 0}; static classinfo_t flash_geom_Matrix = {0x03, 0x00, 0x80, 0x16, "flash.geom", "Matrix", 0, &_Object, interfaces: {0}}; static varinfo_t flash_geom_Matrix_b = {0x01, 0x00, 0x80, 0x16, "", "b", 0, &_Number, &flash_geom_Matrix, 0}; static methodinfo_t flash_geom_Matrix_deltaTransformPoint = {0x02, 0x00, 0x80, 0x16, "", "deltaTransformPoint", 0, &flash_geom_Point, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_identity = {0x02, 0x00, 0x80, 0x16, "", "identity", 0, 0, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_identity = {0x02, 0x00, 0x80, 0x16, "", "identity", 0, &voidclass, &flash_geom_Matrix, 0}; static varinfo_t flash_geom_Matrix_ty = {0x01, 0x00, 0x80, 0x16, "", "ty", 0, &_Number, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_translate = {0x02, 0x00, 0x80, 0x16, "", "translate", 0, 0, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_concat = {0x02, 0x00, 0x80, 0x16, "", "concat", 0, 0, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_translate = {0x02, 0x00, 0x80, 0x16, "", "translate", 0, &voidclass, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_concat = {0x02, 0x00, 0x80, 0x16, "", "concat", 0, &voidclass, &flash_geom_Matrix, 0}; static varinfo_t flash_geom_Matrix_c = {0x01, 0x00, 0x80, 0x16, "", "c", 0, &_Number, &flash_geom_Matrix, 0}; static varinfo_t flash_geom_Matrix_a = {0x01, 0x00, 0x80, 0x16, "", "a", 0, &_Number, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_scale = {0x02, 0x00, 0x80, 0x16, "", "scale", 0, 0, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_scale = {0x02, 0x00, 0x80, 0x16, "", "scale", 0, &voidclass, &flash_geom_Matrix, 0}; static varinfo_t flash_geom_Matrix_d = {0x01, 0x00, 0x80, 0x16, "", "d", 0, &_Number, &flash_geom_Matrix, 0}; static methodinfo_t flash_geom_Matrix_transformPoint = {0x02, 0x00, 0x80, 0x16, "", "transformPoint", 0, &flash_geom_Point, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_rotate = {0x02, 0x00, 0x80, 0x16, "", "rotate", 0, 0, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_createGradientBox = {0x02, 0x00, 0x80, 0x16, "", "createGradientBox", 0, 0, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_rotate = {0x02, 0x00, 0x80, 0x16, "", "rotate", 0, &voidclass, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_createGradientBox = {0x02, 0x00, 0x80, 0x16, "", "createGradientBox", 0, &voidclass, &flash_geom_Matrix, 0}; static methodinfo_t flash_geom_Matrix_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_invert = {0x02, 0x00, 0x80, 0x16, "", "invert", 0, 0, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_invert = {0x02, 0x00, 0x80, 0x16, "", "invert", 0, &voidclass, &flash_geom_Matrix, 0}; static methodinfo_t flash_geom_Matrix_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_geom_Matrix, &flash_geom_Matrix, 0}; static varinfo_t flash_geom_Matrix_tx = {0x01, 0x00, 0x80, 0x16, "", "tx", 0, &_Number, &flash_geom_Matrix, 0}; -static methodinfo_t flash_geom_Matrix_createBox = {0x02, 0x00, 0x80, 0x16, "", "createBox", 0, 0, &flash_geom_Matrix, 0}; +static methodinfo_t flash_geom_Matrix_createBox = {0x02, 0x00, 0x80, 0x16, "", "createBox", 0, &voidclass, &flash_geom_Matrix, 0}; static classinfo_t flash_accessibility_Accessibility = {0x03, 0x00, 0x81, 0x16, "flash.accessibility", "Accessibility", 0, &_Object, interfaces: {0}}; static varinfo_t flash_accessibility_Accessibility_active = {0x01, 0x00, 0x82, 0x16, "", "active", 0, &_Boolean, &flash_accessibility_Accessibility, 0}; -static methodinfo_t flash_accessibility_Accessibility_updateProperties = {0x02, 0x00, 0x82, 0x16, "", "updateProperties", 0, 0, &flash_accessibility_Accessibility, 0}; -static methodinfo_t flash_accessibility_Accessibility_sendEvent = {0x02, 0x00, 0x82, 0x16, "", "sendEvent", 0, 0, &flash_accessibility_Accessibility, 0}; -static methodinfo_t flash_net_sendToURL = {0x02, 0x00, 0x82, 0x16, "flash.net", "sendToURL", 0, 0, 0, 0}; +static methodinfo_t flash_accessibility_Accessibility_updateProperties = {0x02, 0x00, 0x82, 0x16, "", "updateProperties", 0, &voidclass, &flash_accessibility_Accessibility, 0}; +static methodinfo_t flash_accessibility_Accessibility_sendEvent = {0x02, 0x00, 0x82, 0x16, "", "sendEvent", 0, &voidclass, &flash_accessibility_Accessibility, 0}; +static methodinfo_t flash_net_sendToURL = {0x02, 0x00, 0x82, 0x16, "flash.net", "sendToURL", 0, &voidclass, 0, 0}; static classinfo_t flash_filters_GlowFilter = {0x03, 0x00, 0x81, 0x16, "flash.filters", "GlowFilter", 0, &flash_filters_BitmapFilter, interfaces: {0}}; static varinfo_t flash_filters_GlowFilter_blurY = {0x01, 0x00, 0x80, 0x16, "", "blurY", 0, &_Number, &flash_filters_GlowFilter, 0}; static varinfo_t flash_filters_GlowFilter_strength = {0x01, 0x00, 0x80, 0x16, "", "strength", 0, &_Number, &flash_filters_GlowFilter, 0}; @@ -4949,18 +5876,18 @@ static varinfo_t flash_filters_GlowFilter_alpha = {0x01, 0x00, 0x80, 0x16, "", "alpha", 0, &_Number, &flash_filters_GlowFilter, 0}; static varinfo_t flash_filters_GlowFilter_blurX = {0x01, 0x00, 0x80, 0x16, "", "blurX", 0, &_Number, &flash_filters_GlowFilter, 0}; static classinfo_t flash_events_FullScreenEvent = {0x03, 0x00, 0x80, 0x16, "flash.events", "FullScreenEvent", 0, &flash_events_ActivityEvent, interfaces: {0}}; -static varinfo_t flash_events_FullScreenEvent_FULL_SCREEN = {0x01, 0x00, 0x82, 0x16, "", "FULL_SCREEN", 0, &_String, &flash_events_FullScreenEvent, 0}; static methodinfo_t flash_events_FullScreenEvent_toString = {0x02, 0x00, 0x80, 0x16, "", "toString", 0, &_String, &flash_events_FullScreenEvent, 0}; static methodinfo_t flash_events_FullScreenEvent_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_events_Event, &flash_events_FullScreenEvent, 0}; static varinfo_t flash_events_FullScreenEvent_fullScreen = {0x01, 0x00, 0x80, 0x16, "", "fullScreen", 0, &_Boolean, &flash_events_FullScreenEvent, 0}; +static varinfo_t flash_events_FullScreenEvent_FULL_SCREEN = {0x01, 0x00, 0x82, 0x16, "", "FULL_SCREEN", 0, &_String, &flash_events_FullScreenEvent, 0}; static classinfo_t flash_display_StageDisplayState = {0x03, 0x00, 0x81, 0x16, "flash.display", "StageDisplayState", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_StageDisplayState_NORMAL = {0x01, 0x00, 0x82, 0x16, "", "NORMAL", 0, &_String, &flash_display_StageDisplayState, 0}; static varinfo_t flash_display_StageDisplayState_FULL_SCREEN = {0x01, 0x00, 0x82, 0x16, "", "FULL_SCREEN", 0, &_String, &flash_display_StageDisplayState, 0}; static classinfo_t flash_text_engine_TextJustifier = {0x03, 0x00, 0x80, 0x16, "flash.text.engine", "TextJustifier", 0, &_Object, interfaces: {0}}; -static methodinfo_t flash_text_engine_TextJustifier_getJustifierForLocale = {0x02, 0x00, 0x82, 0x16, "", "getJustifierForLocale", 0, &flash_text_engine_TextJustifier, &flash_text_engine_TextJustifier, 0}; static varinfo_t flash_text_engine_TextJustifier_lineJustification = {0x01, 0x00, 0x80, 0x16, "", "lineJustification", 0, &_String, &flash_text_engine_TextJustifier, 0}; static varinfo_t flash_text_engine_TextJustifier_locale = {0x01, 0x00, 0x80, 0x16, "", "locale", 0, &_String, &flash_text_engine_TextJustifier, 0}; static methodinfo_t flash_text_engine_TextJustifier_clone = {0x02, 0x00, 0x80, 0x16, "", "clone", 0, &flash_text_engine_TextJustifier, &flash_text_engine_TextJustifier, 0}; +static methodinfo_t flash_text_engine_TextJustifier_getJustifierForLocale = {0x02, 0x00, 0x82, 0x16, "", "getJustifierForLocale", 0, &flash_text_engine_TextJustifier, &flash_text_engine_TextJustifier, 0}; static classinfo_t flash_display_StageAlign = {0x03, 0x00, 0x81, 0x16, "flash.display", "StageAlign", 0, &_Object, interfaces: {0}}; static varinfo_t flash_display_StageAlign_RIGHT = {0x01, 0x00, 0x82, 0x16, "", "RIGHT", 0, &_String, &flash_display_StageAlign, 0}; static varinfo_t flash_display_StageAlign_BOTTOM = {0x01, 0x00, 0x82, 0x16, "", "BOTTOM", 0, &_String, &flash_display_StageAlign, 0}; @@ -4981,6 +5908,7 @@ dict_t*d = dict_new2(&slotinfo_type); dict_put(d, &flash_text_TextFormat, &flash_text_TextFormat); dict_init2(&flash_text_TextFormat.members, &memberinfo_type, 31); + dict_init2(&flash_text_TextFormat.static_members, &memberinfo_type, 8); dict_put(&flash_text_TextFormat.members, &flash_text_TextFormat_leading, &flash_text_TextFormat_leading); dict_put(&flash_text_TextFormat.members, &flash_text_TextFormat_bold, &flash_text_TextFormat_bold); dict_put(&flash_text_TextFormat.members, &flash_text_TextFormat_underline, &flash_text_TextFormat_underline); @@ -5002,9 +5930,11 @@ dict_put(&flash_text_TextFormat.members, &flash_text_TextFormat_font, &flash_text_TextFormat_font); dict_put(d, &flash_filters_BitmapFilter, &flash_filters_BitmapFilter); dict_init2(&flash_filters_BitmapFilter.members, &memberinfo_type, 8); + dict_init2(&flash_filters_BitmapFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_BitmapFilter.members, &flash_filters_BitmapFilter_clone, &flash_filters_BitmapFilter_clone); dict_put(d, &flash_filters_DropShadowFilter, &flash_filters_DropShadowFilter); dict_init2(&flash_filters_DropShadowFilter.members, &memberinfo_type, 15); + dict_init2(&flash_filters_DropShadowFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_DropShadowFilter.members, &flash_filters_DropShadowFilter_alpha, &flash_filters_DropShadowFilter_alpha); dict_put(&flash_filters_DropShadowFilter.members, &flash_filters_DropShadowFilter_strength, &flash_filters_DropShadowFilter_strength); dict_put(&flash_filters_DropShadowFilter.members, &flash_filters_DropShadowFilter_quality, &flash_filters_DropShadowFilter_quality); @@ -5019,24 +5949,28 @@ dict_put(&flash_filters_DropShadowFilter.members, &flash_filters_DropShadowFilter_clone, &flash_filters_DropShadowFilter_clone); dict_put(d, &adobe_utils_CustomActions, &adobe_utils_CustomActions); dict_init2(&adobe_utils_CustomActions.members, &memberinfo_type, 8); - dict_put(&adobe_utils_CustomActions.members, &adobe_utils_CustomActions_actionsList, &adobe_utils_CustomActions_actionsList); - dict_put(&adobe_utils_CustomActions.members, &adobe_utils_CustomActions_uninstallActions, &adobe_utils_CustomActions_uninstallActions); - dict_put(&adobe_utils_CustomActions.members, &adobe_utils_CustomActions_getActions, &adobe_utils_CustomActions_getActions); - dict_put(&adobe_utils_CustomActions.members, &adobe_utils_CustomActions_installActions, &adobe_utils_CustomActions_installActions); + dict_init2(&adobe_utils_CustomActions.static_members, &memberinfo_type, 8); + dict_put(&adobe_utils_CustomActions.static_members, &adobe_utils_CustomActions_actionsList, &adobe_utils_CustomActions_actionsList); + dict_put(&adobe_utils_CustomActions.static_members, &adobe_utils_CustomActions_uninstallActions, &adobe_utils_CustomActions_uninstallActions); + dict_put(&adobe_utils_CustomActions.static_members, &adobe_utils_CustomActions_getActions, &adobe_utils_CustomActions_getActions); + dict_put(&adobe_utils_CustomActions.static_members, &adobe_utils_CustomActions_installActions, &adobe_utils_CustomActions_installActions); dict_put(d, &flash_text_engine_TextLineValidity, &flash_text_engine_TextLineValidity); dict_init2(&flash_text_engine_TextLineValidity.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TextLineValidity.members, &flash_text_engine_TextLineValidity_STATIC, &flash_text_engine_TextLineValidity_STATIC); - dict_put(&flash_text_engine_TextLineValidity.members, &flash_text_engine_TextLineValidity_VALID, &flash_text_engine_TextLineValidity_VALID); - dict_put(&flash_text_engine_TextLineValidity.members, &flash_text_engine_TextLineValidity_INVALID, &flash_text_engine_TextLineValidity_INVALID); - dict_put(&flash_text_engine_TextLineValidity.members, &flash_text_engine_TextLineValidity_POSSIBLY_INVALID, &flash_text_engine_TextLineValidity_POSSIBLY_INVALID); + dict_init2(&flash_text_engine_TextLineValidity.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_TextLineValidity.static_members, &flash_text_engine_TextLineValidity_STATIC, &flash_text_engine_TextLineValidity_STATIC); + dict_put(&flash_text_engine_TextLineValidity.static_members, &flash_text_engine_TextLineValidity_VALID, &flash_text_engine_TextLineValidity_VALID); + dict_put(&flash_text_engine_TextLineValidity.static_members, &flash_text_engine_TextLineValidity_INVALID, &flash_text_engine_TextLineValidity_INVALID); + dict_put(&flash_text_engine_TextLineValidity.static_members, &flash_text_engine_TextLineValidity_POSSIBLY_INVALID, &flash_text_engine_TextLineValidity_POSSIBLY_INVALID); dict_put(d, &flash_display_LineScaleMode, &flash_display_LineScaleMode); dict_init2(&flash_display_LineScaleMode.members, &memberinfo_type, 8); - dict_put(&flash_display_LineScaleMode.members, &flash_display_LineScaleMode_NORMAL, &flash_display_LineScaleMode_NORMAL); - dict_put(&flash_display_LineScaleMode.members, &flash_display_LineScaleMode_VERTICAL, &flash_display_LineScaleMode_VERTICAL); - dict_put(&flash_display_LineScaleMode.members, &flash_display_LineScaleMode_NONE, &flash_display_LineScaleMode_NONE); - dict_put(&flash_display_LineScaleMode.members, &flash_display_LineScaleMode_HORIZONTAL, &flash_display_LineScaleMode_HORIZONTAL); + dict_init2(&flash_display_LineScaleMode.static_members, &memberinfo_type, 8); + dict_put(&flash_display_LineScaleMode.static_members, &flash_display_LineScaleMode_NORMAL, &flash_display_LineScaleMode_NORMAL); + dict_put(&flash_display_LineScaleMode.static_members, &flash_display_LineScaleMode_VERTICAL, &flash_display_LineScaleMode_VERTICAL); + dict_put(&flash_display_LineScaleMode.static_members, &flash_display_LineScaleMode_NONE, &flash_display_LineScaleMode_NONE); + dict_put(&flash_display_LineScaleMode.static_members, &flash_display_LineScaleMode_HORIZONTAL, &flash_display_LineScaleMode_HORIZONTAL); dict_put(d, &flash_geom_Transform, &flash_geom_Transform); dict_init2(&flash_geom_Transform.members, &memberinfo_type, 15); + dict_init2(&flash_geom_Transform.static_members, &memberinfo_type, 8); dict_put(&flash_geom_Transform.members, &flash_geom_Transform_matrix, &flash_geom_Transform_matrix); dict_put(&flash_geom_Transform.members, &flash_geom_Transform_perspectiveProjection, &flash_geom_Transform_perspectiveProjection); dict_put(&flash_geom_Transform.members, &flash_geom_Transform_concatenatedMatrix, &flash_geom_Transform_concatenatedMatrix); @@ -5047,44 +5981,47 @@ dict_put(&flash_geom_Transform.members, &flash_geom_Transform_concatenatedColorTransform, &flash_geom_Transform_concatenatedColorTransform); dict_put(d, &flash_ui_KeyLocation, &flash_ui_KeyLocation); dict_init2(&flash_ui_KeyLocation.members, &memberinfo_type, 8); - dict_put(&flash_ui_KeyLocation.members, &flash_ui_KeyLocation_LEFT, &flash_ui_KeyLocation_LEFT); - dict_put(&flash_ui_KeyLocation.members, &flash_ui_KeyLocation_RIGHT, &flash_ui_KeyLocation_RIGHT); - dict_put(&flash_ui_KeyLocation.members, &flash_ui_KeyLocation_NUM_PAD, &flash_ui_KeyLocation_NUM_PAD); - dict_put(&flash_ui_KeyLocation.members, &flash_ui_KeyLocation_STANDARD, &flash_ui_KeyLocation_STANDARD); + dict_init2(&flash_ui_KeyLocation.static_members, &memberinfo_type, 8); + dict_put(&flash_ui_KeyLocation.static_members, &flash_ui_KeyLocation_LEFT, &flash_ui_KeyLocation_LEFT); + dict_put(&flash_ui_KeyLocation.static_members, &flash_ui_KeyLocation_RIGHT, &flash_ui_KeyLocation_RIGHT); + dict_put(&flash_ui_KeyLocation.static_members, &flash_ui_KeyLocation_NUM_PAD, &flash_ui_KeyLocation_NUM_PAD); + dict_put(&flash_ui_KeyLocation.static_members, &flash_ui_KeyLocation_STANDARD, &flash_ui_KeyLocation_STANDARD); dict_put(d, &flash_events_MouseEvent, &flash_events_MouseEvent); dict_init2(&flash_events_MouseEvent.members, &memberinfo_type, 31); + dict_init2(&flash_events_MouseEvent.static_members, &memberinfo_type, 15); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_localY, &flash_events_MouseEvent_localY); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_MOUSE_OUT, &flash_events_MouseEvent_MOUSE_OUT); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_updateAfterEvent, &flash_events_MouseEvent_updateAfterEvent); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_MOUSE_MOVE, &flash_events_MouseEvent_MOUSE_MOVE); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_delta, &flash_events_MouseEvent_delta); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_MOUSE_WHEEL, &flash_events_MouseEvent_MOUSE_WHEEL); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_stageX, &flash_events_MouseEvent_stageX); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_CLICK, &flash_events_MouseEvent_CLICK); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_ROLL_OUT, &flash_events_MouseEvent_ROLL_OUT); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_MOUSE_OVER, &flash_events_MouseEvent_MOUSE_OVER); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_ROLL_OVER, &flash_events_MouseEvent_ROLL_OVER); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_toString, &flash_events_MouseEvent_toString); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_MOUSE_DOWN, &flash_events_MouseEvent_MOUSE_DOWN); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_relatedObject, &flash_events_MouseEvent_relatedObject); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_isRelatedObjectInaccessible, &flash_events_MouseEvent_isRelatedObjectInaccessible); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_shiftKey, &flash_events_MouseEvent_shiftKey); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_DOUBLE_CLICK, &flash_events_MouseEvent_DOUBLE_CLICK); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_stageY, &flash_events_MouseEvent_stageY); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_altKey, &flash_events_MouseEvent_altKey); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_clone, &flash_events_MouseEvent_clone); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_ctrlKey, &flash_events_MouseEvent_ctrlKey); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_localX, &flash_events_MouseEvent_localX); dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_buttonDown, &flash_events_MouseEvent_buttonDown); - dict_put(&flash_events_MouseEvent.members, &flash_events_MouseEvent_MOUSE_UP, &flash_events_MouseEvent_MOUSE_UP); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_ROLL_OVER, &flash_events_MouseEvent_ROLL_OVER); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_ROLL_OUT, &flash_events_MouseEvent_ROLL_OUT); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_MOUSE_DOWN, &flash_events_MouseEvent_MOUSE_DOWN); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_DOUBLE_CLICK, &flash_events_MouseEvent_DOUBLE_CLICK); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_MOUSE_WHEEL, &flash_events_MouseEvent_MOUSE_WHEEL); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_CLICK, &flash_events_MouseEvent_CLICK); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_MOUSE_MOVE, &flash_events_MouseEvent_MOUSE_MOVE); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_MOUSE_UP, &flash_events_MouseEvent_MOUSE_UP); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_MOUSE_OVER, &flash_events_MouseEvent_MOUSE_OVER); + dict_put(&flash_events_MouseEvent.static_members, &flash_events_MouseEvent_MOUSE_OUT, &flash_events_MouseEvent_MOUSE_OUT); dict_put(d, &flash_text_engine_LineJustification, &flash_text_engine_LineJustification); dict_init2(&flash_text_engine_LineJustification.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_LineJustification.members, &flash_text_engine_LineJustification_ALL_INCLUDING_LAST, &flash_text_engine_LineJustification_ALL_INCLUDING_LAST); - dict_put(&flash_text_engine_LineJustification.members, &flash_text_engine_LineJustification_UNJUSTIFIED, &flash_text_engine_LineJustification_UNJUSTIFIED); - dict_put(&flash_text_engine_LineJustification.members, &flash_text_engine_LineJustification_ALL_BUT_LAST, &flash_text_engine_LineJustification_ALL_BUT_LAST); + dict_init2(&flash_text_engine_LineJustification.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_LineJustification.static_members, &flash_text_engine_LineJustification_ALL_INCLUDING_LAST, &flash_text_engine_LineJustification_ALL_INCLUDING_LAST); + dict_put(&flash_text_engine_LineJustification.static_members, &flash_text_engine_LineJustification_UNJUSTIFIED, &flash_text_engine_LineJustification_UNJUSTIFIED); + dict_put(&flash_text_engine_LineJustification.static_members, &flash_text_engine_LineJustification_ALL_BUT_LAST, &flash_text_engine_LineJustification_ALL_BUT_LAST); dict_put(d, &flash_media_Camera, &flash_media_Camera); dict_init2(&flash_media_Camera.members, &memberinfo_type, 31); - dict_put(&flash_media_Camera.members, &flash_media_Camera_getCamera, &flash_media_Camera_getCamera); + dict_init2(&flash_media_Camera.static_members, &memberinfo_type, 8); dict_put(&flash_media_Camera.members, &flash_media_Camera_fps, &flash_media_Camera_fps); dict_put(&flash_media_Camera.members, &flash_media_Camera_setMode, &flash_media_Camera_setMode); dict_put(&flash_media_Camera.members, &flash_media_Camera_keyFrameInterval, &flash_media_Camera_keyFrameInterval); @@ -5103,12 +6040,14 @@ dict_put(&flash_media_Camera.members, &flash_media_Camera_muted, &flash_media_Camera_muted); dict_put(&flash_media_Camera.members, &flash_media_Camera_activityLevel, &flash_media_Camera_activityLevel); dict_put(&flash_media_Camera.members, &flash_media_Camera_loopback, &flash_media_Camera_loopback); - dict_put(&flash_media_Camera.members, &flash_media_Camera_names, &flash_media_Camera_names); dict_put(&flash_media_Camera.members, &flash_media_Camera_setQuality, &flash_media_Camera_setQuality); dict_put(&flash_media_Camera.members, &flash_media_Camera_setMotionLevel, &flash_media_Camera_setMotionLevel); + dict_put(&flash_media_Camera.static_members, &flash_media_Camera_getCamera, &flash_media_Camera_getCamera); + dict_put(&flash_media_Camera.static_members, &flash_media_Camera_names, &flash_media_Camera_names); dict_put(d, &flash_net_registerClassAlias, &flash_net_registerClassAlias); dict_put(d, &flash_accessibility_AccessibilityImplementation, &flash_accessibility_AccessibilityImplementation); dict_init2(&flash_accessibility_AccessibilityImplementation.members, &memberinfo_type, 15); + dict_init2(&flash_accessibility_AccessibilityImplementation.static_members, &memberinfo_type, 8); dict_put(&flash_accessibility_AccessibilityImplementation.members, &flash_accessibility_AccessibilityImplementation_get_accState, &flash_accessibility_AccessibilityImplementation_get_accState); dict_put(&flash_accessibility_AccessibilityImplementation.members, &flash_accessibility_AccessibilityImplementation_get_accName, &flash_accessibility_AccessibilityImplementation_get_accName); dict_put(&flash_accessibility_AccessibilityImplementation.members, &flash_accessibility_AccessibilityImplementation_get_accSelection, &flash_accessibility_AccessibilityImplementation_get_accSelection); @@ -5125,6 +6064,7 @@ dict_put(&flash_accessibility_AccessibilityImplementation.members, &flash_accessibility_AccessibilityImplementation_getChildIDArray, &flash_accessibility_AccessibilityImplementation_getChildIDArray); dict_put(d, &flash_utils_ByteArray, &flash_utils_ByteArray); dict_init2(&flash_utils_ByteArray.members, &memberinfo_type, 63); + dict_init2(&flash_utils_ByteArray.static_members, &memberinfo_type, 8); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_writeBoolean, &flash_utils_ByteArray_writeBoolean); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_readDouble, &flash_utils_ByteArray_readDouble); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_toString, &flash_utils_ByteArray_toString); @@ -5156,23 +6096,25 @@ dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_endian, &flash_utils_ByteArray_endian); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_readUnsignedShort, &flash_utils_ByteArray_readUnsignedShort); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_readUnsignedInt, &flash_utils_ByteArray_readUnsignedInt); - dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_defaultObjectEncoding, &flash_utils_ByteArray_defaultObjectEncoding); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_readFloat, &flash_utils_ByteArray_readFloat); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_compress, &flash_utils_ByteArray_compress); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_writeUTFBytes, &flash_utils_ByteArray_writeUTFBytes); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_readBoolean, &flash_utils_ByteArray_readBoolean); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_inflate, &flash_utils_ByteArray_inflate); dict_put(&flash_utils_ByteArray.members, &flash_utils_ByteArray_readUTF, &flash_utils_ByteArray_readUTF); + dict_put(&flash_utils_ByteArray.static_members, &flash_utils_ByteArray_defaultObjectEncoding, &flash_utils_ByteArray_defaultObjectEncoding); dict_put(d, &flash_sampler_stopSampling, &flash_sampler_stopSampling); dict_put(d, &flash_events_SyncEvent, &flash_events_SyncEvent); dict_init2(&flash_events_SyncEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_SyncEvent.members, &flash_events_SyncEvent_SYNC, &flash_events_SyncEvent_SYNC); + dict_init2(&flash_events_SyncEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_SyncEvent.members, &flash_events_SyncEvent_toString, &flash_events_SyncEvent_toString); dict_put(&flash_events_SyncEvent.members, &flash_events_SyncEvent_clone, &flash_events_SyncEvent_clone); dict_put(&flash_events_SyncEvent.members, &flash_events_SyncEvent_changeList, &flash_events_SyncEvent_changeList); + dict_put(&flash_events_SyncEvent.static_members, &flash_events_SyncEvent_SYNC, &flash_events_SyncEvent_SYNC); dict_put(d, &_encodeURIComponent, &_encodeURIComponent); dict_put(d, &flash_net_Socket, &flash_net_Socket); dict_init2(&flash_net_Socket.members, &memberinfo_type, 63); + dict_init2(&flash_net_Socket.static_members, &memberinfo_type, 8); dict_put(&flash_net_Socket.members, &flash_net_Socket_writeBoolean, &flash_net_Socket_writeBoolean); dict_put(&flash_net_Socket.members, &flash_net_Socket_connect, &flash_net_Socket_connect); dict_put(&flash_net_Socket.members, &flash_net_Socket_readDouble, &flash_net_Socket_readDouble); @@ -5210,6 +6152,7 @@ dict_put(d, &_unescape, &_unescape); dict_put(d, &flash_utils_Timer, &flash_utils_Timer); dict_init2(&flash_utils_Timer.members, &memberinfo_type, 8); + dict_init2(&flash_utils_Timer.static_members, &memberinfo_type, 8); dict_put(&flash_utils_Timer.members, &flash_utils_Timer_reset, &flash_utils_Timer_reset); dict_put(&flash_utils_Timer.members, &flash_utils_Timer_running, &flash_utils_Timer_running); dict_put(&flash_utils_Timer.members, &flash_utils_Timer_repeatCount, &flash_utils_Timer_repeatCount); @@ -5218,33 +6161,35 @@ dict_put(&flash_utils_Timer.members, &flash_utils_Timer_currentCount, &flash_utils_Timer_currentCount); dict_put(&flash_utils_Timer.members, &flash_utils_Timer_delay, &flash_utils_Timer_delay); dict_put(d, &_Array, &_Array); - dict_init2(&_Array.members, &memberinfo_type, 63); - dict_put(&_Array.members, &_Array_sort, &_Array_sort); - dict_put(&_Array.members, &_Array_unshift, &_Array_unshift); - dict_put(&_Array.members, &_Array_RETURNINDEXEDARRAY, &_Array_RETURNINDEXEDARRAY); - dict_put(&_Array.members, &_Array_indexOf, &_Array_indexOf); - dict_put(&_Array.members, &_Array_join, &_Array_join); - dict_put(&_Array.members, &_Array_sortOn, &_Array_sortOn); - dict_put(&_Array.members, &_Array_UNIQUESORT, &_Array_UNIQUESORT); - dict_put(&_Array.members, &_Array_shift, &_Array_shift); - dict_put(&_Array.members, &_Array_reverse, &_Array_reverse); - dict_put(&_Array.members, &_Array_CASEINSENSITIVE, &_Array_CASEINSENSITIVE); + dict_init2(&_Array.members, &memberinfo_type, 31); + dict_init2(&_Array.static_members, &memberinfo_type, 8); dict_put(&_Array.members, &_Array_forEach, &_Array_forEach); - dict_put(&_Array.members, &_Array_DESCENDING, &_Array_DESCENDING); - dict_put(&_Array.members, &_Array_pop, &_Array_pop); - dict_put(&_Array.members, &_Array_slice, &_Array_slice); - dict_put(&_Array.members, &_Array_length, &_Array_length); - dict_put(&_Array.members, &_Array_map, &_Array_map); - dict_put(&_Array.members, &_Array_push, &_Array_push); - dict_put(&_Array.members, &_Array_lastIndexOf, &_Array_lastIndexOf); + dict_put(&_Array.members, &_Array_sortOn, &_Array_sortOn); + dict_put(&_Array.members, &_Array_indexOf, &_Array_indexOf); dict_put(&_Array.members, &_Array_splice, &_Array_splice); - dict_put(&_Array.members, &_Array_every, &_Array_every); + dict_put(&_Array.members, &_Array_lastIndexOf, &_Array_lastIndexOf); + dict_put(&_Array.members, &_Array_map, &_Array_map); dict_put(&_Array.members, &_Array_concat, &_Array_concat); - dict_put(&_Array.members, &_Array_NUMERIC, &_Array_NUMERIC); - dict_put(&_Array.members, &_Array_filter, &_Array_filter); + dict_put(&_Array.members, &_Array_shift, &_Array_shift); + dict_put(&_Array.members, &_Array_unshift, &_Array_unshift); dict_put(&_Array.members, &_Array_some, &_Array_some); + dict_put(&_Array.members, &_Array_filter, &_Array_filter); + dict_put(&_Array.members, &_Array_join, &_Array_join); + dict_put(&_Array.members, &_Array_slice, &_Array_slice); + dict_put(&_Array.members, &_Array_every, &_Array_every); + dict_put(&_Array.members, &_Array_pop, &_Array_pop); + dict_put(&_Array.members, &_Array_sort, &_Array_sort); + dict_put(&_Array.members, &_Array_reverse, &_Array_reverse); + dict_put(&_Array.members, &_Array_push, &_Array_push); + dict_put(&_Array.members, &_Array_length, &_Array_length); + dict_put(&_Array.static_members, &_Array_DESCENDING, &_Array_DESCENDING); + dict_put(&_Array.static_members, &_Array_UNIQUESORT, &_Array_UNIQUESORT); + dict_put(&_Array.static_members, &_Array_RETURNINDEXEDARRAY, &_Array_RETURNINDEXEDARRAY); + dict_put(&_Array.static_members, &_Array_CASEINSENSITIVE, &_Array_CASEINSENSITIVE); + dict_put(&_Array.static_members, &_Array_NUMERIC, &_Array_NUMERIC); dict_put(d, &flash_geom_ColorTransform, &flash_geom_ColorTransform); dict_init2(&flash_geom_ColorTransform.members, &memberinfo_type, 15); + dict_init2(&flash_geom_ColorTransform.static_members, &memberinfo_type, 8); dict_put(&flash_geom_ColorTransform.members, &flash_geom_ColorTransform_blueOffset, &flash_geom_ColorTransform_blueOffset); dict_put(&flash_geom_ColorTransform.members, &flash_geom_ColorTransform_greenOffset, &flash_geom_ColorTransform_greenOffset); dict_put(&flash_geom_ColorTransform.members, &flash_geom_ColorTransform_greenMultiplier, &flash_geom_ColorTransform_greenMultiplier); @@ -5258,59 +6203,71 @@ dict_put(&flash_geom_ColorTransform.members, &flash_geom_ColorTransform_redOffset, &flash_geom_ColorTransform_redOffset); dict_put(d, &flash_text_GridFitType, &flash_text_GridFitType); dict_init2(&flash_text_GridFitType.members, &memberinfo_type, 8); - dict_put(&flash_text_GridFitType.members, &flash_text_GridFitType_SUBPIXEL, &flash_text_GridFitType_SUBPIXEL); - dict_put(&flash_text_GridFitType.members, &flash_text_GridFitType_PIXEL, &flash_text_GridFitType_PIXEL); - dict_put(&flash_text_GridFitType.members, &flash_text_GridFitType_NONE, &flash_text_GridFitType_NONE); + dict_init2(&flash_text_GridFitType.static_members, &memberinfo_type, 8); + dict_put(&flash_text_GridFitType.static_members, &flash_text_GridFitType_SUBPIXEL, &flash_text_GridFitType_SUBPIXEL); + dict_put(&flash_text_GridFitType.static_members, &flash_text_GridFitType_PIXEL, &flash_text_GridFitType_PIXEL); + dict_put(&flash_text_GridFitType.static_members, &flash_text_GridFitType_NONE, &flash_text_GridFitType_NONE); dict_put(d, &flash_filters_DisplacementMapFilterMode, &flash_filters_DisplacementMapFilterMode); dict_init2(&flash_filters_DisplacementMapFilterMode.members, &memberinfo_type, 8); - dict_put(&flash_filters_DisplacementMapFilterMode.members, &flash_filters_DisplacementMapFilterMode_COLOR, &flash_filters_DisplacementMapFilterMode_COLOR); - dict_put(&flash_filters_DisplacementMapFilterMode.members, &flash_filters_DisplacementMapFilterMode_WRAP, &flash_filters_DisplacementMapFilterMode_WRAP); - dict_put(&flash_filters_DisplacementMapFilterMode.members, &flash_filters_DisplacementMapFilterMode_CLAMP, &flash_filters_DisplacementMapFilterMode_CLAMP); - dict_put(&flash_filters_DisplacementMapFilterMode.members, &flash_filters_DisplacementMapFilterMode_IGNORE, &flash_filters_DisplacementMapFilterMode_IGNORE); + dict_init2(&flash_filters_DisplacementMapFilterMode.static_members, &memberinfo_type, 8); + dict_put(&flash_filters_DisplacementMapFilterMode.static_members, &flash_filters_DisplacementMapFilterMode_COLOR, &flash_filters_DisplacementMapFilterMode_COLOR); + dict_put(&flash_filters_DisplacementMapFilterMode.static_members, &flash_filters_DisplacementMapFilterMode_WRAP, &flash_filters_DisplacementMapFilterMode_WRAP); + dict_put(&flash_filters_DisplacementMapFilterMode.static_members, &flash_filters_DisplacementMapFilterMode_CLAMP, &flash_filters_DisplacementMapFilterMode_CLAMP); + dict_put(&flash_filters_DisplacementMapFilterMode.static_members, &flash_filters_DisplacementMapFilterMode_IGNORE, &flash_filters_DisplacementMapFilterMode_IGNORE); dict_put(d, &flash_text_TextFieldType, &flash_text_TextFieldType); dict_init2(&flash_text_TextFieldType.members, &memberinfo_type, 8); - dict_put(&flash_text_TextFieldType.members, &flash_text_TextFieldType_DYNAMIC, &flash_text_TextFieldType_DYNAMIC); - dict_put(&flash_text_TextFieldType.members, &flash_text_TextFieldType_INPUT, &flash_text_TextFieldType_INPUT); + dict_init2(&flash_text_TextFieldType.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextFieldType.static_members, &flash_text_TextFieldType_DYNAMIC, &flash_text_TextFieldType_DYNAMIC); + dict_put(&flash_text_TextFieldType.static_members, &flash_text_TextFieldType_INPUT, &flash_text_TextFieldType_INPUT); dict_put(d, &flash_display_IGraphicsStroke, &flash_display_IGraphicsStroke); dict_init2(&flash_display_IGraphicsStroke.members, &memberinfo_type, 8); + dict_init2(&flash_display_IGraphicsStroke.static_members, &memberinfo_type, 8); dict_put(d, &flash_media_SoundLoaderContext, &flash_media_SoundLoaderContext); dict_init2(&flash_media_SoundLoaderContext.members, &memberinfo_type, 8); + dict_init2(&flash_media_SoundLoaderContext.static_members, &memberinfo_type, 8); dict_put(&flash_media_SoundLoaderContext.members, &flash_media_SoundLoaderContext_checkPolicyFile, &flash_media_SoundLoaderContext_checkPolicyFile); dict_put(&flash_media_SoundLoaderContext.members, &flash_media_SoundLoaderContext_bufferTime, &flash_media_SoundLoaderContext_bufferTime); dict_put(d, &flash_net_IDynamicPropertyOutput, &flash_net_IDynamicPropertyOutput); dict_init2(&flash_net_IDynamicPropertyOutput.members, &memberinfo_type, 8); + dict_init2(&flash_net_IDynamicPropertyOutput.static_members, &memberinfo_type, 8); dict_put(&flash_net_IDynamicPropertyOutput.members, &flash_net_IDynamicPropertyOutput_writeDynamicProperty, &flash_net_IDynamicPropertyOutput_writeDynamicProperty); dict_put(d, &flash_display_IGraphicsData, &flash_display_IGraphicsData); dict_init2(&flash_display_IGraphicsData.members, &memberinfo_type, 8); + dict_init2(&flash_display_IGraphicsData.static_members, &memberinfo_type, 8); dict_put(d, &flash_utils_getDefinitionByName, &flash_utils_getDefinitionByName); dict_put(d, &_Function, &_Function); dict_init2(&_Function.members, &memberinfo_type, 8); + dict_init2(&_Function.static_members, &memberinfo_type, 8); dict_put(&_Function.members, &_Function_length, &_Function_length); dict_put(&_Function.members, &_Function_apply, &_Function_apply); dict_put(&_Function.members, &_Function_call, &_Function_call); dict_put(&_Function.members, &_Function_prototype, &_Function_prototype); dict_put(d, &flash_geom_PerspectiveProjection, &flash_geom_PerspectiveProjection); dict_init2(&flash_geom_PerspectiveProjection.members, &memberinfo_type, 8); + dict_init2(&flash_geom_PerspectiveProjection.static_members, &memberinfo_type, 8); dict_put(&flash_geom_PerspectiveProjection.members, &flash_geom_PerspectiveProjection_fieldOfView, &flash_geom_PerspectiveProjection_fieldOfView); dict_put(&flash_geom_PerspectiveProjection.members, &flash_geom_PerspectiveProjection_projectionCenter, &flash_geom_PerspectiveProjection_projectionCenter); dict_put(&flash_geom_PerspectiveProjection.members, &flash_geom_PerspectiveProjection_toMatrix3D, &flash_geom_PerspectiveProjection_toMatrix3D); dict_put(&flash_geom_PerspectiveProjection.members, &flash_geom_PerspectiveProjection_focalLength, &flash_geom_PerspectiveProjection_focalLength); dict_put(d, &flash_text_engine_BreakOpportunity, &flash_text_engine_BreakOpportunity); dict_init2(&flash_text_engine_BreakOpportunity.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_BreakOpportunity.members, &flash_text_engine_BreakOpportunity_AUTO, &flash_text_engine_BreakOpportunity_AUTO); - dict_put(&flash_text_engine_BreakOpportunity.members, &flash_text_engine_BreakOpportunity_ANY, &flash_text_engine_BreakOpportunity_ANY); - dict_put(&flash_text_engine_BreakOpportunity.members, &flash_text_engine_BreakOpportunity_ALL, &flash_text_engine_BreakOpportunity_ALL); - dict_put(&flash_text_engine_BreakOpportunity.members, &flash_text_engine_BreakOpportunity_NONE, &flash_text_engine_BreakOpportunity_NONE); + dict_init2(&flash_text_engine_BreakOpportunity.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_BreakOpportunity.static_members, &flash_text_engine_BreakOpportunity_AUTO, &flash_text_engine_BreakOpportunity_AUTO); + dict_put(&flash_text_engine_BreakOpportunity.static_members, &flash_text_engine_BreakOpportunity_ANY, &flash_text_engine_BreakOpportunity_ANY); + dict_put(&flash_text_engine_BreakOpportunity.static_members, &flash_text_engine_BreakOpportunity_ALL, &flash_text_engine_BreakOpportunity_ALL); + dict_put(&flash_text_engine_BreakOpportunity.static_members, &flash_text_engine_BreakOpportunity_NONE, &flash_text_engine_BreakOpportunity_NONE); dict_put(d, &flash_sampler__getInvocationCount, &flash_sampler__getInvocationCount); dict_put(d, &_parseFloat, &_parseFloat); dict_put(d, &flash_events_NetStatusEvent, &flash_events_NetStatusEvent); dict_init2(&flash_events_NetStatusEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_NetStatusEvent.members, &flash_events_NetStatusEvent_NET_STATUS, &flash_events_NetStatusEvent_NET_STATUS); + dict_init2(&flash_events_NetStatusEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_NetStatusEvent.members, &flash_events_NetStatusEvent_toString, &flash_events_NetStatusEvent_toString); dict_put(&flash_events_NetStatusEvent.members, &flash_events_NetStatusEvent_info, &flash_events_NetStatusEvent_info); dict_put(&flash_events_NetStatusEvent.members, &flash_events_NetStatusEvent_clone, &flash_events_NetStatusEvent_clone); + dict_put(&flash_events_NetStatusEvent.static_members, &flash_events_NetStatusEvent_NET_STATUS, &flash_events_NetStatusEvent_NET_STATUS); dict_put(d, &flash_display_ShaderJob, &flash_display_ShaderJob); dict_init2(&flash_display_ShaderJob.members, &memberinfo_type, 8); + dict_init2(&flash_display_ShaderJob.static_members, &memberinfo_type, 8); dict_put(&flash_display_ShaderJob.members, &flash_display_ShaderJob_cancel, &flash_display_ShaderJob_cancel); dict_put(&flash_display_ShaderJob.members, &flash_display_ShaderJob_width, &flash_display_ShaderJob_width); dict_put(&flash_display_ShaderJob.members, &flash_display_ShaderJob_start, &flash_display_ShaderJob_start); @@ -5320,101 +6277,108 @@ dict_put(&flash_display_ShaderJob.members, &flash_display_ShaderJob_progress, &flash_display_ShaderJob_progress); dict_put(d, &_VerifyError, &_VerifyError); dict_init2(&_VerifyError.members, &memberinfo_type, 8); - dict_put(&_VerifyError.members, &_VerifyError_length, &_VerifyError_length); + dict_init2(&_VerifyError.static_members, &memberinfo_type, 8); + dict_put(&_VerifyError.static_members, &_VerifyError_length, &_VerifyError_length); dict_put(d, &flash_events_AsyncErrorEvent, &flash_events_AsyncErrorEvent); dict_init2(&flash_events_AsyncErrorEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_AsyncErrorEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_AsyncErrorEvent.members, &flash_events_AsyncErrorEvent_toString, &flash_events_AsyncErrorEvent_toString); - dict_put(&flash_events_AsyncErrorEvent.members, &flash_events_AsyncErrorEvent_ASYNC_ERROR, &flash_events_AsyncErrorEvent_ASYNC_ERROR); dict_put(&flash_events_AsyncErrorEvent.members, &flash_events_AsyncErrorEvent_error, &flash_events_AsyncErrorEvent_error); dict_put(&flash_events_AsyncErrorEvent.members, &flash_events_AsyncErrorEvent_clone, &flash_events_AsyncErrorEvent_clone); + dict_put(&flash_events_AsyncErrorEvent.static_members, &flash_events_AsyncErrorEvent_ASYNC_ERROR, &flash_events_AsyncErrorEvent_ASYNC_ERROR); dict_put(d, &flash_net_SharedObject, &flash_net_SharedObject); dict_init2(&flash_net_SharedObject.members, &memberinfo_type, 15); - dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_getLocal, &flash_net_SharedObject_getLocal); - dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_getDiskUsage, &flash_net_SharedObject_getDiskUsage); + dict_init2(&flash_net_SharedObject.static_members, &memberinfo_type, 8); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_objectEncoding, &flash_net_SharedObject_objectEncoding); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_client, &flash_net_SharedObject_client); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_setProperty, &flash_net_SharedObject_setProperty); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_clear, &flash_net_SharedObject_clear); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_flush, &flash_net_SharedObject_flush); - dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_defaultObjectEncoding, &flash_net_SharedObject_defaultObjectEncoding); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_connect, &flash_net_SharedObject_connect); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_size, &flash_net_SharedObject_size); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_setDirty, &flash_net_SharedObject_setDirty); - dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_getRemote, &flash_net_SharedObject_getRemote); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_send, &flash_net_SharedObject_send); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_close, &flash_net_SharedObject_close); - dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_deleteAll, &flash_net_SharedObject_deleteAll); dict_put(&flash_net_SharedObject.members, &flash_net_SharedObject_data, &flash_net_SharedObject_data); + dict_put(&flash_net_SharedObject.static_members, &flash_net_SharedObject_defaultObjectEncoding, &flash_net_SharedObject_defaultObjectEncoding); + dict_put(&flash_net_SharedObject.static_members, &flash_net_SharedObject_getDiskUsage, &flash_net_SharedObject_getDiskUsage); + dict_put(&flash_net_SharedObject.static_members, &flash_net_SharedObject_getRemote, &flash_net_SharedObject_getRemote); + dict_put(&flash_net_SharedObject.static_members, &flash_net_SharedObject_deleteAll, &flash_net_SharedObject_deleteAll); + dict_put(&flash_net_SharedObject.static_members, &flash_net_SharedObject_getLocal, &flash_net_SharedObject_getLocal); dict_put(d, &_Namespace, &_Namespace); dict_init2(&_Namespace.members, &memberinfo_type, 8); + dict_init2(&_Namespace.static_members, &memberinfo_type, 8); dict_put(&_Namespace.members, &_Namespace_valueOf, &_Namespace_valueOf); - dict_put(&_Namespace.members, &_Namespace_length, &_Namespace_length); dict_put(&_Namespace.members, &_Namespace_toString, &_Namespace_toString); dict_put(&_Namespace.members, &_Namespace_uri, &_Namespace_uri); dict_put(&_Namespace.members, &_Namespace_prefix, &_Namespace_prefix); + dict_put(&_Namespace.static_members, &_Namespace_length, &_Namespace_length); dict_put(d, &flash_utils_setTimeout, &flash_utils_setTimeout); dict_put(d, &flash_geom_Matrix3D, &flash_geom_Matrix3D); - dict_init2(&flash_geom_Matrix3D.members, &memberinfo_type, 63); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_interpolateTo, &flash_geom_Matrix3D_interpolateTo); + dict_init2(&flash_geom_Matrix3D.members, &memberinfo_type, 31); + dict_init2(&flash_geom_Matrix3D.static_members, &memberinfo_type, 8); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_decompose, &flash_geom_Matrix3D_decompose); dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_pointAt, &flash_geom_Matrix3D_pointAt); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_interpolate, &flash_geom_Matrix3D_interpolate); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_prependRotation, &flash_geom_Matrix3D_prependRotation); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_identity, &flash_geom_Matrix3D_identity); dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_transformVector, &flash_geom_Matrix3D_transformVector); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_transpose, &flash_geom_Matrix3D_transpose); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_prependScale, &flash_geom_Matrix3D_prependScale); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_deltaTransformVector, &flash_geom_Matrix3D_deltaTransformVector); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_position, &flash_geom_Matrix3D_position); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_decompose, &flash_geom_Matrix3D_decompose); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_append, &flash_geom_Matrix3D_append); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_recompose, &flash_geom_Matrix3D_recompose); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_clone, &flash_geom_Matrix3D_clone); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_rawData, &flash_geom_Matrix3D_rawData); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_appendRotation, &flash_geom_Matrix3D_appendRotation); dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_determinant, &flash_geom_Matrix3D_determinant); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_invert, &flash_geom_Matrix3D_invert); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_prependRotation, &flash_geom_Matrix3D_prependRotation); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_position, &flash_geom_Matrix3D_position); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_interpolateTo, &flash_geom_Matrix3D_interpolateTo); dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_appendScale, &flash_geom_Matrix3D_appendScale); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_transformVectors, &flash_geom_Matrix3D_transformVectors); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_appendTranslation, &flash_geom_Matrix3D_appendTranslation); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_appendRotation, &flash_geom_Matrix3D_appendRotation); dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_prepend, &flash_geom_Matrix3D_prepend); - dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_identity, &flash_geom_Matrix3D_identity); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_recompose, &flash_geom_Matrix3D_recompose); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_appendTranslation, &flash_geom_Matrix3D_appendTranslation); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_invert, &flash_geom_Matrix3D_invert); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_rawData, &flash_geom_Matrix3D_rawData); dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_prependTranslation, &flash_geom_Matrix3D_prependTranslation); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_append, &flash_geom_Matrix3D_append); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_clone, &flash_geom_Matrix3D_clone); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_prependScale, &flash_geom_Matrix3D_prependScale); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_deltaTransformVector, &flash_geom_Matrix3D_deltaTransformVector); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_transformVectors, &flash_geom_Matrix3D_transformVectors); + dict_put(&flash_geom_Matrix3D.members, &flash_geom_Matrix3D_transpose, &flash_geom_Matrix3D_transpose); + dict_put(&flash_geom_Matrix3D.static_members, &flash_geom_Matrix3D_interpolate, &flash_geom_Matrix3D_interpolate); dict_put(d, &flash_sampler_pauseSampling, &flash_sampler_pauseSampling); dict_put(d, &flash_system_Capabilities, &flash_system_Capabilities); - dict_init2(&flash_system_Capabilities.members, &memberinfo_type, 63); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_maxLevelIDC, &flash_system_Capabilities_maxLevelIDC); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_isDebugger, &flash_system_Capabilities_isDebugger); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasStreamingAudio, &flash_system_Capabilities_hasStreamingAudio); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_screenColor, &flash_system_Capabilities_screenColor); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasIME, &flash_system_Capabilities_hasIME); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasEmbeddedVideo, &flash_system_Capabilities_hasEmbeddedVideo); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasTLS, &flash_system_Capabilities_hasTLS); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_isEmbeddedInAcrobat, &flash_system_Capabilities_isEmbeddedInAcrobat); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasScreenPlayback, &flash_system_Capabilities_hasScreenPlayback); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasVideoEncoder, &flash_system_Capabilities_hasVideoEncoder); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasAudioEncoder, &flash_system_Capabilities_hasAudioEncoder); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_pixelAspectRatio, &flash_system_Capabilities_pixelAspectRatio); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasStreamingVideo, &flash_system_Capabilities_hasStreamingVideo); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_screenResolutionX, &flash_system_Capabilities_screenResolutionX); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasScreenBroadcast, &flash_system_Capabilities_hasScreenBroadcast); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasAudio, &flash_system_Capabilities_hasAudio); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_language, &flash_system_Capabilities_language); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_manufacturer, &flash_system_Capabilities_manufacturer); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasPrinting, &flash_system_Capabilities_hasPrinting); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_os, &flash_system_Capabilities_os); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_localFileReadDisable, &flash_system_Capabilities_localFileReadDisable); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasMP3, &flash_system_Capabilities_hasMP3); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_avHardwareDisable, &flash_system_Capabilities_avHardwareDisable); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_hasAccessibility, &flash_system_Capabilities_hasAccessibility); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_version, &flash_system_Capabilities_version); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_screenDPI, &flash_system_Capabilities_screenDPI); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_playerType, &flash_system_Capabilities_playerType); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_screenResolutionY, &flash_system_Capabilities_screenResolutionY); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities__internal, &flash_system_Capabilities__internal); - dict_put(&flash_system_Capabilities.members, &flash_system_Capabilities_serverString, &flash_system_Capabilities_serverString); + dict_init2(&flash_system_Capabilities.members, &memberinfo_type, 8); + dict_init2(&flash_system_Capabilities.static_members, &memberinfo_type, 63); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_maxLevelIDC, &flash_system_Capabilities_maxLevelIDC); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_isDebugger, &flash_system_Capabilities_isDebugger); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasStreamingAudio, &flash_system_Capabilities_hasStreamingAudio); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_screenColor, &flash_system_Capabilities_screenColor); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasIME, &flash_system_Capabilities_hasIME); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasEmbeddedVideo, &flash_system_Capabilities_hasEmbeddedVideo); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasTLS, &flash_system_Capabilities_hasTLS); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_isEmbeddedInAcrobat, &flash_system_Capabilities_isEmbeddedInAcrobat); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasScreenPlayback, &flash_system_Capabilities_hasScreenPlayback); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasVideoEncoder, &flash_system_Capabilities_hasVideoEncoder); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasAudioEncoder, &flash_system_Capabilities_hasAudioEncoder); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_pixelAspectRatio, &flash_system_Capabilities_pixelAspectRatio); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasStreamingVideo, &flash_system_Capabilities_hasStreamingVideo); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_screenResolutionX, &flash_system_Capabilities_screenResolutionX); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasScreenBroadcast, &flash_system_Capabilities_hasScreenBroadcast); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasAudio, &flash_system_Capabilities_hasAudio); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_language, &flash_system_Capabilities_language); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_manufacturer, &flash_system_Capabilities_manufacturer); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasPrinting, &flash_system_Capabilities_hasPrinting); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_os, &flash_system_Capabilities_os); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_localFileReadDisable, &flash_system_Capabilities_localFileReadDisable); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasMP3, &flash_system_Capabilities_hasMP3); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_avHardwareDisable, &flash_system_Capabilities_avHardwareDisable); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_hasAccessibility, &flash_system_Capabilities_hasAccessibility); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_version, &flash_system_Capabilities_version); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_screenDPI, &flash_system_Capabilities_screenDPI); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_playerType, &flash_system_Capabilities_playerType); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_screenResolutionY, &flash_system_Capabilities_screenResolutionY); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities__internal, &flash_system_Capabilities__internal); + dict_put(&flash_system_Capabilities.static_members, &flash_system_Capabilities_serverString, &flash_system_Capabilities_serverString); dict_put(d, &flash_sampler_getSetterInvocationCount, &flash_sampler_getSetterInvocationCount); dict_put(d, &flash_sampler_getGetterInvocationCount, &flash_sampler_getGetterInvocationCount); dict_put(d, &flash_filters_BlurFilter, &flash_filters_BlurFilter); dict_init2(&flash_filters_BlurFilter.members, &memberinfo_type, 8); + dict_init2(&flash_filters_BlurFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_BlurFilter.members, &flash_filters_BlurFilter_blurY, &flash_filters_BlurFilter_blurY); dict_put(&flash_filters_BlurFilter.members, &flash_filters_BlurFilter_clone, &flash_filters_BlurFilter_clone); dict_put(&flash_filters_BlurFilter.members, &flash_filters_BlurFilter_quality, &flash_filters_BlurFilter_quality); @@ -5422,6 +6386,7 @@ dict_put(d, &_isFinite, &_isFinite); dict_put(d, &flash_media_Video, &flash_media_Video); dict_init2(&flash_media_Video.members, &memberinfo_type, 8); + dict_init2(&flash_media_Video.static_members, &memberinfo_type, 8); dict_put(&flash_media_Video.members, &flash_media_Video_attachCamera, &flash_media_Video_attachCamera); dict_put(&flash_media_Video.members, &flash_media_Video_videoWidth, &flash_media_Video_videoWidth); dict_put(&flash_media_Video.members, &flash_media_Video_clear, &flash_media_Video_clear); @@ -5431,21 +6396,24 @@ dict_put(&flash_media_Video.members, &flash_media_Video_smoothing, &flash_media_Video_smoothing); dict_put(d, &flash_text_engine_TextLineCreationResult, &flash_text_engine_TextLineCreationResult); dict_init2(&flash_text_engine_TextLineCreationResult.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TextLineCreationResult.members, &flash_text_engine_TextLineCreationResult_EMERGENCY, &flash_text_engine_TextLineCreationResult_EMERGENCY); - dict_put(&flash_text_engine_TextLineCreationResult.members, &flash_text_engine_TextLineCreationResult_COMPLETE, &flash_text_engine_TextLineCreationResult_COMPLETE); - dict_put(&flash_text_engine_TextLineCreationResult.members, &flash_text_engine_TextLineCreationResult_SUCCESS, &flash_text_engine_TextLineCreationResult_SUCCESS); - dict_put(&flash_text_engine_TextLineCreationResult.members, &flash_text_engine_TextLineCreationResult_INSUFFICIENT_WIDTH, &flash_text_engine_TextLineCreationResult_INSUFFICIENT_WIDTH); + dict_init2(&flash_text_engine_TextLineCreationResult.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_TextLineCreationResult.static_members, &flash_text_engine_TextLineCreationResult_EMERGENCY, &flash_text_engine_TextLineCreationResult_EMERGENCY); + dict_put(&flash_text_engine_TextLineCreationResult.static_members, &flash_text_engine_TextLineCreationResult_COMPLETE, &flash_text_engine_TextLineCreationResult_COMPLETE); + dict_put(&flash_text_engine_TextLineCreationResult.static_members, &flash_text_engine_TextLineCreationResult_SUCCESS, &flash_text_engine_TextLineCreationResult_SUCCESS); + dict_put(&flash_text_engine_TextLineCreationResult.static_members, &flash_text_engine_TextLineCreationResult_INSUFFICIENT_WIDTH, &flash_text_engine_TextLineCreationResult_INSUFFICIENT_WIDTH); dict_put(d, &_Error, &_Error); - dict_init2(&_Error.members, &memberinfo_type, 15); - dict_put(&_Error.members, &_Error_getErrorMessage, &_Error_getErrorMessage); - dict_put(&_Error.members, &_Error_throwError, &_Error_throwError); - dict_put(&_Error.members, &_Error_length, &_Error_length); - dict_put(&_Error.members, &_Error_name, &_Error_name); + dict_init2(&_Error.members, &memberinfo_type, 8); + dict_init2(&_Error.static_members, &memberinfo_type, 8); dict_put(&_Error.members, &_Error_message, &_Error_message); - dict_put(&_Error.members, &_Error_getStackTrace, &_Error_getStackTrace); dict_put(&_Error.members, &_Error_errorID, &_Error_errorID); + dict_put(&_Error.members, &_Error_getStackTrace, &_Error_getStackTrace); + dict_put(&_Error.members, &_Error_name, &_Error_name); + dict_put(&_Error.static_members, &_Error_length, &_Error_length); + dict_put(&_Error.static_members, &_Error_getErrorMessage, &_Error_getErrorMessage); + dict_put(&_Error.static_members, &_Error_throwError, &_Error_throwError); dict_put(d, &flash_xml_XMLNode, &flash_xml_XMLNode); dict_init2(&flash_xml_XMLNode.members, &memberinfo_type, 31); + dict_init2(&flash_xml_XMLNode.static_members, &memberinfo_type, 8); dict_put(&flash_xml_XMLNode.members, &flash_xml_XMLNode_childNodes, &flash_xml_XMLNode_childNodes); dict_put(&flash_xml_XMLNode.members, &flash_xml_XMLNode_appendChild, &flash_xml_XMLNode_appendChild); dict_put(&flash_xml_XMLNode.members, &flash_xml_XMLNode_nextSibling, &flash_xml_XMLNode_nextSibling); @@ -5469,11 +6437,12 @@ dict_put(&flash_xml_XMLNode.members, &flash_xml_XMLNode_nodeValue, &flash_xml_XMLNode_nodeValue); dict_put(d, &flash_net_URLVariables, &flash_net_URLVariables); dict_init2(&flash_net_URLVariables.members, &memberinfo_type, 8); + dict_init2(&flash_net_URLVariables.static_members, &memberinfo_type, 8); dict_put(&flash_net_URLVariables.members, &flash_net_URLVariables_toString, &flash_net_URLVariables_toString); dict_put(&flash_net_URLVariables.members, &flash_net_URLVariables_decode, &flash_net_URLVariables_decode); dict_put(d, &flash_display_LoaderInfo, &flash_display_LoaderInfo); dict_init2(&flash_display_LoaderInfo.members, &memberinfo_type, 31); - dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_getLoaderInfoByDefinition, &flash_display_LoaderInfo_getLoaderInfoByDefinition); + dict_init2(&flash_display_LoaderInfo.static_members, &memberinfo_type, 8); dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_actionScriptVersion, &flash_display_LoaderInfo_actionScriptVersion); dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_contentType, &flash_display_LoaderInfo_contentType); dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_sameDomain, &flash_display_LoaderInfo_sameDomain); @@ -5494,38 +6463,45 @@ dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_parentAllowsChild, &flash_display_LoaderInfo_parentAllowsChild); dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_childAllowsParent, &flash_display_LoaderInfo_childAllowsParent); dict_put(&flash_display_LoaderInfo.members, &flash_display_LoaderInfo_sharedEvents, &flash_display_LoaderInfo_sharedEvents); + dict_put(&flash_display_LoaderInfo.static_members, &flash_display_LoaderInfo_getLoaderInfoByDefinition, &flash_display_LoaderInfo_getLoaderInfoByDefinition); dict_put(d, &flash_sampler_Sample, &flash_sampler_Sample); dict_init2(&flash_sampler_Sample.members, &memberinfo_type, 8); + dict_init2(&flash_sampler_Sample.static_members, &memberinfo_type, 8); dict_put(&flash_sampler_Sample.members, &flash_sampler_Sample_time, &flash_sampler_Sample_time); dict_put(&flash_sampler_Sample.members, &flash_sampler_Sample_stack, &flash_sampler_Sample_stack); dict_put(d, &flash_text_engine_DigitWidth, &flash_text_engine_DigitWidth); dict_init2(&flash_text_engine_DigitWidth.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_DigitWidth.members, &flash_text_engine_DigitWidth_PROPORTIONAL, &flash_text_engine_DigitWidth_PROPORTIONAL); - dict_put(&flash_text_engine_DigitWidth.members, &flash_text_engine_DigitWidth_DEFAULT, &flash_text_engine_DigitWidth_DEFAULT); - dict_put(&flash_text_engine_DigitWidth.members, &flash_text_engine_DigitWidth_TABULAR, &flash_text_engine_DigitWidth_TABULAR); + dict_init2(&flash_text_engine_DigitWidth.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_DigitWidth.static_members, &flash_text_engine_DigitWidth_PROPORTIONAL, &flash_text_engine_DigitWidth_PROPORTIONAL); + dict_put(&flash_text_engine_DigitWidth.static_members, &flash_text_engine_DigitWidth_DEFAULT, &flash_text_engine_DigitWidth_DEFAULT); + dict_put(&flash_text_engine_DigitWidth.static_members, &flash_text_engine_DigitWidth_TABULAR, &flash_text_engine_DigitWidth_TABULAR); dict_put(d, &flash_net_URLRequestMethod, &flash_net_URLRequestMethod); dict_init2(&flash_net_URLRequestMethod.members, &memberinfo_type, 8); - dict_put(&flash_net_URLRequestMethod.members, &flash_net_URLRequestMethod_GET, &flash_net_URLRequestMethod_GET); - dict_put(&flash_net_URLRequestMethod.members, &flash_net_URLRequestMethod_POST, &flash_net_URLRequestMethod_POST); + dict_init2(&flash_net_URLRequestMethod.static_members, &memberinfo_type, 8); + dict_put(&flash_net_URLRequestMethod.static_members, &flash_net_URLRequestMethod_GET, &flash_net_URLRequestMethod_GET); + dict_put(&flash_net_URLRequestMethod.static_members, &flash_net_URLRequestMethod_POST, &flash_net_URLRequestMethod_POST); dict_put(d, &adobe_utils_MMExecute, &adobe_utils_MMExecute); dict_put(d, &flash_system_System, &flash_system_System); - dict_init2(&flash_system_System.members, &memberinfo_type, 15); - dict_put(&flash_system_System.members, &flash_system_System_pause, &flash_system_System_pause); - dict_put(&flash_system_System.members, &flash_system_System_useCodePage, &flash_system_System_useCodePage); - dict_put(&flash_system_System.members, &flash_system_System_exit, &flash_system_System_exit); - dict_put(&flash_system_System.members, &flash_system_System_setClipboard, &flash_system_System_setClipboard); - dict_put(&flash_system_System.members, &flash_system_System_totalMemory, &flash_system_System_totalMemory); - dict_put(&flash_system_System.members, &flash_system_System_gc, &flash_system_System_gc); - dict_put(&flash_system_System.members, &flash_system_System_resume, &flash_system_System_resume); - dict_put(&flash_system_System.members, &flash_system_System_vmVersion, &flash_system_System_vmVersion); - dict_put(&flash_system_System.members, &flash_system_System_ime, &flash_system_System_ime); + dict_init2(&flash_system_System.members, &memberinfo_type, 8); + dict_init2(&flash_system_System.static_members, &memberinfo_type, 15); + dict_put(&flash_system_System.static_members, &flash_system_System_pause, &flash_system_System_pause); + dict_put(&flash_system_System.static_members, &flash_system_System_useCodePage, &flash_system_System_useCodePage); + dict_put(&flash_system_System.static_members, &flash_system_System_exit, &flash_system_System_exit); + dict_put(&flash_system_System.static_members, &flash_system_System_setClipboard, &flash_system_System_setClipboard); + dict_put(&flash_system_System.static_members, &flash_system_System_totalMemory, &flash_system_System_totalMemory); + dict_put(&flash_system_System.static_members, &flash_system_System_gc, &flash_system_System_gc); + dict_put(&flash_system_System.static_members, &flash_system_System_resume, &flash_system_System_resume); + dict_put(&flash_system_System.static_members, &flash_system_System_vmVersion, &flash_system_System_vmVersion); + dict_put(&flash_system_System.static_members, &flash_system_System_ime, &flash_system_System_ime); dict_put(d, &flash_filters_BitmapFilterQuality, &flash_filters_BitmapFilterQuality); dict_init2(&flash_filters_BitmapFilterQuality.members, &memberinfo_type, 8); - dict_put(&flash_filters_BitmapFilterQuality.members, &flash_filters_BitmapFilterQuality_LOW, &flash_filters_BitmapFilterQuality_LOW); - dict_put(&flash_filters_BitmapFilterQuality.members, &flash_filters_BitmapFilterQuality_MEDIUM, &flash_filters_BitmapFilterQuality_MEDIUM); - dict_put(&flash_filters_BitmapFilterQuality.members, &flash_filters_BitmapFilterQuality_HIGH, &flash_filters_BitmapFilterQuality_HIGH); + dict_init2(&flash_filters_BitmapFilterQuality.static_members, &memberinfo_type, 8); + dict_put(&flash_filters_BitmapFilterQuality.static_members, &flash_filters_BitmapFilterQuality_LOW, &flash_filters_BitmapFilterQuality_LOW); + dict_put(&flash_filters_BitmapFilterQuality.static_members, &flash_filters_BitmapFilterQuality_MEDIUM, &flash_filters_BitmapFilterQuality_MEDIUM); + dict_put(&flash_filters_BitmapFilterQuality.static_members, &flash_filters_BitmapFilterQuality_HIGH, &flash_filters_BitmapFilterQuality_HIGH); dict_put(d, &flash_display_DisplayObjectContainer, &flash_display_DisplayObjectContainer); dict_init2(&flash_display_DisplayObjectContainer.members, &memberinfo_type, 31); + dict_init2(&flash_display_DisplayObjectContainer.static_members, &memberinfo_type, 8); dict_put(&flash_display_DisplayObjectContainer.members, &flash_display_DisplayObjectContainer_addChild, &flash_display_DisplayObjectContainer_addChild); dict_put(&flash_display_DisplayObjectContainer.members, &flash_display_DisplayObjectContainer_getObjectsUnderPoint, &flash_display_DisplayObjectContainer_getObjectsUnderPoint); dict_put(&flash_display_DisplayObjectContainer.members, &flash_display_DisplayObjectContainer_removeChildAt, &flash_display_DisplayObjectContainer_removeChildAt); @@ -5545,6 +6521,7 @@ dict_put(&flash_display_DisplayObjectContainer.members, &flash_display_DisplayObjectContainer_textSnapshot, &flash_display_DisplayObjectContainer_textSnapshot); dict_put(d, &flash_system_LoaderContext, &flash_system_LoaderContext); dict_init2(&flash_system_LoaderContext.members, &memberinfo_type, 8); + dict_init2(&flash_system_LoaderContext.static_members, &memberinfo_type, 8); dict_put(&flash_system_LoaderContext.members, &flash_system_LoaderContext_checkPolicyFile, &flash_system_LoaderContext_checkPolicyFile); dict_put(&flash_system_LoaderContext.members, &flash_system_LoaderContext_securityDomain, &flash_system_LoaderContext_securityDomain); dict_put(&flash_system_LoaderContext.members, &flash_system_LoaderContext_applicationDomain, &flash_system_LoaderContext_applicationDomain); @@ -5552,20 +6529,23 @@ dict_put(d, &_isXMLName, &_isXMLName); dict_put(d, &flash_xml_XMLNodeType, &flash_xml_XMLNodeType); dict_init2(&flash_xml_XMLNodeType.members, &memberinfo_type, 8); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_PROCESSING_INSTRUCTION_NODE, &flash_xml_XMLNodeType_PROCESSING_INSTRUCTION_NODE); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_CDATA_NODE, &flash_xml_XMLNodeType_CDATA_NODE); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_DOCUMENT_TYPE_NODE, &flash_xml_XMLNodeType_DOCUMENT_TYPE_NODE); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_COMMENT_NODE, &flash_xml_XMLNodeType_COMMENT_NODE); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_XML_DECLARATION, &flash_xml_XMLNodeType_XML_DECLARATION); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_TEXT_NODE, &flash_xml_XMLNodeType_TEXT_NODE); - dict_put(&flash_xml_XMLNodeType.members, &flash_xml_XMLNodeType_ELEMENT_NODE, &flash_xml_XMLNodeType_ELEMENT_NODE); + dict_init2(&flash_xml_XMLNodeType.static_members, &memberinfo_type, 8); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_PROCESSING_INSTRUCTION_NODE, &flash_xml_XMLNodeType_PROCESSING_INSTRUCTION_NODE); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_CDATA_NODE, &flash_xml_XMLNodeType_CDATA_NODE); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_DOCUMENT_TYPE_NODE, &flash_xml_XMLNodeType_DOCUMENT_TYPE_NODE); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_COMMENT_NODE, &flash_xml_XMLNodeType_COMMENT_NODE); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_XML_DECLARATION, &flash_xml_XMLNodeType_XML_DECLARATION); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_TEXT_NODE, &flash_xml_XMLNodeType_TEXT_NODE); + dict_put(&flash_xml_XMLNodeType.static_members, &flash_xml_XMLNodeType_ELEMENT_NODE, &flash_xml_XMLNodeType_ELEMENT_NODE); dict_put(d, &flash_events_ErrorEvent, &flash_events_ErrorEvent); dict_init2(&flash_events_ErrorEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_ErrorEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_ErrorEvent.members, &flash_events_ErrorEvent_toString, &flash_events_ErrorEvent_toString); - dict_put(&flash_events_ErrorEvent.members, &flash_events_ErrorEvent_ERROR, &flash_events_ErrorEvent_ERROR); dict_put(&flash_events_ErrorEvent.members, &flash_events_ErrorEvent_clone, &flash_events_ErrorEvent_clone); + dict_put(&flash_events_ErrorEvent.static_members, &flash_events_ErrorEvent_ERROR, &flash_events_ErrorEvent_ERROR); dict_put(d, &flash_utils_IDataOutput, &flash_utils_IDataOutput); dict_init2(&flash_utils_IDataOutput.members, &memberinfo_type, 31); + dict_init2(&flash_utils_IDataOutput.static_members, &memberinfo_type, 8); dict_put(&flash_utils_IDataOutput.members, &flash_utils_IDataOutput_writeUnsignedInt, &flash_utils_IDataOutput_writeUnsignedInt); dict_put(&flash_utils_IDataOutput.members, &flash_utils_IDataOutput_writeInt, &flash_utils_IDataOutput_writeInt); dict_put(&flash_utils_IDataOutput.members, &flash_utils_IDataOutput_objectEncoding, &flash_utils_IDataOutput_objectEncoding); @@ -5582,18 +6562,21 @@ dict_put(&flash_utils_IDataOutput.members, &flash_utils_IDataOutput_endian, &flash_utils_IDataOutput_endian); dict_put(d, &flash_geom_Utils3D, &flash_geom_Utils3D); dict_init2(&flash_geom_Utils3D.members, &memberinfo_type, 8); - dict_put(&flash_geom_Utils3D.members, &flash_geom_Utils3D_projectVectors, &flash_geom_Utils3D_projectVectors); - dict_put(&flash_geom_Utils3D.members, &flash_geom_Utils3D_projectVector, &flash_geom_Utils3D_projectVector); - dict_put(&flash_geom_Utils3D.members, &flash_geom_Utils3D_pointTowards, &flash_geom_Utils3D_pointTowards); + dict_init2(&flash_geom_Utils3D.static_members, &memberinfo_type, 8); + dict_put(&flash_geom_Utils3D.static_members, &flash_geom_Utils3D_projectVectors, &flash_geom_Utils3D_projectVectors); + dict_put(&flash_geom_Utils3D.static_members, &flash_geom_Utils3D_projectVector, &flash_geom_Utils3D_projectVector); + dict_put(&flash_geom_Utils3D.static_members, &flash_geom_Utils3D_pointTowards, &flash_geom_Utils3D_pointTowards); dict_put(d, &flash_events_TextEvent, &flash_events_TextEvent); dict_init2(&flash_events_TextEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_TextEvent.members, &flash_events_TextEvent_LINK, &flash_events_TextEvent_LINK); + dict_init2(&flash_events_TextEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_TextEvent.members, &flash_events_TextEvent_toString, &flash_events_TextEvent_toString); dict_put(&flash_events_TextEvent.members, &flash_events_TextEvent_text, &flash_events_TextEvent_text); - dict_put(&flash_events_TextEvent.members, &flash_events_TextEvent_TEXT_INPUT, &flash_events_TextEvent_TEXT_INPUT); dict_put(&flash_events_TextEvent.members, &flash_events_TextEvent_clone, &flash_events_TextEvent_clone); + dict_put(&flash_events_TextEvent.static_members, &flash_events_TextEvent_LINK, &flash_events_TextEvent_LINK); + dict_put(&flash_events_TextEvent.static_members, &flash_events_TextEvent_TEXT_INPUT, &flash_events_TextEvent_TEXT_INPUT); dict_put(d, &flash_utils_Proxy, &flash_utils_Proxy); dict_init2(&flash_utils_Proxy.members, &memberinfo_type, 15); + dict_init2(&flash_utils_Proxy.static_members, &memberinfo_type, 8); dict_put(&flash_utils_Proxy.members, &flash_utils_Proxy_callProperty, &flash_utils_Proxy_callProperty); dict_put(&flash_utils_Proxy.members, &flash_utils_Proxy_setProperty, &flash_utils_Proxy_setProperty); dict_put(&flash_utils_Proxy.members, &flash_utils_Proxy_getProperty, &flash_utils_Proxy_getProperty); @@ -5606,10 +6589,12 @@ dict_put(&flash_utils_Proxy.members, &flash_utils_Proxy_nextValue, &flash_utils_Proxy_nextValue); dict_put(d, &flash_text_engine_FontPosture, &flash_text_engine_FontPosture); dict_init2(&flash_text_engine_FontPosture.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_FontPosture.members, &flash_text_engine_FontPosture_NORMAL, &flash_text_engine_FontPosture_NORMAL); - dict_put(&flash_text_engine_FontPosture.members, &flash_text_engine_FontPosture_ITALIC, &flash_text_engine_FontPosture_ITALIC); + dict_init2(&flash_text_engine_FontPosture.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_FontPosture.static_members, &flash_text_engine_FontPosture_NORMAL, &flash_text_engine_FontPosture_NORMAL); + dict_put(&flash_text_engine_FontPosture.static_members, &flash_text_engine_FontPosture_ITALIC, &flash_text_engine_FontPosture_ITALIC); dict_put(d, &flash_xml_XMLDocument, &flash_xml_XMLDocument); dict_init2(&flash_xml_XMLDocument.members, &memberinfo_type, 8); + dict_init2(&flash_xml_XMLDocument.static_members, &memberinfo_type, 8); dict_put(&flash_xml_XMLDocument.members, &flash_xml_XMLDocument_docTypeDecl, &flash_xml_XMLDocument_docTypeDecl); dict_put(&flash_xml_XMLDocument.members, &flash_xml_XMLDocument_idMap, &flash_xml_XMLDocument_idMap); dict_put(&flash_xml_XMLDocument.members, &flash_xml_XMLDocument_toString, &flash_xml_XMLDocument_toString); @@ -5620,6 +6605,7 @@ dict_put(&flash_xml_XMLDocument.members, &flash_xml_XMLDocument_parseXML, &flash_xml_XMLDocument_parseXML); dict_put(d, &flash_display_ShaderInput, &flash_display_ShaderInput); dict_init2(&flash_display_ShaderInput.members, &memberinfo_type, 8); + dict_init2(&flash_display_ShaderInput.static_members, &memberinfo_type, 8); dict_put(&flash_display_ShaderInput.members, &flash_display_ShaderInput_width, &flash_display_ShaderInput_width); dict_put(&flash_display_ShaderInput.members, &flash_display_ShaderInput_input, &flash_display_ShaderInput_input); dict_put(&flash_display_ShaderInput.members, &flash_display_ShaderInput_height, &flash_display_ShaderInput_height); @@ -5627,6 +6613,7 @@ dict_put(&flash_display_ShaderInput.members, &flash_display_ShaderInput_channels, &flash_display_ShaderInput_channels); dict_put(d, &flash_text_engine_TextBlock, &flash_text_engine_TextBlock); dict_init2(&flash_text_engine_TextBlock.members, &memberinfo_type, 31); + dict_init2(&flash_text_engine_TextBlock.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_TextBlock.members, &flash_text_engine_TextBlock_createTextLine, &flash_text_engine_TextBlock_createTextLine); dict_put(&flash_text_engine_TextBlock.members, &flash_text_engine_TextBlock_bidiLevel, &flash_text_engine_TextBlock_bidiLevel); dict_put(&flash_text_engine_TextBlock.members, &flash_text_engine_TextBlock_getTextLineAtCharIndex, &flash_text_engine_TextBlock_getTextLineAtCharIndex); @@ -5651,32 +6638,38 @@ dict_put(&flash_text_engine_TextBlock.members, &flash_text_engine_TextBlock_dump, &flash_text_engine_TextBlock_dump); dict_put(d, &flash_ui_MouseCursor, &flash_ui_MouseCursor); dict_init2(&flash_ui_MouseCursor.members, &memberinfo_type, 8); - dict_put(&flash_ui_MouseCursor.members, &flash_ui_MouseCursor_BUTTON, &flash_ui_MouseCursor_BUTTON); - dict_put(&flash_ui_MouseCursor.members, &flash_ui_MouseCursor_AUTO, &flash_ui_MouseCursor_AUTO); - dict_put(&flash_ui_MouseCursor.members, &flash_ui_MouseCursor_ARROW, &flash_ui_MouseCursor_ARROW); - dict_put(&flash_ui_MouseCursor.members, &flash_ui_MouseCursor_IBEAM, &flash_ui_MouseCursor_IBEAM); - dict_put(&flash_ui_MouseCursor.members, &flash_ui_MouseCursor_HAND, &flash_ui_MouseCursor_HAND); + dict_init2(&flash_ui_MouseCursor.static_members, &memberinfo_type, 8); + dict_put(&flash_ui_MouseCursor.static_members, &flash_ui_MouseCursor_BUTTON, &flash_ui_MouseCursor_BUTTON); + dict_put(&flash_ui_MouseCursor.static_members, &flash_ui_MouseCursor_AUTO, &flash_ui_MouseCursor_AUTO); + dict_put(&flash_ui_MouseCursor.static_members, &flash_ui_MouseCursor_ARROW, &flash_ui_MouseCursor_ARROW); + dict_put(&flash_ui_MouseCursor.static_members, &flash_ui_MouseCursor_IBEAM, &flash_ui_MouseCursor_IBEAM); + dict_put(&flash_ui_MouseCursor.static_members, &flash_ui_MouseCursor_HAND, &flash_ui_MouseCursor_HAND); dict_put(d, &flash_utils_flash_proxy, &flash_utils_flash_proxy); dict_put(d, &flash_display_MorphShape, &flash_display_MorphShape); dict_init2(&flash_display_MorphShape.members, &memberinfo_type, 8); + dict_init2(&flash_display_MorphShape.static_members, &memberinfo_type, 8); dict_put(d, &flash_text_TextDisplayMode, &flash_text_TextDisplayMode); dict_init2(&flash_text_TextDisplayMode.members, &memberinfo_type, 8); - dict_put(&flash_text_TextDisplayMode.members, &flash_text_TextDisplayMode_CRT, &flash_text_TextDisplayMode_CRT); - dict_put(&flash_text_TextDisplayMode.members, &flash_text_TextDisplayMode_LCD, &flash_text_TextDisplayMode_LCD); - dict_put(&flash_text_TextDisplayMode.members, &flash_text_TextDisplayMode_DEFAULT, &flash_text_TextDisplayMode_DEFAULT); + dict_init2(&flash_text_TextDisplayMode.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextDisplayMode.static_members, &flash_text_TextDisplayMode_CRT, &flash_text_TextDisplayMode_CRT); + dict_put(&flash_text_TextDisplayMode.static_members, &flash_text_TextDisplayMode_LCD, &flash_text_TextDisplayMode_LCD); + dict_put(&flash_text_TextDisplayMode.static_members, &flash_text_TextDisplayMode_DEFAULT, &flash_text_TextDisplayMode_DEFAULT); dict_put(d, &flash_net_URLLoaderDataFormat, &flash_net_URLLoaderDataFormat); dict_init2(&flash_net_URLLoaderDataFormat.members, &memberinfo_type, 8); - dict_put(&flash_net_URLLoaderDataFormat.members, &flash_net_URLLoaderDataFormat_VARIABLES, &flash_net_URLLoaderDataFormat_VARIABLES); - dict_put(&flash_net_URLLoaderDataFormat.members, &flash_net_URLLoaderDataFormat_BINARY, &flash_net_URLLoaderDataFormat_BINARY); - dict_put(&flash_net_URLLoaderDataFormat.members, &flash_net_URLLoaderDataFormat_TEXT, &flash_net_URLLoaderDataFormat_TEXT); + dict_init2(&flash_net_URLLoaderDataFormat.static_members, &memberinfo_type, 8); + dict_put(&flash_net_URLLoaderDataFormat.static_members, &flash_net_URLLoaderDataFormat_VARIABLES, &flash_net_URLLoaderDataFormat_VARIABLES); + dict_put(&flash_net_URLLoaderDataFormat.static_members, &flash_net_URLLoaderDataFormat_BINARY, &flash_net_URLLoaderDataFormat_BINARY); + dict_put(&flash_net_URLLoaderDataFormat.static_members, &flash_net_URLLoaderDataFormat_TEXT, &flash_net_URLLoaderDataFormat_TEXT); dict_put(d, &flash_display_StageQuality, &flash_display_StageQuality); dict_init2(&flash_display_StageQuality.members, &memberinfo_type, 8); - dict_put(&flash_display_StageQuality.members, &flash_display_StageQuality_LOW, &flash_display_StageQuality_LOW); - dict_put(&flash_display_StageQuality.members, &flash_display_StageQuality_MEDIUM, &flash_display_StageQuality_MEDIUM); - dict_put(&flash_display_StageQuality.members, &flash_display_StageQuality_HIGH, &flash_display_StageQuality_HIGH); - dict_put(&flash_display_StageQuality.members, &flash_display_StageQuality_BEST, &flash_display_StageQuality_BEST); + dict_init2(&flash_display_StageQuality.static_members, &memberinfo_type, 8); + dict_put(&flash_display_StageQuality.static_members, &flash_display_StageQuality_LOW, &flash_display_StageQuality_LOW); + dict_put(&flash_display_StageQuality.static_members, &flash_display_StageQuality_MEDIUM, &flash_display_StageQuality_MEDIUM); + dict_put(&flash_display_StageQuality.static_members, &flash_display_StageQuality_HIGH, &flash_display_StageQuality_HIGH); + dict_put(&flash_display_StageQuality.static_members, &flash_display_StageQuality_BEST, &flash_display_StageQuality_BEST); dict_put(d, &flash_display_Sprite, &flash_display_Sprite); dict_init2(&flash_display_Sprite.members, &memberinfo_type, 15); + dict_init2(&flash_display_Sprite.static_members, &memberinfo_type, 8); dict_put(&flash_display_Sprite.members, &flash_display_Sprite_stopDrag, &flash_display_Sprite_stopDrag); dict_put(&flash_display_Sprite.members, &flash_display_Sprite_buttonMode, &flash_display_Sprite_buttonMode); dict_put(&flash_display_Sprite.members, &flash_display_Sprite_soundTransform, &flash_display_Sprite_soundTransform); @@ -5686,61 +6679,63 @@ dict_put(&flash_display_Sprite.members, &flash_display_Sprite_startDrag, &flash_display_Sprite_startDrag); dict_put(&flash_display_Sprite.members, &flash_display_Sprite_dropTarget, &flash_display_Sprite_dropTarget); dict_put(d, &flash_ui_Keyboard, &flash_ui_Keyboard); - dict_init2(&flash_ui_Keyboard.members, &memberinfo_type, 127); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_PAGE_DOWN, &flash_ui_Keyboard_PAGE_DOWN); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F4, &flash_ui_Keyboard_F4); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_ENTER, &flash_ui_Keyboard_ENTER); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_CONTROL, &flash_ui_Keyboard_CONTROL); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F7, &flash_ui_Keyboard_F7); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F14, &flash_ui_Keyboard_F14); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_3, &flash_ui_Keyboard_NUMPAD_3); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_DECIMAL, &flash_ui_Keyboard_NUMPAD_DECIMAL); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_CAPS_LOCK, &flash_ui_Keyboard_CAPS_LOCK); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_SHIFT, &flash_ui_Keyboard_SHIFT); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_TAB, &flash_ui_Keyboard_TAB); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_0, &flash_ui_Keyboard_NUMPAD_0); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_END, &flash_ui_Keyboard_END); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_1, &flash_ui_Keyboard_NUMPAD_1); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_LEFT, &flash_ui_Keyboard_LEFT); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F8, &flash_ui_Keyboard_F8); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F9, &flash_ui_Keyboard_F9); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_numLock, &flash_ui_Keyboard_numLock); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F2, &flash_ui_Keyboard_F2); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_4, &flash_ui_Keyboard_NUMPAD_4); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F3, &flash_ui_Keyboard_F3); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_2, &flash_ui_Keyboard_NUMPAD_2); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_HOME, &flash_ui_Keyboard_HOME); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_7, &flash_ui_Keyboard_NUMPAD_7); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_6, &flash_ui_Keyboard_NUMPAD_6); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F6, &flash_ui_Keyboard_F6); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F5, &flash_ui_Keyboard_F5); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_INSERT, &flash_ui_Keyboard_INSERT); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_ESCAPE, &flash_ui_Keyboard_ESCAPE); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F1, &flash_ui_Keyboard_F1); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_SUBTRACT, &flash_ui_Keyboard_NUMPAD_SUBTRACT); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_8, &flash_ui_Keyboard_NUMPAD_8); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_SPACE, &flash_ui_Keyboard_SPACE); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_BACKSPACE, &flash_ui_Keyboard_BACKSPACE); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_DELETE, &flash_ui_Keyboard_DELETE); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_MULTIPLY, &flash_ui_Keyboard_NUMPAD_MULTIPLY); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F13, &flash_ui_Keyboard_F13); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_ADD, &flash_ui_Keyboard_NUMPAD_ADD); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_9, &flash_ui_Keyboard_NUMPAD_9); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F12, &flash_ui_Keyboard_F12); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_RIGHT, &flash_ui_Keyboard_RIGHT); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F15, &flash_ui_Keyboard_F15); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F11, &flash_ui_Keyboard_F11); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_UP, &flash_ui_Keyboard_UP); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_isAccessible, &flash_ui_Keyboard_isAccessible); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_DOWN, &flash_ui_Keyboard_DOWN); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_capsLock, &flash_ui_Keyboard_capsLock); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_PAGE_UP, &flash_ui_Keyboard_PAGE_UP); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_ENTER, &flash_ui_Keyboard_NUMPAD_ENTER); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_F10, &flash_ui_Keyboard_F10); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_5, &flash_ui_Keyboard_NUMPAD_5); - dict_put(&flash_ui_Keyboard.members, &flash_ui_Keyboard_NUMPAD_DIVIDE, &flash_ui_Keyboard_NUMPAD_DIVIDE); + dict_init2(&flash_ui_Keyboard.members, &memberinfo_type, 8); + dict_init2(&flash_ui_Keyboard.static_members, &memberinfo_type, 127); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_PAGE_DOWN, &flash_ui_Keyboard_PAGE_DOWN); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F4, &flash_ui_Keyboard_F4); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_ENTER, &flash_ui_Keyboard_ENTER); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_CONTROL, &flash_ui_Keyboard_CONTROL); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F7, &flash_ui_Keyboard_F7); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F14, &flash_ui_Keyboard_F14); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_3, &flash_ui_Keyboard_NUMPAD_3); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_DECIMAL, &flash_ui_Keyboard_NUMPAD_DECIMAL); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_CAPS_LOCK, &flash_ui_Keyboard_CAPS_LOCK); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_SHIFT, &flash_ui_Keyboard_SHIFT); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_TAB, &flash_ui_Keyboard_TAB); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_0, &flash_ui_Keyboard_NUMPAD_0); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_END, &flash_ui_Keyboard_END); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_1, &flash_ui_Keyboard_NUMPAD_1); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_LEFT, &flash_ui_Keyboard_LEFT); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F8, &flash_ui_Keyboard_F8); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F9, &flash_ui_Keyboard_F9); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_numLock, &flash_ui_Keyboard_numLock); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F2, &flash_ui_Keyboard_F2); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_4, &flash_ui_Keyboard_NUMPAD_4); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F3, &flash_ui_Keyboard_F3); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_2, &flash_ui_Keyboard_NUMPAD_2); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_HOME, &flash_ui_Keyboard_HOME); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_7, &flash_ui_Keyboard_NUMPAD_7); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_6, &flash_ui_Keyboard_NUMPAD_6); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F6, &flash_ui_Keyboard_F6); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F5, &flash_ui_Keyboard_F5); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_INSERT, &flash_ui_Keyboard_INSERT); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_ESCAPE, &flash_ui_Keyboard_ESCAPE); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F1, &flash_ui_Keyboard_F1); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_SUBTRACT, &flash_ui_Keyboard_NUMPAD_SUBTRACT); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_8, &flash_ui_Keyboard_NUMPAD_8); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_SPACE, &flash_ui_Keyboard_SPACE); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_BACKSPACE, &flash_ui_Keyboard_BACKSPACE); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_DELETE, &flash_ui_Keyboard_DELETE); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_MULTIPLY, &flash_ui_Keyboard_NUMPAD_MULTIPLY); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F13, &flash_ui_Keyboard_F13); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_ADD, &flash_ui_Keyboard_NUMPAD_ADD); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_9, &flash_ui_Keyboard_NUMPAD_9); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F12, &flash_ui_Keyboard_F12); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_RIGHT, &flash_ui_Keyboard_RIGHT); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F15, &flash_ui_Keyboard_F15); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F11, &flash_ui_Keyboard_F11); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_UP, &flash_ui_Keyboard_UP); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_isAccessible, &flash_ui_Keyboard_isAccessible); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_DOWN, &flash_ui_Keyboard_DOWN); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_capsLock, &flash_ui_Keyboard_capsLock); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_PAGE_UP, &flash_ui_Keyboard_PAGE_UP); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_ENTER, &flash_ui_Keyboard_NUMPAD_ENTER); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_F10, &flash_ui_Keyboard_F10); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_5, &flash_ui_Keyboard_NUMPAD_5); + dict_put(&flash_ui_Keyboard.static_members, &flash_ui_Keyboard_NUMPAD_DIVIDE, &flash_ui_Keyboard_NUMPAD_DIVIDE); dict_put(d, &flash_filters_DisplacementMapFilter, &flash_filters_DisplacementMapFilter); dict_init2(&flash_filters_DisplacementMapFilter.members, &memberinfo_type, 31); + dict_init2(&flash_filters_DisplacementMapFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_DisplacementMapFilter.members, &flash_filters_DisplacementMapFilter_scaleY, &flash_filters_DisplacementMapFilter_scaleY); dict_put(&flash_filters_DisplacementMapFilter.members, &flash_filters_DisplacementMapFilter_mapPoint, &flash_filters_DisplacementMapFilter_mapPoint); dict_put(&flash_filters_DisplacementMapFilter.members, &flash_filters_DisplacementMapFilter_scaleX, &flash_filters_DisplacementMapFilter_scaleX); @@ -5755,10 +6750,12 @@ dict_put(d, &adobe_utils_MMEndCommand, &adobe_utils_MMEndCommand); dict_put(d, &flash_display_GradientType, &flash_display_GradientType); dict_init2(&flash_display_GradientType.members, &memberinfo_type, 8); - dict_put(&flash_display_GradientType.members, &flash_display_GradientType_LINEAR, &flash_display_GradientType_LINEAR); - dict_put(&flash_display_GradientType.members, &flash_display_GradientType_RADIAL, &flash_display_GradientType_RADIAL); + dict_init2(&flash_display_GradientType.static_members, &memberinfo_type, 8); + dict_put(&flash_display_GradientType.static_members, &flash_display_GradientType_LINEAR, &flash_display_GradientType_LINEAR); + dict_put(&flash_display_GradientType.static_members, &flash_display_GradientType_RADIAL, &flash_display_GradientType_RADIAL); dict_put(d, &flash_media_ID3Info, &flash_media_ID3Info); dict_init2(&flash_media_ID3Info.members, &memberinfo_type, 8); + dict_init2(&flash_media_ID3Info.static_members, &memberinfo_type, 8); dict_put(&flash_media_ID3Info.members, &flash_media_ID3Info_comment, &flash_media_ID3Info_comment); dict_put(&flash_media_ID3Info.members, &flash_media_ID3Info_year, &flash_media_ID3Info_year); dict_put(&flash_media_ID3Info.members, &flash_media_ID3Info_track, &flash_media_ID3Info_track); @@ -5768,31 +6765,37 @@ dict_put(&flash_media_ID3Info.members, &flash_media_ID3Info_album, &flash_media_ID3Info_album); dict_put(d, &flash_display_GraphicsSolidFill, &flash_display_GraphicsSolidFill); dict_init2(&flash_display_GraphicsSolidFill.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsSolidFill.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsSolidFill.members, &flash_display_GraphicsSolidFill_color, &flash_display_GraphicsSolidFill_color); dict_put(&flash_display_GraphicsSolidFill.members, &flash_display_GraphicsSolidFill_alpha, &flash_display_GraphicsSolidFill_alpha); dict_put(d, &flash_filters_ColorMatrixFilter, &flash_filters_ColorMatrixFilter); dict_init2(&flash_filters_ColorMatrixFilter.members, &memberinfo_type, 8); + dict_init2(&flash_filters_ColorMatrixFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_ColorMatrixFilter.members, &flash_filters_ColorMatrixFilter_matrix, &flash_filters_ColorMatrixFilter_matrix); dict_put(&flash_filters_ColorMatrixFilter.members, &flash_filters_ColorMatrixFilter_clone, &flash_filters_ColorMatrixFilter_clone); dict_put(d, &flash_net_NetStreamPlayTransitions, &flash_net_NetStreamPlayTransitions); dict_init2(&flash_net_NetStreamPlayTransitions.members, &memberinfo_type, 8); - dict_put(&flash_net_NetStreamPlayTransitions.members, &flash_net_NetStreamPlayTransitions_RESET, &flash_net_NetStreamPlayTransitions_RESET); - dict_put(&flash_net_NetStreamPlayTransitions.members, &flash_net_NetStreamPlayTransitions_APPEND, &flash_net_NetStreamPlayTransitions_APPEND); - dict_put(&flash_net_NetStreamPlayTransitions.members, &flash_net_NetStreamPlayTransitions_SWAP, &flash_net_NetStreamPlayTransitions_SWAP); - dict_put(&flash_net_NetStreamPlayTransitions.members, &flash_net_NetStreamPlayTransitions_SWITCH, &flash_net_NetStreamPlayTransitions_SWITCH); - dict_put(&flash_net_NetStreamPlayTransitions.members, &flash_net_NetStreamPlayTransitions_STOP, &flash_net_NetStreamPlayTransitions_STOP); + dict_init2(&flash_net_NetStreamPlayTransitions.static_members, &memberinfo_type, 8); + dict_put(&flash_net_NetStreamPlayTransitions.static_members, &flash_net_NetStreamPlayTransitions_RESET, &flash_net_NetStreamPlayTransitions_RESET); + dict_put(&flash_net_NetStreamPlayTransitions.static_members, &flash_net_NetStreamPlayTransitions_APPEND, &flash_net_NetStreamPlayTransitions_APPEND); + dict_put(&flash_net_NetStreamPlayTransitions.static_members, &flash_net_NetStreamPlayTransitions_SWAP, &flash_net_NetStreamPlayTransitions_SWAP); + dict_put(&flash_net_NetStreamPlayTransitions.static_members, &flash_net_NetStreamPlayTransitions_SWITCH, &flash_net_NetStreamPlayTransitions_SWITCH); + dict_put(&flash_net_NetStreamPlayTransitions.static_members, &flash_net_NetStreamPlayTransitions_STOP, &flash_net_NetStreamPlayTransitions_STOP); dict_put(d, &flash_media_SoundCodec, &flash_media_SoundCodec); dict_init2(&flash_media_SoundCodec.members, &memberinfo_type, 8); - dict_put(&flash_media_SoundCodec.members, &flash_media_SoundCodec_NELLYMOSER, &flash_media_SoundCodec_NELLYMOSER); - dict_put(&flash_media_SoundCodec.members, &flash_media_SoundCodec_SPEEX, &flash_media_SoundCodec_SPEEX); + dict_init2(&flash_media_SoundCodec.static_members, &memberinfo_type, 8); + dict_put(&flash_media_SoundCodec.static_members, &flash_media_SoundCodec_NELLYMOSER, &flash_media_SoundCodec_NELLYMOSER); + dict_put(&flash_media_SoundCodec.static_members, &flash_media_SoundCodec_SPEEX, &flash_media_SoundCodec_SPEEX); dict_put(d, &flash_net_ObjectEncoding, &flash_net_ObjectEncoding); dict_init2(&flash_net_ObjectEncoding.members, &memberinfo_type, 8); - dict_put(&flash_net_ObjectEncoding.members, &flash_net_ObjectEncoding_dynamicPropertyWriter, &flash_net_ObjectEncoding_dynamicPropertyWriter); - dict_put(&flash_net_ObjectEncoding.members, &flash_net_ObjectEncoding_DEFAULT, &flash_net_ObjectEncoding_DEFAULT); - dict_put(&flash_net_ObjectEncoding.members, &flash_net_ObjectEncoding_AMF0, &flash_net_ObjectEncoding_AMF0); - dict_put(&flash_net_ObjectEncoding.members, &flash_net_ObjectEncoding_AMF3, &flash_net_ObjectEncoding_AMF3); + dict_init2(&flash_net_ObjectEncoding.static_members, &memberinfo_type, 8); + dict_put(&flash_net_ObjectEncoding.static_members, &flash_net_ObjectEncoding_dynamicPropertyWriter, &flash_net_ObjectEncoding_dynamicPropertyWriter); + dict_put(&flash_net_ObjectEncoding.static_members, &flash_net_ObjectEncoding_DEFAULT, &flash_net_ObjectEncoding_DEFAULT); + dict_put(&flash_net_ObjectEncoding.static_members, &flash_net_ObjectEncoding_AMF0, &flash_net_ObjectEncoding_AMF0); + dict_put(&flash_net_ObjectEncoding.static_members, &flash_net_ObjectEncoding_AMF3, &flash_net_ObjectEncoding_AMF3); dict_put(d, &flash_text_engine_GroupElement, &flash_text_engine_GroupElement); dict_init2(&flash_text_engine_GroupElement.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_GroupElement.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_GroupElement.members, &flash_text_engine_GroupElement_groupElements, &flash_text_engine_GroupElement_groupElements); dict_put(&flash_text_engine_GroupElement.members, &flash_text_engine_GroupElement_splitTextElement, &flash_text_engine_GroupElement_splitTextElement); dict_put(&flash_text_engine_GroupElement.members, &flash_text_engine_GroupElement_mergeTextElements, &flash_text_engine_GroupElement_mergeTextElements); @@ -5806,16 +6809,19 @@ dict_put(d, &_parseInt, &_parseInt); dict_put(d, &_QName, &_QName); dict_init2(&_QName.members, &memberinfo_type, 8); + dict_init2(&_QName.static_members, &memberinfo_type, 8); dict_put(&_QName.members, &_QName_localName, &_QName_localName); dict_put(&_QName.members, &_QName_valueOf, &_QName_valueOf); - dict_put(&_QName.members, &_QName_length, &_QName_length); dict_put(&_QName.members, &_QName_toString, &_QName_toString); dict_put(&_QName.members, &_QName_uri, &_QName_uri); + dict_put(&_QName.static_members, &_QName_length, &_QName_length); dict_put(d, &_UninitializedError, &_UninitializedError); dict_init2(&_UninitializedError.members, &memberinfo_type, 8); - dict_put(&_UninitializedError.members, &_UninitializedError_length, &_UninitializedError_length); + dict_init2(&_UninitializedError.static_members, &memberinfo_type, 8); + dict_put(&_UninitializedError.static_members, &_UninitializedError_length, &_UninitializedError_length); dict_put(d, &_Date, &_Date); dict_init2(&_Date.members, &memberinfo_type, 127); + dict_init2(&_Date.static_members, &memberinfo_type, 8); dict_put(&_Date.members, &_Date_getTimezoneOffset, &_Date_getTimezoneOffset); dict_put(&_Date.members, &_Date_getTime, &_Date_getTime); dict_put(&_Date.members, &_Date_setUTCMilliseconds, &_Date_setUTCMilliseconds); @@ -5834,10 +6840,8 @@ dict_put(&_Date.members, &_Date_minutes, &_Date_minutes); dict_put(&_Date.members, &_Date_setUTCHours, &_Date_setUTCHours); dict_put(&_Date.members, &_Date_minutesUTC, &_Date_minutesUTC); - dict_put(&_Date.members, &_Date_length, &_Date_length); dict_put(&_Date.members, &_Date_toLocaleTimeString, &_Date_toLocaleTimeString); dict_put(&_Date.members, &_Date_fullYearUTC, &_Date_fullYearUTC); - dict_put(&_Date.members, &_Date_UTC, &_Date_UTC); dict_put(&_Date.members, &_Date_time, &_Date_time); dict_put(&_Date.members, &_Date_monthUTC, &_Date_monthUTC); dict_put(&_Date.members, &_Date_getUTCMilliseconds, &_Date_getUTCMilliseconds); @@ -5863,7 +6867,6 @@ dict_put(&_Date.members, &_Date_setFullYear, &_Date_setFullYear); dict_put(&_Date.members, &_Date_setHours, &_Date_setHours); dict_put(&_Date.members, &_Date_setMonth, &_Date_setMonth); - dict_put(&_Date.members, &_Date_parse, &_Date_parse); dict_put(&_Date.members, &_Date_getUTCSeconds, &_Date_getUTCSeconds); dict_put(&_Date.members, &_Date_getMinutes, &_Date_getMinutes); dict_put(&_Date.members, &_Date_toLocaleString, &_Date_toLocaleString); @@ -5878,8 +6881,12 @@ dict_put(&_Date.members, &_Date_toTimeString, &_Date_toTimeString); dict_put(&_Date.members, &_Date_setMilliseconds, &_Date_setMilliseconds); dict_put(&_Date.members, &_Date_getUTCHours, &_Date_getUTCHours); + dict_put(&_Date.static_members, &_Date_length, &_Date_length); + dict_put(&_Date.static_members, &_Date_UTC, &_Date_UTC); + dict_put(&_Date.static_members, &_Date_parse, &_Date_parse); dict_put(d, &flash_text_StyleSheet, &flash_text_StyleSheet); dict_init2(&flash_text_StyleSheet.members, &memberinfo_type, 8); + dict_init2(&flash_text_StyleSheet.static_members, &memberinfo_type, 8); dict_put(&flash_text_StyleSheet.members, &flash_text_StyleSheet_styleNames, &flash_text_StyleSheet_styleNames); dict_put(&flash_text_StyleSheet.members, &flash_text_StyleSheet_clear, &flash_text_StyleSheet_clear); dict_put(&flash_text_StyleSheet.members, &flash_text_StyleSheet_transform, &flash_text_StyleSheet_transform); @@ -5888,14 +6895,17 @@ dict_put(&flash_text_StyleSheet.members, &flash_text_StyleSheet_setStyle, &flash_text_StyleSheet_setStyle); dict_put(d, &flash_display_ActionScriptVersion, &flash_display_ActionScriptVersion); dict_init2(&flash_display_ActionScriptVersion.members, &memberinfo_type, 8); - dict_put(&flash_display_ActionScriptVersion.members, &flash_display_ActionScriptVersion_ACTIONSCRIPT3, &flash_display_ActionScriptVersion_ACTIONSCRIPT3); - dict_put(&flash_display_ActionScriptVersion.members, &flash_display_ActionScriptVersion_ACTIONSCRIPT2, &flash_display_ActionScriptVersion_ACTIONSCRIPT2); + dict_init2(&flash_display_ActionScriptVersion.static_members, &memberinfo_type, 8); + dict_put(&flash_display_ActionScriptVersion.static_members, &flash_display_ActionScriptVersion_ACTIONSCRIPT3, &flash_display_ActionScriptVersion_ACTIONSCRIPT3); + dict_put(&flash_display_ActionScriptVersion.static_members, &flash_display_ActionScriptVersion_ACTIONSCRIPT2, &flash_display_ActionScriptVersion_ACTIONSCRIPT2); dict_put(d, &flash_text_engine_EastAsianJustifier, &flash_text_engine_EastAsianJustifier); dict_init2(&flash_text_engine_EastAsianJustifier.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_EastAsianJustifier.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_EastAsianJustifier.members, &flash_text_engine_EastAsianJustifier_justificationStyle, &flash_text_engine_EastAsianJustifier_justificationStyle); dict_put(&flash_text_engine_EastAsianJustifier.members, &flash_text_engine_EastAsianJustifier_clone, &flash_text_engine_EastAsianJustifier_clone); dict_put(d, &_String, &_String); dict_init2(&_String.members, &memberinfo_type, 31); + dict_init2(&_String.static_members, &memberinfo_type, 8); dict_put(&_String.members, &_String_indexOf, &_String_indexOf); dict_put(&_String.members, &_String_replace, &_String_replace); dict_put(&_String.members, &_String_lastIndexOf, &_String_lastIndexOf); @@ -5904,7 +6914,6 @@ dict_put(&_String.members, &_String_substr, &_String_substr); dict_put(&_String.members, &_String_slice, &_String_slice); dict_put(&_String.members, &_String_search, &_String_search); - dict_put(&_String.members, &_String_fromCharCode, &_String_fromCharCode); dict_put(&_String.members, &_String_toLocaleUpperCase, &_String_toLocaleUpperCase); dict_put(&_String.members, &_String_toString, &_String_toString); dict_put(&_String.members, &_String_toUpperCase, &_String_toUpperCase); @@ -5917,8 +6926,10 @@ dict_put(&_String.members, &_String_toLocaleLowerCase, &_String_toLocaleLowerCase); dict_put(&_String.members, &_String_length, &_String_length); dict_put(&_String.members, &_String_toLowerCase, &_String_toLowerCase); + dict_put(&_String.static_members, &_String_fromCharCode, &_String_fromCharCode); dict_put(d, &flash_media_SoundChannel, &flash_media_SoundChannel); dict_init2(&flash_media_SoundChannel.members, &memberinfo_type, 8); + dict_init2(&flash_media_SoundChannel.static_members, &memberinfo_type, 8); dict_put(&flash_media_SoundChannel.members, &flash_media_SoundChannel_leftPeak, &flash_media_SoundChannel_leftPeak); dict_put(&flash_media_SoundChannel.members, &flash_media_SoundChannel_stop, &flash_media_SoundChannel_stop); dict_put(&flash_media_SoundChannel.members, &flash_media_SoundChannel_position, &flash_media_SoundChannel_position); @@ -5926,7 +6937,7 @@ dict_put(&flash_media_SoundChannel.members, &flash_media_SoundChannel_rightPeak, &flash_media_SoundChannel_rightPeak); dict_put(d, &flash_desktop_Clipboard, &flash_desktop_Clipboard); dict_init2(&flash_desktop_Clipboard.members, &memberinfo_type, 8); - dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_generalClipboard, &flash_desktop_Clipboard_generalClipboard); + dict_init2(&flash_desktop_Clipboard.static_members, &memberinfo_type, 8); dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_setDataHandler, &flash_desktop_Clipboard_setDataHandler); dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_setData, &flash_desktop_Clipboard_setData); dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_formats, &flash_desktop_Clipboard_formats); @@ -5934,28 +6945,34 @@ dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_getData, &flash_desktop_Clipboard_getData); dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_hasFormat, &flash_desktop_Clipboard_hasFormat); dict_put(&flash_desktop_Clipboard.members, &flash_desktop_Clipboard_clearData, &flash_desktop_Clipboard_clearData); + dict_put(&flash_desktop_Clipboard.static_members, &flash_desktop_Clipboard_generalClipboard, &flash_desktop_Clipboard_generalClipboard); dict_put(d, &flash_display_IBitmapDrawable, &flash_display_IBitmapDrawable); dict_init2(&flash_display_IBitmapDrawable.members, &memberinfo_type, 8); + dict_init2(&flash_display_IBitmapDrawable.static_members, &memberinfo_type, 8); dict_put(d, &_TypeError, &_TypeError); dict_init2(&_TypeError.members, &memberinfo_type, 8); - dict_put(&_TypeError.members, &_TypeError_length, &_TypeError_length); + dict_init2(&_TypeError.static_members, &memberinfo_type, 8); + dict_put(&_TypeError.static_members, &_TypeError_length, &_TypeError_length); dict_put(d, &_int, &_int); dict_init2(&_int.members, &memberinfo_type, 8); - dict_put(&_int.members, &_int_MAX_VALUE, &_int_MAX_VALUE); + dict_init2(&_int.static_members, &memberinfo_type, 8); dict_put(&_int.members, &_int_valueOf, &_int_valueOf); - dict_put(&_int.members, &_int_length, &_int_length); - dict_put(&_int.members, &_int_MIN_VALUE, &_int_MIN_VALUE); dict_put(&_int.members, &_int_toString, &_int_toString); dict_put(&_int.members, &_int_toExponential, &_int_toExponential); dict_put(&_int.members, &_int_toFixed, &_int_toFixed); dict_put(&_int.members, &_int_toPrecision, &_int_toPrecision); + dict_put(&_int.static_members, &_int_MAX_VALUE, &_int_MAX_VALUE); + dict_put(&_int.static_members, &_int_length, &_int_length); + dict_put(&_int.static_members, &_int_MIN_VALUE, &_int_MIN_VALUE); dict_put(d, &flash_display_Scene, &flash_display_Scene); dict_init2(&flash_display_Scene.members, &memberinfo_type, 8); + dict_init2(&flash_display_Scene.static_members, &memberinfo_type, 8); dict_put(&flash_display_Scene.members, &flash_display_Scene_numFrames, &flash_display_Scene_numFrames); dict_put(&flash_display_Scene.members, &flash_display_Scene_labels, &flash_display_Scene_labels); dict_put(&flash_display_Scene.members, &flash_display_Scene_name, &flash_display_Scene_name); dict_put(d, &flash_text_engine_FontMetrics, &flash_text_engine_FontMetrics); dict_init2(&flash_text_engine_FontMetrics.members, &memberinfo_type, 15); + dict_init2(&flash_text_engine_FontMetrics.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_FontMetrics.members, &flash_text_engine_FontMetrics_superscriptOffset, &flash_text_engine_FontMetrics_superscriptOffset); dict_put(&flash_text_engine_FontMetrics.members, &flash_text_engine_FontMetrics_underlineThickness, &flash_text_engine_FontMetrics_underlineThickness); dict_put(&flash_text_engine_FontMetrics.members, &flash_text_engine_FontMetrics_subscriptScale, &flash_text_engine_FontMetrics_subscriptScale); @@ -5967,12 +6984,15 @@ dict_put(&flash_text_engine_FontMetrics.members, &flash_text_engine_FontMetrics_underlineOffset, &flash_text_engine_FontMetrics_underlineOffset); dict_put(d, &flash_utils_IExternalizable, &flash_utils_IExternalizable); dict_init2(&flash_utils_IExternalizable.members, &memberinfo_type, 8); + dict_init2(&flash_utils_IExternalizable.static_members, &memberinfo_type, 8); dict_put(&flash_utils_IExternalizable.members, &flash_utils_IExternalizable_readExternal, &flash_utils_IExternalizable_readExternal); dict_put(&flash_utils_IExternalizable.members, &flash_utils_IExternalizable_writeExternal, &flash_utils_IExternalizable_writeExternal); dict_put(d, &__AS3___vec_Vector, &__AS3___vec_Vector); dict_init2(&__AS3___vec_Vector.members, &memberinfo_type, 8); + dict_init2(&__AS3___vec_Vector.static_members, &memberinfo_type, 8); dict_put(d, &flash_filters_GradientBevelFilter, &flash_filters_GradientBevelFilter); dict_init2(&flash_filters_GradientBevelFilter.members, &memberinfo_type, 15); + dict_init2(&flash_filters_GradientBevelFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_GradientBevelFilter.members, &flash_filters_GradientBevelFilter_strength, &flash_filters_GradientBevelFilter_strength); dict_put(&flash_filters_GradientBevelFilter.members, &flash_filters_GradientBevelFilter_quality, &flash_filters_GradientBevelFilter_quality); dict_put(&flash_filters_GradientBevelFilter.members, &flash_filters_GradientBevelFilter_angle, &flash_filters_GradientBevelFilter_angle); @@ -5987,28 +7007,32 @@ dict_put(&flash_filters_GradientBevelFilter.members, &flash_filters_GradientBevelFilter_clone, &flash_filters_GradientBevelFilter_clone); dict_put(d, &flash_text_TextRun, &flash_text_TextRun); dict_init2(&flash_text_TextRun.members, &memberinfo_type, 8); + dict_init2(&flash_text_TextRun.static_members, &memberinfo_type, 8); dict_put(&flash_text_TextRun.members, &flash_text_TextRun_beginIndex, &flash_text_TextRun_beginIndex); dict_put(&flash_text_TextRun.members, &flash_text_TextRun_endIndex, &flash_text_TextRun_endIndex); dict_put(&flash_text_TextRun.members, &flash_text_TextRun_textFormat, &flash_text_TextRun_textFormat); dict_put(d, &flash_text_TextColorType, &flash_text_TextColorType); dict_init2(&flash_text_TextColorType.members, &memberinfo_type, 8); - dict_put(&flash_text_TextColorType.members, &flash_text_TextColorType_DARK_COLOR, &flash_text_TextColorType_DARK_COLOR); - dict_put(&flash_text_TextColorType.members, &flash_text_TextColorType_LIGHT_COLOR, &flash_text_TextColorType_LIGHT_COLOR); + dict_init2(&flash_text_TextColorType.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextColorType.static_members, &flash_text_TextColorType_DARK_COLOR, &flash_text_TextColorType_DARK_COLOR); + dict_put(&flash_text_TextColorType.static_members, &flash_text_TextColorType_LIGHT_COLOR, &flash_text_TextColorType_LIGHT_COLOR); dict_put(d, &flash_sampler_getSampleCount, &flash_sampler_getSampleCount); dict_put(d, &flash_net_URLRequestHeader, &flash_net_URLRequestHeader); dict_init2(&flash_net_URLRequestHeader.members, &memberinfo_type, 8); + dict_init2(&flash_net_URLRequestHeader.static_members, &memberinfo_type, 8); dict_put(&flash_net_URLRequestHeader.members, &flash_net_URLRequestHeader_value, &flash_net_URLRequestHeader_value); dict_put(&flash_net_URLRequestHeader.members, &flash_net_URLRequestHeader_name, &flash_net_URLRequestHeader_name); dict_put(d, &flash_profiler_showRedrawRegions, &flash_profiler_showRedrawRegions); dict_put(d, &flash_display_ShaderData, &flash_display_ShaderData); dict_init2(&flash_display_ShaderData.members, &memberinfo_type, 8); + dict_init2(&flash_display_ShaderData.static_members, &memberinfo_type, 8); dict_put(d, &flash_text_engine_TextLine, &flash_text_engine_TextLine); dict_init2(&flash_text_engine_TextLine.members, &memberinfo_type, 63); + dict_init2(&flash_text_engine_TextLine.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_previousLine, &flash_text_engine_TextLine_previousLine); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_validity, &flash_text_engine_TextLine_validity); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_getAtomTextBlockBeginIndex, &flash_text_engine_TextLine_getAtomTextBlockBeginIndex); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_getAtomWordBoundaryOnLeft, &flash_text_engine_TextLine_getAtomWordBoundaryOnLeft); - dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_MAX_LINE_WIDTH, &flash_text_engine_TextLine_MAX_LINE_WIDTH); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_getAtomTextRotation, &flash_text_engine_TextLine_getAtomTextRotation); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_textHeight, &flash_text_engine_TextLine_textHeight); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_getAtomCenter, &flash_text_engine_TextLine_getAtomCenter); @@ -6035,9 +7059,11 @@ dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_descent, &flash_text_engine_TextLine_descent); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_getAtomBidiLevel, &flash_text_engine_TextLine_getAtomBidiLevel); dict_put(&flash_text_engine_TextLine.members, &flash_text_engine_TextLine_getAtomIndexAtPoint, &flash_text_engine_TextLine_getAtomIndexAtPoint); + dict_put(&flash_text_engine_TextLine.static_members, &flash_text_engine_TextLine_MAX_LINE_WIDTH, &flash_text_engine_TextLine_MAX_LINE_WIDTH); dict_put(d, &flash_sampler_getSamples, &flash_sampler_getSamples); dict_put(d, &flash_net_URLRequest, &flash_net_URLRequest); dict_init2(&flash_net_URLRequest.members, &memberinfo_type, 15); + dict_init2(&flash_net_URLRequest.static_members, &memberinfo_type, 8); dict_put(&flash_net_URLRequest.members, &flash_net_URLRequest_contentType, &flash_net_URLRequest_contentType); dict_put(&flash_net_URLRequest.members, &flash_net_URLRequest_url, &flash_net_URLRequest_url); dict_put(&flash_net_URLRequest.members, &flash_net_URLRequest_requestHeaders, &flash_net_URLRequest_requestHeaders); @@ -6046,23 +7072,28 @@ dict_put(&flash_net_URLRequest.members, &flash_net_URLRequest_data, &flash_net_URLRequest_data); dict_put(d, &_URIError, &_URIError); dict_init2(&_URIError.members, &memberinfo_type, 8); - dict_put(&_URIError.members, &_URIError_length, &_URIError_length); + dict_init2(&_URIError.static_members, &memberinfo_type, 8); + dict_put(&_URIError.static_members, &_URIError_length, &_URIError_length); dict_put(d, &flash_net_getClassByAlias, &flash_net_getClassByAlias); dict_put(d, &flash_display_ShaderParameter, &flash_display_ShaderParameter); dict_init2(&flash_display_ShaderParameter.members, &memberinfo_type, 8); + dict_init2(&flash_display_ShaderParameter.static_members, &memberinfo_type, 8); dict_put(&flash_display_ShaderParameter.members, &flash_display_ShaderParameter_value, &flash_display_ShaderParameter_value); dict_put(&flash_display_ShaderParameter.members, &flash_display_ShaderParameter_index, &flash_display_ShaderParameter_index); dict_put(&flash_display_ShaderParameter.members, &flash_display_ShaderParameter_type, &flash_display_ShaderParameter_type); dict_put(d, &flash_filters_BitmapFilterType, &flash_filters_BitmapFilterType); dict_init2(&flash_filters_BitmapFilterType.members, &memberinfo_type, 8); - dict_put(&flash_filters_BitmapFilterType.members, &flash_filters_BitmapFilterType_FULL, &flash_filters_BitmapFilterType_FULL); - dict_put(&flash_filters_BitmapFilterType.members, &flash_filters_BitmapFilterType_INNER, &flash_filters_BitmapFilterType_INNER); - dict_put(&flash_filters_BitmapFilterType.members, &flash_filters_BitmapFilterType_OUTER, &flash_filters_BitmapFilterType_OUTER); + dict_init2(&flash_filters_BitmapFilterType.static_members, &memberinfo_type, 8); + dict_put(&flash_filters_BitmapFilterType.static_members, &flash_filters_BitmapFilterType_FULL, &flash_filters_BitmapFilterType_FULL); + dict_put(&flash_filters_BitmapFilterType.static_members, &flash_filters_BitmapFilterType_INNER, &flash_filters_BitmapFilterType_INNER); + dict_put(&flash_filters_BitmapFilterType.static_members, &flash_filters_BitmapFilterType_OUTER, &flash_filters_BitmapFilterType_OUTER); dict_put(d, &_SecurityError, &_SecurityError); dict_init2(&_SecurityError.members, &memberinfo_type, 8); - dict_put(&_SecurityError.members, &_SecurityError_length, &_SecurityError_length); + dict_init2(&_SecurityError.static_members, &memberinfo_type, 8); + dict_put(&_SecurityError.static_members, &_SecurityError_length, &_SecurityError_length); dict_put(d, &flash_utils_IDataInput, &flash_utils_IDataInput); dict_init2(&flash_utils_IDataInput.members, &memberinfo_type, 31); + dict_init2(&flash_utils_IDataInput.static_members, &memberinfo_type, 8); dict_put(&flash_utils_IDataInput.members, &flash_utils_IDataInput_readUTF, &flash_utils_IDataInput_readUTF); dict_put(&flash_utils_IDataInput.members, &flash_utils_IDataInput_readByte, &flash_utils_IDataInput_readByte); dict_put(&flash_utils_IDataInput.members, &flash_utils_IDataInput_readUTFBytes, &flash_utils_IDataInput_readUTFBytes); @@ -6082,6 +7113,7 @@ dict_put(&flash_utils_IDataInput.members, &flash_utils_IDataInput_readBoolean, &flash_utils_IDataInput_readBoolean); dict_put(d, &flash_events_IEventDispatcher, &flash_events_IEventDispatcher); dict_init2(&flash_events_IEventDispatcher.members, &memberinfo_type, 8); + dict_init2(&flash_events_IEventDispatcher.static_members, &memberinfo_type, 8); dict_put(&flash_events_IEventDispatcher.members, &flash_events_IEventDispatcher_willTrigger, &flash_events_IEventDispatcher_willTrigger); dict_put(&flash_events_IEventDispatcher.members, &flash_events_IEventDispatcher_removeEventListener, &flash_events_IEventDispatcher_removeEventListener); dict_put(&flash_events_IEventDispatcher.members, &flash_events_IEventDispatcher_hasEventListener, &flash_events_IEventDispatcher_hasEventListener); @@ -6089,10 +7121,12 @@ dict_put(&flash_events_IEventDispatcher.members, &flash_events_IEventDispatcher_dispatchEvent, &flash_events_IEventDispatcher_dispatchEvent); dict_put(d, &_Class, &_Class); dict_init2(&_Class.members, &memberinfo_type, 8); - dict_put(&_Class.members, &_Class_length, &_Class_length); + dict_init2(&_Class.static_members, &memberinfo_type, 8); dict_put(&_Class.members, &_Class_prototype, &_Class_prototype); + dict_put(&_Class.static_members, &_Class_length, &_Class_length); dict_put(d, &flash_geom_Rectangle, &flash_geom_Rectangle); dict_init2(&flash_geom_Rectangle.members, &memberinfo_type, 31); + dict_init2(&flash_geom_Rectangle.static_members, &memberinfo_type, 8); dict_put(&flash_geom_Rectangle.members, &flash_geom_Rectangle_top, &flash_geom_Rectangle_top); dict_put(&flash_geom_Rectangle.members, &flash_geom_Rectangle_intersection, &flash_geom_Rectangle_intersection); dict_put(&flash_geom_Rectangle.members, &flash_geom_Rectangle_intersects, &flash_geom_Rectangle_intersects); @@ -6121,36 +7155,41 @@ dict_put(&flash_geom_Rectangle.members, &flash_geom_Rectangle_offset, &flash_geom_Rectangle_offset); dict_put(d, &flash_events_SecurityErrorEvent, &flash_events_SecurityErrorEvent); dict_init2(&flash_events_SecurityErrorEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_SecurityErrorEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_SecurityErrorEvent.members, &flash_events_SecurityErrorEvent_toString, &flash_events_SecurityErrorEvent_toString); dict_put(&flash_events_SecurityErrorEvent.members, &flash_events_SecurityErrorEvent_clone, &flash_events_SecurityErrorEvent_clone); - dict_put(&flash_events_SecurityErrorEvent.members, &flash_events_SecurityErrorEvent_SECURITY_ERROR, &flash_events_SecurityErrorEvent_SECURITY_ERROR); + dict_put(&flash_events_SecurityErrorEvent.static_members, &flash_events_SecurityErrorEvent_SECURITY_ERROR, &flash_events_SecurityErrorEvent_SECURITY_ERROR); dict_put(d, &flash_net_IDynamicPropertyWriter, &flash_net_IDynamicPropertyWriter); dict_init2(&flash_net_IDynamicPropertyWriter.members, &memberinfo_type, 8); + dict_init2(&flash_net_IDynamicPropertyWriter.static_members, &memberinfo_type, 8); dict_put(&flash_net_IDynamicPropertyWriter.members, &flash_net_IDynamicPropertyWriter_writeDynamicProperties, &flash_net_IDynamicPropertyWriter_writeDynamicProperties); dict_put(d, &flash_display_InterpolationMethod, &flash_display_InterpolationMethod); dict_init2(&flash_display_InterpolationMethod.members, &memberinfo_type, 8); - dict_put(&flash_display_InterpolationMethod.members, &flash_display_InterpolationMethod_RGB, &flash_display_InterpolationMethod_RGB); - dict_put(&flash_display_InterpolationMethod.members, &flash_display_InterpolationMethod_LINEAR_RGB, &flash_display_InterpolationMethod_LINEAR_RGB); + dict_init2(&flash_display_InterpolationMethod.static_members, &memberinfo_type, 8); + dict_put(&flash_display_InterpolationMethod.static_members, &flash_display_InterpolationMethod_RGB, &flash_display_InterpolationMethod_RGB); + dict_put(&flash_display_InterpolationMethod.static_members, &flash_display_InterpolationMethod_LINEAR_RGB, &flash_display_InterpolationMethod_LINEAR_RGB); dict_put(d, &_Object, &_Object); dict_init2(&_Object.members, &memberinfo_type, 8); - dict_put(&_Object.members, &_Object_init, &_Object_init); + dict_init2(&_Object.static_members, &memberinfo_type, 8); dict_put(&_Object.members, &_Object_propertyIsEnumerable, &_Object_propertyIsEnumerable); - dict_put(&_Object.members, &_Object_length, &_Object_length); - dict_put(&_Object.members, &_Object__setPropertyIsEnumerable, &_Object__setPropertyIsEnumerable); dict_put(&_Object.members, &_Object_isPrototypeOf, &_Object_isPrototypeOf); - dict_put(&_Object.members, &_Object__dontEnumPrototype, &_Object__dontEnumPrototype); dict_put(&_Object.members, &_Object_hasOwnProperty, &_Object_hasOwnProperty); + dict_put(&_Object.static_members, &_Object_init, &_Object_init); + dict_put(&_Object.static_members, &_Object_length, &_Object_length); + dict_put(&_Object.static_members, &_Object__setPropertyIsEnumerable, &_Object__setPropertyIsEnumerable); + dict_put(&_Object.static_members, &_Object__dontEnumPrototype, &_Object__dontEnumPrototype); dict_put(d, &flash_errors_EOFError, &flash_errors_EOFError); dict_init2(&flash_errors_EOFError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_EOFError.static_members, &memberinfo_type, 8); dict_put(d, &flash_net_NetStream, &flash_net_NetStream); dict_init2(&flash_net_NetStream.members, &memberinfo_type, 63); + dict_init2(&flash_net_NetStream.static_members, &memberinfo_type, 8); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_videoCodec, &flash_net_NetStream_videoCodec); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_info, &flash_net_NetStream_info); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_attachCamera, &flash_net_NetStream_attachCamera); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_farNonce, &flash_net_NetStream_farNonce); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_close, &flash_net_NetStream_close); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_pause, &flash_net_NetStream_pause); - dict_put(&flash_net_NetStream.members, &flash_net_NetStream_CONNECT_TO_FMS, &flash_net_NetStream_CONNECT_TO_FMS); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_onPeerConnect, &flash_net_NetStream_onPeerConnect); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_client, &flash_net_NetStream_client); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_resume, &flash_net_NetStream_resume); @@ -6158,7 +7197,6 @@ dict_put(&flash_net_NetStream.members, &flash_net_NetStream_peerStreams, &flash_net_NetStream_peerStreams); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_objectEncoding, &flash_net_NetStream_objectEncoding); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_bytesLoaded, &flash_net_NetStream_bytesLoaded); - dict_put(&flash_net_NetStream.members, &flash_net_NetStream_DIRECT_CONNECTIONS, &flash_net_NetStream_DIRECT_CONNECTIONS); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_receiveVideo, &flash_net_NetStream_receiveVideo); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_maxPauseBufferTime, &flash_net_NetStream_maxPauseBufferTime); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_play2, &flash_net_NetStream_play2); @@ -6181,11 +7219,15 @@ dict_put(&flash_net_NetStream.members, &flash_net_NetStream_currentFPS, &flash_net_NetStream_currentFPS); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_time, &flash_net_NetStream_time); dict_put(&flash_net_NetStream.members, &flash_net_NetStream_soundTransform, &flash_net_NetStream_soundTransform); + dict_put(&flash_net_NetStream.static_members, &flash_net_NetStream_CONNECT_TO_FMS, &flash_net_NetStream_CONNECT_TO_FMS); + dict_put(&flash_net_NetStream.static_members, &flash_net_NetStream_DIRECT_CONNECTIONS, &flash_net_NetStream_DIRECT_CONNECTIONS); dict_put(d, &_ArgumentError, &_ArgumentError); dict_init2(&_ArgumentError.members, &memberinfo_type, 8); - dict_put(&_ArgumentError.members, &_ArgumentError_length, &_ArgumentError_length); + dict_init2(&_ArgumentError.static_members, &memberinfo_type, 8); + dict_put(&_ArgumentError.static_members, &_ArgumentError_length, &_ArgumentError_length); dict_put(d, &_XMLList, &_XMLList); dict_init2(&_XMLList.members, &memberinfo_type, 63); + dict_init2(&_XMLList.static_members, &memberinfo_type, 8); dict_put(&_XMLList.members, &_XMLList_normalize, &_XMLList_normalize); dict_put(&_XMLList.members, &_XMLList_removeNamespace, &_XMLList_removeNamespace); dict_put(&_XMLList.members, &_XMLList_prependChild, &_XMLList_prependChild); @@ -6226,25 +7268,28 @@ dict_put(&_XMLList.members, &_XMLList_setChildren, &_XMLList_setChildren); dict_put(&_XMLList.members, &_XMLList_attribute, &_XMLList_attribute); dict_put(d, &flash_geom_Point, &flash_geom_Point); - dict_init2(&flash_geom_Point.members, &memberinfo_type, 31); - dict_put(&flash_geom_Point.members, &flash_geom_Point_subtract, &flash_geom_Point_subtract); - dict_put(&flash_geom_Point.members, &flash_geom_Point_distance, &flash_geom_Point_distance); - dict_put(&flash_geom_Point.members, &flash_geom_Point_normalize, &flash_geom_Point_normalize); + dict_init2(&flash_geom_Point.members, &memberinfo_type, 15); + dict_init2(&flash_geom_Point.static_members, &memberinfo_type, 8); dict_put(&flash_geom_Point.members, &flash_geom_Point_equals, &flash_geom_Point_equals); - dict_put(&flash_geom_Point.members, &flash_geom_Point_toString, &flash_geom_Point_toString); + dict_put(&flash_geom_Point.members, &flash_geom_Point_normalize, &flash_geom_Point_normalize); dict_put(&flash_geom_Point.members, &flash_geom_Point_x, &flash_geom_Point_x); - dict_put(&flash_geom_Point.members, &flash_geom_Point_add, &flash_geom_Point_add); - dict_put(&flash_geom_Point.members, &flash_geom_Point_polar, &flash_geom_Point_polar); - dict_put(&flash_geom_Point.members, &flash_geom_Point_clone, &flash_geom_Point_clone); - dict_put(&flash_geom_Point.members, &flash_geom_Point_interpolate, &flash_geom_Point_interpolate); + dict_put(&flash_geom_Point.members, &flash_geom_Point_offset, &flash_geom_Point_offset); + dict_put(&flash_geom_Point.members, &flash_geom_Point_subtract, &flash_geom_Point_subtract); dict_put(&flash_geom_Point.members, &flash_geom_Point_y, &flash_geom_Point_y); dict_put(&flash_geom_Point.members, &flash_geom_Point_length, &flash_geom_Point_length); - dict_put(&flash_geom_Point.members, &flash_geom_Point_offset, &flash_geom_Point_offset); + dict_put(&flash_geom_Point.members, &flash_geom_Point_add, &flash_geom_Point_add); + dict_put(&flash_geom_Point.members, &flash_geom_Point_toString, &flash_geom_Point_toString); + dict_put(&flash_geom_Point.members, &flash_geom_Point_clone, &flash_geom_Point_clone); + dict_put(&flash_geom_Point.static_members, &flash_geom_Point_polar, &flash_geom_Point_polar); + dict_put(&flash_geom_Point.static_members, &flash_geom_Point_distance, &flash_geom_Point_distance); + dict_put(&flash_geom_Point.static_members, &flash_geom_Point_interpolate, &flash_geom_Point_interpolate); dict_put(d, &flash_printing_PrintJobOptions, &flash_printing_PrintJobOptions); dict_init2(&flash_printing_PrintJobOptions.members, &memberinfo_type, 8); + dict_init2(&flash_printing_PrintJobOptions.static_members, &memberinfo_type, 8); dict_put(&flash_printing_PrintJobOptions.members, &flash_printing_PrintJobOptions_printAsBitmap, &flash_printing_PrintJobOptions_printAsBitmap); dict_put(d, &flash_display_DisplayObject, &flash_display_DisplayObject); dict_init2(&flash_display_DisplayObject.members, &memberinfo_type, 63); + dict_init2(&flash_display_DisplayObject.static_members, &memberinfo_type, 8); dict_put(&flash_display_DisplayObject.members, &flash_display_DisplayObject_rotation, &flash_display_DisplayObject_rotation); dict_put(&flash_display_DisplayObject.members, &flash_display_DisplayObject_filters, &flash_display_DisplayObject_filters); dict_put(&flash_display_DisplayObject.members, &flash_display_DisplayObject_rotationZ, &flash_display_DisplayObject_rotationZ); @@ -6285,46 +7330,53 @@ dict_put(&flash_display_DisplayObject.members, &flash_display_DisplayObject_y, &flash_display_DisplayObject_y); dict_put(d, &flash_sampler_DeleteObjectSample, &flash_sampler_DeleteObjectSample); dict_init2(&flash_sampler_DeleteObjectSample.members, &memberinfo_type, 8); + dict_init2(&flash_sampler_DeleteObjectSample.static_members, &memberinfo_type, 8); dict_put(&flash_sampler_DeleteObjectSample.members, &flash_sampler_DeleteObjectSample_size, &flash_sampler_DeleteObjectSample_size); dict_put(&flash_sampler_DeleteObjectSample.members, &flash_sampler_DeleteObjectSample_id, &flash_sampler_DeleteObjectSample_id); dict_put(d, &flash_system_fscommand, &flash_system_fscommand); dict_put(d, &flash_utils_unescapeMultiByte, &flash_utils_unescapeMultiByte); dict_put(d, &flash_sampler_StackFrame, &flash_sampler_StackFrame); dict_init2(&flash_sampler_StackFrame.members, &memberinfo_type, 8); + dict_init2(&flash_sampler_StackFrame.static_members, &memberinfo_type, 8); dict_put(&flash_sampler_StackFrame.members, &flash_sampler_StackFrame_name, &flash_sampler_StackFrame_name); dict_put(&flash_sampler_StackFrame.members, &flash_sampler_StackFrame_line, &flash_sampler_StackFrame_line); dict_put(&flash_sampler_StackFrame.members, &flash_sampler_StackFrame_toString, &flash_sampler_StackFrame_toString); dict_put(&flash_sampler_StackFrame.members, &flash_sampler_StackFrame_file, &flash_sampler_StackFrame_file); dict_put(d, &flash_system_JPEGLoaderContext, &flash_system_JPEGLoaderContext); dict_init2(&flash_system_JPEGLoaderContext.members, &memberinfo_type, 8); + dict_init2(&flash_system_JPEGLoaderContext.static_members, &memberinfo_type, 8); dict_put(&flash_system_JPEGLoaderContext.members, &flash_system_JPEGLoaderContext_deblockingFilter, &flash_system_JPEGLoaderContext_deblockingFilter); dict_put(d, &flash_system_IME, &flash_system_IME); dict_init2(&flash_system_IME.members, &memberinfo_type, 8); - dict_put(&flash_system_IME.members, &flash_system_IME_setCompositionString, &flash_system_IME_setCompositionString); - dict_put(&flash_system_IME.members, &flash_system_IME_enabled, &flash_system_IME_enabled); - dict_put(&flash_system_IME.members, &flash_system_IME_doConversion, &flash_system_IME_doConversion); - dict_put(&flash_system_IME.members, &flash_system_IME_conversionMode, &flash_system_IME_conversionMode); + dict_init2(&flash_system_IME.static_members, &memberinfo_type, 8); + dict_put(&flash_system_IME.static_members, &flash_system_IME_setCompositionString, &flash_system_IME_setCompositionString); + dict_put(&flash_system_IME.static_members, &flash_system_IME_enabled, &flash_system_IME_enabled); + dict_put(&flash_system_IME.static_members, &flash_system_IME_doConversion, &flash_system_IME_doConversion); + dict_put(&flash_system_IME.static_members, &flash_system_IME_conversionMode, &flash_system_IME_conversionMode); dict_put(d, &_isNaN, &_isNaN); dict_put(d, &flash_system_Security, &flash_system_Security); - dict_init2(&flash_system_Security.members, &memberinfo_type, 15); - dict_put(&flash_system_Security.members, &flash_system_Security_sandboxType, &flash_system_Security_sandboxType); - dict_put(&flash_system_Security.members, &flash_system_Security_LOCAL_WITH_NETWORK, &flash_system_Security_LOCAL_WITH_NETWORK); - dict_put(&flash_system_Security.members, &flash_system_Security_loadPolicyFile, &flash_system_Security_loadPolicyFile); - dict_put(&flash_system_Security.members, &flash_system_Security_allowDomain, &flash_system_Security_allowDomain); - dict_put(&flash_system_Security.members, &flash_system_Security_showSettings, &flash_system_Security_showSettings); - dict_put(&flash_system_Security.members, &flash_system_Security_LOCAL_TRUSTED, &flash_system_Security_LOCAL_TRUSTED); - dict_put(&flash_system_Security.members, &flash_system_Security_disableAVM1Loading, &flash_system_Security_disableAVM1Loading); - dict_put(&flash_system_Security.members, &flash_system_Security_allowInsecureDomain, &flash_system_Security_allowInsecureDomain); - dict_put(&flash_system_Security.members, &flash_system_Security_exactSettings, &flash_system_Security_exactSettings); - dict_put(&flash_system_Security.members, &flash_system_Security_REMOTE, &flash_system_Security_REMOTE); - dict_put(&flash_system_Security.members, &flash_system_Security_LOCAL_WITH_FILE, &flash_system_Security_LOCAL_WITH_FILE); + dict_init2(&flash_system_Security.members, &memberinfo_type, 8); + dict_init2(&flash_system_Security.static_members, &memberinfo_type, 15); + dict_put(&flash_system_Security.static_members, &flash_system_Security_sandboxType, &flash_system_Security_sandboxType); + dict_put(&flash_system_Security.static_members, &flash_system_Security_LOCAL_WITH_NETWORK, &flash_system_Security_LOCAL_WITH_NETWORK); + dict_put(&flash_system_Security.static_members, &flash_system_Security_loadPolicyFile, &flash_system_Security_loadPolicyFile); + dict_put(&flash_system_Security.static_members, &flash_system_Security_allowDomain, &flash_system_Security_allowDomain); + dict_put(&flash_system_Security.static_members, &flash_system_Security_showSettings, &flash_system_Security_showSettings); + dict_put(&flash_system_Security.static_members, &flash_system_Security_LOCAL_TRUSTED, &flash_system_Security_LOCAL_TRUSTED); + dict_put(&flash_system_Security.static_members, &flash_system_Security_disableAVM1Loading, &flash_system_Security_disableAVM1Loading); + dict_put(&flash_system_Security.static_members, &flash_system_Security_allowInsecureDomain, &flash_system_Security_allowInsecureDomain); + dict_put(&flash_system_Security.static_members, &flash_system_Security_exactSettings, &flash_system_Security_exactSettings); + dict_put(&flash_system_Security.static_members, &flash_system_Security_REMOTE, &flash_system_Security_REMOTE); + dict_put(&flash_system_Security.static_members, &flash_system_Security_LOCAL_WITH_FILE, &flash_system_Security_LOCAL_WITH_FILE); dict_put(d, &flash_display_Bitmap, &flash_display_Bitmap); dict_init2(&flash_display_Bitmap.members, &memberinfo_type, 8); + dict_init2(&flash_display_Bitmap.static_members, &memberinfo_type, 8); dict_put(&flash_display_Bitmap.members, &flash_display_Bitmap_pixelSnapping, &flash_display_Bitmap_pixelSnapping); dict_put(&flash_display_Bitmap.members, &flash_display_Bitmap_bitmapData, &flash_display_Bitmap_bitmapData); dict_put(&flash_display_Bitmap.members, &flash_display_Bitmap_smoothing, &flash_display_Bitmap_smoothing); dict_put(d, &flash_printing_PrintJob, &flash_printing_PrintJob); dict_init2(&flash_printing_PrintJob.members, &memberinfo_type, 15); + dict_init2(&flash_printing_PrintJob.static_members, &memberinfo_type, 8); dict_put(&flash_printing_PrintJob.members, &flash_printing_PrintJob_paperWidth, &flash_printing_PrintJob_paperWidth); dict_put(&flash_printing_PrintJob.members, &flash_printing_PrintJob_addPage, &flash_printing_PrintJob_addPage); dict_put(&flash_printing_PrintJob.members, &flash_printing_PrintJob_pageHeight, &flash_printing_PrintJob_pageHeight); @@ -6335,41 +7387,49 @@ dict_put(&flash_printing_PrintJob.members, &flash_printing_PrintJob_orientation, &flash_printing_PrintJob_orientation); dict_put(d, &flash_text_StaticText, &flash_text_StaticText); dict_init2(&flash_text_StaticText.members, &memberinfo_type, 8); + dict_init2(&flash_text_StaticText.static_members, &memberinfo_type, 8); dict_put(&flash_text_StaticText.members, &flash_text_StaticText_text, &flash_text_StaticText_text); dict_put(d, &flash_text_engine_SpaceJustifier, &flash_text_engine_SpaceJustifier); dict_init2(&flash_text_engine_SpaceJustifier.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_SpaceJustifier.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_SpaceJustifier.members, &flash_text_engine_SpaceJustifier_clone, &flash_text_engine_SpaceJustifier_clone); dict_put(&flash_text_engine_SpaceJustifier.members, &flash_text_engine_SpaceJustifier_letterSpacing, &flash_text_engine_SpaceJustifier_letterSpacing); dict_put(d, &flash_events_DataEvent, &flash_events_DataEvent); dict_init2(&flash_events_DataEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_DataEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_DataEvent.members, &flash_events_DataEvent_toString, &flash_events_DataEvent_toString); - dict_put(&flash_events_DataEvent.members, &flash_events_DataEvent_DATA, &flash_events_DataEvent_DATA); dict_put(&flash_events_DataEvent.members, &flash_events_DataEvent_clone, &flash_events_DataEvent_clone); - dict_put(&flash_events_DataEvent.members, &flash_events_DataEvent_UPLOAD_COMPLETE_DATA, &flash_events_DataEvent_UPLOAD_COMPLETE_DATA); dict_put(&flash_events_DataEvent.members, &flash_events_DataEvent_data, &flash_events_DataEvent_data); + dict_put(&flash_events_DataEvent.static_members, &flash_events_DataEvent_DATA, &flash_events_DataEvent_DATA); + dict_put(&flash_events_DataEvent.static_members, &flash_events_DataEvent_UPLOAD_COMPLETE_DATA, &flash_events_DataEvent_UPLOAD_COMPLETE_DATA); dict_put(d, &flash_events_ActivityEvent, &flash_events_ActivityEvent); dict_init2(&flash_events_ActivityEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_ActivityEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_ActivityEvent.members, &flash_events_ActivityEvent_toString, &flash_events_ActivityEvent_toString); dict_put(&flash_events_ActivityEvent.members, &flash_events_ActivityEvent_activating, &flash_events_ActivityEvent_activating); dict_put(&flash_events_ActivityEvent.members, &flash_events_ActivityEvent_clone, &flash_events_ActivityEvent_clone); - dict_put(&flash_events_ActivityEvent.members, &flash_events_ActivityEvent_ACTIVITY, &flash_events_ActivityEvent_ACTIVITY); + dict_put(&flash_events_ActivityEvent.static_members, &flash_events_ActivityEvent_ACTIVITY, &flash_events_ActivityEvent_ACTIVITY); dict_put(d, &flash_display_GraphicsEndFill, &flash_display_GraphicsEndFill); dict_init2(&flash_display_GraphicsEndFill.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsEndFill.static_members, &memberinfo_type, 8); dict_put(d, &flash_display_ColorCorrection, &flash_display_ColorCorrection); dict_init2(&flash_display_ColorCorrection.members, &memberinfo_type, 8); - dict_put(&flash_display_ColorCorrection.members, &flash_display_ColorCorrection_OFF, &flash_display_ColorCorrection_OFF); - dict_put(&flash_display_ColorCorrection.members, &flash_display_ColorCorrection_DEFAULT, &flash_display_ColorCorrection_DEFAULT); - dict_put(&flash_display_ColorCorrection.members, &flash_display_ColorCorrection_ON, &flash_display_ColorCorrection_ON); + dict_init2(&flash_display_ColorCorrection.static_members, &memberinfo_type, 8); + dict_put(&flash_display_ColorCorrection.static_members, &flash_display_ColorCorrection_OFF, &flash_display_ColorCorrection_OFF); + dict_put(&flash_display_ColorCorrection.static_members, &flash_display_ColorCorrection_DEFAULT, &flash_display_ColorCorrection_DEFAULT); + dict_put(&flash_display_ColorCorrection.static_members, &flash_display_ColorCorrection_ON, &flash_display_ColorCorrection_ON); dict_put(d, &flash_events_IOErrorEvent, &flash_events_IOErrorEvent); dict_init2(&flash_events_IOErrorEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_IOErrorEvent.members, &flash_events_IOErrorEvent_IO_ERROR, &flash_events_IOErrorEvent_IO_ERROR); - dict_put(&flash_events_IOErrorEvent.members, &flash_events_IOErrorEvent_VERIFY_ERROR, &flash_events_IOErrorEvent_VERIFY_ERROR); + dict_init2(&flash_events_IOErrorEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_IOErrorEvent.members, &flash_events_IOErrorEvent_toString, &flash_events_IOErrorEvent_toString); - dict_put(&flash_events_IOErrorEvent.members, &flash_events_IOErrorEvent_NETWORK_ERROR, &flash_events_IOErrorEvent_NETWORK_ERROR); dict_put(&flash_events_IOErrorEvent.members, &flash_events_IOErrorEvent_clone, &flash_events_IOErrorEvent_clone); - dict_put(&flash_events_IOErrorEvent.members, &flash_events_IOErrorEvent_DISK_ERROR, &flash_events_IOErrorEvent_DISK_ERROR); + dict_put(&flash_events_IOErrorEvent.static_members, &flash_events_IOErrorEvent_IO_ERROR, &flash_events_IOErrorEvent_IO_ERROR); + dict_put(&flash_events_IOErrorEvent.static_members, &flash_events_IOErrorEvent_VERIFY_ERROR, &flash_events_IOErrorEvent_VERIFY_ERROR); + dict_put(&flash_events_IOErrorEvent.static_members, &flash_events_IOErrorEvent_NETWORK_ERROR, &flash_events_IOErrorEvent_NETWORK_ERROR); + dict_put(&flash_events_IOErrorEvent.static_members, &flash_events_IOErrorEvent_DISK_ERROR, &flash_events_IOErrorEvent_DISK_ERROR); dict_put(d, &flash_display_GraphicsStroke, &flash_display_GraphicsStroke); dict_init2(&flash_display_GraphicsStroke.members, &memberinfo_type, 15); + dict_init2(&flash_display_GraphicsStroke.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsStroke.members, &flash_display_GraphicsStroke_scaleMode, &flash_display_GraphicsStroke_scaleMode); dict_put(&flash_display_GraphicsStroke.members, &flash_display_GraphicsStroke_miterLimit, &flash_display_GraphicsStroke_miterLimit); dict_put(&flash_display_GraphicsStroke.members, &flash_display_GraphicsStroke_pixelHinting, &flash_display_GraphicsStroke_pixelHinting); @@ -6379,25 +7439,27 @@ dict_put(&flash_display_GraphicsStroke.members, &flash_display_GraphicsStroke_caps, &flash_display_GraphicsStroke_caps); dict_put(d, &_Boolean, &_Boolean); dict_init2(&_Boolean.members, &memberinfo_type, 8); + dict_init2(&_Boolean.static_members, &memberinfo_type, 8); dict_put(&_Boolean.members, &_Boolean_valueOf, &_Boolean_valueOf); - dict_put(&_Boolean.members, &_Boolean_length, &_Boolean_length); dict_put(&_Boolean.members, &_Boolean_toString, &_Boolean_toString); + dict_put(&_Boolean.static_members, &_Boolean_length, &_Boolean_length); dict_put(d, &flash_sampler_getMemberNames, &flash_sampler_getMemberNames); dict_put(d, &flash_utils_getQualifiedClassName, &flash_utils_getQualifiedClassName); dict_put(d, &flash_text_engine_GraphicElement, &flash_text_engine_GraphicElement); dict_init2(&flash_text_engine_GraphicElement.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_GraphicElement.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_GraphicElement.members, &flash_text_engine_GraphicElement_graphic, &flash_text_engine_GraphicElement_graphic); dict_put(&flash_text_engine_GraphicElement.members, &flash_text_engine_GraphicElement_elementWidth, &flash_text_engine_GraphicElement_elementWidth); dict_put(&flash_text_engine_GraphicElement.members, &flash_text_engine_GraphicElement_elementHeight, &flash_text_engine_GraphicElement_elementHeight); dict_put(d, &flash_media_Microphone, &flash_media_Microphone); dict_init2(&flash_media_Microphone.members, &memberinfo_type, 31); + dict_init2(&flash_media_Microphone.static_members, &memberinfo_type, 8); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_codec, &flash_media_Microphone_codec); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_gain, &flash_media_Microphone_gain); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_index, &flash_media_Microphone_index); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_setLoopBack, &flash_media_Microphone_setLoopBack); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_setSilenceLevel, &flash_media_Microphone_setSilenceLevel); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_name, &flash_media_Microphone_name); - dict_put(&flash_media_Microphone.members, &flash_media_Microphone_getMicrophone, &flash_media_Microphone_getMicrophone); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_setUseEchoSuppression, &flash_media_Microphone_setUseEchoSuppression); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_framesPerPacket, &flash_media_Microphone_framesPerPacket); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_muted, &flash_media_Microphone_muted); @@ -6408,9 +7470,11 @@ dict_put(&flash_media_Microphone.members, &flash_media_Microphone_silenceTimeout, &flash_media_Microphone_silenceTimeout); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_rate, &flash_media_Microphone_rate); dict_put(&flash_media_Microphone.members, &flash_media_Microphone_activityLevel, &flash_media_Microphone_activityLevel); - dict_put(&flash_media_Microphone.members, &flash_media_Microphone_names, &flash_media_Microphone_names); + dict_put(&flash_media_Microphone.static_members, &flash_media_Microphone_names, &flash_media_Microphone_names); + dict_put(&flash_media_Microphone.static_members, &flash_media_Microphone_getMicrophone, &flash_media_Microphone_getMicrophone); dict_put(d, &flash_ui_ContextMenuClipboardItems, &flash_ui_ContextMenuClipboardItems); dict_init2(&flash_ui_ContextMenuClipboardItems.members, &memberinfo_type, 8); + dict_init2(&flash_ui_ContextMenuClipboardItems.static_members, &memberinfo_type, 8); dict_put(&flash_ui_ContextMenuClipboardItems.members, &flash_ui_ContextMenuClipboardItems_clear, &flash_ui_ContextMenuClipboardItems_clear); dict_put(&flash_ui_ContextMenuClipboardItems.members, &flash_ui_ContextMenuClipboardItems_clone, &flash_ui_ContextMenuClipboardItems_clone); dict_put(&flash_ui_ContextMenuClipboardItems.members, &flash_ui_ContextMenuClipboardItems_paste, &flash_ui_ContextMenuClipboardItems_paste); @@ -6419,12 +7483,15 @@ dict_put(&flash_ui_ContextMenuClipboardItems.members, &flash_ui_ContextMenuClipboardItems_cut, &flash_ui_ContextMenuClipboardItems_cut); dict_put(d, &flash_display_GraphicsShaderFill, &flash_display_GraphicsShaderFill); dict_init2(&flash_display_GraphicsShaderFill.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsShaderFill.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsShaderFill.members, &flash_display_GraphicsShaderFill_shader, &flash_display_GraphicsShaderFill_shader); dict_put(&flash_display_GraphicsShaderFill.members, &flash_display_GraphicsShaderFill_matrix, &flash_display_GraphicsShaderFill_matrix); dict_put(d, &flash_errors_IllegalOperationError, &flash_errors_IllegalOperationError); dict_init2(&flash_errors_IllegalOperationError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_IllegalOperationError.static_members, &memberinfo_type, 8); dict_put(d, &flash_filters_GradientGlowFilter, &flash_filters_GradientGlowFilter); dict_init2(&flash_filters_GradientGlowFilter.members, &memberinfo_type, 15); + dict_init2(&flash_filters_GradientGlowFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_GradientGlowFilter.members, &flash_filters_GradientGlowFilter_strength, &flash_filters_GradientGlowFilter_strength); dict_put(&flash_filters_GradientGlowFilter.members, &flash_filters_GradientGlowFilter_quality, &flash_filters_GradientGlowFilter_quality); dict_put(&flash_filters_GradientGlowFilter.members, &flash_filters_GradientGlowFilter_angle, &flash_filters_GradientGlowFilter_angle); @@ -6439,11 +7506,13 @@ dict_put(&flash_filters_GradientGlowFilter.members, &flash_filters_GradientGlowFilter_clone, &flash_filters_GradientGlowFilter_clone); dict_put(d, &flash_display_CapsStyle, &flash_display_CapsStyle); dict_init2(&flash_display_CapsStyle.members, &memberinfo_type, 8); - dict_put(&flash_display_CapsStyle.members, &flash_display_CapsStyle_ROUND, &flash_display_CapsStyle_ROUND); - dict_put(&flash_display_CapsStyle.members, &flash_display_CapsStyle_SQUARE, &flash_display_CapsStyle_SQUARE); - dict_put(&flash_display_CapsStyle.members, &flash_display_CapsStyle_NONE, &flash_display_CapsStyle_NONE); + dict_init2(&flash_display_CapsStyle.static_members, &memberinfo_type, 8); + dict_put(&flash_display_CapsStyle.static_members, &flash_display_CapsStyle_ROUND, &flash_display_CapsStyle_ROUND); + dict_put(&flash_display_CapsStyle.static_members, &flash_display_CapsStyle_SQUARE, &flash_display_CapsStyle_SQUARE); + dict_put(&flash_display_CapsStyle.static_members, &flash_display_CapsStyle_NONE, &flash_display_CapsStyle_NONE); dict_put(d, &flash_text_TextSnapshot, &flash_text_TextSnapshot); dict_init2(&flash_text_TextSnapshot.members, &memberinfo_type, 15); + dict_init2(&flash_text_TextSnapshot.static_members, &memberinfo_type, 8); dict_put(&flash_text_TextSnapshot.members, &flash_text_TextSnapshot_setSelectColor, &flash_text_TextSnapshot_setSelectColor); dict_put(&flash_text_TextSnapshot.members, &flash_text_TextSnapshot_setSelected, &flash_text_TextSnapshot_setSelected); dict_put(&flash_text_TextSnapshot.members, &flash_text_TextSnapshot_getSelectedText, &flash_text_TextSnapshot_getSelectedText); @@ -6455,10 +7524,12 @@ dict_put(&flash_text_TextSnapshot.members, &flash_text_TextSnapshot_getText, &flash_text_TextSnapshot_getText); dict_put(d, &flash_text_engine_FontLookup, &flash_text_engine_FontLookup); dict_init2(&flash_text_engine_FontLookup.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_FontLookup.members, &flash_text_engine_FontLookup_DEVICE, &flash_text_engine_FontLookup_DEVICE); - dict_put(&flash_text_engine_FontLookup.members, &flash_text_engine_FontLookup_EMBEDDED_CFF, &flash_text_engine_FontLookup_EMBEDDED_CFF); + dict_init2(&flash_text_engine_FontLookup.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_FontLookup.static_members, &flash_text_engine_FontLookup_DEVICE, &flash_text_engine_FontLookup_DEVICE); + dict_put(&flash_text_engine_FontLookup.static_members, &flash_text_engine_FontLookup_EMBEDDED_CFF, &flash_text_engine_FontLookup_EMBEDDED_CFF); dict_put(d, &flash_display_InteractiveObject, &flash_display_InteractiveObject); dict_init2(&flash_display_InteractiveObject.members, &memberinfo_type, 15); + dict_init2(&flash_display_InteractiveObject.static_members, &memberinfo_type, 8); dict_put(&flash_display_InteractiveObject.members, &flash_display_InteractiveObject_tabIndex, &flash_display_InteractiveObject_tabIndex); dict_put(&flash_display_InteractiveObject.members, &flash_display_InteractiveObject_doubleClickEnabled, &flash_display_InteractiveObject_doubleClickEnabled); dict_put(&flash_display_InteractiveObject.members, &flash_display_InteractiveObject_tabEnabled, &flash_display_InteractiveObject_tabEnabled); @@ -6468,7 +7539,7 @@ dict_put(&flash_display_InteractiveObject.members, &flash_display_InteractiveObject_accessibilityImplementation, &flash_display_InteractiveObject_accessibilityImplementation); dict_put(d, &flash_text_TextField, &flash_text_TextField); dict_init2(&flash_text_TextField.members, &memberinfo_type, 127); - dict_put(&flash_text_TextField.members, &flash_text_TextField_isFontCompatible, &flash_text_TextField_isFontCompatible); + dict_init2(&flash_text_TextField.static_members, &memberinfo_type, 8); dict_put(&flash_text_TextField.members, &flash_text_TextField_getTextFormat, &flash_text_TextField_getTextFormat); dict_put(&flash_text_TextField.members, &flash_text_TextField_border, &flash_text_TextField_border); dict_put(&flash_text_TextField.members, &flash_text_TextField_selectedText, &flash_text_TextField_selectedText); @@ -6531,19 +7602,22 @@ dict_put(&flash_text_TextField.members, &flash_text_TextField_selectionEndIndex, &flash_text_TextField_selectionEndIndex); dict_put(&flash_text_TextField.members, &flash_text_TextField_insertXMLText, &flash_text_TextField_insertXMLText); dict_put(&flash_text_TextField.members, &flash_text_TextField_condenseWhite, &flash_text_TextField_condenseWhite); + dict_put(&flash_text_TextField.static_members, &flash_text_TextField_isFontCompatible, &flash_text_TextField_isFontCompatible); dict_put(d, &flash_printing_PrintJobOrientation, &flash_printing_PrintJobOrientation); dict_init2(&flash_printing_PrintJobOrientation.members, &memberinfo_type, 8); - dict_put(&flash_printing_PrintJobOrientation.members, &flash_printing_PrintJobOrientation_LANDSCAPE, &flash_printing_PrintJobOrientation_LANDSCAPE); - dict_put(&flash_printing_PrintJobOrientation.members, &flash_printing_PrintJobOrientation_PORTRAIT, &flash_printing_PrintJobOrientation_PORTRAIT); + dict_init2(&flash_printing_PrintJobOrientation.static_members, &memberinfo_type, 8); + dict_put(&flash_printing_PrintJobOrientation.static_members, &flash_printing_PrintJobOrientation_LANDSCAPE, &flash_printing_PrintJobOrientation_LANDSCAPE); + dict_put(&flash_printing_PrintJobOrientation.static_members, &flash_printing_PrintJobOrientation_PORTRAIT, &flash_printing_PrintJobOrientation_PORTRAIT); dict_put(d, &flash_text_TextRenderer, &flash_text_TextRenderer); dict_init2(&flash_text_TextRenderer.members, &memberinfo_type, 8); - dict_put(&flash_text_TextRenderer.members, &flash_text_TextRenderer_displayMode, &flash_text_TextRenderer_displayMode); - dict_put(&flash_text_TextRenderer.members, &flash_text_TextRenderer_antiAliasType, &flash_text_TextRenderer_antiAliasType); - dict_put(&flash_text_TextRenderer.members, &flash_text_TextRenderer_maxLevel, &flash_text_TextRenderer_maxLevel); - dict_put(&flash_text_TextRenderer.members, &flash_text_TextRenderer_setAdvancedAntiAliasingTable, &flash_text_TextRenderer_setAdvancedAntiAliasingTable); + dict_init2(&flash_text_TextRenderer.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextRenderer.static_members, &flash_text_TextRenderer_displayMode, &flash_text_TextRenderer_displayMode); + dict_put(&flash_text_TextRenderer.static_members, &flash_text_TextRenderer_antiAliasType, &flash_text_TextRenderer_antiAliasType); + dict_put(&flash_text_TextRenderer.static_members, &flash_text_TextRenderer_maxLevel, &flash_text_TextRenderer_maxLevel); + dict_put(&flash_text_TextRenderer.static_members, &flash_text_TextRenderer_setAdvancedAntiAliasingTable, &flash_text_TextRenderer_setAdvancedAntiAliasingTable); dict_put(d, &flash_net_NetConnection, &flash_net_NetConnection); dict_init2(&flash_net_NetConnection.members, &memberinfo_type, 31); - dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_defaultObjectEncoding, &flash_net_NetConnection_defaultObjectEncoding); + dict_init2(&flash_net_NetConnection.static_members, &memberinfo_type, 8); dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_nearID, &flash_net_NetConnection_nearID); dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_client, &flash_net_NetConnection_client); dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_farNonce, &flash_net_NetConnection_farNonce); @@ -6562,51 +7636,59 @@ dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_maxPeerConnections, &flash_net_NetConnection_maxPeerConnections); dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_connectedProxyType, &flash_net_NetConnection_connectedProxyType); dict_put(&flash_net_NetConnection.members, &flash_net_NetConnection_uri, &flash_net_NetConnection_uri); + dict_put(&flash_net_NetConnection.static_members, &flash_net_NetConnection_defaultObjectEncoding, &flash_net_NetConnection_defaultObjectEncoding); dict_put(d, &_decodeURIComponent, &_decodeURIComponent); dict_put(d, &flash_sampler_isGetterSetter, &flash_sampler_isGetterSetter); dict_put(d, &flash_utils_getQualifiedSuperclassName, &flash_utils_getQualifiedSuperclassName); dict_put(d, &flash_display_GraphicsPathWinding, &flash_display_GraphicsPathWinding); dict_init2(&flash_display_GraphicsPathWinding.members, &memberinfo_type, 8); - dict_put(&flash_display_GraphicsPathWinding.members, &flash_display_GraphicsPathWinding_EVEN_ODD, &flash_display_GraphicsPathWinding_EVEN_ODD); - dict_put(&flash_display_GraphicsPathWinding.members, &flash_display_GraphicsPathWinding_NON_ZERO, &flash_display_GraphicsPathWinding_NON_ZERO); + dict_init2(&flash_display_GraphicsPathWinding.static_members, &memberinfo_type, 8); + dict_put(&flash_display_GraphicsPathWinding.static_members, &flash_display_GraphicsPathWinding_EVEN_ODD, &flash_display_GraphicsPathWinding_EVEN_ODD); + dict_put(&flash_display_GraphicsPathWinding.static_members, &flash_display_GraphicsPathWinding_NON_ZERO, &flash_display_GraphicsPathWinding_NON_ZERO); dict_put(d, &flash_text_engine_TabStop, &flash_text_engine_TabStop); dict_init2(&flash_text_engine_TabStop.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_TabStop.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_TabStop.members, &flash_text_engine_TabStop_alignment, &flash_text_engine_TabStop_alignment); dict_put(&flash_text_engine_TabStop.members, &flash_text_engine_TabStop_position, &flash_text_engine_TabStop_position); dict_put(&flash_text_engine_TabStop.members, &flash_text_engine_TabStop_decimalAlignmentToken, &flash_text_engine_TabStop_decimalAlignmentToken); dict_put(d, &flash_text_engine_JustificationStyle, &flash_text_engine_JustificationStyle); dict_init2(&flash_text_engine_JustificationStyle.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_JustificationStyle.members, &flash_text_engine_JustificationStyle_PUSH_OUT_ONLY, &flash_text_engine_JustificationStyle_PUSH_OUT_ONLY); - dict_put(&flash_text_engine_JustificationStyle.members, &flash_text_engine_JustificationStyle_PRIORITIZE_LEAST_ADJUSTMENT, &flash_text_engine_JustificationStyle_PRIORITIZE_LEAST_ADJUSTMENT); - dict_put(&flash_text_engine_JustificationStyle.members, &flash_text_engine_JustificationStyle_PUSH_IN_KINSOKU, &flash_text_engine_JustificationStyle_PUSH_IN_KINSOKU); + dict_init2(&flash_text_engine_JustificationStyle.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_JustificationStyle.static_members, &flash_text_engine_JustificationStyle_PUSH_OUT_ONLY, &flash_text_engine_JustificationStyle_PUSH_OUT_ONLY); + dict_put(&flash_text_engine_JustificationStyle.static_members, &flash_text_engine_JustificationStyle_PRIORITIZE_LEAST_ADJUSTMENT, &flash_text_engine_JustificationStyle_PRIORITIZE_LEAST_ADJUSTMENT); + dict_put(&flash_text_engine_JustificationStyle.static_members, &flash_text_engine_JustificationStyle_PUSH_IN_KINSOKU, &flash_text_engine_JustificationStyle_PUSH_IN_KINSOKU); dict_put(d, &flash_sampler_startSampling, &flash_sampler_startSampling); dict_put(d, &flash_text_engine_TextRotation, &flash_text_engine_TextRotation); dict_init2(&flash_text_engine_TextRotation.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TextRotation.members, &flash_text_engine_TextRotation_ROTATE_270, &flash_text_engine_TextRotation_ROTATE_270); - dict_put(&flash_text_engine_TextRotation.members, &flash_text_engine_TextRotation_AUTO, &flash_text_engine_TextRotation_AUTO); - dict_put(&flash_text_engine_TextRotation.members, &flash_text_engine_TextRotation_ROTATE_0, &flash_text_engine_TextRotation_ROTATE_0); - dict_put(&flash_text_engine_TextRotation.members, &flash_text_engine_TextRotation_ROTATE_90, &flash_text_engine_TextRotation_ROTATE_90); - dict_put(&flash_text_engine_TextRotation.members, &flash_text_engine_TextRotation_ROTATE_180, &flash_text_engine_TextRotation_ROTATE_180); + dict_init2(&flash_text_engine_TextRotation.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_TextRotation.static_members, &flash_text_engine_TextRotation_ROTATE_270, &flash_text_engine_TextRotation_ROTATE_270); + dict_put(&flash_text_engine_TextRotation.static_members, &flash_text_engine_TextRotation_AUTO, &flash_text_engine_TextRotation_AUTO); + dict_put(&flash_text_engine_TextRotation.static_members, &flash_text_engine_TextRotation_ROTATE_0, &flash_text_engine_TextRotation_ROTATE_0); + dict_put(&flash_text_engine_TextRotation.static_members, &flash_text_engine_TextRotation_ROTATE_90, &flash_text_engine_TextRotation_ROTATE_90); + dict_put(&flash_text_engine_TextRotation.static_members, &flash_text_engine_TextRotation_ROTATE_180, &flash_text_engine_TextRotation_ROTATE_180); dict_put(d, &flash_sampler_clearSamples, &flash_sampler_clearSamples); dict_put(d, &flash_system_IMEConversionMode, &flash_system_IMEConversionMode); dict_init2(&flash_system_IMEConversionMode.members, &memberinfo_type, 8); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_FULL, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_FULL); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_CHINESE, &flash_system_IMEConversionMode_CHINESE); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_HALF, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_HALF); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_UNKNOWN, &flash_system_IMEConversionMode_UNKNOWN); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_KOREAN, &flash_system_IMEConversionMode_KOREAN); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_ALPHANUMERIC_HALF, &flash_system_IMEConversionMode_ALPHANUMERIC_HALF); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_ALPHANUMERIC_FULL, &flash_system_IMEConversionMode_ALPHANUMERIC_FULL); - dict_put(&flash_system_IMEConversionMode.members, &flash_system_IMEConversionMode_JAPANESE_HIRAGANA, &flash_system_IMEConversionMode_JAPANESE_HIRAGANA); + dict_init2(&flash_system_IMEConversionMode.static_members, &memberinfo_type, 8); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_FULL, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_FULL); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_CHINESE, &flash_system_IMEConversionMode_CHINESE); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_HALF, &flash_system_IMEConversionMode_JAPANESE_KATAKANA_HALF); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_UNKNOWN, &flash_system_IMEConversionMode_UNKNOWN); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_KOREAN, &flash_system_IMEConversionMode_KOREAN); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_ALPHANUMERIC_HALF, &flash_system_IMEConversionMode_ALPHANUMERIC_HALF); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_ALPHANUMERIC_FULL, &flash_system_IMEConversionMode_ALPHANUMERIC_FULL); + dict_put(&flash_system_IMEConversionMode.static_members, &flash_system_IMEConversionMode_JAPANESE_HIRAGANA, &flash_system_IMEConversionMode_JAPANESE_HIRAGANA); dict_put(d, &flash_display_StageScaleMode, &flash_display_StageScaleMode); dict_init2(&flash_display_StageScaleMode.members, &memberinfo_type, 8); - dict_put(&flash_display_StageScaleMode.members, &flash_display_StageScaleMode_SHOW_ALL, &flash_display_StageScaleMode_SHOW_ALL); - dict_put(&flash_display_StageScaleMode.members, &flash_display_StageScaleMode_NO_BORDER, &flash_display_StageScaleMode_NO_BORDER); - dict_put(&flash_display_StageScaleMode.members, &flash_display_StageScaleMode_EXACT_FIT, &flash_display_StageScaleMode_EXACT_FIT); - dict_put(&flash_display_StageScaleMode.members, &flash_display_StageScaleMode_NO_SCALE, &flash_display_StageScaleMode_NO_SCALE); + dict_init2(&flash_display_StageScaleMode.static_members, &memberinfo_type, 8); + dict_put(&flash_display_StageScaleMode.static_members, &flash_display_StageScaleMode_SHOW_ALL, &flash_display_StageScaleMode_SHOW_ALL); + dict_put(&flash_display_StageScaleMode.static_members, &flash_display_StageScaleMode_NO_BORDER, &flash_display_StageScaleMode_NO_BORDER); + dict_put(&flash_display_StageScaleMode.static_members, &flash_display_StageScaleMode_EXACT_FIT, &flash_display_StageScaleMode_EXACT_FIT); + dict_put(&flash_display_StageScaleMode.static_members, &flash_display_StageScaleMode_NO_SCALE, &flash_display_StageScaleMode_NO_SCALE); dict_put(d, &flash_sampler_getSize, &flash_sampler_getSize); dict_put(d, &flash_net_URLStream, &flash_net_URLStream); dict_init2(&flash_net_URLStream.members, &memberinfo_type, 31); + dict_init2(&flash_net_URLStream.static_members, &memberinfo_type, 8); dict_put(&flash_net_URLStream.members, &flash_net_URLStream_readUTF, &flash_net_URLStream_readUTF); dict_put(&flash_net_URLStream.members, &flash_net_URLStream_readByte, &flash_net_URLStream_readByte); dict_put(&flash_net_URLStream.members, &flash_net_URLStream_readUTFBytes, &flash_net_URLStream_readUTFBytes); @@ -6628,103 +7710,112 @@ dict_put(&flash_net_URLStream.members, &flash_net_URLStream_endian, &flash_net_URLStream_endian); dict_put(&flash_net_URLStream.members, &flash_net_URLStream_readBoolean, &flash_net_URLStream_readBoolean); dict_put(d, &flash_display_BlendMode, &flash_display_BlendMode); - dict_init2(&flash_display_BlendMode.members, &memberinfo_type, 31); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_LAYER, &flash_display_BlendMode_LAYER); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_ERASE, &flash_display_BlendMode_ERASE); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_HARDLIGHT, &flash_display_BlendMode_HARDLIGHT); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_OVERLAY, &flash_display_BlendMode_OVERLAY); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_ALPHA, &flash_display_BlendMode_ALPHA); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_SUBTRACT, &flash_display_BlendMode_SUBTRACT); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_INVERT, &flash_display_BlendMode_INVERT); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_DIFFERENCE, &flash_display_BlendMode_DIFFERENCE); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_DARKEN, &flash_display_BlendMode_DARKEN); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_SHADER, &flash_display_BlendMode_SHADER); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_MULTIPLY, &flash_display_BlendMode_MULTIPLY); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_ADD, &flash_display_BlendMode_ADD); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_SCREEN, &flash_display_BlendMode_SCREEN); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_NORMAL, &flash_display_BlendMode_NORMAL); - dict_put(&flash_display_BlendMode.members, &flash_display_BlendMode_LIGHTEN, &flash_display_BlendMode_LIGHTEN); + dict_init2(&flash_display_BlendMode.members, &memberinfo_type, 8); + dict_init2(&flash_display_BlendMode.static_members, &memberinfo_type, 31); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_LAYER, &flash_display_BlendMode_LAYER); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_ERASE, &flash_display_BlendMode_ERASE); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_HARDLIGHT, &flash_display_BlendMode_HARDLIGHT); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_OVERLAY, &flash_display_BlendMode_OVERLAY); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_ALPHA, &flash_display_BlendMode_ALPHA); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_SUBTRACT, &flash_display_BlendMode_SUBTRACT); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_INVERT, &flash_display_BlendMode_INVERT); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_DIFFERENCE, &flash_display_BlendMode_DIFFERENCE); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_DARKEN, &flash_display_BlendMode_DARKEN); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_SHADER, &flash_display_BlendMode_SHADER); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_MULTIPLY, &flash_display_BlendMode_MULTIPLY); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_ADD, &flash_display_BlendMode_ADD); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_SCREEN, &flash_display_BlendMode_SCREEN); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_NORMAL, &flash_display_BlendMode_NORMAL); + dict_put(&flash_display_BlendMode.static_members, &flash_display_BlendMode_LIGHTEN, &flash_display_BlendMode_LIGHTEN); dict_put(d, &flash_ui_Mouse, &flash_ui_Mouse); dict_init2(&flash_ui_Mouse.members, &memberinfo_type, 8); - dict_put(&flash_ui_Mouse.members, &flash_ui_Mouse_cursor, &flash_ui_Mouse_cursor); - dict_put(&flash_ui_Mouse.members, &flash_ui_Mouse_show, &flash_ui_Mouse_show); - dict_put(&flash_ui_Mouse.members, &flash_ui_Mouse_hide, &flash_ui_Mouse_hide); + dict_init2(&flash_ui_Mouse.static_members, &memberinfo_type, 8); + dict_put(&flash_ui_Mouse.static_members, &flash_ui_Mouse_cursor, &flash_ui_Mouse_cursor); + dict_put(&flash_ui_Mouse.static_members, &flash_ui_Mouse_show, &flash_ui_Mouse_show); + dict_put(&flash_ui_Mouse.static_members, &flash_ui_Mouse_hide, &flash_ui_Mouse_hide); dict_put(d, &flash_errors_InvalidSWFError, &flash_errors_InvalidSWFError); dict_init2(&flash_errors_InvalidSWFError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_InvalidSWFError.static_members, &memberinfo_type, 8); dict_put(d, &flash_text_engine_RenderingMode, &flash_text_engine_RenderingMode); dict_init2(&flash_text_engine_RenderingMode.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_RenderingMode.members, &flash_text_engine_RenderingMode_NORMAL, &flash_text_engine_RenderingMode_NORMAL); - dict_put(&flash_text_engine_RenderingMode.members, &flash_text_engine_RenderingMode_CFF, &flash_text_engine_RenderingMode_CFF); + dict_init2(&flash_text_engine_RenderingMode.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_RenderingMode.static_members, &flash_text_engine_RenderingMode_NORMAL, &flash_text_engine_RenderingMode_NORMAL); + dict_put(&flash_text_engine_RenderingMode.static_members, &flash_text_engine_RenderingMode_CFF, &flash_text_engine_RenderingMode_CFF); dict_put(d, &flash_display_GraphicsTrianglePath, &flash_display_GraphicsTrianglePath); dict_init2(&flash_display_GraphicsTrianglePath.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsTrianglePath.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsTrianglePath.members, &flash_display_GraphicsTrianglePath_culling, &flash_display_GraphicsTrianglePath_culling); dict_put(&flash_display_GraphicsTrianglePath.members, &flash_display_GraphicsTrianglePath_vertices, &flash_display_GraphicsTrianglePath_vertices); dict_put(&flash_display_GraphicsTrianglePath.members, &flash_display_GraphicsTrianglePath_indices, &flash_display_GraphicsTrianglePath_indices); dict_put(&flash_display_GraphicsTrianglePath.members, &flash_display_GraphicsTrianglePath_uvtData, &flash_display_GraphicsTrianglePath_uvtData); dict_put(d, &flash_display_IGraphicsFill, &flash_display_IGraphicsFill); dict_init2(&flash_display_IGraphicsFill.members, &memberinfo_type, 8); + dict_init2(&flash_display_IGraphicsFill.static_members, &memberinfo_type, 8); dict_put(d, &flash_text_engine_TypographicCase, &flash_text_engine_TypographicCase); dict_init2(&flash_text_engine_TypographicCase.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_UPPERCASE, &flash_text_engine_TypographicCase_UPPERCASE); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_DEFAULT, &flash_text_engine_TypographicCase_DEFAULT); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_LOWERCASE, &flash_text_engine_TypographicCase_LOWERCASE); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_SMALL_CAPS, &flash_text_engine_TypographicCase_SMALL_CAPS); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_TITLE, &flash_text_engine_TypographicCase_TITLE); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_CAPS, &flash_text_engine_TypographicCase_CAPS); - dict_put(&flash_text_engine_TypographicCase.members, &flash_text_engine_TypographicCase_CAPS_AND_SMALL_CAPS, &flash_text_engine_TypographicCase_CAPS_AND_SMALL_CAPS); + dict_init2(&flash_text_engine_TypographicCase.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_UPPERCASE, &flash_text_engine_TypographicCase_UPPERCASE); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_DEFAULT, &flash_text_engine_TypographicCase_DEFAULT); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_LOWERCASE, &flash_text_engine_TypographicCase_LOWERCASE); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_SMALL_CAPS, &flash_text_engine_TypographicCase_SMALL_CAPS); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_TITLE, &flash_text_engine_TypographicCase_TITLE); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_CAPS, &flash_text_engine_TypographicCase_CAPS); + dict_put(&flash_text_engine_TypographicCase.static_members, &flash_text_engine_TypographicCase_CAPS_AND_SMALL_CAPS, &flash_text_engine_TypographicCase_CAPS_AND_SMALL_CAPS); dict_put(d, &_XML, &_XML); - dict_init2(&_XML.members, &memberinfo_type, 127); - dict_put(&_XML.members, &_XML_attribute, &_XML_attribute); + dict_init2(&_XML.members, &memberinfo_type, 63); + dict_init2(&_XML.static_members, &memberinfo_type, 15); + dict_put(&_XML.members, &_XML_normalize, &_XML_normalize); + dict_put(&_XML.members, &_XML_removeNamespace, &_XML_removeNamespace); + dict_put(&_XML.members, &_XML_prependChild, &_XML_prependChild); + dict_put(&_XML.members, &_XML_toXMLString, &_XML_toXMLString); + dict_put(&_XML.members, &_XML_text, &_XML_text); + dict_put(&_XML.members, &_XML_nodeKind, &_XML_nodeKind); + dict_put(&_XML.members, &_XML_copy, &_XML_copy); dict_put(&_XML.members, &_XML_toString, &_XML_toString); dict_put(&_XML.members, &_XML_childIndex, &_XML_childIndex); - dict_put(&_XML.members, &_XML_parent, &_XML_parent); - dict_put(&_XML.members, &_XML_appendChild, &_XML_appendChild); - dict_put(&_XML.members, &_XML_replace, &_XML_replace); - dict_put(&_XML.members, &_XML_elements, &_XML_elements); - dict_put(&_XML.members, &_XML_setNotification, &_XML_setNotification); - dict_put(&_XML.members, &_XML_namespaceDeclarations, &_XML_namespaceDeclarations); - dict_put(&_XML.members, &_XML_length, &_XML_length); - dict_put(&_XML.members, &_XML_comments, &_XML_comments); - dict_put(&_XML.members, &_XML_processingInstructions, &_XML_processingInstructions); - dict_put(&_XML.members, &_XML_inScopeNamespaces, &_XML_inScopeNamespaces); - dict_put(&_XML.members, &_XML_prettyPrinting, &_XML_prettyPrinting); - dict_put(&_XML.members, &_XML_children, &_XML_children); + dict_put(&_XML.members, &_XML_setName, &_XML_setName); dict_put(&_XML.members, &_XML_setLocalName, &_XML_setLocalName); - dict_put(&_XML.members, &_XML_setSettings, &_XML_setSettings); - dict_put(&_XML.members, &_XML_ignoreComments, &_XML_ignoreComments); - dict_put(&_XML.members, &_XML_notification, &_XML_notification); - dict_put(&_XML.members, &_XML_ignoreWhitespace, &_XML_ignoreWhitespace); - dict_put(&_XML.members, &_XML_setNamespace, &_XML_setNamespace); - dict_put(&_XML.members, &_XML_prependChild, &_XML_prependChild); - dict_put(&_XML.members, &_XML_hasSimpleContent, &_XML_hasSimpleContent); + dict_put(&_XML.members, &_XML_namespace, &_XML_namespace); dict_put(&_XML.members, &_XML_insertChildBefore, &_XML_insertChildBefore); - dict_put(&_XML.members, &_XML_hasOwnProperty, &_XML_hasOwnProperty); - dict_put(&_XML.members, &_XML_normalize, &_XML_normalize); - dict_put(&_XML.members, &_XML_valueOf, &_XML_valueOf); - dict_put(&_XML.members, &_XML_copy, &_XML_copy); - dict_put(&_XML.members, &_XML_localName, &_XML_localName); - dict_put(&_XML.members, &_XML_contains, &_XML_contains); + dict_put(&_XML.members, &_XML_addNamespace, &_XML_addNamespace); dict_put(&_XML.members, &_XML_propertyIsEnumerable, &_XML_propertyIsEnumerable); - dict_put(&_XML.members, &_XML_defaultSettings, &_XML_defaultSettings); - dict_put(&_XML.members, &_XML_settings, &_XML_settings); - dict_put(&_XML.members, &_XML_namespace, &_XML_namespace); + dict_put(&_XML.members, &_XML_comments, &_XML_comments); dict_put(&_XML.members, &_XML_attributes, &_XML_attributes); - dict_put(&_XML.members, &_XML_setName, &_XML_setName); - dict_put(&_XML.members, &_XML_text, &_XML_text); - dict_put(&_XML.members, &_XML_insertChildAfter, &_XML_insertChildAfter); - dict_put(&_XML.members, &_XML_ignoreProcessingInstructions, &_XML_ignoreProcessingInstructions); - dict_put(&_XML.members, &_XML_prettyIndent, &_XML_prettyIndent); dict_put(&_XML.members, &_XML_descendants, &_XML_descendants); - dict_put(&_XML.members, &_XML_toXMLString, &_XML_toXMLString); + dict_put(&_XML.members, &_XML_replace, &_XML_replace); + dict_put(&_XML.members, &_XML_setNotification, &_XML_setNotification); + dict_put(&_XML.members, &_XML_children, &_XML_children); + dict_put(&_XML.members, &_XML_contains, &_XML_contains); + dict_put(&_XML.members, &_XML_hasSimpleContent, &_XML_hasSimpleContent); + dict_put(&_XML.members, &_XML_elements, &_XML_elements); dict_put(&_XML.members, &_XML_hasComplexContent, &_XML_hasComplexContent); + dict_put(&_XML.members, &_XML_insertChildAfter, &_XML_insertChildAfter); + dict_put(&_XML.members, &_XML_parent, &_XML_parent); + dict_put(&_XML.members, &_XML_length, &_XML_length); + dict_put(&_XML.members, &_XML_processingInstructions, &_XML_processingInstructions); dict_put(&_XML.members, &_XML_child, &_XML_child); - dict_put(&_XML.members, &_XML_removeNamespace, &_XML_removeNamespace); - dict_put(&_XML.members, &_XML_addNamespace, &_XML_addNamespace); - dict_put(&_XML.members, &_XML_nodeKind, &_XML_nodeKind); + dict_put(&_XML.members, &_XML_appendChild, &_XML_appendChild); + dict_put(&_XML.members, &_XML_valueOf, &_XML_valueOf); + dict_put(&_XML.members, &_XML_localName, &_XML_localName); + dict_put(&_XML.members, &_XML_notification, &_XML_notification); + dict_put(&_XML.members, &_XML_inScopeNamespaces, &_XML_inScopeNamespaces); + dict_put(&_XML.members, &_XML_hasOwnProperty, &_XML_hasOwnProperty); + dict_put(&_XML.members, &_XML_namespaceDeclarations, &_XML_namespaceDeclarations); + dict_put(&_XML.members, &_XML_setNamespace, &_XML_setNamespace); dict_put(&_XML.members, &_XML_name, &_XML_name); dict_put(&_XML.members, &_XML_setChildren, &_XML_setChildren); + dict_put(&_XML.members, &_XML_attribute, &_XML_attribute); + dict_put(&_XML.static_members, &_XML_prettyPrinting, &_XML_prettyPrinting); + dict_put(&_XML.static_members, &_XML_setSettings, &_XML_setSettings); + dict_put(&_XML.static_members, &_XML_ignoreComments, &_XML_ignoreComments); + dict_put(&_XML.static_members, &_XML_prettyIndent, &_XML_prettyIndent); + dict_put(&_XML.static_members, &_XML_settings, &_XML_settings); + dict_put(&_XML.static_members, &_XML_ignoreProcessingInstructions, &_XML_ignoreProcessingInstructions); + dict_put(&_XML.static_members, &_XML_ignoreWhitespace, &_XML_ignoreWhitespace); + dict_put(&_XML.static_members, &_XML_defaultSettings, &_XML_defaultSettings); dict_put(d, &flash_net_NetStreamInfo, &flash_net_NetStreamInfo); dict_init2(&flash_net_NetStreamInfo.members, &memberinfo_type, 31); + dict_init2(&flash_net_NetStreamInfo.static_members, &memberinfo_type, 8); dict_put(&flash_net_NetStreamInfo.members, &flash_net_NetStreamInfo_maxBytesPerSecond, &flash_net_NetStreamInfo_maxBytesPerSecond); dict_put(&flash_net_NetStreamInfo.members, &flash_net_NetStreamInfo_dataBufferByteLength, &flash_net_NetStreamInfo_dataBufferByteLength); dict_put(&flash_net_NetStreamInfo.members, &flash_net_NetStreamInfo_videoByteCount, &flash_net_NetStreamInfo_videoByteCount); @@ -6747,6 +7838,7 @@ dict_put(&flash_net_NetStreamInfo.members, &flash_net_NetStreamInfo_playbackBytesPerSecond, &flash_net_NetStreamInfo_playbackBytesPerSecond); dict_put(d, &flash_display_Stage, &flash_display_Stage); dict_init2(&flash_display_Stage.members, &memberinfo_type, 63); + dict_init2(&flash_display_Stage.static_members, &memberinfo_type, 8); dict_put(&flash_display_Stage.members, &flash_display_Stage_setChildIndex, &flash_display_Stage_setChildIndex); dict_put(&flash_display_Stage.members, &flash_display_Stage_stageFocusRect, &flash_display_Stage_stageFocusRect); dict_put(&flash_display_Stage.members, &flash_display_Stage_frameRate, &flash_display_Stage_frameRate); @@ -6781,44 +7873,50 @@ dict_put(&flash_display_Stage.members, &flash_display_Stage_stageWidth, &flash_display_Stage_stageWidth); dict_put(d, &flash_ui_ContextMenuItem, &flash_ui_ContextMenuItem); dict_init2(&flash_ui_ContextMenuItem.members, &memberinfo_type, 8); + dict_init2(&flash_ui_ContextMenuItem.static_members, &memberinfo_type, 8); dict_put(&flash_ui_ContextMenuItem.members, &flash_ui_ContextMenuItem_separatorBefore, &flash_ui_ContextMenuItem_separatorBefore); dict_put(&flash_ui_ContextMenuItem.members, &flash_ui_ContextMenuItem_enabled, &flash_ui_ContextMenuItem_enabled); dict_put(&flash_ui_ContextMenuItem.members, &flash_ui_ContextMenuItem_caption, &flash_ui_ContextMenuItem_caption); dict_put(&flash_ui_ContextMenuItem.members, &flash_ui_ContextMenuItem_clone, &flash_ui_ContextMenuItem_clone); dict_put(&flash_ui_ContextMenuItem.members, &flash_ui_ContextMenuItem_visible, &flash_ui_ContextMenuItem_visible); dict_put(d, &flash_trace_Trace, &flash_trace_Trace); - dict_init2(&flash_trace_Trace.members, &memberinfo_type, 15); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_METHODS_AND_LINES_WITH_ARGS, &flash_trace_Trace_METHODS_AND_LINES_WITH_ARGS); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_FILE, &flash_trace_Trace_FILE); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_METHODS_WITH_ARGS, &flash_trace_Trace_METHODS_WITH_ARGS); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_OFF, &flash_trace_Trace_OFF); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_METHODS_AND_LINES, &flash_trace_Trace_METHODS_AND_LINES); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_LISTENER, &flash_trace_Trace_LISTENER); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_getLevel, &flash_trace_Trace_getLevel); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_setLevel, &flash_trace_Trace_setLevel); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_setListener, &flash_trace_Trace_setListener); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_getListener, &flash_trace_Trace_getListener); - dict_put(&flash_trace_Trace.members, &flash_trace_Trace_METHODS, &flash_trace_Trace_METHODS); + dict_init2(&flash_trace_Trace.members, &memberinfo_type, 8); + dict_init2(&flash_trace_Trace.static_members, &memberinfo_type, 15); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_METHODS_AND_LINES_WITH_ARGS, &flash_trace_Trace_METHODS_AND_LINES_WITH_ARGS); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_FILE, &flash_trace_Trace_FILE); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_METHODS_WITH_ARGS, &flash_trace_Trace_METHODS_WITH_ARGS); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_OFF, &flash_trace_Trace_OFF); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_METHODS_AND_LINES, &flash_trace_Trace_METHODS_AND_LINES); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_LISTENER, &flash_trace_Trace_LISTENER); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_getLevel, &flash_trace_Trace_getLevel); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_setLevel, &flash_trace_Trace_setLevel); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_setListener, &flash_trace_Trace_setListener); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_getListener, &flash_trace_Trace_getListener); + dict_put(&flash_trace_Trace.static_members, &flash_trace_Trace_METHODS, &flash_trace_Trace_METHODS); dict_put(d, &flash_events_TimerEvent, &flash_events_TimerEvent); dict_init2(&flash_events_TimerEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_TimerEvent.members, &flash_events_TimerEvent_TIMER_COMPLETE, &flash_events_TimerEvent_TIMER_COMPLETE); + dict_init2(&flash_events_TimerEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_TimerEvent.members, &flash_events_TimerEvent_toString, &flash_events_TimerEvent_toString); dict_put(&flash_events_TimerEvent.members, &flash_events_TimerEvent_clone, &flash_events_TimerEvent_clone); - dict_put(&flash_events_TimerEvent.members, &flash_events_TimerEvent_TIMER, &flash_events_TimerEvent_TIMER); dict_put(&flash_events_TimerEvent.members, &flash_events_TimerEvent_updateAfterEvent, &flash_events_TimerEvent_updateAfterEvent); + dict_put(&flash_events_TimerEvent.static_members, &flash_events_TimerEvent_TIMER_COMPLETE, &flash_events_TimerEvent_TIMER_COMPLETE); + dict_put(&flash_events_TimerEvent.static_members, &flash_events_TimerEvent_TIMER, &flash_events_TimerEvent_TIMER); dict_put(d, &flash_events_SampleDataEvent, &flash_events_SampleDataEvent); dict_init2(&flash_events_SampleDataEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_SampleDataEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_SampleDataEvent.members, &flash_events_SampleDataEvent_toString, &flash_events_SampleDataEvent_toString); dict_put(&flash_events_SampleDataEvent.members, &flash_events_SampleDataEvent_position, &flash_events_SampleDataEvent_position); dict_put(&flash_events_SampleDataEvent.members, &flash_events_SampleDataEvent_clone, &flash_events_SampleDataEvent_clone); - dict_put(&flash_events_SampleDataEvent.members, &flash_events_SampleDataEvent_SAMPLE_DATA, &flash_events_SampleDataEvent_SAMPLE_DATA); dict_put(&flash_events_SampleDataEvent.members, &flash_events_SampleDataEvent_data, &flash_events_SampleDataEvent_data); + dict_put(&flash_events_SampleDataEvent.static_members, &flash_events_SampleDataEvent_SAMPLE_DATA, &flash_events_SampleDataEvent_SAMPLE_DATA); dict_put(d, &flash_display_ShaderPrecision, &flash_display_ShaderPrecision); dict_init2(&flash_display_ShaderPrecision.members, &memberinfo_type, 8); - dict_put(&flash_display_ShaderPrecision.members, &flash_display_ShaderPrecision_FULL, &flash_display_ShaderPrecision_FULL); - dict_put(&flash_display_ShaderPrecision.members, &flash_display_ShaderPrecision_FAST, &flash_display_ShaderPrecision_FAST); + dict_init2(&flash_display_ShaderPrecision.static_members, &memberinfo_type, 8); + dict_put(&flash_display_ShaderPrecision.static_members, &flash_display_ShaderPrecision_FULL, &flash_display_ShaderPrecision_FULL); + dict_put(&flash_display_ShaderPrecision.static_members, &flash_display_ShaderPrecision_FAST, &flash_display_ShaderPrecision_FAST); dict_put(d, &flash_net_FileReference, &flash_net_FileReference); dict_init2(&flash_net_FileReference.members, &memberinfo_type, 31); + dict_init2(&flash_net_FileReference.static_members, &memberinfo_type, 8); dict_put(&flash_net_FileReference.members, &flash_net_FileReference_type, &flash_net_FileReference_type); dict_put(&flash_net_FileReference.members, &flash_net_FileReference_browse, &flash_net_FileReference_browse); dict_put(&flash_net_FileReference.members, &flash_net_FileReference_creationDate, &flash_net_FileReference_creationDate); @@ -6834,9 +7932,11 @@ dict_put(&flash_net_FileReference.members, &flash_net_FileReference_modificationDate, &flash_net_FileReference_modificationDate); dict_put(d, &_DefinitionError, &_DefinitionError); dict_init2(&_DefinitionError.members, &memberinfo_type, 8); - dict_put(&_DefinitionError.members, &_DefinitionError_length, &_DefinitionError_length); + dict_init2(&_DefinitionError.static_members, &memberinfo_type, 8); + dict_put(&_DefinitionError.static_members, &_DefinitionError_length, &_DefinitionError_length); dict_put(d, &flash_events_EventDispatcher, &flash_events_EventDispatcher); dict_init2(&flash_events_EventDispatcher.members, &memberinfo_type, 8); + dict_init2(&flash_events_EventDispatcher.static_members, &memberinfo_type, 8); dict_put(&flash_events_EventDispatcher.members, &flash_events_EventDispatcher_willTrigger, &flash_events_EventDispatcher_willTrigger); dict_put(&flash_events_EventDispatcher.members, &flash_events_EventDispatcher_toString, &flash_events_EventDispatcher_toString); dict_put(&flash_events_EventDispatcher.members, &flash_events_EventDispatcher_removeEventListener, &flash_events_EventDispatcher_removeEventListener); @@ -6845,10 +7945,12 @@ dict_put(&flash_events_EventDispatcher.members, &flash_events_EventDispatcher_dispatchEvent, &flash_events_EventDispatcher_dispatchEvent); dict_put(d, &flash_net_SharedObjectFlushStatus, &flash_net_SharedObjectFlushStatus); dict_init2(&flash_net_SharedObjectFlushStatus.members, &memberinfo_type, 8); - dict_put(&flash_net_SharedObjectFlushStatus.members, &flash_net_SharedObjectFlushStatus_FLUSHED, &flash_net_SharedObjectFlushStatus_FLUSHED); - dict_put(&flash_net_SharedObjectFlushStatus.members, &flash_net_SharedObjectFlushStatus_PENDING, &flash_net_SharedObjectFlushStatus_PENDING); + dict_init2(&flash_net_SharedObjectFlushStatus.static_members, &memberinfo_type, 8); + dict_put(&flash_net_SharedObjectFlushStatus.static_members, &flash_net_SharedObjectFlushStatus_FLUSHED, &flash_net_SharedObjectFlushStatus_FLUSHED); + dict_put(&flash_net_SharedObjectFlushStatus.static_members, &flash_net_SharedObjectFlushStatus_PENDING, &flash_net_SharedObjectFlushStatus_PENDING); dict_put(d, &flash_text_TextLineMetrics, &flash_text_TextLineMetrics); dict_init2(&flash_text_TextLineMetrics.members, &memberinfo_type, 8); + dict_init2(&flash_text_TextLineMetrics.static_members, &memberinfo_type, 8); dict_put(&flash_text_TextLineMetrics.members, &flash_text_TextLineMetrics_descent, &flash_text_TextLineMetrics_descent); dict_put(&flash_text_TextLineMetrics.members, &flash_text_TextLineMetrics_width, &flash_text_TextLineMetrics_width); dict_put(&flash_text_TextLineMetrics.members, &flash_text_TextLineMetrics_ascent, &flash_text_TextLineMetrics_ascent); @@ -6857,33 +7959,38 @@ dict_put(&flash_text_TextLineMetrics.members, &flash_text_TextLineMetrics_x, &flash_text_TextLineMetrics_x); dict_put(d, &flash_text_AntiAliasType, &flash_text_AntiAliasType); dict_init2(&flash_text_AntiAliasType.members, &memberinfo_type, 8); - dict_put(&flash_text_AntiAliasType.members, &flash_text_AntiAliasType_NORMAL, &flash_text_AntiAliasType_NORMAL); - dict_put(&flash_text_AntiAliasType.members, &flash_text_AntiAliasType_ADVANCED, &flash_text_AntiAliasType_ADVANCED); + dict_init2(&flash_text_AntiAliasType.static_members, &memberinfo_type, 8); + dict_put(&flash_text_AntiAliasType.static_members, &flash_text_AntiAliasType_NORMAL, &flash_text_AntiAliasType_NORMAL); + dict_put(&flash_text_AntiAliasType.static_members, &flash_text_AntiAliasType_ADVANCED, &flash_text_AntiAliasType_ADVANCED); dict_put(d, &flash_system_SecurityDomain, &flash_system_SecurityDomain); dict_init2(&flash_system_SecurityDomain.members, &memberinfo_type, 8); - dict_put(&flash_system_SecurityDomain.members, &flash_system_SecurityDomain_currentDomain, &flash_system_SecurityDomain_currentDomain); + dict_init2(&flash_system_SecurityDomain.static_members, &memberinfo_type, 8); + dict_put(&flash_system_SecurityDomain.static_members, &flash_system_SecurityDomain_currentDomain, &flash_system_SecurityDomain_currentDomain); dict_put(d, &flash_text_Font, &flash_text_Font); dict_init2(&flash_text_Font.members, &memberinfo_type, 8); - dict_put(&flash_text_Font.members, &flash_text_Font_enumerateFonts, &flash_text_Font_enumerateFonts); + dict_init2(&flash_text_Font.static_members, &memberinfo_type, 8); dict_put(&flash_text_Font.members, &flash_text_Font_hasGlyphs, &flash_text_Font_hasGlyphs); dict_put(&flash_text_Font.members, &flash_text_Font_fontName, &flash_text_Font_fontName); - dict_put(&flash_text_Font.members, &flash_text_Font_registerFont, &flash_text_Font_registerFont); dict_put(&flash_text_Font.members, &flash_text_Font_fontStyle, &flash_text_Font_fontStyle); dict_put(&flash_text_Font.members, &flash_text_Font_fontType, &flash_text_Font_fontType); + dict_put(&flash_text_Font.static_members, &flash_text_Font_enumerateFonts, &flash_text_Font_enumerateFonts); + dict_put(&flash_text_Font.static_members, &flash_text_Font_registerFont, &flash_text_Font_registerFont); dict_put(d, &_RegExp, &_RegExp); dict_init2(&_RegExp.members, &memberinfo_type, 8); + dict_init2(&_RegExp.static_members, &memberinfo_type, 8); dict_put(&_RegExp.members, &_RegExp_source, &_RegExp_source); dict_put(&_RegExp.members, &_RegExp_test, &_RegExp_test); dict_put(&_RegExp.members, &_RegExp_global, &_RegExp_global); - dict_put(&_RegExp.members, &_RegExp_length, &_RegExp_length); dict_put(&_RegExp.members, &_RegExp_exec, &_RegExp_exec); dict_put(&_RegExp.members, &_RegExp_ignoreCase, &_RegExp_ignoreCase); dict_put(&_RegExp.members, &_RegExp_dotall, &_RegExp_dotall); dict_put(&_RegExp.members, &_RegExp_lastIndex, &_RegExp_lastIndex); dict_put(&_RegExp.members, &_RegExp_extended, &_RegExp_extended); dict_put(&_RegExp.members, &_RegExp_multiline, &_RegExp_multiline); + dict_put(&_RegExp.static_members, &_RegExp_length, &_RegExp_length); dict_put(d, &flash_accessibility_AccessibilityProperties, &flash_accessibility_AccessibilityProperties); dict_init2(&flash_accessibility_AccessibilityProperties.members, &memberinfo_type, 8); + dict_init2(&flash_accessibility_AccessibilityProperties.static_members, &memberinfo_type, 8); dict_put(&flash_accessibility_AccessibilityProperties.members, &flash_accessibility_AccessibilityProperties_forceSimple, &flash_accessibility_AccessibilityProperties_forceSimple); dict_put(&flash_accessibility_AccessibilityProperties.members, &flash_accessibility_AccessibilityProperties_noAutoLabeling, &flash_accessibility_AccessibilityProperties_noAutoLabeling); dict_put(&flash_accessibility_AccessibilityProperties.members, &flash_accessibility_AccessibilityProperties_description, &flash_accessibility_AccessibilityProperties_description); @@ -6892,6 +7999,7 @@ dict_put(&flash_accessibility_AccessibilityProperties.members, &flash_accessibility_AccessibilityProperties_silent, &flash_accessibility_AccessibilityProperties_silent); dict_put(d, &flash_ui_ContextMenu, &flash_ui_ContextMenu); dict_init2(&flash_ui_ContextMenu.members, &memberinfo_type, 8); + dict_init2(&flash_ui_ContextMenu.static_members, &memberinfo_type, 8); dict_put(&flash_ui_ContextMenu.members, &flash_ui_ContextMenu_hideBuiltInItems, &flash_ui_ContextMenu_hideBuiltInItems); dict_put(&flash_ui_ContextMenu.members, &flash_ui_ContextMenu_clipboardItems, &flash_ui_ContextMenu_clipboardItems); dict_put(&flash_ui_ContextMenu.members, &flash_ui_ContextMenu_builtInItems, &flash_ui_ContextMenu_builtInItems); @@ -6901,48 +8009,53 @@ dict_put(&flash_ui_ContextMenu.members, &flash_ui_ContextMenu_clipboardMenu, &flash_ui_ContextMenu_clipboardMenu); dict_put(d, &flash_text_TextFieldAutoSize, &flash_text_TextFieldAutoSize); dict_init2(&flash_text_TextFieldAutoSize.members, &memberinfo_type, 8); - dict_put(&flash_text_TextFieldAutoSize.members, &flash_text_TextFieldAutoSize_LEFT, &flash_text_TextFieldAutoSize_LEFT); - dict_put(&flash_text_TextFieldAutoSize.members, &flash_text_TextFieldAutoSize_RIGHT, &flash_text_TextFieldAutoSize_RIGHT); - dict_put(&flash_text_TextFieldAutoSize.members, &flash_text_TextFieldAutoSize_CENTER, &flash_text_TextFieldAutoSize_CENTER); - dict_put(&flash_text_TextFieldAutoSize.members, &flash_text_TextFieldAutoSize_NONE, &flash_text_TextFieldAutoSize_NONE); + dict_init2(&flash_text_TextFieldAutoSize.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextFieldAutoSize.static_members, &flash_text_TextFieldAutoSize_LEFT, &flash_text_TextFieldAutoSize_LEFT); + dict_put(&flash_text_TextFieldAutoSize.static_members, &flash_text_TextFieldAutoSize_RIGHT, &flash_text_TextFieldAutoSize_RIGHT); + dict_put(&flash_text_TextFieldAutoSize.static_members, &flash_text_TextFieldAutoSize_CENTER, &flash_text_TextFieldAutoSize_CENTER); + dict_put(&flash_text_TextFieldAutoSize.static_members, &flash_text_TextFieldAutoSize_NONE, &flash_text_TextFieldAutoSize_NONE); dict_put(d, &_Math, &_Math); - dict_init2(&_Math.members, &memberinfo_type, 63); - dict_put(&_Math.members, &_Math_ceil, &_Math_ceil); - dict_put(&_Math.members, &_Math_SQRT2, &_Math_SQRT2); - dict_put(&_Math.members, &_Math_cos, &_Math_cos); - dict_put(&_Math.members, &_Math_abs, &_Math_abs); - dict_put(&_Math.members, &_Math_PI, &_Math_PI); - dict_put(&_Math.members, &_Math_E, &_Math_E); - dict_put(&_Math.members, &_Math_round, &_Math_round); - dict_put(&_Math.members, &_Math_LN10, &_Math_LN10); - dict_put(&_Math.members, &_Math_SQRT1_2, &_Math_SQRT1_2); - dict_put(&_Math.members, &_Math_log, &_Math_log); - dict_put(&_Math.members, &_Math_LOG10E, &_Math_LOG10E); - dict_put(&_Math.members, &_Math_random, &_Math_random); - dict_put(&_Math.members, &_Math_acos, &_Math_acos); - dict_put(&_Math.members, &_Math_tan, &_Math_tan); - dict_put(&_Math.members, &_Math_asin, &_Math_asin); - dict_put(&_Math.members, &_Math_exp, &_Math_exp); - dict_put(&_Math.members, &_Math_atan2, &_Math_atan2); - dict_put(&_Math.members, &_Math_pow, &_Math_pow); - dict_put(&_Math.members, &_Math_min, &_Math_min); - dict_put(&_Math.members, &_Math_LN2, &_Math_LN2); - dict_put(&_Math.members, &_Math_sin, &_Math_sin); - dict_put(&_Math.members, &_Math_sqrt, &_Math_sqrt); - dict_put(&_Math.members, &_Math_LOG2E, &_Math_LOG2E); - dict_put(&_Math.members, &_Math_max, &_Math_max); - dict_put(&_Math.members, &_Math_atan, &_Math_atan); - dict_put(&_Math.members, &_Math_floor, &_Math_floor); + dict_init2(&_Math.members, &memberinfo_type, 8); + dict_init2(&_Math.static_members, &memberinfo_type, 63); + dict_put(&_Math.static_members, &_Math_ceil, &_Math_ceil); + dict_put(&_Math.static_members, &_Math_SQRT2, &_Math_SQRT2); + dict_put(&_Math.static_members, &_Math_cos, &_Math_cos); + dict_put(&_Math.static_members, &_Math_abs, &_Math_abs); + dict_put(&_Math.static_members, &_Math_PI, &_Math_PI); + dict_put(&_Math.static_members, &_Math_E, &_Math_E); + dict_put(&_Math.static_members, &_Math_round, &_Math_round); + dict_put(&_Math.static_members, &_Math_LN10, &_Math_LN10); + dict_put(&_Math.static_members, &_Math_SQRT1_2, &_Math_SQRT1_2); + dict_put(&_Math.static_members, &_Math_log, &_Math_log); + dict_put(&_Math.static_members, &_Math_LOG10E, &_Math_LOG10E); + dict_put(&_Math.static_members, &_Math_random, &_Math_random); + dict_put(&_Math.static_members, &_Math_acos, &_Math_acos); + dict_put(&_Math.static_members, &_Math_tan, &_Math_tan); + dict_put(&_Math.static_members, &_Math_asin, &_Math_asin); + dict_put(&_Math.static_members, &_Math_exp, &_Math_exp); + dict_put(&_Math.static_members, &_Math_atan2, &_Math_atan2); + dict_put(&_Math.static_members, &_Math_pow, &_Math_pow); + dict_put(&_Math.static_members, &_Math_min, &_Math_min); + dict_put(&_Math.static_members, &_Math_LN2, &_Math_LN2); + dict_put(&_Math.static_members, &_Math_sin, &_Math_sin); + dict_put(&_Math.static_members, &_Math_sqrt, &_Math_sqrt); + dict_put(&_Math.static_members, &_Math_LOG2E, &_Math_LOG2E); + dict_put(&_Math.static_members, &_Math_max, &_Math_max); + dict_put(&_Math.static_members, &_Math_atan, &_Math_atan); + dict_put(&_Math.static_members, &_Math_floor, &_Math_floor); dict_put(d, &flash_display_ColorCorrectionSupport, &flash_display_ColorCorrectionSupport); dict_init2(&flash_display_ColorCorrectionSupport.members, &memberinfo_type, 8); - dict_put(&flash_display_ColorCorrectionSupport.members, &flash_display_ColorCorrectionSupport_UNSUPPORTED, &flash_display_ColorCorrectionSupport_UNSUPPORTED); - dict_put(&flash_display_ColorCorrectionSupport.members, &flash_display_ColorCorrectionSupport_DEFAULT_ON, &flash_display_ColorCorrectionSupport_DEFAULT_ON); - dict_put(&flash_display_ColorCorrectionSupport.members, &flash_display_ColorCorrectionSupport_DEFAULT_OFF, &flash_display_ColorCorrectionSupport_DEFAULT_OFF); + dict_init2(&flash_display_ColorCorrectionSupport.static_members, &memberinfo_type, 8); + dict_put(&flash_display_ColorCorrectionSupport.static_members, &flash_display_ColorCorrectionSupport_UNSUPPORTED, &flash_display_ColorCorrectionSupport_UNSUPPORTED); + dict_put(&flash_display_ColorCorrectionSupport.static_members, &flash_display_ColorCorrectionSupport_DEFAULT_ON, &flash_display_ColorCorrectionSupport_DEFAULT_ON); + dict_put(&flash_display_ColorCorrectionSupport.static_members, &flash_display_ColorCorrectionSupport_DEFAULT_OFF, &flash_display_ColorCorrectionSupport_DEFAULT_OFF); dict_put(d, &flash_errors_IOError, &flash_errors_IOError); dict_init2(&flash_errors_IOError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_IOError.static_members, &memberinfo_type, 8); dict_put(d, &_trace, &_trace); dict_put(d, &flash_ui_ContextMenuBuiltInItems, &flash_ui_ContextMenuBuiltInItems); dict_init2(&flash_ui_ContextMenuBuiltInItems.members, &memberinfo_type, 8); + dict_init2(&flash_ui_ContextMenuBuiltInItems.static_members, &memberinfo_type, 8); dict_put(&flash_ui_ContextMenuBuiltInItems.members, &flash_ui_ContextMenuBuiltInItems_zoom, &flash_ui_ContextMenuBuiltInItems_zoom); dict_put(&flash_ui_ContextMenuBuiltInItems.members, &flash_ui_ContextMenuBuiltInItems_save, &flash_ui_ContextMenuBuiltInItems_save); dict_put(&flash_ui_ContextMenuBuiltInItems.members, &flash_ui_ContextMenuBuiltInItems_loop, &flash_ui_ContextMenuBuiltInItems_loop); @@ -6954,80 +8067,94 @@ dict_put(&flash_ui_ContextMenuBuiltInItems.members, &flash_ui_ContextMenuBuiltInItems_play, &flash_ui_ContextMenuBuiltInItems_play); dict_put(d, &flash_net_FileReferenceList, &flash_net_FileReferenceList); dict_init2(&flash_net_FileReferenceList.members, &memberinfo_type, 8); + dict_init2(&flash_net_FileReferenceList.static_members, &memberinfo_type, 8); dict_put(&flash_net_FileReferenceList.members, &flash_net_FileReferenceList_fileList, &flash_net_FileReferenceList_fileList); dict_put(&flash_net_FileReferenceList.members, &flash_net_FileReferenceList_browse, &flash_net_FileReferenceList_browse); dict_put(d, &flash_display_TriangleCulling, &flash_display_TriangleCulling); dict_init2(&flash_display_TriangleCulling.members, &memberinfo_type, 8); - dict_put(&flash_display_TriangleCulling.members, &flash_display_TriangleCulling_POSITIVE, &flash_display_TriangleCulling_POSITIVE); - dict_put(&flash_display_TriangleCulling.members, &flash_display_TriangleCulling_NEGATIVE, &flash_display_TriangleCulling_NEGATIVE); - dict_put(&flash_display_TriangleCulling.members, &flash_display_TriangleCulling_NONE, &flash_display_TriangleCulling_NONE); + dict_init2(&flash_display_TriangleCulling.static_members, &memberinfo_type, 8); + dict_put(&flash_display_TriangleCulling.static_members, &flash_display_TriangleCulling_POSITIVE, &flash_display_TriangleCulling_POSITIVE); + dict_put(&flash_display_TriangleCulling.static_members, &flash_display_TriangleCulling_NEGATIVE, &flash_display_TriangleCulling_NEGATIVE); + dict_put(&flash_display_TriangleCulling.static_members, &flash_display_TriangleCulling_NONE, &flash_display_TriangleCulling_NONE); dict_put(d, &flash_media_SoundMixer, &flash_media_SoundMixer); dict_init2(&flash_media_SoundMixer.members, &memberinfo_type, 8); - dict_put(&flash_media_SoundMixer.members, &flash_media_SoundMixer_computeSpectrum, &flash_media_SoundMixer_computeSpectrum); - dict_put(&flash_media_SoundMixer.members, &flash_media_SoundMixer_areSoundsInaccessible, &flash_media_SoundMixer_areSoundsInaccessible); - dict_put(&flash_media_SoundMixer.members, &flash_media_SoundMixer_soundTransform, &flash_media_SoundMixer_soundTransform); - dict_put(&flash_media_SoundMixer.members, &flash_media_SoundMixer_bufferTime, &flash_media_SoundMixer_bufferTime); - dict_put(&flash_media_SoundMixer.members, &flash_media_SoundMixer_stopAll, &flash_media_SoundMixer_stopAll); + dict_init2(&flash_media_SoundMixer.static_members, &memberinfo_type, 8); + dict_put(&flash_media_SoundMixer.static_members, &flash_media_SoundMixer_computeSpectrum, &flash_media_SoundMixer_computeSpectrum); + dict_put(&flash_media_SoundMixer.static_members, &flash_media_SoundMixer_areSoundsInaccessible, &flash_media_SoundMixer_areSoundsInaccessible); + dict_put(&flash_media_SoundMixer.static_members, &flash_media_SoundMixer_soundTransform, &flash_media_SoundMixer_soundTransform); + dict_put(&flash_media_SoundMixer.static_members, &flash_media_SoundMixer_bufferTime, &flash_media_SoundMixer_bufferTime); + dict_put(&flash_media_SoundMixer.static_members, &flash_media_SoundMixer_stopAll, &flash_media_SoundMixer_stopAll); dict_put(d, &adobe_utils_XMLUI, &adobe_utils_XMLUI); dict_init2(&adobe_utils_XMLUI.members, &memberinfo_type, 8); - dict_put(&adobe_utils_XMLUI.members, &adobe_utils_XMLUI_cancel, &adobe_utils_XMLUI_cancel); - dict_put(&adobe_utils_XMLUI.members, &adobe_utils_XMLUI_setProperty, &adobe_utils_XMLUI_setProperty); - dict_put(&adobe_utils_XMLUI.members, &adobe_utils_XMLUI_getProperty, &adobe_utils_XMLUI_getProperty); - dict_put(&adobe_utils_XMLUI.members, &adobe_utils_XMLUI_accept, &adobe_utils_XMLUI_accept); + dict_init2(&adobe_utils_XMLUI.static_members, &memberinfo_type, 8); + dict_put(&adobe_utils_XMLUI.static_members, &adobe_utils_XMLUI_cancel, &adobe_utils_XMLUI_cancel); + dict_put(&adobe_utils_XMLUI.static_members, &adobe_utils_XMLUI_setProperty, &adobe_utils_XMLUI_setProperty); + dict_put(&adobe_utils_XMLUI.static_members, &adobe_utils_XMLUI_getProperty, &adobe_utils_XMLUI_getProperty); + dict_put(&adobe_utils_XMLUI.static_members, &adobe_utils_XMLUI_accept, &adobe_utils_XMLUI_accept); dict_put(d, &_escape, &_escape); dict_put(d, &flash_utils_setInterval, &flash_utils_setInterval); dict_put(d, &flash_events_StatusEvent, &flash_events_StatusEvent); dict_init2(&flash_events_StatusEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_StatusEvent.members, &flash_events_StatusEvent_STATUS, &flash_events_StatusEvent_STATUS); + dict_init2(&flash_events_StatusEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_StatusEvent.members, &flash_events_StatusEvent_toString, &flash_events_StatusEvent_toString); dict_put(&flash_events_StatusEvent.members, &flash_events_StatusEvent_code, &flash_events_StatusEvent_code); dict_put(&flash_events_StatusEvent.members, &flash_events_StatusEvent_clone, &flash_events_StatusEvent_clone); dict_put(&flash_events_StatusEvent.members, &flash_events_StatusEvent_level, &flash_events_StatusEvent_level); + dict_put(&flash_events_StatusEvent.static_members, &flash_events_StatusEvent_STATUS, &flash_events_StatusEvent_STATUS); dict_put(d, &flash_display_IGraphicsPath, &flash_display_IGraphicsPath); dict_init2(&flash_display_IGraphicsPath.members, &memberinfo_type, 8); + dict_init2(&flash_display_IGraphicsPath.static_members, &memberinfo_type, 8); dict_put(d, &flash_events_ShaderEvent, &flash_events_ShaderEvent); dict_init2(&flash_events_ShaderEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_ShaderEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_ShaderEvent.members, &flash_events_ShaderEvent_vector, &flash_events_ShaderEvent_vector); dict_put(&flash_events_ShaderEvent.members, &flash_events_ShaderEvent_toString, &flash_events_ShaderEvent_toString); dict_put(&flash_events_ShaderEvent.members, &flash_events_ShaderEvent_bitmapData, &flash_events_ShaderEvent_bitmapData); dict_put(&flash_events_ShaderEvent.members, &flash_events_ShaderEvent_clone, &flash_events_ShaderEvent_clone); - dict_put(&flash_events_ShaderEvent.members, &flash_events_ShaderEvent_COMPLETE, &flash_events_ShaderEvent_COMPLETE); dict_put(&flash_events_ShaderEvent.members, &flash_events_ShaderEvent_byteArray, &flash_events_ShaderEvent_byteArray); + dict_put(&flash_events_ShaderEvent.static_members, &flash_events_ShaderEvent_COMPLETE, &flash_events_ShaderEvent_COMPLETE); dict_put(d, &flash_display_Shader, &flash_display_Shader); dict_init2(&flash_display_Shader.members, &memberinfo_type, 8); + dict_init2(&flash_display_Shader.static_members, &memberinfo_type, 8); dict_put(&flash_display_Shader.members, &flash_display_Shader_precisionHint, &flash_display_Shader_precisionHint); dict_put(&flash_display_Shader.members, &flash_display_Shader_data, &flash_display_Shader_data); dict_put(d, &flash_errors_StackOverflowError, &flash_errors_StackOverflowError); dict_init2(&flash_errors_StackOverflowError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_StackOverflowError.static_members, &memberinfo_type, 8); dict_put(d, &flash_sampler_getInvocationCount, &flash_sampler_getInvocationCount); dict_put(d, &flash_text_engine_Kerning, &flash_text_engine_Kerning); dict_init2(&flash_text_engine_Kerning.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_Kerning.members, &flash_text_engine_Kerning_AUTO, &flash_text_engine_Kerning_AUTO); - dict_put(&flash_text_engine_Kerning.members, &flash_text_engine_Kerning_OFF, &flash_text_engine_Kerning_OFF); - dict_put(&flash_text_engine_Kerning.members, &flash_text_engine_Kerning_ON, &flash_text_engine_Kerning_ON); + dict_init2(&flash_text_engine_Kerning.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_Kerning.static_members, &flash_text_engine_Kerning_AUTO, &flash_text_engine_Kerning_AUTO); + dict_put(&flash_text_engine_Kerning.static_members, &flash_text_engine_Kerning_OFF, &flash_text_engine_Kerning_OFF); + dict_put(&flash_text_engine_Kerning.static_members, &flash_text_engine_Kerning_ON, &flash_text_engine_Kerning_ON); dict_put(d, &flash_text_CSMSettings, &flash_text_CSMSettings); dict_init2(&flash_text_CSMSettings.members, &memberinfo_type, 8); + dict_init2(&flash_text_CSMSettings.static_members, &memberinfo_type, 8); dict_put(&flash_text_CSMSettings.members, &flash_text_CSMSettings_fontSize, &flash_text_CSMSettings_fontSize); dict_put(&flash_text_CSMSettings.members, &flash_text_CSMSettings_outsideCutoff, &flash_text_CSMSettings_outsideCutoff); dict_put(&flash_text_CSMSettings.members, &flash_text_CSMSettings_insideCutoff, &flash_text_CSMSettings_insideCutoff); dict_put(d, &_RangeError, &_RangeError); dict_init2(&_RangeError.members, &memberinfo_type, 8); - dict_put(&_RangeError.members, &_RangeError_length, &_RangeError_length); + dict_init2(&_RangeError.static_members, &memberinfo_type, 8); + dict_put(&_RangeError.static_members, &_RangeError_length, &_RangeError_length); dict_put(d, &_Number, &_Number); dict_init2(&_Number.members, &memberinfo_type, 8); - dict_put(&_Number.members, &_Number_MAX_VALUE, &_Number_MAX_VALUE); + dict_init2(&_Number.static_members, &memberinfo_type, 8); dict_put(&_Number.members, &_Number_valueOf, &_Number_valueOf); - dict_put(&_Number.members, &_Number_length, &_Number_length); - dict_put(&_Number.members, &_Number_MIN_VALUE, &_Number_MIN_VALUE); dict_put(&_Number.members, &_Number_toString, &_Number_toString); - dict_put(&_Number.members, &_Number_NaN, &_Number_NaN); - dict_put(&_Number.members, &_Number_POSITIVE_INFINITY, &_Number_POSITIVE_INFINITY); dict_put(&_Number.members, &_Number_toExponential, &_Number_toExponential); dict_put(&_Number.members, &_Number_toFixed, &_Number_toFixed); - dict_put(&_Number.members, &_Number_NEGATIVE_INFINITY, &_Number_NEGATIVE_INFINITY); dict_put(&_Number.members, &_Number_toPrecision, &_Number_toPrecision); + dict_put(&_Number.static_members, &_Number_MAX_VALUE, &_Number_MAX_VALUE); + dict_put(&_Number.static_members, &_Number_length, &_Number_length); + dict_put(&_Number.static_members, &_Number_MIN_VALUE, &_Number_MIN_VALUE); + dict_put(&_Number.static_members, &_Number_NaN, &_Number_NaN); + dict_put(&_Number.static_members, &_Number_POSITIVE_INFINITY, &_Number_POSITIVE_INFINITY); + dict_put(&_Number.static_members, &_Number_NEGATIVE_INFINITY, &_Number_NEGATIVE_INFINITY); dict_put(d, &flash_display_Graphics, &flash_display_Graphics); dict_init2(&flash_display_Graphics.members, &memberinfo_type, 63); + dict_init2(&flash_display_Graphics.static_members, &memberinfo_type, 8); dict_put(&flash_display_Graphics.members, &flash_display_Graphics_drawPath, &flash_display_Graphics_drawPath); dict_put(&flash_display_Graphics.members, &flash_display_Graphics_drawEllipse, &flash_display_Graphics_drawEllipse); dict_put(&flash_display_Graphics.members, &flash_display_Graphics_drawRoundRectComplex, &flash_display_Graphics_drawRoundRectComplex); @@ -7052,27 +8179,31 @@ dict_put(&flash_display_Graphics.members, &flash_display_Graphics_drawRect, &flash_display_Graphics_drawRect); dict_put(d, &_SyntaxError, &_SyntaxError); dict_init2(&_SyntaxError.members, &memberinfo_type, 8); - dict_put(&_SyntaxError.members, &_SyntaxError_length, &_SyntaxError_length); + dict_init2(&_SyntaxError.static_members, &memberinfo_type, 8); + dict_put(&_SyntaxError.static_members, &_SyntaxError_length, &_SyntaxError_length); dict_put(d, &flash_sampler_NewObjectSample, &flash_sampler_NewObjectSample); dict_init2(&flash_sampler_NewObjectSample.members, &memberinfo_type, 8); + dict_init2(&flash_sampler_NewObjectSample.static_members, &memberinfo_type, 8); dict_put(&flash_sampler_NewObjectSample.members, &flash_sampler_NewObjectSample_type, &flash_sampler_NewObjectSample_type); dict_put(&flash_sampler_NewObjectSample.members, &flash_sampler_NewObjectSample_object, &flash_sampler_NewObjectSample_object); dict_put(&flash_sampler_NewObjectSample.members, &flash_sampler_NewObjectSample_id, &flash_sampler_NewObjectSample_id); dict_put(d, &flash_net_FileFilter, &flash_net_FileFilter); dict_init2(&flash_net_FileFilter.members, &memberinfo_type, 8); + dict_init2(&flash_net_FileFilter.static_members, &memberinfo_type, 8); dict_put(&flash_net_FileFilter.members, &flash_net_FileFilter_extension, &flash_net_FileFilter_extension); dict_put(&flash_net_FileFilter.members, &flash_net_FileFilter_description, &flash_net_FileFilter_description); dict_put(&flash_net_FileFilter.members, &flash_net_FileFilter_macType, &flash_net_FileFilter_macType); dict_put(d, &flash_display_BitmapDataChannel, &flash_display_BitmapDataChannel); dict_init2(&flash_display_BitmapDataChannel.members, &memberinfo_type, 8); - dict_put(&flash_display_BitmapDataChannel.members, &flash_display_BitmapDataChannel_BLUE, &flash_display_BitmapDataChannel_BLUE); - dict_put(&flash_display_BitmapDataChannel.members, &flash_display_BitmapDataChannel_GREEN, &flash_display_BitmapDataChannel_GREEN); - dict_put(&flash_display_BitmapDataChannel.members, &flash_display_BitmapDataChannel_ALPHA, &flash_display_BitmapDataChannel_ALPHA); - dict_put(&flash_display_BitmapDataChannel.members, &flash_display_BitmapDataChannel_RED, &flash_display_BitmapDataChannel_RED); + dict_init2(&flash_display_BitmapDataChannel.static_members, &memberinfo_type, 8); + dict_put(&flash_display_BitmapDataChannel.static_members, &flash_display_BitmapDataChannel_BLUE, &flash_display_BitmapDataChannel_BLUE); + dict_put(&flash_display_BitmapDataChannel.static_members, &flash_display_BitmapDataChannel_GREEN, &flash_display_BitmapDataChannel_GREEN); + dict_put(&flash_display_BitmapDataChannel.static_members, &flash_display_BitmapDataChannel_ALPHA, &flash_display_BitmapDataChannel_ALPHA); + dict_put(&flash_display_BitmapDataChannel.static_members, &flash_display_BitmapDataChannel_RED, &flash_display_BitmapDataChannel_RED); dict_put(d, &flash_utils_clearInterval, &flash_utils_clearInterval); dict_put(d, &flash_text_engine_ContentElement, &flash_text_engine_ContentElement); dict_init2(&flash_text_engine_ContentElement.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_GRAPHIC_ELEMENT, &flash_text_engine_ContentElement_GRAPHIC_ELEMENT); + dict_init2(&flash_text_engine_ContentElement.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_eventMirror, &flash_text_engine_ContentElement_eventMirror); dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_groupElement, &flash_text_engine_ContentElement_groupElement); dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_textRotation, &flash_text_engine_ContentElement_textRotation); @@ -7082,21 +8213,25 @@ dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_textBlock, &flash_text_engine_ContentElement_textBlock); dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_rawText, &flash_text_engine_ContentElement_rawText); dict_put(&flash_text_engine_ContentElement.members, &flash_text_engine_ContentElement_textBlockBeginIndex, &flash_text_engine_ContentElement_textBlockBeginIndex); + dict_put(&flash_text_engine_ContentElement.static_members, &flash_text_engine_ContentElement_GRAPHIC_ELEMENT, &flash_text_engine_ContentElement_GRAPHIC_ELEMENT); dict_put(d, &flash_utils_Endian, &flash_utils_Endian); dict_init2(&flash_utils_Endian.members, &memberinfo_type, 8); - dict_put(&flash_utils_Endian.members, &flash_utils_Endian_LITTLE_ENDIAN, &flash_utils_Endian_LITTLE_ENDIAN); - dict_put(&flash_utils_Endian.members, &flash_utils_Endian_BIG_ENDIAN, &flash_utils_Endian_BIG_ENDIAN); + dict_init2(&flash_utils_Endian.static_members, &memberinfo_type, 8); + dict_put(&flash_utils_Endian.static_members, &flash_utils_Endian_LITTLE_ENDIAN, &flash_utils_Endian_LITTLE_ENDIAN); + dict_put(&flash_utils_Endian.static_members, &flash_utils_Endian_BIG_ENDIAN, &flash_utils_Endian_BIG_ENDIAN); dict_put(d, &flash_net_navigateToURL, &flash_net_navigateToURL); dict_put(d, &flash_events_ProgressEvent, &flash_events_ProgressEvent); dict_init2(&flash_events_ProgressEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_ProgressEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_ProgressEvent.members, &flash_events_ProgressEvent_bytesLoaded, &flash_events_ProgressEvent_bytesLoaded); dict_put(&flash_events_ProgressEvent.members, &flash_events_ProgressEvent_toString, &flash_events_ProgressEvent_toString); - dict_put(&flash_events_ProgressEvent.members, &flash_events_ProgressEvent_PROGRESS, &flash_events_ProgressEvent_PROGRESS); dict_put(&flash_events_ProgressEvent.members, &flash_events_ProgressEvent_bytesTotal, &flash_events_ProgressEvent_bytesTotal); dict_put(&flash_events_ProgressEvent.members, &flash_events_ProgressEvent_clone, &flash_events_ProgressEvent_clone); - dict_put(&flash_events_ProgressEvent.members, &flash_events_ProgressEvent_SOCKET_DATA, &flash_events_ProgressEvent_SOCKET_DATA); + dict_put(&flash_events_ProgressEvent.static_members, &flash_events_ProgressEvent_PROGRESS, &flash_events_ProgressEvent_PROGRESS); + dict_put(&flash_events_ProgressEvent.static_members, &flash_events_ProgressEvent_SOCKET_DATA, &flash_events_ProgressEvent_SOCKET_DATA); dict_put(d, &flash_media_Sound, &flash_media_Sound); dict_init2(&flash_media_Sound.members, &memberinfo_type, 15); + dict_init2(&flash_media_Sound.static_members, &memberinfo_type, 8); dict_put(&flash_media_Sound.members, &flash_media_Sound_extract, &flash_media_Sound_extract); dict_put(&flash_media_Sound.members, &flash_media_Sound_bytesLoaded, &flash_media_Sound_bytesLoaded); dict_put(&flash_media_Sound.members, &flash_media_Sound_id3, &flash_media_Sound_id3); @@ -7109,6 +8244,7 @@ dict_put(&flash_media_Sound.members, &flash_media_Sound_close, &flash_media_Sound_close); dict_put(d, &flash_text_TextExtent, &flash_text_TextExtent); dict_init2(&flash_text_TextExtent.members, &memberinfo_type, 8); + dict_init2(&flash_text_TextExtent.static_members, &memberinfo_type, 8); dict_put(&flash_text_TextExtent.members, &flash_text_TextExtent_descent, &flash_text_TextExtent_descent); dict_put(&flash_text_TextExtent.members, &flash_text_TextExtent_width, &flash_text_TextExtent_width); dict_put(&flash_text_TextExtent.members, &flash_text_TextExtent_ascent, &flash_text_TextExtent_ascent); @@ -7117,12 +8253,14 @@ dict_put(&flash_text_TextExtent.members, &flash_text_TextExtent_height, &flash_text_TextExtent_height); dict_put(d, &flash_text_FontStyle, &flash_text_FontStyle); dict_init2(&flash_text_FontStyle.members, &memberinfo_type, 8); - dict_put(&flash_text_FontStyle.members, &flash_text_FontStyle_REGULAR, &flash_text_FontStyle_REGULAR); - dict_put(&flash_text_FontStyle.members, &flash_text_FontStyle_BOLD, &flash_text_FontStyle_BOLD); - dict_put(&flash_text_FontStyle.members, &flash_text_FontStyle_BOLD_ITALIC, &flash_text_FontStyle_BOLD_ITALIC); - dict_put(&flash_text_FontStyle.members, &flash_text_FontStyle_ITALIC, &flash_text_FontStyle_ITALIC); + dict_init2(&flash_text_FontStyle.static_members, &memberinfo_type, 8); + dict_put(&flash_text_FontStyle.static_members, &flash_text_FontStyle_REGULAR, &flash_text_FontStyle_REGULAR); + dict_put(&flash_text_FontStyle.static_members, &flash_text_FontStyle_BOLD, &flash_text_FontStyle_BOLD); + dict_put(&flash_text_FontStyle.static_members, &flash_text_FontStyle_BOLD_ITALIC, &flash_text_FontStyle_BOLD_ITALIC); + dict_put(&flash_text_FontStyle.static_members, &flash_text_FontStyle_ITALIC, &flash_text_FontStyle_ITALIC); dict_put(d, &flash_text_engine_TextLineMirrorRegion, &flash_text_engine_TextLineMirrorRegion); dict_init2(&flash_text_engine_TextLineMirrorRegion.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_TextLineMirrorRegion.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_TextLineMirrorRegion.members, &flash_text_engine_TextLineMirrorRegion_mirror, &flash_text_engine_TextLineMirrorRegion_mirror); dict_put(&flash_text_engine_TextLineMirrorRegion.members, &flash_text_engine_TextLineMirrorRegion_previousRegion, &flash_text_engine_TextLineMirrorRegion_previousRegion); dict_put(&flash_text_engine_TextLineMirrorRegion.members, &flash_text_engine_TextLineMirrorRegion_bounds, &flash_text_engine_TextLineMirrorRegion_bounds); @@ -7131,16 +8269,14 @@ dict_put(&flash_text_engine_TextLineMirrorRegion.members, &flash_text_engine_TextLineMirrorRegion_textLine, &flash_text_engine_TextLineMirrorRegion_textLine); dict_put(d, &flash_geom_Vector3D, &flash_geom_Vector3D); dict_init2(&flash_geom_Vector3D.members, &memberinfo_type, 31); + dict_init2(&flash_geom_Vector3D.static_members, &memberinfo_type, 8); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_subtract, &flash_geom_Vector3D_subtract); - dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_distance, &flash_geom_Vector3D_distance); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_scaleBy, &flash_geom_Vector3D_scaleBy); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_decrementBy, &flash_geom_Vector3D_decrementBy); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_equals, &flash_geom_Vector3D_equals); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_normalize, &flash_geom_Vector3D_normalize); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_dotProduct, &flash_geom_Vector3D_dotProduct); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_negate, &flash_geom_Vector3D_negate); - dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_X_AXIS, &flash_geom_Vector3D_X_AXIS); - dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_angleBetween, &flash_geom_Vector3D_angleBetween); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_toString, &flash_geom_Vector3D_toString); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_lengthSquared, &flash_geom_Vector3D_lengthSquared); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_x, &flash_geom_Vector3D_x); @@ -7148,42 +8284,50 @@ dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_w, &flash_geom_Vector3D_w); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_z, &flash_geom_Vector3D_z); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_add, &flash_geom_Vector3D_add); - dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_Z_AXIS, &flash_geom_Vector3D_Z_AXIS); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_project, &flash_geom_Vector3D_project); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_crossProduct, &flash_geom_Vector3D_crossProduct); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_nearEquals, &flash_geom_Vector3D_nearEquals); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_clone, &flash_geom_Vector3D_clone); - dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_Y_AXIS, &flash_geom_Vector3D_Y_AXIS); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_y, &flash_geom_Vector3D_y); dict_put(&flash_geom_Vector3D.members, &flash_geom_Vector3D_length, &flash_geom_Vector3D_length); + dict_put(&flash_geom_Vector3D.static_members, &flash_geom_Vector3D_distance, &flash_geom_Vector3D_distance); + dict_put(&flash_geom_Vector3D.static_members, &flash_geom_Vector3D_Z_AXIS, &flash_geom_Vector3D_Z_AXIS); + dict_put(&flash_geom_Vector3D.static_members, &flash_geom_Vector3D_X_AXIS, &flash_geom_Vector3D_X_AXIS); + dict_put(&flash_geom_Vector3D.static_members, &flash_geom_Vector3D_angleBetween, &flash_geom_Vector3D_angleBetween); + dict_put(&flash_geom_Vector3D.static_members, &flash_geom_Vector3D_Y_AXIS, &flash_geom_Vector3D_Y_AXIS); dict_put(d, &flash_desktop_ClipboardTransferMode, &flash_desktop_ClipboardTransferMode); dict_init2(&flash_desktop_ClipboardTransferMode.members, &memberinfo_type, 8); - dict_put(&flash_desktop_ClipboardTransferMode.members, &flash_desktop_ClipboardTransferMode_CLONE_ONLY, &flash_desktop_ClipboardTransferMode_CLONE_ONLY); - dict_put(&flash_desktop_ClipboardTransferMode.members, &flash_desktop_ClipboardTransferMode_ORIGINAL_PREFERRED, &flash_desktop_ClipboardTransferMode_ORIGINAL_PREFERRED); - dict_put(&flash_desktop_ClipboardTransferMode.members, &flash_desktop_ClipboardTransferMode_CLONE_PREFERRED, &flash_desktop_ClipboardTransferMode_CLONE_PREFERRED); - dict_put(&flash_desktop_ClipboardTransferMode.members, &flash_desktop_ClipboardTransferMode_ORIGINAL_ONLY, &flash_desktop_ClipboardTransferMode_ORIGINAL_ONLY); + dict_init2(&flash_desktop_ClipboardTransferMode.static_members, &memberinfo_type, 8); + dict_put(&flash_desktop_ClipboardTransferMode.static_members, &flash_desktop_ClipboardTransferMode_CLONE_ONLY, &flash_desktop_ClipboardTransferMode_CLONE_ONLY); + dict_put(&flash_desktop_ClipboardTransferMode.static_members, &flash_desktop_ClipboardTransferMode_ORIGINAL_PREFERRED, &flash_desktop_ClipboardTransferMode_ORIGINAL_PREFERRED); + dict_put(&flash_desktop_ClipboardTransferMode.static_members, &flash_desktop_ClipboardTransferMode_CLONE_PREFERRED, &flash_desktop_ClipboardTransferMode_CLONE_PREFERRED); + dict_put(&flash_desktop_ClipboardTransferMode.static_members, &flash_desktop_ClipboardTransferMode_ORIGINAL_ONLY, &flash_desktop_ClipboardTransferMode_ORIGINAL_ONLY); dict_put(d, &flash_display_SpreadMethod, &flash_display_SpreadMethod); dict_init2(&flash_display_SpreadMethod.members, &memberinfo_type, 8); - dict_put(&flash_display_SpreadMethod.members, &flash_display_SpreadMethod_REFLECT, &flash_display_SpreadMethod_REFLECT); - dict_put(&flash_display_SpreadMethod.members, &flash_display_SpreadMethod_REPEAT, &flash_display_SpreadMethod_REPEAT); - dict_put(&flash_display_SpreadMethod.members, &flash_display_SpreadMethod_PAD, &flash_display_SpreadMethod_PAD); + dict_init2(&flash_display_SpreadMethod.static_members, &memberinfo_type, 8); + dict_put(&flash_display_SpreadMethod.static_members, &flash_display_SpreadMethod_REFLECT, &flash_display_SpreadMethod_REFLECT); + dict_put(&flash_display_SpreadMethod.static_members, &flash_display_SpreadMethod_REPEAT, &flash_display_SpreadMethod_REPEAT); + dict_put(&flash_display_SpreadMethod.static_members, &flash_display_SpreadMethod_PAD, &flash_display_SpreadMethod_PAD); dict_put(d, &flash_system_SecurityPanel, &flash_system_SecurityPanel); dict_init2(&flash_system_SecurityPanel.members, &memberinfo_type, 8); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_LOCAL_STORAGE, &flash_system_SecurityPanel_LOCAL_STORAGE); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_CAMERA, &flash_system_SecurityPanel_CAMERA); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_DEFAULT, &flash_system_SecurityPanel_DEFAULT); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_SETTINGS_MANAGER, &flash_system_SecurityPanel_SETTINGS_MANAGER); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_PRIVACY, &flash_system_SecurityPanel_PRIVACY); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_MICROPHONE, &flash_system_SecurityPanel_MICROPHONE); - dict_put(&flash_system_SecurityPanel.members, &flash_system_SecurityPanel_DISPLAY, &flash_system_SecurityPanel_DISPLAY); + dict_init2(&flash_system_SecurityPanel.static_members, &memberinfo_type, 8); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_LOCAL_STORAGE, &flash_system_SecurityPanel_LOCAL_STORAGE); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_CAMERA, &flash_system_SecurityPanel_CAMERA); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_DEFAULT, &flash_system_SecurityPanel_DEFAULT); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_SETTINGS_MANAGER, &flash_system_SecurityPanel_SETTINGS_MANAGER); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_PRIVACY, &flash_system_SecurityPanel_PRIVACY); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_MICROPHONE, &flash_system_SecurityPanel_MICROPHONE); + dict_put(&flash_system_SecurityPanel.static_members, &flash_system_SecurityPanel_DISPLAY, &flash_system_SecurityPanel_DISPLAY); dict_put(d, &flash_events_HTTPStatusEvent, &flash_events_HTTPStatusEvent); dict_init2(&flash_events_HTTPStatusEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_HTTPStatusEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_HTTPStatusEvent.members, &flash_events_HTTPStatusEvent_toString, &flash_events_HTTPStatusEvent_toString); - dict_put(&flash_events_HTTPStatusEvent.members, &flash_events_HTTPStatusEvent_HTTP_STATUS, &flash_events_HTTPStatusEvent_HTTP_STATUS); dict_put(&flash_events_HTTPStatusEvent.members, &flash_events_HTTPStatusEvent_clone, &flash_events_HTTPStatusEvent_clone); dict_put(&flash_events_HTTPStatusEvent.members, &flash_events_HTTPStatusEvent_status, &flash_events_HTTPStatusEvent_status); + dict_put(&flash_events_HTTPStatusEvent.static_members, &flash_events_HTTPStatusEvent_HTTP_STATUS, &flash_events_HTTPStatusEvent_HTTP_STATUS); dict_put(d, &flash_net_NetStreamPlayOptions, &flash_net_NetStreamPlayOptions); dict_init2(&flash_net_NetStreamPlayOptions.members, &memberinfo_type, 8); + dict_init2(&flash_net_NetStreamPlayOptions.static_members, &memberinfo_type, 8); dict_put(&flash_net_NetStreamPlayOptions.members, &flash_net_NetStreamPlayOptions_len, &flash_net_NetStreamPlayOptions_len); dict_put(&flash_net_NetStreamPlayOptions.members, &flash_net_NetStreamPlayOptions_streamName, &flash_net_NetStreamPlayOptions_streamName); dict_put(&flash_net_NetStreamPlayOptions.members, &flash_net_NetStreamPlayOptions_start, &flash_net_NetStreamPlayOptions_start); @@ -7191,8 +8335,10 @@ dict_put(&flash_net_NetStreamPlayOptions.members, &flash_net_NetStreamPlayOptions_transition, &flash_net_NetStreamPlayOptions_transition); dict_put(d, &flash_net_Responder, &flash_net_Responder); dict_init2(&flash_net_Responder.members, &memberinfo_type, 8); + dict_init2(&flash_net_Responder.static_members, &memberinfo_type, 8); dict_put(d, &flash_net_XMLSocket, &flash_net_XMLSocket); dict_init2(&flash_net_XMLSocket.members, &memberinfo_type, 8); + dict_init2(&flash_net_XMLSocket.static_members, &memberinfo_type, 8); dict_put(&flash_net_XMLSocket.members, &flash_net_XMLSocket_close, &flash_net_XMLSocket_close); dict_put(&flash_net_XMLSocket.members, &flash_net_XMLSocket_connect, &flash_net_XMLSocket_connect); dict_put(&flash_net_XMLSocket.members, &flash_net_XMLSocket_send, &flash_net_XMLSocket_send); @@ -7200,6 +8346,7 @@ dict_put(&flash_net_XMLSocket.members, &flash_net_XMLSocket_timeout, &flash_net_XMLSocket_timeout); dict_put(d, &flash_filters_ConvolutionFilter, &flash_filters_ConvolutionFilter); dict_init2(&flash_filters_ConvolutionFilter.members, &memberinfo_type, 15); + dict_init2(&flash_filters_ConvolutionFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_ConvolutionFilter.members, &flash_filters_ConvolutionFilter_alpha, &flash_filters_ConvolutionFilter_alpha); dict_put(&flash_filters_ConvolutionFilter.members, &flash_filters_ConvolutionFilter_matrixX, &flash_filters_ConvolutionFilter_matrixX); dict_put(&flash_filters_ConvolutionFilter.members, &flash_filters_ConvolutionFilter_matrix, &flash_filters_ConvolutionFilter_matrix); @@ -7212,6 +8359,7 @@ dict_put(&flash_filters_ConvolutionFilter.members, &flash_filters_ConvolutionFilter_matrixY, &flash_filters_ConvolutionFilter_matrixY); dict_put(d, &flash_text_engine_ElementFormat, &flash_text_engine_ElementFormat); dict_init2(&flash_text_engine_ElementFormat.members, &memberinfo_type, 31); + dict_init2(&flash_text_engine_ElementFormat.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_ElementFormat.members, &flash_text_engine_ElementFormat_getFontMetrics, &flash_text_engine_ElementFormat_getFontMetrics); dict_put(&flash_text_engine_ElementFormat.members, &flash_text_engine_ElementFormat_digitCase, &flash_text_engine_ElementFormat_digitCase); dict_put(&flash_text_engine_ElementFormat.members, &flash_text_engine_ElementFormat_breakOpportunity, &flash_text_engine_ElementFormat_breakOpportunity); @@ -7234,6 +8382,7 @@ dict_put(&flash_text_engine_ElementFormat.members, &flash_text_engine_ElementFormat_trackingRight, &flash_text_engine_ElementFormat_trackingRight); dict_put(d, &flash_display_GraphicsGradientFill, &flash_display_GraphicsGradientFill); dict_init2(&flash_display_GraphicsGradientFill.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsGradientFill.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsGradientFill.members, &flash_display_GraphicsGradientFill_interpolationMethod, &flash_display_GraphicsGradientFill_interpolationMethod); dict_put(&flash_display_GraphicsGradientFill.members, &flash_display_GraphicsGradientFill_focalPointRatio, &flash_display_GraphicsGradientFill_focalPointRatio); dict_put(&flash_display_GraphicsGradientFill.members, &flash_display_GraphicsGradientFill_colors, &flash_display_GraphicsGradientFill_colors); @@ -7244,10 +8393,12 @@ dict_put(&flash_display_GraphicsGradientFill.members, &flash_display_GraphicsGradientFill_alphas, &flash_display_GraphicsGradientFill_alphas); dict_put(d, &flash_display_FrameLabel, &flash_display_FrameLabel); dict_init2(&flash_display_FrameLabel.members, &memberinfo_type, 8); + dict_init2(&flash_display_FrameLabel.static_members, &memberinfo_type, 8); dict_put(&flash_display_FrameLabel.members, &flash_display_FrameLabel_frame, &flash_display_FrameLabel_frame); dict_put(&flash_display_FrameLabel.members, &flash_display_FrameLabel_name, &flash_display_FrameLabel_name); dict_put(d, &flash_media_SoundTransform, &flash_media_SoundTransform); dict_init2(&flash_media_SoundTransform.members, &memberinfo_type, 8); + dict_init2(&flash_media_SoundTransform.static_members, &memberinfo_type, 8); dict_put(&flash_media_SoundTransform.members, &flash_media_SoundTransform_pan, &flash_media_SoundTransform_pan); dict_put(&flash_media_SoundTransform.members, &flash_media_SoundTransform_leftToRight, &flash_media_SoundTransform_leftToRight); dict_put(&flash_media_SoundTransform.members, &flash_media_SoundTransform_rightToLeft, &flash_media_SoundTransform_rightToLeft); @@ -7257,6 +8408,7 @@ dict_put(d, &_AS3, &_AS3); dict_put(d, &flash_net_LocalConnection, &flash_net_LocalConnection); dict_init2(&flash_net_LocalConnection.members, &memberinfo_type, 15); + dict_init2(&flash_net_LocalConnection.static_members, &memberinfo_type, 8); dict_put(&flash_net_LocalConnection.members, &flash_net_LocalConnection_client, &flash_net_LocalConnection_client); dict_put(&flash_net_LocalConnection.members, &flash_net_LocalConnection_allowDomain, &flash_net_LocalConnection_allowDomain); dict_put(&flash_net_LocalConnection.members, &flash_net_LocalConnection_connect, &flash_net_LocalConnection_connect); @@ -7265,67 +8417,77 @@ dict_put(&flash_net_LocalConnection.members, &flash_net_LocalConnection_send, &flash_net_LocalConnection_send); dict_put(&flash_net_LocalConnection.members, &flash_net_LocalConnection_close, &flash_net_LocalConnection_close); dict_put(d, &flash_display_ShaderParameterType, &flash_display_ShaderParameterType); - dict_init2(&flash_display_ShaderParameterType.members, &memberinfo_type, 31); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_FLOAT, &flash_display_ShaderParameterType_FLOAT); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_BOOL, &flash_display_ShaderParameterType_BOOL); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_FLOAT2, &flash_display_ShaderParameterType_FLOAT2); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_MATRIX2X2, &flash_display_ShaderParameterType_MATRIX2X2); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_INT, &flash_display_ShaderParameterType_INT); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_INT4, &flash_display_ShaderParameterType_INT4); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_MATRIX4X4, &flash_display_ShaderParameterType_MATRIX4X4); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_FLOAT3, &flash_display_ShaderParameterType_FLOAT3); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_BOOL2, &flash_display_ShaderParameterType_BOOL2); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_INT3, &flash_display_ShaderParameterType_INT3); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_BOOL3, &flash_display_ShaderParameterType_BOOL3); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_BOOL4, &flash_display_ShaderParameterType_BOOL4); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_FLOAT4, &flash_display_ShaderParameterType_FLOAT4); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_INT2, &flash_display_ShaderParameterType_INT2); - dict_put(&flash_display_ShaderParameterType.members, &flash_display_ShaderParameterType_MATRIX3X3, &flash_display_ShaderParameterType_MATRIX3X3); + dict_init2(&flash_display_ShaderParameterType.members, &memberinfo_type, 8); + dict_init2(&flash_display_ShaderParameterType.static_members, &memberinfo_type, 31); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_FLOAT, &flash_display_ShaderParameterType_FLOAT); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_BOOL, &flash_display_ShaderParameterType_BOOL); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_FLOAT2, &flash_display_ShaderParameterType_FLOAT2); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_MATRIX2X2, &flash_display_ShaderParameterType_MATRIX2X2); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_INT, &flash_display_ShaderParameterType_INT); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_INT4, &flash_display_ShaderParameterType_INT4); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_MATRIX4X4, &flash_display_ShaderParameterType_MATRIX4X4); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_FLOAT3, &flash_display_ShaderParameterType_FLOAT3); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_BOOL2, &flash_display_ShaderParameterType_BOOL2); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_INT3, &flash_display_ShaderParameterType_INT3); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_BOOL3, &flash_display_ShaderParameterType_BOOL3); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_BOOL4, &flash_display_ShaderParameterType_BOOL4); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_FLOAT4, &flash_display_ShaderParameterType_FLOAT4); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_INT2, &flash_display_ShaderParameterType_INT2); + dict_put(&flash_display_ShaderParameterType.static_members, &flash_display_ShaderParameterType_MATRIX3X3, &flash_display_ShaderParameterType_MATRIX3X3); dict_put(d, &flash_events_IMEEvent, &flash_events_IMEEvent); dict_init2(&flash_events_IMEEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_IMEEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_IMEEvent.members, &flash_events_IMEEvent_toString, &flash_events_IMEEvent_toString); dict_put(&flash_events_IMEEvent.members, &flash_events_IMEEvent_clone, &flash_events_IMEEvent_clone); - dict_put(&flash_events_IMEEvent.members, &flash_events_IMEEvent_IME_COMPOSITION, &flash_events_IMEEvent_IME_COMPOSITION); + dict_put(&flash_events_IMEEvent.static_members, &flash_events_IMEEvent_IME_COMPOSITION, &flash_events_IMEEvent_IME_COMPOSITION); dict_put(d, &flash_text_TextFormatDisplay, &flash_text_TextFormatDisplay); dict_init2(&flash_text_TextFormatDisplay.members, &memberinfo_type, 8); - dict_put(&flash_text_TextFormatDisplay.members, &flash_text_TextFormatDisplay_INLINE, &flash_text_TextFormatDisplay_INLINE); - dict_put(&flash_text_TextFormatDisplay.members, &flash_text_TextFormatDisplay_BLOCK, &flash_text_TextFormatDisplay_BLOCK); + dict_init2(&flash_text_TextFormatDisplay.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextFormatDisplay.static_members, &flash_text_TextFormatDisplay_INLINE, &flash_text_TextFormatDisplay_INLINE); + dict_put(&flash_text_TextFormatDisplay.static_members, &flash_text_TextFormatDisplay_BLOCK, &flash_text_TextFormatDisplay_BLOCK); dict_put(d, &flash_profiler_profile, &flash_profiler_profile); dict_put(d, &flash_display_AVM1Movie, &flash_display_AVM1Movie); dict_init2(&flash_display_AVM1Movie.members, &memberinfo_type, 8); + dict_init2(&flash_display_AVM1Movie.static_members, &memberinfo_type, 8); dict_put(&flash_display_AVM1Movie.members, &flash_display_AVM1Movie_call, &flash_display_AVM1Movie_call); dict_put(&flash_display_AVM1Movie.members, &flash_display_AVM1Movie_addCallback, &flash_display_AVM1Movie_addCallback); dict_put(d, &flash_events_ContextMenuEvent, &flash_events_ContextMenuEvent); - dict_init2(&flash_events_ContextMenuEvent.members, &memberinfo_type, 15); - dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_isMouseTargetInaccessible, &flash_events_ContextMenuEvent_isMouseTargetInaccessible); + dict_init2(&flash_events_ContextMenuEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_ContextMenuEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_mouseTarget, &flash_events_ContextMenuEvent_mouseTarget); - dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_contextMenuOwner, &flash_events_ContextMenuEvent_contextMenuOwner); - dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_MENU_ITEM_SELECT, &flash_events_ContextMenuEvent_MENU_ITEM_SELECT); - dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_MENU_SELECT, &flash_events_ContextMenuEvent_MENU_SELECT); + dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_isMouseTargetInaccessible, &flash_events_ContextMenuEvent_isMouseTargetInaccessible); dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_toString, &flash_events_ContextMenuEvent_toString); + dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_contextMenuOwner, &flash_events_ContextMenuEvent_contextMenuOwner); dict_put(&flash_events_ContextMenuEvent.members, &flash_events_ContextMenuEvent_clone, &flash_events_ContextMenuEvent_clone); + dict_put(&flash_events_ContextMenuEvent.static_members, &flash_events_ContextMenuEvent_MENU_SELECT, &flash_events_ContextMenuEvent_MENU_SELECT); + dict_put(&flash_events_ContextMenuEvent.static_members, &flash_events_ContextMenuEvent_MENU_ITEM_SELECT, &flash_events_ContextMenuEvent_MENU_ITEM_SELECT); dict_put(d, &flash_events_EventPhase, &flash_events_EventPhase); dict_init2(&flash_events_EventPhase.members, &memberinfo_type, 8); - dict_put(&flash_events_EventPhase.members, &flash_events_EventPhase_BUBBLING_PHASE, &flash_events_EventPhase_BUBBLING_PHASE); - dict_put(&flash_events_EventPhase.members, &flash_events_EventPhase_CAPTURING_PHASE, &flash_events_EventPhase_CAPTURING_PHASE); - dict_put(&flash_events_EventPhase.members, &flash_events_EventPhase_AT_TARGET, &flash_events_EventPhase_AT_TARGET); + dict_init2(&flash_events_EventPhase.static_members, &memberinfo_type, 8); + dict_put(&flash_events_EventPhase.static_members, &flash_events_EventPhase_BUBBLING_PHASE, &flash_events_EventPhase_BUBBLING_PHASE); + dict_put(&flash_events_EventPhase.static_members, &flash_events_EventPhase_CAPTURING_PHASE, &flash_events_EventPhase_CAPTURING_PHASE); + dict_put(&flash_events_EventPhase.static_members, &flash_events_EventPhase_AT_TARGET, &flash_events_EventPhase_AT_TARGET); dict_put(d, &flash_display_JointStyle, &flash_display_JointStyle); dict_init2(&flash_display_JointStyle.members, &memberinfo_type, 8); - dict_put(&flash_display_JointStyle.members, &flash_display_JointStyle_ROUND, &flash_display_JointStyle_ROUND); - dict_put(&flash_display_JointStyle.members, &flash_display_JointStyle_MITER, &flash_display_JointStyle_MITER); - dict_put(&flash_display_JointStyle.members, &flash_display_JointStyle_BEVEL, &flash_display_JointStyle_BEVEL); + dict_init2(&flash_display_JointStyle.static_members, &memberinfo_type, 8); + dict_put(&flash_display_JointStyle.static_members, &flash_display_JointStyle_ROUND, &flash_display_JointStyle_ROUND); + dict_put(&flash_display_JointStyle.static_members, &flash_display_JointStyle_MITER, &flash_display_JointStyle_MITER); + dict_put(&flash_display_JointStyle.static_members, &flash_display_JointStyle_BEVEL, &flash_display_JointStyle_BEVEL); dict_put(d, &flash_utils_Dictionary, &flash_utils_Dictionary); dict_init2(&flash_utils_Dictionary.members, &memberinfo_type, 8); + dict_init2(&flash_utils_Dictionary.static_members, &memberinfo_type, 8); dict_put(d, &flash_display_GraphicsPathCommand, &flash_display_GraphicsPathCommand); dict_init2(&flash_display_GraphicsPathCommand.members, &memberinfo_type, 8); - dict_put(&flash_display_GraphicsPathCommand.members, &flash_display_GraphicsPathCommand_NO_OP, &flash_display_GraphicsPathCommand_NO_OP); - dict_put(&flash_display_GraphicsPathCommand.members, &flash_display_GraphicsPathCommand_MOVE_TO, &flash_display_GraphicsPathCommand_MOVE_TO); - dict_put(&flash_display_GraphicsPathCommand.members, &flash_display_GraphicsPathCommand_WIDE_MOVE_TO, &flash_display_GraphicsPathCommand_WIDE_MOVE_TO); - dict_put(&flash_display_GraphicsPathCommand.members, &flash_display_GraphicsPathCommand_CURVE_TO, &flash_display_GraphicsPathCommand_CURVE_TO); - dict_put(&flash_display_GraphicsPathCommand.members, &flash_display_GraphicsPathCommand_LINE_TO, &flash_display_GraphicsPathCommand_LINE_TO); - dict_put(&flash_display_GraphicsPathCommand.members, &flash_display_GraphicsPathCommand_WIDE_LINE_TO, &flash_display_GraphicsPathCommand_WIDE_LINE_TO); + dict_init2(&flash_display_GraphicsPathCommand.static_members, &memberinfo_type, 8); + dict_put(&flash_display_GraphicsPathCommand.static_members, &flash_display_GraphicsPathCommand_NO_OP, &flash_display_GraphicsPathCommand_NO_OP); + dict_put(&flash_display_GraphicsPathCommand.static_members, &flash_display_GraphicsPathCommand_MOVE_TO, &flash_display_GraphicsPathCommand_MOVE_TO); + dict_put(&flash_display_GraphicsPathCommand.static_members, &flash_display_GraphicsPathCommand_WIDE_MOVE_TO, &flash_display_GraphicsPathCommand_WIDE_MOVE_TO); + dict_put(&flash_display_GraphicsPathCommand.static_members, &flash_display_GraphicsPathCommand_CURVE_TO, &flash_display_GraphicsPathCommand_CURVE_TO); + dict_put(&flash_display_GraphicsPathCommand.static_members, &flash_display_GraphicsPathCommand_LINE_TO, &flash_display_GraphicsPathCommand_LINE_TO); + dict_put(&flash_display_GraphicsPathCommand.static_members, &flash_display_GraphicsPathCommand_WIDE_LINE_TO, &flash_display_GraphicsPathCommand_WIDE_LINE_TO); dict_put(d, &flash_filters_BevelFilter, &flash_filters_BevelFilter); dict_init2(&flash_filters_BevelFilter.members, &memberinfo_type, 31); + dict_init2(&flash_filters_BevelFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_BevelFilter.members, &flash_filters_BevelFilter_type, &flash_filters_BevelFilter_type); dict_put(&flash_filters_BevelFilter.members, &flash_filters_BevelFilter_highlightColor, &flash_filters_BevelFilter_highlightColor); dict_put(&flash_filters_BevelFilter.members, &flash_filters_BevelFilter_knockout, &flash_filters_BevelFilter_knockout); @@ -7342,6 +8504,7 @@ dict_put(d, &flash_utils_getTimer, &flash_utils_getTimer); dict_put(d, &flash_display_Loader, &flash_display_Loader); dict_init2(&flash_display_Loader.members, &memberinfo_type, 15); + dict_init2(&flash_display_Loader.static_members, &memberinfo_type, 8); dict_put(&flash_display_Loader.members, &flash_display_Loader_content, &flash_display_Loader_content); dict_put(&flash_display_Loader.members, &flash_display_Loader_unloadAndStop, &flash_display_Loader_unloadAndStop); dict_put(&flash_display_Loader.members, &flash_display_Loader_unload, &flash_display_Loader_unload); @@ -7356,6 +8519,7 @@ dict_put(&flash_display_Loader.members, &flash_display_Loader_setChildIndex, &flash_display_Loader_setChildIndex); dict_put(d, &flash_display_GraphicsBitmapFill, &flash_display_GraphicsBitmapFill); dict_init2(&flash_display_GraphicsBitmapFill.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsBitmapFill.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsBitmapFill.members, &flash_display_GraphicsBitmapFill_smooth, &flash_display_GraphicsBitmapFill_smooth); dict_put(&flash_display_GraphicsBitmapFill.members, &flash_display_GraphicsBitmapFill_repeat, &flash_display_GraphicsBitmapFill_repeat); dict_put(&flash_display_GraphicsBitmapFill.members, &flash_display_GraphicsBitmapFill_bitmapData, &flash_display_GraphicsBitmapFill_bitmapData); @@ -7363,6 +8527,7 @@ dict_put(d, &_undefined, &_undefined); dict_put(d, &flash_display_SimpleButton, &flash_display_SimpleButton); dict_init2(&flash_display_SimpleButton.members, &memberinfo_type, 8); + dict_init2(&flash_display_SimpleButton.static_members, &memberinfo_type, 8); dict_put(&flash_display_SimpleButton.members, &flash_display_SimpleButton_overState, &flash_display_SimpleButton_overState); dict_put(&flash_display_SimpleButton.members, &flash_display_SimpleButton_downState, &flash_display_SimpleButton_downState); dict_put(&flash_display_SimpleButton.members, &flash_display_SimpleButton_enabled, &flash_display_SimpleButton_enabled); @@ -7373,36 +8538,42 @@ dict_put(&flash_display_SimpleButton.members, &flash_display_SimpleButton_hitTestState, &flash_display_SimpleButton_hitTestState); dict_put(d, &flash_text_engine_TabAlignment, &flash_text_engine_TabAlignment); dict_init2(&flash_text_engine_TabAlignment.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TabAlignment.members, &flash_text_engine_TabAlignment_END, &flash_text_engine_TabAlignment_END); - dict_put(&flash_text_engine_TabAlignment.members, &flash_text_engine_TabAlignment_CENTER, &flash_text_engine_TabAlignment_CENTER); - dict_put(&flash_text_engine_TabAlignment.members, &flash_text_engine_TabAlignment_START, &flash_text_engine_TabAlignment_START); - dict_put(&flash_text_engine_TabAlignment.members, &flash_text_engine_TabAlignment_DECIMAL, &flash_text_engine_TabAlignment_DECIMAL); + dict_init2(&flash_text_engine_TabAlignment.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_TabAlignment.static_members, &flash_text_engine_TabAlignment_END, &flash_text_engine_TabAlignment_END); + dict_put(&flash_text_engine_TabAlignment.static_members, &flash_text_engine_TabAlignment_CENTER, &flash_text_engine_TabAlignment_CENTER); + dict_put(&flash_text_engine_TabAlignment.static_members, &flash_text_engine_TabAlignment_START, &flash_text_engine_TabAlignment_START); + dict_put(&flash_text_engine_TabAlignment.static_members, &flash_text_engine_TabAlignment_DECIMAL, &flash_text_engine_TabAlignment_DECIMAL); dict_put(d, &flash_text_engine_FontWeight, &flash_text_engine_FontWeight); dict_init2(&flash_text_engine_FontWeight.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_FontWeight.members, &flash_text_engine_FontWeight_NORMAL, &flash_text_engine_FontWeight_NORMAL); - dict_put(&flash_text_engine_FontWeight.members, &flash_text_engine_FontWeight_BOLD, &flash_text_engine_FontWeight_BOLD); + dict_init2(&flash_text_engine_FontWeight.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_FontWeight.static_members, &flash_text_engine_FontWeight_NORMAL, &flash_text_engine_FontWeight_NORMAL); + dict_put(&flash_text_engine_FontWeight.static_members, &flash_text_engine_FontWeight_BOLD, &flash_text_engine_FontWeight_BOLD); dict_put(d, &flash_utils_describeType, &flash_utils_describeType); dict_put(d, &flash_display_PixelSnapping, &flash_display_PixelSnapping); dict_init2(&flash_display_PixelSnapping.members, &memberinfo_type, 8); - dict_put(&flash_display_PixelSnapping.members, &flash_display_PixelSnapping_AUTO, &flash_display_PixelSnapping_AUTO); - dict_put(&flash_display_PixelSnapping.members, &flash_display_PixelSnapping_NEVER, &flash_display_PixelSnapping_NEVER); - dict_put(&flash_display_PixelSnapping.members, &flash_display_PixelSnapping_ALWAYS, &flash_display_PixelSnapping_ALWAYS); + dict_init2(&flash_display_PixelSnapping.static_members, &memberinfo_type, 8); + dict_put(&flash_display_PixelSnapping.static_members, &flash_display_PixelSnapping_AUTO, &flash_display_PixelSnapping_AUTO); + dict_put(&flash_display_PixelSnapping.static_members, &flash_display_PixelSnapping_NEVER, &flash_display_PixelSnapping_NEVER); + dict_put(&flash_display_PixelSnapping.static_members, &flash_display_PixelSnapping_ALWAYS, &flash_display_PixelSnapping_ALWAYS); dict_put(d, &flash_events_FocusEvent, &flash_events_FocusEvent); - dict_init2(&flash_events_FocusEvent.members, &memberinfo_type, 15); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_FOCUS_OUT, &flash_events_FocusEvent_FOCUS_OUT); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_KEY_FOCUS_CHANGE, &flash_events_FocusEvent_KEY_FOCUS_CHANGE); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_shiftKey, &flash_events_FocusEvent_shiftKey); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_isRelatedObjectInaccessible, &flash_events_FocusEvent_isRelatedObjectInaccessible); + dict_init2(&flash_events_FocusEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_FocusEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_keyCode, &flash_events_FocusEvent_keyCode); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_relatedObject, &flash_events_FocusEvent_relatedObject); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_FOCUS_IN, &flash_events_FocusEvent_FOCUS_IN); - dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_MOUSE_FOCUS_CHANGE, &flash_events_FocusEvent_MOUSE_FOCUS_CHANGE); dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_toString, &flash_events_FocusEvent_toString); + dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_isRelatedObjectInaccessible, &flash_events_FocusEvent_isRelatedObjectInaccessible); dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_clone, &flash_events_FocusEvent_clone); + dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_shiftKey, &flash_events_FocusEvent_shiftKey); + dict_put(&flash_events_FocusEvent.members, &flash_events_FocusEvent_relatedObject, &flash_events_FocusEvent_relatedObject); + dict_put(&flash_events_FocusEvent.static_members, &flash_events_FocusEvent_FOCUS_IN, &flash_events_FocusEvent_FOCUS_IN); + dict_put(&flash_events_FocusEvent.static_members, &flash_events_FocusEvent_FOCUS_OUT, &flash_events_FocusEvent_FOCUS_OUT); + dict_put(&flash_events_FocusEvent.static_members, &flash_events_FocusEvent_KEY_FOCUS_CHANGE, &flash_events_FocusEvent_KEY_FOCUS_CHANGE); + dict_put(&flash_events_FocusEvent.static_members, &flash_events_FocusEvent_MOUSE_FOCUS_CHANGE, &flash_events_FocusEvent_MOUSE_FOCUS_CHANGE); dict_put(d, &flash_errors_MemoryError, &flash_errors_MemoryError); dict_init2(&flash_errors_MemoryError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_MemoryError.static_members, &memberinfo_type, 8); dict_put(d, &flash_events_NetFilterEvent, &flash_events_NetFilterEvent); dict_init2(&flash_events_NetFilterEvent.members, &memberinfo_type, 8); + dict_init2(&flash_events_NetFilterEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_NetFilterEvent.members, &flash_events_NetFilterEvent_header, &flash_events_NetFilterEvent_header); dict_put(&flash_events_NetFilterEvent.members, &flash_events_NetFilterEvent_toString, &flash_events_NetFilterEvent_toString); dict_put(&flash_events_NetFilterEvent.members, &flash_events_NetFilterEvent_clone, &flash_events_NetFilterEvent_clone); @@ -7411,63 +8582,74 @@ dict_put(d, &_encodeURI, &_encodeURI); dict_put(d, &flash_text_engine_TextBaseline, &flash_text_engine_TextBaseline); dict_init2(&flash_text_engine_TextBaseline.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_ROMAN, &flash_text_engine_TextBaseline_ROMAN); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_DESCENT, &flash_text_engine_TextBaseline_DESCENT); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_IDEOGRAPHIC_CENTER, &flash_text_engine_TextBaseline_IDEOGRAPHIC_CENTER); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_USE_DOMINANT_BASELINE, &flash_text_engine_TextBaseline_USE_DOMINANT_BASELINE); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_IDEOGRAPHIC_BOTTOM, &flash_text_engine_TextBaseline_IDEOGRAPHIC_BOTTOM); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_ASCENT, &flash_text_engine_TextBaseline_ASCENT); - dict_put(&flash_text_engine_TextBaseline.members, &flash_text_engine_TextBaseline_IDEOGRAPHIC_TOP, &flash_text_engine_TextBaseline_IDEOGRAPHIC_TOP); + dict_init2(&flash_text_engine_TextBaseline.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_ROMAN, &flash_text_engine_TextBaseline_ROMAN); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_DESCENT, &flash_text_engine_TextBaseline_DESCENT); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_IDEOGRAPHIC_CENTER, &flash_text_engine_TextBaseline_IDEOGRAPHIC_CENTER); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_USE_DOMINANT_BASELINE, &flash_text_engine_TextBaseline_USE_DOMINANT_BASELINE); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_IDEOGRAPHIC_BOTTOM, &flash_text_engine_TextBaseline_IDEOGRAPHIC_BOTTOM); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_ASCENT, &flash_text_engine_TextBaseline_ASCENT); + dict_put(&flash_text_engine_TextBaseline.static_members, &flash_text_engine_TextBaseline_IDEOGRAPHIC_TOP, &flash_text_engine_TextBaseline_IDEOGRAPHIC_TOP); dict_put(d, &flash_external_ExternalInterface, &flash_external_ExternalInterface); dict_init2(&flash_external_ExternalInterface.members, &memberinfo_type, 8); - dict_put(&flash_external_ExternalInterface.members, &flash_external_ExternalInterface_call, &flash_external_ExternalInterface_call); - dict_put(&flash_external_ExternalInterface.members, &flash_external_ExternalInterface_available, &flash_external_ExternalInterface_available); - dict_put(&flash_external_ExternalInterface.members, &flash_external_ExternalInterface_addCallback, &flash_external_ExternalInterface_addCallback); - dict_put(&flash_external_ExternalInterface.members, &flash_external_ExternalInterface_marshallExceptions, &flash_external_ExternalInterface_marshallExceptions); - dict_put(&flash_external_ExternalInterface.members, &flash_external_ExternalInterface_objectID, &flash_external_ExternalInterface_objectID); + dict_init2(&flash_external_ExternalInterface.static_members, &memberinfo_type, 8); + dict_put(&flash_external_ExternalInterface.static_members, &flash_external_ExternalInterface_call, &flash_external_ExternalInterface_call); + dict_put(&flash_external_ExternalInterface.static_members, &flash_external_ExternalInterface_available, &flash_external_ExternalInterface_available); + dict_put(&flash_external_ExternalInterface.static_members, &flash_external_ExternalInterface_addCallback, &flash_external_ExternalInterface_addCallback); + dict_put(&flash_external_ExternalInterface.static_members, &flash_external_ExternalInterface_marshallExceptions, &flash_external_ExternalInterface_marshallExceptions); + dict_put(&flash_external_ExternalInterface.static_members, &flash_external_ExternalInterface_objectID, &flash_external_ExternalInterface_objectID); dict_put(d, &_EvalError, &_EvalError); dict_init2(&_EvalError.members, &memberinfo_type, 8); - dict_put(&_EvalError.members, &_EvalError_length, &_EvalError_length); + dict_init2(&_EvalError.static_members, &memberinfo_type, 8); + dict_put(&_EvalError.static_members, &_EvalError_length, &_EvalError_length); dict_put(d, &flash_text_engine_DigitCase, &flash_text_engine_DigitCase); dict_init2(&flash_text_engine_DigitCase.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_DigitCase.members, &flash_text_engine_DigitCase_OLD_STYLE, &flash_text_engine_DigitCase_OLD_STYLE); - dict_put(&flash_text_engine_DigitCase.members, &flash_text_engine_DigitCase_DEFAULT, &flash_text_engine_DigitCase_DEFAULT); - dict_put(&flash_text_engine_DigitCase.members, &flash_text_engine_DigitCase_LINING, &flash_text_engine_DigitCase_LINING); + dict_init2(&flash_text_engine_DigitCase.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_DigitCase.static_members, &flash_text_engine_DigitCase_OLD_STYLE, &flash_text_engine_DigitCase_OLD_STYLE); + dict_put(&flash_text_engine_DigitCase.static_members, &flash_text_engine_DigitCase_DEFAULT, &flash_text_engine_DigitCase_DEFAULT); + dict_put(&flash_text_engine_DigitCase.static_members, &flash_text_engine_DigitCase_LINING, &flash_text_engine_DigitCase_LINING); dict_put(d, &flash_text_TextFormatAlign, &flash_text_TextFormatAlign); dict_init2(&flash_text_TextFormatAlign.members, &memberinfo_type, 8); - dict_put(&flash_text_TextFormatAlign.members, &flash_text_TextFormatAlign_LEFT, &flash_text_TextFormatAlign_LEFT); - dict_put(&flash_text_TextFormatAlign.members, &flash_text_TextFormatAlign_RIGHT, &flash_text_TextFormatAlign_RIGHT); - dict_put(&flash_text_TextFormatAlign.members, &flash_text_TextFormatAlign_CENTER, &flash_text_TextFormatAlign_CENTER); - dict_put(&flash_text_TextFormatAlign.members, &flash_text_TextFormatAlign_JUSTIFY, &flash_text_TextFormatAlign_JUSTIFY); + dict_init2(&flash_text_TextFormatAlign.static_members, &memberinfo_type, 8); + dict_put(&flash_text_TextFormatAlign.static_members, &flash_text_TextFormatAlign_LEFT, &flash_text_TextFormatAlign_LEFT); + dict_put(&flash_text_TextFormatAlign.static_members, &flash_text_TextFormatAlign_RIGHT, &flash_text_TextFormatAlign_RIGHT); + dict_put(&flash_text_TextFormatAlign.static_members, &flash_text_TextFormatAlign_CENTER, &flash_text_TextFormatAlign_CENTER); + dict_put(&flash_text_TextFormatAlign.static_members, &flash_text_TextFormatAlign_JUSTIFY, &flash_text_TextFormatAlign_JUSTIFY); dict_put(d, &flash_errors_ScriptTimeoutError, &flash_errors_ScriptTimeoutError); dict_init2(&flash_errors_ScriptTimeoutError.members, &memberinfo_type, 8); + dict_init2(&flash_errors_ScriptTimeoutError.static_members, &memberinfo_type, 8); dict_put(d, &_uint, &_uint); dict_init2(&_uint.members, &memberinfo_type, 8); - dict_put(&_uint.members, &_uint_MAX_VALUE, &_uint_MAX_VALUE); + dict_init2(&_uint.static_members, &memberinfo_type, 8); dict_put(&_uint.members, &_uint_valueOf, &_uint_valueOf); - dict_put(&_uint.members, &_uint_length, &_uint_length); - dict_put(&_uint.members, &_uint_MIN_VALUE, &_uint_MIN_VALUE); dict_put(&_uint.members, &_uint_toString, &_uint_toString); dict_put(&_uint.members, &_uint_toExponential, &_uint_toExponential); dict_put(&_uint.members, &_uint_toFixed, &_uint_toFixed); dict_put(&_uint.members, &_uint_toPrecision, &_uint_toPrecision); + dict_put(&_uint.static_members, &_uint_MAX_VALUE, &_uint_MAX_VALUE); + dict_put(&_uint.static_members, &_uint_length, &_uint_length); + dict_put(&_uint.static_members, &_uint_MIN_VALUE, &_uint_MIN_VALUE); dict_put(d, &flash_debugger_enterDebugger, &flash_debugger_enterDebugger); dict_put(d, &flash_geom_Orientation3D, &flash_geom_Orientation3D); dict_init2(&flash_geom_Orientation3D.members, &memberinfo_type, 8); - dict_put(&flash_geom_Orientation3D.members, &flash_geom_Orientation3D_QUATERNION, &flash_geom_Orientation3D_QUATERNION); - dict_put(&flash_geom_Orientation3D.members, &flash_geom_Orientation3D_EULER_ANGLES, &flash_geom_Orientation3D_EULER_ANGLES); - dict_put(&flash_geom_Orientation3D.members, &flash_geom_Orientation3D_AXIS_ANGLE, &flash_geom_Orientation3D_AXIS_ANGLE); + dict_init2(&flash_geom_Orientation3D.static_members, &memberinfo_type, 8); + dict_put(&flash_geom_Orientation3D.static_members, &flash_geom_Orientation3D_QUATERNION, &flash_geom_Orientation3D_QUATERNION); + dict_put(&flash_geom_Orientation3D.static_members, &flash_geom_Orientation3D_EULER_ANGLES, &flash_geom_Orientation3D_EULER_ANGLES); + dict_put(&flash_geom_Orientation3D.static_members, &flash_geom_Orientation3D_AXIS_ANGLE, &flash_geom_Orientation3D_AXIS_ANGLE); dict_put(d, &flash_text_engine_CFFHinting, &flash_text_engine_CFFHinting); dict_init2(&flash_text_engine_CFFHinting.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_CFFHinting.members, &flash_text_engine_CFFHinting_HORIZONTAL_STEM, &flash_text_engine_CFFHinting_HORIZONTAL_STEM); - dict_put(&flash_text_engine_CFFHinting.members, &flash_text_engine_CFFHinting_NONE, &flash_text_engine_CFFHinting_NONE); + dict_init2(&flash_text_engine_CFFHinting.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_CFFHinting.static_members, &flash_text_engine_CFFHinting_HORIZONTAL_STEM, &flash_text_engine_CFFHinting_HORIZONTAL_STEM); + dict_put(&flash_text_engine_CFFHinting.static_members, &flash_text_engine_CFFHinting_NONE, &flash_text_engine_CFFHinting_NONE); dict_put(d, &flash_text_FontType, &flash_text_FontType); dict_init2(&flash_text_FontType.members, &memberinfo_type, 8); - dict_put(&flash_text_FontType.members, &flash_text_FontType_EMBEDDED, &flash_text_FontType_EMBEDDED); - dict_put(&flash_text_FontType.members, &flash_text_FontType_DEVICE, &flash_text_FontType_DEVICE); - dict_put(&flash_text_FontType.members, &flash_text_FontType_EMBEDDED_CFF, &flash_text_FontType_EMBEDDED_CFF); + dict_init2(&flash_text_FontType.static_members, &memberinfo_type, 8); + dict_put(&flash_text_FontType.static_members, &flash_text_FontType_EMBEDDED, &flash_text_FontType_EMBEDDED); + dict_put(&flash_text_FontType.static_members, &flash_text_FontType_DEVICE, &flash_text_FontType_DEVICE); + dict_put(&flash_text_FontType.static_members, &flash_text_FontType_EMBEDDED_CFF, &flash_text_FontType_EMBEDDED_CFF); dict_put(d, &flash_filters_ShaderFilter, &flash_filters_ShaderFilter); dict_init2(&flash_filters_ShaderFilter.members, &memberinfo_type, 8); + dict_init2(&flash_filters_ShaderFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_ShaderFilter.members, &flash_filters_ShaderFilter_bottomExtension, &flash_filters_ShaderFilter_bottomExtension); dict_put(&flash_filters_ShaderFilter.members, &flash_filters_ShaderFilter_shader, &flash_filters_ShaderFilter_shader); dict_put(&flash_filters_ShaderFilter.members, &flash_filters_ShaderFilter_rightExtension, &flash_filters_ShaderFilter_rightExtension); @@ -7475,6 +8657,7 @@ dict_put(&flash_filters_ShaderFilter.members, &flash_filters_ShaderFilter_topExtension, &flash_filters_ShaderFilter_topExtension); dict_put(d, &flash_display_GraphicsPath, &flash_display_GraphicsPath); dict_init2(&flash_display_GraphicsPath.members, &memberinfo_type, 8); + dict_init2(&flash_display_GraphicsPath.static_members, &memberinfo_type, 8); dict_put(&flash_display_GraphicsPath.members, &flash_display_GraphicsPath_wideMoveTo, &flash_display_GraphicsPath_wideMoveTo); dict_put(&flash_display_GraphicsPath.members, &flash_display_GraphicsPath_winding, &flash_display_GraphicsPath_winding); dict_put(&flash_display_GraphicsPath.members, &flash_display_GraphicsPath_moveTo, &flash_display_GraphicsPath_moveTo); @@ -7485,94 +8668,100 @@ dict_put(&flash_display_GraphicsPath.members, &flash_display_GraphicsPath_data, &flash_display_GraphicsPath_data); dict_put(d, &flash_system_ApplicationDomain, &flash_system_ApplicationDomain); dict_init2(&flash_system_ApplicationDomain.members, &memberinfo_type, 8); + dict_init2(&flash_system_ApplicationDomain.static_members, &memberinfo_type, 8); dict_put(&flash_system_ApplicationDomain.members, &flash_system_ApplicationDomain_hasDefinition, &flash_system_ApplicationDomain_hasDefinition); dict_put(&flash_system_ApplicationDomain.members, &flash_system_ApplicationDomain_getDefinition, &flash_system_ApplicationDomain_getDefinition); - dict_put(&flash_system_ApplicationDomain.members, &flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH, &flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH); dict_put(&flash_system_ApplicationDomain.members, &flash_system_ApplicationDomain_parentDomain, &flash_system_ApplicationDomain_parentDomain); dict_put(&flash_system_ApplicationDomain.members, &flash_system_ApplicationDomain_domainMemory, &flash_system_ApplicationDomain_domainMemory); - dict_put(&flash_system_ApplicationDomain.members, &flash_system_ApplicationDomain_currentDomain, &flash_system_ApplicationDomain_currentDomain); + dict_put(&flash_system_ApplicationDomain.static_members, &flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH, &flash_system_ApplicationDomain_MIN_DOMAIN_MEMORY_LENGTH); + dict_put(&flash_system_ApplicationDomain.static_members, &flash_system_ApplicationDomain_currentDomain, &flash_system_ApplicationDomain_currentDomain); dict_put(d, &flash_events_KeyboardEvent, &flash_events_KeyboardEvent); - dict_init2(&flash_events_KeyboardEvent.members, &memberinfo_type, 31); + dict_init2(&flash_events_KeyboardEvent.members, &memberinfo_type, 15); + dict_init2(&flash_events_KeyboardEvent.static_members, &memberinfo_type, 8); + dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_shiftKey, &flash_events_KeyboardEvent_shiftKey); + dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_keyCode, &flash_events_KeyboardEvent_keyCode); + dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_keyLocation, &flash_events_KeyboardEvent_keyLocation); dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_updateAfterEvent, &flash_events_KeyboardEvent_updateAfterEvent); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_charCode, &flash_events_KeyboardEvent_charCode); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_KEY_UP, &flash_events_KeyboardEvent_KEY_UP); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_KEY_DOWN, &flash_events_KeyboardEvent_KEY_DOWN); dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_toString, &flash_events_KeyboardEvent_toString); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_keyLocation, &flash_events_KeyboardEvent_keyLocation); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_shiftKey, &flash_events_KeyboardEvent_shiftKey); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_clone, &flash_events_KeyboardEvent_clone); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_ctrlKey, &flash_events_KeyboardEvent_ctrlKey); dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_altKey, &flash_events_KeyboardEvent_altKey); - dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_keyCode, &flash_events_KeyboardEvent_keyCode); + dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_ctrlKey, &flash_events_KeyboardEvent_ctrlKey); + dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_clone, &flash_events_KeyboardEvent_clone); + dict_put(&flash_events_KeyboardEvent.members, &flash_events_KeyboardEvent_charCode, &flash_events_KeyboardEvent_charCode); + dict_put(&flash_events_KeyboardEvent.static_members, &flash_events_KeyboardEvent_KEY_DOWN, &flash_events_KeyboardEvent_KEY_DOWN); + dict_put(&flash_events_KeyboardEvent.static_members, &flash_events_KeyboardEvent_KEY_UP, &flash_events_KeyboardEvent_KEY_UP); dict_put(d, &adobe_utils_ProductManager, &adobe_utils_ProductManager); dict_init2(&adobe_utils_ProductManager.members, &memberinfo_type, 8); + dict_init2(&adobe_utils_ProductManager.static_members, &memberinfo_type, 8); dict_put(&adobe_utils_ProductManager.members, &adobe_utils_ProductManager_running, &adobe_utils_ProductManager_running); dict_put(&adobe_utils_ProductManager.members, &adobe_utils_ProductManager_download, &adobe_utils_ProductManager_download); dict_put(&adobe_utils_ProductManager.members, &adobe_utils_ProductManager_installedVersion, &adobe_utils_ProductManager_installedVersion); dict_put(&adobe_utils_ProductManager.members, &adobe_utils_ProductManager_installed, &adobe_utils_ProductManager_installed); dict_put(&adobe_utils_ProductManager.members, &adobe_utils_ProductManager_launch, &adobe_utils_ProductManager_launch); dict_put(d, &flash_events_Event, &flash_events_Event); - dict_init2(&flash_events_Event.members, &memberinfo_type, 127); - dict_put(&flash_events_Event.members, &flash_events_Event_CLEAR, &flash_events_Event_CLEAR); - dict_put(&flash_events_Event.members, &flash_events_Event_toString, &flash_events_Event_toString); - dict_put(&flash_events_Event.members, &flash_events_Event_cancelable, &flash_events_Event_cancelable); - dict_put(&flash_events_Event.members, &flash_events_Event_CANCEL, &flash_events_Event_CANCEL); - dict_put(&flash_events_Event.members, &flash_events_Event_clone, &flash_events_Event_clone); - dict_put(&flash_events_Event.members, &flash_events_Event_CONNECT, &flash_events_Event_CONNECT); - dict_put(&flash_events_Event.members, &flash_events_Event_REMOVED_FROM_STAGE, &flash_events_Event_REMOVED_FROM_STAGE); - dict_put(&flash_events_Event.members, &flash_events_Event_FRAME_CONSTRUCTED, &flash_events_Event_FRAME_CONSTRUCTED); - dict_put(&flash_events_Event.members, &flash_events_Event_TAB_INDEX_CHANGE, &flash_events_Event_TAB_INDEX_CHANGE); - dict_put(&flash_events_Event.members, &flash_events_Event_currentTarget, &flash_events_Event_currentTarget); - dict_put(&flash_events_Event.members, &flash_events_Event_ADDED, &flash_events_Event_ADDED); - dict_put(&flash_events_Event.members, &flash_events_Event_OPEN, &flash_events_Event_OPEN); - dict_put(&flash_events_Event.members, &flash_events_Event_TAB_CHILDREN_CHANGE, &flash_events_Event_TAB_CHILDREN_CHANGE); - dict_put(&flash_events_Event.members, &flash_events_Event_COMPLETE, &flash_events_Event_COMPLETE); - dict_put(&flash_events_Event.members, &flash_events_Event_ACTIVATE, &flash_events_Event_ACTIVATE); - dict_put(&flash_events_Event.members, &flash_events_Event_RENDER, &flash_events_Event_RENDER); - dict_put(&flash_events_Event.members, &flash_events_Event_EXIT_FRAME, &flash_events_Event_EXIT_FRAME); + dict_init2(&flash_events_Event.members, &memberinfo_type, 31); + dict_init2(&flash_events_Event.static_members, &memberinfo_type, 63); dict_put(&flash_events_Event.members, &flash_events_Event_type, &flash_events_Event_type); - dict_put(&flash_events_Event.members, &flash_events_Event_DEACTIVATE, &flash_events_Event_DEACTIVATE); - dict_put(&flash_events_Event.members, &flash_events_Event_stopImmediatePropagation, &flash_events_Event_stopImmediatePropagation); - dict_put(&flash_events_Event.members, &flash_events_Event_SELECT_ALL, &flash_events_Event_SELECT_ALL); - dict_put(&flash_events_Event.members, &flash_events_Event_CUT, &flash_events_Event_CUT); - dict_put(&flash_events_Event.members, &flash_events_Event_ENTER_FRAME, &flash_events_Event_ENTER_FRAME); - dict_put(&flash_events_Event.members, &flash_events_Event_INIT, &flash_events_Event_INIT); - dict_put(&flash_events_Event.members, &flash_events_Event_SOUND_COMPLETE, &flash_events_Event_SOUND_COMPLETE); - dict_put(&flash_events_Event.members, &flash_events_Event_COPY, &flash_events_Event_COPY); + dict_put(&flash_events_Event.members, &flash_events_Event_cancelable, &flash_events_Event_cancelable); dict_put(&flash_events_Event.members, &flash_events_Event_isDefaultPrevented, &flash_events_Event_isDefaultPrevented); - dict_put(&flash_events_Event.members, &flash_events_Event_PASTE, &flash_events_Event_PASTE); - dict_put(&flash_events_Event.members, &flash_events_Event_stopPropagation, &flash_events_Event_stopPropagation); - dict_put(&flash_events_Event.members, &flash_events_Event_CLOSE, &flash_events_Event_CLOSE); - dict_put(&flash_events_Event.members, &flash_events_Event_REMOVED, &flash_events_Event_REMOVED); - dict_put(&flash_events_Event.members, &flash_events_Event_TAB_ENABLED_CHANGE, &flash_events_Event_TAB_ENABLED_CHANGE); + dict_put(&flash_events_Event.members, &flash_events_Event_target, &flash_events_Event_target); dict_put(&flash_events_Event.members, &flash_events_Event_eventPhase, &flash_events_Event_eventPhase); - dict_put(&flash_events_Event.members, &flash_events_Event_UNLOAD, &flash_events_Event_UNLOAD); + dict_put(&flash_events_Event.members, &flash_events_Event_currentTarget, &flash_events_Event_currentTarget); + dict_put(&flash_events_Event.members, &flash_events_Event_toString, &flash_events_Event_toString); + dict_put(&flash_events_Event.members, &flash_events_Event_stopImmediatePropagation, &flash_events_Event_stopImmediatePropagation); dict_put(&flash_events_Event.members, &flash_events_Event_bubbles, &flash_events_Event_bubbles); - dict_put(&flash_events_Event.members, &flash_events_Event_formatToString, &flash_events_Event_formatToString); - dict_put(&flash_events_Event.members, &flash_events_Event_FULLSCREEN, &flash_events_Event_FULLSCREEN); - dict_put(&flash_events_Event.members, &flash_events_Event_MOUSE_LEAVE, &flash_events_Event_MOUSE_LEAVE); - dict_put(&flash_events_Event.members, &flash_events_Event_ID3, &flash_events_Event_ID3); - dict_put(&flash_events_Event.members, &flash_events_Event_RESIZE, &flash_events_Event_RESIZE); - dict_put(&flash_events_Event.members, &flash_events_Event_CHANGE, &flash_events_Event_CHANGE); - dict_put(&flash_events_Event.members, &flash_events_Event_SELECT, &flash_events_Event_SELECT); - dict_put(&flash_events_Event.members, &flash_events_Event_SCROLL, &flash_events_Event_SCROLL); - dict_put(&flash_events_Event.members, &flash_events_Event_ADDED_TO_STAGE, &flash_events_Event_ADDED_TO_STAGE); + dict_put(&flash_events_Event.members, &flash_events_Event_stopPropagation, &flash_events_Event_stopPropagation); + dict_put(&flash_events_Event.members, &flash_events_Event_clone, &flash_events_Event_clone); dict_put(&flash_events_Event.members, &flash_events_Event_preventDefault, &flash_events_Event_preventDefault); - dict_put(&flash_events_Event.members, &flash_events_Event_target, &flash_events_Event_target); + dict_put(&flash_events_Event.members, &flash_events_Event_formatToString, &flash_events_Event_formatToString); + dict_put(&flash_events_Event.static_members, &flash_events_Event_REMOVED_FROM_STAGE, &flash_events_Event_REMOVED_FROM_STAGE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_CLEAR, &flash_events_Event_CLEAR); + dict_put(&flash_events_Event.static_members, &flash_events_Event_OPEN, &flash_events_Event_OPEN); + dict_put(&flash_events_Event.static_members, &flash_events_Event_TAB_CHILDREN_CHANGE, &flash_events_Event_TAB_CHILDREN_CHANGE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_DEACTIVATE, &flash_events_Event_DEACTIVATE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_ACTIVATE, &flash_events_Event_ACTIVATE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_SOUND_COMPLETE, &flash_events_Event_SOUND_COMPLETE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_CANCEL, &flash_events_Event_CANCEL); + dict_put(&flash_events_Event.static_members, &flash_events_Event_REMOVED, &flash_events_Event_REMOVED); + dict_put(&flash_events_Event.static_members, &flash_events_Event_INIT, &flash_events_Event_INIT); + dict_put(&flash_events_Event.static_members, &flash_events_Event_FRAME_CONSTRUCTED, &flash_events_Event_FRAME_CONSTRUCTED); + dict_put(&flash_events_Event.static_members, &flash_events_Event_SCROLL, &flash_events_Event_SCROLL); + dict_put(&flash_events_Event.static_members, &flash_events_Event_TAB_INDEX_CHANGE, &flash_events_Event_TAB_INDEX_CHANGE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_CHANGE, &flash_events_Event_CHANGE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_ADDED_TO_STAGE, &flash_events_Event_ADDED_TO_STAGE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_UNLOAD, &flash_events_Event_UNLOAD); + dict_put(&flash_events_Event.static_members, &flash_events_Event_SELECT, &flash_events_Event_SELECT); + dict_put(&flash_events_Event.static_members, &flash_events_Event_CONNECT, &flash_events_Event_CONNECT); + dict_put(&flash_events_Event.static_members, &flash_events_Event_CUT, &flash_events_Event_CUT); + dict_put(&flash_events_Event.static_members, &flash_events_Event_PASTE, &flash_events_Event_PASTE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_ADDED, &flash_events_Event_ADDED); + dict_put(&flash_events_Event.static_members, &flash_events_Event_ID3, &flash_events_Event_ID3); + dict_put(&flash_events_Event.static_members, &flash_events_Event_ENTER_FRAME, &flash_events_Event_ENTER_FRAME); + dict_put(&flash_events_Event.static_members, &flash_events_Event_RENDER, &flash_events_Event_RENDER); + dict_put(&flash_events_Event.static_members, &flash_events_Event_EXIT_FRAME, &flash_events_Event_EXIT_FRAME); + dict_put(&flash_events_Event.static_members, &flash_events_Event_RESIZE, &flash_events_Event_RESIZE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_FULLSCREEN, &flash_events_Event_FULLSCREEN); + dict_put(&flash_events_Event.static_members, &flash_events_Event_MOUSE_LEAVE, &flash_events_Event_MOUSE_LEAVE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_CLOSE, &flash_events_Event_CLOSE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_SELECT_ALL, &flash_events_Event_SELECT_ALL); + dict_put(&flash_events_Event.static_members, &flash_events_Event_TAB_ENABLED_CHANGE, &flash_events_Event_TAB_ENABLED_CHANGE); + dict_put(&flash_events_Event.static_members, &flash_events_Event_COPY, &flash_events_Event_COPY); + dict_put(&flash_events_Event.static_members, &flash_events_Event_COMPLETE, &flash_events_Event_COMPLETE); dict_put(d, &flash_desktop_ClipboardFormats, &flash_desktop_ClipboardFormats); - dict_init2(&flash_desktop_ClipboardFormats.members, &memberinfo_type, 15); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_TEXT_FORMAT, &flash_desktop_ClipboardFormats_TEXT_FORMAT); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_BITMAP_FORMAT, &flash_desktop_ClipboardFormats_BITMAP_FORMAT); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_FLASH_PREFIX, &flash_desktop_ClipboardFormats_FLASH_PREFIX); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_HTML_FORMAT, &flash_desktop_ClipboardFormats_HTML_FORMAT); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_REFERENCE_PREFIX, &flash_desktop_ClipboardFormats_REFERENCE_PREFIX); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_AIR_PREFIX, &flash_desktop_ClipboardFormats_AIR_PREFIX); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX, &flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_RICH_TEXT_FORMAT, &flash_desktop_ClipboardFormats_RICH_TEXT_FORMAT); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_URL_FORMAT, &flash_desktop_ClipboardFormats_URL_FORMAT); - dict_put(&flash_desktop_ClipboardFormats.members, &flash_desktop_ClipboardFormats_FILE_LIST_FORMAT, &flash_desktop_ClipboardFormats_FILE_LIST_FORMAT); + dict_init2(&flash_desktop_ClipboardFormats.members, &memberinfo_type, 8); + dict_init2(&flash_desktop_ClipboardFormats.static_members, &memberinfo_type, 15); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_TEXT_FORMAT, &flash_desktop_ClipboardFormats_TEXT_FORMAT); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_BITMAP_FORMAT, &flash_desktop_ClipboardFormats_BITMAP_FORMAT); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_FLASH_PREFIX, &flash_desktop_ClipboardFormats_FLASH_PREFIX); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_HTML_FORMAT, &flash_desktop_ClipboardFormats_HTML_FORMAT); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_REFERENCE_PREFIX, &flash_desktop_ClipboardFormats_REFERENCE_PREFIX); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_AIR_PREFIX, &flash_desktop_ClipboardFormats_AIR_PREFIX); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX, &flash_desktop_ClipboardFormats_SERIALIZATION_PREFIX); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_RICH_TEXT_FORMAT, &flash_desktop_ClipboardFormats_RICH_TEXT_FORMAT); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_URL_FORMAT, &flash_desktop_ClipboardFormats_URL_FORMAT); + dict_put(&flash_desktop_ClipboardFormats.static_members, &flash_desktop_ClipboardFormats_FILE_LIST_FORMAT, &flash_desktop_ClipboardFormats_FILE_LIST_FORMAT); dict_put(d, &flash_display_MovieClip, &flash_display_MovieClip); dict_init2(&flash_display_MovieClip.members, &memberinfo_type, 31); + dict_init2(&flash_display_MovieClip.static_members, &memberinfo_type, 8); dict_put(&flash_display_MovieClip.members, &flash_display_MovieClip_prevScene, &flash_display_MovieClip_prevScene); dict_put(&flash_display_MovieClip.members, &flash_display_MovieClip_gotoAndPlay, &flash_display_MovieClip_gotoAndPlay); dict_put(&flash_display_MovieClip.members, &flash_display_MovieClip_currentLabels, &flash_display_MovieClip_currentLabels); @@ -7594,6 +8783,7 @@ dict_put(&flash_display_MovieClip.members, &flash_display_MovieClip_stop, &flash_display_MovieClip_stop); dict_put(d, &flash_display_BitmapData, &flash_display_BitmapData); dict_init2(&flash_display_BitmapData.members, &memberinfo_type, 63); + dict_init2(&flash_display_BitmapData.static_members, &memberinfo_type, 8); dict_put(&flash_display_BitmapData.members, &flash_display_BitmapData_getPixel32, &flash_display_BitmapData_getPixel32); dict_put(&flash_display_BitmapData.members, &flash_display_BitmapData_draw, &flash_display_BitmapData_draw); dict_put(&flash_display_BitmapData.members, &flash_display_BitmapData_setPixels, &flash_display_BitmapData_setPixels); @@ -7631,15 +8821,16 @@ dict_put(&flash_display_BitmapData.members, &flash_display_BitmapData_dispose, &flash_display_BitmapData_dispose); dict_put(d, &flash_text_engine_LigatureLevel, &flash_text_engine_LigatureLevel); dict_init2(&flash_text_engine_LigatureLevel.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_LigatureLevel.members, &flash_text_engine_LigatureLevel_UNCOMMON, &flash_text_engine_LigatureLevel_UNCOMMON); - dict_put(&flash_text_engine_LigatureLevel.members, &flash_text_engine_LigatureLevel_COMMON, &flash_text_engine_LigatureLevel_COMMON); - dict_put(&flash_text_engine_LigatureLevel.members, &flash_text_engine_LigatureLevel_EXOTIC, &flash_text_engine_LigatureLevel_EXOTIC); - dict_put(&flash_text_engine_LigatureLevel.members, &flash_text_engine_LigatureLevel_MINIMUM, &flash_text_engine_LigatureLevel_MINIMUM); - dict_put(&flash_text_engine_LigatureLevel.members, &flash_text_engine_LigatureLevel_NONE, &flash_text_engine_LigatureLevel_NONE); + dict_init2(&flash_text_engine_LigatureLevel.static_members, &memberinfo_type, 8); + dict_put(&flash_text_engine_LigatureLevel.static_members, &flash_text_engine_LigatureLevel_UNCOMMON, &flash_text_engine_LigatureLevel_UNCOMMON); + dict_put(&flash_text_engine_LigatureLevel.static_members, &flash_text_engine_LigatureLevel_COMMON, &flash_text_engine_LigatureLevel_COMMON); + dict_put(&flash_text_engine_LigatureLevel.static_members, &flash_text_engine_LigatureLevel_EXOTIC, &flash_text_engine_LigatureLevel_EXOTIC); + dict_put(&flash_text_engine_LigatureLevel.static_members, &flash_text_engine_LigatureLevel_MINIMUM, &flash_text_engine_LigatureLevel_MINIMUM); + dict_put(&flash_text_engine_LigatureLevel.static_members, &flash_text_engine_LigatureLevel_NONE, &flash_text_engine_LigatureLevel_NONE); dict_put(d, &_Infinity, &_Infinity); dict_put(d, &flash_text_engine_FontDescription, &flash_text_engine_FontDescription); dict_init2(&flash_text_engine_FontDescription.members, &memberinfo_type, 15); - dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_isFontCompatible, &flash_text_engine_FontDescription_isFontCompatible); + dict_init2(&flash_text_engine_FontDescription.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_renderingMode, &flash_text_engine_FontDescription_renderingMode); dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_cffHinting, &flash_text_engine_FontDescription_cffHinting); dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_fontPosture, &flash_text_engine_FontDescription_fontPosture); @@ -7648,23 +8839,27 @@ dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_locked, &flash_text_engine_FontDescription_locked); dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_fontWeight, &flash_text_engine_FontDescription_fontWeight); dict_put(&flash_text_engine_FontDescription.members, &flash_text_engine_FontDescription_clone, &flash_text_engine_FontDescription_clone); + dict_put(&flash_text_engine_FontDescription.static_members, &flash_text_engine_FontDescription_isFontCompatible, &flash_text_engine_FontDescription_isFontCompatible); dict_put(d, &flash_text_engine_TextElement, &flash_text_engine_TextElement); dict_init2(&flash_text_engine_TextElement.members, &memberinfo_type, 8); + dict_init2(&flash_text_engine_TextElement.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_TextElement.members, &flash_text_engine_TextElement_replaceText, &flash_text_engine_TextElement_replaceText); dict_put(d, &flash_display_SWFVersion, &flash_display_SWFVersion); dict_init2(&flash_display_SWFVersion.members, &memberinfo_type, 8); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH4, &flash_display_SWFVersion_FLASH4); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH7, &flash_display_SWFVersion_FLASH7); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH8, &flash_display_SWFVersion_FLASH8); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH3, &flash_display_SWFVersion_FLASH3); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH6, &flash_display_SWFVersion_FLASH6); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH9, &flash_display_SWFVersion_FLASH9); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH2, &flash_display_SWFVersion_FLASH2); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH5, &flash_display_SWFVersion_FLASH5); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH10, &flash_display_SWFVersion_FLASH10); - dict_put(&flash_display_SWFVersion.members, &flash_display_SWFVersion_FLASH1, &flash_display_SWFVersion_FLASH1); + dict_init2(&flash_display_SWFVersion.static_members, &memberinfo_type, 8); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH4, &flash_display_SWFVersion_FLASH4); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH7, &flash_display_SWFVersion_FLASH7); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH8, &flash_display_SWFVersion_FLASH8); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH3, &flash_display_SWFVersion_FLASH3); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH6, &flash_display_SWFVersion_FLASH6); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH9, &flash_display_SWFVersion_FLASH9); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH2, &flash_display_SWFVersion_FLASH2); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH5, &flash_display_SWFVersion_FLASH5); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH10, &flash_display_SWFVersion_FLASH10); + dict_put(&flash_display_SWFVersion.static_members, &flash_display_SWFVersion_FLASH1, &flash_display_SWFVersion_FLASH1); dict_put(d, &flash_net_URLLoader, &flash_net_URLLoader); dict_init2(&flash_net_URLLoader.members, &memberinfo_type, 8); + dict_init2(&flash_net_URLLoader.static_members, &memberinfo_type, 8); dict_put(&flash_net_URLLoader.members, &flash_net_URLLoader_close, &flash_net_URLLoader_close); dict_put(&flash_net_URLLoader.members, &flash_net_URLLoader_bytesLoaded, &flash_net_URLLoader_bytesLoaded); dict_put(&flash_net_URLLoader.members, &flash_net_URLLoader_load, &flash_net_URLLoader_load); @@ -7673,6 +8868,7 @@ dict_put(&flash_net_URLLoader.members, &flash_net_URLLoader_data, &flash_net_URLLoader_data); dict_put(d, &flash_geom_Matrix, &flash_geom_Matrix); dict_init2(&flash_geom_Matrix.members, &memberinfo_type, 31); + dict_init2(&flash_geom_Matrix.static_members, &memberinfo_type, 8); dict_put(&flash_geom_Matrix.members, &flash_geom_Matrix_b, &flash_geom_Matrix_b); dict_put(&flash_geom_Matrix.members, &flash_geom_Matrix_deltaTransformPoint, &flash_geom_Matrix_deltaTransformPoint); dict_put(&flash_geom_Matrix.members, &flash_geom_Matrix_identity, &flash_geom_Matrix_identity); @@ -7693,12 +8889,14 @@ dict_put(&flash_geom_Matrix.members, &flash_geom_Matrix_createBox, &flash_geom_Matrix_createBox); dict_put(d, &flash_accessibility_Accessibility, &flash_accessibility_Accessibility); dict_init2(&flash_accessibility_Accessibility.members, &memberinfo_type, 8); - dict_put(&flash_accessibility_Accessibility.members, &flash_accessibility_Accessibility_active, &flash_accessibility_Accessibility_active); - dict_put(&flash_accessibility_Accessibility.members, &flash_accessibility_Accessibility_updateProperties, &flash_accessibility_Accessibility_updateProperties); - dict_put(&flash_accessibility_Accessibility.members, &flash_accessibility_Accessibility_sendEvent, &flash_accessibility_Accessibility_sendEvent); + dict_init2(&flash_accessibility_Accessibility.static_members, &memberinfo_type, 8); + dict_put(&flash_accessibility_Accessibility.static_members, &flash_accessibility_Accessibility_active, &flash_accessibility_Accessibility_active); + dict_put(&flash_accessibility_Accessibility.static_members, &flash_accessibility_Accessibility_updateProperties, &flash_accessibility_Accessibility_updateProperties); + dict_put(&flash_accessibility_Accessibility.static_members, &flash_accessibility_Accessibility_sendEvent, &flash_accessibility_Accessibility_sendEvent); dict_put(d, &flash_net_sendToURL, &flash_net_sendToURL); dict_put(d, &flash_filters_GlowFilter, &flash_filters_GlowFilter); dict_init2(&flash_filters_GlowFilter.members, &memberinfo_type, 8); + dict_init2(&flash_filters_GlowFilter.static_members, &memberinfo_type, 8); dict_put(&flash_filters_GlowFilter.members, &flash_filters_GlowFilter_blurY, &flash_filters_GlowFilter_blurY); dict_put(&flash_filters_GlowFilter.members, &flash_filters_GlowFilter_strength, &flash_filters_GlowFilter_strength); dict_put(&flash_filters_GlowFilter.members, &flash_filters_GlowFilter_inner, &flash_filters_GlowFilter_inner); @@ -7710,36 +8908,42 @@ dict_put(&flash_filters_GlowFilter.members, &flash_filters_GlowFilter_blurX, &flash_filters_GlowFilter_blurX); dict_put(d, &flash_events_FullScreenEvent, &flash_events_FullScreenEvent); dict_init2(&flash_events_FullScreenEvent.members, &memberinfo_type, 8); - dict_put(&flash_events_FullScreenEvent.members, &flash_events_FullScreenEvent_FULL_SCREEN, &flash_events_FullScreenEvent_FULL_SCREEN); + dict_init2(&flash_events_FullScreenEvent.static_members, &memberinfo_type, 8); dict_put(&flash_events_FullScreenEvent.members, &flash_events_FullScreenEvent_toString, &flash_events_FullScreenEvent_toString); dict_put(&flash_events_FullScreenEvent.members, &flash_events_FullScreenEvent_clone, &flash_events_FullScreenEvent_clone); dict_put(&flash_events_FullScreenEvent.members, &flash_events_FullScreenEvent_fullScreen, &flash_events_FullScreenEvent_fullScreen); + dict_put(&flash_events_FullScreenEvent.static_members, &flash_events_FullScreenEvent_FULL_SCREEN, &flash_events_FullScreenEvent_FULL_SCREEN); dict_put(d, &flash_display_StageDisplayState, &flash_display_StageDisplayState); dict_init2(&flash_display_StageDisplayState.members, &memberinfo_type, 8); - dict_put(&flash_display_StageDisplayState.members, &flash_display_StageDisplayState_NORMAL, &flash_display_StageDisplayState_NORMAL); - dict_put(&flash_display_StageDisplayState.members, &flash_display_StageDisplayState_FULL_SCREEN, &flash_display_StageDisplayState_FULL_SCREEN); + dict_init2(&flash_display_StageDisplayState.static_members, &memberinfo_type, 8); + dict_put(&flash_display_StageDisplayState.static_members, &flash_display_StageDisplayState_NORMAL, &flash_display_StageDisplayState_NORMAL); + dict_put(&flash_display_StageDisplayState.static_members, &flash_display_StageDisplayState_FULL_SCREEN, &flash_display_StageDisplayState_FULL_SCREEN); dict_put(d, &flash_text_engine_TextJustifier, &flash_text_engine_TextJustifier); dict_init2(&flash_text_engine_TextJustifier.members, &memberinfo_type, 8); - dict_put(&flash_text_engine_TextJustifier.members, &flash_text_engine_TextJustifier_getJustifierForLocale, &flash_text_engine_TextJustifier_getJustifierForLocale); + dict_init2(&flash_text_engine_TextJustifier.static_members, &memberinfo_type, 8); dict_put(&flash_text_engine_TextJustifier.members, &flash_text_engine_TextJustifier_lineJustification, &flash_text_engine_TextJustifier_lineJustification); dict_put(&flash_text_engine_TextJustifier.members, &flash_text_engine_TextJustifier_locale, &flash_text_engine_TextJustifier_locale); dict_put(&flash_text_engine_TextJustifier.members, &flash_text_engine_TextJustifier_clone, &flash_text_engine_TextJustifier_clone); + dict_put(&flash_text_engine_TextJustifier.static_members, &flash_text_engine_TextJustifier_getJustifierForLocale, &flash_text_engine_TextJustifier_getJustifierForLocale); dict_put(d, &flash_display_StageAlign, &flash_display_StageAlign); - dict_init2(&flash_display_StageAlign.members, &memberinfo_type, 15); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_RIGHT, &flash_display_StageAlign_RIGHT); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_BOTTOM, &flash_display_StageAlign_BOTTOM); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_BOTTOM_LEFT, &flash_display_StageAlign_BOTTOM_LEFT); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_TOP_RIGHT, &flash_display_StageAlign_TOP_RIGHT); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_TOP, &flash_display_StageAlign_TOP); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_LEFT, &flash_display_StageAlign_LEFT); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_BOTTOM_RIGHT, &flash_display_StageAlign_BOTTOM_RIGHT); - dict_put(&flash_display_StageAlign.members, &flash_display_StageAlign_TOP_LEFT, &flash_display_StageAlign_TOP_LEFT); + dict_init2(&flash_display_StageAlign.members, &memberinfo_type, 8); + dict_init2(&flash_display_StageAlign.static_members, &memberinfo_type, 15); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_RIGHT, &flash_display_StageAlign_RIGHT); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_BOTTOM, &flash_display_StageAlign_BOTTOM); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_BOTTOM_LEFT, &flash_display_StageAlign_BOTTOM_LEFT); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_TOP_RIGHT, &flash_display_StageAlign_TOP_RIGHT); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_TOP, &flash_display_StageAlign_TOP); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_LEFT, &flash_display_StageAlign_LEFT); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_BOTTOM_RIGHT, &flash_display_StageAlign_BOTTOM_RIGHT); + dict_put(&flash_display_StageAlign.static_members, &flash_display_StageAlign_TOP_LEFT, &flash_display_StageAlign_TOP_LEFT); dict_put(d, &_NaN, &_NaN); dict_put(d, &_ReferenceError, &_ReferenceError); dict_init2(&_ReferenceError.members, &memberinfo_type, 8); - dict_put(&_ReferenceError.members, &_ReferenceError_length, &_ReferenceError_length); + dict_init2(&_ReferenceError.static_members, &memberinfo_type, 8); + dict_put(&_ReferenceError.static_members, &_ReferenceError_length, &_ReferenceError_length); dict_put(d, &flash_display_Shape, &flash_display_Shape); dict_init2(&flash_display_Shape.members, &memberinfo_type, 8); + dict_init2(&flash_display_Shape.static_members, &memberinfo_type, 8); dict_put(&flash_display_Shape.members, &flash_display_Shape_graphics, &flash_display_Shape_graphics); _NaN_constant.f = __builtin_nan(""); _Infinity_constant.f = __builtin_inf(); diff -Nru swftools-0.9.0/lib/as3/code.c swftools-0.9.2/lib/as3/code.c --- swftools-0.9.0/lib/as3/code.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/code.c 2012-02-04 15:13:08.000000000 +0000 @@ -197,6 +197,21 @@ {0x95, "typeof", "", -1, 1, 0, 0}, {0xa7, "urshift", "", -2, 1, 0, 0}, +/* Alchemy opcodes */ +{0x3a, "si8", "", -2, 0, 0, 0}, +{0x3b, "si16", "", -2, 0, 0, 0}, +{0x3c, "si32", "", -2, 0, 0, 0}, +{0x3d, "sf32", "", -2, 0, 0, 0}, +{0x3e, "sf64", "", -2, 0, 0, 0}, +{0x35, "li8", "", -1, 1, 0, 0}, +{0x36, "li16", "", -1, 1, 0, 0}, +{0x37, "li32", "", -1, 1, 0, 0}, +{0x38, "lf32", "", -1, 1, 0, 0}, +{0x39, "lf64", "", -1, 1, 0, 0}, +{0x50, "sxi1", "", -1, 1, 0, 0}, +{0x51, "sxi8", "", -1, 1, 0, 0}, +{0x52, "sxi16", "", -1, 1, 0, 0}, + /* opcodes not documented, but seen in the wild */ {0x53, "applytype", "n", -1, 1, 0, OP_STACK_ARGS}, //seen in builtin.abc @@ -255,10 +270,10 @@ void lookupswitch_print(lookupswitch_t*l) { - printf("default: %08x\n", l->def); + printf("default: %p\n", l->def); code_list_t*t = l->targets; while(t) { - printf("target: %08x\n", t->code); + printf("target: %p\n", t->code); t = t->next; } } @@ -357,8 +372,7 @@ printf("Can't parse opcode param type \"%c\" (for op %02x %s).\n", *p, code->opcode, op->name); return 0; } - if(data) - code->data[pos++] = data; + code->data[pos++] = data; p++; } } @@ -845,7 +859,7 @@ for(t=0;topcode); if(op->flags & (OP_JUMP|OP_BRANCH)) { - printf("%05d) %s %08x\n", t, op->name, c->branch); + printf("%05d) %s %p\n", t, op->name, c->branch); } else if(op->params[0]=='2') { printf("%05d) %s %s\n", t, op->name, multiname_tostring(c->data[0])); } else if(op->params[0]=='N') { @@ -990,13 +1004,13 @@ if(c->branch) fprintf(fo, "->%d", c->branch->pos); else - fprintf(fo, "%08x", c->branch); + fprintf(fo, "%p", c->branch); } else if(*p == 's') { char*s = string_escape((string_t*)data); fprintf(fo, "\"%s\"", s); free(s); } else if(*p == 'D') { - fprintf(fo, "[register %02x=%s]", (ptroff_t)c->data[1], (char*)c->data[0]); + fprintf(fo, "[register %02x=%s]", (int)(ptroff_t)c->data[1], (char*)c->data[0]); } else if(*p == 'S') { lookupswitch_t*l = c->data[0]; fprintf(fo, "["); @@ -1225,6 +1239,19 @@ return code_cut(c); } +char is_getlocal(code_t*c) +{ + if(!c) return 0; + if(c->opcode == OPCODE_GETLOCAL || + c->opcode == OPCODE_GETLOCAL_0 || + c->opcode == OPCODE_GETLOCAL_1 || + c->opcode == OPCODE_GETLOCAL_2 || + c->opcode == OPCODE_GETLOCAL_3) { + return 1; + } + return 0; +} + code_t* cut_last_push(code_t*c) { assert(!c->next); diff -Nru swftools-0.9.0/lib/as3/code.h swftools-0.9.2/lib/as3/code.h --- swftools-0.9.0/lib/as3/code.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/as3/code.h 2010-11-12 18:54:14.000000000 +0000 @@ -102,6 +102,8 @@ code_t* cut_last_push(code_t*_c); +char is_getlocal(code_t*c); + #define code_new() (0) #endif diff -Nru swftools-0.9.0/lib/as3/common.c swftools-0.9.2/lib/as3/common.c --- swftools-0.9.0/lib/as3/common.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/common.c 2011-01-02 03:30:29.000000000 +0000 @@ -1,3 +1,26 @@ +/* common.c + + Routines for handling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008,2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include #include #include @@ -18,6 +41,7 @@ vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); fprintf(stderr, "%s:%d:%d: error: %s\n", current_filename, current_line, current_column, buf); + fprintf(stderr, "%s\n", current_filename_long); fflush(stderr); exit(1); } @@ -47,3 +71,15 @@ fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename, current_line, current_column, buf); fflush(stderr); } + +void internal_error(const char*file, int line, const char*f) +{ + syntaxerror("internal error in %s, %s:%d", f, file, line); +} + +int a3_error(char*s) +{ + syntaxerror("%s", s); + return 0; //make gcc happy +} + diff -Nru swftools-0.9.0/lib/as3/common.h swftools-0.9.2/lib/as3/common.h --- swftools-0.9.0/lib/as3/common.h 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/common.h 2011-01-02 03:30:29.000000000 +0000 @@ -1,11 +1,39 @@ +/* common.h + + Routines for handling/compiling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008,2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef __as3_common_h__ #define __as3_common_h__ - +extern int as3_lex(); extern int as3_verbosity; extern int as3_pass; #define syntaxerror as3_error +int a3_error(char*s); void as3_error(const char*format, ...) __attribute__ ((__noreturn__)); void as3_warning(const char*format, ...); void as3_softwarning(const char*format, ...); + +void internal_error(const char*file, int line, const char*f); +#define as3_assert(b) {if(!(b)) internal_error(__FILE__, __LINE__,__func__);} + #endif diff -Nru swftools-0.9.0/lib/as3/compiler.c swftools-0.9.2/lib/as3/compiler.c --- swftools-0.9.0/lib/as3/compiler.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/compiler.c 2010-11-12 18:54:31.000000000 +0000 @@ -27,6 +27,8 @@ #include "parser.h" #include "parser.tab.h" #include "compiler.h" +#include "registry.h" +#include "assets.h" #include "../os.h" #ifdef HAVE_SYS_STAT_H #include @@ -113,6 +115,7 @@ a3_parse(); as3_lex_destroy(); finish_file(); + if(fi) fclose(fi); } typedef struct _scheduled_file { @@ -155,7 +158,7 @@ } filename = normalize_path(filename); - + if(dict_contains(scheduled_dict, filename)) { return; //already processed } else { @@ -269,7 +272,8 @@ char*dirname = strdup(package); int s=0; while(dirname[s]) { - if(dirname[s]=='.') dirname[s]='/'; + if(dirname[s]=='.') + dirname[s] = path_seperator; s++; }; if(!as3_schedule_directory(dirname)) @@ -301,22 +305,19 @@ strcpy(filename+t, cls); strcpy(filename+t+l2, ".as"); - char*f=0; - if(!(f=find_file(filename, error))) { + char*f=find_file(filename, error); + if(!f) { int i; - /* try lower case filename (not packagename!), too */ - for(i=t;i='A' && filename[i]<='Z') - filename[i] += 'a'-'A'; - } - if(!(f=find_file(filename, error))) { - if(error) { - strcpy(filename+t, cls); - strcpy(filename+t+l2, ".as"); - as3_warning("Could not open file %s", filename); - } - return; - } + filename = filename_to_lowercase(filename); + f=find_file(filename, error); + } + if(!f) { + if(error) { + strcpy(filename+t, cls); + strcpy(filename+t+l2, ".as"); + as3_warning("Could not open file %s", filename); + } + return; } as3_schedule_file(filename, f); } @@ -343,6 +344,10 @@ } return as3code; } +void* as3_getassets(void*t) +{ + return swf_AssetsToTags((TAG*)t, registry_getassets()); +} char* as3_getglobalclass() { return as3_globalclass; diff -Nru swftools-0.9.0/lib/as3/compiler.h swftools-0.9.2/lib/as3/compiler.h --- swftools-0.9.0/lib/as3/compiler.h 2009-04-06 01:50:17.000000000 +0000 +++ swftools-0.9.2/lib/as3/compiler.h 2012-04-08 17:25:26.000000000 +0000 @@ -1,6 +1,31 @@ +/* compiler.h + + Routines for handling/compiling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008,2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef __as3_compiler_h__ #define __as3_compiler_h__ +void registry_init(); + void as3_setverbosity(int level); void as3_add_include_dir(char*dir); @@ -19,6 +44,7 @@ void as3_warning(const char*format, ...); char* as3_getglobalclass(); void* as3_getcode(); +void* as3_getassets(void*); void as3_destroy(); #endif //__as3_compiler_h__ diff -Nru swftools-0.9.0/lib/as3/expr.c swftools-0.9.2/lib/as3/expr.c --- swftools-0.9.0/lib/as3/expr.c 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/lib/as3/expr.c 2010-11-12 18:55:23.000000000 +0000 @@ -1,4 +1,4 @@ -/* ast.c +/* expr.c Extension module for the rfxswf library. Part of the swftools package. @@ -90,16 +90,6 @@ return type1; return TYPE_ANY; } -static char is_getlocal(code_t*c) -{ - if(!c || c->prev || c->next) - return 0; - return(c->opcode == OPCODE_GETLOCAL - || c->opcode == OPCODE_GETLOCAL_0 - || c->opcode == OPCODE_GETLOCAL_1 - || c->opcode == OPCODE_GETLOCAL_2 - || c->opcode == OPCODE_GETLOCAL_3); -} static int getlocalnr(code_t*c) { if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];} @@ -155,7 +145,8 @@ prefix = abc_dup(prefix); // we need the object, too } use_temp_var = 1; - } else if(m->type == MULTINAMEL || m->type == MULTINAMELA) { + } else if(m->type == MULTINAMEL || m->type == MULTINAMELA || + m->type == RTQNAME || m->type == RTQNAMEA) { if(!justassign) { /* dupping two values on the stack requires 5 operations and one register- couldn't adobe just have given us a dup2? */ @@ -2646,7 +2637,16 @@ typedcode_t node_code_write(node_t*n) { - syntaxerror("not implemented yet"); + typedcode_t t; + t.c = 0; + int tmp = gettempvar(); + t.c = abc_setlocal(t.c, tmp); + code_t*w = toreadwrite(n->code.c, abc_getlocal(0,tmp), 1, 0, 0); + t.c = code_append(t.c, w); + t.c = abc_kill(t.c, tmp); + n->code.c=0; + t.t = n->code.t; + return t; } typedcode_t node_code_read(node_t*n) { @@ -2832,6 +2832,12 @@ return t; } } +typedcode_t node_write(node_t*n) +{ + typedcode_t t = n->type->write(n); + node_free(n); + return t; +} code_t* node_exec(node_t*n) { code_t*c = n->type->exec(n); diff -Nru swftools-0.9.0/lib/as3/expr.h swftools-0.9.2/lib/as3/expr.h --- swftools-0.9.0/lib/as3/expr.h 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/lib/as3/expr.h 2010-11-12 18:55:20.000000000 +0000 @@ -1,4 +1,4 @@ -/* ast.h +/* expr.h Extension module for the rfxswf library. Part of the swftools package. @@ -141,6 +141,7 @@ node_t* mknode3(nodetype_t*t, node_t*one, node_t*two, node_t*three); void node_free(node_t*n); typedcode_t node_read(node_t*n); //read and free +typedcode_t node_write(node_t*n); //write and free code_t* node_exec(node_t*n); //exec and free constant_t node_eval(node_t*n); //eval and free void node_dump(node_t*n); diff -Nru swftools-0.9.0/lib/as3/files.c swftools-0.9.2/lib/as3/files.c --- swftools-0.9.0/lib/as3/files.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/files.c 2010-11-12 18:55:19.000000000 +0000 @@ -27,6 +27,7 @@ #include "files.h" #include "common.h" #include "tokenizer.h" +#include "../os.h" static int verbose = 0; static void dbg(const char*format, ...) @@ -103,17 +104,50 @@ return strdup("."); } } + +char is_absolute(const char*filename) +{ + if(!filename || !filename[0]) + return 0; + if(filename[0]=='/' || filename[0]=='\\') + return 1; + if(filename[1]==':' && filename[2]=='/') + return 1; + if(filename[1]==':' && filename[2]=='\\') + return 1; + return 0; +} + +char* filename_to_lowercase(const char*name) +{ + char*n = strdup(name); + //char*x1 = strrchr(name, '/'); + //char*x2 = strrchr(name, '\\'); + char*s = n; + //if(x1+1>s) s=x1+1; + //if(x2+1>s) s=x2+1; + while(*s) { + /* FIXME: what we probably should do here is use libc's tolower(). + I don't really know yet, though, how Windows (or MacOS X) handles + lowercasing of Unicode filenames */ + if(*s>='A' && *s<='Z') + *s += 'a'-'A'; + s++; + } + return n; +} + char* normalize_path(const char*path) { char*n = 0, *d = 0; - if(path[0] != '/') { + if(!is_absolute(path)) { char buf[512]; char*c = getcwd(buf,512); int l = strlen(buf); d = n = malloc(l+strlen(path)+10); strcpy(n, buf);d += l; - if(!l || n[l-1]!='/') { - *d='/';d++; + if(!l || n[l-1]!=path_seperator) { + *d=path_seperator;d++; } } else { d = n = strdup(path); @@ -122,19 +156,19 @@ char init = 1; while(*s) { - if(init && s[0] == '.' && (s[1]=='/' || s[1]=='\0')) { + if(init && s[0] == '.' && (s[1]==path_seperator || s[1]=='\0')) { if(!s[1]) break; s+=2; init=1; continue; } - if(init && s[0] == '.' && s[1] == '.' && (s[2] == '/' || s[2]=='\0')) { + if(init && s[0] == '.' && s[1] == '.' && (s[2] == path_seperator || s[2]=='\0')) { // step one down char*last = 0; if(d<=n) return 0; *--d = 0; - if(!(last=strrchr(n, '/'))) { + if(!(last=strrchr(n, path_seperator))) { return 0; } d = last+1; @@ -145,13 +179,18 @@ } *d = *s; - if(*s=='/') init=1; + if(*s==path_seperator) init=1; else init=0; d++;s++; } - if(d!=n && d[-1]=='/') + if(d!=n && d[-1]==path_seperator) d--; *d = 0; + +#ifdef LOWERCASE_UPPERCASE + n = filename_to_lowercase(n); +#endif + return n; } static void testnormalize() @@ -174,35 +213,22 @@ TEST("/tmp/../usr/"); } - char* concat_paths(const char*base, const char*add) { int l1 = strlen(base); int l2 = strlen(add); int pos = 0; char*n = 0; - while(l1 && base[l1-1] == '/') + while(l1 && base[l1-1] == path_seperator) l1--; - while(pos < l2 && add[pos] == '/') + while(pos < l2 && add[pos] == path_seperator) pos++; n = (char*)malloc(l1 + (l2-pos) + 2); memcpy(n,base,l1); - n[l1]='/'; + n[l1]=path_seperator; memcpy(&n[l1+1],&add[pos],l2-pos+1); return n; } -char is_absolute(const char*filename) -{ - if(!filename || !filename[0]) - return 0; - if(filename[0]=='/' || filename[0]=='\\') - return 1; - if(filename[1]==':' && filename[1]=='/') - return 1; - if(filename[1]==':' && filename[1]=='\\') - return 1; - return 0; -} char*find_file(const char*filename, char error) { @@ -298,3 +324,4 @@ return include_stack[include_stack_ptr]; } } + diff -Nru swftools-0.9.0/lib/as3/files.h swftools-0.9.2/lib/as3/files.h --- swftools-0.9.0/lib/as3/files.h 2009-04-06 01:50:17.000000000 +0000 +++ swftools-0.9.2/lib/as3/files.h 2010-11-12 18:54:08.000000000 +0000 @@ -43,5 +43,6 @@ char* concat_paths(const char*base, const char*add); char* normalize_path(const char*path); +char* filename_to_lowercase(const char*name); #endif diff -Nru swftools-0.9.0/lib/as3/import.c swftools-0.9.2/lib/as3/import.c --- swftools-0.9.0/lib/as3/import.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/import.c 2010-11-12 18:55:19.000000000 +0000 @@ -23,11 +23,15 @@ #include "abc.h" #include "registry.h" #include "common.h" -#include "common.h" #include "tokenizer.h" +#include "assets.h" #include "../os.h" +#include "../xml.h" +#ifdef HAVE_ZZIP +#include "zzip/lib.h" +#endif -static void import_code(void*_abc, char*filename, int pass); +static void import_code(void*_abc, char*filename, int pass, asset_bundle_t*a); void as3_import_abc(char*filename) { @@ -36,44 +40,200 @@ tag->data = file->data; tag->len = file->len; abc_file_t*abc = swf_ReadABC(tag); - import_code(abc, filename, 0); - import_code(abc, filename, 1); + import_code(abc, filename, 0, 0); + import_code(abc, filename, 1, 0); swf_FreeABC(abc); memfile_close(file); free(tag); } -void as3_import_swf(char*filename) +typedef struct _deps { + const char*name; + struct _deps*next; +} deps_t; + +void as3_import_swf2(reader_t*r, char*filename, dict_t*deps) { - SWF* swf = swf_OpenSWF(filename); - if(!swf) + SWF _swf,*swf=&_swf; + if(swf_ReadSWF2(r, &_swf)<0) return; + swf_FoldAll(swf); + TAG*tag = swf->firstTag; + asset_resolver_t* assets = swf_ParseAssets(swf); + + asset_bundle_list_t* asset_bundles = list_new(); + + dict_t*name2bundle = dict_new(); /* pass 1 */ while(tag) { if(tag->id == ST_DOABC || tag->id == ST_RAWABC) { abc_file_t*abc = swf_ReadABC(tag); - import_code(abc, filename, 0); - swf_FreeABC(abc); + import_code(abc, filename, 0, 0); + NEW(asset_bundle_t, a); + a->file = abc; + if(abc->name) { + dict_put(name2bundle, abc->name, a); + } + list_append(asset_bundles, a); } tag = tag->next; } tag = swf->firstTag; + asset_bundle_list_t*b = asset_bundles; /* pass 2 */ while(tag) { if(tag->id == ST_DOABC || tag->id == ST_RAWABC) { - abc_file_t*abc = swf_ReadABC(tag); - import_code(abc, filename, 1); - swf_FreeABC(abc); + asset_bundle_t*a = b->asset_bundle; + abc_file_t*abc = a->file; + swf_ResolveAssets(assets, abc); + if(deps && abc->name) { + deps_t*d = dict_lookup(deps, abc->name); + while(d) { + if(d->name) { + asset_bundle_t*other = dict_lookup(name2bundle, d->name); + list_append(a->dependencies, other); + } + d = d->next; + } + } + registry_add_asset(a); + import_code(abc, filename, 1, a); + b=b->next; } tag = tag->next; } - swf_FreeTags(swf); - free(swf); + dict_destroy(name2bundle); + list_free(asset_bundles); + + //swf_FreeTags(swf); // FIXME: mem leak +} + +void as3_import_swf(char*filename) +{ + reader_t reader; + reader_init_filereader2(&reader, filename); + as3_import_swf2(&reader, filename, 0); + reader.dealloc(&reader); +} + +#ifdef HAVE_ZZIP +typedef struct _catalog_state { + char*xml_filename; + char in_libraries; + char*library; + char*script; + dict_t*deps; + deps_t*current_deps; + dict_t*name2deps; + dict_t*id2script; + ZZIP_DIR*dir; +} catalog_state_t; + +const char* fa(catalog_state_t*state, xmlattribute_t*attr, const char*name) +{ + while(attr) { + if(!strcmp(attr->name, name)) return attr->value; + attr = attr->next; + } + syntaxerror("error parsing %s: attribute %s missing", state->xml_filename, name); +} + +void catalog_start_tag(xmlconsumer_t*c, char*name, xmlattribute_t*attr) +{ + catalog_state_t*state = (catalog_state_t*)c->internal; + if(!strcmp(name, "libraries")) { + state->in_libraries = 1; + } else if(!strcmp(name, "library")) { + state->library = strdup(fa(state, attr, "path")); + } else if(!strcmp(name, "script")) { + state->script = strdup(fa(state, attr, "name")); + } else if(!strcmp(name, "def")) { + dict_put(state->id2script, strdup(fa(state, attr, "id")), strdup(state->script)); + } else if(!strcmp(name, "dep")) { + NEW(deps_t,d); + d->name = strdup(fa(state, attr, "id")); + d->next = state->current_deps; + state->current_deps = d; + } +} +void catalog_data(xmlconsumer_t*c, char*data, int len) +{ + catalog_state_t*state = (catalog_state_t*)c->internal; +} +void catalog_end_tag(xmlconsumer_t*c, char*name) +{ + catalog_state_t*state = (catalog_state_t*)c->internal; + if(!strcmp(name, "libraries")) { + state->in_libraries = 0; + } else if(!strcmp(name, "library")) { + ZZIP_FILE*file = zzip_file_open(state->dir, state->library, 0); + + DICT_ITERATE_DATA(state->deps,deps_t*,deps) { + while(deps) { + char*script = dict_lookup(state->id2script, deps->name); + if(!script) { + //as3_warning("when importing %s: depencency %s referenced in catalog.xml, but not found.", state->xml_filename, deps->name); + } + deps->name = script; + deps = deps->next; + } + } + + if(!file) { + as3_warning("when importing %s: %s referenced in catalog.xml, but not found.", state->xml_filename, state->library); + } else { + reader_t r; + reader_init_zzipreader(&r, file); + as3_import_swf2(&r, state->library, state->deps); + r.dealloc(&r); + zzip_file_close(file); + } + dict_destroy(state->deps); + state->deps = 0; + free(state->library); + state->library = 0; + } else if(!strcmp(name, "script")) { + dict_put(state->deps, state->script, state->current_deps); + free(state->script); + state->current_deps = 0; + state->script = 0; + } } +void as3_import_zipfile(char*filename) +{ + ZZIP_DIR*dir = zzip_opendir(filename); + if(!dir) as3_error("Error reading %s\n", filename); + ZZIP_FILE*file = zzip_file_open(dir, "catalog.xml", 0); + reader_t r; + reader_init_zzipreader(&r, file); + + xmlconsumer_t c; + catalog_state_t state; + memset(&state, 0, sizeof(state)); + state.dir = dir; + state.xml_filename = filename; + state.name2deps = dict_new(); + state.id2script = dict_new(); + state.deps = dict_new(); + c.start_tag = catalog_start_tag; + c.data= catalog_data; + c.end_tag = catalog_end_tag; + c.internal = &state; + + xml_parse(&r, &c); + + r.dealloc(&r); +} +#else +void as3_import_zipfile(char*filename) +{ + as3_warning("No zipfile support compiled in- can't import %s\n", filename); +} +#endif void as3_import_file(char*filename) { @@ -85,6 +245,8 @@ if(!strncmp(head, "FWS", 3) || !strncmp(head, "CWS", 3)) { as3_import_swf(filename); + } else if(!strncmp(head, "PK", 2)) { + as3_import_zipfile(filename); } else { as3_import_abc(filename); } @@ -129,7 +291,7 @@ return c; } -static void import_code(void*_abc, char*filename, int pass) +static void import_code(void*_abc, char*filename, int pass, asset_bundle_t*asset_bundle) { abc_file_t*abc = _abc; int t; @@ -167,6 +329,8 @@ classinfo_t*c = (classinfo_t*)registry_find(package, name); if(!c) continue; + c->assets = asset_bundle; + int nr = 0; multiname_list_t*i = cls->interfaces; while(i) { @@ -191,28 +355,30 @@ goto cont; const char*name = trait->name->name; char* ns = access==ACCESS_NAMESPACE?strdup(trait->name->ns->name):""; - if(registry_findmember(c, ns, name, 0)) + + if(registry_findmember(c, ns, name, 0, is_static)) goto cont; + name = strdup(name); memberinfo_t*s = 0; if(trait->kind == TRAIT_METHOD) { - s = (memberinfo_t*)methodinfo_register_onclass(c, access, ns, name); + s = (memberinfo_t*)methodinfo_register_onclass(c, access, ns, name, is_static); s->return_type = resolve_class(filename, "return type", trait->method->return_type); dict_put(names, name, 0); } else if(trait->kind == TRAIT_SLOT) { - s = (memberinfo_t*)varinfo_register_onclass(c, access, ns, name); + s = (memberinfo_t*)varinfo_register_onclass(c, access, ns, name, is_static); s->type = resolve_class(filename, "type", trait->type_name); dict_put(names, name, 0); } else if(trait->kind == TRAIT_GETTER) { - s = (memberinfo_t*)varinfo_register_onclass(c, access, ns, name); + s = (memberinfo_t*)varinfo_register_onclass(c, access, ns, name, is_static); s->type = resolve_class(filename, "type", trait->method->return_type); dict_put(names, name, 0); } else if(trait->kind == TRAIT_CONST) { /* some variables (e.g. XML.length) are apparently both a method and a slot. needs split of static/non-static first */ if(!dict_contains(names, name)) { - varinfo_t*v = (varinfo_t*)varinfo_register_onclass(c, access, ns, name); + varinfo_t*v = (varinfo_t*)varinfo_register_onclass(c, access, ns, name, is_static); v->type = resolve_class(filename, "type", trait->type_name); v->flags |= FLAG_CONST; /* leave this alone for now- it blows up the file too much @@ -287,6 +453,6 @@ void as3_import_code(void*_abc) { - import_code(_abc, "", 0); - import_code(_abc, "", 1); + import_code(_abc, "", 0, 0); + import_code(_abc, "", 1, 0); } diff -Nru swftools-0.9.0/lib/as3/initcode.c swftools-0.9.2/lib/as3/initcode.c --- swftools-0.9.0/lib/as3/initcode.c 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/initcode.c 2010-11-12 18:55:26.000000000 +0000 @@ -1,3 +1,26 @@ +/* initcode.c + + Routines for handling/compiling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008,2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include #include "../q.h" #include "abc.h" diff -Nru swftools-0.9.0/lib/as3/initcode.h swftools-0.9.2/lib/as3/initcode.h --- swftools-0.9.0/lib/as3/initcode.h 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/as3/initcode.h 2010-11-12 18:54:09.000000000 +0000 @@ -1,3 +1,26 @@ +/* initcode.h + + Routines for handling/compiling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008,2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef __initcode_h__ #define __initcode_h__ diff -Nru swftools-0.9.0/lib/as3/parser_help.c swftools-0.9.2/lib/as3/parser_help.c --- swftools-0.9.0/lib/as3/parser_help.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/as3/parser_help.c 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,1435 @@ +#include "parser_help.h" + +global_t*global = 0; + +static namespace_t ns1 = {ACCESS_PRIVATE, ""}; +static namespace_t ns2 = {ACCESS_PROTECTED, ""}; +static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""}; +namespace_t stdns = {ACCESS_PACKAGE, ""}; +static namespace_list_t nl4 = {&stdns,0}; +static namespace_list_t nl3 = {&ns3,&nl4}; +static namespace_list_t nl2 = {&ns2,&nl3}; +static namespace_list_t nl1 = {&ns1,&nl2}; +namespace_set_t nopackage_namespace_set = {&nl1}; + +static char* internal_filename_package = 0; +void initialize_file(char*filename) +{ + if(state) { + syntaxerror("invalid call to initialize_file during parsing of another file"); + } + + new_state(); + state->package = internal_filename_package = strdup(filename); + + global->token2info = dict_lookup(global->file2token2info, + current_filename // use long version + ); + if(!global->token2info) { + global->token2info = dict_new2(&ptr_type); + dict_put(global->file2token2info, current_filename, global->token2info); + } + + if(as3_pass==1) { + state->method = rfx_calloc(sizeof(methodstate_t)); + dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method); + state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope + state->method->allvars = dict_new(); + } else { + state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); + state->method->variable_count = 0; + if(!state->method) + syntaxerror("internal error: skewed tokencount"); + function_initvars(state->method, 0, 0, 0, 1); + global->init = 0; + } +} + +void finish_file() +{ + if(!state || state->level!=1) { + syntaxerror("unexpected end of file in pass %d", as3_pass); + } + + if(as3_pass==2) { + dict_del(global->file2token2info, current_filename); + code_t*header = method_header(state->method); + //if(global->init->method->body->code || global->init->traits) { + if(global->init) { + code_t*c = wrap_function(header, 0, global->init->method->body->code); + global->init->method->body->code = abc_returnvoid(c); + free(state->method);state->method=0; + } + } + + //free(state->package);state->package=0; // used in registry + state_destroy(state);state=0; +} + +void initialize_parser() +{ + global = rfx_calloc(sizeof(global_t)); + global->file = abc_file_new(); + global->file->flags &= ~ABCFILE_LAZY; + global->file2token2info = dict_new(); + global->token2info = 0; + global->classinit = abc_initscript(global->file); +} + +void* finish_parser() +{ + dict_free_all(global->file2token2info, 1, (void*)dict_destroy); + global->token2info=0; + + initcode_add_classlist(global->classinit, global->classes); + + return global->file; +} + +variable_t* find_variable(state_t*s, const char*name) +{ + if(s->method->no_variable_scoping) { + return dict_lookup(s->method->allvars, name); + } else { + state_t*top = s; + while(s) { + variable_t*v = 0; + v = dict_lookup(s->vars, name); + if(v) return v; + if(s->new_vars) break; + s = s->old; + } + return 0; + } +} +variable_t* find_slot(methodstate_t*m, const char*name) +{ + if(m && m->slots) + return dict_lookup(m->slots, name); + return 0; +} + +variable_t* find_variable_safe(state_t*s, char*name) +{ + variable_t* v = find_variable(s, name); + if(!v) + syntaxerror("undefined variable: %s", name); + return v; +} + +char variable_exists(char*name) +{ + return dict_contains(state->vars, name); +} + +code_t*defaultvalue(code_t*c, classinfo_t*type) +{ + as3_assert(!type || type->kind!=INFOTYPE_UNRESOLVED); + if(TYPE_IS_INT(type)) { + c = abc_pushbyte(c, 0); + } else if(TYPE_IS_UINT(type)) { + c = abc_pushuint(c, 0); + } else if(TYPE_IS_FLOAT(type)) { + c = abc_pushnan(c); + } else if(TYPE_IS_BOOLEAN(type)) { + c = abc_pushfalse(c); + } else if(TYPE_IS_STRING(type)) { + c = abc_pushnull(c); + c = abc_coerce_s(c); + } else if(!type) { + //c = abc_pushundefined(c); + syntaxerror("internal error: can't generate default value for * type"); + } else { + c = abc_pushnull(c); + MULTINAME(m, type); + c = abc_coerce2(c, &m); + } + return c; +} + +int alloc_local() +{ + return state->method->variable_count++; +} + +variable_t* new_variable2(methodstate_t*method, const char*name, classinfo_t*type, char init, char maybeslot) +{ + if(maybeslot) { + variable_t*v = find_slot(method, name); + if(v) { + alloc_local(); + return v; + } + } + + NEW(variable_t, v); + v->type = type; + v->init = v->kill = init; + + if(name) { + if(!method->no_variable_scoping) { + if(dict_contains(state->vars, name)) { + syntaxerror("variable %s already defined", name); + } + v->index = alloc_local(); + dict_put(state->vars, name, v); + } else { + if(as3_pass==2 && dict_contains(state->method->allvars, name)) { + variable_t*v = dict_lookup(state->method->allvars, name); + if(v->type != type && (!v->type || v->type->kind!=INFOTYPE_UNRESOLVED)) { + syntaxerror("variable %s already defined.", name); + } + return v; + } + v->index = alloc_local(); + } + dict_put(state->method->allvars, name, v); + } else { + v->index = alloc_local(); + } + return v; +} +int new_variable(methodstate_t*method, const char*name, classinfo_t*type, char init, char maybeslot) +{ + return new_variable2(method, name, type, init, maybeslot)->index; +} + +#define TEMPVARNAME "__as3_temp__" +int gettempvar() +{ + variable_t*v = find_variable(state, TEMPVARNAME); + int i; + if(v) + i = v->index; + else + i = new_variable(state->method, TEMPVARNAME, 0, 0, 0); + as3_assert(i); + return i; +} +code_t* var_block(code_t*body, dict_t*vars) +{ + code_t*c = 0; + code_t*k = 0; + int t; + DICT_ITERATE_DATA(vars, variable_t*, v) { + if(v->type && v->init) { + c = defaultvalue(c, v->type); + c = abc_setlocal(c, v->index); + } + if(v->type && v->kill) { + k = abc_kill(k, v->index); + } + } + + if(k) { + code_t*x = body; + while(x) { + if(x->opcode== OPCODE___BREAK__ || + x->opcode== OPCODE___CONTINUE__) { + /* link kill code before break/continue */ + code_t*e = code_dup(k); + code_t*s = code_start(e); + s->prev = x->prev; + if(x->prev) { + x->prev->next = s; + } + e->next = x; + x->prev = e; + } + x = x->prev; + } + } + + c = code_append(c, body); + c = code_append(c, k); + return c; +} + +void unknown_variable(char*name) +{ + if(!state->method->unresolved_variables) + state->method->unresolved_variables = dict_new(); + if(!dict_contains(state->method->unresolved_variables, name)) + dict_put(state->method->unresolved_variables, name, 0); +} +code_t* add_scope_code(code_t*c, methodstate_t*m, char init) +{ + if(m->uses_slots || m->innerfunctions || (m->late_binding && !m->inner)) { + c = abc_getlocal_0(c); + c = abc_pushscope(c); + } + if(m->uses_slots) { + /* FIXME: this alloc_local() causes variable indexes to be + different in pass2 than in pass1 */ + if(!m->activation_var) { + m->activation_var = alloc_local(); + } + if(init) { + c = abc_newactivation(c); + c = abc_dup(c); + c = abc_pushscope(c); + c = abc_setlocal(c, m->activation_var); + } else { + c = abc_getlocal(c, m->activation_var); + c = abc_pushscope(c); + } + } + return c; +} + +code_t* method_header(methodstate_t*m) +{ + code_t*c = 0; + + c = add_scope_code(c, m, 1); + + methodstate_list_t*l = m->innerfunctions; + while(l) { + as3_assert(l->methodstate->abc); + if(m->uses_slots && l->methodstate->is_a_slot) { + c = abc_getscopeobject(c, 1); + c = abc_newfunction(c, l->methodstate->abc); + c = abc_dup(c); + c = abc_setlocal(c, l->methodstate->var_index); + c = abc_setslot(c, l->methodstate->slot_index); + } else { + c = abc_newfunction(c, l->methodstate->abc); + c = abc_setlocal(c, l->methodstate->var_index); + } + free(l->methodstate);l->methodstate=0; + l = l->next; + } + if(m->header) { + c = code_append(c, m->header); + m->header = 0; + } + if(m->is_constructor && !m->has_super) { + // call default constructor + c = abc_getlocal_0(c); + c = abc_constructsuper(c, 0); + } + + if(m->slots) { + /* all parameters that are used by inner functions + need to be copied from local to slot */ + as3_assert(m->activation_var); + DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) { + if(v->is_parameter) { + c = abc_getlocal(c, m->activation_var); + c = abc_getlocal(c, v->index); + c = abc_setslot(c, v->index); + } + } + } + list_free(m->innerfunctions); + m->innerfunctions = 0; + return c; +} + + +code_t* wrap_function(code_t*c,code_t*header, code_t*body) +{ + c = code_append(c, header); + c = code_append(c, var_block(body, state->method->no_variable_scoping?state->method->allvars:state->vars)); + /* append return if necessary */ + if(!c || (c->opcode != OPCODE_RETURNVOID && + c->opcode != OPCODE_RETURNVALUE)) { + c = abc_returnvoid(c); + } + return c; +} + +void startpackage(char*name) +{ + new_state(); + state->package = strdup(name); +} +void endpackage() +{ + //used e.g. in classinfo_register: + //free(state->package);state->package=0; + old_state(); +} + +const char* lookup_namespace(const char*name) +{ + state_t*s = state; + while(s) { + const char*url = dict_lookup(s->namespaces, name); + if(url) + return url; + s = s->old; + } + varinfo_t*a; + registry_find(state->package, name); + if(( a = (varinfo_t*)find_class(name) )) { + if(a->kind == INFOTYPE_VAR) { + if(!a->value || !NS_TYPE(a->value->type)) + syntaxerror("%s.%s is not a namespace", a->package, a->name); + return a->value->ns->name; + } + } + return 0; +} + +namespace_t modifiers2access(modifiers_t*mod) +{ + namespace_t ns; + ns.access = 0; + ns.name = ""; + if(mod->flags&FLAG_NAMESPACE) { + if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels and namespaces"); + ns.access = ACCESS_NAMESPACE; + const char*url = lookup_namespace(mod->ns); + if(!url) { + if(as3_pass>1) { + syntaxerror("unknown namespace: %s (pass %d)", mod->ns, as3_pass); + } else { + url = mod->ns; + } + } + ns.name = url; + } else if(mod->flags&FLAG_PUBLIC) { + if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels"); + ns.access = ACCESS_PACKAGE; + } else if(mod->flags&FLAG_PRIVATE) { + if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels"); + ns.access = ACCESS_PRIVATE; + } else if(mod->flags&FLAG_PROTECTED) { + if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels"); + ns.access = ACCESS_PROTECTED; + } else { + ns.access = ACCESS_PACKAGEINTERNAL; + } + return ns; +} + +memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse, char is_static) +{ + return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse, is_static); +} + +void innerfunctions2vars(methodstate_t*m) +{ + methodstate_list_t*l = m->innerfunctions; + while(l) { + methodstate_t*m = l->methodstate; + variable_t* v = new_variable2(state->method, m->info->name, TYPE_FUNCTION(m->info), 0, 0); + m->var_index = v->index; + if(m->is_a_slot) + m->slot_index = m->is_a_slot; + v->is_inner_method = m; + l = l->next; + } +} + +void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0) +{ + if(var0) { + int index = -1; + if(m->inner) + index = new_variable(m, "this", 0, 0, 0); + else if(!m->is_global) + index = new_variable(m, (flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0); + else + index = new_variable(m, "globalscope", 0, 0, 0); + if(index) { + DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) { + printf("%s %d\n", name, v->index); + } + } + as3_assert(!index); + } + + if(has_params) { + param_list_t*p=0; + for(p=params->list;p;p=p->next) { + variable_t*v = new_variable2(m, p->param->name, p->param->type, 0, 1); + v->is_parameter = 1; + } + if(as3_pass==2 && m->need_arguments) { + /* arguments can never be used by an innerfunction (the inner functions + have their own arguments var), so it's ok to not initialize this until + pass 2. (We don't know whether we need it before, anyway) */ + variable_t*v = new_variable2(m, "arguments", TYPE_ARRAY, 0, 0); + m->need_arguments = v->index; + } + } + + innerfunctions2vars(m); + + if(as3_pass==2) { + m->scope_code = add_scope_code(m->scope_code, m, 0); + if(m->slots) { + /* exchange unresolved identifiers with the actual objects */ + DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v1) { + if(v1->type && v1->type->kind == INFOTYPE_UNRESOLVED) { + classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v1->type); + if(!type || type->kind != INFOTYPE_CLASS) { + syntaxerror("Couldn't find class %s::%s (%s)", v1->type->package, v1->type->name, name); + } + v1->type = type; + } + } + } + if(m->allvars) { + DICT_ITERATE_ITEMS(m->allvars, char*, name2, variable_t*, v2) { + if(v2->type && v2->type->kind == INFOTYPE_UNRESOLVED) { + classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v2->type); + if(!type || type->kind != INFOTYPE_CLASS) { + syntaxerror("Couldn't find class %s::%s (%s)", v2->type->package, v2->type->name, name2); + } + v2->type = type; + } + } + } + } +} + +char*as3_globalclass=0; +void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements) +{ + if(state->cls) { + syntaxerror("inner classes now allowed"); + } + + new_state(); + token_list_t*t=0; + classinfo_list_t*mlist=0; + + if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE)) + syntaxerror("invalid modifier(s)"); + + if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) + syntaxerror("public and internal not supported at the same time."); + + if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC)) + syntaxerror("protected and static not supported at the same time."); + + //if(!(mod->flags&FLAG_INTERFACE) && !extends) { + if(!(mod->flags&FLAG_INTERFACE) && !extends) { + // all classes extend object + extends = registry_getobjectclass(); + } + + /* create the class name, together with the proper attributes */ + int access=0; + char*package=0; + + if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) { + access = ACCESS_PRIVATE; package = internal_filename_package; + } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) { + access = ACCESS_PACKAGEINTERNAL; package = state->package; + } else if(state->package!=internal_filename_package) { + access = ACCESS_PACKAGE; package = state->package; + } else { + syntaxerror("public classes only allowed inside a package"); + } + + if(as3_pass==1) { + state->cls = rfx_calloc(sizeof(classstate_t)); + state->cls->init = methodstate_new(); + state->cls->static_init = methodstate_new(); + state->cls->static_init->is_static=FLAG_STATIC; + /* notice: we make no effort to initialize the top variable (local0) here, + even though it has special meaning. We just rely on the fact + that pass 1 won't do anything with variables */ + + dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls); + + /* set current method to constructor- all code within the class-level (except + static variable initializations) will be executed during construction time */ + state->method = state->cls->init; + + if(registry_find(package, classname)) { + syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname); + } + /* build info struct */ + int num_interfaces = (list_length(implements)); + state->cls->info = classinfo_register(access, package, classname, num_interfaces); + state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL); + state->cls->info->superclass = extends; + + int pos = 0; + classinfo_list_t*l = implements; + for(l=implements;l;l=l->next) { + state->cls->info->interfaces[pos++] = l->classinfo; + } + } + + if(as3_pass == 2) { + state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); + + as3_assert(state->cls && state->cls->info); + + state->method = state->cls->static_init; + + function_initvars(state->cls->init, 0, 0, 0, 1); + state->cls->static_init->variable_count=1; + function_initvars(state->cls->static_init, 0, 0, 0, 0); + + if(extends && (extends->flags & FLAG_FINAL)) + syntaxerror("Can't extend final class '%s'", extends->name); + + int pos = 0; + while(state->cls->info->interfaces[pos]) { + if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE)) + syntaxerror("'%s' is not an interface", + state->cls->info->interfaces[pos]->name); + pos++; + } + + /* generate the abc code for this class */ + MULTINAME(classname2,state->cls->info); + multiname_t*extends2 = sig2mname(extends); + + /* don't add the class to the class index just yet- that will be done later + by initscript */ + state->cls->abc = abc_class_new(0, &classname2, extends2); + state->cls->abc->file = global->file; + + multiname_destroy(extends2); + if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc); + if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc); + if(state->cls->info->flags&FLAG_INTERFACE) { + abc_class_interface(state->cls->abc); + } + + for(mlist=implements;mlist;mlist=mlist->next) { + MULTINAME(m, mlist->classinfo); + abc_class_add_interface(state->cls->abc, &m); + } + + state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc); + list_append(global->classes, state->cls->dependencies); + + /* flash.display.MovieClip handling */ + if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) { + if(state->package && state->package[0]) { + as3_globalclass = concat3(state->package, ".", classname); + } else { + as3_globalclass = strdup(classname); + } + } + } +} + +void endclass() +{ + if(as3_pass == 2) { + if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) { + code_t*c = 0; + c = abc_getlocal_0(c); + c = abc_constructsuper(c, 0); + state->cls->init->header = code_append(state->cls->init->header, c); + state->cls->has_constructor=1; + } + if(state->cls->init) { + if(state->cls->info->flags&FLAG_INTERFACE) { + if(state->cls->init->header) + syntaxerror("interface can not have class-level code"); + } else { + abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0); + code_t*c = method_header(state->cls->init); + m->body->code = wrap_function(c, 0, m->body->code); + } + } + if(state->cls->static_init) { + abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0); + code_t*c = method_header(state->cls->static_init); + m->body->code = wrap_function(c, 0, m->body->code); + } + + trait_list_t*trait = state->cls->abc->traits; + /* switch all protected members to the protected ns of this class */ + while(trait) { + trait_t*t = trait->trait; + if(t->name->ns->access == ACCESS_PROTECTED) { + if(!state->cls->abc->protectedNS) { + char*n = concat3(state->cls->info->package, ":", state->cls->info->name); + state->cls->abc->protectedNS = namespace_new_protected(n); + state->cls->abc->flags |= CLASS_PROTECTED_NS; + } + t->name->ns->name = strdup(state->cls->abc->protectedNS->name); + } + trait = trait->next; + } + } + + old_state(); +} + +void check_code_for_break(code_t*c) +{ + while(c) { + if(c->opcode == OPCODE___BREAK__) { + char*name = string_cstr(c->data[0]); + syntaxerror("Unresolved \"break %s\"", name); + } + if(c->opcode == OPCODE___CONTINUE__) { + char*name = string_cstr(c->data[0]); + syntaxerror("Unresolved \"continue %s\"", name); + } + if(c->opcode == OPCODE___RETHROW__) { + syntaxerror("Unresolved \"rethrow\""); + } + if(c->opcode == OPCODE___FALLTHROUGH__) { + syntaxerror("Unresolved \"fallthrough\""); + } + if(c->opcode == OPCODE___PUSHPACKAGE__) { + char*name = string_cstr(c->data[0]); + syntaxerror("Can't reference a package (%s) as such", name); + } + c=c->prev; + } +} + +void check_constant_against_type(classinfo_t*t, constant_t*c) +{ +#define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name) + if(TYPE_IS_NUMBER(t)) { + xassert(c->type == CONSTANT_FLOAT + || c->type == CONSTANT_INT + || c->type == CONSTANT_UINT); + } else if(TYPE_IS_UINT(t)) { + xassert(c->type == CONSTANT_UINT || + (c->type == CONSTANT_INT && c->i>=0)); + } else if(TYPE_IS_INT(t)) { + xassert(c->type == CONSTANT_INT); + } else if(TYPE_IS_BOOLEAN(t)) { + xassert(c->type == CONSTANT_TRUE + || c->type == CONSTANT_FALSE); + } +} + +void check_override(memberinfo_t*m, int flags) +{ + if(!m) + return; + if(m->parent == state->cls->info && !((flags^m->flags)&FLAG_STATIC)) + syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name); + if(!m->parent) + syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name); + if(m->access==ACCESS_PRIVATE) + return; + if(m->flags & FLAG_FINAL) + syntaxerror("can't override final member %s", m->name); + + /* allow this. it's no issue. + if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC)) + syntaxerror("can't override static member %s", m->name);*/ + + if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC)) + syntaxerror("can't override non-static member %s with static declaration", m->name); + + if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) { + if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) { + if(m->kind == INFOTYPE_METHOD) + syntaxerror("can't override without explicit 'override' declaration"); + else + syntaxerror("can't override '%s'", m->name); + } + } +} + +methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot) +{ + methodinfo_t*minfo = 0; + namespace_t ns = modifiers2access(mod); + if(!state->cls) { + //package method + minfo = methodinfo_register_global(ns.access, state->package, name); + minfo->return_type = return_type; + } else if(getset != KW_GET && getset != KW_SET) { + //class method + memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0, mod->flags&FLAG_STATIC); + if(m) { + syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name); + } + minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name, mod->flags&FLAG_STATIC); + minfo->return_type = return_type; + // getslot on a member slot only returns "undefined", so no need + // to actually store these + //state->minfo->slot = state->method->abc->method->trait->slot_id; + } else { + //class getter/setter + int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET; + classinfo_t*type=0; + if(getset == KW_GET) { + type = return_type; + } else if(params->list && params->list->param && !params->list->next) { + type = params->list->param->type; + } else + syntaxerror("setter function needs to take exactly one argument"); + // not sure wether to look into superclasses here, too + minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1, mod->flags&FLAG_STATIC); + if(minfo) { + if(minfo->kind!=INFOTYPE_VAR) + syntaxerror("class already contains a method called '%s'", name); + if(!(minfo->subtype & (SUBTYPE_GETSET))) + syntaxerror("class already contains a field called '%s'", name); + if(minfo->subtype & gs) + syntaxerror("getter/setter for '%s' already defined", name); + /* make a setter or getter into a getset */ + minfo->subtype |= gs; + + /* + FIXME: this check needs to be done in pass 2 + + if((!minfo->return_type != !type) || + (minfo->return_type && type && + !strcmp(minfo->return_type->name, type->name))) { + syntaxerror("different type in getter and setter: %s and %s", + minfo->return_type?minfo->return_type->name:"*", + type?type->name:"*"); + }*/ + } else { + minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name, mod->flags&FLAG_STATIC); + minfo->kind = INFOTYPE_VAR; //hack + minfo->subtype = gs; + minfo->return_type = type; + } + + /* can't assign a slot as getter and setter might have different slots */ + //minfo->slot = slot; + } + if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL; + if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC; + if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE; + + return minfo; +} + +void innerfunction(char*name, params_t*params, classinfo_t*return_type) +{ + //as3_assert(state->method && state->method->info); + + methodstate_t*parent_method = state->method; + variable_t*v = 0; + + if(as3_pass==1) { + return_type = 0; // not valid in pass 1 + if(name) { + v = new_variable2(parent_method, name, 0, 0, 0); + } + } + + new_state(); + state->new_vars = 1; + + if(as3_pass == 1) { + state->method = methodstate_new(); + state->method->inner = 1; + state->method->is_static = parent_method->is_static; + state->method->variable_count = 0; + state->method->abc = rfx_calloc(sizeof(abc_method_t)); + if(v) { + v->is_inner_method = state->method; + } + + NEW(methodinfo_t,minfo); + minfo->kind = INFOTYPE_METHOD; + minfo->access = ACCESS_PACKAGEINTERNAL; + minfo->name = name; + state->method->info = minfo; + + if(parent_method) + list_append(parent_method->innerfunctions, state->method); + + dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method); + + function_initvars(state->method, 1, params, 0, 1); + } + + if(as3_pass == 2) { + state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); + state->method->variable_count = 0; + as3_assert(state->method); + + state->method->info->return_type = return_type; + function_initvars(state->method, 1, params, 0, 1); + } +} + + +void startfunction(modifiers_t*mod, enum yytokentype getset, char*name, + params_t*params, classinfo_t*return_type) +{ + if(state->method && state->method->info) { + syntaxerror("not able to start another method scope"); + } + new_state(); + state->new_vars = 1; + + if(as3_pass == 1) { + state->method = methodstate_new(); + state->method->has_super = 0; + state->method->is_static = mod->flags&FLAG_STATIC; + + if(state->cls) { + state->method->is_constructor = !strcmp(state->cls->info->name,name); + } else { + state->method->is_global = 1; + state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack + } + if(state->method->is_constructor) + name = "__as3_constructor__"; + + state->method->info = registerfunction(getset, mod, name, params, return_type, 0); + + function_initvars(state->method, 1, params, mod->flags, 1); + + dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method); + } + + if(as3_pass == 2) { + state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); + + if(!state->method->no_variable_scoping) + state->method->variable_count = 0; + + as3_assert(state->method); + + if(state->cls) { + memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2, mod->flags&FLAG_STATIC); + check_override(m, mod->flags); + } + + if(state->cls) { + state->cls->has_constructor |= state->method->is_constructor; + } + + function_initvars(state->method, 1, params, mod->flags, 1); + } +} + +void insert_unresolved(methodstate_t*m, dict_t*xvars, dict_t*allvars) +{ + as3_assert(m->inner); + if(m->unresolved_variables) { + dict_t*d = m->unresolved_variables; + int t; + DICT_ITERATE_KEY(d, char*, id) { + /* check parent method's variables */ + variable_t*v; + if(dict_contains(allvars, id)) { + m->uses_parent_function = 1; + state->method->uses_slots = 1; + dict_put(xvars, id, 0); + } + } + } + methodstate_list_t*ml = m->innerfunctions; + while(ml) { + insert_unresolved(ml->methodstate, xvars, allvars); + ml = ml->next; + } +} + +abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, + char*name, params_t*params, classinfo_t*return_type, + code_t*body) +{ + if(as3_pass==1) { + dict_t*xvars = dict_new(); + + if(state->method->unresolved_variables) { + DICT_ITERATE_KEY(state->method->unresolved_variables, char*, vname) { + if(!state->method->no_variable_scoping && dict_contains(state->method->allvars, vname)) { + variable_t*v = dict_lookup(state->method->allvars, vname); + if(!v->is_inner_method) { + state->method->no_variable_scoping = 1; + as3_warning("function %s uses forward or outer block variable references (%s): switching into compatibility mode", name, vname); + } + } + } + } + + methodstate_list_t*ml = state->method->innerfunctions; + while(ml) { + insert_unresolved(ml->methodstate, xvars, state->method->allvars); + ml = ml->next; + } + + if(state->method->uses_slots) { + state->method->slots = dict_new(); + int i = 1; + DICT_ITERATE_ITEMS(state->method->allvars, char*, name, variable_t*, v) { + if(!name) syntaxerror("internal error"); + if(v->index && dict_contains(xvars, name)) { + v->init = v->kill = 0; + v->index = i; + if(v->is_inner_method) { + v->is_inner_method->is_a_slot = i; + } + i++; + dict_put(state->method->slots, name, v); + } + } + state->method->uses_slots = i; + dict_destroy(state->vars);state->vars = 0; + as3_assert(state->new_vars); + } + old_state(); + return 0; + } + + if(as3_pass==2) { + /*if(state->method->uses_parent_function){ + syntaxerror("accessing variables of parent function from inner functions not supported yet"); + }*/ + + abc_method_t*f = 0; + + multiname_t*type2 = sig2mname(return_type); + int slot = 0; + if(state->method->inner) { + f = state->method->abc; + abc_method_init(f, global->file, type2, 1); + } else if(state->method->is_constructor) { + f = abc_class_getconstructor(state->cls->abc, type2); + } else if(!state->method->is_global) { + namespace_t ns = modifiers2access(mod); + multiname_t mname = {QNAME, &ns, 0, name}; + if(mod->flags&FLAG_STATIC) + f = abc_class_staticmethod(state->cls->abc, type2, &mname); + else + f = abc_class_method(state->cls->abc, type2, &mname); + slot = f->trait->slot_id; + } else { + namespace_t mname_ns = {state->method->info->access, state->package}; + multiname_t mname = {QNAME, &mname_ns, 0, name}; + + f = abc_method_new(global->file, type2, 1); + if(!global->init) global->init = abc_initscript(global->file); + trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f); + //abc_code_t*c = global->init->method->body->code; + } + //flash doesn't seem to allow us to access function slots + //state->method->info->slot = slot; + + if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE; + if(getset == KW_GET) f->trait->kind = TRAIT_GETTER; + if(getset == KW_SET) f->trait->kind = TRAIT_SETTER; + if(params->varargs) f->flags |= METHOD_NEED_REST; + if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS; + + char opt=0; + param_list_t*p=0; + for(p=params->list;p;p=p->next) { + if(params->varargs && !p->next) { + break; //varargs: omit last parameter in function signature + } + multiname_t*m = sig2mname(p->param->type); + list_append(f->parameters, m); + if(p->param->value) { + check_constant_against_type(p->param->type, p->param->value); + opt=1;list_append(f->optional_parameters, p->param->value); + } else if(opt) { + syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name); + } + } + if(state->method->slots) { + DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) { + if(v->index) { + multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name); + multiname_t*type = sig2mname(v->type); + trait_t*t = trait_new_member(&f->body->traits, type, mname, 0); + t->slot_id = v->index; + } + } + } + + check_code_for_break(body); + + /* Seems this works now. + if(state->method->exceptions && state->method->uses_slots) { + as3_warning("try/catch and activation not supported yet within the same method"); + }*/ + + if(f->body) { + f->body->code = body; + f->body->exceptions = state->method->exceptions; + } else { //interface + if(body) + syntaxerror("interface methods can't have a method body"); + } + + old_state(); + return f; + } + + return 0; +} + +void breakjumpsto(code_t*c, char*name, code_t*jump) +{ + while(c) { + if(c->opcode == OPCODE___BREAK__) { + string_t*name2 = c->data[0]; + if(!name2->len || !strncmp(name2->str, name, name2->len)) { + c->opcode = OPCODE_JUMP; + c->branch = jump; + } + } + c=c->prev; + } +} + +void continuejumpsto(code_t*c, char*name, code_t*jump) +{ + while(c) { + if(c->opcode == OPCODE___CONTINUE__) { + string_t*name2 = c->data[0]; + if(!name2->len || !strncmp(name2->str, name, name2->len)) { + c->opcode = OPCODE_JUMP; + c->branch = jump; + } + } + c = c->prev; + } +} + +code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to) +{ + if(from==to) + return c; + if(!to) { + return abc_coerce_a(c); + } + MULTINAME(m, to); + if(!from) { + // cast an "any" type to a specific type. subject to + // runtime exceptions + return abc_coerce2(c, &m); + } + + if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) && + (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) { + // allow conversion between number types + if(TYPE_IS_UINT(to)) + return abc_convert_u(c); + else if(TYPE_IS_INT(to)) + return abc_convert_i(c); + else if(TYPE_IS_NUMBER(to)) + return abc_convert_d(c); + return abc_coerce2(c, &m); + } + /* allow conversion from string to number */ + if(TYPE_IS_STRING(from) && TYPE_IS_NUMBER(to)) { + return abc_convert_d(c); + } + + if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from)) + return c; + + if(TYPE_IS_BOOLEAN(to)) + return abc_convert_b(c); + if(TYPE_IS_STRING(to)) + return abc_convert_s(c); + if(TYPE_IS_OBJECT(to)) + return abc_coerce2(c, &m); + if(TYPE_IS_OBJECT(from) && TYPE_IS_XMLLIST(to)) + return abc_coerce2(c, &m); + if(TYPE_IS_OBJECT(from) && TYPE_IS_ARRAY(to)) + return abc_coerce2(c, &m); + + classinfo_t*supertype = from; + while(supertype) { + if(supertype == to) { + /* target type is one of from's superclasses. + (not sure we need this coerce - as far as the verifier + is concerned, object==object (i think) */ + return abc_coerce2(c, &m); + } + int t=0; + while(supertype->interfaces[t]) { + if(supertype->interfaces[t]==to) { + // target type is one of from's interfaces + return abc_coerce2(c, &m); + } + t++; + } + supertype = supertype->superclass; + } + if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to)) + return c; + if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to)) + return c; + if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to)) + return c; + + + as3_error("can't convert type %s%s%s to %s%s%s", + from->package, from->package[0]?".":"", from->name, + to->package, to->package[0]?".":"", to->name); + + return c; +} + +code_t* coerce_to_type(code_t*c, classinfo_t*t) +{ + if(!t) { + return abc_coerce_a(c); + } else if(TYPE_IS_STRING(t)) { + return abc_coerce_s(c); + } else { + MULTINAME(m, t); + return abc_coerce2(c, &m); + } +} + +char is_pushundefined(code_t*c) +{ + return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED); +} + +const char* get_package_from_name(const char*name) +{ + /* try explicit imports */ + dictentry_t* e = dict_get_slot(state->imports, name); + while(e) { + if(!strcmp(e->key, name)) { + slotinfo_t*c = (slotinfo_t*)e->data; + if(c) return c->package; + } + e = e->next; + } + return 0; +} + +namespace_list_t*get_current_imports() +{ + namespace_list_t*searchlist = 0; + + list_append(searchlist, namespace_new_package(state->package)); + + import_list_t*l = state->wildcard_imports; + while(l) { + namespace_t*ns = namespace_new_package(l->import->package); + list_append(searchlist, ns); + l = l->next; + } + list_append(searchlist, namespace_new_package("")); + list_append(searchlist, namespace_new_package(internal_filename_package)); + return searchlist; +} + +slotinfo_t* find_class(const char*name) +{ + slotinfo_t*c=0; + + c = registry_find(state->package, name); + if(c) return c; + + /* try explicit imports */ + dictentry_t* e = dict_get_slot(state->imports, name); + if(c) return c; + while(e) { + if(!strcmp(e->key, name)) { + c = (slotinfo_t*)e->data; + if(c) return c; + } + e = e->next; + } + + /* try package.* imports */ + import_list_t*l = state->wildcard_imports; + while(l) { + //printf("does package %s contain a class %s?\n", l->import->package, name); + c = registry_find(l->import->package, name); + if(c) return c; + l = l->next; + } + + /* try global package */ + c = registry_find("", name); + if(c) return c; + + /* try local "filename" package */ + c = registry_find(internal_filename_package, name); + if(c) return c; + + return 0; +} + +typedcode_t push_class(slotinfo_t*a) +{ + typedcode_t x; + x.c = 0; + x.t = 0; + if(a->access == ACCESS_PACKAGEINTERNAL && + strcmp(a->package, state->package) && + strcmp(a->package, internal_filename_package) + ) { + syntaxerror("Can't access internal %s %s in package '%s' from package '%s'", + infotypename(a), a->name, a->package, state->package); + } + + + if(a->kind != INFOTYPE_CLASS) { + MULTINAME(m, a); + x.c = abc_findpropstrict2(x.c, &m); + x.c = abc_getproperty2(x.c, &m); + if(a->kind == INFOTYPE_METHOD) { + methodinfo_t*f = (methodinfo_t*)a; + x.t = TYPE_FUNCTION(f); + } else { + varinfo_t*v = (varinfo_t*)a; + x.t = v->type; + } + return x; + } else { + if(state->cls && state->method == state->cls->static_init) { + /* we're in the static initializer. + record the fact that we're using this class here */ + parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a); + } + classinfo_t*c = (classinfo_t*)a; + //if(c->slot) { + if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global + x.c = abc_getglobalscope(x.c); + x.c = abc_getslot(x.c, c->slot); + } else { + MULTINAME(m, c); + x.c = abc_getlex2(x.c, &m); + } + x.t = TYPE_CLASS(c); + } + return x; +} + +char is_break_or_jump(code_t*c) +{ + if(!c) + return 0; + if(c->opcode == OPCODE_JUMP || + c->opcode == OPCODE___BREAK__ || + c->opcode == OPCODE___CONTINUE__ || + c->opcode == OPCODE_THROW || + c->opcode == OPCODE_RETURNVOID || + c->opcode == OPCODE_RETURNVALUE) { + return 1; + } + return 0; +} + +#define IS_FINALLY_TARGET(op) \ + ((op) == OPCODE___CONTINUE__ || \ + (op) == OPCODE___BREAK__ || \ + (op) == OPCODE_RETURNVOID || \ + (op) == OPCODE_RETURNVALUE || \ + (op) == OPCODE___RETHROW__) + +static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar) +{ +#define NEED_EXTRA_STACK_ARG + code_t*finally_label = abc_nop(0); + NEW(lookupswitch_t, l); + //_lookupswitch + + code_t*i = c; + int count=0; + while(i) { + code_t*prev = i->prev; + if(IS_FINALLY_TARGET(i->opcode)) { + code_t*p = prev; + char needvalue=0; + if(i->opcode == OPCODE___RETHROW__ || + i->opcode == OPCODE_RETURNVALUE) { + if(i->opcode == OPCODE___RETHROW__) + i->opcode = OPCODE_THROW; + needvalue=1; + p = abc_coerce_a(p); + p = abc_setlocal(p, tempvar); + } + p = abc_pushbyte(p, count++); + p = abc_jump(p, finally_label); + code_t*target = p = abc_label(p); +#ifdef NEED_EXTRA_STACK_ARG + p = abc_pop(p); +#endif + if(needvalue) { + p = abc_getlocal(p, tempvar); + } + + p->next = i;i->prev = p; + list_append(l->targets, target); + } + i = prev; + } + + code_t*j,*f; + c = abc_pushbyte(c, -1); + c = code_append(c, finally_label); + c = code_append(c, finally); + +#ifdef NEED_EXTRA_STACK_ARG + c = abc_dup(c); +#endif + c = abc_lookupswitch(c, l); + c = l->def = abc_label(c); +#ifdef NEED_EXTRA_STACK_ARG + c = abc_pop(c); +#endif + + return c; +} + +static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar) +{ + code_t*i = c; + while(i) { + code_t*prev = i->prev; + if(IS_FINALLY_TARGET(i->opcode)) { + if(i->opcode == OPCODE___RETHROW__) + i->opcode = OPCODE_THROW; + code_t*end = code_dup(finally); + code_t*start = code_start(end); + if(prev) prev->next = start; + start->prev = prev; + i->prev = end; + end->next = i; + } + i = prev; + } + return code_append(c, finally); +} + +code_t* insert_finally(code_t*c, code_t*finally, int tempvar) +{ + if(!finally) + return c; + code_t*i = c; + char cantdup=0; + int num_insertion_points=0; + while(i) { + if(IS_FINALLY_TARGET(i->opcode)) + num_insertion_points++; + i = i->prev; + } + i = finally; + int code_size=0; + while(i) { + code_size++; + if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) { + cantdup=1; + } + i = i->prev; + } + int simple_version_cost = (1+num_insertion_points)*code_size; + int lookup_version_cost = 4*num_insertion_points + 5; + + if(cantdup || simple_version_cost > lookup_version_cost) { + //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost); + return insert_finally_lookup(c, finally, tempvar); + } else { + //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost); + return insert_finally_simple(c, finally, tempvar); + } +} + diff -Nru swftools-0.9.0/lib/as3/parser_help.h swftools-0.9.2/lib/as3/parser_help.h --- swftools-0.9.0/lib/as3/parser_help.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/as3/parser_help.h 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,132 @@ +#ifndef __parse_help__ +#define __parse_help__ + +#include "state.h" +#include "expr.h" +#include "tokenizer.h" +#include "common.h" + +typedef struct _global { + abc_file_t*file; + + parsedclass_list_t*classes; + abc_script_t*classinit; + + abc_script_t*init; //package-level code + + dict_t*token2info; + dict_t*file2token2info; +} global_t; + +extern global_t*global; + +typedef struct _variable { + int index; + classinfo_t*type; + char init; + char kill; + char is_parameter; + methodstate_t*is_inner_method; +} variable_t; + +void initialize_file(char*filename); +void finish_file(); + +void initialize_parser(); +void* finish_parser(); + +#define FLAG_PUBLIC 256 +#define FLAG_PROTECTED 512 +#define FLAG_PRIVATE 1024 +#define FLAG_PACKAGEINTERNAL 2048 +#define FLAG_NAMESPACE 4096 + +slotinfo_t* find_class(const char*name); +char is_break_or_jump(code_t*c); +code_t* insert_finally(code_t*c, code_t*finally, int tempvar); +typedcode_t push_class(slotinfo_t*a); +slotinfo_t* find_class(const char*name); +namespace_list_t*get_current_imports(); +const char* get_package_from_name(const char*name); +char is_pushundefined(code_t*c); +code_t* coerce_to_type(code_t*c, classinfo_t*t); +code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to); +void continuejumpsto(code_t*c, char*name, code_t*jump); +void breakjumpsto(code_t*c, char*name, code_t*jump); +void insert_unresolved(methodstate_t*m, dict_t*xvars, dict_t*allvars); +void startfunction(modifiers_t*mod, enum yytokentype getset, char*name, params_t*params, classinfo_t*return_type); +void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0); +abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name, params_t*params, classinfo_t*return_type, code_t*body); +void innerfunction(char*name, params_t*params, classinfo_t*return_type); +methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot); +void check_override(memberinfo_t*m, int flags); +void check_constant_against_type(classinfo_t*t, constant_t*c); +void check_code_for_break(code_t*c); +void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements); +void endclass(); +void innerfunctions2vars(methodstate_t*m); +memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse, char is_static); +namespace_t modifiers2access(modifiers_t*mod); +const char* lookup_namespace(const char*name); +void startpackage(char*name); +void endpackage(); +code_t* wrap_function(code_t*c,code_t*header, code_t*body); +code_t* method_header(methodstate_t*m); +code_t* add_scope_code(code_t*c, methodstate_t*m, char init); +void unknown_variable(char*name); +code_t* var_block(code_t*body, dict_t*vars); +int gettempvar(); +int new_variable(methodstate_t*method, const char*name, classinfo_t*type, char init, char maybeslot); +variable_t* new_variable2(methodstate_t*method, const char*name, classinfo_t*type, char init, char maybeslot); +int alloc_local(); +code_t*defaultvalue(code_t*c, classinfo_t*type); +char variable_exists(char*name); +variable_t* find_variable_safe(state_t*s, char*name); +variable_t* find_variable(state_t*s, const char*name); +variable_t* find_slot(methodstate_t*m, const char*name); +code_t* method_header(methodstate_t*m); +code_t* wrap_function(code_t*c,code_t*header, code_t*body); +void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0); +void state_destroy(state_t*state); +void as3_set_define(const char*c); + +/* protected handling here is a big hack: we just assume the protectedns + is package:class. the correct approach would be to add the proper + namespace to all protected members in the registry, even though that + would slow down searching */ +#define MEMBER_MULTINAME(m,f,n) \ + multiname_t m;\ + namespace_t m##_ns;\ + if(f) { \ + m##_ns.access = ((slotinfo_t*)(f))->access; \ + if(m##_ns.access == ACCESS_NAMESPACE) \ + m##_ns.name = ((slotinfo_t*)(f))->package; \ + else if(m##_ns.access == ACCESS_PROTECTED && (f)->parent) \ + m##_ns.name = concat3((f)->parent->package,":",(f)->parent->name); \ + else \ + m##_ns.name = ""; \ + m.type = QNAME; \ + m.ns = &m##_ns; \ + m.namespace_set = 0; \ + m.name = ((slotinfo_t*)(f))->name; \ + } else { \ + m.type = MULTINAME; \ + m.ns =0; \ + m.namespace_set = &nopackage_namespace_set; \ + m.name = n; \ + } + +/* warning: list length of namespace set is undefined */ +#define MULTINAME_LATE(m, access, package) \ + namespace_t m##_ns = {access, package}; \ + namespace_set_t m##_nsset; \ + namespace_list_t m##_l;m##_l.next = 0; \ + m##_nsset.namespaces = &m##_l; \ + m##_nsset = m##_nsset; \ + m##_l.namespace = &m##_ns; \ + multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0}; + +extern namespace_t stdns; +extern namespace_set_t nopackage_namespace_set; + +#endif diff -Nru swftools-0.9.0/lib/as3/parser.tab.c swftools-0.9.2/lib/as3/parser.tab.c --- swftools-0.9.0/lib/as3/parser.tab.c 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/lib/as3/parser.tab.c 2011-10-07 03:20:17.000000000 +0000 @@ -1,5 +1,5 @@ -/* A Bison parser, made by GNU Bison 2.4. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton implementation for Bison's Yacc-like parsers in C @@ -46,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4" +#define YYBISON_VERSION "2.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "./skeleton.m4" @@ -92,13 +92,14 @@ #include "compiler.h" #include "expr.h" #include "initcode.h" +#include "parser_help.h" extern int a3_lex(); /* Line 198 of skeleton.m4 */ -#line 102 "parser.tab.c" +#line 103 "parser.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -126,102 +127,102 @@ know about them. */ enum yytokentype { T_IDENTIFIER = 258, - T_NAMESPACE = 259, - T_STRING = 260, - T_REGEXP = 261, - T_EMPTY = 262, - T_INT = 263, - T_UINT = 264, - T_FLOAT = 265, - T_FOR = 266, - T_WHILE = 267, - T_DO = 268, - T_SWITCH = 269, - KW_IMPLEMENTS = 270, - KW_NAMESPACE = 271, - KW_PACKAGE = 272, - KW_PROTECTED = 273, - KW_ARGUMENTS = 274, - KW_PUBLIC = 275, - KW_PRIVATE = 276, - KW_USE = 277, - KW_INTERNAL = 278, - KW_NEW = 279, - KW_NATIVE = 280, - KW_FUNCTION = 281, - KW_FINALLY = 282, - KW_UNDEFINED = 283, - KW_NAN = 284, - KW_CONTINUE = 285, - KW_CLASS = 286, - KW_CONST = 287, - KW_CATCH = 288, - KW_CASE = 289, - KW_SET = 290, - KW_VOID = 291, - KW_THROW = 292, - KW_STATIC = 293, - KW_WITH = 294, - KW_INSTANCEOF = 295, - KW_IMPORT = 296, - KW_RETURN = 297, - KW_TYPEOF = 298, - KW_INTERFACE = 299, - KW_NULL = 300, - KW_VAR = 301, - KW_DYNAMIC = 302, - KW_OVERRIDE = 303, - KW_FINAL = 304, - KW_EACH = 305, - KW_GET = 306, - KW_TRY = 307, - KW_SUPER = 308, - KW_EXTENDS = 309, - KW_FALSE = 310, - KW_TRUE = 311, - KW_BOOLEAN = 312, - KW_UINT = 313, - KW_INT = 314, - KW_NUMBER = 315, - KW_STRING = 316, - KW_DEFAULT = 317, - KW_DEFAULT_XML = 318, - KW_DELETE = 319, - KW_IF = 320, - KW_ELSE = 321, - KW_BREAK = 322, - KW_IS = 323, - KW_IN = 324, - KW_AS = 325, - T_DICTSTART = 326, - T_EQEQ = 327, - T_EQEQEQ = 328, - T_NE = 329, - T_NEE = 330, - T_LE = 331, - T_GE = 332, - T_ORBY = 333, - T_DIVBY = 334, - T_MODBY = 335, - T_MULBY = 336, - T_ANDBY = 337, - T_PLUSBY = 338, - T_MINUSBY = 339, - T_XORBY = 340, - T_SHRBY = 341, - T_SHLBY = 342, - T_USHRBY = 343, - T_OROR = 344, - T_ANDAND = 345, - T_COLONCOLON = 346, - T_MINUSMINUS = 347, - T_PLUSPLUS = 348, - T_DOTDOT = 349, - T_DOTDOTDOT = 350, - T_SHL = 351, - T_USHR = 352, - T_SHR = 353, - prec_none = 354, + T_STRING = 259, + T_REGEXP = 260, + T_EMPTY = 261, + T_INT = 262, + T_UINT = 263, + T_FLOAT = 264, + T_FOR = 265, + T_WHILE = 266, + T_DO = 267, + T_SWITCH = 268, + KW_IMPLEMENTS = 269, + KW_NAMESPACE = 270, + KW_PACKAGE = 271, + KW_PROTECTED = 272, + KW_ARGUMENTS = 273, + KW_PUBLIC = 274, + KW_PRIVATE = 275, + KW_USE = 276, + KW_INTERNAL = 277, + KW_NEW = 278, + KW_NATIVE = 279, + KW_FUNCTION = 280, + KW_FINALLY = 281, + KW_UNDEFINED = 282, + KW_NAN = 283, + KW_CONTINUE = 284, + KW_CLASS = 285, + KW_CONST = 286, + KW_CATCH = 287, + KW_CASE = 288, + KW_SET = 289, + KW_VOID = 290, + KW_THROW = 291, + KW_STATIC = 292, + KW_WITH = 293, + KW_INSTANCEOF = 294, + KW_IMPORT = 295, + KW_RETURN = 296, + KW_TYPEOF = 297, + KW_INTERFACE = 298, + KW_NULL = 299, + KW_VAR = 300, + KW_DYNAMIC = 301, + KW_OVERRIDE = 302, + KW_FINAL = 303, + KW_EACH = 304, + KW_GET = 305, + KW_TRY = 306, + KW_SUPER = 307, + KW_EXTENDS = 308, + KW_FALSE = 309, + KW_TRUE = 310, + KW_BOOLEAN = 311, + KW_UINT = 312, + KW_INT = 313, + KW_NUMBER = 314, + KW_STRING = 315, + KW_DEFAULT = 316, + KW_DEFAULT_XML = 317, + KW_DELETE = 318, + KW_IF = 319, + KW_ELSE = 320, + KW_BREAK = 321, + KW_IS = 322, + KW_IN = 323, + KW_AS = 324, + T_DICTSTART = 325, + T_EQEQ = 326, + T_EQEQEQ = 327, + T_NE = 328, + T_NEE = 329, + T_LE = 330, + T_GE = 331, + T_ORBY = 332, + T_DIVBY = 333, + T_MODBY = 334, + T_MULBY = 335, + T_ANDBY = 336, + T_PLUSBY = 337, + T_MINUSBY = 338, + T_XORBY = 339, + T_SHRBY = 340, + T_SHLBY = 341, + T_USHRBY = 342, + T_OROR = 343, + T_ANDAND = 344, + T_COLONCOLON = 345, + T_MINUSMINUS = 346, + T_PLUSPLUS = 347, + T_DOTDOT = 348, + T_DOTDOTDOT = 349, + T_SHL = 350, + T_USHR = 351, + T_SHR = 352, + prec_none = 353, + prec_var_read = 354, below_semicolon = 355, below_assignment = 356, below_lt = 357, @@ -230,9 +231,10 @@ plusplus_prefix = 360, below_curly = 361, new2 = 362, - above_identifier = 363, - below_else = 364, - above_function = 365 + below_identifier = 363, + above_identifier = 364, + below_else = 365, + above_function = 366 }; #endif @@ -241,12 +243,12 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union /* Line 223 of skeleton.m4 */ -#line 47 "parser.y" +#line 48 "parser.y" tokenunion { /* Line 223 of skeleton.m4 */ -#line 47 "parser.y" +#line 48 "parser.y" enum yytokentype token; @@ -281,7 +283,7 @@ /* Line 223 of skeleton.m4 */ -#line 285 "parser.tab.c" +#line 287 "parser.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -292,1659 +294,9 @@ /* Copy the second part of user declarations. */ /* Line 273 of skeleton.m4 */ -#line 276 "parser.y" +#line 277 "parser.y" -static int a3_error(char*s) -{ - syntaxerror("%s", s); - return 0; //make gcc happy -} - -static void parsererror(const char*file, int line, const char*f) -{ - syntaxerror("internal error in %s, %s:%d", f, file, line); -} - -#define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);} - - -static char* concat2(const char* t1, const char* t2) -{ - int l1 = strlen(t1); - int l2 = strlen(t2); - char*text = malloc(l1+l2+1); - memcpy(text , t1, l1); - memcpy(text+l1, t2, l2); - text[l1+l2] = 0; - return text; -} -static char* concat3(const char* t1, const char* t2, const char* t3) -{ - int l1 = strlen(t1); - int l2 = strlen(t2); - int l3 = strlen(t3); - char*text = malloc(l1+l2+l3+1); - memcpy(text , t1, l1); - memcpy(text+l1, t2, l2); - memcpy(text+l1+l2, t3, l3); - text[l1+l2+l3] = 0; - return text; -} - -typedef struct _import { - char*package; -} import_t; -DECLARE_LIST(import); - -DECLARE(methodstate); -DECLARE_LIST(methodstate); - -typedef struct _classstate { - /* class data */ - classinfo_t*info; - abc_class_t*abc; - - methodstate_t*init; - methodstate_t*static_init; - //code_t*init; - //code_t*static_init; - parsedclass_t*dependencies; - - char has_constructor; -} classstate_t; - -struct _methodstate { - /* method data */ - methodinfo_t*info; - char has_exceptions; - char late_binding; - char is_constructor; - char has_super; - char is_global; - char is_static; - int variable_count; - - dict_t*unresolved_variables; - - char inner; - char uses_parent_function; - char no_variable_scoping; - int uses_slots; - dict_t*slots; - int activation_var; - - int need_arguments; - - abc_method_t*abc; - int var_index; // for inner methods - int slot_index; // for inner methods - char is_a_slot; // for inner methods - - code_t*header; - - code_t*scope_code; - abc_exception_list_t*exceptions; - - methodstate_list_t*innerfunctions; -}; - -typedef struct _state { - struct _state*old; - int level; - - char*package; - import_list_t*wildcard_imports; - dict_t*import_toplevel_packages; - dict_t*imports; - - namespace_list_t*active_namespace_urls; - - char has_own_imports; - char new_vars; // e.g. transition between two functions - char xmlfilter; // are we inside a xmlobj..() filter? - - classstate_t*cls; - methodstate_t*method; - - char*exception_name; - - int switch_var; - - dict_t*vars; - dict_t*allvars; // also contains variables from sublevels -} state_t; - -typedef struct _global { - abc_file_t*file; - - parsedclass_list_t*classes; - abc_script_t*classinit; - - abc_script_t*init; //package-level code - - dict_t*token2info; - dict_t*file2token2info; -} global_t; - -static global_t*global = 0; -static state_t* state = 0; - -DECLARE_LIST(state); - -/* protected handling here is a big hack: we just assume the protectedns - is package:class. the correct approach would be to add the proper - namespace to all protected members in the registry, even though that - would slow down searching */ -#define MEMBER_MULTINAME(m,f,n) \ - multiname_t m;\ - namespace_t m##_ns;\ - if(f) { \ - m##_ns.access = ((slotinfo_t*)(f))->access; \ - if(m##_ns.access == ACCESS_NAMESPACE) \ - m##_ns.name = ((slotinfo_t*)(f))->package; \ - else if(m##_ns.access == ACCESS_PROTECTED && (f)->parent) \ - m##_ns.name = concat3((f)->parent->package,":",(f)->parent->name); \ - else \ - m##_ns.name = ""; \ - m.type = QNAME; \ - m.ns = &m##_ns; \ - m.namespace_set = 0; \ - m.name = ((slotinfo_t*)(f))->name; \ - } else { \ - m.type = MULTINAME; \ - m.ns =0; \ - m.namespace_set = &nopackage_namespace_set; \ - m.name = n; \ - } - -/* warning: list length of namespace set is undefined */ -#define MULTINAME_LATE(m, access, package) \ - namespace_t m##_ns = {access, package}; \ - namespace_set_t m##_nsset; \ - namespace_list_t m##_l;m##_l.next = 0; \ - m##_nsset.namespaces = &m##_l; \ - m##_nsset = m##_nsset; \ - m##_l.namespace = &m##_ns; \ - multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0}; - -static namespace_t ns1 = {ACCESS_PRIVATE, ""}; -static namespace_t ns2 = {ACCESS_PROTECTED, ""}; -static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""}; -static namespace_t stdns = {ACCESS_PACKAGE, ""}; -static namespace_list_t nl4 = {&stdns,0}; -static namespace_list_t nl3 = {&ns3,&nl4}; -static namespace_list_t nl2 = {&ns2,&nl3}; -static namespace_list_t nl1 = {&ns1,&nl2}; -static namespace_set_t nopackage_namespace_set = {&nl1}; - -static dict_t*definitions=0; -void as3_set_define(const char*c) -{ - if(!definitions) - definitions = dict_new(); - if(!dict_contains(definitions,c)) - dict_put(definitions,c,0); -} - -static void new_state() -{ - NEW(state_t, s); - state_t*oldstate = state; - if(state) - memcpy(s, state, sizeof(state_t)); //shallow copy - if(!s->imports) { - s->imports = dict_new(); - } - if(!s->import_toplevel_packages) { - s->import_toplevel_packages = dict_new(); - } - state = s; - state->level++; - state->has_own_imports = 0; - state->vars = dict_new(); - state->old = oldstate; - state->new_vars = 0; - - trie_remember(active_namespaces); - - if(oldstate) - state->active_namespace_urls = list_clone(oldstate->active_namespace_urls); -} - -static void state_destroy(state_t*state) -{ - if(state->has_own_imports) { - list_free(state->wildcard_imports); - dict_destroy(state->imports);state->imports=0; - } - if(state->imports && (!state->old || state->old->imports!=state->imports)) { - dict_destroy(state->imports);state->imports=0; - } - if(state->vars) { - dict_destroy(state->vars);state->vars=0; - } - if(state->new_vars && state->allvars) { - parserassert(!state->old || state->old->allvars != state->allvars); - DICT_ITERATE_DATA(state->allvars, void*, data) { - free(data); - } - dict_destroy(state->allvars); - } - - list_free(state->active_namespace_urls) - state->active_namespace_urls = 0; - - free(state); -} - -static void old_state() -{ - trie_rollback(active_namespaces); - - if(!state || !state->old) - syntaxerror("invalid nesting"); - state_t*leaving = state; - - state = state->old; - - if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) { - free(leaving->method); - leaving->method=0; - } - if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) { - free(leaving->cls); - leaving->cls=0; - } - - state_destroy(leaving); -} - -static code_t* method_header(methodstate_t*m); -static code_t* wrap_function(code_t*c,code_t*header, code_t*body); -static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0); - - -static char* internal_filename_package = 0; -void initialize_file(char*filename) -{ - if(state) { - syntaxerror("invalid call to initialize_file during parsing of another file"); - } - - active_namespaces = trie_new(); - - new_state(); - state->package = internal_filename_package = strdup(filename); - state->allvars = dict_new(); - - global->token2info = dict_lookup(global->file2token2info, - current_filename // use long version - ); - if(!global->token2info) { - global->token2info = dict_new2(&ptr_type); - dict_put(global->file2token2info, current_filename, global->token2info); - } - - if(as3_pass==1) { - state->method = rfx_calloc(sizeof(methodstate_t)); - dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method); - state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope - } else { - state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); - state->method->variable_count = 0; - if(!state->method) - syntaxerror("internal error: skewed tokencount"); - function_initvars(state->method, 0, 0, 0, 1); - global->init = 0; - } -} - -void finish_file() -{ - if(!state || state->level!=1) { - syntaxerror("unexpected end of file in pass %d", as3_pass); - } - - if(as3_pass==2) { - dict_del(global->file2token2info, current_filename); - code_t*header = method_header(state->method); - //if(global->init->method->body->code || global->init->traits) { - if(global->init) { - code_t*c = wrap_function(header, 0, global->init->method->body->code); - global->init->method->body->code = abc_returnvoid(c); - free(state->method);state->method=0; - } - } - - //free(state->package);state->package=0; // used in registry - state_destroy(state);state=0; -} - -void initialize_parser() -{ - global = rfx_calloc(sizeof(global_t)); - global->file = abc_file_new(); - global->file->flags &= ~ABCFILE_LAZY; - global->file2token2info = dict_new(); - global->token2info = 0; - global->classinit = abc_initscript(global->file); -} - -void* finish_parser() -{ - dict_free_all(global->file2token2info, 1, (void*)dict_destroy); - global->token2info=0; - - initcode_add_classlist(global->classinit, global->classes); - - return global->file; -} - -typedef struct _variable { - int index; - classinfo_t*type; - char init; - char kill; - char is_parameter; - methodstate_t*is_inner_method; -} variable_t; - -static variable_t* find_variable(state_t*s, char*name) -{ - if(s->method->no_variable_scoping) { - return dict_lookup(s->allvars, name); - } else { - state_t*top = s; - while(s) { - variable_t*v = 0; - v = dict_lookup(s->vars, name); - if(v) return v; - if(s->new_vars) break; - s = s->old; - } - return 0; - } -} -static variable_t* find_slot(state_t*s, const char*name) -{ - if(s->method && s->method->slots) - return dict_lookup(s->method->slots, name); - return 0; -} - -static variable_t* find_variable_safe(state_t*s, char*name) -{ - variable_t* v = find_variable(s, name); - if(!v) - syntaxerror("undefined variable: %s", name); - return v; -} - -static char variable_exists(char*name) -{ - return dict_contains(state->vars, name); -} - -static code_t*defaultvalue(code_t*c, classinfo_t*type) -{ - if(TYPE_IS_INT(type)) { - c = abc_pushbyte(c, 0); - } else if(TYPE_IS_UINT(type)) { - c = abc_pushuint(c, 0); - } else if(TYPE_IS_FLOAT(type)) { - c = abc_pushnan(c); - } else if(TYPE_IS_BOOLEAN(type)) { - c = abc_pushfalse(c); - } else if(TYPE_IS_STRING(type)) { - c = abc_pushnull(c); - c = abc_coerce_s(c); - } else if(!type) { - //c = abc_pushundefined(c); - syntaxerror("internal error: can't generate default value for * type"); - } else { - c = abc_pushnull(c); - MULTINAME(m, type); - c = abc_coerce2(c, &m); - } - return c; -} - -static int alloc_local() -{ - return state->method->variable_count++; -} - -static variable_t* new_variable2(const char*name, classinfo_t*type, char init, char maybeslot) -{ - if(maybeslot) { - variable_t*v = find_slot(state, name); - if(v) { - alloc_local(); - return v; - } - } - - NEW(variable_t, v); - v->index = alloc_local(); - v->type = type; - v->init = v->kill = init; - - if(name) { - if(!state->method->no_variable_scoping) - { - if(dict_contains(state->vars, name)) - syntaxerror("variable %s already defined", name); - dict_put(state->vars, name, v); - } - if(state->method->no_variable_scoping && - as3_pass==2 && - dict_contains(state->allvars, name)) - { - variable_t*v = dict_lookup(state->allvars, name); - if(v->type != type) - syntaxerror("variable %s already defined.", name); - return v; - } - dict_put(state->allvars, name, v); - } - - return v; -} -static int new_variable(const char*name, classinfo_t*type, char init, char maybeslot) -{ - return new_variable2(name, type, init, maybeslot)->index; -} - -#define TEMPVARNAME "__as3_temp__" -int gettempvar() -{ - variable_t*v = find_variable(state, TEMPVARNAME); - int i; - if(v) - i = v->index; - else - i = new_variable(TEMPVARNAME, 0, 0, 0); - parserassert(i); - return i; -} - -static code_t* var_block(code_t*body, dict_t*vars) -{ - code_t*c = 0; - code_t*k = 0; - int t; - DICT_ITERATE_DATA(vars, variable_t*, v) { - if(v->type && v->init) { - c = defaultvalue(c, v->type); - c = abc_setlocal(c, v->index); - } - if(v->type && v->kill) { - k = abc_kill(k, v->index); - } - } - - if(k) { - code_t*x = body; - while(x) { - if(x->opcode== OPCODE___BREAK__ || - x->opcode== OPCODE___CONTINUE__) { - /* link kill code before break/continue */ - code_t*e = code_dup(k); - code_t*s = code_start(e); - s->prev = x->prev; - if(x->prev) { - x->prev->next = s; - } - e->next = x; - x->prev = e; - } - x = x->prev; - } - } - - c = code_append(c, body); - c = code_append(c, k); - return c; -} - -static void unknown_variable(char*name) -{ - if(!state->method->unresolved_variables) - state->method->unresolved_variables = dict_new(); - if(!dict_contains(state->method->unresolved_variables, name)) - dict_put(state->method->unresolved_variables, name, 0); -} - -static code_t* add_scope_code(code_t*c, methodstate_t*m, char init) -{ - if(m->uses_slots || (m->late_binding && !m->inner)) { //???? especially inner functions need the pushscope - c = abc_getlocal_0(c); - c = abc_pushscope(c); - } - if(m->uses_slots) { - /* FIXME: this alloc_local() causes variable indexes to be - different in pass2 than in pass1 */ - if(!m->activation_var) { - m->activation_var = alloc_local(); - } - if(init) { - c = abc_newactivation(c); - c = abc_dup(c); - c = abc_pushscope(c); - c = abc_setlocal(c, m->activation_var); - } else { - c = abc_getlocal(c, m->activation_var); - c = abc_pushscope(c); - } - } - return c; -} - -static code_t* method_header(methodstate_t*m) -{ - code_t*c = 0; - - c = add_scope_code(c, m, 1); - - methodstate_list_t*l = m->innerfunctions; - while(l) { - parserassert(l->methodstate->abc); - if(m->uses_slots && l->methodstate->is_a_slot) { - c = abc_getscopeobject(c, 1); - c = abc_newfunction(c, l->methodstate->abc); - c = abc_dup(c); - c = abc_setlocal(c, l->methodstate->var_index); - c = abc_setslot(c, l->methodstate->slot_index); - } else { - c = abc_newfunction(c, l->methodstate->abc); - c = abc_setlocal(c, l->methodstate->var_index); - } - free(l->methodstate);l->methodstate=0; - l = l->next; - } - if(m->header) { - c = code_append(c, m->header); - m->header = 0; - } - if(m->is_constructor && !m->has_super) { - // call default constructor - c = abc_getlocal_0(c); - c = abc_constructsuper(c, 0); - } - - if(m->slots) { - /* all parameters that are used by inner functions - need to be copied from local to slot */ - parserassert(m->activation_var); - DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) { - if(v->is_parameter) { - c = abc_getlocal(c, m->activation_var); - c = abc_getlocal(c, v->index); - c = abc_setslot(c, v->index); - } - } - } - list_free(m->innerfunctions); - m->innerfunctions = 0; - return c; -} - - -static code_t* wrap_function(code_t*c,code_t*header, code_t*body) -{ - c = code_append(c, header); - c = code_append(c, var_block(body, state->method->no_variable_scoping?state->allvars:state->vars)); - /* append return if necessary */ - if(!c || (c->opcode != OPCODE_RETURNVOID && - c->opcode != OPCODE_RETURNVALUE)) { - c = abc_returnvoid(c); - } - return c; -} - -static void startpackage(char*name) -{ - new_state(); - state->package = strdup(name); -} -static void endpackage() -{ - //used e.g. in classinfo_register: - //free(state->package);state->package=0; - old_state(); -} - -#define FLAG_PUBLIC 256 -#define FLAG_PROTECTED 512 -#define FLAG_PRIVATE 1024 -#define FLAG_PACKAGEINTERNAL 2048 -#define FLAG_NAMESPACE 4096 - -static namespace_t modifiers2access(modifiers_t*mod) -{ - namespace_t ns; - ns.access = 0; - ns.name = ""; - if(mod->flags&FLAG_NAMESPACE) { - if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) - syntaxerror("invalid combination of access levels and namespaces"); - ns.access = ACCESS_NAMESPACE; - state_t*s = state; - const char*url = (const char*)trie_lookup(active_namespaces, mod->ns); - if(!url) { - /* shouldn't happen- the tokenizer only reports something as a namespace - if it was already registered */ - trie_dump(active_namespaces); - syntaxerror("unknown namespace: %s", mod->ns); - } - ns.name = url; - } else if(mod->flags&FLAG_PUBLIC) { - if(mod->flags&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) - syntaxerror("invalid combination of access levels"); - ns.access = ACCESS_PACKAGE; - } else if(mod->flags&FLAG_PRIVATE) { - if(mod->flags&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) - syntaxerror("invalid combination of access levels"); - ns.access = ACCESS_PRIVATE; - } else if(mod->flags&FLAG_PROTECTED) { - if(mod->flags&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL)) - syntaxerror("invalid combination of access levels"); - ns.access = ACCESS_PROTECTED; - } else { - ns.access = ACCESS_PACKAGEINTERNAL; - } - return ns; -} -static slotinfo_t* find_class(const char*name); - -static memberinfo_t* findmember_nsset(classinfo_t*cls, const char*name, char recurse) -{ - return registry_findmember_nsset(cls, state->active_namespace_urls, name, recurse); -} - -static void innerfunctions2vars(methodstate_t*m) -{ - methodstate_list_t*l = m->innerfunctions; - while(l) { - methodstate_t*m = l->methodstate; - - variable_t* v = new_variable2(m->info->name, TYPE_FUNCTION(m->info), 0, 0); - m->var_index = v->index; - if(m->is_a_slot) - m->slot_index = m->is_a_slot; - v->is_inner_method = m; - l = l->next; - } -} - -static void function_initvars(methodstate_t*m, char has_params, params_t*params, int flags, char var0) -{ - if(var0) { - int index = -1; - if(m->inner) - index = new_variable("this", 0, 0, 0); - else if(!m->is_global) - index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0, 0); - else - index = new_variable("globalscope", 0, 0, 0); - parserassert(!index); - } - - if(has_params) { - param_list_t*p=0; - for(p=params->list;p;p=p->next) { - variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1); - v->is_parameter = 1; - } - if(as3_pass==2 && m->need_arguments) { - /* arguments can never be used by an innerfunction (the inner functions - have their own arguments var), so it's ok to not initialize this until - pass 2. (We don't know whether we need it before, anyway) */ - variable_t*v = new_variable2("arguments", TYPE_ARRAY, 0, 0); - m->need_arguments = v->index; - } - } - - innerfunctions2vars(m); - - if(as3_pass==2) { - m->scope_code = add_scope_code(m->scope_code, m, 0); - if(m->slots) { - /* exchange unresolved identifiers with the actual objects */ - DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) { - if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) { - classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type); - if(!type || type->kind != INFOTYPE_CLASS) { - syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name); - } - v->type = type; - } - } - } - } -} - - -char*as3_globalclass=0; -static void startclass(modifiers_t* mod, char*classname, classinfo_t*extends, classinfo_list_t*implements) -{ - if(state->cls) { - syntaxerror("inner classes now allowed"); - } - - new_state(); - token_list_t*t=0; - classinfo_list_t*mlist=0; - - if(mod->flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE)) - syntaxerror("invalid modifier(s)"); - - if((mod->flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) - syntaxerror("public and internal not supported at the same time."); - - if((mod->flags&(FLAG_PROTECTED|FLAG_STATIC)) == (FLAG_PROTECTED|FLAG_STATIC)) - syntaxerror("protected and static not supported at the same time."); - - //if(!(mod->flags&FLAG_INTERFACE) && !extends) { - if(!(mod->flags&FLAG_INTERFACE) && !extends) { - // all classes extend object - extends = registry_getobjectclass(); - } - - /* create the class name, together with the proper attributes */ - int access=0; - char*package=0; - - if(!(mod->flags&FLAG_PUBLIC) && state->package==internal_filename_package) { - access = ACCESS_PRIVATE; package = internal_filename_package; - } else if(!(mod->flags&FLAG_PUBLIC) && state->package!=internal_filename_package) { - access = ACCESS_PACKAGEINTERNAL; package = state->package; - } else if(state->package!=internal_filename_package) { - access = ACCESS_PACKAGE; package = state->package; - } else { - syntaxerror("public classes only allowed inside a package"); - } - - if(as3_pass==1) { - state->cls = rfx_calloc(sizeof(classstate_t)); - state->cls->init = rfx_calloc(sizeof(methodstate_t)); - state->cls->static_init = rfx_calloc(sizeof(methodstate_t)); - state->cls->static_init->is_static=FLAG_STATIC; - state->cls->static_init->variable_count=1; - /* notice: we make no effort to initialize the top variable (local0) here, - even though it has special meaning. We just rely on the fact - that pass 1 won't do anything with variables */ - - dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls); - - /* set current method to constructor- all code within the class-level (except - static variable initializations) will be executed during construction time */ - state->method = state->cls->init; - - if(registry_find(package, classname)) { - syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname); - } - /* build info struct */ - int num_interfaces = (list_length(implements)); - state->cls->info = classinfo_register(access, package, classname, num_interfaces); - state->cls->info->flags |= mod->flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL); - state->cls->info->superclass = extends; - - int pos = 0; - classinfo_list_t*l = implements; - for(l=implements;l;l=l->next) { - state->cls->info->interfaces[pos++] = l->classinfo; - } - } - - if(as3_pass == 2) { - state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); - - state->method = state->cls->init; - parserassert(state->cls && state->cls->info); - - function_initvars(state->cls->init, 0, 0, 0, 1); - function_initvars(state->cls->static_init, 0, 0, 0, 0); - - if(extends && (extends->flags & FLAG_FINAL)) - syntaxerror("Can't extend final class '%s'", extends->name); - - int pos = 0; - while(state->cls->info->interfaces[pos]) { - if(!(state->cls->info->interfaces[pos]->flags & FLAG_INTERFACE)) - syntaxerror("'%s' is not an interface", - state->cls->info->interfaces[pos]->name); - pos++; - } - - /* generate the abc code for this class */ - MULTINAME(classname2,state->cls->info); - multiname_t*extends2 = sig2mname(extends); - - /* don't add the class to the class index just yet- that will be done later - by initscript */ - state->cls->abc = abc_class_new(0, &classname2, extends2); - state->cls->abc->file = global->file; - - multiname_destroy(extends2); - if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc); - if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc); - if(state->cls->info->flags&FLAG_INTERFACE) { - abc_class_interface(state->cls->abc); - } - - for(mlist=implements;mlist;mlist=mlist->next) { - MULTINAME(m, mlist->classinfo); - abc_class_add_interface(state->cls->abc, &m); - } - - state->cls->dependencies = parsedclass_new(state->cls->info, state->cls->abc); - list_append(global->classes, state->cls->dependencies); - - /* flash.display.MovieClip handling */ - if(!as3_globalclass && (mod->flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) { - if(state->package && state->package[0]) { - as3_globalclass = concat3(state->package, ".", classname); - } else { - as3_globalclass = strdup(classname); - } - } - } -} - -static void endclass() -{ - if(as3_pass == 2) { - if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) { - code_t*c = 0; - c = abc_getlocal_0(c); - c = abc_constructsuper(c, 0); - state->cls->init->header = code_append(state->cls->init->header, c); - state->cls->has_constructor=1; - } - if(state->cls->init) { - if(state->cls->info->flags&FLAG_INTERFACE) { - if(state->cls->init->header) - syntaxerror("interface can not have class-level code"); - } else { - abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0); - code_t*c = method_header(state->cls->init); - m->body->code = wrap_function(c, 0, m->body->code); - } - } - if(state->cls->static_init) { - abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0); - code_t*c = method_header(state->cls->static_init); - m->body->code = wrap_function(c, 0, m->body->code); - } - - trait_list_t*trait = state->cls->abc->traits; - /* switch all protected members to the protected ns of this class */ - while(trait) { - trait_t*t = trait->trait; - if(t->name->ns->access == ACCESS_PROTECTED) { - if(!state->cls->abc->protectedNS) { - char*n = concat3(state->cls->info->package, ":", state->cls->info->name); - state->cls->abc->protectedNS = namespace_new_protected(n); - state->cls->abc->flags |= CLASS_PROTECTED_NS; - } - t->name->ns->name = strdup(state->cls->abc->protectedNS->name); - } - trait = trait->next; - } - } - - old_state(); -} - -void check_code_for_break(code_t*c) -{ - while(c) { - if(c->opcode == OPCODE___BREAK__) { - char*name = string_cstr(c->data[0]); - syntaxerror("Unresolved \"break %s\"", name); - } - if(c->opcode == OPCODE___CONTINUE__) { - char*name = string_cstr(c->data[0]); - syntaxerror("Unresolved \"continue %s\"", name); - } - if(c->opcode == OPCODE___RETHROW__) { - syntaxerror("Unresolved \"rethrow\""); - } - if(c->opcode == OPCODE___FALLTHROUGH__) { - syntaxerror("Unresolved \"fallthrough\""); - } - if(c->opcode == OPCODE___PUSHPACKAGE__) { - char*name = string_cstr(c->data[0]); - syntaxerror("Can't reference a package (%s) as such", name); - } - c=c->prev; - } -} - -static void check_constant_against_type(classinfo_t*t, constant_t*c) -{ -#define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name) - if(TYPE_IS_NUMBER(t)) { - xassert(c->type == CONSTANT_FLOAT - || c->type == CONSTANT_INT - || c->type == CONSTANT_UINT); - } else if(TYPE_IS_UINT(t)) { - xassert(c->type == CONSTANT_UINT || - (c->type == CONSTANT_INT && c->i>=0)); - } else if(TYPE_IS_INT(t)) { - xassert(c->type == CONSTANT_INT); - } else if(TYPE_IS_BOOLEAN(t)) { - xassert(c->type == CONSTANT_TRUE - || c->type == CONSTANT_FALSE); - } -} - -static void check_override(memberinfo_t*m, int flags) -{ - if(!m) - return; - if(m->parent == state->cls->info) - syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name); - if(!m->parent) - syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name); - if(m->access==ACCESS_PRIVATE) - return; - if(m->flags & FLAG_FINAL) - syntaxerror("can't override final member %s", m->name); - - /* allow this. it's no issue. - if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC)) - syntaxerror("can't override static member %s", m->name);*/ - - if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC)) - syntaxerror("can't override non-static member %s with static declaration", m->name); - - if(!(flags&FLAG_OVERRIDE) && !(flags&FLAG_STATIC) && !(m->flags&FLAG_STATIC)) { - if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) { - if(m->kind == INFOTYPE_METHOD) - syntaxerror("can't override without explicit 'override' declaration"); - else - syntaxerror("can't override '%s'", m->name); - } - } -} - -static methodinfo_t*registerfunction(enum yytokentype getset, modifiers_t*mod, char*name, params_t*params, classinfo_t*return_type, int slot) -{ - methodinfo_t*minfo = 0; - namespace_t ns = modifiers2access(mod); - if(!state->cls) { - //package method - minfo = methodinfo_register_global(ns.access, state->package, name); - minfo->return_type = return_type; - } else if(getset != KW_GET && getset != KW_SET) { - //class method - memberinfo_t* m = registry_findmember(state->cls->info, ns.name, name, 0); - if(m) { - syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name); - } - minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name); - minfo->return_type = return_type; - // getslot on a member slot only returns "undefined", so no need - // to actually store these - //state->minfo->slot = state->method->abc->method->trait->slot_id; - } else { - //class getter/setter - int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET; - classinfo_t*type=0; - if(getset == KW_GET) { - type = return_type; - } else if(params->list && params->list->param && !params->list->next) { - type = params->list->param->type; - } else - syntaxerror("setter function needs to take exactly one argument"); - // not sure wether to look into superclasses here, too - minfo = (methodinfo_t*)registry_findmember(state->cls->info, ns.name, name, 1); - if(minfo) { - if(minfo->kind!=INFOTYPE_VAR) - syntaxerror("class already contains a method called '%s'", name); - if(!(minfo->subtype & (SUBTYPE_GETSET))) - syntaxerror("class already contains a field called '%s'", name); - if(minfo->subtype & gs) - syntaxerror("getter/setter for '%s' already defined", name); - /* make a setter or getter into a getset */ - minfo->subtype |= gs; - - /* - FIXME: this check needs to be done in pass 2 - - if((!minfo->return_type != !type) || - (minfo->return_type && type && - !strcmp(minfo->return_type->name, type->name))) { - syntaxerror("different type in getter and setter: %s and %s", - minfo->return_type?minfo->return_type->name:"*", - type?type->name:"*"); - }*/ - } else { - minfo = methodinfo_register_onclass(state->cls->info, ns.access, ns.name, name); - minfo->kind = INFOTYPE_VAR; //hack - minfo->subtype = gs; - minfo->return_type = type; - } - - /* can't assign a slot as getter and setter might have different slots */ - //minfo->slot = slot; - } - if(mod->flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL; - if(mod->flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC; - if(mod->flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE; - - return minfo; -} - -static void innerfunction(char*name, params_t*params, classinfo_t*return_type) -{ - //parserassert(state->method && state->method->info); - - methodstate_t*parent_method = state->method; - - if(as3_pass==1) { - return_type = 0; // not valid in pass 1 - } - - new_state(); - state->new_vars = 1; - state->allvars = dict_new(); - - if(as3_pass == 1) { - state->method = rfx_calloc(sizeof(methodstate_t)); - state->method->inner = 1; - state->method->is_static = parent_method->is_static; - state->method->variable_count = 0; - state->method->abc = rfx_calloc(sizeof(abc_method_t)); - - NEW(methodinfo_t,minfo); - minfo->kind = INFOTYPE_METHOD; - minfo->access = ACCESS_PACKAGEINTERNAL; - minfo->name = name; - state->method->info = minfo; - - if(parent_method) - list_append(parent_method->innerfunctions, state->method); - - dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method); - - function_initvars(state->method, 1, params, 0, 1); - } - - if(as3_pass == 2) { - state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); - state->method->variable_count = 0; - parserassert(state->method); - - state->method->info->return_type = return_type; - function_initvars(state->method, 1, params, 0, 1); - } -} - -static void startfunction(modifiers_t*mod, enum yytokentype getset, char*name, - params_t*params, classinfo_t*return_type) -{ - if(state->method && state->method->info) { - syntaxerror("not able to start another method scope"); - } - new_state(); - state->new_vars = 1; - state->allvars = dict_new(); - - if(as3_pass == 1) { - state->method = rfx_calloc(sizeof(methodstate_t)); - state->method->has_super = 0; - state->method->is_static = mod->flags&FLAG_STATIC; - - if(state->cls) { - state->method->is_constructor = !strcmp(state->cls->info->name,name); - } else { - state->method->is_global = 1; - state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack - } - if(state->method->is_constructor) - name = "__as3_constructor__"; - - state->method->info = registerfunction(getset, mod, name, params, return_type, 0); - - function_initvars(state->method, 1, params, mod->flags, 1); - - dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method); - } - - if(as3_pass == 2) { - state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount); - state->method->variable_count = 0; - parserassert(state->method); - - if(state->cls) { - memberinfo_t*m = registry_findmember(state->cls->info, mod->ns, name, 2); - check_override(m, mod->flags); - } - - if(state->cls) { - state->cls->has_constructor |= state->method->is_constructor; - } - - function_initvars(state->method, 1, params, mod->flags, 1); - } -} - -static abc_method_t* endfunction(modifiers_t*mod, enum yytokentype getset, char*name, - params_t*params, classinfo_t*return_type, code_t*body) -{ - if(as3_pass==1) { - innerfunctions2vars(state->method); - - methodstate_list_t*ml = state->method->innerfunctions; - - dict_t*xvars = dict_new(); - - if(state->method->unresolved_variables) { - DICT_ITERATE_KEY(state->method->unresolved_variables, char*, vname) { - if(dict_contains(state->allvars, vname)) { - state->method->no_variable_scoping = 1; - as3_warning("function %s uses forward or outer block variable references (%s): switching into compatiblity mode", name, vname); - break; - } - } - } - - while(ml) { - methodstate_t*m = ml->methodstate; - parserassert(m->inner); - if(m->unresolved_variables) { - dict_t*d = m->unresolved_variables; - int t; - DICT_ITERATE_KEY(d, char*, id) { - /* check parent method's variables */ - variable_t*v; - if((v=find_variable(state, id))) { - m->uses_parent_function = 1; - state->method->uses_slots = 1; - dict_put(xvars, id, 0); - } - } - dict_destroy(m->unresolved_variables); - m->unresolved_variables = 0; - } - ml = ml->next; - } - - if(state->method->uses_slots) { - state->method->slots = dict_new(); - int i = 1; - DICT_ITERATE_ITEMS(state->vars, char*, name, variable_t*, v) { - if(!name) syntaxerror("internal error"); - if(v->index && dict_contains(xvars, name)) { - v->init = v->kill = 0; - v->index = i; - if(v->is_inner_method) { - v->is_inner_method->is_a_slot = i; - } - i++; - dict_put(state->method->slots, name, v); - } - } - state->method->uses_slots = i; - dict_destroy(state->vars);state->vars = 0; - parserassert(state->new_vars); - dict_destroy(state->allvars);state->allvars = 0; - } - old_state(); - return 0; - } - - if(as3_pass==2) { - /*if(state->method->uses_parent_function){ - syntaxerror("accessing variables of parent function from inner functions not supported yet"); - }*/ - - abc_method_t*f = 0; - - multiname_t*type2 = sig2mname(return_type); - int slot = 0; - if(state->method->inner) { - f = state->method->abc; - abc_method_init(f, global->file, type2, 1); - } else if(state->method->is_constructor) { - f = abc_class_getconstructor(state->cls->abc, type2); - } else if(!state->method->is_global) { - namespace_t ns = modifiers2access(mod); - multiname_t mname = {QNAME, &ns, 0, name}; - if(mod->flags&FLAG_STATIC) - f = abc_class_staticmethod(state->cls->abc, type2, &mname); - else - f = abc_class_method(state->cls->abc, type2, &mname); - slot = f->trait->slot_id; - } else { - namespace_t mname_ns = {state->method->info->access, state->package}; - multiname_t mname = {QNAME, &mname_ns, 0, name}; - - f = abc_method_new(global->file, type2, 1); - if(!global->init) global->init = abc_initscript(global->file); - trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f); - //abc_code_t*c = global->init->method->body->code; - } - //flash doesn't seem to allow us to access function slots - //state->method->info->slot = slot; - - if(mod && mod->flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE; - if(getset == KW_GET) f->trait->kind = TRAIT_GETTER; - if(getset == KW_SET) f->trait->kind = TRAIT_SETTER; - if(params->varargs) f->flags |= METHOD_NEED_REST; - if(state->method->need_arguments) f->flags |= METHOD_NEED_ARGUMENTS; - - char opt=0; - param_list_t*p=0; - for(p=params->list;p;p=p->next) { - if(params->varargs && !p->next) { - break; //varargs: omit last parameter in function signature - } - multiname_t*m = sig2mname(p->param->type); - list_append(f->parameters, m); - if(p->param->value) { - check_constant_against_type(p->param->type, p->param->value); - opt=1;list_append(f->optional_parameters, p->param->value); - } else if(opt) { - syntaxerror("function %s: non-optional parameter not allowed after optional parameters", name); - } - } - if(state->method->slots) { - DICT_ITERATE_ITEMS(state->method->slots, char*, name, variable_t*, v) { - if(v->index) { - multiname_t*mname = multiname_new(namespace_new(ACCESS_PACKAGE, ""), name); - multiname_t*type = sig2mname(v->type); - trait_t*t = trait_new_member(&f->body->traits, type, mname, 0); - t->slot_id = v->index; - } - } - } - - check_code_for_break(body); - - /* Seems this works now. - if(state->method->exceptions && state->method->uses_slots) { - as3_warning("try/catch and activation not supported yet within the same method"); - }*/ - - if(f->body) { - f->body->code = body; - f->body->exceptions = state->method->exceptions; - } else { //interface - if(body) - syntaxerror("interface methods can't have a method body"); - } - - old_state(); - return f; - } - - return 0; -} - -void breakjumpsto(code_t*c, char*name, code_t*jump) -{ - while(c) { - if(c->opcode == OPCODE___BREAK__) { - string_t*name2 = c->data[0]; - if(!name2->len || !strncmp(name2->str, name, name2->len)) { - c->opcode = OPCODE_JUMP; - c->branch = jump; - } - } - c=c->prev; - } -} -void continuejumpsto(code_t*c, char*name, code_t*jump) -{ - while(c) { - if(c->opcode == OPCODE___CONTINUE__) { - string_t*name2 = c->data[0]; - if(!name2->len || !strncmp(name2->str, name, name2->len)) { - c->opcode = OPCODE_JUMP; - c->branch = jump; - } - } - c = c->prev; - } -} - -code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to) -{ - if(from==to) - return c; - if(!to) { - return abc_coerce_a(c); - } - MULTINAME(m, to); - if(!from) { - // cast an "any" type to a specific type. subject to - // runtime exceptions - return abc_coerce2(c, &m); - } - - if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) && - (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) { - // allow conversion between number types - if(TYPE_IS_UINT(to)) - return abc_convert_u(c); - else if(TYPE_IS_INT(to)) - return abc_convert_i(c); - else if(TYPE_IS_NUMBER(to)) - return abc_convert_d(c); - return abc_coerce2(c, &m); - } - - if(TYPE_IS_XMLLIST(to) && TYPE_IS_XML(from)) - return c; - - if(TYPE_IS_BOOLEAN(to)) - return abc_convert_b(c); - if(TYPE_IS_STRING(to)) - return abc_convert_s(c); - if(TYPE_IS_OBJECT(to)) - return abc_coerce2(c, &m); - if(TYPE_IS_OBJECT(from) && TYPE_IS_XMLLIST(to)) - return abc_coerce2(c, &m); - if(TYPE_IS_OBJECT(from) && TYPE_IS_ARRAY(to)) - return abc_coerce2(c, &m); - - classinfo_t*supertype = from; - while(supertype) { - if(supertype == to) { - /* target type is one of from's superclasses. - (not sure we need this coerce - as far as the verifier - is concerned, object==object (i think) */ - return abc_coerce2(c, &m); - } - int t=0; - while(supertype->interfaces[t]) { - if(supertype->interfaces[t]==to) { - // target type is one of from's interfaces - return abc_coerce2(c, &m); - } - t++; - } - supertype = supertype->superclass; - } - if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to)) - return c; - if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to)) - return c; - if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to)) - return c; - - as3_error("can't convert type %s%s%s to %s%s%s", - from->package, from->package[0]?".":"", from->name, - to->package, to->package[0]?".":"", to->name); - - return c; -} -code_t* coerce_to_type(code_t*c, classinfo_t*t) -{ - if(!t) { - return abc_coerce_a(c); - } else if(TYPE_IS_STRING(t)) { - return abc_coerce_s(c); - } else { - MULTINAME(m, t); - return abc_coerce2(c, &m); - } -} - -char is_pushundefined(code_t*c) -{ - return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED); -} - -static const char* get_package_from_name(const char*name) -{ - /* try explicit imports */ - dictentry_t* e = dict_get_slot(state->imports, name); - while(e) { - if(!strcmp(e->key, name)) { - slotinfo_t*c = (slotinfo_t*)e->data; - if(c) return c->package; - } - e = e->next; - } - return 0; -} -static namespace_list_t*get_current_imports() -{ - namespace_list_t*searchlist = 0; - - list_append(searchlist, namespace_new_package(state->package)); - - import_list_t*l = state->wildcard_imports; - while(l) { - namespace_t*ns = namespace_new_package(l->import->package); - list_append(searchlist, ns); - l = l->next; - } - list_append(searchlist, namespace_new_package("")); - list_append(searchlist, namespace_new_package(internal_filename_package)); - return searchlist; -} - -static slotinfo_t* find_class(const char*name) -{ - slotinfo_t*c=0; - - c = registry_find(state->package, name); - if(c) return c; - - /* try explicit imports */ - dictentry_t* e = dict_get_slot(state->imports, name); - if(c) return c; - while(e) { - if(!strcmp(e->key, name)) { - c = (slotinfo_t*)e->data; - if(c) return c; - } - e = e->next; - } - - /* try package.* imports */ - import_list_t*l = state->wildcard_imports; - while(l) { - //printf("does package %s contain a class %s?\n", l->import->package, name); - c = registry_find(l->import->package, name); - if(c) return c; - l = l->next; - } - - /* try global package */ - c = registry_find("", name); - if(c) return c; - - /* try local "filename" package */ - c = registry_find(internal_filename_package, name); - if(c) return c; - - return 0; -} -typedcode_t push_class(slotinfo_t*a) -{ - typedcode_t x; - x.c = 0; - x.t = 0; - if(a->access == ACCESS_PACKAGEINTERNAL && - strcmp(a->package, state->package) && - strcmp(a->package, internal_filename_package) - ) { - syntaxerror("Can't access internal %s %s in package '%s' from package '%s'", - infotypename(a), a->name, a->package, state->package); - } - - - if(a->kind != INFOTYPE_CLASS) { - MULTINAME(m, a); - x.c = abc_findpropstrict2(x.c, &m); - x.c = abc_getproperty2(x.c, &m); - if(a->kind == INFOTYPE_METHOD) { - methodinfo_t*f = (methodinfo_t*)a; - x.t = TYPE_FUNCTION(f); - } else { - varinfo_t*v = (varinfo_t*)a; - x.t = v->type; - } - return x; - } else { - if(state->cls && state->method == state->cls->static_init) { - /* we're in the static initializer. - record the fact that we're using this class here */ - parsedclass_add_dependency(state->cls->dependencies, (classinfo_t*)a); - } - classinfo_t*c = (classinfo_t*)a; - //if(c->slot) { - if(0) { //Error #1026: Slot 1 exceeds slotCount=0 of global - x.c = abc_getglobalscope(x.c); - x.c = abc_getslot(x.c, c->slot); - } else { - MULTINAME(m, c); - x.c = abc_getlex2(x.c, &m); - } - x.t = TYPE_CLASS(c); - } - return x; -} - - -char is_break_or_jump(code_t*c) -{ - if(!c) - return 0; - if(c->opcode == OPCODE_JUMP || - c->opcode == OPCODE___BREAK__ || - c->opcode == OPCODE___CONTINUE__ || - c->opcode == OPCODE_THROW || - c->opcode == OPCODE_RETURNVOID || - c->opcode == OPCODE_RETURNVALUE) { - return 1; - } - return 0; -} - -#define IS_FINALLY_TARGET(op) \ - ((op) == OPCODE___CONTINUE__ || \ - (op) == OPCODE___BREAK__ || \ - (op) == OPCODE_RETURNVOID || \ - (op) == OPCODE_RETURNVALUE || \ - (op) == OPCODE___RETHROW__) - -static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar) -{ -#define NEED_EXTRA_STACK_ARG - code_t*finally_label = abc_nop(0); - NEW(lookupswitch_t, l); - //_lookupswitch - - code_t*i = c; - int count=0; - while(i) { - code_t*prev = i->prev; - if(IS_FINALLY_TARGET(i->opcode)) { - code_t*p = prev; - char needvalue=0; - if(i->opcode == OPCODE___RETHROW__ || - i->opcode == OPCODE_RETURNVALUE) { - if(i->opcode == OPCODE___RETHROW__) - i->opcode = OPCODE_THROW; - needvalue=1; - p = abc_coerce_a(p); - p = abc_setlocal(p, tempvar); - } - p = abc_pushbyte(p, count++); - p = abc_jump(p, finally_label); - code_t*target = p = abc_label(p); -#ifdef NEED_EXTRA_STACK_ARG - p = abc_pop(p); -#endif - if(needvalue) { - p = abc_getlocal(p, tempvar); - } - - p->next = i;i->prev = p; - list_append(l->targets, target); - } - i = prev; - } - - code_t*j,*f; - c = abc_pushbyte(c, -1); - c = code_append(c, finally_label); - c = code_append(c, finally); - -#ifdef NEED_EXTRA_STACK_ARG - c = abc_dup(c); -#endif - c = abc_lookupswitch(c, l); - c = l->def = abc_label(c); -#ifdef NEED_EXTRA_STACK_ARG - c = abc_pop(c); -#endif - - return c; -} - -static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar) -{ - code_t*i = c; - while(i) { - code_t*prev = i->prev; - if(IS_FINALLY_TARGET(i->opcode)) { - if(i->opcode == OPCODE___RETHROW__) - i->opcode = OPCODE_THROW; - code_t*end = code_dup(finally); - code_t*start = code_start(end); - if(prev) prev->next = start; - start->prev = prev; - i->prev = end; - end->next = i; - } - i = prev; - } - return code_append(c, finally); -} - -code_t* insert_finally(code_t*c, code_t*finally, int tempvar) -{ - if(!finally) - return c; - code_t*i = c; - char cantdup=0; - int num_insertion_points=0; - while(i) { - if(IS_FINALLY_TARGET(i->opcode)) - num_insertion_points++; - i = i->prev; - } - i = finally; - int code_size=0; - while(i) { - code_size++; - if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) { - cantdup=1; - } - i = i->prev; - } - int simple_version_cost = (1+num_insertion_points)*code_size; - int lookup_version_cost = 4*num_insertion_points + 5; - - if(cantdup || simple_version_cost > lookup_version_cost) { - //printf("(use lookup) simple=%d > lookup=%d\n", simple_version_cost, lookup_version_cost); - return insert_finally_lookup(c, finally, tempvar); - } else { - //printf("(use simple) simple=%d < lookup=%d\n", simple_version_cost, lookup_version_cost); - return insert_finally_simple(c, finally, tempvar); - } -} - #define PASS1 }} if(as3_pass == 1) {{ #define PASS1END }} if(as3_pass == 2) {{ #define PASS2 }} if(as3_pass == 2) {{ @@ -1955,11 +307,11 @@ /* Line 273 of skeleton.m4 */ -#line 1959 "parser.tab.c" +#line 311 "parser.tab.c" /* Unqualified %code blocks. */ /* Line 274 of skeleton.m4 */ -#line 2050 "parser.y" +#line 403 "parser.y" char is_subtype_of(classinfo_t*type, classinfo_t*supertype) { @@ -1976,7 +328,7 @@ /* Line 274 of skeleton.m4 */ -#line 2500 "parser.y" +#line 854 "parser.y" static void state_has_imports() { @@ -1999,7 +351,7 @@ /* Line 274 of skeleton.m4 */ -#line 2639 "parser.y" +#line 999 "parser.y" static int slotstate_varconst = 0; static modifiers_t*slotstate_flags = 0; @@ -2019,7 +371,7 @@ state->method = state->cls->static_init; } } else { - parserassert(state->method); + as3_assert(state->method); } } static trait_t* add_abc_slot(modifiers_t* modifiers, const char*name, multiname_t*m, code_t***c) @@ -2061,15 +413,63 @@ /* Line 274 of skeleton.m4 */ -#line 2819 "parser.y" +#line 1173 "parser.y" static int xml_level = 0; /* Line 274 of skeleton.m4 */ -#line 3624 "parser.y" +#line 1841 "parser.y" + + node_t* resolve_identifier(const char*name); + node_t* get_descendants(node_t*e,const char*ns,const char*subnode,char multi, char attr) + { + typedcode_t v = node_read(e); + typedcode_t w; + + multiname_t m = {0,0,0,subnode}; + namespace_t zero = {ZERONAMESPACE,"*"}; + if(!strcmp(ns,"*")) { + m.ns = &zero; + m.type = attr?QNAMEA:QNAME; + } else { + typedcode_t w = node_read(resolve_identifier(ns)); + if(!TYPE_IS_NAMESPACE(w.t)) { + as3_softwarning("%s might not be a namespace", ns); + } + v.c = code_append(v.c, w.c); + v.c = converttype(v.c, w.t, TYPE_NAMESPACE); + m.type = attr?RTQNAMEA:RTQNAME; + } + + if(!multi) { + v.c = abc_getproperty2(v.c, &m); + } else { + v.c = abc_getdescendants2(v.c, &m); + } + + if(TYPE_IS_XML(v.t)) { + v.t = TYPE_XMLLIST; + } else { + v.c = abc_coerce_a(v.c); + v.t = TYPE_ANY; + } + return mkcodenode(v); + } + + +/* Line 274 of skeleton.m4 */ +#line 2016 "parser.y" + + node_t* var_read(variable_t*v) + { + typedcode_t o; + o.c = abc_getlocal(0, v->index); + o.t = v->type; + return mkcodenode(o); + } - node_t* resolve_identifier(char*name) + node_t* resolve_identifier(const char*name) { typedcode_t o; o.t = 0; @@ -2082,11 +482,9 @@ /* look at variables */ if((v = find_variable(state, name))) { // name is a local variable - o.c = abc_getlocal(o.c, v->index); - o.t = v->type; - return mkcodenode(o); + return var_read(v); } - if((v = find_slot(state, name))) { + if((v = find_slot(state->method, name))) { o.c = abc_getscopeobject(o.c, 1); o.c = abc_getslot(o.c, v->index); o.t = v->type; @@ -2095,58 +493,69 @@ int i_am_static = state->method->is_static; - /* look at current class' members */ - if(!state->method->inner && - !state->xmlfilter && - state->cls && - (f = findmember_nsset(state->cls->info, name, 1))) - { - // name is a member or attribute in this class - int var_is_static = (f->flags&FLAG_STATIC); - - if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) { - /* if the variable is a constant (and we know what is evaluates to), we - can just use the value itself */ - varinfo_t*v = (varinfo_t*)f; - if(v->value) { - return mkconstnode(v->value); - } - } - - if(var_is_static >= i_am_static) { - if(f->kind == INFOTYPE_METHOD) { - o.t = TYPE_FUNCTION(f); - } else { - o.t = f->type; - } + if(!state->method->inner && !state->xmlfilter && state->cls) + { + /* look at current class' members */ + if((f = findmember_nsset(state->cls->info, name, 1, i_am_static))) + { + // name is a member or attribute in this class + int var_is_static = (f->flags&FLAG_STATIC); - if(var_is_static && !i_am_static) { - /* access to a static member from a non-static location. - do this via findpropstrict: - there doesn't seem to be any non-lookup way to access - static properties of a class */ - state->method->late_binding = 1; - o.t = f->type; - namespace_t ns = {f->access, f->package}; - multiname_t m = {QNAME, &ns, 0, name}; - o.c = abc_findpropstrict2(o.c, &m); - o.c = abc_getproperty2(o.c, &m); - return mkcodenode(o); - } else if(f->slot>0) { - o.c = abc_getlocal_0(o.c); - o.c = abc_getslot(o.c, f->slot); - return mkcodenode(o); - } else { - MEMBER_MULTINAME(m, f, name); - o.c = abc_getlocal_0(o.c); - o.c = abc_getproperty2(o.c, &m); - return mkcodenode(o); - } - } - } + if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) { + /* if the variable is a constant (and we know what is evaluates to), we + can just use the value itself */ + varinfo_t*v = (varinfo_t*)f; + if(v->value) { + return mkconstnode(v->value); + } + } + + if(var_is_static >= i_am_static) { + if(f->kind == INFOTYPE_METHOD) { + o.t = TYPE_FUNCTION(f); + } else { + o.t = f->type; + } + + if(var_is_static && !i_am_static) { + /* access to a static member from a non-static location. + do this via findpropstrict: + there doesn't seem to be any non-lookup way to access + static properties of a class */ + state->method->late_binding = 1; + o.t = f->type; + namespace_t ns = {f->access, f->package}; + multiname_t m = {QNAME, &ns, 0, name}; + o.c = abc_findpropstrict2(o.c, &m); + o.c = abc_getproperty2(o.c, &m); + return mkcodenode(o); + } else if(f->slot>0) { + o.c = abc_getlocal_0(o.c); + o.c = abc_getslot(o.c, f->slot); + return mkcodenode(o); + } else { + MEMBER_MULTINAME(m, f, name); + o.c = abc_getlocal_0(o.c); + o.c = abc_getproperty2(o.c, &m); + return mkcodenode(o); + } + } + } + /* special case: it's allowed to access non-static constants + from a static context */ + if(i_am_static && (f=findmember_nsset(state->cls->info, name, 1, 0))) { + if(f->kind == INFOTYPE_VAR && (f->flags&FLAG_CONST)) { + varinfo_t*v = (varinfo_t*)f; + if(v->value) { + return mkconstnode(v->value); + } + } + } + } /* look at actual classes, in the current package and imported */ if(!state->xmlfilter && (a = find_class(name))) { + registry_use(a); if(state->cls && state->cls->info == (classinfo_t*)a && i_am_static) { o.c = abc_getlocal_0(0); o.t = TYPE_CLASS((classinfo_t*)a); @@ -2160,7 +569,7 @@ if(!state->xmlfilter && (dict_contains(state->import_toplevel_packages, name) || registry_ispackage(name))) { - o.c = abc___pushpackage__(o.c, name); + o.c = abc___pushpackage__(o.c, (char*)name); o.t = 0; return mkcodenode(o); //? } @@ -2184,7 +593,7 @@ /* Line 274 of skeleton.m4 */ -#line 3764 "parser.y" +#line 2175 "parser.y" void add_active_url(const char*url) { @@ -2196,7 +605,7 @@ /* Line 274 of skeleton.m4 */ -#line 2200 "parser.tab.c" +#line 609 "parser.tab.c" #ifdef short # undef short @@ -2409,22 +818,22 @@ #endif /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 164 +#define YYFINAL 158 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3411 +#define YYLAST 3127 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 136 +#define YYNTOKENS 137 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 135 +#define YYNNTS 134 /* YYNRULES -- Number of rules. */ -#define YYNRULES 354 +#define YYNRULES 350 /* YYNRULES -- Number of states. */ -#define YYNSTATES 601 +#define YYNSTATES 593 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 365 +#define YYMAXUTOK 366 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -2436,7 +845,7 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 120, 2, 2, 2, 118, 109, 2, - 124, 135, 117, 115, 102, 114, 129, 116, 2, 2, + 124, 136, 117, 115, 102, 114, 129, 116, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, 101, 111, 104, 112, 105, 130, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -2444,7 +853,7 @@ 2, 126, 2, 127, 108, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 128, 107, 134, 119, 2, 2, 2, + 2, 2, 2, 128, 107, 135, 119, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -2468,7 +877,7 @@ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 103, 110, 113, 121, - 122, 123, 125, 131, 132, 133 + 122, 123, 125, 131, 132, 133, 134 }; #if YYDEBUG @@ -2477,195 +886,195 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 6, 8, 10, 13, 15, 17, - 19, 21, 23, 25, 30, 32, 33, 35, 37, 40, - 42, 44, 46, 48, 50, 55, 60, 62, 64, 65, - 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, - 88, 90, 92, 94, 96, 100, 103, 105, 107, 109, - 111, 113, 115, 117, 122, 125, 127, 129, 130, 134, - 137, 138, 141, 144, 146, 150, 154, 155, 158, 159, - 162, 169, 170, 172, 174, 178, 180, 183, 187, 196, - 203, 209, 216, 218, 221, 223, 226, 227, 229, 231, - 234, 236, 239, 244, 248, 249, 258, 259, 269, 270, - 276, 278, 281, 283, 286, 288, 289, 296, 299, 301, - 306, 309, 311, 313, 315, 317, 319, 323, 325, 326, - 333, 334, 340, 343, 346, 351, 352, 354, 356, 359, - 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, - 380, 383, 384, 387, 388, 391, 392, 402, 403, 412, - 413, 415, 417, 420, 422, 427, 429, 431, 433, 434, - 436, 438, 441, 443, 446, 455, 457, 459, 460, 465, - 467, 471, 475, 476, 479, 481, 483, 485, 487, 489, - 491, 493, 495, 497, 499, 501, 503, 504, 505, 510, - 511, 516, 517, 520, 523, 526, 529, 533, 535, 537, - 538, 540, 547, 558, 570, 572, 575, 577, 581, 585, - 589, 593, 594, 596, 599, 604, 608, 610, 615, 618, - 620, 622, 623, 624, 637, 639, 640, 641, 652, 654, - 658, 660, 662, 664, 668, 670, 672, 674, 677, 678, - 679, 683, 684, 686, 688, 690, 693, 696, 697, 702, - 707, 712, 715, 717, 720, 722, 724, 726, 730, 732, - 736, 737, 739, 741, 743, 745, 747, 749, 753, 759, - 761, 763, 765, 767, 769, 771, 773, 775, 777, 779, - 783, 787, 791, 795, 799, 803, 807, 811, 815, 819, - 823, 827, 830, 833, 837, 841, 845, 849, 853, 857, - 861, 865, 869, 873, 877, 881, 885, 889, 893, 896, - 899, 901, 905, 908, 913, 917, 921, 925, 929, 933, - 937, 941, 945, 949, 953, 957, 961, 967, 970, 973, - 976, 979, 983, 986, 987, 994, 996, 998, 1000, 1002, - 1004, 1010, 1014, 1020, 1025, 1030, 1037, 1044, 1048, 1050, - 1053, 1058, 1063, 1066, 1071 + 19, 21, 23, 25, 27, 28, 30, 32, 35, 37, + 39, 41, 43, 45, 50, 52, 54, 55, 58, 60, + 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, + 82, 84, 86, 90, 93, 95, 97, 99, 101, 103, + 105, 107, 110, 112, 114, 115, 118, 119, 122, 125, + 127, 131, 135, 136, 139, 140, 143, 150, 151, 153, + 155, 159, 161, 164, 168, 177, 184, 190, 197, 199, + 202, 204, 207, 208, 210, 212, 215, 217, 220, 225, + 229, 230, 239, 240, 250, 251, 257, 259, 262, 264, + 267, 269, 270, 277, 280, 282, 287, 290, 292, 294, + 296, 298, 302, 304, 305, 312, 313, 319, 322, 325, + 330, 331, 333, 335, 338, 340, 342, 344, 346, 348, + 350, 352, 354, 356, 357, 360, 361, 364, 365, 368, + 369, 379, 380, 389, 390, 392, 394, 397, 399, 401, + 403, 408, 410, 411, 413, 415, 418, 420, 423, 432, + 434, 436, 437, 442, 444, 448, 452, 453, 456, 458, + 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, + 480, 481, 482, 487, 488, 493, 494, 497, 500, 503, + 506, 510, 512, 514, 515, 517, 524, 535, 547, 549, + 552, 554, 558, 562, 566, 570, 571, 573, 576, 581, + 585, 587, 592, 595, 597, 599, 600, 601, 614, 616, + 617, 618, 629, 631, 635, 637, 639, 641, 645, 647, + 649, 651, 654, 655, 656, 660, 661, 663, 665, 667, + 670, 673, 674, 679, 684, 689, 692, 694, 697, 699, + 701, 703, 707, 709, 713, 714, 716, 718, 720, 722, + 724, 726, 730, 736, 738, 740, 742, 744, 746, 748, + 750, 752, 754, 756, 760, 764, 768, 772, 776, 780, + 784, 788, 792, 796, 800, 804, 807, 810, 814, 818, + 822, 826, 830, 834, 838, 842, 846, 850, 854, 858, + 862, 866, 870, 873, 876, 878, 882, 885, 890, 894, + 898, 902, 906, 910, 914, 918, 922, 926, 930, 934, + 938, 944, 947, 950, 953, 956, 960, 963, 964, 971, + 973, 975, 977, 981, 987, 991, 997, 1003, 1008, 1015, + 1020, 1027, 1034, 1041, 1045, 1047, 1050, 1055, 1060, 1063, + 1068 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 137, 0, -1, 138, -1, -1, 139, -1, 140, -1, - 139, 140, -1, 188, -1, 200, -1, 198, -1, 234, - -1, 209, -1, 149, -1, 151, 128, 138, 134, -1, - 101, -1, -1, 142, -1, 143, -1, 142, 143, -1, - 200, -1, 198, -1, 234, -1, 209, -1, 149, -1, - 151, 128, 141, 134, -1, 126, 150, 261, 127, -1, - 101, -1, 145, -1, -1, 145, 147, -1, 147, -1, + 138, 0, -1, 139, -1, -1, 140, -1, 141, -1, + 140, 141, -1, 188, -1, 200, -1, 198, -1, 234, + -1, 209, -1, 150, -1, 101, -1, -1, 143, -1, + 144, -1, 143, 144, -1, 200, -1, 198, -1, 234, + -1, 209, -1, 150, -1, 126, 151, 261, 127, -1, + 101, -1, 146, -1, -1, 146, 148, -1, 148, -1, 269, -1, 191, -1, 163, -1, 164, -1, 165, -1, 166, -1, 173, -1, 159, -1, 185, -1, 181, -1, - 257, -1, 270, -1, 268, -1, 128, 145, 134, -1, - 128, 134, -1, 101, -1, 146, -1, 153, -1, 167, - -1, 168, -1, 253, -1, 183, -1, 151, 128, 145, - 134, -1, 147, 101, -1, 147, -1, 146, -1, -1, - 3, 91, 3, -1, 104, 261, -1, -1, 46, 154, - -1, 32, 154, -1, 155, -1, 154, 102, 155, -1, - 3, 244, 152, -1, -1, 157, 148, -1, -1, 66, - 156, -1, 65, 124, 255, 135, 156, 158, -1, -1, - 153, -1, 257, -1, 46, 3, 244, -1, 3, -1, - 11, 124, -1, 11, 50, 124, -1, 162, 160, 101, - 255, 101, 257, 135, 156, -1, 162, 161, 69, 255, - 135, 156, -1, 12, 124, 255, 135, 156, -1, 13, - 156, 12, 124, 255, 135, -1, 67, -1, 67, 3, - -1, 30, -1, 30, 3, -1, -1, 170, -1, 172, - -1, 170, 172, -1, 171, -1, 170, 171, -1, 34, - 261, 106, 144, -1, 62, 106, 144, -1, -1, 14, - 124, 174, 261, 135, 128, 169, 134, -1, -1, 33, - 124, 3, 244, 135, 176, 128, 144, 134, -1, -1, - 27, 128, 178, 144, 134, -1, 175, -1, 179, 175, - -1, 179, -1, 179, 177, -1, 177, -1, -1, 52, - 128, 182, 144, 134, 180, -1, 37, 255, -1, 37, - -1, 39, 124, 255, 135, -1, 184, 148, -1, 3, - -1, 17, -1, 16, -1, 29, -1, 4, -1, 187, - 129, 186, -1, 186, -1, -1, 17, 187, 128, 189, - 141, 134, -1, -1, 17, 128, 190, 141, 134, -1, - 41, 3, -1, 41, 240, -1, 41, 187, 129, 117, - -1, -1, 193, -1, 194, -1, 193, 194, -1, 20, - -1, 21, -1, 18, -1, 38, -1, 47, -1, 49, - -1, 48, -1, 25, -1, 23, -1, 4, -1, -1, - 54, 241, -1, -1, 54, 242, -1, -1, 15, 242, - -1, -1, 192, 31, 3, 195, 197, 128, 199, 202, - 134, -1, -1, 192, 44, 3, 196, 128, 201, 205, - 134, -1, -1, 203, -1, 204, -1, 203, 204, -1, - 101, -1, 151, 128, 202, 134, -1, 209, -1, 234, - -1, 146, -1, -1, 206, -1, 207, -1, 206, 207, - -1, 101, -1, 46, 3, -1, 192, 26, 233, 3, - 124, 230, 135, 244, -1, 46, -1, 32, -1, -1, - 192, 208, 210, 211, -1, 212, -1, 211, 102, 212, - -1, 3, 244, 152, -1, -1, 104, 261, -1, 8, - -1, 9, -1, 10, -1, 5, -1, 56, -1, 55, - -1, 45, -1, 28, -1, 29, -1, 227, -1, 111, - -1, 112, -1, -1, -1, 128, 261, 220, 134, -1, - -1, 128, 261, 222, 134, -1, -1, 223, 219, -1, - 223, 5, -1, 223, 112, -1, 227, 223, -1, 224, - 227, 223, -1, 3, -1, 221, -1, -1, 228, -1, - 216, 225, 226, 116, 218, 112, -1, 216, 225, 226, - 217, 223, 111, 116, 225, 218, 112, -1, 216, 225, - 226, 217, 223, 224, 111, 116, 225, 218, 112, -1, - 229, -1, 228, 229, -1, 221, -1, 221, 104, 5, - -1, 221, 104, 221, -1, 3, 104, 221, -1, 3, - 104, 5, -1, -1, 231, -1, 95, 232, -1, 231, - 102, 95, 232, -1, 231, 102, 232, -1, 232, -1, - 3, 106, 243, 213, -1, 3, 213, -1, 51, -1, - 35, -1, -1, -1, 192, 26, 233, 3, 124, 230, - 135, 244, 128, 235, 144, 134, -1, 3, -1, -1, - -1, 26, 236, 124, 230, 135, 244, 128, 238, 144, - 134, -1, 186, -1, 187, 129, 186, -1, 240, -1, - 239, -1, 241, -1, 242, 102, 241, -1, 241, -1, - 117, -1, 36, -1, 106, 243, -1, -1, -1, 124, - 246, 135, -1, -1, 247, -1, 248, -1, 254, -1, - 247, 102, -1, 248, 254, -1, -1, 24, 261, 249, - 245, -1, 261, 124, 246, 135, -1, 53, 124, 246, - 135, -1, 64, 261, -1, 42, -1, 42, 255, -1, - 261, -1, 256, -1, 261, -1, 256, 102, 261, -1, - 261, -1, 257, 102, 261, -1, -1, 260, -1, 3, - -1, 5, -1, 8, -1, 9, -1, 10, -1, 259, - 106, 254, -1, 260, 102, 259, 106, 254, -1, 237, - -1, 265, -1, 250, -1, 252, -1, 251, -1, 266, - -1, 214, -1, 215, -1, 6, -1, 19, -1, 126, - 246, 127, -1, 71, 258, 134, -1, 261, 111, 261, - -1, 261, 112, 261, -1, 261, 76, 261, -1, 261, - 77, 261, -1, 261, 72, 261, -1, 261, 73, 261, - -1, 261, 75, 261, -1, 261, 74, 261, -1, 261, - 89, 261, -1, 261, 90, 261, -1, 120, 261, -1, - 119, 261, -1, 261, 109, 261, -1, 261, 108, 261, - -1, 261, 107, 261, -1, 261, 98, 261, -1, 261, - 97, 261, -1, 261, 96, 261, -1, 261, 116, 261, - -1, 261, 118, 261, -1, 261, 115, 261, -1, 261, - 114, 261, -1, 261, 117, 261, -1, 261, 69, 261, - -1, 261, 70, 261, -1, 261, 40, 261, -1, 261, - 68, 261, -1, 43, 261, -1, 36, 261, -1, 36, - -1, 124, 256, 135, -1, 114, 261, -1, 261, 126, - 261, 127, -1, 261, 81, 261, -1, 261, 80, 261, - -1, 261, 87, 261, -1, 261, 86, 261, -1, 261, - 88, 261, -1, 261, 79, 261, -1, 261, 78, 261, - -1, 261, 85, 261, -1, 261, 82, 261, -1, 261, - 83, 261, -1, 261, 84, 261, -1, 261, 104, 261, - -1, 261, 105, 261, 106, 261, -1, 261, 93, -1, - 261, 92, -1, 93, 261, -1, 92, 261, -1, 53, - 129, 3, -1, 130, 3, -1, -1, 261, 129, 124, - 262, 261, 135, -1, 3, -1, 117, -1, 4, -1, - 186, -1, 117, -1, 261, 129, 263, 91, 264, -1, - 261, 94, 264, -1, 261, 129, 126, 261, 127, -1, - 261, 129, 130, 264, -1, 261, 94, 130, 264, -1, - 261, 129, 130, 126, 261, 127, -1, 261, 94, 130, - 126, 261, 127, -1, 261, 129, 264, -1, 3, -1, - 16, 3, -1, 16, 3, 104, 3, -1, 16, 3, - 104, 5, -1, 192, 267, -1, 63, 16, 104, 261, - -1, 22, 16, 241, -1 + 257, -1, 270, -1, 268, -1, 128, 146, 135, -1, + 128, 135, -1, 101, -1, 147, -1, 153, -1, 167, + -1, 168, -1, 253, -1, 183, -1, 148, 101, -1, + 148, -1, 147, -1, -1, 104, 261, -1, -1, 45, + 154, -1, 31, 154, -1, 155, -1, 154, 102, 155, + -1, 3, 244, 152, -1, -1, 157, 149, -1, -1, + 65, 156, -1, 64, 124, 255, 136, 156, 158, -1, + -1, 153, -1, 257, -1, 45, 3, 244, -1, 3, + -1, 10, 124, -1, 10, 49, 124, -1, 162, 160, + 101, 255, 101, 257, 136, 156, -1, 162, 161, 68, + 255, 136, 156, -1, 11, 124, 255, 136, 156, -1, + 12, 156, 11, 124, 255, 136, -1, 66, -1, 66, + 3, -1, 29, -1, 29, 3, -1, -1, 170, -1, + 172, -1, 170, 172, -1, 171, -1, 170, 171, -1, + 33, 261, 106, 145, -1, 61, 106, 145, -1, -1, + 13, 124, 174, 261, 136, 128, 169, 135, -1, -1, + 32, 124, 3, 244, 136, 176, 128, 145, 135, -1, + -1, 26, 128, 178, 145, 135, -1, 175, -1, 179, + 175, -1, 179, -1, 179, 177, -1, 177, -1, -1, + 51, 128, 182, 145, 135, 180, -1, 36, 255, -1, + 36, -1, 38, 124, 255, 136, -1, 184, 149, -1, + 3, -1, 16, -1, 15, -1, 28, -1, 187, 129, + 186, -1, 186, -1, -1, 16, 187, 128, 189, 142, + 135, -1, -1, 16, 128, 190, 142, 135, -1, 40, + 3, -1, 40, 240, -1, 40, 187, 129, 117, -1, + -1, 193, -1, 194, -1, 193, 194, -1, 19, -1, + 20, -1, 17, -1, 37, -1, 46, -1, 48, -1, + 47, -1, 24, -1, 22, -1, -1, 53, 241, -1, + -1, 53, 242, -1, -1, 14, 242, -1, -1, 192, + 30, 3, 195, 197, 128, 199, 202, 135, -1, -1, + 192, 43, 3, 196, 128, 201, 205, 135, -1, -1, + 203, -1, 204, -1, 203, 204, -1, 101, -1, 209, + -1, 234, -1, 126, 151, 261, 127, -1, 147, -1, + -1, 206, -1, 207, -1, 206, 207, -1, 101, -1, + 45, 3, -1, 192, 25, 233, 3, 124, 230, 136, + 244, -1, 45, -1, 31, -1, -1, 192, 208, 210, + 211, -1, 212, -1, 211, 102, 212, -1, 3, 244, + 152, -1, -1, 104, 261, -1, 7, -1, 8, -1, + 9, -1, 4, -1, 55, -1, 54, -1, 44, -1, + 27, -1, 28, -1, 227, -1, 111, -1, 112, -1, + -1, -1, 128, 261, 220, 135, -1, -1, 128, 261, + 222, 135, -1, -1, 223, 219, -1, 223, 4, -1, + 223, 112, -1, 227, 223, -1, 224, 227, 223, -1, + 3, -1, 221, -1, -1, 228, -1, 216, 225, 226, + 116, 218, 112, -1, 216, 225, 226, 217, 223, 111, + 116, 225, 218, 112, -1, 216, 225, 226, 217, 223, + 224, 111, 116, 225, 218, 112, -1, 229, -1, 228, + 229, -1, 221, -1, 221, 104, 4, -1, 221, 104, + 221, -1, 3, 104, 221, -1, 3, 104, 4, -1, + -1, 231, -1, 94, 232, -1, 231, 102, 94, 232, + -1, 231, 102, 232, -1, 232, -1, 3, 106, 243, + 213, -1, 3, 213, -1, 50, -1, 34, -1, -1, + -1, 192, 25, 233, 3, 124, 230, 136, 244, 128, + 235, 145, 135, -1, 3, -1, -1, -1, 25, 236, + 124, 230, 136, 244, 128, 238, 145, 135, -1, 186, + -1, 187, 129, 186, -1, 240, -1, 239, -1, 241, + -1, 242, 102, 241, -1, 241, -1, 117, -1, 35, + -1, 106, 243, -1, -1, -1, 124, 246, 136, -1, + -1, 247, -1, 248, -1, 254, -1, 247, 102, -1, + 248, 254, -1, -1, 23, 261, 249, 245, -1, 261, + 124, 246, 136, -1, 52, 124, 246, 136, -1, 63, + 261, -1, 41, -1, 41, 255, -1, 261, -1, 256, + -1, 261, -1, 256, 102, 261, -1, 261, -1, 257, + 102, 261, -1, -1, 260, -1, 3, -1, 4, -1, + 7, -1, 8, -1, 9, -1, 259, 106, 254, -1, + 260, 102, 259, 106, 254, -1, 237, -1, 265, -1, + 250, -1, 252, -1, 251, -1, 266, -1, 214, -1, + 215, -1, 5, -1, 18, -1, 126, 246, 127, -1, + 70, 258, 135, -1, 261, 111, 261, -1, 261, 112, + 261, -1, 261, 75, 261, -1, 261, 76, 261, -1, + 261, 71, 261, -1, 261, 72, 261, -1, 261, 74, + 261, -1, 261, 73, 261, -1, 261, 88, 261, -1, + 261, 89, 261, -1, 120, 261, -1, 119, 261, -1, + 261, 109, 261, -1, 261, 108, 261, -1, 261, 107, + 261, -1, 261, 97, 261, -1, 261, 96, 261, -1, + 261, 95, 261, -1, 261, 116, 261, -1, 261, 118, + 261, -1, 261, 115, 261, -1, 261, 114, 261, -1, + 261, 117, 261, -1, 261, 68, 261, -1, 261, 69, + 261, -1, 261, 39, 261, -1, 261, 67, 261, -1, + 42, 261, -1, 35, 261, -1, 35, -1, 124, 256, + 136, -1, 114, 261, -1, 261, 126, 261, 127, -1, + 261, 80, 261, -1, 261, 79, 261, -1, 261, 86, + 261, -1, 261, 85, 261, -1, 261, 87, 261, -1, + 261, 78, 261, -1, 261, 77, 261, -1, 261, 84, + 261, -1, 261, 81, 261, -1, 261, 82, 261, -1, + 261, 83, 261, -1, 261, 104, 261, -1, 261, 105, + 261, 106, 261, -1, 261, 92, -1, 261, 91, -1, + 92, 261, -1, 91, 261, -1, 52, 129, 3, -1, + 130, 3, -1, -1, 261, 129, 124, 262, 261, 136, + -1, 117, -1, 186, -1, 117, -1, 261, 90, 261, + -1, 261, 129, 263, 90, 264, -1, 261, 93, 264, + -1, 261, 93, 263, 90, 264, -1, 261, 129, 126, + 261, 127, -1, 261, 129, 130, 264, -1, 261, 129, + 130, 263, 90, 264, -1, 261, 93, 130, 264, -1, + 261, 93, 130, 263, 90, 264, -1, 261, 129, 130, + 126, 261, 127, -1, 261, 93, 130, 126, 261, 127, + -1, 261, 129, 264, -1, 3, -1, 15, 3, -1, + 15, 3, 104, 3, -1, 15, 3, 104, 4, -1, + 192, 267, -1, 62, 15, 104, 261, -1, 21, 15, + 241, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1941, 1941, 1943, 1943, 1944, 1945, 1947, 1948, 1949, - 1950, 1951, 1952, 1953, 1954, 1956, 1956, 1957, 1958, 1960, - 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1969, 1970, 1972, - 1975, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, - 1987, 1988, 1989, 1990, 1991, 1992, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2014, 2015, 2019, 2030, 2038, 2065, - 2066, 2068, 2069, 2071, 2072, 2074, 2135, 2135, 2139, 2140, - 2143, 2159, 2160, 2161, 2166, 2170, 2175, 2176, 2178, 2198, - 2241, 2257, 2269, 2272, 2275, 2278, 2282, 2283, 2284, 2285, - 2286, 2287, 2289, 2300, 2303, 2303, 2334, 2334, 2359, 2359, - 2375, 2376, 2377, 2378, 2386, 2395, 2395, 2444, 2448, 2459, - 2469, 2486, 2487, 2488, 2489, 2490, 2492, 2493, 2495, 2495, - 2497, 2497, 2521, 2529, 2540, 2556, 2557, 2558, 2559, 2566, - 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2579, - 2580, 2582, 2583, 2585, 2586, 2590, 2588, 2596, 2594, 2603, - 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2612, 2618, 2619, - 2620, 2621, 2622, 2623, 2626, 2699, 2699, 2701, 2701, 2703, - 2704, 2706, 2790, 2791, 2800, 2801, 2804, 2805, 2806, 2807, - 2808, 2809, 2810, 2823, 2834, 2835, 2836, 2838, 2838, 2841, - 2841, 2844, 2845, 2848, 2853, 2856, 2859, 2862, 2865, 2869, - 2872, 2876, 2880, 2885, 2891, 2894, 2897, 2900, 2905, 2908, - 2911, 2921, 2925, 2931, 2937, 2945, 2950, 2956, 2964, 2972, - 2973, 2974, 2977, 2976, 2993, 2994, 2996, 2995, 3019, 3038, - 3052, 3053, 3055, 3056, 3058, 3059, 3060, 3069, 3070, 3074, - 3075, 3077, 3078, 3079, 3081, 3085, 3086, 3091, 3092, 3136, - 3186, 3207, 3229, 3232, 3239, 3242, 3245, 3248, 3251, 3254, - 3259, 3260, 3262, 3263, 3264, 3265, 3266, 3268, 3274, 3283, - 3284, 3285, 3286, 3287, 3288, 3290, 3294, 3299, 3317, 3328, - 3338, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, - 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, - 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, - 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, - 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3394, 3395, 3396, - 3397, 3399, 3414, 3422, 3422, 3476, 3477, 3478, 3479, 3480, - 3488, 3506, 3513, 3524, 3531, 3538, 3548, 3559, 3739, 3773, - 3780, 3787, 3794, 3816, 3822 + 0, 292, 292, 294, 294, 295, 296, 298, 299, 300, + 301, 302, 303, 305, 307, 307, 308, 309, 311, 312, + 313, 314, 315, 317, 318, 320, 321, 323, 326, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 346, 347, 348, 349, 350, 351, + 352, 367, 368, 372, 383, 418, 419, 421, 422, 424, + 425, 427, 488, 488, 492, 493, 496, 512, 513, 514, + 519, 523, 528, 529, 531, 551, 595, 611, 623, 626, + 629, 632, 636, 637, 638, 639, 640, 641, 643, 654, + 657, 657, 688, 688, 713, 713, 729, 730, 731, 732, + 740, 749, 749, 798, 803, 814, 824, 841, 842, 843, + 844, 846, 847, 849, 849, 851, 851, 875, 883, 897, + 913, 914, 915, 916, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 938, 939, 941, 942, 944, 945, 949, + 947, 955, 953, 962, 963, 964, 965, 966, 968, 969, + 970, 972, 978, 979, 980, 981, 982, 983, 986, 1059, + 1059, 1061, 1061, 1063, 1064, 1066, 1150, 1151, 1159, 1160, + 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1177, 1188, 1189, + 1190, 1192, 1192, 1195, 1195, 1198, 1199, 1202, 1207, 1210, + 1213, 1216, 1219, 1223, 1226, 1230, 1234, 1239, 1245, 1248, + 1251, 1254, 1259, 1262, 1265, 1275, 1279, 1285, 1291, 1299, + 1304, 1310, 1318, 1326, 1327, 1328, 1331, 1330, 1347, 1348, + 1350, 1349, 1373, 1393, 1408, 1409, 1411, 1412, 1414, 1415, + 1416, 1425, 1426, 1430, 1431, 1433, 1434, 1435, 1437, 1441, + 1442, 1447, 1448, 1495, 1545, 1566, 1588, 1591, 1598, 1601, + 1604, 1607, 1610, 1613, 1618, 1619, 1621, 1622, 1623, 1624, + 1625, 1627, 1633, 1642, 1643, 1644, 1645, 1646, 1647, 1649, + 1653, 1658, 1676, 1687, 1697, 1706, 1707, 1708, 1709, 1710, + 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, + 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, + 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, + 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, + 1751, 1753, 1754, 1755, 1756, 1758, 1773, 1781, 1781, 1836, + 1838, 1839, 1880, 1883, 1886, 1893, 1896, 1907, 1915, 1919, + 1926, 1930, 1940, 1951, 2149, 2184, 2191, 2198, 2205, 2227, + 2234 }; #endif @@ -2674,50 +1083,50 @@ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE", - "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT", - "\"for\"", "\"while\"", "\"do\"", "\"switch\"", "\"implements\"", - "\"namespace\"", "\"package\"", "\"protected\"", "\"arguments\"", - "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"", - "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"", "\"NaN\"", - "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"", - "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"", - "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"", - "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"", - "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"", - "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"", - "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"default xml\"", - "\"delete\"", "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", - "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", - "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"&=\"", - "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", - "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", - "\">>>\"", "\">>\"", "prec_none", "below_semicolon", "';'", "','", - "below_assignment", "'='", "'?'", "':'", "'|'", "'^'", "'&'", "below_lt", - "'<'", "'>'", "below_minus", "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", - "'!'", "minusminus_prefix", "plusplus_prefix", "below_curly", "'('", - "new2", "'['", "']'", "'{'", "'.'", "'@'", "above_identifier", - "below_else", "above_function", "'}'", "')'", "$accept", "PROGRAM", + "$end", "error", "$undefined", "T_IDENTIFIER", "T_STRING", "T_REGEXP", + "T_EMPTY", "T_INT", "T_UINT", "T_FLOAT", "\"for\"", "\"while\"", + "\"do\"", "\"switch\"", "\"implements\"", "\"namespace\"", "\"package\"", + "\"protected\"", "\"arguments\"", "\"public\"", "\"private\"", "\"use\"", + "\"internal\"", "\"new\"", "\"native\"", "\"function\"", "\"finally\"", + "\"undefined\"", "\"NaN\"", "\"continue\"", "\"class\"", "\"const\"", + "\"catch\"", "\"case\"", "\"set\"", "\"void\"", "\"throw\"", + "\"static\"", "\"with\"", "\"instanceof\"", "\"import\"", "\"return\"", + "\"typeof\"", "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", + "\"override\"", "\"final\"", "\"each\"", "\"get\"", "\"try\"", + "\"super\"", "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", + "\"uint\"", "\"int\"", "\"Number\"", "\"String\"", "\"default\"", + "\"default xml\"", "\"delete\"", "\"if\"", "\"else\"", "\"break\"", + "\"is\"", "\"in\"", "\"as\"", "\"{ (dictionary)\"", "\"==\"", "\"===\"", + "\"!=\"", "\"!==\"", "\"<=\"", "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", + "\"*=\"", "\"&=\"", "\"+=\"", "\"-=\"", "\"^=\"", "\">>=\"", "\"<<=\"", + "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", + "\"...\"", "\"<<\"", "\">>>\"", "\">>\"", "prec_none", "prec_var_read", + "below_semicolon", "';'", "','", "below_assignment", "'='", "'?'", "':'", + "'|'", "'^'", "'&'", "below_lt", "'<'", "'>'", "below_minus", "'-'", + "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix", + "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'", + "'.'", "'@'", "below_identifier", "above_identifier", "below_else", + "above_function", "'}'", "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", - "PACKAGE_INITCODE", "EMBED_START", "CONDITIONAL_COMPILATION", - "MAYBEEXPRESSION", "VARIABLE_DECLARATION", "VARIABLE_LIST", - "ONE_VARIABLE", "IF_CODEBLOCK", "$@1", "MAYBEELSE", "IF", "FOR_INIT", - "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "DO_WHILE", - "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", - "SWITCH", "$@2", "CATCH", "$@3", "FINALLY", "$@4", "CATCH_LIST", - "CATCH_FINALLY_LIST", "TRY", "$@5", "THROW", "WITH_HEAD", "WITH", - "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@6", "$@7", "IMPORT", - "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS", - "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@8", - "INTERFACE_DECLARATION", "$@9", "MAYBE_CLASS_BODY", "CLASS_BODY", - "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", - "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@10", "SLOT_LIST", - "ONE_SLOT", "MAYBECONSTANT", "CONSTANT", "XML", "OPEN", "CLOSE", - "CLOSE2", "XMLEXPR1", "$@11", "XMLEXPR2", "$@12", "XMLTEXT", "XML2", - "XML_ID_OR_EXPR", "MAYBE_XMLATTRIBUTES", "XMLNODE", "XMLATTRIBUTES", - "XMLATTRIBUTE", "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET", + "PACKAGE_INITCODE", "EMBED_START", "MAYBEEXPRESSION", + "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "IF_CODEBLOCK", + "$@1", "MAYBEELSE", "IF", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", + "FOR_IN", "WHILE", "DO_WHILE", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", + "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@2", "CATCH", "$@3", + "FINALLY", "$@4", "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@5", + "THROW", "WITH_HEAD", "WITH", "X_IDENTIFIER", "PACKAGE", + "PACKAGE_DECLARATION", "$@6", "$@7", "IMPORT", "MAYBE_MODIFIERS", + "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST", + "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@8", "INTERFACE_DECLARATION", + "$@9", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM", + "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST", + "SLOT_DECLARATION", "$@10", "SLOT_LIST", "ONE_SLOT", "MAYBECONSTANT", + "CONSTANT", "XML", "OPEN", "CLOSE", "CLOSE2", "XMLEXPR1", "$@11", + "XMLEXPR2", "$@12", "XMLTEXT", "XML2", "XML_ID_OR_EXPR", + "MAYBE_XMLATTRIBUTES", "XMLNODE", "XMLATTRIBUTES", "XMLATTRIBUTE", + "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13", "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS", "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", @@ -2748,90 +1157,90 @@ 355, 59, 44, 356, 61, 63, 58, 124, 94, 38, 357, 60, 62, 358, 45, 43, 47, 42, 37, 126, 33, 359, 360, 361, 40, 362, 91, 93, 123, 46, - 64, 363, 364, 365, 125, 41 + 64, 363, 364, 365, 366, 125, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 136, 137, 138, 138, 139, 139, 140, 140, 140, - 140, 140, 140, 140, 140, 141, 141, 142, 142, 143, - 143, 143, 143, 143, 143, 143, 143, 144, 144, 145, - 145, 146, 146, 146, 146, 146, 146, 146, 146, 146, - 146, 146, 146, 146, 146, 146, 147, 147, 147, 147, - 147, 147, 147, 147, 148, 148, 149, 150, 151, 152, - 152, 153, 153, 154, 154, 155, 157, 156, 158, 158, - 159, 160, 160, 160, 161, 161, 162, 162, 163, 164, - 165, 166, 167, 167, 168, 168, 169, 169, 169, 169, - 170, 170, 171, 172, 174, 173, 176, 175, 178, 177, - 179, 179, 180, 180, 180, 182, 181, 183, 183, 184, - 185, 186, 186, 186, 186, 186, 187, 187, 189, 188, - 190, 188, 191, 191, 191, 192, 192, 193, 193, 194, - 194, 194, 194, 194, 194, 194, 194, 194, 194, 195, - 195, 196, 196, 197, 197, 199, 198, 201, 200, 202, - 202, 203, 203, 204, 204, 204, 204, 204, 205, 205, - 206, 206, 207, 207, 207, 208, 208, 210, 209, 211, - 211, 212, 213, 213, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 215, 216, 217, 218, 220, 219, 222, - 221, 223, 223, 223, 223, 224, 224, 225, 225, 226, - 226, 227, 227, 227, 228, 228, 229, 229, 229, 229, - 229, 230, 230, 230, 230, 231, 231, 232, 232, 233, - 233, 233, 235, 234, 236, 236, 238, 237, 239, 240, - 241, 241, 242, 242, 243, 243, 243, 244, 244, 245, - 245, 246, 246, 246, 247, 248, 247, 249, 250, 251, - 251, 252, 253, 253, 254, 255, 256, 256, 257, 257, - 258, 258, 259, 259, 259, 259, 259, 260, 260, 261, - 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 0, 137, 138, 139, 139, 140, 140, 141, 141, 141, + 141, 141, 141, 141, 142, 142, 143, 143, 144, 144, + 144, 144, 144, 144, 144, 145, 145, 146, 146, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 148, 148, 148, 148, 148, 148, + 148, 149, 149, 150, 151, 152, 152, 153, 153, 154, + 154, 155, 157, 156, 158, 158, 159, 160, 160, 160, + 161, 161, 162, 162, 163, 164, 165, 166, 167, 167, + 168, 168, 169, 169, 169, 169, 170, 170, 171, 172, + 174, 173, 176, 175, 178, 177, 179, 179, 180, 180, + 180, 182, 181, 183, 183, 184, 185, 186, 186, 186, + 186, 187, 187, 189, 188, 190, 188, 191, 191, 191, + 192, 192, 193, 193, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 195, 195, 196, 196, 197, 197, 199, + 198, 201, 200, 202, 202, 203, 203, 204, 204, 204, + 204, 204, 205, 205, 206, 206, 207, 207, 207, 208, + 208, 210, 209, 211, 211, 212, 213, 213, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 215, 216, 217, + 218, 220, 219, 222, 221, 223, 223, 223, 223, 224, + 224, 225, 225, 226, 226, 227, 227, 227, 228, 228, + 229, 229, 229, 229, 229, 230, 230, 230, 230, 231, + 231, 232, 232, 233, 233, 233, 235, 234, 236, 236, + 238, 237, 239, 240, 241, 241, 242, 242, 243, 243, + 243, 244, 244, 245, 245, 246, 246, 246, 247, 248, + 247, 249, 250, 251, 251, 252, 253, 253, 254, 255, + 256, 256, 257, 257, 258, 258, 259, 259, 259, 259, + 259, 260, 260, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, - 261, 261, 261, 262, 261, 263, 263, 263, 264, 264, - 261, 261, 261, 261, 261, 261, 261, 265, 266, 267, - 267, 267, 268, 269, 270 + 261, 261, 261, 261, 261, 261, 261, 262, 261, 263, + 264, 264, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 265, 266, 267, 267, 267, 268, 269, + 270 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 0, 1, 1, 2, 1, 1, 1, - 1, 1, 1, 4, 1, 0, 1, 1, 2, 1, - 1, 1, 1, 1, 4, 4, 1, 1, 0, 2, + 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, + 1, 1, 1, 4, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, - 1, 1, 1, 4, 2, 1, 1, 0, 3, 2, - 0, 2, 2, 1, 3, 3, 0, 2, 0, 2, - 6, 0, 1, 1, 3, 1, 2, 3, 8, 6, - 5, 6, 1, 2, 1, 2, 0, 1, 1, 2, - 1, 2, 4, 3, 0, 8, 0, 9, 0, 5, - 1, 2, 1, 2, 1, 0, 6, 2, 1, 4, - 2, 1, 1, 1, 1, 1, 3, 1, 0, 6, - 0, 5, 2, 2, 4, 0, 1, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 0, 2, 0, 2, 0, 9, 0, 8, 0, - 1, 1, 2, 1, 4, 1, 1, 1, 0, 1, - 1, 2, 1, 2, 8, 1, 1, 0, 4, 1, - 3, 3, 0, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 4, 0, - 4, 0, 2, 2, 2, 2, 3, 1, 1, 0, - 1, 6, 10, 11, 1, 2, 1, 3, 3, 3, - 3, 0, 1, 2, 4, 3, 1, 4, 2, 1, - 1, 0, 0, 12, 1, 0, 0, 10, 1, 3, - 1, 1, 1, 3, 1, 1, 1, 2, 0, 0, - 3, 0, 1, 1, 1, 2, 2, 0, 4, 4, - 4, 2, 1, 2, 1, 1, 1, 3, 1, 3, - 0, 1, 1, 1, 1, 1, 1, 3, 5, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 0, 2, 0, 2, 2, 1, + 3, 3, 0, 2, 0, 2, 6, 0, 1, 1, + 3, 1, 2, 3, 8, 6, 5, 6, 1, 2, + 1, 2, 0, 1, 1, 2, 1, 2, 4, 3, + 0, 8, 0, 9, 0, 5, 1, 2, 1, 2, + 1, 0, 6, 2, 1, 4, 2, 1, 1, 1, + 1, 3, 1, 0, 6, 0, 5, 2, 2, 4, + 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 2, 0, 2, 0, 2, 0, + 9, 0, 8, 0, 1, 1, 2, 1, 1, 1, + 4, 1, 0, 1, 1, 2, 1, 2, 8, 1, + 1, 0, 4, 1, 3, 3, 0, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 4, 0, 4, 0, 2, 2, 2, 2, + 3, 1, 1, 0, 1, 6, 10, 11, 1, 2, + 1, 3, 3, 3, 3, 0, 1, 2, 4, 3, + 1, 4, 2, 1, 1, 0, 0, 12, 1, 0, + 0, 10, 1, 3, 1, 1, 1, 3, 1, 1, + 1, 2, 0, 0, 3, 0, 1, 1, 1, 2, + 2, 0, 4, 4, 4, 2, 1, 2, 1, 1, + 1, 3, 1, 3, 0, 1, 1, 1, 1, 1, + 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 1, 3, 2, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, - 1, 3, 2, 4, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 2, 2, 2, - 2, 3, 2, 0, 6, 1, 1, 1, 1, 1, - 5, 3, 5, 4, 4, 6, 6, 3, 1, 2, - 4, 4, 2, 4, 3 + 5, 2, 2, 2, 2, 3, 2, 0, 6, 1, + 1, 1, 3, 5, 3, 5, 5, 4, 6, 4, + 6, 6, 6, 3, 1, 2, 4, 4, 2, 4, + 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2839,937 +1248,876 @@ means the default is an error. */ static const yytype_uint16 yydefact[] = { - 125, 348, 138, 177, 277, 174, 175, 176, 0, 0, - 66, 0, 0, 131, 278, 129, 130, 0, 137, 0, - 136, 225, 181, 182, 310, 132, 0, 0, 0, 180, - 133, 135, 134, 0, 0, 179, 178, 0, 0, 0, - 260, 0, 0, 14, 184, 0, 0, 0, 0, 241, - 125, 0, 0, 2, 125, 5, 56, 12, 0, 38, - 71, 33, 34, 35, 36, 37, 40, 125, 39, 7, - 32, 0, 126, 127, 9, 8, 11, 275, 276, 0, - 183, 10, 269, 271, 273, 272, 41, 258, 270, 274, - 43, 31, 42, 0, 0, 76, 0, 0, 125, 94, - 111, 115, 113, 112, 114, 120, 117, 0, 0, 348, - 247, 224, 0, 309, 0, 122, 0, 123, 308, 105, - 241, 0, 0, 251, 0, 262, 263, 264, 265, 266, - 0, 0, 261, 330, 329, 312, 292, 291, 0, 256, - 0, 242, 243, 244, 254, 84, 0, 108, 252, 0, - 82, 46, 45, 125, 47, 30, 0, 48, 49, 50, - 52, 0, 51, 332, 1, 6, 125, 348, 0, 72, - 0, 0, 73, 55, 110, 0, 221, 0, 166, 0, - 165, 167, 352, 128, 197, 0, 198, 199, 0, 0, + 120, 344, 171, 271, 168, 169, 170, 0, 0, 62, + 0, 0, 126, 272, 124, 125, 0, 132, 0, 131, + 219, 175, 176, 304, 127, 0, 0, 0, 174, 128, + 130, 129, 0, 0, 173, 172, 0, 0, 0, 254, + 0, 0, 13, 178, 0, 0, 0, 0, 235, 120, + 0, 0, 2, 120, 5, 53, 12, 36, 67, 31, + 32, 33, 34, 35, 38, 120, 37, 7, 30, 0, + 121, 122, 9, 8, 11, 269, 270, 0, 177, 10, + 263, 265, 267, 266, 39, 252, 264, 268, 41, 29, + 40, 0, 72, 0, 0, 120, 90, 107, 109, 108, + 110, 115, 112, 0, 0, 241, 218, 0, 303, 0, + 117, 0, 118, 302, 101, 235, 0, 0, 245, 0, + 256, 257, 258, 259, 260, 0, 0, 255, 324, 323, + 306, 286, 285, 0, 250, 0, 236, 237, 238, 248, + 80, 0, 104, 246, 0, 78, 44, 43, 120, 45, + 28, 46, 47, 48, 50, 0, 49, 326, 1, 6, + 344, 0, 68, 0, 0, 69, 52, 106, 0, 215, + 0, 160, 0, 159, 161, 348, 123, 191, 0, 192, + 193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 322, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 328, 327, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 241, 0, 0, 58, 77, 0, 255, 0, 67, 0, - 125, 118, 0, 228, 0, 231, 230, 354, 239, 211, - 0, 0, 28, 0, 331, 0, 0, 280, 0, 0, - 0, 311, 279, 245, 246, 85, 238, 62, 63, 107, - 253, 61, 83, 44, 29, 125, 0, 238, 0, 0, - 54, 349, 220, 219, 0, 139, 141, 0, 189, 0, - 206, 0, 200, 204, 259, 306, 307, 304, 305, 285, - 286, 288, 287, 283, 284, 320, 319, 315, 314, 322, - 323, 324, 321, 317, 316, 318, 289, 290, 339, 0, - 338, 341, 298, 297, 296, 325, 0, 295, 294, 293, - 281, 282, 302, 301, 299, 303, 300, 0, 0, 111, - 115, 339, 333, 0, 0, 0, 347, 66, 0, 0, - 26, 57, 0, 125, 17, 23, 0, 20, 19, 22, - 21, 125, 116, 0, 241, 248, 172, 0, 0, 212, - 216, 109, 124, 229, 0, 27, 250, 353, 66, 267, - 0, 257, 0, 60, 0, 125, 13, 60, 0, 0, - 0, 0, 0, 143, 0, 0, 238, 168, 169, 0, - 0, 0, 185, 186, 191, 205, 0, 344, 0, 249, - 313, 0, 0, 0, 343, 0, 80, 0, 0, 0, - 121, 18, 125, 0, 0, 0, 0, 218, 213, 238, - 0, 0, 68, 0, 236, 235, 234, 237, 0, 65, - 64, 53, 0, 66, 350, 351, 211, 140, 0, 0, - 232, 142, 147, 60, 0, 190, 210, 209, 207, 208, - 0, 0, 0, 326, 0, 342, 0, 340, 81, 86, - 0, 0, 119, 240, 173, 172, 0, 0, 215, 0, - 0, 100, 104, 102, 106, 66, 70, 268, 59, 0, - 79, 0, 144, 145, 0, 125, 171, 170, 201, 193, - 184, 194, 0, 192, 0, 191, 346, 334, 345, 0, - 0, 0, 87, 90, 88, 25, 24, 217, 226, 214, - 98, 0, 101, 103, 69, 66, 238, 125, 233, 0, - 162, 0, 0, 125, 160, 0, 187, 184, 191, 195, - 0, 28, 95, 91, 89, 28, 28, 238, 78, 0, - 153, 157, 0, 0, 0, 125, 151, 155, 156, 163, - 221, 148, 161, 186, 0, 0, 196, 28, 93, 0, - 0, 0, 222, 125, 146, 152, 0, 0, 188, 186, - 92, 227, 99, 96, 28, 0, 0, 202, 0, 0, - 0, 154, 211, 203, 28, 223, 0, 0, 238, 97, - 164 + 0, 0, 0, 0, 235, 0, 0, 73, 0, 249, + 0, 63, 0, 120, 113, 0, 222, 0, 225, 224, + 350, 233, 205, 0, 0, 26, 0, 325, 0, 0, + 274, 0, 0, 0, 305, 273, 239, 240, 81, 232, + 58, 59, 103, 247, 57, 79, 42, 27, 232, 0, + 0, 51, 345, 214, 213, 0, 133, 135, 0, 183, + 0, 200, 0, 194, 198, 253, 300, 301, 298, 299, + 279, 280, 282, 281, 277, 278, 314, 313, 309, 308, + 316, 317, 318, 315, 311, 310, 312, 283, 284, 332, + 331, 0, 330, 0, 334, 292, 291, 290, 319, 0, + 289, 288, 287, 275, 276, 296, 295, 293, 297, 294, + 0, 0, 327, 0, 0, 0, 343, 62, 0, 0, + 24, 54, 0, 120, 16, 22, 19, 18, 21, 20, + 120, 111, 0, 235, 242, 166, 0, 0, 206, 210, + 105, 119, 223, 0, 25, 244, 349, 62, 261, 0, + 251, 0, 56, 0, 56, 0, 0, 0, 0, 0, + 137, 0, 0, 232, 162, 163, 0, 0, 0, 179, + 180, 185, 199, 0, 0, 339, 0, 0, 243, 307, + 0, 0, 0, 0, 337, 0, 76, 0, 0, 0, + 116, 17, 0, 0, 0, 0, 212, 207, 232, 0, + 0, 64, 0, 230, 229, 228, 231, 0, 61, 60, + 0, 62, 346, 347, 205, 134, 0, 0, 226, 136, + 141, 56, 0, 184, 204, 203, 201, 202, 0, 0, + 0, 0, 331, 335, 320, 0, 336, 0, 0, 333, + 77, 82, 0, 114, 234, 167, 166, 0, 0, 209, + 0, 0, 96, 100, 98, 102, 62, 66, 262, 55, + 0, 75, 0, 138, 139, 0, 120, 165, 164, 195, + 187, 178, 188, 0, 186, 0, 185, 342, 340, 328, + 341, 338, 0, 0, 0, 83, 86, 84, 23, 211, + 220, 208, 94, 0, 97, 99, 65, 62, 232, 120, + 227, 0, 156, 0, 0, 120, 154, 0, 181, 178, + 185, 189, 0, 26, 91, 87, 85, 26, 26, 232, + 74, 0, 147, 54, 151, 0, 0, 120, 145, 148, + 149, 157, 215, 142, 155, 180, 0, 0, 190, 26, + 89, 0, 0, 0, 216, 0, 140, 146, 0, 0, + 182, 180, 88, 221, 95, 92, 26, 0, 0, 196, + 0, 0, 0, 150, 205, 197, 26, 217, 0, 0, + 232, 93, 158 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 52, 53, 54, 55, 352, 353, 354, 374, 375, - 154, 155, 174, 355, 419, 156, 439, 157, 271, 268, - 97, 98, 486, 59, 170, 171, 60, 61, 62, 63, - 64, 158, 159, 511, 512, 513, 514, 65, 239, 481, - 589, 482, 546, 483, 484, 66, 252, 160, 67, 68, - 243, 244, 69, 361, 240, 70, 161, 72, 73, 393, - 395, 449, 357, 527, 358, 495, 554, 555, 556, 532, - 533, 534, 181, 359, 287, 397, 398, 427, 77, 78, - 79, 404, 460, 503, 564, 186, 399, 461, 504, 187, - 291, 80, 292, 293, 368, 369, 370, 284, 360, 584, - 112, 82, 545, 245, 246, 436, 451, 437, 383, 365, - 140, 141, 142, 248, 83, 84, 85, 162, 143, 235, - 236, 86, 130, 131, 132, 87, 411, 345, 321, 88, - 89, 182, 90, 91, 92 + -1, 51, 52, 53, 54, 342, 343, 344, 363, 364, + 149, 150, 167, 345, 409, 428, 151, 264, 261, 94, + 95, 477, 57, 163, 164, 58, 59, 60, 61, 62, + 152, 153, 504, 505, 506, 507, 63, 232, 472, 581, + 473, 538, 474, 475, 64, 245, 154, 65, 66, 312, + 237, 67, 350, 233, 68, 155, 70, 71, 380, 382, + 437, 346, 519, 347, 486, 546, 547, 548, 524, 525, + 526, 174, 348, 278, 384, 385, 416, 75, 76, 77, + 391, 448, 494, 556, 179, 386, 449, 495, 180, 282, + 78, 283, 284, 357, 358, 359, 275, 349, 576, 107, + 80, 537, 238, 239, 425, 439, 426, 372, 354, 135, + 136, 137, 241, 81, 82, 83, 156, 138, 228, 229, + 84, 125, 126, 127, 85, 400, 313, 314, 86, 87, + 175, 88, 89, 90 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -515 +#define YYPACT_NINF -484 static const yytype_int16 yypact[] = { - 1766, 12, -515, -515, -515, -515, -515, -515, -28, -6, - -515, 16, 94, -515, -515, -515, -515, 108, -515, 2220, - -515, 122, -515, -515, 2277, -515, 17, 363, 2220, -515, - -515, -515, -515, 24, 27, -515, -515, 112, 2220, 29, - 332, 2220, 2220, -515, -515, 2220, 2220, 2220, 2220, 2220, - 710, 158, 165, -515, 578, -515, -515, -515, 44, -515, - 2148, -515, -515, -515, -515, -515, -515, 2022, -515, -515, - -515, 288, 766, -515, -515, -515, -515, -515, -515, 11, - -515, -515, -515, -515, -515, -515, 118, 2972, -515, -515, - -515, -515, -515, 218, 101, -515, 2220, 221, 2022, -515, - -515, -515, -515, -515, -515, -515, -515, -83, 373, -515, - -50, -515, 111, -51, 2220, 110, 124, -515, -51, -515, - 2220, 253, 155, -51, 2220, -515, -515, -515, -515, -515, - 127, 159, 162, -51, -51, 702, -51, -51, -52, 2910, - 141, 168, 2220, -515, 2910, 268, 272, 2220, 2220, 272, - 273, -515, -515, 842, -515, -515, 149, -515, -515, -515, - -515, 266, -515, -515, -515, -515, 1106, 214, 282, -515, - 191, 225, 118, 202, -515, 302, 54, 304, -515, 305, - -515, -515, -515, -515, -515, 2220, -515, 20, 2220, 2220, - 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, - 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, - 2220, 2220, -515, -515, 130, 2220, 2220, 2220, 2220, 2220, - 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, 2220, - 2220, 2220, 128, -515, -515, 174, 209, 188, -515, 2220, - 1238, -515, 373, 184, 187, -515, -515, -515, 194, 21, - 186, 84, 1894, 193, -515, 2220, 198, -515, 2220, 332, - 2220, -515, -515, -515, -515, -515, 216, 236, -515, -515, - -515, 236, -515, -515, -515, 2022, 226, 216, 2220, 2220, - -515, 239, -515, -515, 345, 311, 314, 366, 2910, 278, - 280, -49, 20, -515, 2910, 408, 570, 570, 570, 3282, - 3282, 3282, 3282, 408, 408, 2910, 2910, 2910, 2910, 2910, - 2910, 2910, 2910, 2910, 2910, 2910, 365, 3034, -515, 146, - -515, -515, 424, 424, 424, 2910, 2476, 3096, 3158, 3220, - 408, 408, 702, 702, -51, -51, -51, 250, 2538, 295, - 306, 307, -515, 2220, 233, 312, -515, -515, 2220, 2336, - -515, 279, 259, 1370, -515, -515, 267, -515, -515, -515, - -515, 1238, -515, 373, 2220, -515, 126, 401, 274, 308, - -515, -515, -515, 283, 281, 1894, -515, 2910, -515, -515, - 310, 2910, 270, 313, 272, 974, -515, -30, 317, 284, - 104, 290, 373, 393, 373, 292, 216, 323, -515, 294, - 14, 15, -515, -515, -515, -515, 2220, -515, 2220, -515, - -515, 2220, 2600, 2220, -515, 354, -515, 296, 301, 2220, - -515, -515, 1238, 298, 309, 2220, 270, -515, -515, 216, - 22, 39, 364, 2220, -515, -515, -515, -515, 2220, -515, - -515, -515, 2220, -515, -515, -515, 21, -515, 373, 315, - -515, 334, -515, 313, 366, -515, -515, -515, -515, -515, - 333, 43, 2662, 2910, 2406, -515, 2724, -515, -515, 28, - 2786, 316, -515, -515, 2910, 342, 319, 401, -515, 321, - 327, -515, -515, 39, -515, -515, -515, -515, 2910, -41, - -515, 318, 334, -515, 373, 277, -515, -515, -515, -515, - 338, -515, 2220, -515, 353, -515, -515, -515, -515, 2220, - 350, 331, 28, -515, -515, -515, -515, -515, -515, -515, - -515, 463, -515, -515, -515, -515, 216, 1502, -515, 464, - -515, 442, 335, 326, -515, 11, 2910, 359, -515, 46, - 2848, 1894, -515, -515, -515, 1894, 1894, 216, -515, 358, - -515, -515, 360, 264, 336, 1634, -515, -515, -515, -515, - 54, -515, -515, -515, 344, 11, 46, 1894, -515, 362, - 369, 352, -515, 1502, -515, -515, 489, 381, -515, -515, - -515, -515, -515, -515, 1894, 374, 375, -515, 386, 379, - 376, -515, 21, -515, 1894, -515, 377, 380, 216, -515, - -515 + 1323, -484, -484, -484, -484, -484, -484, -13, -71, -484, + -53, 62, -484, -484, -484, -484, 73, -484, 1851, -484, + 110, -484, -484, 407, -484, 9, 229, 1851, -484, -484, + -484, -484, -22, 16, -484, -484, 115, 1851, 33, 390, + 1851, 1851, -484, -484, 1851, 1851, 1851, 1851, 1851, 549, + 159, 216, -484, 1452, -484, -484, -484, -484, 1798, -484, + -484, -484, -484, -484, -484, 1708, -484, -484, -484, 375, + 419, -484, -484, -484, -484, -484, -484, 10, -484, -484, + -484, -484, -484, -484, 117, 2620, -484, -484, -484, -484, + -484, 93, -484, 1851, 209, 1708, -484, -484, -484, -484, + -484, -484, -484, -65, 277, 147, -484, 100, -24, 1851, + 113, 119, -484, -24, -484, 1851, 225, 135, -24, 1851, + -484, -484, -484, -484, -484, 111, 148, 151, -24, -24, + 208, -24, -24, -50, 2557, 134, 160, 1851, -484, 2557, + 260, 261, 1851, 1851, 261, 263, -484, -484, 678, -484, + -484, -484, -484, -484, -484, 256, -484, -484, -484, -484, + 207, 275, -484, 180, 219, 117, 188, -484, 291, 39, + 292, -484, 293, -484, -484, -484, -484, -484, 1851, -484, + 13, 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, + 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, + 1851, 1851, 1851, 1851, 1851, 1851, -484, -484, 22, 1851, + 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, 1851, + 1851, 1851, 1851, 1851, 1851, 1851, 18, -484, 166, 202, + 182, -484, 1851, 807, -484, 277, 178, 181, -484, -484, + -484, 192, 15, 183, 44, 1580, 185, -484, 1851, 186, + -484, 1851, 390, 1851, -484, -484, -484, -484, -484, 211, + 226, -484, -484, -484, 226, -484, -484, -484, 211, 1851, + 1851, -484, 227, -484, -484, 326, 280, 285, 338, 2557, + 245, 246, 37, 13, -484, 2557, 928, 799, 799, 799, + 2998, 2998, 2998, 2998, 928, 928, 2557, 2557, 2557, 2557, + 2557, 2557, 2557, 2557, 2557, 2557, 2557, 2683, 2746, -484, + 258, 210, -484, 262, -484, 354, 354, 354, 2557, 2053, + 2809, 2872, 2935, 928, 928, 208, 208, -24, -24, -24, + 218, 2116, -484, 1851, 240, 265, -484, -484, 1851, 1911, + -484, 232, 221, 936, -484, -484, -484, -484, -484, -484, + 807, -484, 277, 1851, -484, 50, 359, 228, 270, -484, + -484, -484, 234, 230, 1580, -484, 2557, -484, -484, 267, + 2557, 101, 272, 261, -17, 273, 247, 143, 257, 277, + 366, 277, 264, 211, 284, -484, 254, 27, 31, -484, + -484, -484, -484, 1851, 305, -484, 244, 1851, -484, -484, + 1851, 2179, 1851, 312, -484, 244, -484, 271, 289, 1851, + -484, -484, 268, 283, 1851, 101, -484, -484, 211, 21, + 102, 343, 1851, -484, -484, -484, -484, 1851, -484, -484, + 1851, -484, -484, -484, 15, -484, 277, 294, -484, 311, + -484, 272, 338, -484, -484, -484, -484, -484, 314, 99, + 2242, 244, -484, -484, 2557, 1982, -484, 2305, 244, -484, + -484, 51, 2368, -484, -484, 2557, 319, 299, 359, -484, + 300, 307, -484, -484, 102, -484, -484, -484, -484, 2557, + -41, -484, 297, 311, -484, 277, 266, -484, -484, -484, + -484, 313, -484, 1851, -484, 329, -484, -484, -484, -484, + -484, -484, 1851, 331, 315, 51, -484, -484, -484, -484, + -484, -484, -484, 445, -484, -484, -484, -484, 211, 1065, + -484, 446, -484, 427, 318, 323, -484, 10, 2557, 339, + -484, 103, 2431, 1580, -484, -484, -484, 1580, 1580, 211, + -484, 332, -484, 232, -484, 106, 322, 1194, -484, -484, + -484, -484, 39, -484, -484, -484, 328, 10, 103, 1580, + -484, 341, 344, 337, -484, 1851, -484, -484, 451, 352, + -484, -484, -484, -484, -484, -484, 1580, 2494, 350, -484, + 369, 357, 347, -484, 15, -484, 1580, -484, 353, 351, + 211, -484, -484 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -515, -515, 343, -515, 457, -340, -515, 160, -514, -37, - 1, -58, 417, 60, -515, 2, 82, 461, 390, 161, - -241, -515, -515, -515, -515, -515, -515, -515, -515, -515, - -515, -515, -515, -515, -515, 31, 32, -515, -515, 63, - -515, 64, -515, -515, -515, -515, -515, -515, -515, -515, - 37, 59, -515, -515, -515, -515, 0, -515, 477, -515, - -515, -515, 65, -515, 68, -515, -22, -515, -3, -515, - -515, 30, -515, 3, -515, -515, 100, 85, -515, -515, - -515, -515, -464, -515, -515, -172, -515, -453, -515, -488, - -515, -423, -515, 269, -428, -515, -339, 5, 4, -515, - -515, -515, -515, -515, 535, -103, 116, 140, -269, -515, - -109, -515, -515, -515, -515, -515, -515, -515, -132, -55, - 519, -54, -515, 320, -515, -12, -515, -515, -215, -515, - -515, -515, -515, -515, -515 + -484, -484, -484, -484, 435, 140, -484, 149, -268, 444, + 3, -55, 399, 41, -48, 55, 439, 360, 127, -288, + -484, -484, -484, -484, -484, -484, -484, -484, -484, -484, + -484, -484, -484, -484, -3, -2, -484, -484, 30, -484, + 32, -484, -484, -484, -484, -484, -484, -484, -484, 6, + 59, -484, -484, -484, -484, 1, -484, 437, -484, -484, + -484, 43, -484, 45, -484, -484, -484, -42, -484, -484, + -16, -484, 2, -484, -484, 66, 46, -484, -484, -484, + -484, -479, -484, -484, -165, -484, -416, -484, -483, -484, + -387, -484, 231, -395, -484, -336, -39, 4, -484, -484, + -484, -484, -484, 484, -97, 75, 104, -260, -484, -104, + -484, -484, -484, -484, -484, -484, -484, -125, -61, 468, + -52, -484, 276, -484, -18, -484, -212, -184, -484, -484, + -484, -484, -484, -484 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -338 +#define YYTABLE_NINF -330 static const yytype_int16 yytable[] = { - 71, 56, 58, 76, 81, 247, 172, 110, 387, 173, - 264, 253, 113, 153, 184, 290, 118, 346, 491, 456, - 458, 423, 94, 289, 366, 366, 123, 568, 428, 133, - 134, 569, 570, 135, 136, 137, 139, 144, 505, -74, - 173, 212, 213, 214, 214, 241, 242, 563, 499, 106, - 260, 499, 539, 580, 71, 56, 58, 76, 81, 250, - 57, 188, 509, 402, 106, 74, 479, 403, 75, 256, - 590, 107, 480, 230, 438, 231, 231, 579, 232, 232, - 597, 538, 471, 261, 139, 566, 116, 100, 101, 282, - 510, 478, 269, 270, 525, 274, 95, 100, 101, 577, - 102, 103, 139, 93, 407, 283, 416, 444, 144, 445, - 102, 103, 139, 104, 57, 588, 367, 477, 96, 74, - 290, 337, 75, 104, 108, 111, 379, 453, 122, 414, - 144, 339, 340, 100, 101, 139, 139, 432, 519, 185, - 99, 114, 185, 185, 102, 103, 102, 103, 185, 100, - 101, 120, 119, 124, 500, 501, 121, 104, 501, 104, - 476, 163, 102, 103, 596, 164, 71, 56, 58, 76, - 81, 502, 166, 288, 502, 104, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 467, 372, 490, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 144, 338, - 188, 233, 105, 388, 389, 234, 57, 349, 457, 459, - 425, 74, 426, 237, 75, 249, 100, 101, 385, -111, - 71, 56, 356, 377, 524, 341, 144, 318, 381, 102, - 103, 320, 342, 251, 343, 424, 254, 549, 344, 255, - 319, 257, 104, 318, 259, 258, 139, 139, 262, 320, - 263, 265, 406, 100, 101, 266, 272, 275, 571, 362, - 175, 2, 175, -75, 548, 277, 102, 103, 373, 447, - 176, 450, 278, 417, 279, 13, 178, 15, 16, 104, - 18, 487, 20, 280, 175, 281, 434, 285, 286, 347, - 180, 260, 348, -117, 176, 25, 363, 274, 364, 177, - 178, 371, 382, 529, 30, 31, 32, 274, 376, 600, - 2, 412, 179, 378, 180, 125, 139, 126, 384, 144, - 127, 128, 129, 390, 13, 450, 15, 16, 391, 18, - 318, 20, 144, 71, 56, 356, 320, 100, 101, 413, - 386, 71, 56, 356, 25, 392, 115, 101, 394, 396, - 102, 103, 529, 30, 31, 32, 100, 101, 530, 102, - 103, 320, 400, 104, 401, 409, -335, 435, 489, 102, - 103, 528, 104, 420, 462, 422, 463, -337, -336, 464, - 373, 466, 104, 415, 366, 189, -241, 470, 448, 429, - 430, -158, -116, 474, 446, 431, 433, 438, 442, 443, - 452, 144, 71, 56, 356, 454, 488, 530, 455, 469, - 485, 468, 472, 190, 191, 192, 494, 193, 194, 195, - 196, 197, 198, 493, 473, 498, 425, 518, -338, 520, - 516, 521, 320, 526, 535, 211, 541, 212, 213, 214, - -159, 215, 216, 217, 537, 542, 547, 559, 560, 561, - 574, 318, 220, 221, 222, 565, 223, 224, 578, 225, - 226, 227, 228, 229, -338, -338, 572, 583, 573, 230, - 536, 231, 586, 587, 232, 531, 581, 540, 593, 592, - 212, 213, 214, 582, 215, 216, 217, 594, 591, 276, - 595, 165, 598, 421, 599, 238, 212, 213, 214, -338, - -338, 169, 225, 226, 227, 228, 229, 553, 551, 552, - 557, 558, 230, 531, 231, 496, 267, 232, 225, 226, - 227, 228, 229, 543, 544, 440, 522, 523, 230, 183, - 231, 585, 575, 232, 497, 553, 551, 552, 557, 558, - 517, 405, 117, 562, 492, 576, 475, 138, 0, 0, - 0, 0, 0, 553, 551, 552, 557, 558, -4, 380, - 0, 1, 2, 3, 4, 0, 5, 6, 7, 8, - 9, 10, 11, 0, 0, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 0, 0, 22, 23, 0, 0, - 189, 0, 0, 0, 24, 0, 25, 26, 0, 27, - 0, 28, 0, 29, 0, 30, 31, 32, 0, 0, - 33, 34, 0, 35, 36, 0, 0, 0, -338, -338, - -338, 37, 38, 39, 0, 0, 197, 198, 0, 40, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 212, 213, 214, 0, 215, 216, 217, 0, - 41, 42, 0, 0, 0, 0, 0, 0, 0, 43, - 0, 223, 224, 0, 225, 226, 227, 228, 229, 44, - 0, 0, 45, 0, 230, 0, 231, 46, 47, 232, - 0, 0, 48, 0, 49, 0, 50, 0, 51, 0, - 0, 0, -4, 1, 2, 3, 4, 0, 5, 6, - 7, 8, 9, 10, 11, 0, 0, 0, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 0, 22, 23, - 145, 0, 146, 0, 0, 0, 24, 147, 25, 26, - 0, 27, 148, 28, 0, 29, 149, 30, 31, 32, - 0, 0, 33, 34, 0, 35, 36, 0, 0, 0, - 2, 0, 0, 37, 38, 39, 0, 150, 0, 0, - 0, 40, 0, 0, 13, 0, 15, 16, 0, 18, - 0, 20, 0, 0, 212, 213, 214, 0, 0, 0, - 0, 0, 41, 42, 25, 0, 0, 0, 0, 0, - 0, 151, 0, 30, 31, 32, 0, 0, 227, 228, - 229, 44, 0, 0, 45, 0, 230, 0, 231, 46, - 47, 232, 0, 0, 48, 0, 49, 0, 50, 0, - 51, 0, 0, 0, 152, 1, 2, 3, 4, 0, - 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, - 22, 23, 145, 0, 146, 0, 0, 0, 24, 147, - 25, 26, 0, 27, 148, 28, 0, 29, 149, 30, - 31, 32, 0, 0, 33, 34, 0, 35, 36, 0, - 0, 0, 0, 0, 0, 37, 38, 39, 0, 150, - 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, + 105, 69, 74, 55, 79, 108, 165, 240, 374, 113, + 166, 246, 257, 177, 335, 281, 280, 102, 355, 118, + 417, 97, 128, 129, 355, 97, 130, 131, 132, 134, + 139, 444, 102, 98, 99, 446, 91, 98, 99, 482, + 166, 56, 336, 72, 555, 73, 100, 97, 243, 406, + 100, -70, 253, 93, 69, 74, 55, 79, 249, 98, + 99, 181, 496, 234, 235, 97, 205, 206, 207, 208, + 103, 96, 100, 273, 571, 134, 569, 98, 99, 421, + 531, 262, 263, 469, 502, 111, 254, 427, 104, 274, + 100, 134, 580, 267, 56, 517, 72, 139, 73, 394, + 224, 134, 225, 490, 97, 226, 114, 490, 530, 356, + 236, 92, 503, 106, 558, 468, 98, 99, 281, 139, + 330, 168, 403, 441, 134, 134, 368, 395, 470, 100, + 117, 169, 511, 109, 471, 310, 423, 171, 178, 310, + 115, 178, 332, 481, 333, 116, 432, 433, 334, 389, + 404, 173, 311, 390, 414, 178, 415, 119, 467, 178, + 279, 361, 157, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 516, 588, + 101, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 139, 331, 375, 376, + 491, 492, 453, 97, 339, 492, 158, 227, 424, 181, + 230, 459, 445, 447, 242, 98, 99, 493, 247, 540, + 366, 493, 110, 139, 69, 370, 55, 205, 100, 248, + 208, 351, -107, 97, 98, 99, 250, 97, 244, 413, + 362, 134, 134, 252, 251, 98, 99, 100, 541, 98, + 99, 255, 256, 258, 259, 560, 265, 498, 100, 561, + 562, 168, 100, 225, 501, -71, 226, 407, 268, 563, + 97, 269, 435, 12, 438, 14, 15, 270, 17, 271, + 19, 572, 98, 99, 272, 276, 277, 478, 205, 206, + 207, 208, 337, 24, 253, 100, 338, -112, 582, 267, + 352, 521, 29, 30, 31, 401, 353, 371, 589, 360, + 134, 365, 367, 139, 221, 222, 223, 310, 373, 378, + 592, 377, 224, 379, 225, 139, 393, 226, 381, 438, + 12, 383, 14, 15, 69, 17, 55, 19, -329, 387, + 388, 69, 396, 55, 398, 405, 410, 310, 362, -235, + 24, 452, 355, -111, 418, 420, 402, 522, 521, 29, + 30, 31, 419, 422, 430, 450, 427, 236, 480, 454, + 436, 434, 455, 431, 457, 236, 442, 236, 520, 443, + 168, 462, 440, 120, 121, 451, 465, 122, 123, 124, + 169, -152, 458, 463, 139, 170, 171, 460, 476, 479, + 1, 2, 3, 485, 4, 5, 6, 461, 172, 464, + 173, 236, 484, 414, 522, 13, 489, 510, 512, 527, + 18, 513, 20, 518, 21, 22, 12, 533, 14, 15, + 529, 17, 236, 19, 205, 206, 207, 208, 539, 551, + 534, 28, 552, 553, 578, 557, 24, 566, -153, 33, + 564, 34, 35, 570, 579, 29, 30, 31, 219, 220, + 221, 222, 223, 575, 584, 528, 573, 39, 224, 574, + 225, 585, 587, 226, 532, 586, 591, 523, 159, 590, + 412, 236, 411, 148, 231, 565, 487, 162, 40, 41, + 429, 260, 535, 536, 514, 567, 515, 176, 488, 554, + 112, 483, 509, 568, 392, 133, 0, 0, 0, 466, + 545, 549, 544, 550, 0, 139, 523, 0, 369, 0, + 0, 47, 0, 48, 0, 0, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 577, 545, 549, + 544, 550, 1, 2, 3, 0, 4, 5, 6, 7, + 8, 9, 10, 0, 0, 0, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 0, 21, 22, 140, 0, + 141, 0, 0, 0, 23, 142, 24, 25, 0, 26, + 143, 27, 0, 28, 144, 29, 30, 31, 0, 0, + 32, 33, 0, 34, 35, 0, 0, 0, 0, 0, + 0, 36, 37, 38, 0, 145, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 41, 42, 0, 0, 0, 0, - 0, 0, 0, 151, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 44, 0, 0, 45, 0, 0, 0, - 0, 46, 47, 0, 0, 0, 48, 0, 49, 0, - 50, 0, 51, 0, 0, 0, 273, 1, 2, 3, - 4, 0, 5, 6, 7, 8, 9, 10, 11, 0, - 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 0, 22, 23, 145, 0, 146, 0, 0, 0, - 24, 147, 25, 26, 0, 27, 148, 28, 0, 29, - 149, 30, 31, 32, 0, 0, 33, 34, 0, 35, - 36, 0, 0, 0, 0, 0, 0, 37, 38, 39, - 0, 150, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 42, 0, 0, - 0, 0, 0, 0, 0, 151, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 44, 0, 0, 45, 0, - 0, 0, 0, 46, 47, 0, 0, 0, 48, 0, - 49, 0, 50, 0, 51, 0, 0, 0, 441, 1, - 2, 3, 4, 0, 5, 6, 7, 8, 9, 10, - 11, 0, 0, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 0, 22, 23, 0, 0, 0, 0, - 0, 0, 24, 0, 25, 26, 0, 27, 0, 28, - 0, 29, 0, 30, 31, 32, 0, 0, 33, 34, - 0, 35, 36, 0, 0, 0, 0, 0, 0, 37, - 38, 39, 0, 0, 0, 0, 0, 40, 0, 0, + 40, 41, 0, 0, 0, 0, 0, 0, 0, 0, + 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 43, 0, 0, 44, 0, 0, 0, 0, 45, 46, + 0, 0, 0, 47, 0, 48, 0, 49, 0, 50, + 0, 1, 2, 3, 147, 4, 5, 6, 7, 8, + 9, 10, 0, 0, 0, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 0, 21, 22, 140, 0, 141, + 0, 0, 0, 23, 142, 24, 25, 0, 26, 143, + 27, 0, 28, 144, 29, 30, 31, 0, 0, 32, + 33, 0, 34, 35, 0, 0, 0, 0, 0, 0, + 36, 37, 38, 0, 145, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, - 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, - 45, 0, 0, 0, 0, 46, 47, 0, 0, 0, - 48, 0, 49, 0, 50, 0, 51, 0, 0, 0, - -3, 1, 2, 3, 4, 0, 5, 6, 7, 8, - 9, 10, 11, 0, 0, 0, 13, 14, 15, 16, - 17, 18, 19, 20, 0, 0, 22, 23, 0, 0, - 0, 0, 0, 0, 24, 0, 25, 26, 0, 27, - 0, 28, 0, 29, 0, 30, 31, 32, 0, 0, - 33, 34, 0, 35, 36, 0, 0, 0, 0, 0, - 0, 37, 38, 39, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 41, 0, 0, 0, 0, 0, 0, 0, 0, 146, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, + 0, 0, 44, 0, 0, 0, 0, 45, 46, 0, + 0, 0, 47, 0, 48, 0, 49, 0, 50, 0, + 1, 2, 3, 266, 4, 5, 6, 7, 8, 9, + 10, 0, 0, 0, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 0, 21, 22, 0, 0, 182, 0, + 0, 0, 23, 0, 24, 25, 0, 26, 0, 27, + 0, 28, 0, 29, 30, 31, 0, 0, 32, 33, + 0, 34, 35, 0, 0, 0, -330, -330, -330, 36, + 37, 38, 0, 0, 190, 191, 0, 39, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, + 206, 207, 208, 0, 209, 210, 211, 0, 40, 41, + 0, 0, 0, 0, 0, 0, 0, 0, 340, 0, + 217, 218, 0, 219, 220, 221, 222, 223, 43, 0, + 0, 44, 0, 224, 0, 225, 45, 46, 226, 0, + 0, 47, 0, 341, 0, 49, 0, 50, 0, 1, + 2, 3, -14, 4, 5, 6, 7, 8, 9, 10, + 0, 0, 0, 12, 13, 14, 15, 16, 17, 18, + 19, 0, 0, 21, 22, 0, 0, -330, 0, 0, + 0, 23, 0, 24, 25, 0, 26, 0, 27, 0, + 28, 0, 29, 30, 31, 0, 0, 32, 33, 0, + 34, 35, 0, 0, 0, 0, 0, 0, 36, 37, + 38, 0, 0, -330, -330, 0, 39, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 205, 206, + 207, 208, 0, 209, 210, 211, 0, 40, 41, 0, + 0, 0, 0, 0, 0, 0, 0, 340, 0, -330, + -330, 0, 219, 220, 221, 222, 223, 43, 0, 0, + 44, 0, 224, 0, 225, 45, 46, 226, 0, 0, + 47, 0, 341, 0, 49, 0, 50, 0, 1, 2, + 3, -15, 4, 5, 6, 7, 8, 9, 10, 0, + 0, 0, 12, 13, 14, 15, 16, 17, 18, 19, + 0, 0, 21, 22, 0, 0, 0, 0, 0, 0, + 23, 0, 24, 25, 0, 26, 0, 27, 0, 28, + 0, 29, 30, 31, 0, 0, 32, 33, 0, 34, + 35, 0, 0, 0, 0, 0, 0, 36, 37, 38, + 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 542, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 43, 0, 0, 44, + 0, 0, 0, 0, 45, 46, 0, 0, 0, 47, + 0, 543, 0, 49, 0, 50, 0, 1, 2, 3, + -143, 4, 5, 6, 7, 8, 9, 10, 0, 0, + 0, 12, 13, 14, 15, 16, 17, 18, 19, 0, + 0, 21, 22, 0, 0, 0, 0, 0, 0, 23, + 0, 24, 25, 0, 26, 0, 27, 0, 28, 0, + 29, 30, 31, 0, 0, 32, 33, 0, 34, 35, + 0, 0, 0, 0, 0, 0, 36, 37, 38, 0, + 0, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 41, 42, 0, 0, 0, 0, 0, 0, 0, 350, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, - 0, 0, 45, 0, 0, 0, 0, 46, 47, 0, - 0, 0, 48, 0, 351, 0, 50, 0, 51, 0, - 0, 0, -15, 1, 2, 3, 4, 0, 5, 6, - 7, 8, 9, 10, 11, 0, 0, 0, 13, 14, - 15, 16, 17, 18, 19, 20, 0, 0, 22, 23, - 0, 0, 0, 0, 0, 0, 24, 0, 25, 26, - 0, 27, 0, 28, 0, 29, 0, 30, 31, 32, - 0, 0, 33, 34, 0, 35, 36, 0, 0, 0, - 0, 0, 0, 37, 38, 39, 0, 0, 0, 0, - 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 40, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 542, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 43, 0, 0, 44, 0, + 0, 0, 0, 45, 46, 0, 0, 0, 47, 0, + 543, 0, 49, -3, 50, 0, 1, 2, 3, -144, + 4, 5, 6, 7, 8, 9, 10, 0, 0, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, + 21, 22, 0, 0, 0, 0, 0, 0, 23, 0, + 24, 25, 0, 26, 0, 27, 0, 28, 0, 29, + 30, 31, 0, 0, 32, 33, 0, 34, 35, 0, + 0, 0, 0, 0, 0, 36, 37, 38, 0, 0, + 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 41, 42, 0, 0, 0, 0, 0, 0, - 0, 350, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 44, 0, 0, 45, 0, 0, 0, 0, 46, - 47, 0, 0, 0, 48, 0, 351, 0, 50, 0, - 51, 0, 0, 0, -16, 1, 2, 3, 4, 0, - 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, - 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, - 22, 23, 0, 0, 0, 0, 0, 0, 24, 0, - 25, 26, 0, 27, 0, 28, 0, 29, 0, 30, - 31, 32, 0, 0, 33, 34, 0, 35, 36, 0, - 0, 0, 0, 0, 0, 37, 38, 39, 0, 0, - 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 43, 0, 0, 44, 0, 0, + 0, 0, 45, 46, 0, 0, 0, 47, 0, 48, + 0, 49, -4, 50, 0, 1, 2, 3, 0, 4, + 5, 6, 7, 8, 9, 10, 0, 0, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 0, 0, 21, + 22, 0, 0, 0, 0, 0, 0, 23, 0, 24, + 25, 0, 26, 0, 27, 0, 28, 0, 29, 30, + 31, 0, 0, 32, 33, 0, 34, 35, 0, 0, + 0, 0, 0, 0, 36, 37, 38, 0, 0, 0, + 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 41, 42, 0, 0, 0, 0, - 0, 0, 0, 550, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 44, 0, 0, 45, 0, 0, 0, - 0, 46, 47, 0, 0, 0, 48, 0, 49, 0, - 50, 0, 51, 0, 0, 0, -149, 1, 2, 3, - 4, 0, 5, 6, 7, 8, 9, 10, 11, 0, - 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, - 0, 0, 22, 23, 0, 0, 0, 0, 0, 0, - 24, 0, 25, 26, 0, 27, 0, 28, 0, 29, - 0, 30, 31, 32, 0, 0, 33, 34, 0, 35, - 36, 0, 0, 0, 0, 0, 0, 37, 38, 39, - 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, + 0, 0, 0, 40, 41, 0, 0, 0, 0, 0, + 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 43, 0, 0, 44, 0, 0, 0, + 0, 45, 46, 0, 0, 0, 47, 0, 48, 0, + 49, 0, 50, 1, 2, 3, 0, 4, 5, 6, + 7, 8, 9, 10, 0, -120, 0, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 0, 21, 22, 140, + 0, 141, 0, 0, 0, 23, 142, 24, 25, 0, + 26, 143, 27, 0, 28, 144, 29, 30, 31, 0, + 0, 32, 33, 0, 34, 35, 0, 0, 0, 0, + 0, 0, 36, 37, 38, 0, 145, 0, 0, 0, + 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 42, 0, 0, - 0, 0, 0, 0, 0, 550, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 44, 0, 0, 45, 0, - 0, 0, 0, 46, 47, 0, 0, 0, 48, 0, - 49, 0, 50, 0, 51, 0, -3, 0, -150, 1, - 2, 3, 4, 0, 5, 6, 7, 8, 9, 10, - 11, 0, 0, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 0, 22, 23, 0, 0, 0, 0, - 0, 0, 24, 0, 25, 26, 0, 27, 0, 28, - 0, 29, 0, 30, 31, 32, 0, 0, 33, 34, - 0, 35, 36, 0, 0, 0, 0, 0, 0, 37, - 38, 39, 0, 0, 0, 0, 0, 40, 0, 0, + 0, 40, 41, 0, 0, 0, 0, 0, 0, 0, + 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 43, 0, 0, 44, 0, 0, 0, 0, 45, + 46, 0, 0, 0, 47, 0, 48, 0, 49, 0, + 50, 1, 2, 3, 0, 4, 5, 6, 7, 8, + 9, 10, 0, 0, 0, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 0, 21, 22, 140, 0, 141, + 0, 0, 0, 23, 142, 24, 25, 0, 26, 143, + 27, 0, 28, 144, 29, 30, 31, 0, 0, 32, + 33, 0, 34, 35, 0, 0, 0, 0, 0, 0, + 36, 37, 38, 0, 145, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, - 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, - 45, 0, 0, 0, 0, 46, 47, 0, 0, 0, - 48, 0, 49, 0, 50, 0, 51, 1, 2, 3, - 4, 0, 5, 6, 7, 8, 9, 10, 11, 0, - -125, 0, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 0, 22, 23, 145, 0, 146, 0, 0, 0, - 24, 147, 25, 26, 0, 27, 148, 28, 0, 29, - 149, 30, 31, 32, 0, 0, 33, 34, 0, 35, - 36, 0, 0, 0, 0, 0, 0, 37, 38, 39, - 0, 150, 0, 0, 0, 40, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 41, 160, 2, 3, 0, 4, 5, 6, 0, 146, + 0, 0, 0, 0, 0, 0, 13, 0, 0, 43, + 0, 18, 44, 20, 0, 21, 22, 45, 46, 141, + 0, 0, 47, 23, 48, 0, 49, 0, 50, 0, + 27, 0, 28, 161, 0, 0, 0, 0, 0, 0, + 33, 0, 34, 35, 1, 2, 3, 0, 4, 5, + 6, 37, 0, 0, 0, 0, 0, 0, 39, 13, + 0, 0, 0, 0, 18, 0, 20, 0, 21, 22, + 0, 0, 0, 0, 0, 0, 23, 0, 0, 40, + 41, 0, 0, 27, 0, 28, 0, 0, 0, 0, + 0, 0, 0, 33, 0, 34, 35, 0, 0, 43, + 0, 0, 44, 0, 37, 0, 0, 45, 46, 0, + 0, 39, 47, 0, 48, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 41, 42, 0, 0, - 0, 0, 0, 0, 0, 151, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 44, 0, 0, 45, 0, - 0, 0, 0, 46, 47, 0, 0, 0, 48, 0, - 49, 0, 50, 0, 51, 1, 2, 3, 4, 0, - 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, - 22, 23, 145, 0, 146, 0, 0, 0, 24, 147, - 25, 26, 0, 27, 148, 28, 0, 29, 149, 30, - 31, 32, 0, 0, 33, 34, 0, 35, 36, 0, - 0, 0, 0, 0, 0, 37, 38, 39, 0, 150, - 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 41, 42, 0, 0, 0, 0, - 0, 0, 0, 151, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 44, 0, 0, 45, 0, 0, 0, - 0, 46, 47, 0, 0, 0, 48, 0, 49, 0, - 50, 167, 51, 3, 4, 0, 5, 6, 7, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, - 0, 0, 19, 0, 21, 0, 22, 23, 0, 0, - 146, 0, 0, 0, 24, 0, 0, 0, 0, 0, - 0, 28, 0, 29, 168, 0, 0, 0, 0, 0, - 0, 34, 0, 35, 36, 0, 0, 0, 0, 0, - 0, 0, 38, 0, 0, 0, 0, 0, 0, 40, - 0, 0, 0, 109, 0, 3, 4, 0, 5, 6, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 41, 42, 0, 0, 19, 0, 21, 0, 22, 23, - 0, 0, 0, 0, 0, 0, 24, 0, 0, 44, - 0, 0, 45, 28, 0, 29, 0, 46, 47, 0, - 0, 0, 48, 34, 49, 35, 36, 0, 51, 0, - 109, 0, 3, 4, 38, 5, 6, 7, 0, 0, - 0, 40, 0, 0, 0, 0, 14, 0, 0, 0, - 0, 19, 0, 21, 0, 22, 23, 0, 0, 0, - 0, 0, 41, 42, 0, 0, 0, 0, 0, 0, - 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 34, 44, 35, 36, 45, 0, 0, 0, 0, 46, - 47, 0, 0, 0, 48, 0, 49, 0, 40, 0, - 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, - 42, 0, 0, 0, 0, 0, 189, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 48, 0, 49, 190, 191, 192, 51, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 0, 212, 213, - 214, 0, 215, 216, 217, 0, 0, 0, 0, 0, - 218, 219, 0, 220, 221, 222, 189, 223, 224, 0, - 225, 226, 227, 228, 229, 0, 0, 0, 0, 0, - 230, 0, 231, 0, 0, 232, 0, 0, 0, 0, - 0, 418, 0, 0, 190, 191, 192, 0, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 0, 212, 213, - 214, 0, 215, 216, 217, 0, 0, 0, 0, 0, - 218, 219, 0, 220, 221, 222, 189, 223, 224, 0, - 225, 226, 227, 228, 229, 0, 0, 0, 0, 0, - 230, 0, 231, 0, 0, 232, 0, 0, 0, 0, - 0, 507, 0, 0, 190, 191, 192, 0, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 0, 212, 213, - 214, 0, 215, 216, 217, 0, 0, 0, 189, 0, - 218, 219, 408, 220, 221, 222, 0, 223, 224, 0, - 225, 226, 227, 228, 229, 0, 0, 0, 0, 0, - 230, 0, 231, 0, 0, 232, 190, 191, 192, 0, + 0, 0, 40, 41, 0, 0, 0, 0, 0, 0, + 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 43, 0, 0, 44, 0, 0, 0, 0, + 45, 46, 0, 0, 0, 47, 0, 48, 183, 184, + 185, 50, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 0, 209, 210, 211, 0, + 0, 0, 0, 0, 0, 212, 213, 0, 214, 215, + 216, 182, 217, 218, 0, 219, 220, 221, 222, 223, + 0, 0, 0, 0, 0, 224, 0, 225, 0, 0, + 226, 0, 0, 0, 0, 0, 0, 408, 0, 183, + 184, 185, 0, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 0, - 212, 213, 214, 0, 215, 216, 217, 0, 0, 0, - 189, 0, 218, 219, 0, 220, 221, 222, 0, 223, - 224, 0, 225, 226, 227, 228, 229, 0, 0, 0, - 0, 0, 230, 0, 231, 410, 0, 232, 190, 191, - 192, 0, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 0, 212, 213, 214, 0, 215, 216, 217, 0, - 0, 0, 189, 0, 218, 219, 0, 220, 221, 222, - 0, 223, 224, 0, 225, 226, 227, 228, 229, 0, - 0, 0, 0, 0, 230, 0, 231, 465, 0, 232, - 190, 191, 192, 0, 193, 194, 195, 196, 197, 198, + 203, 204, 205, 206, 207, 208, 0, 209, 210, 211, + 0, 0, 0, 0, 0, 0, 212, 213, 0, 214, + 215, 216, 182, 217, 218, 0, 219, 220, 221, 222, + 223, 0, 0, 0, 0, 0, 224, 0, 225, 0, + 0, 226, 0, 0, 0, 0, 0, 0, 499, 0, + 183, 184, 185, 0, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 0, 209, 210, + 211, 0, 0, 0, 0, 182, 0, 212, 213, 397, + 214, 215, 216, 0, 217, 218, 0, 219, 220, 221, + 222, 223, 0, 0, 0, 0, 0, 224, 0, 225, + 0, 0, 226, 183, 184, 185, 0, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 0, 212, 213, 214, 0, 215, 216, - 217, 0, 0, 0, 189, 0, 218, 219, 0, 220, - 221, 222, 0, 223, 224, 0, 225, 226, 227, 228, - 229, 0, 0, 0, 0, 0, 230, 0, 231, 506, - 0, 232, 190, 191, 192, 0, 193, 194, 195, 196, + 0, 209, 210, 211, 0, 0, 0, 0, 182, 0, + 212, 213, 0, 214, 215, 216, 0, 217, 218, 0, + 219, 220, 221, 222, 223, 0, 0, 0, 0, 0, + 224, 0, 225, 399, 0, 226, 183, 184, 185, 0, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 0, 209, 210, 211, 0, 0, 0, + 0, 182, 0, 212, 213, 0, 214, 215, 216, 0, + 217, 218, 0, 219, 220, 221, 222, 223, 0, 0, + 0, 0, 0, 224, 0, 225, 456, 0, 226, 183, + 184, 185, 0, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 0, 209, 210, 211, + 0, 0, 0, 0, 182, 0, 212, 213, 0, 214, + 215, 216, 0, 217, 218, 0, 219, 220, 221, 222, + 223, 0, 0, 0, 0, 0, 224, 0, 225, 497, + 0, 226, 183, 184, 185, 0, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 0, + 209, 210, 211, 0, 0, 0, 0, 182, 0, 212, + 213, 0, 214, 215, 216, 0, 217, 218, 0, 219, + 220, 221, 222, 223, 0, 0, 0, 0, 0, 224, + 0, 225, 500, 0, 226, 183, 184, 185, 0, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 0, 212, 213, 214, 0, - 215, 216, 217, 0, 0, 0, 189, 0, 218, 219, - 0, 220, 221, 222, 0, 223, 224, 0, 225, 226, - 227, 228, 229, 0, 0, 0, 0, 0, 230, 0, - 231, 508, 0, 232, 190, 191, 192, 0, 193, 194, + 207, 208, 0, 209, 210, 211, 0, 0, 0, 0, + 182, 0, 212, 213, 0, 214, 215, 216, 0, 217, + 218, 0, 219, 220, 221, 222, 223, 0, 0, 0, + 0, 0, 224, 0, 225, 508, 0, 226, 183, 184, + 185, 0, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 0, 209, 210, 211, 0, + 0, 0, 0, 182, 0, 212, 213, 559, 214, 215, + 216, 0, 217, 218, 0, 219, 220, 221, 222, 223, + 0, 0, 0, 0, 0, 224, 0, 225, 0, 0, + 226, 183, 184, 185, 0, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 0, 209, + 210, 211, 0, 0, 0, 0, 182, 0, 212, 213, + 0, 214, 215, 216, 0, 217, 218, 0, 219, 220, + 221, 222, 223, 0, 0, 0, 0, 0, 224, 0, + 225, 583, 0, 226, 183, 184, 185, 0, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 0, 209, 210, 211, 0, 0, 0, 0, 182, + 0, 212, 213, 0, 214, 215, 216, 0, 217, 218, + 0, 219, 220, 221, 222, 223, 0, 0, 0, 0, + 0, 224, 0, 225, 0, 0, 226, 183, 184, 185, + 0, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 0, 212, 213, - 214, 0, 215, 216, 217, 0, 0, 0, 189, 0, - 218, 219, 0, 220, 221, 222, 0, 223, 224, 0, - 225, 226, 227, 228, 229, 0, 0, 0, 0, 0, - 230, 0, 231, 515, 0, 232, 190, 191, 192, 0, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 0, - 212, 213, 214, 0, 215, 216, 217, 0, 0, 0, - 189, 0, 218, 219, 567, 220, 221, 222, 0, 223, - 224, 0, 225, 226, 227, 228, 229, 0, 0, 0, - 0, 0, 230, 0, 231, 0, 0, 232, 190, 191, - 192, 0, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 0, 212, 213, 214, 0, 215, 216, 217, 0, - 0, 0, 189, 0, 218, 219, 0, 220, 221, 222, - 0, 223, 224, 0, 225, 226, 227, 228, 229, 0, - 0, 0, 0, 0, 230, 0, 231, 0, 0, 232, - 190, 191, 192, 0, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 0, 212, 213, 214, 0, 215, 216, - 217, 0, 0, 0, 189, 0, 218, 219, 0, 220, - 221, 222, 0, 0, 224, 0, 225, 226, 227, 228, - 229, 0, 0, 0, 0, 0, 230, 0, 231, 0, - 0, 232, 190, 191, 192, 0, 193, 194, 195, 196, - 197, 198, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, - 215, 216, 217, 0, 0, 0, 189, 0, 0, 0, - 0, 220, 221, 222, 0, 223, 224, 0, 225, 226, - 227, 228, 229, 0, 0, 0, 0, 0, 230, 0, - 231, 0, 0, 232, 190, 191, 192, 0, 193, 194, - 195, 196, 197, 198, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 212, 213, - 214, 0, 215, 216, 217, 0, 0, 0, 189, 0, - 0, 0, 0, 0, 221, 222, 0, 223, 224, 0, - 225, 226, 227, 228, 229, 0, 0, 0, 0, 0, - 230, 0, 231, 0, 0, 232, 190, 191, 192, 0, - 193, 194, 195, 196, 197, 198, 0, 0, 0, 0, + 205, 206, 207, 208, 0, 209, 210, 211, 0, 0, + 0, 0, 182, 0, 212, 213, 0, 214, 215, 216, + 0, 0, 218, 0, 219, 220, 221, 222, 223, 0, + 0, 0, 0, 0, 224, 0, 225, 0, 0, 226, + 183, 184, 185, 0, 186, 187, 188, 189, 190, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 212, 213, 214, 0, 215, 216, 217, 0, 0, 0, - 189, 0, 0, 0, 0, 0, 0, 222, 0, 223, - 224, 0, 225, 226, 227, 228, 229, 0, 0, 0, - 0, 0, 230, 0, 231, 0, 0, 232, 190, 191, - 192, 0, 193, 194, 195, 196, 197, 198, 0, 0, + 0, 0, 204, 205, 206, 207, 208, 0, 209, 210, + 211, 0, 0, 0, 0, 182, 0, 0, 0, 0, + 214, 215, 216, 0, 217, 218, 0, 219, 220, 221, + 222, 223, 0, 0, 0, 0, 0, 224, 0, 225, + 0, 0, 226, 183, 184, 185, 0, 186, 187, 188, + 189, 190, 191, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 205, 206, 207, 208, + 0, 209, 210, 211, 0, 0, 0, 0, 182, 0, + 0, 0, 0, 214, 215, 216, 0, 217, 218, 0, + 219, 220, 221, 222, 223, 0, 0, 0, 0, 0, + 224, 0, 225, 0, 0, 226, 183, 184, 185, 0, + 186, 187, 188, 189, 190, 191, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 205, + 206, 207, 208, 0, 209, 210, 211, 0, 0, 0, + 0, 182, 0, 0, 0, 0, 0, 215, 216, 0, + 217, 218, 0, 219, 220, 221, 222, 223, 0, 0, + 0, 0, 0, 224, 0, 225, 0, 0, 226, 183, + 184, 185, 0, 186, 187, 188, 189, 190, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 212, 213, 214, 0, 215, 216, 217, 0, - 0, 0, 189, 0, 0, 0, 0, 0, 0, -338, - 0, 223, 224, 0, 225, 226, 227, 228, 229, 0, - 0, 0, 0, 0, 230, 0, 231, 0, 0, 232, - 190, 191, 192, 0, -338, -338, -338, -338, 197, 198, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 212, 213, 214, 0, 215, 216, - 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 223, 224, 0, 225, 226, 227, 228, - 229, 0, 0, 0, 0, 0, 230, 0, 231, 0, - 0, 232 + 0, 0, 205, 206, 207, 208, 0, 209, 210, 211, + 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, + 0, 216, 0, 217, 218, 0, 219, 220, 221, 222, + 223, 0, 0, 0, 0, 0, 224, 0, 225, 0, + 0, 226, 183, 184, 185, 0, 186, 187, 188, 189, + 190, 191, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 205, 206, 207, 208, 0, + 209, 210, 211, 0, 0, 0, 0, 182, 0, 0, + 0, 0, 0, 0, -330, 0, 217, 218, 0, 219, + 220, 221, 222, 223, 0, 0, 0, 0, 0, 224, + 0, 225, 0, 0, 226, 183, 184, 185, 0, -330, + -330, -330, -330, 190, 191, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 205, 206, + 207, 208, 0, 209, 210, 211, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 217, + 218, 0, 219, 220, 221, 222, 223, 0, 0, 0, + 0, 0, 224, 0, 225, 0, 0, 226 }; static const yytype_int16 yycheck[] = { - 0, 0, 0, 0, 0, 108, 60, 19, 277, 67, - 142, 120, 24, 50, 3, 187, 28, 232, 446, 5, - 5, 361, 50, 3, 3, 3, 38, 541, 367, 41, - 42, 545, 546, 45, 46, 47, 48, 49, 461, 69, - 98, 92, 93, 94, 94, 128, 129, 535, 5, 12, - 102, 5, 505, 567, 54, 54, 54, 54, 54, 114, - 0, 102, 34, 112, 27, 0, 27, 116, 0, 124, - 584, 12, 33, 124, 104, 126, 126, 565, 129, 129, - 594, 504, 422, 135, 96, 538, 27, 3, 4, 35, - 62, 430, 147, 148, 135, 153, 124, 3, 4, 563, - 16, 17, 114, 91, 319, 51, 347, 3, 120, 5, - 16, 17, 124, 29, 54, 579, 95, 95, 124, 54, - 292, 230, 54, 29, 16, 3, 258, 396, 16, 344, - 142, 3, 4, 3, 4, 147, 148, 378, 477, 128, - 124, 124, 128, 128, 16, 17, 16, 17, 128, 3, - 4, 124, 128, 124, 111, 112, 129, 29, 112, 29, - 429, 3, 16, 17, 592, 0, 166, 166, 166, 166, - 166, 128, 128, 185, 128, 29, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 415, 117, 443, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 102, 3, 128, 278, 279, 124, 166, 239, 400, 401, - 104, 166, 106, 12, 166, 124, 3, 4, 275, 129, - 240, 240, 240, 255, 485, 117, 258, 117, 260, 16, - 17, 214, 124, 129, 126, 364, 3, 526, 130, 104, - 130, 134, 29, 117, 102, 106, 278, 279, 127, 232, - 102, 3, 126, 3, 4, 3, 3, 128, 547, 242, - 16, 4, 16, 69, 525, 3, 16, 17, 251, 392, - 26, 394, 101, 348, 69, 18, 32, 20, 21, 29, - 23, 433, 25, 101, 16, 3, 36, 3, 3, 135, - 46, 102, 124, 129, 26, 38, 129, 375, 124, 31, - 32, 135, 106, 46, 47, 48, 49, 385, 135, 598, - 4, 343, 44, 135, 46, 3, 348, 5, 102, 351, - 8, 9, 10, 104, 18, 448, 20, 21, 3, 23, - 117, 25, 364, 353, 353, 353, 319, 3, 4, 126, - 134, 361, 361, 361, 38, 54, 3, 4, 54, 3, - 16, 17, 46, 47, 48, 49, 3, 4, 101, 16, - 17, 344, 104, 29, 104, 135, 91, 117, 442, 16, - 17, 494, 29, 134, 406, 128, 408, 91, 91, 411, - 363, 413, 29, 91, 3, 40, 127, 419, 15, 135, - 102, 134, 129, 425, 124, 134, 106, 104, 101, 135, - 128, 433, 422, 422, 422, 102, 438, 101, 134, 128, - 66, 135, 134, 68, 69, 70, 102, 72, 73, 74, - 75, 76, 77, 128, 135, 112, 104, 128, 40, 128, - 134, 124, 415, 135, 116, 90, 106, 92, 93, 94, - 134, 96, 97, 98, 111, 134, 3, 3, 26, 134, - 134, 117, 107, 108, 109, 116, 111, 112, 134, 114, - 115, 116, 117, 118, 76, 77, 128, 135, 128, 124, - 502, 126, 3, 112, 129, 495, 134, 509, 112, 124, - 92, 93, 94, 134, 96, 97, 98, 128, 134, 166, - 134, 54, 135, 353, 134, 98, 92, 93, 94, 111, - 112, 60, 114, 115, 116, 117, 118, 527, 527, 527, - 527, 527, 124, 533, 126, 453, 146, 129, 114, 115, - 116, 117, 118, 512, 512, 384, 483, 483, 124, 72, - 126, 573, 555, 129, 454, 555, 555, 555, 555, 555, - 475, 292, 27, 533, 448, 560, 426, 48, -1, -1, - -1, -1, -1, 573, 573, 573, 573, 573, 0, 259, - -1, 3, 4, 5, 6, -1, 8, 9, 10, 11, - 12, 13, 14, -1, -1, 17, 18, 19, 20, 21, - 22, 23, 24, 25, -1, -1, 28, 29, -1, -1, - 40, -1, -1, -1, 36, -1, 38, 39, -1, 41, - -1, 43, -1, 45, -1, 47, 48, 49, -1, -1, - 52, 53, -1, 55, 56, -1, -1, -1, 68, 69, - 70, 63, 64, 65, -1, -1, 76, 77, -1, 71, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 92, 93, 94, -1, 96, 97, 98, -1, - 92, 93, -1, -1, -1, -1, -1, -1, -1, 101, - -1, 111, 112, -1, 114, 115, 116, 117, 118, 111, - -1, -1, 114, -1, 124, -1, 126, 119, 120, 129, - -1, -1, 124, -1, 126, -1, 128, -1, 130, -1, - -1, -1, 134, 3, 4, 5, 6, -1, 8, 9, - 10, 11, 12, 13, 14, -1, -1, -1, 18, 19, - 20, 21, 22, 23, 24, 25, 26, -1, 28, 29, - 30, -1, 32, -1, -1, -1, 36, 37, 38, 39, - -1, 41, 42, 43, -1, 45, 46, 47, 48, 49, - -1, -1, 52, 53, -1, 55, 56, -1, -1, -1, - 4, -1, -1, 63, 64, 65, -1, 67, -1, -1, - -1, 71, -1, -1, 18, -1, 20, 21, -1, 23, - -1, 25, -1, -1, 92, 93, 94, -1, -1, -1, - -1, -1, 92, 93, 38, -1, -1, -1, -1, -1, - -1, 101, -1, 47, 48, 49, -1, -1, 116, 117, - 118, 111, -1, -1, 114, -1, 124, -1, 126, 119, - 120, 129, -1, -1, 124, -1, 126, -1, 128, -1, - 130, -1, -1, -1, 134, 3, 4, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, - 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, - 28, 29, 30, -1, 32, -1, -1, -1, 36, 37, - 38, 39, -1, 41, 42, 43, -1, 45, 46, 47, - 48, 49, -1, -1, 52, 53, -1, 55, 56, -1, - -1, -1, -1, -1, -1, 63, 64, 65, -1, 67, - -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, 93, -1, -1, -1, -1, - -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 111, -1, -1, 114, -1, -1, -1, - -1, 119, 120, -1, -1, -1, 124, -1, 126, -1, - 128, -1, 130, -1, -1, -1, 134, 3, 4, 5, - 6, -1, 8, 9, 10, 11, 12, 13, 14, -1, - -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, - 26, -1, 28, 29, 30, -1, 32, -1, -1, -1, - 36, 37, 38, 39, -1, 41, 42, 43, -1, 45, - 46, 47, 48, 49, -1, -1, 52, 53, -1, 55, - 56, -1, -1, -1, -1, -1, -1, 63, 64, 65, - -1, 67, -1, -1, -1, 71, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 92, 93, -1, -1, - -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 111, -1, -1, 114, -1, - -1, -1, -1, 119, 120, -1, -1, -1, 124, -1, - 126, -1, 128, -1, 130, -1, -1, -1, 134, 3, - 4, 5, 6, -1, 8, 9, 10, 11, 12, 13, - 14, -1, -1, 17, 18, 19, 20, 21, 22, 23, - 24, 25, -1, -1, 28, 29, -1, -1, -1, -1, - -1, -1, 36, -1, 38, 39, -1, 41, -1, 43, - -1, 45, -1, 47, 48, 49, -1, -1, 52, 53, - -1, 55, 56, -1, -1, -1, -1, -1, -1, 63, - 64, 65, -1, -1, -1, -1, -1, 71, -1, -1, + 18, 0, 0, 0, 0, 23, 58, 104, 268, 27, + 65, 115, 137, 3, 226, 180, 3, 11, 3, 37, + 356, 3, 40, 41, 3, 3, 44, 45, 46, 47, + 48, 4, 26, 15, 16, 4, 49, 15, 16, 434, + 95, 0, 226, 0, 527, 0, 28, 3, 109, 337, + 28, 68, 102, 124, 53, 53, 53, 53, 119, 15, + 16, 102, 449, 128, 129, 3, 90, 91, 92, 93, + 11, 124, 28, 34, 557, 93, 555, 15, 16, 367, + 496, 142, 143, 419, 33, 26, 136, 104, 15, 50, + 28, 109, 571, 148, 53, 136, 53, 115, 53, 311, + 124, 119, 126, 4, 3, 129, 128, 4, 495, 94, + 104, 124, 61, 3, 530, 94, 15, 16, 283, 137, + 224, 15, 334, 383, 142, 143, 251, 311, 26, 28, + 15, 25, 468, 124, 32, 117, 35, 31, 128, 117, + 124, 128, 124, 431, 126, 129, 3, 4, 130, 112, + 334, 45, 130, 116, 104, 128, 106, 124, 418, 128, + 178, 117, 3, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 476, 584, + 128, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 269, 270, + 111, 112, 396, 3, 232, 112, 0, 124, 117, 102, + 11, 405, 387, 388, 124, 15, 16, 128, 3, 517, + 248, 128, 3, 251, 233, 253, 233, 90, 28, 104, + 93, 235, 129, 3, 15, 16, 135, 3, 129, 353, + 244, 269, 270, 102, 106, 15, 16, 28, 518, 15, + 16, 127, 102, 3, 3, 533, 3, 451, 28, 537, + 538, 15, 28, 126, 458, 68, 129, 338, 3, 539, + 3, 101, 379, 17, 381, 19, 20, 68, 22, 101, + 24, 559, 15, 16, 3, 3, 3, 422, 90, 91, + 92, 93, 136, 37, 102, 28, 124, 129, 576, 364, + 129, 45, 46, 47, 48, 333, 124, 106, 586, 136, + 338, 136, 136, 341, 116, 117, 118, 117, 102, 3, + 590, 104, 124, 53, 126, 353, 126, 129, 53, 436, + 17, 3, 19, 20, 343, 22, 343, 24, 90, 104, + 104, 350, 90, 350, 136, 90, 135, 117, 352, 127, + 37, 117, 3, 129, 136, 135, 126, 101, 45, 46, + 47, 48, 102, 106, 101, 393, 104, 371, 430, 397, + 14, 124, 400, 136, 402, 379, 102, 381, 485, 135, + 15, 409, 128, 3, 4, 90, 414, 7, 8, 9, + 25, 135, 90, 135, 422, 30, 31, 136, 65, 427, + 3, 4, 5, 102, 7, 8, 9, 128, 43, 136, + 45, 415, 128, 104, 101, 18, 112, 128, 128, 116, + 23, 124, 25, 136, 27, 28, 17, 106, 19, 20, + 111, 22, 436, 24, 90, 91, 92, 93, 3, 3, + 135, 44, 25, 135, 3, 116, 37, 135, 135, 52, + 128, 54, 55, 135, 112, 46, 47, 48, 114, 115, + 116, 117, 118, 136, 124, 493, 135, 70, 124, 135, + 126, 112, 135, 129, 502, 128, 135, 486, 53, 136, + 350, 485, 343, 49, 95, 543, 441, 58, 91, 92, + 373, 141, 505, 505, 474, 547, 474, 70, 442, 525, + 26, 436, 466, 552, 283, 47, -1, -1, -1, 415, + 519, 519, 519, 519, -1, 543, 525, -1, 252, -1, + -1, 124, -1, 126, -1, -1, -1, 130, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 565, 547, 547, + 547, 547, 3, 4, 5, -1, 7, 8, 9, 10, + 11, 12, 13, -1, -1, -1, 17, 18, 19, 20, + 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, + 31, -1, -1, -1, 35, 36, 37, 38, -1, 40, + 41, 42, -1, 44, 45, 46, 47, 48, -1, -1, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, + -1, 62, 63, 64, -1, 66, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, - -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, - 114, -1, -1, -1, -1, 119, 120, -1, -1, -1, - 124, -1, 126, -1, 128, -1, 130, -1, -1, -1, - 134, 3, 4, 5, 6, -1, 8, 9, 10, 11, - 12, 13, 14, -1, -1, -1, 18, 19, 20, 21, - 22, 23, 24, 25, -1, -1, 28, 29, -1, -1, - -1, -1, -1, -1, 36, -1, 38, 39, -1, 41, - -1, 43, -1, 45, -1, 47, 48, 49, -1, -1, - 52, 53, -1, 55, 56, -1, -1, -1, -1, -1, - -1, 63, 64, 65, -1, -1, -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 91, 92, -1, -1, -1, -1, -1, -1, -1, -1, + 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 111, -1, -1, 114, -1, -1, -1, -1, 119, 120, + -1, -1, -1, 124, -1, 126, -1, 128, -1, 130, + -1, 3, 4, 5, 135, 7, 8, 9, 10, 11, + 12, 13, -1, -1, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, 27, 28, 29, -1, 31, + -1, -1, -1, 35, 36, 37, 38, -1, 40, 41, + 42, -1, 44, 45, 46, 47, 48, -1, -1, 51, + 52, -1, 54, 55, -1, -1, -1, -1, -1, -1, + 62, 63, 64, -1, 66, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 92, 93, -1, -1, -1, -1, -1, -1, -1, 101, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, + 92, -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, 114, -1, -1, -1, -1, 119, 120, -1, -1, -1, 124, -1, 126, -1, 128, -1, 130, -1, - -1, -1, 134, 3, 4, 5, 6, -1, 8, 9, - 10, 11, 12, 13, 14, -1, -1, -1, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, 28, 29, - -1, -1, -1, -1, -1, -1, 36, -1, 38, 39, - -1, 41, -1, 43, -1, 45, -1, 47, 48, 49, - -1, -1, 52, 53, -1, 55, 56, -1, -1, -1, - -1, -1, -1, 63, 64, 65, -1, -1, -1, -1, - -1, 71, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 92, 93, -1, -1, -1, -1, -1, -1, - -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 111, -1, -1, 114, -1, -1, -1, -1, 119, - 120, -1, -1, -1, 124, -1, 126, -1, 128, -1, - 130, -1, -1, -1, 134, 3, 4, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, - 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, - 28, 29, -1, -1, -1, -1, -1, -1, 36, -1, - 38, 39, -1, 41, -1, 43, -1, 45, -1, 47, - 48, 49, -1, -1, 52, 53, -1, 55, 56, -1, - -1, -1, -1, -1, -1, 63, 64, 65, -1, -1, - -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, + 3, 4, 5, 135, 7, 8, 9, 10, 11, 12, + 13, -1, -1, -1, 17, 18, 19, 20, 21, 22, + 23, 24, -1, -1, 27, 28, -1, -1, 39, -1, + -1, -1, 35, -1, 37, 38, -1, 40, -1, 42, + -1, 44, -1, 46, 47, 48, -1, -1, 51, 52, + -1, 54, 55, -1, -1, -1, 67, 68, 69, 62, + 63, 64, -1, -1, 75, 76, -1, 70, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, + 91, 92, 93, -1, 95, 96, 97, -1, 91, 92, + -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, + 111, 112, -1, 114, 115, 116, 117, 118, 111, -1, + -1, 114, -1, 124, -1, 126, 119, 120, 129, -1, + -1, 124, -1, 126, -1, 128, -1, 130, -1, 3, + 4, 5, 135, 7, 8, 9, 10, 11, 12, 13, + -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, + 24, -1, -1, 27, 28, -1, -1, 39, -1, -1, + -1, 35, -1, 37, 38, -1, 40, -1, 42, -1, + 44, -1, 46, 47, 48, -1, -1, 51, 52, -1, + 54, 55, -1, -1, -1, -1, -1, -1, 62, 63, + 64, -1, -1, 75, 76, -1, 70, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, + 92, 93, -1, 95, 96, 97, -1, 91, 92, -1, + -1, -1, -1, -1, -1, -1, -1, 101, -1, 111, + 112, -1, 114, 115, 116, 117, 118, 111, -1, -1, + 114, -1, 124, -1, 126, 119, 120, 129, -1, -1, + 124, -1, 126, -1, 128, -1, 130, -1, 3, 4, + 5, 135, 7, 8, 9, 10, 11, 12, 13, -1, + -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, + -1, -1, 27, 28, -1, -1, -1, -1, -1, -1, + 35, -1, 37, 38, -1, 40, -1, 42, -1, 44, + -1, 46, 47, 48, -1, -1, 51, 52, -1, 54, + 55, -1, -1, -1, -1, -1, -1, 62, 63, 64, + -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, 93, -1, -1, -1, -1, - -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 111, -1, -1, 114, -1, -1, -1, - -1, 119, 120, -1, -1, -1, 124, -1, 126, -1, - 128, -1, 130, -1, -1, -1, 134, 3, 4, 5, - 6, -1, 8, 9, 10, 11, 12, 13, 14, -1, - -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, - -1, -1, 28, 29, -1, -1, -1, -1, -1, -1, - 36, -1, 38, 39, -1, 41, -1, 43, -1, 45, - -1, 47, 48, 49, -1, -1, 52, 53, -1, 55, - 56, -1, -1, -1, -1, -1, -1, 63, 64, 65, - -1, -1, -1, -1, -1, 71, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 91, 92, -1, -1, + -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 111, -1, -1, 114, + -1, -1, -1, -1, 119, 120, -1, -1, -1, 124, + -1, 126, -1, 128, -1, 130, -1, 3, 4, 5, + 135, 7, 8, 9, 10, 11, 12, 13, -1, -1, + -1, 17, 18, 19, 20, 21, 22, 23, 24, -1, + -1, 27, 28, -1, -1, -1, -1, -1, -1, 35, + -1, 37, 38, -1, 40, -1, 42, -1, 44, -1, + 46, 47, 48, -1, -1, 51, 52, -1, 54, 55, + -1, -1, -1, -1, -1, -1, 62, 63, 64, -1, + -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 92, 93, -1, -1, + -1, -1, -1, -1, -1, 91, 92, -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, 114, -1, -1, -1, -1, 119, 120, -1, -1, -1, 124, -1, - 126, -1, 128, -1, 130, -1, 0, -1, 134, 3, - 4, 5, 6, -1, 8, 9, 10, 11, 12, 13, - 14, -1, -1, 17, 18, 19, 20, 21, 22, 23, - 24, 25, -1, -1, 28, 29, -1, -1, -1, -1, - -1, -1, 36, -1, 38, 39, -1, 41, -1, 43, - -1, 45, -1, 47, 48, 49, -1, -1, 52, 53, - -1, 55, 56, -1, -1, -1, -1, -1, -1, 63, - 64, 65, -1, -1, -1, -1, -1, 71, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, - -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, - 114, -1, -1, -1, -1, 119, 120, -1, -1, -1, - 124, -1, 126, -1, 128, -1, 130, 3, 4, 5, - 6, -1, 8, 9, 10, 11, 12, 13, 14, -1, - 16, -1, 18, 19, 20, 21, 22, 23, 24, 25, - 26, -1, 28, 29, 30, -1, 32, -1, -1, -1, - 36, 37, 38, 39, -1, 41, 42, 43, -1, 45, - 46, 47, 48, 49, -1, -1, 52, 53, -1, 55, - 56, -1, -1, -1, -1, -1, -1, 63, 64, 65, - -1, 67, -1, -1, -1, 71, -1, -1, -1, -1, + 126, -1, 128, 0, 130, -1, 3, 4, 5, 135, + 7, 8, 9, 10, 11, 12, 13, -1, -1, 16, + 17, 18, 19, 20, 21, 22, 23, 24, -1, -1, + 27, 28, -1, -1, -1, -1, -1, -1, 35, -1, + 37, 38, -1, 40, -1, 42, -1, 44, -1, 46, + 47, 48, -1, -1, 51, 52, -1, 54, 55, -1, + -1, -1, -1, -1, -1, 62, 63, 64, -1, -1, + -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 92, 93, -1, -1, - -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 111, -1, -1, 114, -1, - -1, -1, -1, 119, 120, -1, -1, -1, 124, -1, - 126, -1, 128, -1, 130, 3, 4, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, -1, -1, -1, - 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, - 28, 29, 30, -1, 32, -1, -1, -1, 36, 37, - 38, 39, -1, 41, 42, 43, -1, 45, 46, 47, - 48, 49, -1, -1, 52, 53, -1, 55, 56, -1, - -1, -1, -1, -1, -1, 63, 64, 65, -1, 67, - -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 91, 92, -1, -1, -1, -1, + -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 111, -1, -1, 114, -1, -1, + -1, -1, 119, 120, -1, -1, -1, 124, -1, 126, + -1, 128, 0, 130, -1, 3, 4, 5, -1, 7, + 8, 9, 10, 11, 12, 13, -1, -1, 16, 17, + 18, 19, 20, 21, 22, 23, 24, -1, -1, 27, + 28, -1, -1, -1, -1, -1, -1, 35, -1, 37, + 38, -1, 40, -1, 42, -1, 44, -1, 46, 47, + 48, -1, -1, 51, 52, -1, 54, 55, -1, -1, + -1, -1, -1, -1, 62, 63, 64, -1, -1, -1, + -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, 93, -1, -1, -1, -1, + -1, -1, -1, 91, 92, -1, -1, -1, -1, -1, -1, -1, -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, 114, -1, -1, -1, -1, 119, 120, -1, -1, -1, 124, -1, 126, -1, - 128, 3, 130, 5, 6, -1, 8, 9, 10, -1, - -1, -1, -1, -1, -1, -1, -1, 19, -1, -1, - -1, -1, 24, -1, 26, -1, 28, 29, -1, -1, - 32, -1, -1, -1, 36, -1, -1, -1, -1, -1, - -1, 43, -1, 45, 46, -1, -1, -1, -1, -1, - -1, 53, -1, 55, 56, -1, -1, -1, -1, -1, - -1, -1, 64, -1, -1, -1, -1, -1, -1, 71, - -1, -1, -1, 3, -1, 5, 6, -1, 8, 9, - 10, -1, -1, -1, -1, -1, -1, -1, -1, 19, - 92, 93, -1, -1, 24, -1, 26, -1, 28, 29, - -1, -1, -1, -1, -1, -1, 36, -1, -1, 111, - -1, -1, 114, 43, -1, 45, -1, 119, 120, -1, - -1, -1, 124, 53, 126, 55, 56, -1, 130, -1, - 3, -1, 5, 6, 64, 8, 9, 10, -1, -1, - -1, 71, -1, -1, -1, -1, 19, -1, -1, -1, - -1, 24, -1, 26, -1, 28, 29, -1, -1, -1, - -1, -1, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, 45, -1, -1, -1, -1, -1, -1, -1, - 53, 111, 55, 56, 114, -1, -1, -1, -1, 119, - 120, -1, -1, -1, 124, -1, 126, -1, 71, -1, - 130, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, - 93, -1, -1, -1, -1, -1, 40, -1, -1, -1, + 128, -1, 130, 3, 4, 5, -1, 7, 8, 9, + 10, 11, 12, 13, -1, 15, -1, 17, 18, 19, + 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, + -1, 31, -1, -1, -1, 35, 36, 37, 38, -1, + 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, + -1, 51, 52, -1, 54, 55, -1, -1, -1, -1, + -1, -1, 62, 63, 64, -1, 66, -1, -1, -1, + 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 91, 92, -1, -1, -1, -1, -1, -1, -1, + -1, 101, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 111, -1, -1, 114, -1, -1, -1, -1, 119, + 120, -1, -1, -1, 124, -1, 126, -1, 128, -1, + 130, 3, 4, 5, -1, 7, 8, 9, 10, 11, + 12, 13, -1, -1, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, 27, 28, 29, -1, 31, + -1, -1, -1, 35, 36, 37, 38, -1, 40, 41, + 42, -1, 44, 45, 46, 47, 48, -1, -1, 51, + 52, -1, 54, 55, -1, -1, -1, -1, -1, -1, + 62, 63, 64, -1, 66, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 124, -1, 126, 68, 69, 70, 130, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, -1, 92, 93, - 94, -1, 96, 97, 98, -1, -1, -1, -1, -1, - 104, 105, -1, 107, 108, 109, 40, 111, 112, -1, - 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, - 124, -1, 126, -1, -1, 129, -1, -1, -1, -1, - -1, 135, -1, -1, 68, 69, 70, -1, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, -1, 92, 93, - 94, -1, 96, 97, 98, -1, -1, -1, -1, -1, - 104, 105, -1, 107, 108, 109, 40, 111, 112, -1, - 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, - 124, -1, 126, -1, -1, 129, -1, -1, -1, -1, - -1, 135, -1, -1, 68, 69, 70, -1, 72, 73, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, + 92, 3, 4, 5, -1, 7, 8, 9, -1, 101, + -1, -1, -1, -1, -1, -1, 18, -1, -1, 111, + -1, 23, 114, 25, -1, 27, 28, 119, 120, 31, + -1, -1, 124, 35, 126, -1, 128, -1, 130, -1, + 42, -1, 44, 45, -1, -1, -1, -1, -1, -1, + 52, -1, 54, 55, 3, 4, 5, -1, 7, 8, + 9, 63, -1, -1, -1, -1, -1, -1, 70, 18, + -1, -1, -1, -1, 23, -1, 25, -1, 27, 28, + -1, -1, -1, -1, -1, -1, 35, -1, -1, 91, + 92, -1, -1, 42, -1, 44, -1, -1, -1, -1, + -1, -1, -1, 52, -1, 54, 55, -1, -1, 111, + -1, -1, 114, -1, 63, -1, -1, 119, 120, -1, + -1, 70, 124, -1, 126, -1, -1, -1, 130, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 91, 92, -1, -1, -1, -1, -1, -1, + 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 111, -1, -1, 114, -1, -1, -1, -1, + 119, 120, -1, -1, -1, 124, -1, 126, 67, 68, + 69, 130, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, -1, 95, 96, 97, -1, + -1, -1, -1, -1, -1, 104, 105, -1, 107, 108, + 109, 39, 111, 112, -1, 114, 115, 116, 117, 118, + -1, -1, -1, -1, -1, 124, -1, 126, -1, -1, + 129, -1, -1, -1, -1, -1, -1, 136, -1, 67, + 68, 69, -1, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, -1, 95, 96, 97, + -1, -1, -1, -1, -1, -1, 104, 105, -1, 107, + 108, 109, 39, 111, 112, -1, 114, 115, 116, 117, + 118, -1, -1, -1, -1, -1, 124, -1, 126, -1, + -1, 129, -1, -1, -1, -1, -1, -1, 136, -1, + 67, 68, 69, -1, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, -1, 95, 96, + 97, -1, -1, -1, -1, 39, -1, 104, 105, 106, + 107, 108, 109, -1, 111, 112, -1, 114, 115, 116, + 117, 118, -1, -1, -1, -1, -1, 124, -1, 126, + -1, -1, 129, 67, 68, 69, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, -1, 92, 93, - 94, -1, 96, 97, 98, -1, -1, -1, 40, -1, - 104, 105, 106, 107, 108, 109, -1, 111, 112, -1, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + -1, 95, 96, 97, -1, -1, -1, -1, 39, -1, + 104, 105, -1, 107, 108, 109, -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, - 124, -1, 126, -1, -1, 129, 68, 69, 70, -1, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, - 92, 93, 94, -1, 96, 97, 98, -1, -1, -1, - 40, -1, 104, 105, -1, 107, 108, 109, -1, 111, - 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, - -1, -1, 124, -1, 126, 127, -1, 129, 68, 69, - 70, -1, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, -1, 92, 93, 94, -1, 96, 97, 98, -1, - -1, -1, 40, -1, 104, 105, -1, 107, 108, 109, - -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, - -1, -1, -1, -1, 124, -1, 126, 127, -1, 129, - 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, + 124, -1, 126, 127, -1, 129, 67, 68, 69, -1, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, + -1, 39, -1, 104, 105, -1, 107, 108, 109, -1, + 111, 112, -1, 114, 115, 116, 117, 118, -1, -1, + -1, -1, -1, 124, -1, 126, 127, -1, 129, 67, + 68, 69, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, -1, 92, 93, 94, -1, 96, 97, - 98, -1, -1, -1, 40, -1, 104, 105, -1, 107, + 88, 89, 90, 91, 92, 93, -1, 95, 96, 97, + -1, -1, -1, -1, 39, -1, 104, 105, -1, 107, 108, 109, -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, 124, -1, 126, 127, - -1, 129, 68, 69, 70, -1, 72, 73, 74, 75, + -1, 129, 67, 68, 69, -1, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, + 95, 96, 97, -1, -1, -1, -1, 39, -1, 104, + 105, -1, 107, 108, 109, -1, 111, 112, -1, 114, + 115, 116, 117, 118, -1, -1, -1, -1, -1, 124, + -1, 126, 127, -1, 129, 67, 68, 69, -1, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, + 39, -1, 104, 105, -1, 107, 108, 109, -1, 111, + 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, + -1, -1, 124, -1, 126, 127, -1, 129, 67, 68, + 69, -1, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, -1, 95, 96, 97, -1, + -1, -1, -1, 39, -1, 104, 105, 106, 107, 108, + 109, -1, 111, 112, -1, 114, 115, 116, 117, 118, + -1, -1, -1, -1, -1, 124, -1, 126, -1, -1, + 129, 67, 68, 69, -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, -1, 92, 93, 94, -1, - 96, 97, 98, -1, -1, -1, 40, -1, 104, 105, + 86, 87, 88, 89, 90, 91, 92, 93, -1, 95, + 96, 97, -1, -1, -1, -1, 39, -1, 104, 105, -1, 107, 108, 109, -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, 124, -1, - 126, 127, -1, 129, 68, 69, 70, -1, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, -1, 92, 93, - 94, -1, 96, 97, 98, -1, -1, -1, 40, -1, - 104, 105, -1, 107, 108, 109, -1, 111, 112, -1, - 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, - 124, -1, 126, 127, -1, 129, 68, 69, 70, -1, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, - 92, 93, 94, -1, 96, 97, 98, -1, -1, -1, - 40, -1, 104, 105, 106, 107, 108, 109, -1, 111, - 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, - -1, -1, 124, -1, 126, -1, -1, 129, 68, 69, - 70, -1, 72, 73, 74, 75, 76, 77, 78, 79, + 126, 127, -1, 129, 67, 68, 69, -1, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, -1, 95, 96, 97, -1, -1, -1, -1, 39, + -1, 104, 105, -1, 107, 108, 109, -1, 111, 112, + -1, 114, 115, 116, 117, 118, -1, -1, -1, -1, + -1, 124, -1, 126, -1, -1, 129, 67, 68, 69, + -1, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, -1, 92, 93, 94, -1, 96, 97, 98, -1, - -1, -1, 40, -1, 104, 105, -1, 107, 108, 109, - -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, + 90, 91, 92, 93, -1, 95, 96, 97, -1, -1, + -1, -1, 39, -1, 104, 105, -1, 107, 108, 109, + -1, -1, 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, 124, -1, 126, -1, -1, 129, - 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, -1, 92, 93, 94, -1, 96, 97, - 98, -1, -1, -1, 40, -1, 104, 105, -1, 107, - 108, 109, -1, -1, 112, -1, 114, 115, 116, 117, - 118, -1, -1, -1, -1, -1, 124, -1, 126, -1, - -1, 129, 68, 69, 70, -1, 72, 73, 74, 75, - 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 92, 93, 94, -1, - 96, 97, 98, -1, -1, -1, 40, -1, -1, -1, - -1, 107, 108, 109, -1, 111, 112, -1, 114, 115, - 116, 117, 118, -1, -1, -1, -1, -1, 124, -1, - 126, -1, -1, 129, 68, 69, 70, -1, 72, 73, - 74, 75, 76, 77, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 92, 93, - 94, -1, 96, 97, 98, -1, -1, -1, 40, -1, - -1, -1, -1, -1, 108, 109, -1, 111, 112, -1, - 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, - 124, -1, 126, -1, -1, 129, 68, 69, 70, -1, - 72, 73, 74, 75, 76, 77, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 92, 93, 94, -1, 96, 97, 98, -1, -1, -1, - 40, -1, -1, -1, -1, -1, -1, 109, -1, 111, - 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, - -1, -1, 124, -1, 126, -1, -1, 129, 68, 69, - 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, + 67, 68, 69, -1, 71, 72, 73, 74, 75, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 92, 93, 94, -1, 96, 97, 98, -1, - -1, -1, 40, -1, -1, -1, -1, -1, -1, 109, - -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, - -1, -1, -1, -1, 124, -1, 126, -1, -1, 129, - 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, + -1, -1, 89, 90, 91, 92, 93, -1, 95, 96, + 97, -1, -1, -1, -1, 39, -1, -1, -1, -1, + 107, 108, 109, -1, 111, 112, -1, 114, 115, 116, + 117, 118, -1, -1, -1, -1, -1, 124, -1, 126, + -1, -1, 129, 67, 68, 69, -1, 71, 72, 73, + 74, 75, 76, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 90, 91, 92, 93, + -1, 95, 96, 97, -1, -1, -1, -1, 39, -1, + -1, -1, -1, 107, 108, 109, -1, 111, 112, -1, + 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, + 124, -1, 126, -1, -1, 129, 67, 68, 69, -1, + 71, 72, 73, 74, 75, 76, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 90, + 91, 92, 93, -1, 95, 96, 97, -1, -1, -1, + -1, 39, -1, -1, -1, -1, -1, 108, 109, -1, + 111, 112, -1, 114, 115, 116, 117, 118, -1, -1, + -1, -1, -1, 124, -1, 126, -1, -1, 129, 67, + 68, 69, -1, 71, 72, 73, 74, 75, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 92, 93, 94, -1, 96, 97, - 98, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 111, 112, -1, 114, 115, 116, 117, + -1, -1, 90, 91, 92, 93, -1, 95, 96, 97, + -1, -1, -1, -1, 39, -1, -1, -1, -1, -1, + -1, 109, -1, 111, 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, -1, -1, 124, -1, 126, -1, - -1, 129 + -1, 129, 67, 68, 69, -1, 71, 72, 73, 74, + 75, 76, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 90, 91, 92, 93, -1, + 95, 96, 97, -1, -1, -1, -1, 39, -1, -1, + -1, -1, -1, -1, 109, -1, 111, 112, -1, 114, + 115, 116, 117, 118, -1, -1, -1, -1, -1, 124, + -1, 126, -1, -1, 129, 67, 68, 69, -1, 71, + 72, 73, 74, 75, 76, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, + 92, 93, -1, 95, 96, 97, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 111, + 112, -1, 114, 115, 116, 117, 118, -1, -1, -1, + -1, -1, 124, -1, 126, -1, -1, 129 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 3, 4, 5, 6, 8, 9, 10, 11, 12, - 13, 14, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 28, 29, 36, 38, 39, 41, 43, 45, - 47, 48, 49, 52, 53, 55, 56, 63, 64, 65, - 71, 92, 93, 101, 111, 114, 119, 120, 124, 126, - 128, 130, 137, 138, 139, 140, 146, 149, 151, 159, - 162, 163, 164, 165, 166, 173, 181, 184, 185, 188, - 191, 192, 193, 194, 198, 200, 209, 214, 215, 216, - 227, 234, 237, 250, 251, 252, 257, 261, 265, 266, - 268, 269, 270, 91, 50, 124, 124, 156, 157, 124, - 3, 4, 16, 17, 29, 128, 186, 187, 16, 3, - 261, 3, 236, 261, 124, 3, 187, 240, 261, 128, - 124, 129, 16, 261, 124, 3, 5, 8, 9, 10, - 258, 259, 260, 261, 261, 261, 261, 261, 256, 261, - 246, 247, 248, 254, 261, 30, 32, 37, 42, 46, - 67, 101, 134, 145, 146, 147, 151, 153, 167, 168, - 183, 192, 253, 3, 0, 140, 128, 3, 46, 153, - 160, 161, 257, 147, 148, 16, 26, 31, 32, 44, - 46, 208, 267, 194, 3, 128, 221, 225, 102, 40, - 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 92, 93, 94, 96, 97, 98, 104, 105, - 107, 108, 109, 111, 112, 114, 115, 116, 117, 118, - 124, 126, 129, 3, 124, 255, 256, 12, 148, 174, - 190, 128, 129, 186, 187, 239, 240, 241, 249, 124, - 255, 129, 182, 246, 3, 104, 255, 134, 106, 102, - 102, 135, 127, 102, 254, 3, 3, 154, 155, 255, - 255, 154, 3, 134, 147, 128, 138, 3, 101, 69, - 101, 3, 35, 51, 233, 3, 3, 210, 261, 3, - 221, 226, 228, 229, 261, 261, 261, 261, 261, 261, + 0, 3, 4, 5, 7, 8, 9, 10, 11, 12, + 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 27, 28, 35, 37, 38, 40, 42, 44, 46, + 47, 48, 51, 52, 54, 55, 62, 63, 64, 70, + 91, 92, 101, 111, 114, 119, 120, 124, 126, 128, + 130, 138, 139, 140, 141, 147, 150, 159, 162, 163, + 164, 165, 166, 173, 181, 184, 185, 188, 191, 192, + 193, 194, 198, 200, 209, 214, 215, 216, 227, 234, + 237, 250, 251, 252, 257, 261, 265, 266, 268, 269, + 270, 49, 124, 124, 156, 157, 124, 3, 15, 16, + 28, 128, 186, 187, 15, 261, 3, 236, 261, 124, + 3, 187, 240, 261, 128, 124, 129, 15, 261, 124, + 3, 4, 7, 8, 9, 258, 259, 260, 261, 261, + 261, 261, 261, 256, 261, 246, 247, 248, 254, 261, + 29, 31, 36, 41, 45, 66, 101, 135, 146, 147, + 148, 153, 167, 168, 183, 192, 253, 3, 0, 141, + 3, 45, 153, 160, 161, 257, 148, 149, 15, 25, + 30, 31, 43, 45, 208, 267, 194, 3, 128, 221, + 225, 102, 39, 67, 68, 69, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, + 96, 97, 104, 105, 107, 108, 109, 111, 112, 114, + 115, 116, 117, 118, 124, 126, 129, 124, 255, 256, + 11, 149, 174, 190, 128, 129, 186, 187, 239, 240, + 241, 249, 124, 255, 129, 182, 246, 3, 104, 255, + 135, 106, 102, 102, 136, 127, 102, 254, 3, 3, + 154, 155, 255, 255, 154, 3, 135, 148, 3, 101, + 68, 101, 3, 34, 50, 233, 3, 3, 210, 261, + 3, 221, 226, 228, 229, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 117, 130, 186, 263, 264, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 261, 261, 261, 261, 117, 130, - 186, 264, 261, 261, 261, 261, 261, 261, 261, 261, - 261, 261, 261, 261, 261, 261, 261, 246, 261, 3, - 4, 117, 124, 126, 130, 263, 264, 135, 124, 261, - 101, 126, 141, 142, 143, 149, 151, 198, 200, 209, - 234, 189, 186, 129, 124, 245, 3, 95, 230, 231, - 232, 135, 117, 186, 144, 145, 135, 261, 135, 254, - 259, 261, 106, 244, 102, 145, 134, 244, 255, 255, - 104, 3, 54, 195, 54, 196, 3, 211, 212, 222, - 104, 104, 112, 116, 217, 229, 126, 264, 106, 135, - 127, 262, 261, 126, 264, 91, 156, 255, 135, 150, - 134, 143, 128, 141, 246, 104, 106, 213, 232, 135, - 102, 134, 156, 106, 36, 117, 241, 243, 104, 152, - 155, 134, 101, 135, 3, 5, 124, 241, 15, 197, - 241, 242, 128, 244, 102, 134, 5, 221, 5, 221, - 218, 223, 261, 261, 261, 127, 261, 264, 135, 128, - 261, 141, 134, 135, 261, 243, 244, 95, 232, 27, - 33, 175, 177, 179, 180, 66, 158, 254, 261, 257, - 156, 230, 242, 128, 102, 201, 152, 212, 112, 5, - 111, 112, 128, 219, 224, 227, 127, 135, 127, 34, - 62, 169, 170, 171, 172, 127, 134, 213, 128, 232, - 128, 124, 175, 177, 156, 135, 135, 199, 241, 46, - 101, 192, 205, 206, 207, 116, 261, 111, 227, 223, - 261, 106, 134, 171, 172, 238, 178, 3, 156, 244, - 101, 146, 151, 192, 202, 203, 204, 209, 234, 3, - 26, 134, 207, 225, 220, 116, 223, 106, 144, 144, - 144, 244, 128, 128, 134, 204, 233, 218, 134, 225, - 144, 134, 134, 135, 235, 202, 3, 112, 218, 176, - 144, 134, 124, 112, 128, 134, 230, 144, 135, 134, - 244 + 246, 261, 124, 126, 130, 263, 264, 136, 124, 261, + 101, 126, 142, 143, 144, 150, 198, 200, 209, 234, + 189, 186, 129, 124, 245, 3, 94, 230, 231, 232, + 136, 117, 186, 145, 146, 136, 261, 136, 254, 259, + 261, 106, 244, 102, 244, 255, 255, 104, 3, 53, + 195, 53, 196, 3, 211, 212, 222, 104, 104, 112, + 116, 217, 229, 126, 263, 264, 90, 106, 136, 127, + 262, 261, 126, 263, 264, 90, 156, 255, 136, 151, + 135, 144, 142, 246, 104, 106, 213, 232, 136, 102, + 135, 156, 106, 35, 117, 241, 243, 104, 152, 155, + 101, 136, 3, 4, 124, 241, 14, 197, 241, 242, + 128, 244, 102, 135, 4, 221, 4, 221, 218, 223, + 261, 90, 117, 264, 261, 261, 127, 261, 90, 264, + 136, 128, 261, 135, 136, 261, 243, 244, 94, 232, + 26, 32, 175, 177, 179, 180, 65, 158, 254, 261, + 257, 156, 230, 242, 128, 102, 201, 152, 212, 112, + 4, 111, 112, 128, 219, 224, 227, 127, 264, 136, + 127, 264, 33, 61, 169, 170, 171, 172, 127, 213, + 128, 232, 128, 124, 175, 177, 156, 136, 136, 199, + 241, 45, 101, 192, 205, 206, 207, 116, 261, 111, + 227, 223, 261, 106, 135, 171, 172, 238, 178, 3, + 156, 244, 101, 126, 147, 192, 202, 203, 204, 209, + 234, 3, 25, 135, 207, 225, 220, 116, 223, 106, + 145, 145, 145, 244, 128, 151, 135, 204, 233, 218, + 135, 225, 145, 135, 135, 136, 235, 261, 3, 112, + 218, 176, 145, 127, 124, 112, 128, 135, 230, 145, + 136, 135, 244 }; #define yyerrok (yyerrstatus = 0) @@ -4581,66 +2929,44 @@ switch (yyn) { - case 13: - if(as3_pass==2) { - -/* Line 1464 of skeleton.m4 */ -#line 1953 "parser.y" - {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} - } - break; - - - - case 24: - if(as3_pass==2) { - -/* Line 1464 of skeleton.m4 */ -#line 1965 "parser.y" - {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} - } - break; - - - - case 25: + case 23: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1966 "parser.y" +#line 317 "parser.y" {PASS_ALWAYS as3_pass=(yyvsp[(2) - (4)].number_int);PASS1 as3_warning("embed command ignored");} } break; - case 27: + case 25: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1969 "parser.y" +#line 320 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; - case 28: + case 26: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1970 "parser.y" +#line 321 "parser.y" {(yyval.code)=code_new();} } break; - case 29: + case 27: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1972 "parser.y" +#line 323 "parser.y" { (yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code)); } @@ -4649,96 +2975,77 @@ - case 30: + case 28: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1975 "parser.y" +#line 326 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; - case 44: + case 42: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1991 "parser.y" +#line 342 "parser.y" {(yyval.code)=(yyvsp[(2) - (3)].code);} } break; - case 45: + case 43: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1992 "parser.y" +#line 343 "parser.y" {(yyval.code)=0;} } break; - case 46: + case 44: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 1995 "parser.y" +#line 346 "parser.y" {(yyval.code)=0;} } break; - case 53: - if(as3_pass==2) { - -/* Line 1464 of skeleton.m4 */ -#line 2002 "parser.y" - { - PASS_ALWAYS - if(as3_pass) { - (yyval.code) = (yyvsp[(3) - (4)].code); - } else { - (yyval.code) = 0; - } - as3_pass=(yyvsp[(1) - (4)].number_int); -} - } - break; - - - - case 54: + case 51: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2014 "parser.y" +#line 367 "parser.y" {(yyval.code)=(yyvsp[(1) - (2)].code);} } break; - case 55: + case 52: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2015 "parser.y" +#line 368 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; - case 56: + case 53: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2019 "parser.y" +#line 372 "parser.y" { if((yyvsp[(1) - (1)].code)) { if(!global->init) @@ -4752,11 +3059,11 @@ - case 57: + case 54: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2030 "parser.y" +#line 383 "parser.y" { PASS_ALWAYS (yyval.number_int) = as3_pass; @@ -4767,109 +3074,90 @@ - case 58: - if(as3_pass==2) { - -/* Line 1464 of skeleton.m4 */ -#line 2038 "parser.y" - { - PASS12 - (yyval.number_int)=as3_pass; - char*key = concat3((yyvsp[(1) - (3)].id),"::",(yyvsp[(3) - (3)].id)); - if(!definitions || !dict_contains(definitions, key)) { - as3_pass=0; - } - free(key); -} - } - break; - - - - case 59: + case 55: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2065 "parser.y" +#line 418 "parser.y" {(yyval.node)=(yyvsp[(2) - (2)].node);} } break; - case 60: + case 56: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2066 "parser.y" +#line 419 "parser.y" {(yyval.node)=mkdummynode();} } break; - case 61: + case 57: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2068 "parser.y" +#line 421 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; - case 62: + case 58: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2069 "parser.y" +#line 422 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; - case 63: + case 59: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2071 "parser.y" +#line 424 "parser.y" {(yyval.code) = (yyvsp[(1) - (1)].code);} } break; - case 64: + case 60: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2072 "parser.y" +#line 425 "parser.y" {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));} } break; - case 65: + case 61: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2075 "parser.y" +#line 428 "parser.y" { PASS12 - if(variable_exists((yyvsp[(1) - (3)].id))) + if(variable_exists((yyvsp[(1) - (3)].id))) syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id)); PASS1 - new_variable((yyvsp[(1) - (3)].id), 0, 1, 0); + new_variable(state->method, (yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0); PASS2 char slot = 0; int index = 0; variable_t*v = 0; if(state->method->uses_slots) { - v = find_slot(state, (yyvsp[(1) - (3)].id)); + v = find_slot(state->method, (yyvsp[(1) - (3)].id)); if(v && !v->init) { // this variable is stored in a slot v->init = 1; @@ -4878,7 +3166,7 @@ } } if(!v) { - v = new_variable2((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0); + v = new_variable2(state->method, (yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1, 0); } (yyval.code) = slot?abc_getscopeobject(0, 1):0; @@ -4919,22 +3207,22 @@ - case 66: + case 62: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2135 "parser.y" +#line 488 "parser.y" {PASS12 new_state();} } break; - case 67: + case 63: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2135 "parser.y" +#line 488 "parser.y" { (yyval.code) = var_block((yyvsp[(2) - (2)].code), state->vars); PASS12 old_state(); @@ -4944,33 +3232,33 @@ - case 68: + case 64: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2139 "parser.y" +#line 492 "parser.y" {(yyval.code) = code_new();} } break; - case 69: + case 65: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2140 "parser.y" +#line 493 "parser.y" {(yyval.code)=(yyvsp[(2) - (2)].code);} } break; - case 70: + case 66: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2143 "parser.y" +#line 496 "parser.y" { (yyval.code) = code_new(); (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (6)].value).c); @@ -4991,36 +3279,36 @@ - case 71: + case 67: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2159 "parser.y" +#line 512 "parser.y" {(yyval.code)=code_new();} } break; - case 74: + case 70: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2166 "parser.y" +#line 519 "parser.y" { - PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),0,1,0); - PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0); + PASS1 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable(state->method, (yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0); + PASS2 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable(state->method, (yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1,0); } } break; - case 75: + case 71: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2170 "parser.y" +#line 523 "parser.y" { PASS12 (yyval.id)=(yyvsp[(1) - (1)].id); @@ -5030,33 +3318,33 @@ - case 76: + case 72: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2175 "parser.y" +#line 528 "parser.y" {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;} } break; - case 77: + case 73: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2176 "parser.y" +#line 529 "parser.y" {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;} } break; - case 78: + case 74: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2178 "parser.y" +#line 531 "parser.y" { if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement"); (yyval.code) = code_new(); @@ -5081,16 +3369,15 @@ - case 79: + case 75: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2198 "parser.y" +#line 551 "parser.y" { - variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id)); - if(!var) { - syntaxerror("variable %s not known in this scope", (yyvsp[(2) - (6)].id)); - } + node_t*n = resolve_identifier((yyvsp[(2) - (6)].id)); + typedcode_t w = node_write(n); + int it = alloc_local(); int array = alloc_local(); @@ -5111,8 +3398,9 @@ (yyval.code) = abc_nextname((yyval.code)); else (yyval.code) = abc_nextvalue((yyval.code)); - (yyval.code) = converttype((yyval.code), 0, var->type); - (yyval.code) = abc_setlocal((yyval.code), var->index); + + (yyval.code) = converttype((yyval.code), 0, w.t); + (yyval.code) = code_append((yyval.code), w.c); (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code)); (yyval.code) = abc_jump((yyval.code), loopstart); @@ -5126,6 +3414,7 @@ (yyval.code) = abc_kill((yyval.code), it); (yyval.code) = abc_kill((yyval.code), array); + (yyval.code) = var_block((yyval.code), state->vars); PASS12 old_state(); } } @@ -5133,11 +3422,11 @@ - case 80: + case 76: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2241 "parser.y" +#line 595 "parser.y" { (yyval.code) = code_new(); @@ -5158,11 +3447,11 @@ - case 81: + case 77: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2257 "parser.y" +#line 611 "parser.y" { (yyval.code) = code_new(); code_t*loopstart = (yyval.code) = abc_label((yyval.code)); @@ -5179,11 +3468,11 @@ - case 82: + case 78: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2269 "parser.y" +#line 623 "parser.y" { (yyval.code) = abc___break__(0, ""); } @@ -5192,11 +3481,11 @@ - case 83: + case 79: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2272 "parser.y" +#line 626 "parser.y" { (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id)); } @@ -5205,11 +3494,11 @@ - case 84: + case 80: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2275 "parser.y" +#line 629 "parser.y" { (yyval.code) = abc___continue__(0, ""); } @@ -5218,11 +3507,11 @@ - case 85: + case 81: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2278 "parser.y" +#line 632 "parser.y" { (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id)); } @@ -5231,77 +3520,77 @@ - case 86: + case 82: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2282 "parser.y" +#line 636 "parser.y" {(yyval.code)=0;} } break; - case 87: + case 83: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2283 "parser.y" +#line 637 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; - case 88: + case 84: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2284 "parser.y" +#line 638 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; - case 89: + case 85: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2285 "parser.y" +#line 639 "parser.y" {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));} } break; - case 90: + case 86: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2286 "parser.y" +#line 640 "parser.y" {(yyval.code)=(yyvsp[(1) - (1)].code);} } break; - case 91: + case 87: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2287 "parser.y" +#line 641 "parser.y" {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));} } break; - case 92: + case 88: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2289 "parser.y" +#line 643 "parser.y" { (yyval.code) = abc_getlocal(0, state->switch_var); (yyval.code) = code_append((yyval.code), node_read((yyvsp[(2) - (4)].node)).c); @@ -5318,11 +3607,11 @@ - case 93: + case 89: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2300 "parser.y" +#line 654 "parser.y" { (yyval.code) = (yyvsp[(3) - (3)].code); } @@ -5331,22 +3620,22 @@ - case 94: + case 90: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2303 "parser.y" +#line 657 "parser.y" {PASS12 new_state();state->switch_var=alloc_local();} } break; - case 95: + case 91: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2303 "parser.y" +#line 657 "parser.y" { (yyval.code) = node_read((yyvsp[(4) - (8)].node)).c; (yyval.code) = abc_setlocal((yyval.code), state->switch_var); @@ -5380,26 +3669,26 @@ - case 96: + case 92: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2334 "parser.y" +#line 688 "parser.y" {PASS12 new_state(); state->exception_name=(yyvsp[(3) - (5)].id); - PASS1 new_variable((yyvsp[(3) - (5)].id), 0, 0, 0); - PASS2 new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0); + PASS1 new_variable(state->method, (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0); + PASS2 new_variable(state->method, (yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0, 0); } } break; - case 97: + case 93: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2339 "parser.y" +#line 693 "parser.y" { namespace_t name_ns = {ACCESS_PACKAGE, ""}; multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)}; @@ -5425,22 +3714,22 @@ - case 98: + case 94: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2359 "parser.y" +#line 713 "parser.y" {PASS12 new_state();state->exception_name=0;} } break; - case 99: + case 95: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2359 "parser.y" +#line 713 "parser.y" { (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code), state->vars); if(!(yyvsp[(4) - (5)].code)) { @@ -5461,44 +3750,44 @@ - case 100: + case 96: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2375 "parser.y" +#line 729 "parser.y" {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));} } break; - case 101: + case 97: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2376 "parser.y" +#line 730 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));} } break; - case 102: + case 98: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2377 "parser.y" +#line 731 "parser.y" {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);} } break; - case 103: + case 99: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2378 "parser.y" +#line 732 "parser.y" { (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list); (yyval.catch_list).finally = 0; @@ -5512,11 +3801,11 @@ - case 104: + case 100: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2386 "parser.y" +#line 740 "parser.y" { (yyval.catch_list).l=list_new(); (yyval.catch_list).finally = 0; @@ -5530,11 +3819,11 @@ - case 105: + case 101: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2395 "parser.y" +#line 749 "parser.y" {PASS12 new_state(); state->method->has_exceptions=1; state->method->late_binding=1;//for invariant scope_code @@ -5544,11 +3833,11 @@ - case 106: + case 102: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2398 "parser.y" +#line 752 "parser.y" { code_t*out = abc_nop(0); @@ -5571,7 +3860,7 @@ (yyval.code) = code_append((yyval.code), e->target); (yyval.code) = abc_jump((yyval.code), out); } else { - parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally); + as3_assert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally); // finally block e->target = (yyval.code) = abc_nop((yyval.code)); (yyval.code) = code_append((yyval.code), code_dup(state->method->scope_code)); @@ -5597,11 +3886,11 @@ - case 107: + case 103: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2444 "parser.y" +#line 798 "parser.y" { (yyval.code)=(yyvsp[(2) - (2)].value).c; (yyval.code)=abc_throw((yyval.code)); @@ -5611,11 +3900,11 @@ - case 108: + case 104: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2448 "parser.y" +#line 803 "parser.y" { if(!state->exception_name) syntaxerror("re-throw only possible within a catch block"); @@ -5629,11 +3918,11 @@ - case 109: + case 105: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2459 "parser.y" +#line 814 "parser.y" { new_state(); if(state->method->has_exceptions) { @@ -5649,11 +3938,11 @@ - case 110: + case 106: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2469 "parser.y" +#line 824 "parser.y" { /* remove getlocal;pushwith from scope code again */ state->method->scope_code = code_cutlast(code_cutlast(state->method->scope_code)); @@ -5673,121 +3962,110 @@ - case 112: + case 108: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2487 "parser.y" +#line 842 "parser.y" {PASS12 (yyval.id)="package";} } break; - case 113: + case 109: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2488 "parser.y" +#line 843 "parser.y" {PASS12 (yyval.id)="namespace";} } break; - case 114: + case 110: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2489 "parser.y" +#line 844 "parser.y" {PASS12 (yyval.id)="NaN";} } break; - case 115: - if(as3_pass==2) { - -/* Line 1464 of skeleton.m4 */ -#line 2490 "parser.y" - {PASS12 (yyval.id)=(yyvsp[(1) - (1)].id);} - } - break; - - - - case 116: + case 111: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2492 "parser.y" +#line 846 "parser.y" {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;} } break; - case 117: + case 112: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2493 "parser.y" +#line 847 "parser.y" {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));} } break; - case 118: + case 113: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2495 "parser.y" +#line 849 "parser.y" {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;} } break; - case 119: + case 114: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2496 "parser.y" +#line 850 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; - case 120: + case 115: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2497 "parser.y" +#line 851 "parser.y" {PASS12 startpackage("");} } break; - case 121: + case 116: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2498 "parser.y" +#line 852 "parser.y" {PASS12 endpackage();(yyval.code)=0;} } break; - case 122: + case 117: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2521 "parser.y" +#line 875 "parser.y" { PASS12 slotinfo_t*s = registry_find(state->package, (yyvsp[(2) - (2)].id)); @@ -5801,17 +4079,20 @@ - case 123: + case 118: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2529 "parser.y" +#line 883 "parser.y" { PASS12 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name); - if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) { + if(!s && as3_pass==1) { as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name); } + /*if(s && s->kind == INFOTYPE_VAR && TYPE_IS_NAMESPACE(s->type)) { + trie_put(active_namespaces, (unsigned char*)$2->name, 0); + }*/ state_has_imports(); dict_put(state->imports, (yyvsp[(2) - (2)].classinfo)->name, (yyvsp[(2) - (2)].classinfo)); import_toplevel((yyvsp[(2) - (2)].classinfo)->package); @@ -5822,11 +4103,11 @@ - case 124: + case 119: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2540 "parser.y" +#line 897 "parser.y" { PASS12 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6) && as3_pass==1) { @@ -5845,44 +4126,44 @@ - case 125: + case 120: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2556 "parser.y" +#line 913 "parser.y" {PASS12 (yyval.flags).flags=0;(yyval.flags).ns=0;} } break; - case 126: + case 121: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2557 "parser.y" +#line 914 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; - case 127: + case 122: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2558 "parser.y" +#line 915 "parser.y" {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);} } break; - case 128: + case 123: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2559 "parser.y" +#line 916 "parser.y" { PASS12 (yyval.flags).flags=(yyvsp[(1) - (2)].flags).flags|(yyvsp[(2) - (2)].flags).flags; @@ -5895,211 +4176,198 @@ - case 129: + case 124: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2566 "parser.y" +#line 923 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PUBLIC;(yyval.flags).ns=0;} } break; - case 130: + case 125: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2567 "parser.y" +#line 924 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PRIVATE;(yyval.flags).ns=0;} } break; - case 131: + case 126: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2568 "parser.y" +#line 925 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PROTECTED;(yyval.flags).ns=0;} } break; - case 132: + case 127: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2569 "parser.y" +#line 926 "parser.y" {PASS12 (yyval.flags).flags=FLAG_STATIC;(yyval.flags).ns=0;} } break; - case 133: + case 128: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2570 "parser.y" +#line 927 "parser.y" {PASS12 (yyval.flags).flags=FLAG_DYNAMIC;(yyval.flags).ns=0;} } break; - case 134: + case 129: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2571 "parser.y" +#line 928 "parser.y" {PASS12 (yyval.flags).flags=FLAG_FINAL;(yyval.flags).ns=0;} } break; - case 135: + case 130: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2572 "parser.y" +#line 929 "parser.y" {PASS12 (yyval.flags).flags=FLAG_OVERRIDE;(yyval.flags).ns=0;} } break; - case 136: + case 131: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2573 "parser.y" +#line 930 "parser.y" {PASS12 (yyval.flags).flags=FLAG_NATIVE;(yyval.flags).ns=0;} } break; - case 137: + case 132: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2574 "parser.y" +#line 931 "parser.y" {PASS12 (yyval.flags).flags=FLAG_PACKAGEINTERNAL;(yyval.flags).ns=0;} } break; - case 138: - if(as3_pass==2) { - -/* Line 1464 of skeleton.m4 */ -#line 2575 "parser.y" - {PASS12 (yyval.flags).flags=FLAG_NAMESPACE; - (yyval.flags).ns=(yyvsp[(1) - (1)].id); - } - } - break; - - - - case 139: + case 133: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2579 "parser.y" +#line 938 "parser.y" {PASS12 (yyval.classinfo)=0;} } break; - case 140: + case 134: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2580 "parser.y" +#line 939 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; - case 141: + case 135: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2582 "parser.y" +#line 941 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; - case 142: + case 136: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2583 "parser.y" +#line 942 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; - case 143: + case 137: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2585 "parser.y" +#line 944 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();} } break; - case 144: + case 138: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2586 "parser.y" +#line 945 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);} } break; - case 145: + case 139: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2590 "parser.y" +#line 949 "parser.y" {PASS12 startclass(&(yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));} } break; - case 146: + case 140: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2592 "parser.y" +#line 951 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; - case 147: + case 141: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2596 "parser.y" +#line 955 "parser.y" {PASS12 (yyvsp[(1) - (5)].flags).flags|=FLAG_INTERFACE; startclass(&(yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));} } @@ -6107,33 +4375,33 @@ - case 148: + case 142: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2599 "parser.y" +#line 958 "parser.y" {PASS12 endclass();(yyval.code)=0;} } break; - case 154: + case 150: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2608 "parser.y" - {PASS_ALWAYS as3_pass=(yyvsp[(1) - (4)].number_int);} +#line 970 "parser.y" + {PASS_ALWAYS as3_pass=(yyvsp[(2) - (4)].number_int);PASS1 as3_warning("embed command ignored");} } break; - case 157: + case 151: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2612 "parser.y" +#line 972 "parser.y" { code_t*c = state->cls->static_init->header; c = code_append(c, (yyvsp[(1) - (1)].code)); @@ -6144,11 +4412,11 @@ - case 163: + case 157: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2623 "parser.y" +#line 983 "parser.y" { syntaxerror("variable declarations not allowed in interfaces"); } @@ -6157,11 +4425,11 @@ - case 164: + case 158: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2626 "parser.y" +#line 986 "parser.y" { PASS12 (yyvsp[(1) - (8)].flags).flags |= FLAG_PUBLIC; @@ -6177,55 +4445,55 @@ - case 167: + case 161: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2701 "parser.y" +#line 1061 "parser.y" {PASS12 setslotstate(&(yyvsp[(1) - (2)].flags),(yyvsp[(2) - (2)].token));} } break; - case 168: + case 162: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2701 "parser.y" +#line 1061 "parser.y" {PASS12 (yyval.code)=(yyvsp[(4) - (4)].code);setslotstate(0, 0);} } break; - case 169: + case 163: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2703 "parser.y" +#line 1063 "parser.y" {PASS12 (yyval.code)=0;} } break; - case 170: + case 164: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2704 "parser.y" +#line 1064 "parser.y" {PASS12 (yyval.code)=0;} } break; - case 171: + case 165: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2707 "parser.y" +#line 1067 "parser.y" { PASS12 int flags = slotstate_flags->flags; @@ -6235,11 +4503,11 @@ varinfo_t* info = 0; if(state->cls) { - memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1); + memberinfo_t*i = registry_findmember(state->cls->info, ns.name, (yyvsp[(1) - (3)].id), 1, slotstate_flags->flags&FLAG_STATIC); if(i) { check_override(i, flags); } - info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id)); + info = varinfo_register_onclass(state->cls->info, ns.access, ns.name, (yyvsp[(1) - (3)].id), slotstate_flags->flags&FLAG_STATIC); } else { slotinfo_t*i = registry_find(state->package, (yyvsp[(1) - (3)].id)); if(i) { @@ -6311,22 +4579,22 @@ - case 172: + case 166: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2790 "parser.y" +#line 1150 "parser.y" {(yyval.constant)=0;} } break; - case 173: + case 167: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2791 "parser.y" +#line 1151 "parser.y" { (yyval.constant) = malloc(sizeof(constant_t)); *(yyval.constant) = node_eval((yyvsp[(2) - (2)].node)); @@ -6339,22 +4607,22 @@ - case 174: + case 168: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2800 "parser.y" +#line 1159 "parser.y" {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));} } break; - case 175: + case 169: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2801 "parser.y" +#line 1160 "parser.y" { (yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint)); } @@ -6363,88 +4631,88 @@ - case 176: + case 170: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2804 "parser.y" +#line 1163 "parser.y" {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));} } break; - case 177: + case 171: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2805 "parser.y" +#line 1164 "parser.y" {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);} } break; - case 178: + case 172: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2806 "parser.y" +#line 1165 "parser.y" {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));} } break; - case 179: + case 173: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2807 "parser.y" +#line 1166 "parser.y" {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));} } break; - case 180: + case 174: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2808 "parser.y" +#line 1167 "parser.y" {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));} } break; - case 181: + case 175: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2809 "parser.y" +#line 1168 "parser.y" {(yyval.constant) = constant_new_undefined((yyvsp[(1) - (1)].token));} } break; - case 182: + case 176: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2810 "parser.y" +#line 1169 "parser.y" {(yyval.constant) = constant_new_float(__builtin_nan(""));} } break; - case 183: + case 177: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2823 "parser.y" +#line 1177 "parser.y" { multiname_t m = {QNAME, &stdns, 0, "XML"}; typedcode_t v; @@ -6460,55 +4728,55 @@ - case 184: + case 178: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2834 "parser.y" +#line 1188 "parser.y" {PASS_ALWAYS if(!xml_level++) tokenizer_begin_xml();} } break; - case 185: + case 179: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2835 "parser.y" +#line 1189 "parser.y" {PASS_ALWAYS tokenizer_begin_xmltext();} } break; - case 186: + case 180: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2836 "parser.y" +#line 1190 "parser.y" {PASS_ALWAYS if(!--xml_level) tokenizer_end_xml(); else tokenizer_begin_xmltext();} } break; - case 187: + case 181: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2838 "parser.y" +#line 1192 "parser.y" {PASS_ALWAYS tokenizer_begin_xmltext();} } break; - case 188: + case 182: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2838 "parser.y" +#line 1192 "parser.y" { (yyval.node) = (yyvsp[(2) - (4)].node); } @@ -6517,22 +4785,22 @@ - case 189: + case 183: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2841 "parser.y" +#line 1195 "parser.y" {PASS_ALWAYS tokenizer_begin_xml();} } break; - case 190: + case 184: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2841 "parser.y" +#line 1195 "parser.y" { (yyval.node) = (yyvsp[(2) - (4)].node); } @@ -6541,22 +4809,22 @@ - case 191: + case 185: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2844 "parser.y" +#line 1198 "parser.y" {(yyval.node)=mkstringnode("");} } break; - case 192: + case 186: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2845 "parser.y" +#line 1199 "parser.y" { (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node)); } @@ -6565,11 +4833,11 @@ - case 193: + case 187: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2848 "parser.y" +#line 1202 "parser.y" { char* str = string_cstr(&(yyvsp[(2) - (2)].str)); (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node),mkstringnode(str)); @@ -6580,11 +4848,11 @@ - case 194: + case 188: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2853 "parser.y" +#line 1207 "parser.y" { (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node), mkstringnode(">")); } @@ -6593,11 +4861,11 @@ - case 195: + case 189: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2856 "parser.y" +#line 1210 "parser.y" { (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node),(yyvsp[(2) - (2)].node)); } @@ -6606,11 +4874,11 @@ - case 196: + case 190: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2859 "parser.y" +#line 1213 "parser.y" { (yyval.node) = mkaddnode((yyvsp[(1) - (3)].node), mkaddnode((yyvsp[(2) - (3)].node),(yyvsp[(3) - (3)].node))); } @@ -6619,11 +4887,11 @@ - case 197: + case 191: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2862 "parser.y" +#line 1216 "parser.y" { (yyval.node) = mkstringnode((yyvsp[(1) - (1)].id)); } @@ -6632,11 +4900,11 @@ - case 198: + case 192: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2865 "parser.y" +#line 1219 "parser.y" { (yyval.node) = (yyvsp[(1) - (1)].node); } @@ -6645,11 +4913,11 @@ - case 199: + case 193: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2869 "parser.y" +#line 1223 "parser.y" { (yyval.node) = mkstringnode(""); } @@ -6658,11 +4926,11 @@ - case 200: + case 194: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2872 "parser.y" +#line 1226 "parser.y" { (yyval.node) = mkaddnode(mkstringnode(" "),(yyvsp[(1) - (1)].node)); } @@ -6671,11 +4939,11 @@ - case 201: + case 195: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2876 "parser.y" +#line 1230 "parser.y" { //$$ = allocprintf("<%s%s/>", $2, $3, $5, $8); (yyval.node) = mkaddnode(mkaddnode(mkaddnode(mkstringnode("<"),(yyvsp[(2) - (6)].node)),(yyvsp[(3) - (6)].node)),mkstringnode("/>")); @@ -6685,11 +4953,11 @@ - case 202: + case 196: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2880 "parser.y" +#line 1234 "parser.y" { //$$ = allocprintf("<%s%s>%s", $2, $3, $5, $8); (yyval.node) = mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode( @@ -6700,11 +4968,11 @@ - case 203: + case 197: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2885 "parser.y" +#line 1239 "parser.y" { //$$ = allocprintf("<%s%s>%s%s", $2, $3, $5, $6, $9); (yyval.node) = mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode(mkaddnode( @@ -6715,11 +4983,11 @@ - case 204: + case 198: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2891 "parser.y" +#line 1245 "parser.y" { (yyval.node) = (yyvsp[(1) - (1)].node); } @@ -6728,11 +4996,11 @@ - case 205: + case 199: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2894 "parser.y" +#line 1248 "parser.y" { (yyval.node) = mkaddnode((yyvsp[(1) - (2)].node), mkaddnode(mkstringnode(" "),(yyvsp[(2) - (2)].node))); } @@ -6741,11 +5009,11 @@ - case 206: + case 200: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2897 "parser.y" +#line 1251 "parser.y" { (yyval.node) = (yyvsp[(1) - (1)].node); } @@ -6754,11 +5022,11 @@ - case 207: + case 201: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2900 "parser.y" +#line 1254 "parser.y" { char* str = string_cstr(&(yyvsp[(3) - (3)].str)); (yyval.node) = mkaddnode((yyvsp[(1) - (3)].node), mkstringnode(concat2("=",str))); @@ -6769,11 +5037,11 @@ - case 208: + case 202: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2905 "parser.y" +#line 1259 "parser.y" { (yyval.node) = mkaddnode((yyvsp[(1) - (3)].node), mkaddnode(mkstringnode("=\""), mkaddnode((yyvsp[(3) - (3)].node), mkstringnode("\"")))); } @@ -6782,11 +5050,11 @@ - case 209: + case 203: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2908 "parser.y" +#line 1262 "parser.y" { (yyval.node) = mkaddnode(mkaddnode(mkstringnode(concat2((yyvsp[(1) - (3)].id),"=\"")), (yyvsp[(3) - (3)].node)), mkstringnode("\"")); } @@ -6795,11 +5063,11 @@ - case 210: + case 204: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2911 "parser.y" +#line 1265 "parser.y" { char* str = string_cstr(&(yyvsp[(3) - (3)].str)); (yyval.node)=mkstringnode(allocprintf("%s=%s", (yyvsp[(1) - (3)].id),str)); @@ -6811,11 +5079,11 @@ - case 211: + case 205: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2921 "parser.y" +#line 1275 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6825,11 +5093,11 @@ - case 212: + case 206: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2925 "parser.y" +#line 1279 "parser.y" { PASS12 (yyval.params)=(yyvsp[(1) - (1)].params); @@ -6839,11 +5107,11 @@ - case 213: + case 207: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2931 "parser.y" +#line 1285 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6855,11 +5123,11 @@ - case 214: + case 208: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2937 "parser.y" +#line 1291 "parser.y" { PASS12 (yyval.params) =(yyvsp[(1) - (4)].params); @@ -6871,11 +5139,11 @@ - case 215: + case 209: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2945 "parser.y" +#line 1299 "parser.y" { PASS12 (yyval.params) = (yyvsp[(1) - (3)].params); @@ -6886,11 +5154,11 @@ - case 216: + case 210: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2950 "parser.y" +#line 1304 "parser.y" { PASS12 memset(&(yyval.params),0,sizeof((yyval.params))); @@ -6901,11 +5169,11 @@ - case 217: + case 211: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2956 "parser.y" +#line 1310 "parser.y" { PASS12 (yyval.param) = rfx_calloc(sizeof(param_t)); @@ -6919,11 +5187,11 @@ - case 218: + case 212: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2964 "parser.y" +#line 1318 "parser.y" { PASS12 (yyval.param) = rfx_calloc(sizeof(param_t)); @@ -6937,33 +5205,33 @@ - case 221: + case 215: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2974 "parser.y" +#line 1328 "parser.y" {PASS12 (yyval.token)=0;} } break; - case 222: + case 216: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2977 "parser.y" +#line 1331 "parser.y" {PASS12 startfunction(&(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));} } break; - case 223: + case 217: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2978 "parser.y" +#line 1332 "parser.y" { PASS1 endfunction(&(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0); @@ -6983,33 +5251,33 @@ - case 225: + case 219: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2994 "parser.y" +#line 1348 "parser.y" {PASS12 (yyval.id)=0;} } break; - case 226: + case 220: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2996 "parser.y" +#line 1350 "parser.y" {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));} } break; - case 227: + case 221: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 2997 "parser.y" +#line 1351 "parser.y" { PASS1 endfunction(0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0); @@ -7033,11 +5301,11 @@ - case 228: + case 222: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3019 "parser.y" +#line 1373 "parser.y" { PASS1 NEW(unresolvedinfo_t,c); memset(c, 0, sizeof(*c)); @@ -7055,17 +5323,18 @@ slotinfo_t*s = find_class((yyvsp[(1) - (1)].id)); if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package); (yyval.classinfo) = (classinfo_t*)s; + registry_use(s); } } break; - case 229: + case 223: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3038 "parser.y" +#line 1393 "parser.y" { PASS1 NEW(unresolvedinfo_t,c); memset(c, 0, sizeof(*c)); @@ -7078,127 +5347,128 @@ if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id)); free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0; (yyval.classinfo) = (classinfo_t*)s; + registry_use(s); } } break; - case 232: + case 226: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3055 "parser.y" +#line 1411 "parser.y" {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));} } break; - case 233: + case 227: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3056 "parser.y" +#line 1412 "parser.y" {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));} } break; - case 234: + case 228: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3058 "parser.y" +#line 1414 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);} } break; - case 235: + case 229: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3059 "parser.y" +#line 1415 "parser.y" {PASS12 (yyval.classinfo)=TYPE_ANY;} } break; - case 236: + case 230: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3060 "parser.y" +#line 1416 "parser.y" {PASS12 (yyval.classinfo)=TYPE_VOID;} } break; - case 237: + case 231: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3069 "parser.y" +#line 1425 "parser.y" {PASS12 (yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);} } break; - case 238: + case 232: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3070 "parser.y" +#line 1426 "parser.y" {PASS12 (yyval.classinfo)=0;} } break; - case 239: + case 233: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3074 "parser.y" +#line 1430 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; - case 240: + case 234: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3075 "parser.y" +#line 1431 "parser.y" {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);} } break; - case 241: + case 235: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3077 "parser.y" +#line 1433 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; - case 244: + case 238: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3081 "parser.y" +#line 1437 "parser.y" {(yyval.value_list).number=1; (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c; } @@ -7207,22 +5477,22 @@ - case 245: + case 239: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3085 "parser.y" +#line 1441 "parser.y" {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);} } break; - case 246: + case 240: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3086 "parser.y" +#line 1442 "parser.y" { (yyval.value_list).number= (yyvsp[(1) - (2)].value_list).number+1; (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c); @@ -7232,11 +5502,11 @@ - case 248: + case 242: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3092 "parser.y" +#line 1448 "parser.y" { typedcode_t v = node_read((yyvsp[(2) - (4)].node)); (yyval.value).c = v.c; @@ -7249,6 +5519,9 @@ (yyval.value).c = code_append((yyval.value).c, paramcode); (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).number); multiname_destroy(name); + } else if(is_getlocal((yyval.value).c)) { + (yyval.value).c = code_append((yyval.value).c, paramcode); + (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).number); } else if(TYPE_IS_CLASS(v.t) && v.t->data) { code_free((yyval.value).c); classinfo_t*c = v.t->data; @@ -7281,11 +5554,11 @@ - case 249: + case 243: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3136 "parser.y" +#line 1495 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (4)].node)); @@ -7340,11 +5613,11 @@ - case 250: + case 244: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3186 "parser.y" +#line 1545 "parser.y" { if(!state->cls) syntaxerror("super() not allowed outside of a class"); if(!state->method) syntaxerror("super() not allowed outside of a function"); @@ -7370,11 +5643,11 @@ - case 251: + case 245: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3207 "parser.y" +#line 1566 "parser.y" { typedcode_t v = node_read((yyvsp[(2) - (2)].node)); (yyval.value).c = v.c; @@ -7401,11 +5674,11 @@ - case 252: + case 246: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3229 "parser.y" +#line 1588 "parser.y" { (yyval.code) = abc_returnvoid(0); } @@ -7414,11 +5687,11 @@ - case 253: + case 247: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3232 "parser.y" +#line 1591 "parser.y" { (yyval.code) = (yyvsp[(2) - (2)].value).c; (yyval.code) = abc_returnvalue((yyval.code)); @@ -7428,11 +5701,11 @@ - case 254: + case 248: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3239 "parser.y" +#line 1598 "parser.y" { (yyval.value) = node_read((yyvsp[(1) - (1)].node)); } @@ -7441,11 +5714,11 @@ - case 255: + case 249: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3242 "parser.y" +#line 1601 "parser.y" { (yyval.value) = node_read((yyvsp[(1) - (1)].node)); } @@ -7454,11 +5727,11 @@ - case 256: + case 250: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3245 "parser.y" +#line 1604 "parser.y" { (yyval.node) = mkmultinode(&node_comma, (yyvsp[(1) - (1)].node)); } @@ -7467,11 +5740,11 @@ - case 257: + case 251: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3248 "parser.y" +#line 1607 "parser.y" { (yyval.node) = multinode_extend((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } @@ -7480,11 +5753,11 @@ - case 258: + case 252: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3251 "parser.y" +#line 1610 "parser.y" { (yyval.code) = node_exec((yyvsp[(1) - (1)].node)); } @@ -7493,11 +5766,11 @@ - case 259: + case 253: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3254 "parser.y" +#line 1613 "parser.y" { (yyval.code) = (yyvsp[(1) - (3)].code); (yyval.code) = code_append((yyval.code), node_exec((yyvsp[(3) - (3)].node))); @@ -7507,88 +5780,88 @@ - case 260: + case 254: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3259 "parser.y" +#line 1618 "parser.y" {(yyval.value_list).cc=0;(yyval.value_list).number=0;} } break; - case 261: + case 255: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3260 "parser.y" +#line 1619 "parser.y" {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);} } break; - case 262: + case 256: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3262 "parser.y" +#line 1621 "parser.y" {(yyval.code)=abc_pushstring(0,(yyvsp[(1) - (1)].id));} } break; - case 263: + case 257: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3263 "parser.y" +#line 1622 "parser.y" {(yyval.code)=abc_pushstring2(0,&(yyvsp[(1) - (1)].str));} } break; - case 264: + case 258: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3264 "parser.y" +#line 1623 "parser.y" {syntaxerror("dictionary keys must be strings");} } break; - case 265: + case 259: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3265 "parser.y" +#line 1624 "parser.y" {syntaxerror("dictionary keys must be strings");} } break; - case 266: + case 260: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3266 "parser.y" +#line 1625 "parser.y" {syntaxerror("dictionary keys must be strings");} } break; - case 267: + case 261: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3268 "parser.y" +#line 1627 "parser.y" { (yyval.value_list).cc = 0; (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].code)); @@ -7600,11 +5873,11 @@ - case 268: + case 262: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3274 "parser.y" +#line 1633 "parser.y" { (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc; (yyval.value_list).number = (yyvsp[(1) - (5)].value_list).number+2; @@ -7616,77 +5889,77 @@ - case 269: + case 263: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3283 "parser.y" +#line 1642 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; - case 270: + case 264: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3284 "parser.y" +#line 1643 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; - case 271: + case 265: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3285 "parser.y" +#line 1644 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; - case 272: + case 266: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3286 "parser.y" +#line 1645 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; - case 273: + case 267: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3287 "parser.y" +#line 1646 "parser.y" {(yyval.node) = mkcodenode((yyvsp[(1) - (1)].value));} } break; - case 274: + case 268: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3288 "parser.y" +#line 1647 "parser.y" {(yyval.node) = (yyvsp[(1) - (1)].node);} } break; - case 275: + case 269: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3290 "parser.y" +#line 1649 "parser.y" { (yyval.node) = mkconstnode((yyvsp[(1) - (1)].constant)); } @@ -7695,11 +5968,11 @@ - case 276: + case 270: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3294 "parser.y" +#line 1653 "parser.y" { (yyval.node) = (yyvsp[(1) - (1)].node); } @@ -7708,11 +5981,11 @@ - case 277: + case 271: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3299 "parser.y" +#line 1658 "parser.y" { typedcode_t v; v.c = 0; @@ -7735,11 +6008,11 @@ - case 278: + case 272: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3317 "parser.y" +#line 1676 "parser.y" { PASS1 state->method->need_arguments = 1; @@ -7754,11 +6027,11 @@ - case 279: + case 273: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3328 "parser.y" +#line 1687 "parser.y" { typedcode_t v; v.c = code_new(); @@ -7772,11 +6045,11 @@ - case 280: + case 274: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3338 "parser.y" +#line 1697 "parser.y" { typedcode_t v; v.c = code_new(); @@ -7790,566 +6063,566 @@ - case 281: + case 275: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3347 "parser.y" +#line 1706 "parser.y" {(yyval.node) = mknode2(&node_lt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 282: + case 276: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3348 "parser.y" +#line 1707 "parser.y" {(yyval.node) = mknode2(&node_gt,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 283: + case 277: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3349 "parser.y" +#line 1708 "parser.y" {(yyval.node) = mknode2(&node_le,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 284: + case 278: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3350 "parser.y" +#line 1709 "parser.y" {(yyval.node) = mknode2(&node_ge,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 285: + case 279: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3351 "parser.y" +#line 1710 "parser.y" {(yyval.node) = mknode2(&node_eqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 286: + case 280: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3352 "parser.y" +#line 1711 "parser.y" {(yyval.node) = mknode2(&node_eqeqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 287: + case 281: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3353 "parser.y" +#line 1712 "parser.y" {(yyval.node) = mknode2(&node_noteqeq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 288: + case 282: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3354 "parser.y" +#line 1713 "parser.y" {(yyval.node) = mknode2(&node_noteq,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 289: + case 283: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3355 "parser.y" +#line 1714 "parser.y" {(yyval.node) = mknode2(&node_oror,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 290: + case 284: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3356 "parser.y" +#line 1715 "parser.y" {(yyval.node) = mknode2(&node_andand,(yyvsp[(1) - (3)].node),(yyvsp[(3) - (3)].node));} } break; - case 291: + case 285: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3357 "parser.y" +#line 1716 "parser.y" {(yyval.node) = mknode1(&node_not, (yyvsp[(2) - (2)].node));} } break; - case 292: + case 286: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3358 "parser.y" +#line 1717 "parser.y" {(yyval.node) = mknode1(&node_bitnot, (yyvsp[(2) - (2)].node));} } break; - case 293: + case 287: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3359 "parser.y" +#line 1718 "parser.y" {(yyval.node) = mknode2(&node_bitand, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 294: + case 288: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3360 "parser.y" +#line 1719 "parser.y" {(yyval.node) = mknode2(&node_bitxor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 295: + case 289: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3361 "parser.y" +#line 1720 "parser.y" {(yyval.node) = mknode2(&node_bitor, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 296: + case 290: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3362 "parser.y" +#line 1721 "parser.y" {(yyval.node) = mknode2(&node_shr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 297: + case 291: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3363 "parser.y" +#line 1722 "parser.y" {(yyval.node) = mknode2(&node_ushr, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 298: + case 292: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3364 "parser.y" +#line 1723 "parser.y" {(yyval.node) = mknode2(&node_shl, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 299: + case 293: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3365 "parser.y" +#line 1724 "parser.y" {(yyval.node) = mknode2(&node_div, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 300: + case 294: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3366 "parser.y" +#line 1725 "parser.y" {(yyval.node) = mknode2(&node_mod, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 301: + case 295: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3367 "parser.y" +#line 1726 "parser.y" {(yyval.node) = mknode2(&node_plus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 302: + case 296: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3368 "parser.y" +#line 1727 "parser.y" {(yyval.node) = mknode2(&node_minus, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 303: + case 297: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3369 "parser.y" +#line 1728 "parser.y" {(yyval.node) = mknode2(&node_multiply, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 304: + case 298: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3370 "parser.y" +#line 1729 "parser.y" {(yyval.node) = mknode2(&node_in, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 305: + case 299: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3371 "parser.y" +#line 1730 "parser.y" {(yyval.node) = mknode2(&node_as, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 306: + case 300: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3372 "parser.y" +#line 1731 "parser.y" {(yyval.node) = mknode2(&node_instanceof, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 307: + case 301: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3373 "parser.y" +#line 1732 "parser.y" {(yyval.node) = mknode2(&node_is, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 308: + case 302: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3374 "parser.y" +#line 1733 "parser.y" {(yyval.node) = mknode1(&node_typeof, (yyvsp[(2) - (2)].node));} } break; - case 309: + case 303: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3375 "parser.y" +#line 1734 "parser.y" {(yyval.node) = mknode1(&node_void, (yyvsp[(2) - (2)].node));} } break; - case 310: + case 304: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3376 "parser.y" +#line 1735 "parser.y" { (yyval.node) = mkconstnode(constant_new_undefined());} } break; - case 311: + case 305: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3377 "parser.y" +#line 1736 "parser.y" { (yyval.node)=(yyvsp[(2) - (3)].node);} } break; - case 312: + case 306: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3378 "parser.y" +#line 1737 "parser.y" {(yyval.node) = mknode1(&node_neg, (yyvsp[(2) - (2)].node));} } break; - case 313: + case 307: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3379 "parser.y" +#line 1738 "parser.y" {(yyval.node) = mknode2(&node_arraylookup, (yyvsp[(1) - (4)].node),(yyvsp[(3) - (4)].node));} } break; - case 314: + case 308: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3380 "parser.y" +#line 1739 "parser.y" {(yyval.node) = mknode2(&node_muleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 315: + case 309: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3381 "parser.y" +#line 1740 "parser.y" {(yyval.node) = mknode2(&node_modeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 316: + case 310: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3382 "parser.y" +#line 1741 "parser.y" {(yyval.node) = mknode2(&node_shleq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 317: + case 311: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3383 "parser.y" +#line 1742 "parser.y" {(yyval.node) = mknode2(&node_shreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 318: + case 312: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3384 "parser.y" +#line 1743 "parser.y" {(yyval.node) = mknode2(&node_ushreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 319: + case 313: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3385 "parser.y" +#line 1744 "parser.y" { (yyval.node) = mknode2(&node_diveq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 320: + case 314: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3386 "parser.y" +#line 1745 "parser.y" { (yyval.node) = mknode2(&node_bitoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 321: + case 315: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3387 "parser.y" +#line 1746 "parser.y" { (yyval.node) = mknode2(&node_bitxoreq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 322: + case 316: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3388 "parser.y" +#line 1747 "parser.y" { (yyval.node) = mknode2(&node_bitandeq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 323: + case 317: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3389 "parser.y" +#line 1748 "parser.y" { (yyval.node) = mknode2(&node_pluseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 324: + case 318: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3390 "parser.y" +#line 1749 "parser.y" { (yyval.node) = mknode2(&node_minuseq, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 325: + case 319: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3391 "parser.y" +#line 1750 "parser.y" { (yyval.node) = mknode2(&node_assign, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));} } break; - case 326: + case 320: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3392 "parser.y" +#line 1751 "parser.y" { (yyval.node) = mknode3(&node_tenary, (yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));} } break; - case 327: + case 321: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3394 "parser.y" +#line 1753 "parser.y" { (yyval.node) = mknode1(&node_rplusplus, (yyvsp[(1) - (2)].node));} } break; - case 328: + case 322: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3395 "parser.y" +#line 1754 "parser.y" { (yyval.node) = mknode1(&node_rminusminus, (yyvsp[(1) - (2)].node));} } break; - case 329: + case 323: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3396 "parser.y" +#line 1755 "parser.y" {(yyval.node) = mknode1(&node_lplusplus, (yyvsp[(2) - (2)].node)); } } break; - case 330: + case 324: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3397 "parser.y" +#line 1756 "parser.y" {(yyval.node) = mknode1(&node_lminusminus, (yyvsp[(2) - (2)].node)); } } break; - case 331: + case 325: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3400 "parser.y" +#line 1759 "parser.y" { if(!state->cls->info) syntaxerror("super keyword not allowed outside a class"); classinfo_t*t = state->cls->info->superclass; if(!t) t = TYPE_OBJECT; - memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1); + memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1, 0); MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id)); typedcode_t v; v.c = 0; @@ -8363,11 +6636,11 @@ - case 332: + case 326: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3414 "parser.y" +#line 1773 "parser.y" { typedcode_t v; multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(2) - (2)].id)}; @@ -8380,22 +6653,22 @@ - case 333: + case 327: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3422 "parser.y" +#line 1781 "parser.y" {PASS12 new_state();state->xmlfilter=1;} } break; - case 334: + case 328: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3422 "parser.y" +#line 1781 "parser.y" { PASS1 old_state(); PASS2 @@ -8454,71 +6727,63 @@ - case 335: + case 329: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3476 "parser.y" - {(yyval.id)=(yyvsp[(1) - (1)].id);} +#line 1836 "parser.y" + {(yyval.id)="*";} } break; - case 336: + case 331: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3477 "parser.y" +#line 1839 "parser.y" {(yyval.id)="*";} } break; - case 337: + case 332: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3478 "parser.y" - {(yyval.id)=(char*)(yyvsp[(1) - (1)].id);} +#line 1880 "parser.y" + { +} } break; - case 339: + case 333: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3480 "parser.y" - {(yyval.id)="*";} +#line 1883 "parser.y" + { + (yyval.node) = get_descendants((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(5) - (5)].id), 0, 0); +} } break; - case 340: + case 334: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3488 "parser.y" +#line 1886 "parser.y" { - typedcode_t v = node_read((yyvsp[(1) - (5)].node)); - typedcode_t w = node_read(resolve_identifier((yyvsp[(3) - (5)].id))); - v.c = code_append(v.c, w.c); - if(!TYPE_IS_NAMESPACE(w.t)) { - as3_softwarning("%s might not be a namespace", (yyvsp[(3) - (5)].id)); - } - v.c = converttype(v.c, w.t, TYPE_NAMESPACE); - multiname_t m = {RTQNAME, 0, 0, (yyvsp[(5) - (5)].id)}; - v.c = abc_getproperty2(v.c, &m); - if(TYPE_IS_XML(v.t)) { - v.t = TYPE_XMLLIST; - } else { - v.c = abc_coerce_a(v.c); - v.t = TYPE_ANY; - } + typedcode_t v = node_read((yyvsp[(1) - (3)].node)); + multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)}; + v.c = abc_getdescendants2(v.c, &m); + v.t = TYPE_XMLLIST; (yyval.node) = mkcodenode(v); } } @@ -8526,28 +6791,24 @@ - case 341: + case 335: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3506 "parser.y" +#line 1893 "parser.y" { - typedcode_t v = node_read((yyvsp[(1) - (3)].node)); - multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)}; - v.c = abc_getdescendants2(v.c, &m); - v.t = TYPE_XMLLIST; - (yyval.node) = mkcodenode(v); + (yyval.node) = get_descendants((yyvsp[(1) - (5)].node), (yyvsp[(3) - (5)].id), (yyvsp[(5) - (5)].id), 1, 0); } } break; - case 342: + case 336: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3513 "parser.y" +#line 1896 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (5)].node)); typedcode_t w = node_read((yyvsp[(4) - (5)].node)); @@ -8563,11 +6824,11 @@ - case 343: + case 337: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3524 "parser.y" +#line 1907 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (4)].node)); multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)}; @@ -8580,11 +6841,24 @@ - case 344: + case 338: + if(as3_pass==2) { + +/* Line 1464 of skeleton.m4 */ +#line 1915 "parser.y" + { + (yyval.node) = get_descendants((yyvsp[(1) - (6)].node), (yyvsp[(4) - (6)].id), (yyvsp[(6) - (6)].id), 0, 1); +} + } + break; + + + + case 339: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3531 "parser.y" +#line 1919 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (4)].node)); multiname_t m = {MULTINAMEA, 0, &nopackage_namespace_set, (yyvsp[(4) - (4)].id)}; @@ -8597,11 +6871,24 @@ - case 345: + case 340: + if(as3_pass==2) { + +/* Line 1464 of skeleton.m4 */ +#line 1926 "parser.y" + { + (yyval.node) = get_descendants((yyvsp[(1) - (6)].node), (yyvsp[(4) - (6)].id), (yyvsp[(6) - (6)].id), 1, 1); +} + } + break; + + + + case 341: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3538 "parser.y" +#line 1930 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (6)].node)); typedcode_t w = node_read((yyvsp[(5) - (6)].node)); @@ -8617,11 +6904,11 @@ - case 346: + case 342: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3548 "parser.y" +#line 1940 "parser.y" { typedcode_t v = node_read((yyvsp[(1) - (6)].node)); typedcode_t w = node_read((yyvsp[(5) - (6)].node)); @@ -8637,11 +6924,11 @@ - case 347: + case 343: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3559 "parser.y" +#line 1951 "parser.y" { typedcode_t v1 = node_read((yyvsp[(1) - (3)].node)); (yyval.value).c = v1.c; @@ -8651,7 +6938,7 @@ t = t->data; is_static = 1; } - if(TYPE_IS_XML(t)) { + if(TYPE_IS_XML(t) && !findmember_nsset(t, (yyvsp[(3) - (3)].id), 1, is_static)) { multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)}; (yyval.value).c = abc_getproperty2((yyval.value).c, &m); (yyval.value).c = abc_coerce_a((yyval.value).c); @@ -8660,7 +6947,7 @@ if(t->subtype==INFOTYPE_UNRESOLVED) { syntaxerror("syntaxerror: trying to resolve property '%s' on incomplete object '%s'", (yyvsp[(3) - (3)].id), t->name); } - memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1); + memberinfo_t*f = findmember_nsset(t, (yyvsp[(3) - (3)].id), 1, is_static); char noslot = 0; if(f && !is_static != !(f->flags&FLAG_STATIC)) noslot=1; @@ -8711,13 +6998,14 @@ - case 348: + case 344: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3739 "parser.y" +#line 2149 "parser.y" { PASS1 + char*name = (yyvsp[(1) - (1)].id); /* Queue unresolved identifiers for checking against the parent function's variables. We consider everything which is not a local variable "unresolved". @@ -8726,28 +7014,28 @@ would shadow those. */ - if(!find_variable(state, (yyvsp[(1) - (1)].id))) { - unknown_variable((yyvsp[(1) - (1)].id)); + if(!find_variable(state, name)) { + unknown_variable(name); /* let the compiler know that it might want to check the current directory/package for this identifier- maybe there's a file $1.as defining $1. */ - as3_schedule_class_noerror(state->package, (yyvsp[(1) - (1)].id)); + as3_schedule_class_noerror(state->package, name); } (yyval.node) = 0; PASS2 - - (yyval.node) = resolve_identifier((yyvsp[(1) - (1)].id)); + char*name = (yyvsp[(1) - (1)].id); + (yyval.node) = resolve_identifier(name); } } break; - case 349: + case 345: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3773 "parser.y" +#line 2184 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -8760,11 +7048,11 @@ - case 350: + case 346: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3780 "parser.y" +#line 2191 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -8777,11 +7065,11 @@ - case 351: + case 347: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3787 "parser.y" +#line 2198 "parser.y" { PASS12 NEW(namespace_decl_t,n); @@ -8794,14 +7082,14 @@ - case 352: + case 348: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3794 "parser.y" +#line 2205 "parser.y" { PASS12 - trie_put(active_namespaces, (yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url); + dict_put(state->namespaces, (unsigned char*)(yyvsp[(2) - (2)].namespace_decl)->name, (void*)(yyvsp[(2) - (2)].namespace_decl)->url); namespace_t access = modifiers2access(&(yyvsp[(1) - (2)].flags)); varinfo_t* var = varinfo_register_global(access.access, state->package, (yyvsp[(2) - (2)].namespace_decl)->name); @@ -8825,28 +7113,28 @@ - case 353: + case 349: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3817 "parser.y" +#line 2228 "parser.y" { - as3_warning("default xml namespaces not supported yet"); (yyval.code) = 0; + (yyval.code) = code_append((yyval.code), node_read((yyvsp[(4) - (4)].node)).c); + (yyval.code) = abc_dxnslate((yyval.code)); } } break; - case 354: + case 350: if(as3_pass==2) { /* Line 1464 of skeleton.m4 */ -#line 3822 "parser.y" +#line 2234 "parser.y" { PASS12 - const char*url = (yyvsp[(3) - (3)].classinfo)->name; varinfo_t*s = (varinfo_t*)(yyvsp[(3) - (3)].classinfo); if(s->kind == INFOTYPE_UNRESOLVED) { @@ -8859,9 +7147,9 @@ syntaxerror("%s.%s is not a public namespace (%d)", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name, s?s->kind:-1); if(!s->value || !NS_TYPE(s->value->type)) syntaxerror("%s.%s is not a namespace", (yyvsp[(3) - (3)].classinfo)->package, (yyvsp[(3) - (3)].classinfo)->name); - url = s->value->ns->name; - trie_put(active_namespaces, (yyvsp[(3) - (3)].classinfo)->name, (void*)url); + const char*url = s->value->ns->name; + dict_put(state->namespaces, (unsigned char*)(yyvsp[(3) - (3)].classinfo)->name, (void*)url); add_active_url(url); (yyval.code)=0; } @@ -8872,7 +7160,7 @@ /* Line 1464 of skeleton.m4 */ -#line 8876 "parser.tab.c" +#line 7164 "parser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff -Nru swftools-0.9.0/lib/as3/parser.tab.h swftools-0.9.2/lib/as3/parser.tab.h --- swftools-0.9.0/lib/as3/parser.tab.h 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/as3/parser.tab.h 2011-01-02 03:30:29.000000000 +0000 @@ -1,5 +1,5 @@ -/* A Bison parser, made by GNU Bison 2.4. */ +/* A Bison parser, made by GNU Bison 2.4.2. */ /* Skeleton interface for Bison's Yacc-like parsers in C @@ -40,102 +40,102 @@ know about them. */ enum yytokentype { T_IDENTIFIER = 258, - T_NAMESPACE = 259, - T_STRING = 260, - T_REGEXP = 261, - T_EMPTY = 262, - T_INT = 263, - T_UINT = 264, - T_FLOAT = 265, - T_FOR = 266, - T_WHILE = 267, - T_DO = 268, - T_SWITCH = 269, - KW_IMPLEMENTS = 270, - KW_NAMESPACE = 271, - KW_PACKAGE = 272, - KW_PROTECTED = 273, - KW_ARGUMENTS = 274, - KW_PUBLIC = 275, - KW_PRIVATE = 276, - KW_USE = 277, - KW_INTERNAL = 278, - KW_NEW = 279, - KW_NATIVE = 280, - KW_FUNCTION = 281, - KW_FINALLY = 282, - KW_UNDEFINED = 283, - KW_NAN = 284, - KW_CONTINUE = 285, - KW_CLASS = 286, - KW_CONST = 287, - KW_CATCH = 288, - KW_CASE = 289, - KW_SET = 290, - KW_VOID = 291, - KW_THROW = 292, - KW_STATIC = 293, - KW_WITH = 294, - KW_INSTANCEOF = 295, - KW_IMPORT = 296, - KW_RETURN = 297, - KW_TYPEOF = 298, - KW_INTERFACE = 299, - KW_NULL = 300, - KW_VAR = 301, - KW_DYNAMIC = 302, - KW_OVERRIDE = 303, - KW_FINAL = 304, - KW_EACH = 305, - KW_GET = 306, - KW_TRY = 307, - KW_SUPER = 308, - KW_EXTENDS = 309, - KW_FALSE = 310, - KW_TRUE = 311, - KW_BOOLEAN = 312, - KW_UINT = 313, - KW_INT = 314, - KW_NUMBER = 315, - KW_STRING = 316, - KW_DEFAULT = 317, - KW_DEFAULT_XML = 318, - KW_DELETE = 319, - KW_IF = 320, - KW_ELSE = 321, - KW_BREAK = 322, - KW_IS = 323, - KW_IN = 324, - KW_AS = 325, - T_DICTSTART = 326, - T_EQEQ = 327, - T_EQEQEQ = 328, - T_NE = 329, - T_NEE = 330, - T_LE = 331, - T_GE = 332, - T_ORBY = 333, - T_DIVBY = 334, - T_MODBY = 335, - T_MULBY = 336, - T_ANDBY = 337, - T_PLUSBY = 338, - T_MINUSBY = 339, - T_XORBY = 340, - T_SHRBY = 341, - T_SHLBY = 342, - T_USHRBY = 343, - T_OROR = 344, - T_ANDAND = 345, - T_COLONCOLON = 346, - T_MINUSMINUS = 347, - T_PLUSPLUS = 348, - T_DOTDOT = 349, - T_DOTDOTDOT = 350, - T_SHL = 351, - T_USHR = 352, - T_SHR = 353, - prec_none = 354, + T_STRING = 259, + T_REGEXP = 260, + T_EMPTY = 261, + T_INT = 262, + T_UINT = 263, + T_FLOAT = 264, + T_FOR = 265, + T_WHILE = 266, + T_DO = 267, + T_SWITCH = 268, + KW_IMPLEMENTS = 269, + KW_NAMESPACE = 270, + KW_PACKAGE = 271, + KW_PROTECTED = 272, + KW_ARGUMENTS = 273, + KW_PUBLIC = 274, + KW_PRIVATE = 275, + KW_USE = 276, + KW_INTERNAL = 277, + KW_NEW = 278, + KW_NATIVE = 279, + KW_FUNCTION = 280, + KW_FINALLY = 281, + KW_UNDEFINED = 282, + KW_NAN = 283, + KW_CONTINUE = 284, + KW_CLASS = 285, + KW_CONST = 286, + KW_CATCH = 287, + KW_CASE = 288, + KW_SET = 289, + KW_VOID = 290, + KW_THROW = 291, + KW_STATIC = 292, + KW_WITH = 293, + KW_INSTANCEOF = 294, + KW_IMPORT = 295, + KW_RETURN = 296, + KW_TYPEOF = 297, + KW_INTERFACE = 298, + KW_NULL = 299, + KW_VAR = 300, + KW_DYNAMIC = 301, + KW_OVERRIDE = 302, + KW_FINAL = 303, + KW_EACH = 304, + KW_GET = 305, + KW_TRY = 306, + KW_SUPER = 307, + KW_EXTENDS = 308, + KW_FALSE = 309, + KW_TRUE = 310, + KW_BOOLEAN = 311, + KW_UINT = 312, + KW_INT = 313, + KW_NUMBER = 314, + KW_STRING = 315, + KW_DEFAULT = 316, + KW_DEFAULT_XML = 317, + KW_DELETE = 318, + KW_IF = 319, + KW_ELSE = 320, + KW_BREAK = 321, + KW_IS = 322, + KW_IN = 323, + KW_AS = 324, + T_DICTSTART = 325, + T_EQEQ = 326, + T_EQEQEQ = 327, + T_NE = 328, + T_NEE = 329, + T_LE = 330, + T_GE = 331, + T_ORBY = 332, + T_DIVBY = 333, + T_MODBY = 334, + T_MULBY = 335, + T_ANDBY = 336, + T_PLUSBY = 337, + T_MINUSBY = 338, + T_XORBY = 339, + T_SHRBY = 340, + T_SHLBY = 341, + T_USHRBY = 342, + T_OROR = 343, + T_ANDAND = 344, + T_COLONCOLON = 345, + T_MINUSMINUS = 346, + T_PLUSPLUS = 347, + T_DOTDOT = 348, + T_DOTDOTDOT = 349, + T_SHL = 350, + T_USHR = 351, + T_SHR = 352, + prec_none = 353, + prec_var_read = 354, below_semicolon = 355, below_assignment = 356, below_lt = 357, @@ -144,9 +144,10 @@ plusplus_prefix = 360, below_curly = 361, new2 = 362, - above_identifier = 363, - below_else = 364, - above_function = 365 + below_identifier = 363, + above_identifier = 364, + below_else = 365, + above_function = 366 }; #endif @@ -155,12 +156,12 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union /* Line 1685 of skeleton.m4 */ -#line 47 "parser.y" +#line 48 "parser.y" tokenunion { /* Line 1685 of skeleton.m4 */ -#line 47 "parser.y" +#line 48 "parser.y" enum yytokentype token; @@ -195,7 +196,7 @@ /* Line 1685 of skeleton.m4 */ -#line 199 "parser.tab.h" +#line 200 "parser.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff -Nru swftools-0.9.0/lib/as3/pool.c swftools-0.9.2/lib/as3/pool.c --- swftools-0.9.0/lib/as3/pool.c 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/lib/as3/pool.c 2011-01-02 03:30:29.000000000 +0000 @@ -136,7 +136,7 @@ if(!str) return strdup("NULL"); int len=0; - unsigned const char*s=str; + unsigned const char*s=(unsigned const char*)str; while(*s) { if(*s<10) { len+=2; // \d @@ -151,7 +151,7 @@ } char*newstr = malloc(len+1); char*dest = newstr; - s=str; + s=(unsigned const char*)str; while(*s) { if(*s<9) { dest+=sprintf(dest, "\\%d", *s); @@ -185,9 +185,9 @@ char*s = escape_string(ns->name); char*string = (char*)malloc(strlen(access)+strlen(s)+7); if(!s) - sprintf(string, "[%s]NULL", access, s); + sprintf(string, "[%s]NULL", access); else if(!*s) - sprintf(string, "[%s]\"\"", access, s); + sprintf(string, "[%s]\"\"", access); else sprintf(string, "[%s]%s", access, s); free(s); @@ -209,7 +209,7 @@ namespace_t*ns = malloc(sizeof(namespace_t)); memset(ns, 0, sizeof(namespace_t)); if(name[0] == '[') { - U8 access; + U8 access = 0; char*n = strdup(name); char*bracket = strchr(n, ']'); if(bracket) { @@ -487,6 +487,7 @@ else if(type==0x19) return "explicit"; else if(type==0x1A) return "staticprotected"; else if(type==0x05) return "private"; + else if(type==0x00) return "any"; else { fprintf(stderr, "Undefined access type %02x\n", type); return "undefined"; @@ -522,14 +523,17 @@ int namelen = strlen(name); if(m->type==QNAME || m->type==QNAMEA || m->type==POSTFIXTYPE) { - char*nsname = escape_string(m->ns->name); + char*nsname = m->ns?escape_string(m->ns->name):strdup("NULL"); mname = malloc(strlen(nsname)+namelen+32); strcpy(mname, "type == QNAMEA) strcat(mname, ",attr"); - strcat(mname, ">["); - strcat(mname,access2str(m->ns->access)); - strcat(mname, "]"); + strcat(mname, ">"); + if(m->ns) { + strcat(mname,"["); + strcat(mname,access2str(m->ns->access)); + strcat(mname, "]"); + } strcat(mname, nsname); free(nsname); strcat(mname, "::"); @@ -877,6 +881,7 @@ int pool_register_float(pool_t*p, double d) { int pos = array_append_or_increase(p->x_floats, &d); + fprintf(stderr, "putting %f at %d\n", d, pos);fflush(stderr); assert(pos!=0); return pos; } @@ -899,7 +904,7 @@ { if(!ns) return 0; int pos = array_append_or_increase(pool->x_namespaces, ns); - assert(pos!=0); + assert(pos!=0 || ns->access==ZERONAMESPACE); return pos; } int pool_register_namespace_set(pool_t*pool, namespace_set_t*set) @@ -949,7 +954,7 @@ { int i = array_find(pool->x_ints, &x); if(i<=0) { - fprintf(stderr, "Couldn't find int \"%d\" in constant pool\n", x); + fprintf(stderr, "Couldn't find int \"%f\" in constant pool\n", x); return 0; } return i; @@ -959,9 +964,9 @@ if(!ns) return 0; int i = array_find(pool->x_namespaces, ns); - if(i<=0) { + if(i<0) { char*s = namespace_tostring(ns); - fprintf(stderr, "Couldn't find namespace \"%s\" %08x in constant pool\n", s, ns); + fprintf(stderr, "Couldn't find namespace \"%s\" %p in constant pool\n", s, (int)ns); free(s); return 0; } @@ -987,7 +992,7 @@ string_t s = string_new2(str); int i = array_find(pool->x_strings, &s); if(i<=0) { - fprintf(stderr, "Couldn't find string \"%s\" in constant pool\n", s); + fprintf(stderr, "Couldn't find string \"%s\" in constant pool\n", str); return 0; } return i; @@ -1009,7 +1014,9 @@ int pool_lookup_int(pool_t*pool, int i) { if(!i) return 0; - return *(int*)array_getkey(pool->x_ints, i); + int*ptr = (int*)array_getkey(pool->x_ints, i); + if(!ptr) return 0; + return *ptr; } unsigned int pool_lookup_uint(pool_t*pool, int i) { @@ -1019,7 +1026,10 @@ double pool_lookup_float(pool_t*pool, int i) { if(!i) return __builtin_nan(""); - return *(double*)array_getkey(pool->x_floats, i); + double*ptr = (double*)array_getkey(pool->x_floats, i); + if(!ptr) + return __builtin_nan(""); + return *ptr; } const char*pool_lookup_string(pool_t*pool, int i) { @@ -1045,6 +1055,7 @@ return (multiname_t*)array_getkey(pool->x_multinames, i); } +static namespace_t zeronamespace={ZERONAMESPACE,"*"}; pool_t*pool_new() { NEW(pool_t, p); @@ -1063,7 +1074,7 @@ array_append(p->x_uints, 0, 0); array_append(p->x_floats, 0, 0); array_append(p->x_strings, 0, 0); - array_append(p->x_namespaces, 0, 0); + array_append(p->x_namespaces, &zeronamespace, 0); array_append(p->x_namespace_sets, 0, 0); array_append(p->x_multinames, 0, 0); return p; @@ -1114,7 +1125,7 @@ DEBUG printf("%d strings\n", num_strings); for(t=1;tdata[tag->pos], len); + string_t s = string_new((char*)&tag->data[tag->pos], len); swf_GetBlock(tag, 0, len); array_append(pool->x_strings, &s, 0); DEBUG printf("%d) \"%s\"\n", t, ((string_t*)array_getkey(pool->x_strings, t))->str); @@ -1166,6 +1177,9 @@ if(m.type==0x07 || m.type==0x0d) { int namespace_index = swf_GetU30(tag); m.ns = (namespace_t*)array_getkey(pool->x_namespaces, namespace_index); + if(!m.ns) { + fprintf(stderr, "Error: Illegal reference to namespace #%d in constant pool.\n", namespace_index); + } int name_index = swf_GetU30(tag); if(name_index) // 0 = '*' (any) m.name = pool_lookup_string(pool, name_index); @@ -1224,7 +1238,7 @@ int freq = (int)(ptroff_t)array_getvalue(pool->x_strings, t); if(flags&1) fprintf(fo, "%5d %d) ", freq, t); if(flags&1) fwrite(str.str, str.len, 1, fo); - if(flags&1) fprintf(fo, "\n", t); + if(flags&1) fprintf(fo, "\n"); } fprintf(fo, "%d namespaces\n", pool->x_namespaces->num); for(t=1;tx_namespaces->num;t++) { @@ -1351,13 +1365,17 @@ } else { assert(m->type!=0x07 && m->type!=0x0d); } + if(m->name) { assert(m->type==0x09 || m->type==0x0e || m->type==0x07 || m->type==0x0d || m->type==0x0f || m->type==0x10); int i = pool_find_string(pool, m->name); if(i<0) fprintf(stderr, "internal error: unregistered name\n"); swf_SetU30(tag, i); } else { - assert(m->type!=0x09 && m->type!=0x0e && m->type!=0x07 && m->type!=0x0d && m->type!=0x0f && m->type!=0x10); + if(m->type == 0x09) { + swf_SetU30(tag, 0); + } + assert(m->type!=0x0e && m->type!=0x07 && m->type!=0x0d && m->type!=0x0f && m->type!=0x10); } if(m->namespace_set) { assert(m->type==0x09 || m->type==0x0e || m->type==0x1c || m->type==0x1b); diff -Nru swftools-0.9.0/lib/as3/pool.h swftools-0.9.2/lib/as3/pool.h --- swftools-0.9.0/lib/as3/pool.h 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/lib/as3/pool.h 2010-11-12 18:55:24.000000000 +0000 @@ -124,7 +124,8 @@ RTQNAMELA=0x12, MULTINAMEA=0x0E, MULTINAMELA=0x1C, - POSTFIXTYPE=0x1D + POSTFIXTYPE=0x1D, + ZERONAMESPACE=0 } multiname_type_t; char* access2str(int type); diff -Nru swftools-0.9.0/lib/as3/registry.c swftools-0.9.2/lib/as3/registry.c --- swftools-0.9.0/lib/as3/registry.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/as3/registry.c 2010-11-12 18:55:21.000000000 +0000 @@ -27,6 +27,7 @@ #include "builtin.h" dict_t*registry_classes=0; +asset_bundle_list_t*assets=0; // ----------------------- class signature ------------------------------ @@ -71,6 +72,58 @@ free: (free_func)dummy_destroy, }; +// ----------------------- assets ------------------------------------- +static void use_asset(asset_bundle_t*a) +{ + a->used = 1; + asset_bundle_list_t*l = a->dependencies; + while(l) { + if(!l->asset_bundle->used) { + use_asset(l->asset_bundle); + } + l = l->next; + } +} +void registry_use(slotinfo_t*s) +{ + if(!s) return; + if(!(s->flags&FLAG_USED)) { + s->flags |= FLAG_USED; + if(s->kind == INFOTYPE_CLASS) { + classinfo_t*c=(classinfo_t*)s; + if(c->assets) { + use_asset(c->assets); + } + int t=0; + while(c->interfaces[t]) { + registry_use((slotinfo_t*)c->interfaces[t]); + t++; + } + while(c->superclass) { + c = c->superclass; + registry_use((slotinfo_t*)c); + } + } else if(s->kind == INFOTYPE_METHOD) { + methodinfo_t*m=(methodinfo_t*)s; + if(m->parent) { + registry_use((slotinfo_t*)m->parent); + } + } else if(s->kind == INFOTYPE_VAR) { + varinfo_t*v=(varinfo_t*)s; + if(v->parent) { + registry_use((slotinfo_t*)v->parent); + } + } + } +} +void registry_add_asset(asset_bundle_t*bundle) +{ + list_append(assets, bundle); +} +asset_bundle_list_t*registry_getassets() +{ + return assets; +} // ----------------------- resolving ---------------------------------- slotinfo_t* registry_resolve(slotinfo_t*_s) { @@ -114,9 +167,14 @@ { classinfo_t*cls = (classinfo_t*)_cls; cls->superclass = (classinfo_t*)registry_resolve((slotinfo_t*)cls->superclass); + DICT_ITERATE_DATA(&cls->members,slotinfo_t*,m) { - resolve_on_slot(m); + resolve_on_slot(m); + } + DICT_ITERATE_DATA(&cls->static_members,slotinfo_t*,m2) { + resolve_on_slot(m2); } + int t=0; while(cls->interfaces[t]) { cls->interfaces[t] = (classinfo_t*)registry_resolve((slotinfo_t*)cls->interfaces[t]); @@ -152,11 +210,12 @@ c->name = name; dict_put(registry_classes, c, c); dict_init2(&c->members, &memberinfo_type, AVERAGE_NUMBER_OF_MEMBERS); + dict_init2(&c->static_members, &memberinfo_type, AVERAGE_NUMBER_OF_MEMBERS); schedule_for_resolve((slotinfo_t*)c); return c; } -methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name) +methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name, char is_static) { NEW(methodinfo_t,m); m->kind = INFOTYPE_METHOD; @@ -164,10 +223,13 @@ m->name = name; m->package = ns; m->parent = cls; - dict_put(&cls->members, m, m); + if(!is_static) + dict_put(&cls->members, m, m); + else + dict_put(&cls->static_members, m, m); return m; } -varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name) +varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name, char is_static) { NEW(varinfo_t,m); m->kind = INFOTYPE_VAR; @@ -175,7 +237,10 @@ m->name = name; m->package = ns; m->parent = cls; - dict_put(&cls->members, m, m); + if(!is_static) + dict_put(&cls->members, m, m); + else + dict_put(&cls->static_members, m, m); return m; } methodinfo_t* methodinfo_register_global(U8 access, const char*package, const char*name) @@ -247,14 +312,17 @@ } } -memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char recursive) +memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char recursive, char is_static) { memberinfo_t tmp; tmp.name = name; tmp.package = ns?ns:""; if(!recursive) { - return (memberinfo_t*)dict_lookup(&cls->members, &tmp); + if(!is_static) + return (memberinfo_t*)dict_lookup(&cls->members, &tmp); + else + return (memberinfo_t*)dict_lookup(&cls->static_members, &tmp); } /* look at classes directly extended by this class */ slotinfo_t*m = 0; @@ -267,10 +335,13 @@ if(s->kind == INFOTYPE_UNRESOLVED) break; - m = (slotinfo_t*)dict_lookup(&s->members, &tmp); - if(m) { - return (memberinfo_t*)m; - } + if(!is_static) { + m = (slotinfo_t*)dict_lookup(&s->members, &tmp); + if(m) return (memberinfo_t*)m; + } + m = (slotinfo_t*)dict_lookup(&s->static_members, &tmp); + if(m) return (memberinfo_t*)m; + s = s->superclass; } /* look at interfaces, and parent interfaces */ @@ -279,10 +350,13 @@ classinfo_t*s = cls->interfaces[t]; if(s->kind != INFOTYPE_UNRESOLVED) { while(s) { - m = (slotinfo_t*)dict_lookup(&s->members, &tmp); - if(m) { - return (memberinfo_t*)m; - } + if(!is_static) { + m = (slotinfo_t*)dict_lookup(&s->members, &tmp); + if(m) return (memberinfo_t*)m; + } + m = (slotinfo_t*)dict_lookup(&s->static_members, &tmp); + if(m) return (memberinfo_t*)m; + s = s->superclass; } } @@ -291,20 +365,20 @@ return 0; } -memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses) +memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses, char is_static) { memberinfo_t*m = 0; while(ns) { - m = registry_findmember(cls, ns->namespace->name, name, superclasses); + m = registry_findmember(cls, ns->namespace->name, name, superclasses, is_static); if(m) return m; ns = ns->next; } - m = registry_findmember(cls, "", name, superclasses); + m = registry_findmember(cls, "", name, superclasses, is_static); if(m) return m; /* TODO: it maybe would be faster to just store the builtin namespace as "" in builtins.c (update: some members (e.g. XML.length) are present both for "" and "http:...builtin") */ - m = registry_findmember(cls, "http://adobe.com/AS3/2006/builtin", name, superclasses); + m = registry_findmember(cls, "http://adobe.com/AS3/2006/builtin", name, superclasses, is_static); if(m) return m; return 0; } @@ -358,6 +432,7 @@ } dict_init2(&c->members, &memberinfo_type, 1); + dict_init2(&c->static_members, &memberinfo_type, 1); c->data = f; dict_put(functionobjects, f, c); return c; @@ -379,7 +454,7 @@ } // ----------------------- package handling --------------------------- -char registry_ispackage(char*package) +char registry_ispackage(const char*package) { /* crude approximation of "the real thing", but sufficient for now */ return !strncmp(package, "flash", 5); @@ -485,6 +560,8 @@ char* infotypename(slotinfo_t*s) { + if(!s) + return "(unknown)"; if(s->kind == INFOTYPE_CLASS) return "class"; else if(s->kind == INFOTYPE_VAR) return "var"; else if(s->kind == INFOTYPE_METHOD) return "function"; diff -Nru swftools-0.9.0/lib/as3/registry.h swftools-0.9.2/lib/as3/registry.h --- swftools-0.9.0/lib/as3/registry.h 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/as3/registry.h 2011-01-02 03:30:29.000000000 +0000 @@ -24,8 +24,10 @@ #ifndef __abc_registry_h__ #define __abc_registry_h__ -#include "pool.h" +#include "abc.h" +DECLARE(asset_bundle); +DECLARE_LIST(asset_bundle); DECLARE(slotinfo); DECLARE(classinfo); DECLARE(memberinfo); @@ -38,6 +40,7 @@ /* member/class flags */ #define FLAG_FINAL 1 #define FLAG_BUILTIN 128 +#define FLAG_USED 64 /* member flags */ #define FLAG_STATIC 2 @@ -57,34 +60,30 @@ #define SUBTYPE_SET 2 #define SUBTYPE_GETSET 3 -struct _slotinfo { - U8 kind,subtype,flags,access; - const char*package; - const char*name; +#define SLOTINFO_HEAD \ + U8 kind,subtype,flags,access; \ + const char*package; \ + const char*name; \ int slot; + +struct _slotinfo { + SLOTINFO_HEAD; }; struct _unresolvedinfo { - U8 kind,subtype,flags,access; - const char*package; - const char*name; - int slot; + SLOTINFO_HEAD; namespace_list_t*nsset; }; struct _classinfo { - U8 kind,subtype,flags,access; - const char*package; - const char*name; - int slot; + SLOTINFO_HEAD; classinfo_t*superclass; dict_t members; + dict_t static_members; void*data; //TODO: get rid of this- parser.y should pass type/value/code triples around + asset_bundle_t*assets; classinfo_t*interfaces[]; }; struct _memberinfo { - U8 kind,subtype,flags,access; - const char*package; - const char*name; - int slot; + SLOTINFO_HEAD; union { classinfo_t*return_type; classinfo_t*type; @@ -92,24 +91,24 @@ classinfo_t*parent; }; struct _methodinfo /*extends memberinfo*/ { - U8 kind,subtype,flags,access; - const char*package; - const char*name; - int slot; + SLOTINFO_HEAD; classinfo_t*return_type; classinfo_t*parent; classinfo_list_t*params; }; struct _varinfo /*extends memberinfo*/ { - U8 kind,subtype,flags,access; - const char*package; - const char*name; - int slot; + SLOTINFO_HEAD; classinfo_t*type; classinfo_t*parent; constant_t*value; }; +struct _asset_bundle { + abc_file_t*file; + asset_bundle_list_t*dependencies; + char used; +}; + extern type_t memberinfo_type; extern type_t slotinfo_type; char slotinfo_equals(slotinfo_t*c1, slotinfo_t*c2); @@ -117,9 +116,9 @@ void registry_init(); classinfo_t* classinfo_register(int access, const char*package, const char*name, int num_interfaces); -methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name); +methodinfo_t* methodinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name, char is_static); methodinfo_t* methodinfo_register_global(U8 access, const char*package, const char*name); -varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name); +varinfo_t* varinfo_register_onclass(classinfo_t*cls, U8 access, const char*ns, const char*name, char is_static); varinfo_t* varinfo_register_global(U8 access, const char*package, const char*name); slotinfo_t* registry_resolve(slotinfo_t*s); @@ -127,8 +126,8 @@ slotinfo_t* registry_find(const char*package, const char*name); void registry_dump(); -memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char superclasses); -memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses); +memberinfo_t* registry_findmember(classinfo_t*cls, const char*ns, const char*name, char superclasses, char is_static); +memberinfo_t* registry_findmember_nsset(classinfo_t*cls, namespace_list_t*ns, const char*name, char superclasses, char is_static); void registry_fill_multiname(multiname_t*m, namespace_t*n, slotinfo_t*c); #define MULTINAME(m,x) \ @@ -147,9 +146,14 @@ namespace_t access2namespace(U8 access, char*package); -char registry_ispackage(char*package); +char registry_ispackage(const char*package); + +void registry_add_asset(asset_bundle_t*bundle); +void registry_use(slotinfo_t*s); +asset_bundle_list_t*registry_getassets(); // static multinames +classinfo_t voidclass; classinfo_t* registry_getanytype(); classinfo_t* registry_getarrayclass(); classinfo_t* registry_getobjectclass(); diff -Nru swftools-0.9.0/lib/as3/scripts.c swftools-0.9.2/lib/as3/scripts.c --- swftools-0.9.0/lib/as3/scripts.c 2009-03-29 19:32:14.000000000 +0000 +++ swftools-0.9.2/lib/as3/scripts.c 2011-01-02 03:30:29.000000000 +0000 @@ -21,6 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "abc.h" void swf_AddButtonLinks(SWF*swf, char stop_each_frame, char events) @@ -28,26 +29,38 @@ int num_frames = 0; int has_buttons = 0; TAG*tag=swf->firstTag; + + unsigned int checksum = 0; while(tag) { if(tag->id == ST_SHOWFRAME) num_frames++; if(tag->id == ST_DEFINEBUTTON || tag->id == ST_DEFINEBUTTON2) has_buttons = 1; + crc32_add_bytes(checksum, tag->data, tag->len); tag = tag->next; } + int t = time(0); + checksum = crc32_add_bytes(checksum, &t, sizeof(t)); + + unsigned char h[16]; + unsigned char file_signature[33]; + sprintf((char*)file_signature, "%x", checksum); + + char scenename1[80], scenename2[80]; + sprintf(scenename1, "rfx.MainTimeline_%s", file_signature); + sprintf(scenename2, "rfx::MainTimeline_%s", file_signature); abc_file_t*file = abc_file_new(); abc_method_body_t*c = 0; - abc_class_t*cls = abc_class_new2(file, "rfx::MainTimeline", "flash.display::MovieClip"); - abc_class_protectedNS(cls, "rfx:MainTimeline"); + abc_class_t*cls = abc_class_new2(file, scenename2, "flash.display::MovieClip"); TAG*abctag = swf_InsertTagBefore(swf, swf->firstTag, ST_DOABC); tag = swf_InsertTag(abctag, ST_SYMBOLCLASS); swf_SetU16(tag, 1); swf_SetU16(tag, 0); - swf_SetString(tag, "rfx.MainTimeline"); + swf_SetString(tag, scenename1); c = abc_class_getstaticconstructor(cls, 0)->body; c->old.max_stack = 1; @@ -86,7 +99,7 @@ char needs_framescript=0; char buttonname[80]; char functionname[80]; - sprintf(framename, "[packageinternal]rfx::frame%d", frame); + sprintf(framename, "[packageinternal]rfx::frame%d_%s", frame, file_signature); if(!f && (tag->id == ST_DEFINEBUTTON || tag->id == ST_DEFINEBUTTON2 || stop_each_frame)) { /* make the contructor add a frame script */ @@ -116,7 +129,7 @@ __ getlex(f,buttonname); __ getlex(f,"flash.events::MouseEvent"); __ getproperty(f, "::CLICK"); - sprintf(functionname, "::clickbutton%d", swf_GetDefineID(tag)); + sprintf(functionname, "::clickbutton%d_%s", swf_GetDefineID(tag), file_signature); __ getlex(f,functionname); __ callpropvoid(f, "::addEventListener" ,2); @@ -142,7 +155,7 @@ __ callpropvoid(h,"[package]::gotoAndStop", 1); } else { char framename[80]; - sprintf(framename, "frame%d", framenr); + sprintf(framename, "frame%d_%s", framenr, file_signature); __ getlocal_0(h); //this __ findpropstrict(h, "[package]flash.events::TextEvent"); __ pushstring(h, "link"); @@ -157,7 +170,7 @@ __ findpropstrict(h,"flash.net::navigateToURL"); __ findpropstrict(h,"flash.net::URLRequest"); // TODO: target _blank - __ pushstring(h,oldaction->data); //url + __ pushstring(h,(char*)oldaction->data); //url __ constructprop(h,"flash.net::URLRequest", 1); __ callpropvoid(h,"flash.net::navigateToURL", 1); } else { @@ -166,7 +179,7 @@ __ pushstring(h, "link"); __ pushtrue(h); __ pushtrue(h); - __ pushstring(h,oldaction->data); //url + __ pushstring(h,(char*)oldaction->data); //url __ constructprop(h,"[package]flash.events::TextEvent", 4); __ callpropvoid(h,"[package]::dispatchEvent", 1); } @@ -238,11 +251,11 @@ __ popscope(c); __ popscope(c); __ popscope(c); - __ initproperty(c,"rfx::MainTimeline"); + __ initproperty(c,scenename2); __ returnvoid(c); //abc_method_body_addClassTrait(c, "rfx:MainTimeline", 1, cls); - multiname_t*classname = multiname_fromstring("rfx::MainTimeline"); + multiname_t*classname = multiname_fromstring(scenename2); abc_initscript_addClassTrait(s, classname, cls); multiname_destroy(classname); diff -Nru swftools-0.9.0/lib/as3/state.c swftools-0.9.2/lib/as3/state.c --- swftools-0.9.0/lib/as3/state.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/as3/state.c 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,95 @@ +#include "state.h" +#include "common.h" + +state_t* state = 0; + +void new_state() +{ + NEW(state_t, s); + state_t*oldstate = state; + if(state) + memcpy(s, state, sizeof(state_t)); //shallow copy + if(!s->imports) { + s->imports = dict_new(); + } + if(!s->import_toplevel_packages) { + s->import_toplevel_packages = dict_new(); + } + state = s; + state->level++; + state->has_own_imports = 0; + state->vars = dict_new(); + state->old = oldstate; + state->new_vars = 0; + + state->namespaces = dict_new(); + + if(oldstate) + state->active_namespace_urls = list_clone(oldstate->active_namespace_urls); +} + +void state_destroy(state_t*state) +{ + if(state->has_own_imports) { + list_free(state->wildcard_imports); + dict_destroy(state->imports);state->imports=0; + } + if(state->imports && (!state->old || state->old->imports!=state->imports)) { + dict_destroy(state->imports);state->imports=0; + } + if(state->vars) { + dict_destroy(state->vars);state->vars=0; + } + + list_free(state->active_namespace_urls) + state->active_namespace_urls = 0; + + free(state); +} + +void old_state() +{ + if(!state || !state->old) + syntaxerror("invalid nesting"); + state_t*leaving = state; + + state = state->old; + + if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) { + methodstate_destroy(leaving->method);leaving->method=0; + } + if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) { + free(leaving->cls); + leaving->cls=0; + } + + state_destroy(leaving); +} + +methodstate_t*methodstate_new() +{ + NEW(methodstate_t,m); + m->allvars = dict_new(); + return m; +} + +void methodstate_destroy(methodstate_t*m) +{ + dict_destroy(m->unresolved_variables); m->unresolved_variables = 0; + list_free(m->innerfunctions);m->innerfunctions=0; + + if(m->allvars) { + DICT_ITERATE_DATA(m->allvars, void*, data) {free(data);} + m->allvars = 0; + } +} + +dict_t*definitions=0; +void as3_set_define(const char*c) +{ + if(!definitions) + definitions = dict_new(); + if(!dict_contains(definitions,c)) + dict_put(definitions,c,0); +} + diff -Nru swftools-0.9.0/lib/as3/state.h swftools-0.9.2/lib/as3/state.h --- swftools-0.9.0/lib/as3/state.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/as3/state.h 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,108 @@ +#ifndef __state_h__ +#define __state_h__ + +#include "../q.h" +#include "abc.h" +#include "registry.h" +#include "initcode.h" + +DECLARE(state); +DECLARE_LIST(state); +DECLARE(import); +DECLARE_LIST(import); +DECLARE(methodstate); +DECLARE_LIST(methodstate); +DECLARE(classstate); + +struct _state { + struct _state*old; + int level; + + char*package; + import_list_t*wildcard_imports; + dict_t*import_toplevel_packages; + dict_t*imports; + + dict_t*namespaces; + namespace_list_t*active_namespace_urls; + + char has_own_imports; + char new_vars; // e.g. transition between two functions + char xmlfilter; // are we inside a xmlobj..() filter? + + classstate_t*cls; + methodstate_t*method; + + char*exception_name; + + int switch_var; + + dict_t*vars; +}; + +extern state_t* state; + +struct _import { + char*package; +}; + +struct _classstate { + /* class data */ + classinfo_t*info; + abc_class_t*abc; + + methodstate_t*init; + methodstate_t*static_init; + //code_t*init; + //code_t*static_init; + parsedclass_t*dependencies; + + char has_constructor; +}; + +struct _methodstate { + /* method data */ + methodinfo_t*info; + char has_exceptions; + char late_binding; + char is_constructor; + char has_super; + char is_global; + char is_static; + int variable_count; + + dict_t*unresolved_variables; + dict_t*allvars; // all variables (in all sublevels, but not for inner functions) + + char inner; + char uses_parent_function; + char no_variable_scoping; + int uses_slots; + dict_t*slots; + int activation_var; + + int need_arguments; + + abc_method_t*abc; + int var_index; // for inner methods + int slot_index; // for inner methods + char is_a_slot; // for inner methods + + code_t*header; + + code_t*scope_code; + abc_exception_list_t*exceptions; + + methodstate_list_t*innerfunctions; +}; + +void new_state(); +void old_state(); + +methodstate_t*methodstate_new(); +void methodstate_destroy(methodstate_t*m); + +extern dict_t*definitions; +void as3_set_define(const char*c); + +#endif //__state_h__ diff -Nru swftools-0.9.0/lib/as3/tokenizer.h swftools-0.9.2/lib/as3/tokenizer.h --- swftools-0.9.0/lib/as3/tokenizer.h 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/as3/tokenizer.h 2010-11-12 18:54:35.000000000 +0000 @@ -77,10 +77,9 @@ typedef token_t*tokenptr_t; -extern trie_t*active_namespaces; - #include "parser.tab.h" +extern char*token2string(enum yytokentype nr, YYSTYPE v); extern unsigned int as3_tokencount; void as3_buffer_input(void*buffer, int len); diff -Nru swftools-0.9.0/lib/as3/tokenizer.yy.c swftools-0.9.2/lib/as3/tokenizer.yy.c --- swftools-0.9.0/lib/as3/tokenizer.yy.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/as3/tokenizer.yy.c 2011-01-02 03:30:29.000000000 +0000 @@ -172,7 +172,12 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int as3_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t as3_leng; extern FILE *as3_in, *as3_out; @@ -198,11 +203,6 @@ #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -220,7 +220,7 @@ /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -290,8 +290,8 @@ /* yy_hold_char holds the character lost when as3_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int as3_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t as3_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -319,7 +319,7 @@ YY_BUFFER_STATE as3__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE as3__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE as3__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE as3__scan_bytes (yyconst char *bytes,yy_size_t len ); void *as3_alloc (yy_size_t ); void *as3_realloc (void *,yy_size_t ); @@ -388,77 +388,86 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[629] = +static yyconst flex_int16_t yy_accept[705] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 130, 31, 127, 130, 127, 127, 127, 130, 127, 128, 126, 127, 127, 73, 127, 130, 130, 130, 75, 127, 127, 127, 125, 125, 126, 127, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 29, 127, 126, 130, - 125, 129, 31, 127, 129, 127, 127, 127, 129, 127, - 128, 126, 127, 127, 73, 127, 129, 129, 129, 75, - 127, 127, 127, 125, 125, 126, 127, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 29, 127, 126, 31, + 130, 130, 125, 129, 31, 127, 129, 127, 127, 127, + 129, 127, 128, 126, 127, 127, 73, 127, 129, 129, + 129, 75, 127, 127, 127, 125, 125, 126, 127, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 28, 127, 126, 129, 125, 29, - 127, 127, 73, 127, 129, 129, 129, 17, 17, 19, - 20, 18, 16, 16, 129, 12, 15, 11, 14, 13, - 10, 49, 0, 6, 0, 125, 61, 47, 64, 0, - 0, 62, 56, 57, 55, 59, 72, 0, 3, 0, - 60, 34, 34, 0, 0, 0, 0, 74, 0, 68, - 54, 52, 53, 70, 0, 125, 0, 125, 58, 125, + 125, 125, 125, 125, 125, 125, 28, 127, 126, 31, + 129, 129, 125, 29, 127, 127, 73, 127, 129, 129, + 129, 17, 17, 19, 20, 18, 16, 16, 129, 12, + 15, 11, 14, 13, 10, 15, 15, 49, 0, 6, + 0, 125, 0, 0, 61, 47, 64, 0, 0, 62, + 56, 57, 55, 59, 72, 0, 3, 0, 60, 34, + 34, 0, 0, 0, 0, 74, 0, 68, 54, 52, + 53, 70, 0, 125, 0, 125, 125, 125, 58, 125, 124, 125, 125, 125, 125, 125, 44, 125, 125, 125, 125, 125, 125, 125, 125, 125, 123, 125, 122, 121, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 63, 48, 0, 122, 0, 0, 0, 0, 0, - 3, 23, 60, 0, 26, 26, 0, 0, 0, 0, - 17, 0, 0, 9, 15, 0, 50, 125, 71, 35, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 66, 51, 65, 69, 0, 0, 0, 0, - 0, 36, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 43, 125, 117, 125, - 125, 125, 125, 125, 116, 125, 125, 125, 125, 125, - 125, 125, 118, 125, 125, 125, 125, 125, 120, 125, - - 125, 115, 119, 125, 125, 125, 30, 125, 0, 26, - 26, 0, 0, 27, 23, 0, 0, 0, 23, 0, - 23, 23, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 2, 0, 33, 0, 32, 32, 0, - 0, 67, 0, 0, 0, 0, 125, 125, 113, 125, - 125, 125, 125, 125, 125, 125, 108, 112, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 111, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 110, - 125, 125, 109, 125, 114, 125, 27, 0, 0, 0, - 0, 23, 0, 23, 0, 0, 2, 0, 23, 23, - - 25, 0, 24, 24, 0, 0, 0, 0, 2, 37, - 0, 39, 0, 0, 0, 125, 106, 103, 101, 102, - 125, 125, 125, 125, 125, 105, 104, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 107, 125, 100, 125, 125, 45, 125, 25, 0, - 24, 24, 0, 0, 2, 0, 23, 23, 0, 0, - 0, 0, 0, 0, 38, 0, 0, 125, 125, 125, - 93, 125, 125, 125, 125, 125, 98, 125, 125, 125, - 125, 96, 125, 125, 125, 125, 95, 94, 97, 46, - 99, 125, 125, 23, 0, 0, 0, 0, 0, 0, - - 125, 125, 88, 91, 92, 87, 125, 125, 125, 125, - 125, 125, 125, 89, 90, 125, 125, 125, 23, 8, - 21, 0, 0, 0, 40, 125, 83, 0, 86, 125, - 125, 125, 85, 125, 84, 125, 125, 0, 0, 0, - 41, 82, 0, 125, 125, 78, 80, 79, 81, 0, - 0, 0, 0, 0, 0, 0, 0, 77, 76, 0, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 63, 48, 125, 31, 0, 122, 0, 0, 0, + 0, 0, 3, 23, 60, 0, 26, 26, 0, 0, + 0, 0, 17, 0, 0, 9, 15, 0, 15, 50, + 125, 0, 71, 35, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 66, 51, 65, 69, + 0, 0, 0, 0, 0, 0, 0, 125, 36, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 43, 125, 117, 125, 125, 125, 125, + + 125, 116, 125, 125, 125, 125, 125, 125, 125, 118, + 125, 125, 125, 125, 125, 120, 125, 125, 115, 119, + 125, 125, 125, 30, 125, 0, 26, 26, 0, 0, + 27, 23, 0, 0, 0, 23, 0, 23, 23, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, + 2, 0, 33, 0, 32, 32, 0, 0, 67, 0, + 0, 0, 0, 125, 125, 113, 125, 125, 125, 125, + 125, 125, 125, 108, 112, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 111, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 110, 125, 125, 109, + + 125, 114, 125, 27, 0, 0, 0, 0, 23, 0, + 23, 0, 0, 2, 0, 23, 23, 25, 0, 24, + 24, 0, 0, 0, 0, 2, 37, 0, 39, 0, + 0, 0, 125, 106, 103, 101, 102, 125, 125, 125, + 125, 125, 105, 104, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 107, 125, + 100, 125, 125, 45, 125, 25, 0, 24, 24, 0, + 0, 2, 0, 23, 23, 0, 0, 0, 0, 0, + 0, 38, 0, 0, 125, 125, 125, 93, 125, 125, + 125, 125, 125, 98, 125, 125, 125, 125, 96, 125, + + 125, 125, 125, 95, 94, 97, 46, 99, 125, 125, + 23, 0, 0, 0, 0, 0, 0, 125, 125, 88, + 91, 92, 87, 125, 125, 125, 125, 125, 125, 125, + 89, 90, 125, 125, 125, 23, 8, 21, 0, 0, + 0, 40, 125, 83, 0, 125, 125, 86, 125, 125, + 125, 85, 125, 84, 125, 125, 0, 125, 125, 0, + 0, 41, 82, 0, 125, 125, 125, 125, 78, 80, + 79, 81, 0, 0, 0, 0, 0, 125, 125, 125, + 0, 0, 0, 0, 125, 77, 76, 0, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 42, 0, 4, 0, 0, 4, 0, 5, - 0, 0, 0, 0, 0, 7, 0, 39, 5, 39, + 0, 0, 5, 0, 125, 0, 125, 125, 125, 0, + 0, 0, 42, 42, 0, 0, 0, 4, 0, 0, + 0, 0, 4, 0, 0, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, + 0, 0, 125, 125, 125, 125, 0, 7, 0, 0, + 0, 39, 5, 39, 39, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 125, 22, 0, 7, + 0, 38, 5, 38, 38, 0, 0, 0, 5, 0, + 22, 0, 0, 0, 0, 40, 5, 40, 40, 41, - 39, 0, 0, 0, 22, 0, 7, 0, 38, 5, - 38, 38, 0, 0, 22, 0, 0, 0, 0, 40, - 5, 40, 40, 41, 5, 41, 41, 0 + 5, 41, 41, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -476,24 +485,24 @@ 42, 43, 44, 45, 46, 28, 47, 48, 49, 50, 51, 52, 28, 53, 54, 55, 56, 57, 58, 59, - 60, 28, 61, 62, 63, 13, 8, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 65, 64, 64, 64, - 66, 64, 64, 64, 64, 64, 64, 64, 64, 64, - - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 67, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64 + 60, 28, 61, 62, 63, 13, 8, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 64, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 65, 37, 37, 37, + 66, 37, 37, 67, 37, 37, 37, 37, 37, 37, + + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 68, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37 } ; -static yyconst flex_int32_t yy_meta[68] = +static yyconst flex_int32_t yy_meta[69] = { 0, 1, 2, 3, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 6, @@ -501,164 +510,182 @@ 9, 9, 4, 10, 4, 4, 11, 9, 9, 9, 9, 12, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 13, 9, - 8, 4, 4, 14, 14, 14, 14 + 8, 4, 4, 11, 11, 11, 11, 11 } ; -static yyconst flex_int16_t yy_base[670] = +static yyconst flex_int16_t yy_base[749] = { 0, - 0, 927, 67, 925, 903, 89, 120, 127, 148, 151, - 212, 0, 963, 3586, 3586, 937, 145, 0, 935, 142, - 144, 3586, 3586, 934, 139, 140, 140, 144, 262, 267, - 272, 935, 160, 931, 145, 187, 294, 3586, 929, 325, - 331, 335, 145, 257, 264, 156, 312, 326, 308, 319, - 343, 350, 342, 359, 366, 373, 3586, 256, 3586, 888, - 377, 3586, 3586, 923, 161, 0, 914, 175, 168, 3586, - 3586, 906, 414, 420, 323, 288, 426, 431, 436, 907, - 437, 899, 275, 412, 421, 3586, 897, 426, 433, 0, - 445, 450, 456, 468, 475, 479, 490, 495, 494, 502, - - 511, 525, 517, 532, 3586, 261, 3586, 854, 543, 3586, - 181, 186, 331, 397, 567, 578, 583, 0, 0, 891, - 3586, 3586, 3586, 3586, 885, 3586, 864, 3586, 3586, 3586, - 3586, 859, 335, 3586, 879, 0, 3586, 3586, 3586, 421, - 877, 3586, 3586, 3586, 3586, 3586, 858, 586, 612, 396, - 3586, 3586, 590, 601, 445, 843, 805, 3586, 820, 820, - 3586, 817, 3586, 450, 636, 596, 646, 614, 3586, 619, - 618, 626, 637, 633, 645, 659, 660, 665, 661, 676, - 680, 681, 688, 695, 699, 703, 704, 715, 721, 722, - 730, 726, 742, 744, 749, 750, 764, 756, 768, 770, - - 776, 784, 788, 795, 796, 811, 812, 818, 819, 826, - 830, 3586, 3586, 772, 835, 633, 873, 878, 881, 272, - 906, 938, 463, 480, 3586, 884, 896, 658, 819, 475, - 0, 498, 818, 3586, 794, 0, 3586, 0, 3586, 3586, - 719, 932, 942, 794, 563, 3586, 907, 930, 998, 1065, - 790, 780, 3586, 3586, 3586, 780, 1131, 748, 740, 725, - 716, 1099, 1100, 1101, 1115, 1120, 1116, 1127, 1135, 1142, - 1149, 1150, 1154, 1161, 1156, 1168, 1170, 1175, 1176, 1182, - 1184, 1196, 1198, 1204, 1203, 1205, 1210, 1219, 1221, 1226, - 1235, 1237, 1241, 1246, 1257, 1252, 1258, 1272, 1264, 1279, - - 1280, 1278, 1286, 1294, 1295, 1302, 3586, 1300, 1120, 3586, - 1334, 891, 739, 3586, 0, 1356, 1362, 1382, 726, 1390, - 0, 1406, 1347, 1358, 1466, 1533, 727, 723, 696, 0, - 614, 1411, 1600, 698, 1605, 3586, 0, 3586, 0, 653, - 675, 3586, 0, 641, 644, 640, 1369, 1381, 1301, 1578, - 1574, 1579, 1360, 1593, 1595, 1604, 1597, 1609, 1613, 1620, - 1618, 1627, 1632, 1638, 1639, 1646, 1647, 1654, 1655, 1662, - 1666, 1670, 1674, 1681, 1682, 1688, 1690, 1702, 1706, 1707, - 1708, 1722, 1723, 1724, 1729, 1730, 3586, 1401, 1617, 1786, - 1853, 0, 1918, 1952, 2019, 2024, 657, 2029, 2063, 0, - - 3586, 0, 3586, 0, 655, 644, 628, 1921, 3586, 3586, - 619, 3586, 0, 580, 582, 1890, 1731, 1891, 1896, 1897, - 1999, 2003, 2004, 2093, 2094, 2095, 2099, 2110, 2111, 2115, - 2117, 2126, 2133, 2140, 2141, 2142, 2156, 2157, 2158, 2162, - 2176, 2177, 2181, 2182, 2193, 2197, 2199, 2201, 3586, 0, - 3586, 0, 2252, 2257, 0, 2262, 0, 0, 607, 182, - 601, 474, 575, 558, 3586, 544, 540, 2232, 2236, 2247, - 2252, 2259, 2263, 2267, 2268, 2282, 2274, 2283, 2288, 2290, - 2294, 2299, 2305, 2306, 2313, 2311, 2320, 2322, 2327, 2329, - 2331, 2336, 2343, 555, 494, 535, 540, 542, 509, 0, - - 2345, 2350, 2400, 2359, 2361, 2368, 2370, 2375, 2386, 2391, - 2379, 2395, 2402, 2407, 2409, 2414, 2421, 2471, 520, 3586, - 3586, 510, 501, 0, 3586, 2416, 2430, 2480, 2439, 2441, - 2450, 2457, 2456, 2464, 2462, 2473, 2479, 2529, 489, 468, - 3586, 2478, 421, 2497, 2499, 2505, 2506, 2511, 2517, 1141, - 369, 2568, 2572, 394, 354, 336, 299, 2540, 2541, 2057, - 2579, 2591, 2595, 389, 2601, 321, 583, 2605, 2617, 2630, - 2641, 2651, 2645, 2655, 2663, 2667, 2671, 2675, 2679, 284, - 276, 647, 3586, 2687, 2723, 198, 2727, 2732, 2736, 2740, - 2774, 2751, 2755, 2759, 730, 3586, 736, 2744, 2763, 2767, - - 2809, 2841, 2813, 2821, 3586, 794, 147, 805, 2817, 2825, - 2829, 2868, 2876, 2880, 141, 853, 2884, 2929, 2996, 2888, - 2892, 2896, 2907, 2915, 2921, 2954, 2964, 3586, 3063, 3077, - 3083, 3096, 3110, 3123, 3136, 3150, 3164, 3178, 3187, 3196, - 3209, 3223, 3237, 3247, 3260, 3274, 3288, 3298, 3306, 3320, - 3334, 3344, 3349, 3362, 3376, 3390, 3404, 3418, 3432, 3446, - 3460, 3474, 3488, 3502, 3515, 3529, 3543, 3557, 3571 + 0, 1980, 68, 1979, 1963, 91, 122, 129, 150, 153, + 214, 0, 2022, 3900, 3900, 1996, 147, 90, 1995, 144, + 148, 3900, 3900, 1993, 143, 145, 143, 169, 265, 270, + 275, 1994, 161, 1990, 146, 296, 300, 3900, 1944, 328, + 138, 149, 153, 268, 299, 156, 293, 316, 256, 303, + 272, 320, 326, 334, 345, 348, 3900, 286, 3900, 286, + 1903, 1896, 354, 3900, 3900, 1931, 159, 298, 1903, 283, + 356, 3900, 3900, 1896, 393, 399, 405, 413, 413, 419, + 424, 1887, 424, 1878, 380, 397, 405, 3900, 1875, 0, + 399, 416, 420, 437, 441, 446, 455, 464, 403, 469, + + 459, 473, 479, 484, 492, 495, 3900, 360, 3900, 428, + 1818, 1814, 501, 3900, 164, 451, 538, 538, 146, 1811, + 0, 0, 0, 1827, 3900, 3900, 3900, 3900, 1806, 3900, + 1753, 3900, 3900, 3900, 3900, 1717, 297, 1712, 429, 3900, + 1659, 0, 544, 547, 3900, 3900, 3900, 477, 1646, 3900, + 3900, 3900, 3900, 3900, 1618, 550, 572, 532, 3900, 3900, + 562, 1542, 568, 1572, 1526, 3900, 1510, 1502, 3900, 1455, + 3900, 536, 591, 526, 595, 532, 549, 570, 3900, 562, + 556, 565, 567, 573, 575, 587, 578, 589, 593, 591, + 597, 612, 614, 603, 619, 621, 617, 625, 627, 630, + + 636, 634, 645, 652, 655, 650, 658, 660, 663, 669, + 667, 678, 672, 674, 683, 688, 691, 685, 694, 697, + 699, 3900, 3900, 702, 3900, 1411, 706, 742, 747, 752, + 755, 629, 780, 812, 752, 759, 3900, 770, 1388, 780, + 1421, 179, 0, 486, 1409, 3900, 1388, 0, 1381, 3900, + 0, 783, 3900, 3900, 806, 821, 872, 1377, 754, 3900, + 806, 857, 899, 962, 1370, 1325, 3900, 3900, 3900, 1311, + 1244, 987, 1209, 1206, 1138, 1144, 1104, 726, 734, 776, + 780, 793, 840, 766, 828, 946, 842, 955, 844, 952, + 959, 784, 964, 832, 967, 929, 978, 961, 980, 985, + + 950, 957, 989, 982, 993, 995, 1002, 1005, 1007, 1011, + 1013, 1020, 1016, 1024, 1030, 1026, 1034, 1039, 1032, 1036, + 1041, 1043, 1053, 3900, 1051, 1080, 3900, 1088, 1091, 1142, + 3900, 0, 1113, 1122, 1142, 1123, 1147, 0, 1163, 1098, + 1113, 1223, 1286, 1114, 1112, 1092, 0, 495, 1168, 1312, + 1084, 1322, 3900, 0, 3900, 0, 997, 1014, 3900, 0, + 966, 890, 887, 1105, 1120, 1085, 1132, 1099, 1110, 1134, + 1264, 1145, 1279, 1125, 1253, 1285, 1292, 1302, 1289, 1298, + 1276, 1315, 1304, 1306, 1308, 1310, 1313, 1332, 1334, 1329, + 1327, 1321, 1338, 1323, 1349, 1340, 1325, 1346, 1352, 1354, + + 1359, 1356, 1361, 3900, 1398, 1401, 1443, 1506, 0, 1525, + 1569, 1532, 1559, 873, 1629, 1663, 0, 3900, 0, 3900, + 0, 873, 871, 815, 1423, 3900, 3900, 804, 3900, 0, + 758, 750, 1484, 1375, 1377, 1379, 1381, 1495, 1502, 1504, + 1529, 1511, 1383, 1532, 1535, 1538, 1549, 1584, 1592, 1587, + 1552, 1597, 1603, 1599, 1692, 1694, 1605, 1696, 1500, 1688, + 1523, 1700, 1698, 1607, 1714, 3900, 0, 3900, 0, 1755, + 1760, 0, 1780, 0, 0, 779, 318, 768, 374, 739, + 717, 3900, 670, 660, 1685, 1724, 1718, 1712, 1747, 1732, + 1737, 1751, 1754, 1739, 1758, 1765, 1768, 1771, 1762, 1776, + + 1778, 1781, 1773, 1783, 1785, 1787, 1789, 1791, 1796, 1805, + 681, 467, 1110, 654, 627, 592, 0, 1798, 1812, 1858, + 1802, 1814, 1816, 1821, 1823, 1830, 1838, 1832, 1841, 1845, + 1835, 1843, 1848, 1851, 1904, 598, 3900, 3900, 578, 544, + 0, 3900, 1860, 1862, 1915, 1870, 1873, 1877, 1879, 1888, + 1893, 1890, 1898, 1895, 1909, 1912, 1973, 2040, 1906, 519, + 512, 3900, 1901, 493, 1934, 1936, 1919, 1938, 1940, 1944, + 1946, 1948, 2107, 627, 2112, 2123, 2116, 2189, 457, 0, + 481, 451, 430, 381, 1955, 1951, 1953, 2256, 2260, 2264, + 2268, 2272, 1977, 2276, 409, 1776, 2280, 2285, 2299, 2291, + + 2304, 2371, 2357, 2375, 2382, 2386, 2390, 2404, 2399, 2456, + 2471, 2477, 2482, 2486, 0, 2493, 0, 346, 2560, 354, + 342, 1149, 3900, 1959, 285, 2627, 2631, 2635, 254, 312, + 1952, 2639, 2643, 2647, 2651, 2655, 2667, 225, 2734, 2659, + 2725, 2759, 2770, 2776, 2813, 2782, 2805, 2849, 2827, 2853, + 220, 2860, 0, 0, 0, 144, 1734, 3900, 1822, 137, + 2871, 2884, 2893, 2897, 2901, 2968, 2941, 2950, 3007, 3016, + 3031, 3038, 3023, 3050, 3074, 3044, 0, 3900, 1910, 143, + 1984, 3056, 3089, 3122, 3126, 3130, 3140, 2122, 3144, 3157, + 138, 1988, 3164, 3231, 3294, 3196, 3210, 3214, 3267, 3280, + + 3284, 3319, 3333, 3900, 3400, 3413, 3418, 3431, 3444, 3456, + 3464, 3477, 3490, 3503, 3516, 3524, 3532, 3545, 3557, 3570, + 3579, 3592, 3605, 3617, 3626, 3634, 3647, 3660, 3668, 3673, + 3686, 3699, 3712, 3720, 3733, 3746, 3759, 3767, 3775, 3783, + 3796, 3808, 3821, 3834, 3847, 3860, 3873, 3886 } ; -static yyconst flex_int16_t yy_def[670] = +static yyconst flex_int16_t yy_def[749] = { 0, - 628, 1, 628, 3, 3, 3, 3, 3, 629, 629, - 628, 11, 628, 628, 628, 628, 630, 631, 628, 628, - 632, 628, 628, 628, 628, 628, 628, 628, 633, 633, - 633, 628, 628, 628, 628, 634, 634, 628, 628, 634, - 634, 634, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 628, 628, 628, 628, - 42, 628, 628, 628, 630, 631, 628, 628, 632, 628, - 628, 628, 628, 628, 628, 635, 636, 636, 636, 628, - 628, 628, 628, 42, 42, 628, 628, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - - 42, 42, 42, 42, 628, 628, 628, 628, 42, 628, - 628, 628, 628, 628, 633, 633, 633, 637, 637, 628, - 628, 628, 628, 628, 638, 628, 639, 628, 628, 628, - 628, 628, 630, 628, 630, 640, 628, 628, 628, 632, - 632, 628, 628, 628, 628, 628, 628, 641, 642, 643, - 628, 628, 641, 633, 628, 644, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 42, 628, 42, 628, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 628, 628, 628, 42, 628, 645, 645, 646, 635, - 647, 643, 635, 635, 628, 646, 636, 628, 648, 628, - 637, 628, 638, 628, 639, 649, 628, 640, 628, 628, - 642, 642, 650, 628, 643, 628, 641, 641, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - - 42, 42, 42, 42, 42, 42, 628, 42, 651, 628, - 651, 628, 652, 628, 653, 647, 647, 654, 653, 647, - 222, 635, 646, 646, 628, 628, 628, 628, 628, 649, - 655, 642, 650, 628, 642, 628, 249, 628, 249, 628, - 628, 628, 656, 628, 628, 628, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 628, 651, 651, 628, - 628, 653, 657, 628, 647, 654, 653, 647, 628, 322, - - 628, 325, 628, 325, 658, 659, 628, 642, 628, 628, - 628, 628, 660, 628, 628, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 628, 390, - 628, 390, 647, 647, 653, 647, 394, 399, 658, 658, - 659, 659, 628, 628, 628, 628, 628, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 322, 658, 659, 628, 628, 628, 661, - - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 394, 628, - 628, 628, 628, 662, 628, 42, 42, 628, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 663, 628, 664, - 628, 42, 628, 42, 42, 42, 42, 42, 42, 665, - 666, 667, 665, 668, 664, 664, 628, 42, 42, 628, - 628, 665, 665, 666, 628, 666, 669, 669, 667, 667, - 665, 667, 628, 628, 665, 665, 665, 665, 665, 668, - 668, 664, 628, 628, 628, 669, 628, 628, 665, 669, - 665, 665, 665, 665, 668, 628, 664, 628, 628, 665, - - 665, 665, 665, 665, 628, 668, 664, 664, 628, 628, - 665, 665, 665, 665, 668, 668, 665, 665, 665, 628, - 628, 665, 665, 628, 628, 665, 665, 0, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628 + 704, 1, 704, 3, 3, 3, 3, 3, 705, 705, + 704, 11, 704, 704, 704, 704, 706, 707, 704, 704, + 708, 704, 704, 704, 704, 704, 704, 704, 709, 709, + 709, 704, 704, 704, 704, 710, 710, 704, 704, 710, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 704, 704, 704, 40, + 711, 711, 40, 704, 704, 704, 706, 707, 704, 704, + 708, 704, 704, 704, 704, 704, 704, 712, 713, 713, + 713, 704, 704, 704, 704, 40, 40, 704, 704, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 704, 704, 704, 40, + 711, 711, 40, 704, 704, 704, 704, 704, 31, 31, + 31, 714, 714, 704, 704, 704, 704, 704, 715, 704, + 716, 704, 704, 704, 704, 716, 716, 704, 706, 704, + 706, 717, 707, 707, 704, 704, 704, 708, 708, 704, + 704, 704, 704, 704, 704, 718, 719, 720, 704, 704, + 718, 31, 704, 721, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 40, 704, 40, 40, 40, 704, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 704, 704, 40, 704, 711, 40, 704, 722, 722, + 723, 712, 724, 720, 712, 712, 704, 723, 81, 704, + 725, 704, 714, 704, 715, 704, 716, 726, 716, 704, + 717, 707, 704, 704, 719, 719, 727, 704, 720, 704, + 718, 718, 704, 721, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 704, 40, 728, 704, 728, 704, 729, + 704, 730, 724, 724, 731, 730, 724, 234, 712, 723, + 723, 704, 725, 704, 704, 704, 726, 732, 719, 727, + 704, 719, 704, 263, 704, 263, 704, 704, 704, 733, + 704, 704, 704, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 704, 728, 728, 704, 729, 730, 734, + 719, 724, 731, 730, 724, 704, 339, 704, 342, 704, + 342, 735, 736, 704, 719, 704, 704, 704, 704, 737, + 704, 704, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 704, 407, 704, 407, 724, + 724, 730, 724, 411, 416, 735, 735, 736, 736, 704, + 704, 704, 704, 704, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 339, 735, 736, 704, 704, 704, 738, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 411, 704, 704, 704, 704, + 739, 704, 40, 40, 704, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 740, 704, 40, 704, + 741, 704, 40, 704, 40, 40, 40, 40, 40, 40, + 40, 40, 742, 743, 744, 742, 742, 704, 578, 558, + 745, 741, 741, 704, 40, 40, 40, 704, 704, 742, + 742, 742, 743, 704, 743, 746, 746, 744, 744, 742, + + 744, 744, 704, 704, 742, 742, 742, 742, 742, 742, + 747, 704, 704, 742, 578, 742, 578, 578, 704, 745, + 745, 741, 704, 40, 704, 742, 704, 704, 704, 746, + 746, 704, 704, 742, 742, 746, 744, 704, 742, 742, + 742, 742, 742, 740, 740, 742, 748, 744, 742, 742, + 704, 742, 578, 578, 619, 578, 745, 704, 741, 704, + 742, 704, 704, 742, 742, 639, 742, 742, 742, 743, + 748, 748, 748, 748, 747, 742, 619, 704, 745, 741, + 741, 704, 704, 742, 742, 742, 742, 743, 743, 748, + 745, 745, 742, 639, 639, 704, 704, 742, 742, 704, + + 704, 742, 742, 0, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704 } ; -static yyconst flex_int16_t yy_nxt[3654] = +static yyconst flex_int16_t yy_nxt[3969] = { 0, 14, 15, 15, 15, 15, 16, 17, 14, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, @@ -666,405 +693,439 @@ 37, 36, 22, 14, 38, 39, 36, 40, 41, 42, 43, 44, 45, 46, 36, 47, 36, 36, 36, 48, 49, 50, 51, 52, 53, 54, 55, 56, 36, 36, - 57, 58, 59, 14, 14, 14, 60, 62, 63, 15, - 63, 63, 64, 65, 62, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 84, 84, 84, 85, 84, 70, - - 62, 86, 87, 84, 88, 89, 90, 91, 92, 93, - 94, 84, 95, 84, 84, 84, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 84, 84, 105, 106, 107, - 62, 62, 62, 108, 109, 111, 112, 113, 114, 115, - 116, 117, 111, 112, 113, 114, 115, 116, 117, 110, - 119, 134, 138, 119, 143, 134, 145, 147, 149, 148, - 148, 148, 150, 144, 146, 159, 139, 134, 151, 163, - 164, 120, 109, 121, 120, 581, 121, 141, 135, 134, - 110, 556, 166, 160, 161, 138, 176, 110, 165, 165, - 165, 165, 166, 166, 135, 177, 143, 186, 495, 139, - - 567, 141, 145, 166, 178, 144, 166, 628, 122, 167, - 146, 122, 62, 123, 124, 123, 123, 62, 125, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 126, 127, 127, 127, 62, 128, 129, 130, 127, 127, - 127, 127, 127, 127, 62, 62, 62, 62, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 131, 62, 62, 127, 127, 127, 127, 153, - 212, 154, 154, 154, 153, 212, 154, 154, 154, 153, - 315, 154, 154, 154, 179, 165, 165, 165, 165, 163, - - 164, 182, 221, 155, 180, 224, 222, 166, 155, 183, - 595, 166, 223, 155, 184, 181, 167, 213, 581, 185, - 156, 224, 213, 564, 157, 628, 165, 165, 165, 165, - 628, 168, 165, 165, 165, 165, 165, 165, 165, 165, - 147, 134, 219, 219, 219, 166, 583, 167, 147, 166, - 148, 148, 148, 167, 187, 166, 195, 167, 166, 166, - 188, 189, 166, 191, 194, 190, 166, 192, 135, 166, - 582, 196, 173, 166, 197, 565, 166, 170, 171, 166, - 166, 193, 174, 172, 198, 175, 203, 166, 556, 166, - 166, 199, 166, 166, 204, 565, 166, 166, 246, 246, - - 166, 205, 566, 208, 200, 201, 166, 202, 206, 166, - 166, 149, 207, 166, 166, 150, 209, 210, 211, 187, - 166, 151, 566, 166, 166, 188, 215, 166, 581, 143, - 190, 216, 134, 217, 218, 218, 145, 216, 144, 217, - 218, 218, 230, 226, 146, 227, 227, 227, 226, 166, - 227, 227, 227, 226, 141, 227, 227, 227, 168, 166, - 160, 161, 166, 166, 248, 248, 248, 228, 166, 557, - 166, 166, 228, 166, 255, 256, 166, 228, 170, 171, - 166, 315, 166, 166, 229, 172, 176, 179, 157, 628, - 496, 327, 166, 182, 628, 177, 224, 180, 322, 628, - - 166, 183, 556, 166, 178, 166, 184, 252, 181, 186, - 495, 185, 166, 224, 328, 166, 191, 187, 166, 520, - 192, 554, 166, 188, 189, 166, 166, 166, 190, 166, - 329, 166, 195, 540, 193, 198, 539, 166, 244, 166, - 166, 166, 166, 199, 166, 166, 194, 196, 166, 166, - 197, 496, 166, 524, 208, 203, 200, 201, 166, 202, - 521, 166, 166, 204, 166, 246, 246, 209, 523, 166, - 205, 522, 166, 519, 206, 166, 210, 211, 207, 166, - 166, 500, 166, 499, 153, 187, 154, 154, 154, 498, - 166, 188, 215, 166, 565, 153, 190, 154, 154, 154, - - 153, 497, 154, 154, 154, 148, 148, 148, 155, 247, - 247, 247, 241, 241, 241, 241, 586, 462, 153, 155, - 154, 154, 154, 460, 155, 156, 243, 155, 408, 467, - 244, 155, 409, 166, 466, 157, 628, 165, 165, 165, - 165, 628, 155, 166, 262, 464, 166, 257, 257, 257, - 257, 166, 309, 309, 309, 166, 166, 463, 167, 628, - 462, 166, 263, 166, 166, 166, 166, 264, 166, 166, - 267, 460, 596, 166, 166, 335, 166, 324, 324, 324, - 166, 597, 166, 166, 166, 415, 258, 166, 259, 414, - 265, 266, 166, 413, 268, 166, 166, 166, 166, 260, - - 272, 269, 166, 261, 411, 410, 270, 166, 166, 166, - 166, 166, 166, 166, 271, 166, 335, 166, 166, 241, - 241, 241, 241, 166, 407, 166, 166, 166, 275, 273, - 166, 166, 166, 331, 274, 166, 166, 276, 166, 406, - 166, 166, 166, 405, 335, 166, 166, 277, 278, 166, - 166, 166, 166, 166, 166, 605, 390, 279, 166, 166, - 346, 607, 166, 166, 606, 166, 280, 166, 166, 166, - 608, 166, 166, 166, 281, 282, 166, 166, 283, 166, - 166, 166, 345, 285, 284, 287, 166, 166, 288, 286, - 344, 166, 166, 166, 166, 289, 166, 166, 343, 166, - - 290, 166, 291, 166, 342, 166, 166, 294, 341, 340, - 292, 166, 335, 166, 166, 166, 236, 166, 166, 615, - 166, 166, 293, 166, 234, 166, 166, 295, 616, 296, - 607, 166, 166, 166, 166, 166, 325, 307, 166, 582, - 297, 254, 166, 166, 253, 166, 166, 300, 166, 166, - 298, 301, 252, 302, 299, 166, 166, 251, 166, 166, - 249, 166, 166, 166, 304, 166, 166, 166, 166, 166, - 303, 305, 166, 166, 308, 239, 166, 166, 615, 140, - 166, 133, 166, 237, 306, 166, 236, 595, 281, 282, - 311, 234, 218, 218, 218, 311, 232, 218, 218, 218, - - 219, 219, 219, 323, 323, 323, 316, 316, 241, 316, - 389, 389, 389, 226, 312, 227, 227, 227, 214, 312, - 318, 169, 228, 162, 319, 228, 247, 247, 247, 158, - 142, 313, 241, 241, 241, 241, 628, 228, 137, 320, - 246, 246, 332, 332, 332, 332, 331, 132, 155, 248, - 248, 248, 214, 169, 628, 162, 333, 158, 142, 137, - 334, 132, 628, 110, 321, 321, 321, 321, 321, 321, - 109, 628, 61, 628, 628, 321, 321, 321, 321, 321, - 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, - 321, 321, 321, 321, 321, 321, 321, 321, 336, 336, - - 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, - 336, 336, 336, 336, 336, 336, 336, 337, 337, 337, - 336, 336, 336, 336, 337, 337, 337, 337, 337, 337, - 336, 628, 336, 336, 628, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 337, 337, 337, 337, 337, 337, 337, 337, 336, 336, - 336, 336, 336, 336, 336, 338, 338, 338, 338, 338, + 57, 58, 59, 60, 36, 36, 61, 62, 64, 65, + 15, 65, 65, 66, 67, 64, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 86, 86, 86, 87, 86, + + 72, 64, 88, 89, 86, 90, 91, 92, 93, 94, + 95, 96, 86, 97, 86, 86, 86, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 86, 86, 107, 108, + 109, 110, 86, 86, 111, 112, 113, 115, 116, 117, + 118, 119, 120, 121, 115, 116, 117, 118, 119, 120, + 121, 114, 123, 140, 146, 123, 143, 144, 151, 140, + 155, 153, 156, 156, 156, 140, 167, 152, 147, 154, + 171, 172, 621, 124, 113, 125, 124, 583, 125, 151, + 141, 149, 114, 157, 168, 169, 183, 158, 152, 114, + 182, 174, 141, 159, 186, 344, 184, 196, 704, 185, + + 632, 174, 174, 187, 164, 174, 174, 677, 174, 174, + 126, 266, 188, 126, 64, 127, 128, 127, 127, 64, + 129, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 130, 131, 131, 131, 64, 132, 133, 134, + 131, 131, 131, 131, 131, 131, 64, 64, 64, 64, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 135, 64, 64, 136, 131, 131, + 137, 131, 161, 612, 162, 162, 162, 161, 603, 162, + 162, 162, 161, 146, 162, 162, 162, 173, 173, 173, + + 173, 173, 173, 173, 173, 189, 163, 147, 174, 174, + 222, 163, 204, 208, 596, 190, 163, 627, 175, 248, + 174, 174, 175, 164, 174, 174, 191, 165, 704, 173, + 173, 173, 173, 704, 512, 197, 192, 178, 174, 174, + 205, 198, 199, 704, 193, 174, 200, 223, 588, 194, + 175, 174, 174, 201, 195, 206, 174, 202, 207, 176, + 249, 209, 177, 176, 143, 144, 177, 140, 174, 174, + 213, 203, 174, 174, 210, 211, 657, 212, 214, 174, + 180, 181, 218, 216, 222, 215, 174, 217, 621, 149, + 513, 176, 220, 221, 177, 219, 197, 174, 174, 704, + + 174, 174, 198, 227, 171, 172, 174, 200, 151, 653, + 228, 593, 229, 230, 230, 153, 228, 152, 229, 230, + 230, 223, 155, 154, 231, 231, 231, 233, 623, 242, + 238, 234, 239, 239, 239, 140, 238, 235, 239, 239, + 239, 238, 178, 239, 239, 239, 236, 168, 169, 174, + 174, 182, 174, 183, 240, 174, 174, 174, 174, 204, + 240, 186, 141, 184, 622, 240, 185, 153, 174, 174, + 187, 241, 174, 174, 189, 154, 165, 704, 192, 188, + 174, 174, 704, 512, 190, 583, 193, 196, 140, 174, + 174, 194, 537, 174, 174, 191, 195, 197, 174, 174, + + 208, 201, 345, 198, 199, 202, 205, 174, 200, 425, + 149, 174, 174, 426, 209, 621, 174, 174, 346, 203, + 619, 206, 174, 213, 207, 174, 174, 210, 211, 218, + 212, 214, 174, 216, 260, 260, 174, 217, 215, 220, + 221, 584, 219, 197, 174, 174, 583, 174, 174, 198, + 227, 581, 157, 174, 200, 155, 158, 156, 156, 156, + 269, 270, 159, 142, 142, 142, 142, 142, 142, 156, + 156, 156, 255, 255, 255, 255, 561, 142, 174, 174, + 142, 261, 261, 261, 174, 174, 257, 262, 262, 262, + 258, 163, 173, 173, 173, 173, 272, 272, 272, 272, + + 279, 174, 174, 163, 560, 280, 281, 704, 174, 174, + 284, 252, 278, 175, 174, 174, 258, 174, 174, 174, + 282, 283, 174, 174, 285, 174, 174, 174, 174, 286, + 174, 174, 289, 594, 287, 273, 541, 274, 288, 174, + 174, 174, 174, 174, 290, 174, 174, 332, 275, 174, + 174, 291, 276, 540, 173, 294, 174, 271, 272, 292, + 595, 277, 236, 293, 174, 174, 174, 174, 295, 174, + 174, 174, 174, 174, 174, 296, 297, 174, 174, 174, + 298, 299, 174, 174, 300, 539, 174, 174, 174, 174, + 301, 302, 303, 304, 305, 306, 308, 174, 174, 536, + + 307, 517, 174, 174, 174, 174, 311, 174, 174, 516, + 174, 174, 174, 174, 309, 174, 174, 310, 312, 174, + 174, 174, 174, 313, 314, 174, 174, 174, 318, 315, + 174, 174, 319, 316, 317, 174, 174, 320, 174, 321, + 174, 174, 322, 174, 174, 325, 174, 174, 515, 174, + 174, 174, 174, 323, 174, 174, 260, 260, 174, 298, + 299, 326, 326, 326, 328, 514, 230, 230, 230, 328, + 332, 230, 230, 230, 231, 231, 231, 339, 174, 174, + 333, 333, 255, 333, 479, 236, 174, 174, 329, 340, + 340, 340, 236, 329, 335, 477, 240, 484, 336, 341, + + 341, 341, 142, 142, 142, 330, 255, 255, 255, 255, + 704, 240, 483, 337, 260, 260, 142, 365, 174, 368, + 348, 255, 255, 255, 255, 261, 261, 261, 174, 174, + 481, 364, 174, 174, 366, 348, 174, 377, 338, 338, + 338, 338, 338, 338, 480, 174, 174, 163, 704, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, - 338, 338, 339, 338, 250, 250, 250, 338, 338, 338, - 338, 250, 250, 250, 250, 250, 250, 338, 628, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 349, 349, 349, 349, 262, 262, 262, 367, + 174, 369, 370, 372, 174, 174, 350, 479, 374, 477, + 351, 352, 174, 174, 174, 174, 174, 174, 704, 353, + + 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, + 353, 353, 353, 353, 353, 353, 353, 353, 354, 354, + 354, 353, 353, 353, 353, 354, 354, 354, 354, 354, + 354, 353, 432, 353, 353, 431, 354, 354, 354, 354, + 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + 354, 354, 354, 354, 354, 354, 354, 354, 354, 353, + 353, 353, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 356, + 355, 174, 174, 371, 355, 355, 355, 355, 272, 272, + 272, 272, 373, 375, 355, 385, 355, 355, 174, 174, + + 376, 378, 174, 174, 174, 174, 379, 174, 174, 174, + 174, 174, 174, 174, 174, 382, 174, 174, 430, 174, + 174, 383, 355, 355, 355, 380, 384, 273, 381, 274, + 174, 174, 174, 174, 387, 174, 386, 174, 174, 388, + 275, 174, 174, 428, 276, 174, 174, 174, 174, 427, + 272, 389, 391, 277, 174, 174, 390, 174, 174, 174, + 174, 394, 392, 174, 174, 174, 174, 393, 174, 174, + 395, 397, 174, 174, 396, 398, 174, 174, 174, 174, + 399, 400, 174, 174, 174, 174, 174, 174, 174, 174, + 401, 174, 174, 174, 174, 174, 174, 402, 403, 326, + + 326, 326, 352, 174, 174, 174, 174, 405, 405, 405, + 406, 406, 406, 333, 333, 255, 333, 340, 340, 340, + 424, 329, 333, 333, 255, 333, 513, 410, 423, 329, + 422, 411, 341, 341, 341, 538, 410, 174, 174, 240, + 411, 352, 412, 412, 349, 412, 337, 333, 333, 255, + 333, 174, 436, 433, 704, 337, 413, 174, 174, 407, + 414, 410, 174, 174, 437, 416, 434, 272, 255, 255, + 255, 255, 174, 174, 658, 415, 435, 174, 174, 438, + 337, 332, 348, 659, 174, 174, 174, 174, 363, 417, + 417, 417, 417, 417, 417, 362, 236, 174, 174, 440, + + 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, + 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, + 417, 417, 417, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, + 418, 418, 419, 419, 419, 418, 418, 418, 418, 419, + 419, 419, 419, 419, 419, 418, 361, 418, 418, 360, + 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, + 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, + 419, 419, 419, 418, 418, 418, 420, 420, 420, 420, + 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, + + 420, 420, 420, 421, 420, 174, 174, 173, 420, 420, + 420, 420, 349, 349, 349, 349, 174, 174, 420, 439, + 420, 420, 255, 255, 255, 255, 350, 441, 447, 174, + 351, 174, 174, 443, 442, 359, 348, 174, 174, 446, + 258, 174, 174, 445, 174, 174, 420, 420, 420, 444, + 174, 174, 448, 358, 174, 174, 449, 174, 174, 450, + 174, 174, 174, 174, 451, 452, 174, 174, 174, 453, + 455, 454, 456, 457, 174, 459, 174, 174, 174, 174, + 174, 174, 174, 458, 174, 174, 174, 174, 460, 357, + 174, 174, 174, 174, 463, 352, 462, 461, 174, 174, + + 464, 174, 174, 248, 174, 174, 174, 174, 174, 174, + 248, 174, 174, 174, 174, 246, 465, 405, 405, 405, + 406, 406, 406, 255, 255, 255, 255, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 348, 342, 329, + 704, 351, 704, 466, 466, 466, 466, 466, 466, 466, + 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, + 466, 466, 467, 467, 467, 466, 466, 466, 466, 467, + 467, 467, 467, 467, 467, 466, 324, 466, 466, 268, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + + 467, 467, 467, 466, 466, 466, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 469, 468, 485, 267, 352, 468, 468, + 468, 468, 333, 333, 255, 333, 174, 174, 468, 471, + 468, 468, 266, 472, 486, 488, 410, 174, 174, 487, + 411, 490, 174, 174, 174, 174, 174, 174, 473, 412, + 412, 349, 412, 174, 174, 337, 468, 468, 468, 255, + 255, 255, 255, 413, 489, 174, 174, 414, 265, 491, + 492, 174, 174, 348, 174, 174, 493, 174, 174, 263, + 174, 174, 415, 499, 704, 474, 474, 474, 474, 474, + + 474, 174, 174, 494, 174, 174, 474, 474, 474, 474, + 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, + 474, 474, 474, 474, 474, 474, 474, 474, 474, 333, + 333, 255, 333, 495, 496, 253, 174, 174, 498, 174, + 174, 497, 500, 410, 174, 174, 501, 416, 148, 174, + 174, 174, 174, 502, 505, 174, 174, 174, 174, 174, + 174, 139, 337, 333, 333, 255, 333, 334, 334, 334, + 334, 334, 334, 334, 334, 334, 334, 410, 334, 334, + 334, 411, 334, 334, 334, 334, 334, 334, 334, 475, + 475, 475, 475, 475, 475, 334, 337, 334, 334, 334, + + 475, 475, 475, 475, 475, 475, 475, 475, 475, 475, + 475, 475, 475, 475, 475, 475, 475, 475, 475, 475, + 475, 475, 475, 334, 334, 334, 334, 334, 334, 334, + 334, 503, 507, 504, 518, 506, 250, 174, 174, 248, + 174, 174, 508, 509, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 510, 333, 333, 255, 333, 678, + 333, 333, 255, 333, 174, 174, 174, 174, 679, 410, + 174, 174, 520, 336, 410, 248, 174, 174, 414, 519, + 333, 333, 255, 333, 174, 522, 521, 594, 337, 174, + 174, 174, 174, 337, 410, 525, 523, 526, 511, 174, + + 174, 524, 527, 174, 174, 528, 174, 174, 529, 630, + 174, 174, 246, 337, 174, 174, 530, 174, 174, 531, + 174, 174, 532, 174, 174, 174, 174, 533, 174, 174, + 174, 174, 244, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 534, 535, 680, 174, 174, + 174, 174, 543, 544, 174, 174, 681, 174, 174, 545, + 545, 545, 545, 704, 174, 174, 174, 174, 174, 174, + 548, 550, 549, 174, 174, 174, 174, 551, 226, 552, + 553, 225, 174, 174, 174, 174, 554, 174, 174, 555, + 174, 174, 556, 174, 174, 174, 174, 174, 174, 179, + + 174, 174, 170, 174, 174, 557, 557, 557, 557, 166, + 174, 174, 174, 563, 174, 174, 173, 173, 173, 173, + 150, 546, 174, 174, 547, 174, 174, 145, 565, 174, + 174, 174, 174, 567, 569, 691, 566, 175, 568, 570, + 174, 174, 174, 174, 692, 174, 174, 174, 174, 571, + 174, 174, 572, 174, 174, 138, 174, 174, 174, 174, + 226, 174, 174, 594, 174, 174, 225, 558, 179, 580, + 559, 174, 586, 564, 557, 557, 557, 557, 173, 574, + 587, 271, 585, 594, 575, 630, 174, 174, 174, 174, + 174, 174, 174, 174, 565, 576, 174, 174, 174, 174, + + 174, 174, 624, 174, 174, 174, 174, 174, 174, 680, + 595, 174, 174, 691, 170, 597, 166, 150, 622, 145, + 138, 704, 657, 114, 113, 63, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 557, 704, 704, 577, + 573, 557, 557, 557, 557, 573, 574, 573, 573, 573, + 573, 575, 573, 573, 573, 573, 573, 573, 573, 578, + 578, 578, 576, 573, 573, 573, 578, 578, 578, 578, + 578, 578, 573, 578, 573, 573, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + + 573, 573, 573, 558, 578, 578, 579, 578, 588, 589, + 588, 590, 596, 597, 589, 597, 598, 588, 589, 588, + 590, 704, 704, 600, 603, 604, 603, 605, 594, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 601, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 595, 704, 704, 704, 704, + 704, 704, 704, 606, 704, 607, 704, 704, 704, 704, + 590, 704, 704, 592, 704, 598, 608, 704, 602, 611, + 609, 704, 592, 704, 704, 670, 605, 704, 704, 610, + 612, 613, 612, 614, 591, 591, 591, 591, 591, 591, + + 591, 591, 591, 591, 591, 591, 591, 591, 615, 615, + 615, 616, 591, 591, 591, 615, 615, 615, 615, 615, + 615, 591, 615, 591, 591, 615, 615, 615, 615, 615, + 615, 615, 615, 615, 615, 615, 615, 615, 615, 615, + 615, 615, 615, 615, 615, 615, 615, 615, 615, 591, + 591, 591, 617, 615, 615, 618, 615, 588, 589, 588, + 588, 588, 589, 588, 588, 588, 589, 588, 590, 588, + 589, 588, 590, 588, 589, 588, 590, 627, 628, 627, + 627, 597, 589, 597, 597, 596, 597, 589, 597, 598, + 704, 594, 632, 633, 632, 634, 600, 704, 704, 596, + + 597, 589, 597, 598, 596, 597, 636, 597, 598, 704, + 600, 704, 704, 630, 704, 704, 704, 704, 601, 588, + 704, 704, 625, 588, 704, 704, 625, 590, 704, 704, + 592, 590, 601, 704, 592, 626, 704, 704, 592, 627, + 704, 704, 629, 597, 704, 704, 631, 704, 598, 704, + 704, 602, 704, 704, 634, 704, 704, 635, 603, 604, + 603, 603, 598, 704, 704, 602, 704, 598, 704, 704, + 602, 596, 597, 589, 597, 598, 603, 604, 603, 603, + 704, 704, 600, 603, 604, 603, 605, 588, 589, 588, + 590, 588, 589, 588, 590, 704, 704, 273, 704, 274, + + 588, 589, 588, 590, 601, 588, 589, 588, 590, 704, + 275, 704, 704, 704, 276, 273, 704, 274, 704, 704, + 603, 704, 606, 638, 607, 704, 704, 704, 275, 704, + 704, 704, 276, 704, 637, 608, 639, 602, 603, 609, + 640, 638, 704, 642, 704, 605, 704, 704, 610, 590, + 704, 704, 592, 590, 704, 704, 592, 588, 589, 588, + 590, 641, 590, 704, 704, 592, 704, 590, 704, 704, + 592, 573, 644, 645, 644, 611, 704, 647, 612, 613, + 612, 612, 648, 612, 613, 612, 612, 612, 613, 612, + 614, 704, 704, 649, 603, 604, 603, 605, 704, 175, + + 704, 704, 704, 704, 175, 704, 704, 704, 616, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 643, + 704, 704, 592, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 606, 611, 607, 704, 650, 704, 704, + 612, 704, 704, 651, 704, 612, 608, 704, 651, 614, + 609, 704, 652, 704, 704, 704, 605, 704, 704, 610, + 573, 644, 645, 644, 611, 646, 647, 646, 646, 646, + 646, 648, 646, 646, 646, 646, 646, 646, 646, 654, + 654, 654, 649, 646, 646, 646, 654, 654, 654, 654, + 654, 654, 646, 654, 646, 646, 654, 654, 654, 654, + + 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 646, 646, 646, 655, 654, 654, 656, 654, 588, 589, + 588, 590, 627, 628, 627, 627, 627, 628, 627, 627, + 632, 633, 632, 632, 632, 633, 632, 632, 632, 633, + 632, 634, 588, 589, 588, 590, 597, 589, 597, 597, + 588, 589, 588, 590, 704, 704, 594, 596, 597, 589, + 597, 598, 704, 704, 704, 704, 704, 704, 600, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 630, 704, + 590, 704, 704, 592, 627, 704, 704, 629, 627, 704, + + 601, 629, 632, 704, 704, 660, 632, 704, 704, 660, + 634, 666, 704, 635, 661, 704, 704, 592, 597, 704, + 704, 631, 590, 704, 704, 592, 588, 589, 588, 590, + 598, 704, 704, 602, 429, 662, 663, 662, 664, 665, + 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, + 665, 665, 665, 704, 704, 704, 665, 665, 665, 665, + 588, 589, 588, 590, 704, 704, 665, 704, 665, 665, + 667, 603, 604, 603, 605, 704, 704, 644, 645, 644, + 644, 704, 574, 588, 589, 588, 590, 575, 590, 704, + 704, 592, 704, 704, 665, 665, 665, 590, 576, 704, + + 592, 704, 704, 704, 668, 593, 670, 589, 670, 671, + 606, 600, 607, 704, 644, 645, 644, 644, 704, 574, + 704, 704, 590, 608, 575, 592, 704, 609, 603, 604, + 603, 605, 704, 605, 704, 576, 610, 704, 673, 644, + 704, 704, 669, 704, 704, 590, 704, 704, 592, 596, + 597, 589, 597, 598, 588, 589, 588, 590, 704, 704, + 600, 588, 589, 588, 590, 704, 704, 606, 671, 607, + 704, 674, 632, 633, 632, 634, 644, 704, 704, 669, + 608, 704, 601, 704, 609, 588, 589, 588, 588, 704, + 605, 704, 704, 610, 588, 589, 588, 588, 588, 589, + + 588, 590, 588, 589, 588, 590, 704, 704, 704, 704, + 704, 704, 598, 704, 704, 602, 675, 704, 704, 592, + 704, 704, 704, 676, 704, 704, 592, 704, 704, 704, + 704, 704, 704, 704, 634, 704, 704, 635, 704, 704, + 704, 704, 588, 589, 588, 590, 704, 588, 704, 704, + 625, 588, 589, 588, 590, 704, 588, 704, 704, 625, + 590, 704, 704, 592, 590, 704, 704, 592, 482, 682, + 683, 682, 684, 685, 685, 685, 685, 685, 685, 685, + 685, 685, 685, 685, 685, 685, 685, 704, 704, 704, + 685, 685, 685, 685, 704, 686, 704, 687, 704, 704, + + 685, 704, 685, 685, 590, 704, 704, 592, 588, 589, + 588, 590, 704, 590, 704, 704, 592, 670, 589, 670, + 670, 704, 594, 593, 670, 689, 670, 671, 685, 685, + 685, 593, 670, 589, 670, 671, 704, 600, 593, 670, + 589, 670, 671, 704, 600, 612, 613, 612, 614, 595, + 593, 670, 589, 670, 671, 704, 600, 588, 589, 588, + 588, 704, 704, 704, 673, 704, 616, 704, 704, 704, + 675, 673, 704, 592, 573, 644, 645, 644, 611, 670, + 647, 704, 688, 673, 704, 648, 671, 704, 704, 674, + 588, 589, 588, 588, 671, 704, 649, 674, 704, 704, + + 704, 671, 704, 704, 674, 704, 704, 614, 704, 704, + 652, 704, 704, 690, 704, 704, 674, 704, 704, 588, + 704, 704, 625, 588, 589, 588, 590, 588, 589, 588, + 590, 588, 589, 588, 590, 704, 704, 611, 704, 704, + 650, 588, 589, 588, 590, 670, 589, 670, 670, 704, + 594, 704, 588, 704, 704, 625, 704, 593, 670, 589, + 670, 671, 704, 600, 704, 588, 589, 588, 590, 693, + 704, 704, 704, 704, 704, 704, 704, 595, 704, 704, + 704, 694, 704, 704, 704, 590, 704, 704, 592, 590, + 673, 704, 592, 590, 704, 704, 592, 588, 589, 588, + + 588, 704, 704, 590, 704, 704, 592, 670, 695, 704, + 688, 588, 589, 588, 588, 588, 589, 588, 590, 704, + 671, 704, 704, 674, 704, 704, 704, 590, 704, 704, + 592, 542, 696, 697, 696, 698, 699, 699, 699, 699, + 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, + 704, 704, 704, 699, 699, 699, 699, 704, 704, 588, + 704, 704, 625, 699, 704, 699, 699, 704, 588, 589, + 588, 590, 704, 588, 704, 704, 625, 590, 704, 704, + 592, 588, 589, 588, 588, 588, 589, 588, 588, 704, + 704, 699, 699, 699, 562, 700, 701, 700, 702, 703, + + 703, 703, 703, 703, 703, 703, 703, 703, 703, 703, + 703, 703, 703, 704, 704, 704, 703, 703, 703, 703, + 588, 589, 588, 590, 704, 704, 703, 704, 703, 703, + 590, 704, 704, 592, 588, 589, 588, 590, 704, 704, + 704, 704, 704, 588, 704, 704, 625, 588, 704, 704, + 625, 704, 704, 704, 703, 703, 703, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 590, 704, 704, 592, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 590, 704, 704, 592, + + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 139, 139, 704, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 142, 704, 142, 142, + 142, 148, 148, 704, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 160, 160, 160, 160, 160, 160, + 160, 160, 704, 704, 704, 160, 160, 174, 174, 704, + 704, 174, 174, 704, 174, 174, 174, 174, 174, 224, + 704, 704, 224, 224, 224, 224, 224, 232, 232, 704, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 237, 237, 237, 237, 237, 237, 237, 237, 704, 704, + + 704, 237, 237, 243, 243, 243, 243, 243, 243, 243, + 704, 243, 243, 243, 243, 243, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 247, + 247, 704, 247, 704, 247, 247, 247, 251, 704, 704, + 251, 251, 251, 251, 251, 254, 254, 254, 254, 254, + 254, 254, 254, 704, 704, 704, 254, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 264, 264, 704, 704, 264, 704, 704, + 264, 264, 327, 327, 327, 327, 327, 327, 327, 327, + + 704, 704, 704, 327, 327, 331, 331, 331, 331, 331, + 331, 331, 331, 704, 704, 704, 331, 334, 334, 334, + 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, + 343, 343, 704, 704, 343, 704, 704, 343, 343, 347, + 704, 704, 347, 704, 347, 347, 347, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 404, 404, 404, 404, 404, 404, 404, 404, 704, 704, + 704, 404, 408, 408, 704, 704, 408, 704, 704, 408, + 408, 409, 704, 704, 409, 409, 333, 333, 333, 333, + 333, 333, 333, 333, 333, 333, 333, 333, 333, 352, + + 352, 352, 352, 352, 352, 352, 352, 352, 352, 352, + 352, 352, 429, 429, 429, 429, 429, 704, 429, 429, + 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, + 470, 470, 470, 476, 476, 476, 476, 476, 476, 476, + 476, 476, 476, 476, 476, 476, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 482, + 482, 482, 482, 482, 704, 482, 482, 542, 542, 542, + 542, 542, 704, 542, 542, 562, 562, 562, 562, 562, + 704, 562, 562, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 582, 582, 582, 582, - 338, 628, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 338, 338, 338, 338, 338, - 338, 338, 257, 257, 257, 257, 166, 166, 348, 309, - 309, 309, 560, 561, 560, 562, 166, 166, 166, 166, - 166, 166, 166, 166, 628, 347, 349, 166, 628, 350, - 628, 312, 166, 166, 166, 166, 166, 166, 628, 351, - 166, 258, 354, 259, 166, 628, 628, 166, 628, 166, - 352, 353, 166, 355, 260, 166, 356, 166, 261, 166, - 628, 166, 166, 166, 357, 358, 166, 166, 166, 166, - - 166, 166, 359, 166, 166, 361, 166, 166, 166, 360, - 628, 166, 166, 166, 362, 166, 628, 166, 166, 166, - 166, 166, 166, 166, 628, 166, 166, 628, 628, 363, - 628, 166, 364, 166, 166, 166, 628, 366, 365, 367, - 166, 166, 166, 166, 628, 166, 166, 166, 166, 368, - 166, 166, 369, 166, 166, 166, 166, 166, 166, 628, - 166, 628, 370, 166, 628, 371, 166, 628, 166, 166, - 628, 166, 166, 166, 166, 628, 166, 372, 166, 628, - 373, 628, 374, 166, 166, 166, 628, 166, 166, 166, - 628, 166, 375, 166, 166, 166, 166, 628, 377, 166, - - 376, 166, 166, 628, 166, 166, 378, 166, 379, 166, - 628, 166, 628, 380, 166, 166, 166, 166, 628, 166, - 381, 382, 166, 166, 628, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 383, 628, 166, 166, 166, 166, - 628, 166, 384, 628, 166, 166, 385, 386, 166, 166, - 166, 166, 166, 388, 388, 388, 316, 316, 241, 316, - 628, 628, 316, 316, 241, 316, 323, 323, 323, 628, - 393, 628, 628, 628, 394, 312, 393, 324, 324, 324, - 394, 628, 395, 395, 332, 395, 628, 628, 228, 320, - 316, 316, 241, 316, 628, 320, 396, 166, 628, 628, - - 397, 628, 628, 628, 393, 421, 166, 166, 399, 628, - 166, 241, 241, 241, 241, 398, 166, 416, 166, 166, - 388, 388, 388, 320, 315, 331, 628, 417, 166, 628, - 628, 166, 400, 400, 400, 400, 400, 400, 628, 224, - 628, 628, 312, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, - 400, 400, 400, 400, 400, 400, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, - 401, 401, 401, 401, 401, 402, 402, 402, 401, 401, - 401, 401, 402, 402, 402, 402, 402, 402, 401, 628, - - 401, 401, 628, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, - 402, 402, 402, 402, 402, 402, 401, 401, 401, 401, - 401, 401, 401, 403, 403, 403, 403, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, - 404, 403, 326, 326, 326, 403, 403, 403, 403, 326, - 326, 326, 326, 326, 326, 403, 628, 403, 403, 628, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 403, 403, 403, 403, 403, 403, 403, - - 332, 332, 332, 332, 628, 241, 241, 241, 241, 628, - 628, 166, 628, 628, 333, 166, 166, 628, 334, 331, - 628, 166, 418, 244, 166, 166, 166, 419, 166, 166, - 166, 628, 166, 420, 166, 628, 389, 389, 389, 628, - 166, 166, 166, 166, 166, 166, 166, 166, 422, 423, - 166, 166, 424, 628, 166, 166, 166, 166, 628, 166, - 166, 426, 425, 166, 166, 427, 628, 166, 166, 166, - 166, 628, 628, 429, 166, 166, 431, 166, 628, 166, - 628, 428, 166, 166, 166, 166, 166, 628, 166, 166, - 430, 166, 166, 166, 166, 628, 166, 166, 432, 166, - - 433, 166, 166, 436, 166, 166, 628, 437, 628, 166, - 434, 166, 166, 166, 435, 438, 166, 166, 166, 166, - 166, 166, 628, 628, 166, 166, 439, 166, 166, 166, - 628, 166, 166, 441, 440, 166, 628, 166, 166, 166, - 166, 443, 442, 166, 166, 166, 628, 628, 628, 166, - 628, 628, 166, 166, 166, 166, 166, 166, 445, 166, - 166, 166, 628, 444, 446, 447, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 628, 166, 166, 166, 166, - 166, 166, 628, 628, 628, 448, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - - 449, 449, 449, 449, 449, 450, 450, 450, 449, 449, - 449, 449, 450, 450, 450, 450, 450, 450, 449, 628, - 449, 449, 628, 450, 450, 450, 450, 450, 450, 450, - 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, - 450, 450, 450, 450, 450, 450, 449, 449, 449, 449, - 449, 449, 449, 451, 451, 451, 451, 451, 451, 451, - 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, - 452, 451, 391, 391, 391, 451, 451, 451, 451, 391, - 391, 391, 391, 391, 391, 451, 628, 451, 451, 628, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 451, 451, 451, 451, 451, 451, 451, - 335, 241, 241, 241, 241, 628, 628, 166, 166, 628, - 628, 468, 454, 166, 166, 331, 455, 166, 166, 334, - 166, 166, 628, 166, 166, 628, 166, 166, 628, 628, - 628, 456, 241, 241, 241, 241, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 331, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 457, 457, - 457, 457, 457, 457, 242, 242, 242, 242, 242, 457, - 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - - 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - 457, 457, 242, 242, 242, 242, 242, 242, 242, 316, - 316, 241, 316, 628, 395, 395, 332, 395, 628, 316, - 316, 241, 316, 393, 628, 628, 166, 394, 396, 628, - 166, 166, 397, 393, 628, 471, 166, 399, 469, 166, - 470, 166, 320, 166, 166, 628, 628, 398, 560, 561, - 560, 560, 320, 316, 316, 241, 316, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 393, 317, 317, - 317, 394, 317, 317, 317, 317, 317, 317, 317, 458, - 458, 458, 458, 458, 458, 317, 320, 317, 317, 317, - - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 317, 317, 317, 317, 317, 317, 317, - 166, 166, 166, 628, 473, 628, 166, 628, 472, 628, - 166, 166, 166, 166, 166, 166, 474, 166, 166, 166, - 628, 628, 166, 628, 166, 475, 628, 166, 166, 476, - 166, 166, 166, 166, 166, 166, 478, 166, 479, 477, - 166, 628, 628, 166, 628, 480, 166, 166, 166, 166, - 166, 482, 628, 166, 481, 484, 483, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 486, 487, 628, 166, - - 628, 628, 628, 166, 166, 166, 166, 166, 166, 166, - 485, 488, 166, 166, 166, 489, 628, 628, 166, 166, - 628, 628, 628, 166, 166, 490, 166, 166, 166, 166, - 166, 166, 166, 628, 166, 491, 166, 628, 166, 628, - 166, 493, 492, 166, 166, 628, 166, 166, 166, 166, - 628, 166, 316, 316, 241, 316, 628, 316, 316, 241, - 316, 628, 316, 316, 241, 316, 393, 628, 628, 166, - 319, 393, 628, 166, 628, 397, 393, 628, 628, 166, - 494, 501, 166, 166, 166, 320, 166, 628, 628, 166, - 320, 502, 628, 628, 166, 320, 166, 166, 504, 166, - - 166, 503, 166, 628, 166, 166, 166, 628, 628, 166, - 166, 166, 628, 166, 166, 166, 505, 166, 507, 166, - 166, 166, 509, 508, 166, 510, 506, 511, 628, 166, - 166, 512, 166, 166, 628, 166, 166, 166, 166, 628, - 166, 166, 166, 166, 166, 513, 166, 514, 166, 166, - 166, 628, 166, 166, 515, 166, 166, 166, 166, 166, - 166, 166, 628, 166, 166, 516, 166, 166, 166, 166, - 166, 628, 166, 166, 166, 628, 166, 166, 166, 166, - 166, 166, 166, 166, 518, 517, 166, 166, 628, 628, - 166, 527, 166, 166, 628, 166, 166, 166, 166, 526, - - 166, 528, 528, 528, 528, 166, 166, 166, 166, 166, - 628, 166, 166, 628, 628, 166, 166, 166, 166, 529, - 166, 628, 166, 166, 530, 166, 533, 531, 166, 166, - 532, 628, 166, 166, 534, 628, 166, 166, 166, 166, - 628, 166, 166, 535, 166, 166, 166, 166, 628, 166, - 166, 166, 166, 166, 166, 536, 166, 166, 166, 166, - 628, 166, 537, 166, 166, 628, 166, 166, 166, 542, - 628, 166, 538, 538, 538, 538, 166, 166, 166, 628, - 166, 165, 165, 165, 165, 628, 166, 166, 166, 166, - 628, 166, 628, 166, 166, 544, 628, 166, 546, 166, - - 545, 166, 167, 166, 166, 547, 166, 166, 166, 166, - 166, 166, 166, 548, 166, 166, 166, 628, 166, 549, - 166, 166, 628, 166, 628, 166, 166, 628, 166, 166, - 538, 538, 538, 538, 166, 551, 166, 628, 543, 628, - 552, 559, 166, 166, 166, 628, 166, 166, 166, 166, - 558, 553, 166, 166, 166, 166, 166, 628, 166, 628, - 628, 166, 628, 628, 166, 628, 628, 166, 567, 568, - 561, 568, 569, 573, 574, 573, 575, 166, 166, 571, - 560, 561, 560, 560, 628, 628, 628, 166, 166, 628, - 166, 166, 560, 561, 560, 562, 560, 561, 560, 562, - - 628, 572, 584, 585, 584, 584, 568, 561, 568, 568, - 628, 628, 576, 628, 577, 628, 565, 567, 568, 561, - 568, 569, 628, 628, 628, 578, 628, 628, 571, 579, - 567, 568, 561, 568, 569, 628, 628, 628, 586, 628, - 628, 571, 587, 588, 587, 589, 573, 574, 573, 573, - 572, 567, 568, 590, 568, 569, 573, 574, 573, 573, - 628, 628, 628, 572, 573, 574, 573, 575, 560, 561, - 560, 562, 560, 561, 560, 562, 560, 561, 560, 562, - 560, 561, 560, 562, 628, 258, 628, 259, 584, 585, - 584, 584, 628, 628, 628, 258, 628, 259, 260, 628, - - 628, 628, 261, 576, 628, 577, 628, 628, 260, 628, - 628, 628, 261, 628, 628, 628, 578, 591, 628, 628, - 579, 592, 628, 594, 584, 585, 584, 584, 587, 588, - 587, 587, 593, 587, 588, 587, 587, 587, 588, 587, - 589, 568, 561, 568, 568, 560, 561, 560, 560, 628, - 628, 565, 560, 561, 560, 562, 560, 561, 560, 562, - 560, 561, 560, 562, 560, 561, 560, 560, 560, 561, - 560, 562, 628, 586, 412, 598, 599, 598, 600, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, - 601, 601, 601, 628, 628, 628, 601, 601, 601, 601, - - 603, 628, 628, 602, 604, 628, 601, 628, 601, 601, - 560, 561, 560, 562, 560, 561, 560, 562, 560, 561, - 560, 560, 560, 561, 560, 562, 560, 561, 560, 560, - 560, 561, 560, 562, 601, 601, 601, 601, 601, 601, - 601, 465, 609, 610, 609, 611, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, - 628, 628, 628, 612, 612, 612, 612, 613, 614, 560, - 561, 560, 562, 612, 628, 612, 612, 560, 561, 560, - 562, 560, 561, 560, 562, 560, 561, 560, 562, 560, - 561, 560, 560, 560, 561, 560, 560, 560, 561, 560, - - 562, 612, 612, 612, 612, 612, 612, 612, 560, 561, - 560, 562, 628, 628, 628, 617, 560, 561, 560, 560, - 628, 618, 560, 561, 560, 560, 628, 628, 619, 525, - 620, 621, 620, 622, 623, 623, 623, 623, 623, 623, - 623, 623, 623, 623, 623, 623, 623, 623, 628, 628, - 628, 623, 623, 623, 623, 560, 561, 560, 562, 628, - 628, 623, 628, 623, 623, 560, 561, 560, 562, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 623, - 623, 623, 623, 623, 623, 623, 541, 624, 625, 624, - - 626, 627, 627, 627, 627, 627, 627, 627, 627, 627, - 627, 627, 627, 627, 627, 628, 628, 628, 627, 627, - 627, 627, 628, 628, 628, 628, 628, 628, 627, 628, - 627, 627, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 627, 627, 627, 627, - 627, 627, 627, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 133, 133, 628, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 136, 628, 136, 136, 136, 140, 140, 628, 140, - - 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, - 152, 152, 152, 152, 152, 152, 152, 152, 628, 628, - 628, 152, 152, 152, 166, 166, 628, 628, 166, 166, - 628, 166, 166, 166, 166, 166, 220, 220, 628, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 225, 225, 225, 225, 225, 225, 225, 225, 628, 628, - 628, 225, 225, 225, 231, 231, 231, 231, 231, 231, - 231, 628, 231, 231, 231, 231, 231, 231, 233, 233, - 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, - 233, 233, 235, 235, 628, 235, 628, 235, 235, 235, - - 235, 238, 628, 628, 238, 238, 238, 238, 238, 240, - 240, 240, 240, 240, 240, 240, 240, 628, 628, 628, - 240, 628, 240, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 250, 250, 628, 628, 250, 628, 628, 250, 250, - 310, 310, 310, 310, 310, 310, 310, 310, 628, 628, - 628, 310, 310, 310, 314, 314, 314, 314, 314, 314, - 314, 314, 628, 628, 628, 314, 628, 314, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - - 317, 317, 326, 326, 628, 628, 326, 628, 628, 326, - 326, 330, 628, 628, 330, 628, 330, 330, 330, 330, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241, 241, 387, 387, 387, 387, 387, 387, - 387, 387, 628, 628, 628, 387, 628, 387, 391, 391, - 628, 628, 391, 628, 628, 391, 391, 392, 628, 628, - 392, 392, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 335, 335, 335, 335, - 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, - 412, 412, 412, 412, 412, 628, 412, 412, 628, 628, - - 628, 628, 628, 412, 453, 453, 453, 453, 453, 453, - 453, 453, 453, 453, 453, 453, 453, 453, 459, 459, - 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - 459, 459, 461, 461, 461, 461, 461, 461, 461, 461, - 461, 461, 461, 461, 461, 461, 465, 465, 465, 465, - 465, 628, 465, 465, 628, 628, 628, 628, 628, 465, - 525, 525, 525, 525, 525, 628, 525, 525, 628, 628, - 628, 628, 628, 525, 541, 541, 541, 541, 541, 628, - 541, 541, 628, 628, 628, 628, 628, 541, 550, 550, - 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, - - 550, 550, 555, 555, 555, 555, 555, 555, 555, 555, - 555, 555, 555, 555, 555, 555, 563, 563, 563, 563, - 563, 563, 563, 563, 563, 563, 563, 563, 563, 564, - 564, 628, 564, 564, 564, 564, 564, 564, 564, 564, - 564, 564, 564, 570, 570, 570, 570, 570, 570, 570, - 570, 570, 570, 570, 570, 570, 570, 580, 580, 580, - 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, - 580, 567, 567, 628, 567, 567, 567, 567, 567, 567, - 567, 567, 567, 567, 567, 13, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628 + 582, 582, 582, 582, 582, 582, 582, 582, 582, 591, + 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, + 591, 593, 593, 704, 593, 593, 593, 593, 593, 593, + 593, 593, 593, 593, 599, 599, 599, 599, 599, 599, + 599, 599, 599, 599, 599, 599, 599, 620, 620, 620, + 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, + 596, 596, 704, 596, 596, 596, 596, 596, 596, 596, + 596, 596, 596, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 672, 672, 672, 672, + 672, 672, 672, 672, 672, 672, 672, 672, 672, 13, + + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704 } ; -static yyconst flex_int16_t yy_chk[3654] = +static yyconst flex_int16_t yy_chk[3969] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1072,7 +1133,7 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -1080,394 +1141,428 @@ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 6, 7, 7, 7, 7, 7, - 7, 7, 8, 8, 8, 8, 8, 8, 8, 6, - 9, 17, 20, 10, 25, 21, 26, 27, 28, 27, - 27, 27, 28, 25, 26, 33, 20, 65, 28, 35, - 35, 9, 8, 9, 10, 615, 10, 21, 17, 69, - 7, 607, 43, 33, 33, 68, 43, 8, 36, 36, - 36, 36, 43, 46, 65, 43, 111, 46, 460, 68, + 3, 3, 3, 3, 3, 3, 6, 7, 7, 7, + 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, + 8, 6, 9, 17, 20, 10, 18, 18, 25, 21, + 27, 26, 27, 27, 27, 67, 33, 25, 20, 26, + 35, 35, 691, 9, 8, 9, 10, 680, 10, 115, + 17, 21, 7, 28, 33, 33, 42, 28, 115, 8, + 41, 41, 67, 28, 43, 242, 42, 46, 119, 42, - 586, 69, 112, 46, 43, 111, 46, 460, 9, 36, - 112, 10, 11, 11, 11, 11, 11, 11, 11, 11, + 660, 42, 42, 43, 119, 43, 43, 656, 46, 46, + 9, 242, 43, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 29, - 58, 29, 29, 29, 30, 106, 30, 30, 30, 31, - 220, 31, 31, 31, 44, 37, 37, 37, 37, 83, - - 83, 45, 76, 29, 44, 220, 76, 44, 30, 45, - 581, 45, 76, 31, 45, 44, 37, 58, 580, 45, - 29, 76, 106, 566, 31, 30, 40, 40, 40, 40, - 31, 37, 41, 41, 41, 41, 42, 42, 42, 42, - 75, 133, 75, 75, 75, 49, 557, 40, 113, 47, - 113, 113, 113, 41, 47, 49, 50, 42, 49, 47, - 47, 47, 47, 48, 49, 47, 50, 48, 133, 50, - 556, 50, 42, 48, 50, 551, 48, 40, 40, 53, - 51, 48, 42, 41, 51, 42, 53, 52, 555, 53, - 51, 52, 53, 51, 53, 564, 54, 52, 150, 150, - - 52, 53, 551, 55, 52, 52, 54, 52, 54, 54, - 56, 114, 54, 55, 61, 114, 55, 56, 56, 61, - 56, 114, 564, 56, 61, 61, 61, 61, 554, 73, - 61, 73, 140, 73, 73, 73, 74, 74, 73, 74, - 74, 74, 81, 77, 74, 77, 77, 77, 78, 84, - 78, 78, 78, 79, 140, 79, 79, 79, 85, 84, - 81, 81, 84, 88, 155, 155, 155, 77, 85, 543, - 89, 85, 78, 88, 164, 164, 88, 79, 88, 88, - 89, 223, 91, 89, 77, 89, 91, 92, 79, 78, - 462, 230, 91, 93, 79, 91, 223, 92, 224, 462, - - 92, 93, 540, 93, 91, 94, 93, 230, 92, 94, - 495, 93, 95, 224, 232, 94, 96, 95, 94, 495, - 96, 539, 95, 95, 95, 95, 96, 97, 95, 96, - 232, 99, 98, 523, 96, 99, 522, 97, 519, 100, - 97, 99, 98, 100, 99, 98, 97, 98, 101, 100, - 98, 496, 100, 499, 103, 101, 100, 100, 101, 100, - 496, 101, 102, 101, 103, 245, 245, 103, 498, 104, - 101, 497, 102, 494, 102, 102, 104, 104, 102, 104, - 109, 467, 104, 466, 115, 109, 115, 115, 115, 464, - 109, 109, 109, 109, 567, 116, 109, 116, 116, 116, - - 117, 463, 117, 117, 117, 148, 148, 148, 115, 153, - 153, 153, 149, 149, 149, 149, 567, 461, 154, 116, - 154, 154, 154, 459, 117, 115, 149, 148, 331, 415, - 149, 153, 331, 166, 414, 117, 116, 165, 165, 165, - 165, 117, 154, 166, 168, 411, 166, 167, 167, 167, - 167, 168, 216, 216, 216, 171, 170, 407, 165, 154, - 406, 168, 170, 172, 168, 171, 170, 172, 171, 170, - 174, 405, 582, 172, 173, 397, 172, 228, 228, 228, - 174, 582, 175, 174, 173, 346, 167, 173, 167, 345, - 173, 173, 175, 344, 175, 175, 176, 177, 179, 167, - - 179, 176, 178, 167, 341, 340, 176, 177, 179, 176, - 177, 179, 178, 180, 178, 178, 334, 181, 182, 241, - 241, 241, 241, 180, 329, 183, 180, 181, 182, 180, - 181, 182, 184, 241, 181, 183, 185, 183, 183, 328, - 186, 187, 184, 327, 319, 184, 185, 184, 185, 185, - 186, 187, 188, 186, 187, 595, 313, 186, 189, 190, - 261, 597, 188, 192, 595, 188, 188, 191, 189, 190, - 597, 189, 190, 192, 189, 189, 192, 191, 191, 193, - 191, 194, 260, 192, 191, 194, 195, 196, 195, 193, - 259, 194, 193, 198, 194, 196, 195, 196, 258, 195, - - 196, 197, 197, 198, 256, 199, 198, 200, 252, 251, - 198, 197, 244, 201, 197, 199, 235, 200, 199, 606, - 200, 202, 199, 201, 233, 203, 201, 201, 606, 202, - 608, 202, 204, 205, 202, 203, 229, 214, 203, 608, - 203, 162, 204, 205, 160, 204, 205, 205, 206, 207, - 204, 206, 159, 207, 204, 208, 209, 157, 206, 207, - 156, 206, 207, 210, 209, 208, 209, 211, 208, 209, - 208, 210, 215, 210, 215, 147, 210, 211, 616, 141, - 211, 135, 215, 132, 211, 215, 127, 616, 215, 215, - 217, 125, 217, 217, 217, 218, 120, 218, 218, 218, - - 219, 219, 219, 226, 226, 226, 221, 221, 221, 221, - 312, 312, 312, 227, 217, 227, 227, 227, 108, 218, - 221, 87, 219, 82, 221, 226, 247, 247, 247, 80, - 72, 217, 242, 242, 242, 242, 218, 227, 67, 221, - 222, 222, 243, 243, 243, 243, 242, 64, 247, 248, - 248, 248, 60, 39, 227, 34, 243, 32, 24, 19, - 243, 16, 13, 5, 222, 222, 222, 222, 222, 222, - 4, 248, 2, 0, 0, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 222, 222, 249, 249, - - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 0, 249, 249, 0, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 249, 249, 249, 249, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 0, 250, - - 250, 0, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 257, 257, 257, 257, 262, 263, 264, 309, - 309, 309, 550, 550, 550, 550, 262, 263, 264, 262, - 263, 264, 265, 267, 0, 263, 265, 266, 0, 266, - 0, 309, 265, 267, 268, 265, 267, 266, 0, 267, - 266, 257, 269, 257, 268, 0, 0, 268, 0, 270, - 268, 268, 269, 270, 257, 269, 271, 272, 257, 270, - 0, 273, 270, 275, 272, 273, 271, 272, 274, 271, - - 272, 273, 274, 275, 273, 276, 275, 277, 274, 275, - 0, 274, 278, 279, 278, 276, 0, 277, 276, 280, - 277, 281, 278, 279, 0, 278, 279, 0, 0, 280, - 0, 281, 280, 282, 281, 283, 0, 282, 281, 283, - 285, 284, 286, 282, 0, 283, 282, 287, 283, 284, - 285, 284, 286, 285, 284, 286, 288, 287, 289, 0, - 287, 0, 287, 290, 0, 288, 288, 0, 289, 288, - 0, 289, 291, 290, 292, 0, 290, 289, 293, 0, - 290, 0, 291, 294, 292, 291, 0, 292, 293, 296, - 0, 293, 292, 294, 295, 297, 294, 0, 295, 296, - - 294, 299, 296, 0, 295, 297, 296, 295, 297, 298, - 0, 299, 0, 298, 299, 302, 300, 301, 0, 298, - 300, 301, 298, 303, 0, 302, 300, 301, 302, 300, - 301, 304, 305, 303, 304, 0, 303, 308, 349, 306, - 0, 304, 305, 0, 304, 305, 306, 308, 349, 306, - 308, 349, 306, 311, 311, 311, 316, 316, 316, 316, - 0, 0, 317, 317, 317, 317, 323, 323, 323, 0, - 316, 0, 0, 0, 316, 311, 317, 324, 324, 324, - 317, 0, 318, 318, 318, 318, 0, 0, 323, 316, - 320, 320, 320, 320, 0, 317, 318, 353, 0, 324, - - 318, 0, 0, 0, 320, 353, 347, 353, 320, 0, - 353, 332, 332, 332, 332, 318, 347, 347, 348, 347, - 388, 388, 388, 320, 322, 332, 0, 348, 348, 0, - 0, 348, 322, 322, 322, 322, 322, 322, 0, 322, - 0, 0, 388, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 322, 322, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 0, - - 325, 325, 0, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, - 325, 325, 325, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 0, 326, 326, 0, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - - 333, 333, 333, 333, 0, 335, 335, 335, 335, 0, - 0, 351, 0, 0, 333, 350, 352, 0, 333, 335, - 0, 351, 350, 335, 351, 350, 352, 351, 350, 352, - 354, 0, 355, 352, 357, 0, 389, 389, 389, 0, - 354, 356, 355, 354, 357, 355, 358, 357, 354, 355, - 359, 356, 356, 0, 356, 361, 358, 360, 389, 358, - 359, 360, 359, 359, 362, 361, 0, 360, 361, 363, - 360, 0, 0, 363, 362, 364, 365, 362, 0, 363, - 0, 362, 363, 366, 367, 364, 365, 0, 364, 365, - 364, 368, 369, 366, 367, 0, 366, 367, 366, 370, - - 367, 368, 369, 371, 368, 369, 0, 372, 0, 370, - 368, 373, 370, 371, 370, 373, 371, 372, 374, 375, - 372, 373, 0, 0, 373, 376, 374, 377, 374, 375, - 0, 374, 375, 376, 375, 376, 0, 377, 376, 378, - 377, 378, 377, 379, 380, 381, 0, 0, 0, 378, - 0, 0, 378, 379, 380, 381, 379, 380, 381, 382, - 383, 384, 0, 379, 382, 384, 385, 386, 417, 382, - 383, 384, 382, 383, 384, 0, 385, 386, 417, 385, - 386, 417, 0, 0, 0, 386, 390, 390, 390, 390, - 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - - 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - 390, 390, 390, 390, 390, 390, 390, 390, 390, 0, - 390, 390, 0, 390, 390, 390, 390, 390, 390, 390, - 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, - 390, 390, 390, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 0, 391, 391, 0, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, - 393, 408, 408, 408, 408, 0, 0, 416, 418, 0, - 0, 416, 393, 419, 420, 408, 393, 416, 418, 408, - 416, 418, 0, 419, 420, 0, 419, 420, 0, 0, - 0, 393, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - - 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 394, 394, 394, 394, 394, 394, 395, - 395, 395, 395, 0, 396, 396, 396, 396, 0, 398, - 398, 398, 398, 395, 0, 0, 421, 395, 396, 0, - 422, 423, 396, 398, 0, 423, 421, 398, 421, 421, - 422, 423, 395, 422, 423, 0, 0, 396, 560, 560, - 560, 560, 398, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, - 424, 425, 426, 0, 425, 0, 427, 0, 424, 0, - 424, 425, 426, 424, 425, 426, 427, 428, 429, 427, - 0, 0, 430, 0, 431, 428, 0, 428, 429, 429, - 428, 429, 430, 432, 431, 430, 431, 431, 432, 430, - 433, 0, 0, 432, 0, 432, 432, 434, 435, 436, - 433, 434, 0, 433, 433, 436, 435, 434, 435, 436, - 434, 435, 436, 437, 438, 439, 438, 439, 0, 440, - - 0, 0, 0, 437, 438, 439, 437, 438, 439, 440, - 437, 440, 440, 441, 442, 441, 0, 0, 443, 444, - 0, 0, 0, 441, 442, 443, 441, 442, 443, 444, - 445, 443, 444, 0, 446, 445, 447, 0, 448, 0, - 445, 448, 446, 445, 446, 0, 447, 446, 448, 447, - 0, 448, 453, 453, 453, 453, 0, 454, 454, 454, - 454, 0, 456, 456, 456, 456, 453, 0, 0, 468, - 453, 454, 0, 469, 0, 454, 456, 0, 0, 468, - 456, 468, 468, 469, 470, 453, 469, 0, 0, 471, - 454, 469, 0, 0, 470, 456, 472, 470, 472, 471, - - 473, 470, 471, 0, 474, 475, 472, 0, 0, 472, - 473, 477, 0, 473, 474, 475, 473, 474, 475, 476, - 478, 477, 478, 476, 477, 479, 474, 480, 0, 476, - 478, 481, 476, 478, 0, 479, 482, 480, 479, 0, - 480, 481, 483, 484, 481, 483, 482, 484, 486, 482, - 485, 0, 483, 484, 485, 483, 484, 487, 486, 488, - 485, 486, 0, 485, 489, 486, 490, 487, 491, 488, - 487, 0, 488, 492, 489, 0, 490, 489, 491, 490, - 493, 491, 501, 492, 493, 492, 492, 502, 0, 0, - 493, 502, 501, 493, 0, 501, 504, 502, 505, 501, - - 502, 503, 503, 503, 503, 506, 504, 507, 505, 504, - 0, 505, 508, 0, 0, 506, 511, 507, 506, 507, - 507, 0, 508, 509, 508, 508, 511, 509, 510, 511, - 510, 0, 512, 509, 512, 0, 509, 503, 510, 513, - 0, 510, 512, 513, 514, 512, 515, 503, 0, 513, - 503, 516, 513, 526, 514, 516, 515, 514, 517, 515, - 0, 516, 517, 526, 516, 0, 526, 527, 517, 526, - 0, 517, 518, 518, 518, 518, 529, 527, 530, 0, - 527, 528, 528, 528, 528, 0, 529, 531, 530, 529, - 0, 530, 0, 533, 532, 530, 0, 531, 532, 535, - - 531, 534, 528, 533, 532, 534, 533, 532, 518, 535, - 536, 534, 535, 536, 534, 542, 537, 0, 518, 537, - 536, 518, 0, 536, 0, 542, 537, 0, 542, 537, - 538, 538, 538, 538, 544, 538, 545, 0, 528, 0, - 538, 545, 546, 547, 544, 0, 545, 544, 548, 545, - 544, 538, 546, 547, 549, 546, 547, 0, 548, 0, - 0, 548, 0, 0, 549, 0, 0, 549, 552, 552, - 552, 552, 552, 553, 553, 553, 553, 558, 559, 552, - 561, 561, 561, 561, 0, 0, 0, 558, 559, 0, - 558, 559, 562, 562, 562, 562, 563, 563, 563, 563, - - 0, 552, 565, 565, 565, 565, 568, 568, 568, 568, - 0, 0, 553, 0, 553, 0, 568, 569, 569, 569, - 569, 569, 0, 0, 0, 553, 0, 0, 569, 553, - 570, 570, 570, 570, 570, 0, 0, 0, 568, 0, - 0, 570, 571, 571, 571, 571, 573, 573, 573, 573, - 569, 572, 572, 572, 572, 572, 574, 574, 574, 574, - 0, 0, 0, 570, 575, 575, 575, 575, 576, 576, - 576, 576, 577, 577, 577, 577, 578, 578, 578, 578, - 579, 579, 579, 579, 0, 573, 0, 573, 584, 584, - 584, 584, 0, 0, 0, 574, 0, 574, 573, 0, - - 0, 0, 573, 575, 0, 575, 0, 0, 574, 0, - 0, 0, 574, 0, 0, 0, 575, 576, 0, 0, - 575, 577, 0, 579, 585, 585, 585, 585, 587, 587, - 587, 587, 578, 588, 588, 588, 588, 589, 589, 589, - 589, 590, 590, 590, 590, 598, 598, 598, 598, 0, - 0, 590, 592, 592, 592, 592, 593, 593, 593, 593, - 594, 594, 594, 594, 599, 599, 599, 599, 600, 600, - 600, 600, 0, 590, 591, 591, 591, 591, 591, 591, - 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, - 591, 591, 591, 0, 0, 0, 591, 591, 591, 591, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 29, 651, 29, 29, 29, 30, 638, 30, + 30, 30, 31, 70, 31, 31, 31, 36, 36, 36, - 593, 0, 0, 592, 594, 0, 591, 0, 591, 591, - 601, 601, 601, 601, 603, 603, 603, 603, 609, 609, - 609, 609, 604, 604, 604, 604, 610, 610, 610, 610, - 611, 611, 611, 611, 591, 591, 591, 591, 591, 591, - 591, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, - 0, 0, 0, 602, 602, 602, 602, 603, 604, 612, - 612, 612, 612, 602, 0, 602, 602, 613, 613, 613, - 613, 614, 614, 614, 614, 617, 617, 617, 617, 620, - 620, 620, 620, 621, 621, 621, 621, 622, 622, 622, - - 622, 602, 602, 602, 602, 602, 602, 602, 623, 623, - 623, 623, 0, 0, 0, 613, 624, 624, 624, 624, - 0, 614, 625, 625, 625, 625, 0, 0, 617, 618, - 618, 618, 618, 618, 618, 618, 618, 618, 618, 618, - 618, 618, 618, 618, 618, 618, 618, 618, 0, 0, - 0, 618, 618, 618, 618, 626, 626, 626, 626, 0, - 0, 618, 0, 618, 618, 627, 627, 627, 627, 0, + 36, 37, 37, 37, 37, 44, 29, 70, 49, 49, + 58, 30, 49, 51, 630, 44, 31, 629, 36, 137, + 44, 44, 37, 29, 51, 51, 44, 31, 30, 40, + 40, 40, 40, 31, 477, 47, 45, 37, 60, 60, + 50, 47, 47, 477, 45, 47, 47, 58, 625, 45, + 40, 45, 45, 48, 45, 50, 50, 48, 50, 36, + 137, 52, 36, 37, 68, 68, 37, 71, 48, 48, + 53, 48, 52, 52, 52, 52, 621, 52, 53, 53, + 40, 40, 55, 54, 108, 53, 54, 54, 620, 71, + 479, 40, 56, 56, 40, 55, 63, 55, 55, 479, + + 56, 56, 63, 63, 85, 85, 63, 63, 75, 618, + 75, 595, 75, 75, 75, 76, 76, 75, 76, 76, + 76, 108, 77, 76, 77, 77, 77, 78, 584, 83, + 79, 78, 79, 79, 79, 139, 80, 78, 80, 80, + 80, 81, 87, 81, 81, 81, 78, 83, 83, 86, + 86, 91, 91, 92, 79, 99, 99, 87, 87, 99, + 80, 93, 139, 92, 583, 81, 92, 116, 92, 92, + 93, 79, 93, 93, 94, 116, 81, 80, 95, 93, + 110, 110, 81, 512, 94, 582, 95, 96, 148, 94, + 94, 95, 512, 95, 95, 94, 95, 97, 96, 96, + + 101, 98, 244, 97, 97, 98, 100, 97, 97, 348, + 148, 101, 101, 348, 102, 581, 98, 98, 244, 98, + 579, 100, 100, 103, 100, 102, 102, 102, 102, 105, + 102, 103, 103, 104, 158, 158, 104, 104, 103, 106, + 106, 564, 105, 113, 105, 105, 561, 106, 106, 113, + 113, 560, 118, 113, 113, 117, 118, 117, 117, 117, + 172, 172, 118, 143, 143, 143, 144, 144, 144, 156, + 156, 156, 157, 157, 157, 157, 540, 143, 174, 174, + 144, 161, 161, 161, 176, 176, 157, 163, 163, 163, + 157, 156, 173, 173, 173, 173, 175, 175, 175, 175, + + 178, 177, 177, 161, 539, 180, 182, 143, 181, 181, + 184, 144, 177, 173, 180, 180, 536, 182, 182, 183, + 183, 183, 178, 178, 185, 184, 184, 185, 185, 186, + 187, 187, 189, 574, 186, 175, 516, 175, 188, 186, + 186, 188, 188, 190, 190, 189, 189, 232, 175, 191, + 191, 191, 175, 515, 173, 194, 194, 173, 175, 192, + 574, 175, 232, 193, 192, 192, 193, 193, 195, 197, + 197, 195, 195, 196, 196, 196, 198, 198, 198, 199, + 199, 199, 200, 200, 201, 514, 202, 202, 201, 201, + 201, 202, 203, 204, 205, 206, 207, 203, 203, 511, + + 206, 484, 206, 206, 204, 204, 210, 205, 205, 483, + 207, 207, 208, 208, 208, 209, 209, 209, 211, 211, + 211, 210, 210, 212, 213, 213, 214, 214, 216, 214, + 212, 212, 217, 214, 215, 215, 215, 218, 218, 219, + 216, 216, 220, 217, 217, 227, 219, 219, 481, 220, + 220, 221, 221, 221, 224, 224, 259, 259, 227, 227, + 227, 228, 228, 228, 229, 480, 229, 229, 229, 230, + 235, 230, 230, 230, 231, 231, 231, 236, 278, 278, + 233, 233, 233, 233, 478, 235, 279, 279, 229, 238, + 238, 238, 236, 230, 233, 476, 231, 432, 233, 240, + + 240, 240, 252, 252, 252, 229, 255, 255, 255, 255, + 230, 238, 431, 233, 234, 234, 252, 281, 284, 284, + 255, 256, 256, 256, 256, 261, 261, 261, 280, 280, + 428, 280, 281, 281, 282, 256, 292, 292, 234, 234, + 234, 234, 234, 234, 424, 282, 282, 261, 252, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 257, 257, 257, 257, 262, 262, 262, 283, + 285, 285, 285, 287, 294, 294, 257, 423, 289, 422, + 257, 414, 283, 283, 287, 287, 289, 289, 262, 263, + + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 363, 263, 263, 362, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 263, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 296, 296, 286, 264, 264, 264, 264, 272, 272, + 272, 272, 288, 290, 264, 301, 264, 264, 286, 286, + + 291, 293, 301, 301, 290, 290, 295, 288, 288, 302, + 302, 291, 291, 298, 298, 298, 293, 293, 361, 295, + 295, 299, 264, 264, 264, 297, 300, 272, 297, 272, + 297, 297, 299, 299, 304, 304, 303, 300, 300, 305, + 272, 303, 303, 358, 272, 305, 305, 306, 306, 357, + 272, 306, 308, 272, 307, 307, 307, 308, 308, 309, + 309, 312, 309, 310, 310, 311, 311, 311, 313, 313, + 313, 315, 312, 312, 314, 317, 314, 314, 316, 316, + 318, 321, 315, 315, 319, 319, 317, 317, 320, 320, + 322, 318, 318, 321, 321, 322, 322, 323, 325, 326, + + 326, 326, 351, 325, 325, 323, 323, 328, 328, 328, + 329, 329, 329, 333, 333, 333, 333, 340, 340, 340, + 346, 326, 334, 334, 334, 334, 513, 333, 345, 328, + 344, 333, 341, 341, 341, 513, 334, 366, 366, 340, + 334, 336, 335, 335, 335, 335, 333, 337, 337, 337, + 337, 368, 368, 364, 341, 334, 335, 364, 364, 330, + 335, 337, 369, 369, 369, 337, 365, 277, 349, 349, + 349, 349, 365, 365, 622, 335, 367, 374, 374, 370, + 337, 339, 349, 622, 367, 367, 370, 370, 276, 339, + 339, 339, 339, 339, 339, 275, 339, 372, 372, 372, + + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 274, 342, 342, 273, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, + 342, 342, 342, 342, 342, 342, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + + 343, 343, 343, 343, 343, 375, 375, 271, 343, 343, + 343, 343, 350, 350, 350, 350, 371, 371, 343, 371, + 343, 343, 352, 352, 352, 352, 350, 373, 381, 381, + 350, 373, 373, 377, 376, 270, 352, 376, 376, 380, + 352, 379, 379, 379, 377, 377, 343, 343, 343, 378, + 380, 380, 382, 266, 378, 378, 383, 383, 384, 384, + 385, 385, 386, 386, 385, 387, 387, 382, 382, 388, + 390, 389, 391, 392, 392, 394, 394, 397, 397, 391, + 391, 390, 390, 393, 388, 388, 389, 389, 395, 265, + 393, 393, 396, 396, 399, 258, 398, 396, 398, 398, + + 401, 395, 395, 249, 399, 399, 400, 400, 402, 402, + 247, 401, 401, 403, 403, 245, 403, 405, 405, 405, + 406, 406, 406, 425, 425, 425, 425, 434, 434, 435, + 435, 436, 436, 437, 437, 443, 443, 425, 241, 405, + 239, 425, 406, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 226, 407, 407, 170, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + + 407, 407, 407, 407, 407, 407, 408, 408, 408, 408, + 408, 408, 408, 408, 408, 408, 408, 408, 408, 408, + 408, 408, 408, 408, 408, 433, 168, 410, 408, 408, + 408, 408, 412, 412, 412, 412, 433, 433, 408, 410, + 408, 408, 167, 410, 438, 440, 412, 438, 438, 439, + 412, 442, 459, 459, 439, 439, 440, 440, 410, 413, + 413, 413, 413, 442, 442, 412, 408, 408, 408, 411, + 411, 411, 411, 413, 441, 461, 461, 413, 165, 444, + 445, 441, 441, 411, 444, 444, 446, 445, 445, 164, + 446, 446, 413, 451, 162, 411, 411, 411, 411, 411, + + 411, 447, 447, 447, 451, 451, 411, 411, 411, 411, + 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, + 411, 411, 411, 411, 411, 411, 411, 411, 411, 415, + 415, 415, 415, 448, 449, 155, 448, 448, 450, 450, + 450, 449, 452, 415, 449, 449, 453, 415, 149, 452, + 452, 454, 454, 454, 457, 453, 453, 457, 457, 464, + 464, 141, 415, 416, 416, 416, 416, 416, 416, 416, + 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, + 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, + 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, + + 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, + 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, + 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, + 416, 455, 460, 456, 485, 458, 138, 485, 485, 136, + 460, 460, 462, 463, 455, 455, 456, 456, 458, 458, + 463, 463, 462, 462, 465, 470, 470, 470, 470, 657, + 471, 471, 471, 471, 488, 488, 465, 465, 657, 470, + 487, 487, 487, 470, 471, 131, 486, 486, 471, 486, + 473, 473, 473, 473, 490, 490, 489, 596, 470, 491, + 491, 494, 494, 471, 473, 493, 491, 495, 473, 489, + + 489, 492, 496, 492, 492, 497, 493, 493, 498, 596, + 495, 495, 129, 473, 499, 499, 500, 496, 496, 501, + 497, 497, 502, 498, 498, 503, 503, 503, 500, 500, + 501, 501, 124, 502, 502, 504, 504, 505, 505, 506, + 506, 507, 507, 508, 508, 509, 510, 659, 509, 509, + 518, 518, 518, 519, 521, 521, 659, 510, 510, 520, + 520, 520, 520, 120, 519, 519, 522, 522, 523, 523, + 524, 526, 525, 524, 524, 525, 525, 527, 112, 528, + 529, 111, 526, 526, 528, 528, 530, 531, 531, 533, + 527, 527, 534, 529, 529, 532, 532, 530, 530, 89, + + 533, 533, 84, 534, 534, 535, 535, 535, 535, 82, + 520, 520, 543, 543, 544, 544, 545, 545, 545, 545, + 74, 520, 546, 546, 520, 547, 547, 69, 546, 548, + 548, 549, 549, 549, 551, 679, 547, 545, 550, 553, + 550, 550, 552, 552, 679, 551, 551, 554, 554, 555, + 553, 553, 556, 563, 563, 66, 535, 535, 559, 559, + 62, 555, 555, 631, 556, 556, 61, 535, 39, 559, + 535, 567, 567, 545, 557, 557, 557, 557, 545, 557, + 568, 545, 565, 593, 557, 631, 565, 565, 566, 566, + 568, 568, 569, 569, 566, 557, 570, 570, 571, 571, + + 572, 572, 585, 586, 586, 587, 587, 585, 585, 681, + 593, 624, 624, 692, 34, 631, 32, 24, 681, 19, + 16, 13, 692, 5, 4, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 557, 0, 0, 557, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + + 558, 558, 558, 558, 558, 558, 558, 558, 573, 573, + 573, 573, 575, 575, 575, 575, 575, 577, 577, 577, + 577, 0, 0, 575, 576, 576, 576, 576, 688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 618, - 618, 618, 618, 618, 618, 618, 619, 619, 619, 619, + 0, 0, 0, 0, 0, 575, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 688, 0, 0, 0, 0, + 0, 0, 0, 576, 0, 576, 0, 0, 0, 0, + 573, 0, 0, 573, 0, 575, 576, 0, 575, 577, + 576, 0, 577, 0, 0, 688, 576, 0, 0, 576, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 578, 588, 588, 588, + 588, 589, 589, 589, 589, 590, 590, 590, 590, 591, + 591, 591, 591, 592, 592, 592, 592, 594, 594, 594, + 594, 597, 597, 597, 597, 598, 598, 598, 598, 598, + 0, 597, 600, 600, 600, 600, 598, 0, 0, 599, + + 599, 599, 599, 599, 601, 601, 601, 601, 601, 0, + 599, 0, 0, 597, 0, 0, 0, 0, 598, 588, + 0, 0, 588, 589, 0, 0, 589, 590, 0, 0, + 590, 591, 599, 0, 591, 592, 0, 0, 592, 594, + 0, 0, 594, 597, 0, 0, 597, 0, 598, 0, + 0, 598, 0, 0, 600, 0, 0, 600, 603, 603, + 603, 603, 599, 0, 0, 599, 0, 601, 0, 0, + 601, 602, 602, 602, 602, 602, 604, 604, 604, 604, + 0, 0, 602, 605, 605, 605, 605, 606, 606, 606, + 606, 607, 607, 607, 607, 0, 0, 603, 0, 603, + + 609, 609, 609, 609, 602, 608, 608, 608, 608, 0, + 603, 0, 0, 0, 603, 604, 0, 604, 0, 0, + 603, 0, 605, 603, 605, 0, 0, 0, 604, 0, + 0, 0, 604, 0, 602, 605, 606, 602, 604, 605, + 607, 604, 0, 609, 0, 605, 0, 0, 605, 606, + 0, 0, 606, 607, 0, 0, 607, 610, 610, 610, + 610, 608, 609, 0, 0, 609, 0, 608, 0, 0, + 608, 611, 611, 611, 611, 611, 0, 611, 612, 612, + 612, 612, 611, 613, 613, 613, 613, 614, 614, 614, + 614, 0, 0, 611, 616, 616, 616, 616, 0, 612, + + 0, 0, 0, 0, 613, 0, 0, 0, 614, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 610, + 0, 0, 610, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 616, 611, 616, 0, 611, 0, 0, + 612, 0, 0, 612, 0, 613, 616, 0, 613, 614, + 616, 0, 614, 0, 0, 0, 616, 0, 0, 616, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, - 619, 619, 619, 619, 619, 0, 0, 0, 619, 619, - 619, 619, 0, 0, 0, 0, 0, 0, 619, 0, - 619, 619, 0, 0, 0, 0, 0, 0, 0, 0, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 626, 626, + 626, 626, 627, 627, 627, 627, 628, 628, 628, 628, + 632, 632, 632, 632, 633, 633, 633, 633, 634, 634, + 634, 634, 635, 635, 635, 635, 636, 636, 636, 636, + 640, 640, 640, 640, 0, 0, 636, 637, 637, 637, + 637, 637, 0, 0, 0, 0, 0, 0, 637, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 636, 0, + 626, 0, 0, 626, 627, 0, 0, 627, 628, 0, + + 637, 628, 632, 0, 0, 632, 633, 0, 0, 633, + 634, 640, 0, 634, 635, 0, 0, 635, 636, 0, + 0, 636, 640, 0, 0, 640, 641, 641, 641, 641, + 637, 0, 0, 637, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 0, 0, 0, 639, 639, 639, 639, + 642, 642, 642, 642, 0, 0, 639, 0, 639, 639, + 641, 643, 643, 643, 643, 0, 0, 644, 644, 644, + 644, 0, 644, 646, 646, 646, 646, 644, 641, 0, + 0, 641, 0, 0, 639, 639, 639, 639, 644, 0, + + 639, 0, 0, 0, 642, 647, 647, 647, 647, 647, + 643, 647, 643, 0, 645, 645, 645, 645, 0, 645, + 0, 0, 642, 643, 645, 642, 0, 643, 649, 649, + 649, 649, 0, 643, 0, 645, 643, 0, 647, 644, + 0, 0, 644, 0, 0, 646, 0, 0, 646, 648, + 648, 648, 648, 648, 650, 650, 650, 650, 0, 0, + 648, 652, 652, 652, 652, 0, 0, 649, 647, 649, + 0, 647, 661, 661, 661, 661, 645, 0, 0, 645, + 649, 0, 648, 0, 649, 662, 662, 662, 662, 0, + 649, 0, 0, 649, 663, 663, 663, 663, 664, 664, + + 664, 664, 665, 665, 665, 665, 0, 0, 0, 0, + 0, 0, 648, 0, 0, 648, 650, 0, 0, 650, + 0, 0, 0, 652, 0, 0, 652, 0, 0, 0, + 0, 0, 0, 0, 661, 0, 0, 661, 0, 0, + 0, 0, 667, 667, 667, 667, 0, 662, 0, 0, + 662, 668, 668, 668, 668, 0, 663, 0, 0, 663, + 664, 0, 0, 664, 665, 0, 0, 665, 666, 666, + 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, + 666, 666, 666, 666, 666, 666, 666, 0, 0, 0, + 666, 666, 666, 666, 0, 667, 0, 668, 0, 0, + + 666, 0, 666, 666, 667, 0, 0, 667, 669, 669, + 669, 669, 0, 668, 0, 0, 668, 670, 670, 670, + 670, 0, 670, 673, 673, 673, 673, 673, 666, 666, + 666, 671, 671, 671, 671, 671, 0, 671, 672, 672, + 672, 672, 672, 0, 672, 676, 676, 676, 676, 670, + 674, 674, 674, 674, 674, 0, 674, 682, 682, 682, + 682, 0, 0, 0, 671, 0, 676, 0, 0, 0, + 669, 672, 0, 669, 675, 675, 675, 675, 675, 670, + 675, 0, 670, 674, 0, 675, 673, 0, 0, 673, + 683, 683, 683, 683, 671, 0, 675, 671, 0, 0, + + 0, 672, 0, 0, 672, 0, 0, 676, 0, 0, + 676, 0, 0, 674, 0, 0, 674, 0, 0, 682, + 0, 0, 682, 684, 684, 684, 684, 685, 685, 685, + 685, 686, 686, 686, 686, 0, 0, 675, 0, 0, + 675, 687, 687, 687, 687, 689, 689, 689, 689, 0, + 689, 0, 683, 0, 0, 683, 0, 690, 690, 690, + 690, 690, 0, 690, 0, 693, 693, 693, 693, 686, + 0, 0, 0, 0, 0, 0, 0, 689, 0, 0, + 0, 687, 0, 0, 0, 684, 0, 0, 684, 685, + 690, 0, 685, 686, 0, 0, 686, 696, 696, 696, + + 696, 0, 0, 687, 0, 0, 687, 689, 693, 0, + 689, 697, 697, 697, 697, 698, 698, 698, 698, 0, + 690, 0, 0, 690, 0, 0, 0, 693, 0, 0, + 693, 694, 694, 694, 694, 694, 694, 694, 694, 694, + 694, 694, 694, 694, 694, 694, 694, 694, 694, 694, + 0, 0, 0, 694, 694, 694, 694, 0, 0, 696, + 0, 0, 696, 694, 0, 694, 694, 0, 699, 699, + 699, 699, 0, 697, 0, 0, 697, 698, 0, 0, + 698, 700, 700, 700, 700, 701, 701, 701, 701, 0, + 0, 694, 694, 694, 695, 695, 695, 695, 695, 695, + + 695, 695, 695, 695, 695, 695, 695, 695, 695, 695, + 695, 695, 695, 0, 0, 0, 695, 695, 695, 695, + 702, 702, 702, 702, 0, 0, 695, 0, 695, 695, + 699, 0, 0, 699, 703, 703, 703, 703, 0, 0, + 0, 0, 0, 700, 0, 0, 700, 701, 0, 0, + 701, 0, 0, 0, 695, 695, 695, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 619, 619, 619, 619, - 619, 619, 619, 629, 629, 629, 629, 629, 629, 629, - 629, 629, 629, 629, 629, 629, 629, 630, 630, 0, - 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, - 630, 631, 0, 631, 631, 631, 632, 632, 0, 632, - - 632, 632, 632, 632, 632, 632, 632, 632, 632, 632, - 633, 633, 633, 633, 633, 633, 633, 633, 0, 0, - 0, 633, 633, 633, 634, 634, 0, 0, 634, 634, - 0, 634, 634, 634, 634, 634, 635, 635, 0, 635, - 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, - 636, 636, 636, 636, 636, 636, 636, 636, 0, 0, - 0, 636, 636, 636, 637, 637, 637, 637, 637, 637, - 637, 0, 637, 637, 637, 637, 637, 637, 638, 638, - 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, - 638, 638, 639, 639, 0, 639, 0, 639, 639, 639, - - 639, 640, 0, 0, 640, 640, 640, 640, 640, 641, - 641, 641, 641, 641, 641, 641, 641, 0, 0, 0, - 641, 0, 641, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 643, 643, 643, - 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, - 643, 644, 644, 0, 0, 644, 0, 0, 644, 644, - 645, 645, 645, 645, 645, 645, 645, 645, 0, 0, - 0, 645, 645, 645, 646, 646, 646, 646, 646, 646, - 646, 646, 0, 0, 0, 646, 0, 646, 647, 647, - 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, - - 647, 647, 648, 648, 0, 0, 648, 0, 0, 648, - 648, 649, 0, 0, 649, 0, 649, 649, 649, 649, - 650, 650, 650, 650, 650, 650, 650, 650, 650, 650, - 650, 650, 650, 650, 651, 651, 651, 651, 651, 651, - 651, 651, 0, 0, 0, 651, 0, 651, 652, 652, - 0, 0, 652, 0, 0, 652, 652, 653, 0, 0, - 653, 653, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 655, 655, 655, 655, - 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, - 656, 656, 656, 656, 656, 0, 656, 656, 0, 0, - - 0, 0, 0, 656, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 658, 658, - 658, 658, 658, 658, 658, 658, 658, 658, 658, 658, - 658, 658, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 660, 660, 660, 660, - 660, 0, 660, 660, 0, 0, 0, 0, 0, 660, - 661, 661, 661, 661, 661, 0, 661, 661, 0, 0, - 0, 0, 0, 661, 662, 662, 662, 662, 662, 0, - 662, 662, 0, 0, 0, 0, 0, 662, 663, 663, - 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, - - 663, 663, 664, 664, 664, 664, 664, 664, 664, 664, - 664, 664, 664, 664, 664, 664, 665, 665, 665, 665, - 665, 665, 665, 665, 665, 665, 665, 665, 665, 666, - 666, 0, 666, 666, 666, 666, 666, 666, 666, 666, - 666, 666, 666, 667, 667, 667, 667, 667, 667, 667, - 667, 667, 667, 667, 667, 667, 667, 668, 668, 668, - 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, - 668, 669, 669, 0, 669, 669, 669, 669, 669, 669, - 669, 669, 669, 669, 669, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 702, 0, 0, 702, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 703, 0, 0, 703, + + 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, + 705, 705, 705, 706, 706, 0, 706, 706, 706, 706, + 706, 706, 706, 706, 706, 706, 707, 0, 707, 707, + 707, 708, 708, 0, 708, 708, 708, 708, 708, 708, + 708, 708, 708, 708, 709, 709, 709, 709, 709, 709, + 709, 709, 0, 0, 0, 709, 709, 710, 710, 0, + 0, 710, 710, 0, 710, 710, 710, 710, 710, 711, + 0, 0, 711, 711, 711, 711, 711, 712, 712, 0, + 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, + 713, 713, 713, 713, 713, 713, 713, 713, 0, 0, + + 0, 713, 713, 714, 714, 714, 714, 714, 714, 714, + 0, 714, 714, 714, 714, 714, 715, 715, 715, 715, + 715, 715, 715, 715, 715, 715, 715, 715, 715, 716, + 716, 0, 716, 0, 716, 716, 716, 717, 0, 0, + 717, 717, 717, 717, 717, 718, 718, 718, 718, 718, + 718, 718, 718, 0, 0, 0, 718, 719, 719, 719, + 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, + 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, + 720, 720, 720, 721, 721, 0, 0, 721, 0, 0, + 721, 721, 722, 722, 722, 722, 722, 722, 722, 722, + + 0, 0, 0, 722, 722, 723, 723, 723, 723, 723, + 723, 723, 723, 0, 0, 0, 723, 724, 724, 724, + 724, 724, 724, 724, 724, 724, 724, 724, 724, 724, + 725, 725, 0, 0, 725, 0, 0, 725, 725, 726, + 0, 0, 726, 0, 726, 726, 726, 727, 727, 727, + 727, 727, 727, 727, 727, 727, 727, 727, 727, 727, + 728, 728, 728, 728, 728, 728, 728, 728, 0, 0, + 0, 728, 729, 729, 0, 0, 729, 0, 0, 729, + 729, 730, 0, 0, 730, 730, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, 731, 732, + + 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, + 732, 732, 733, 733, 733, 733, 733, 0, 733, 733, + 734, 734, 734, 734, 734, 734, 734, 734, 734, 734, + 734, 734, 734, 735, 735, 735, 735, 735, 735, 735, + 735, 735, 735, 735, 735, 735, 736, 736, 736, 736, + 736, 736, 736, 736, 736, 736, 736, 736, 736, 737, + 737, 737, 737, 737, 0, 737, 737, 738, 738, 738, + 738, 738, 0, 738, 738, 739, 739, 739, 739, 739, + 0, 739, 739, 740, 740, 740, 740, 740, 740, 740, + 740, 740, 740, 740, 740, 740, 741, 741, 741, 741, + + 741, 741, 741, 741, 741, 741, 741, 741, 741, 742, + 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 743, 743, 0, 743, 743, 743, 743, 743, 743, + 743, 743, 743, 743, 744, 744, 744, 744, 744, 744, + 744, 744, 744, 744, 744, 744, 744, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 746, 746, 0, 746, 746, 746, 746, 746, 746, 746, + 746, 746, 746, 747, 747, 747, 747, 747, 747, 747, + 747, 747, 747, 747, 747, 747, 748, 748, 748, 748, + 748, 748, 748, 748, 748, 748, 748, 748, 748, 704, + + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704 } ; static yy_state_type yy_last_accepting_state; @@ -1597,10 +1692,10 @@ } else { int i1=0,i2=len; // find start - while(!strchr(" \n\r\t", text[i1])) i1++; + while(!strchr(" \n\r\t\xa0", text[i1])) i1++; // strip - while(strchr(" \n\r\t", text[i1])) i1++; - while(strchr(" \n\r\t", text[i2-1])) i2--; + while(strchr(" \n\r\t\xa0", text[i1])) i1++; + while(strchr(" \n\r\t\xa0", text[i2-1])) i2--; if(i2!=len) text[i2]=0; filename = strdup(&text[i1]); } @@ -1957,30 +2052,13 @@ current_column+=as3_leng; } -trie_t*active_namespaces = 0; -/*void tokenizer_register_namespace(const char*id) -{ - trie_put(namespaces, id, 0); -} -void tokenizer_unregister_namespace(const char*id) -{ - trie_remove(namespaces, id); -}*/ -static inline char tokenizer_is_namespace(const char*id) -{ - return trie_contains(active_namespaces, id); -} - static inline int handleIdentifier() { char*s = malloc(as3_leng+1); memcpy(s, as3_text, as3_leng); s[as3_leng]=0; a3_lval.id = s; - if(tokenizer_is_namespace(s)) - return T_NAMESPACE; - else - return T_IDENTIFIER; + return T_IDENTIFIER; } static int tokenerror(); @@ -1997,7 +2075,8 @@ -#line 2001 "tokenizer.yy.c" + +#line 2080 "tokenizer.yy.c" #define INITIAL 0 #define REGEXPOK 1 @@ -2041,7 +2120,7 @@ void as3_set_out (FILE * out_str ); -int as3_get_leng (void ); +yy_size_t as3_get_leng (void ); char *as3_get_text (void ); @@ -2102,7 +2181,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( as3_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -2187,11 +2266,11 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 540 "tokenizer.lex" +#line 536 "tokenizer.lex" -#line 2195 "tokenizer.yy.c" +#line 2274 "tokenizer.yy.c" if ( !(yy_init) ) { @@ -2245,13 +2324,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 629 ) + if ( yy_current_state >= 705 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 628 ); + while ( yy_current_state != 704 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -2274,18 +2353,18 @@ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 543 "tokenizer.lex" +#line 539 "tokenizer.lex" {l(); /* single line comment */} YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 544 "tokenizer.lex" +#line 540 "tokenizer.lex" {l(); /* multi line comment */} YY_BREAK case 3: YY_RULE_SETUP -#line 545 "tokenizer.lex" +#line 541 "tokenizer.lex" {syntaxerror("syntax error: unterminated comment", as3_text);} YY_BREAK case 4: @@ -2294,7 +2373,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 547 "tokenizer.lex" +#line 543 "tokenizer.lex" {l();handleInclude(as3_text, as3_leng, 1);} YY_BREAK case 5: @@ -2303,26 +2382,26 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 548 "tokenizer.lex" +#line 544 "tokenizer.lex" {l();handleInclude(as3_text, as3_leng, 0);} YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 549 "tokenizer.lex" +#line 545 "tokenizer.lex" {l(); BEGIN(DEFAULT);handleString(as3_text, as3_leng);return T_STRING;} YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 550 "tokenizer.lex" +#line 546 "tokenizer.lex" {l(); BEGIN(DEFAULT);handleCData(as3_text, as3_leng);return T_STRING;} YY_BREAK case 8: /* rule 8 can match eol */ YY_RULE_SETUP -#line 553 "tokenizer.lex" +#line 549 "tokenizer.lex" {l(); BEGIN(DEFAULT);handleRaw(as3_text, as3_leng);return T_STRING;} YY_BREAK @@ -2330,47 +2409,47 @@ case 9: /* rule 9 can match eol */ YY_RULE_SETUP -#line 557 "tokenizer.lex" +#line 553 "tokenizer.lex" {l(); handleRaw(as3_text, as3_leng);return T_STRING;} YY_BREAK case 10: YY_RULE_SETUP -#line 558 "tokenizer.lex" +#line 554 "tokenizer.lex" {c(); BEGIN(REGEXPOK);return m('{');} YY_BREAK case 11: YY_RULE_SETUP -#line 559 "tokenizer.lex" +#line 555 "tokenizer.lex" {c(); return m('<');} YY_BREAK case 12: YY_RULE_SETUP -#line 560 "tokenizer.lex" +#line 556 "tokenizer.lex" {c(); return m('/');} YY_BREAK case 13: YY_RULE_SETUP -#line 561 "tokenizer.lex" +#line 557 "tokenizer.lex" {c(); return m('>');} YY_BREAK case 14: YY_RULE_SETUP -#line 562 "tokenizer.lex" +#line 558 "tokenizer.lex" {c(); return m('=');} YY_BREAK case 15: YY_RULE_SETUP -#line 563 "tokenizer.lex" +#line 559 "tokenizer.lex" {c(); handleRaw(as3_text, as3_leng);return T_IDENTIFIER;} YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP -#line 564 "tokenizer.lex" -{l();} +#line 560 "tokenizer.lex" +{l(); handleRaw(as3_text, as3_leng);return T_STRING;} YY_BREAK case YY_STATE_EOF(XML): -#line 565 "tokenizer.lex" +#line 561 "tokenizer.lex" {syntaxerror("unexpected end of file");} YY_BREAK @@ -2378,45 +2457,45 @@ case 17: /* rule 17 can match eol */ YY_RULE_SETUP -#line 569 "tokenizer.lex" +#line 565 "tokenizer.lex" {l(); handleRaw(as3_text, as3_leng);return T_STRING;} YY_BREAK case 18: YY_RULE_SETUP -#line 570 "tokenizer.lex" +#line 566 "tokenizer.lex" {c(); BEGIN(REGEXPOK);return m('{');} YY_BREAK case 19: YY_RULE_SETUP -#line 571 "tokenizer.lex" +#line 567 "tokenizer.lex" {c(); BEGIN(XML);return m('<');} YY_BREAK case 20: YY_RULE_SETUP -#line 572 "tokenizer.lex" +#line 568 "tokenizer.lex" {c(); return m('>');} YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP -#line 573 "tokenizer.lex" +#line 569 "tokenizer.lex" {l(); handleRaw(as3_text, as3_leng);return T_STRING;} YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP -#line 574 "tokenizer.lex" +#line 570 "tokenizer.lex" {l(); handleRaw(as3_text, as3_leng);return T_STRING;} YY_BREAK case YY_STATE_EOF(XMLTEXT): -#line 575 "tokenizer.lex" +#line 571 "tokenizer.lex" {syntaxerror("unexpected end of file");} YY_BREAK case 23: YY_RULE_SETUP -#line 579 "tokenizer.lex" +#line 575 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handleregexp();} YY_BREAK case 24: @@ -2425,7 +2504,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 580 "tokenizer.lex" +#line 576 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handlehex();} YY_BREAK case 25: @@ -2434,7 +2513,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 581 "tokenizer.lex" +#line 577 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handlehexfloat();} YY_BREAK case 26: @@ -2443,7 +2522,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 582 "tokenizer.lex" +#line 578 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handleint();} YY_BREAK case 27: @@ -2452,29 +2531,29 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 583 "tokenizer.lex" +#line 579 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handlefloat();} YY_BREAK case 28: YY_RULE_SETUP -#line 586 "tokenizer.lex" +#line 582 "tokenizer.lex" {c(); BEGIN(REGEXPOK);return m(T_DICTSTART);} YY_BREAK case 29: YY_RULE_SETUP -#line 587 "tokenizer.lex" +#line 583 "tokenizer.lex" {c(); BEGIN(DEFAULT); return m('{');} YY_BREAK case 30: YY_RULE_SETUP -#line 589 "tokenizer.lex" -{/* utf 8 bom */} +#line 585 "tokenizer.lex" +{/* utf 8 bom (0xfeff) */} YY_BREAK case 31: /* rule 31 can match eol */ YY_RULE_SETUP -#line 590 "tokenizer.lex" +#line 586 "tokenizer.lex" {l();} YY_BREAK case 32: @@ -2483,7 +2562,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 592 "tokenizer.lex" +#line 588 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handlehex();} YY_BREAK case 33: @@ -2492,7 +2571,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 593 "tokenizer.lex" +#line 589 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handlehexfloat();} YY_BREAK case 34: @@ -2501,7 +2580,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 594 "tokenizer.lex" +#line 590 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handleint();} YY_BREAK case 35: @@ -2510,17 +2589,17 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 595 "tokenizer.lex" +#line 591 "tokenizer.lex" {c(); BEGIN(DEFAULT);return handlefloat();} YY_BREAK case 36: YY_RULE_SETUP -#line 596 "tokenizer.lex" +#line 592 "tokenizer.lex" {c(); BEGIN(DEFAULT);return m(KW_NAN);} YY_BREAK case 37: YY_RULE_SETUP -#line 598 "tokenizer.lex" +#line 594 "tokenizer.lex" {/* for debugging: generates a tokenizer-level error */ syntaxerror("3rr0r");} YY_BREAK @@ -2530,7 +2609,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 601 "tokenizer.lex" +#line 597 "tokenizer.lex" {l();BEGIN(DEFAULT);handleLabel(as3_text, as3_leng-3);return T_FOR;} YY_BREAK case 39: @@ -2539,7 +2618,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 602 "tokenizer.lex" +#line 598 "tokenizer.lex" {l();BEGIN(DEFAULT);handleLabel(as3_text, as3_leng-2);return T_DO;} YY_BREAK case 40: @@ -2548,7 +2627,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 603 "tokenizer.lex" +#line 599 "tokenizer.lex" {l();BEGIN(DEFAULT);handleLabel(as3_text, as3_leng-5);return T_WHILE;} YY_BREAK case 41: @@ -2557,449 +2636,449 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up as3_text again */ YY_RULE_SETUP -#line 604 "tokenizer.lex" +#line 600 "tokenizer.lex" {l();BEGIN(DEFAULT);handleLabel(as3_text, as3_leng-6);return T_SWITCH;} YY_BREAK case 42: /* rule 42 can match eol */ YY_RULE_SETUP -#line 605 "tokenizer.lex" +#line 601 "tokenizer.lex" {l();BEGIN(DEFAULT);return m(KW_DEFAULT_XML);} YY_BREAK case 43: YY_RULE_SETUP -#line 606 "tokenizer.lex" +#line 602 "tokenizer.lex" {c();BEGIN(DEFAULT);a3_lval.id="";return T_FOR;} YY_BREAK case 44: YY_RULE_SETUP -#line 607 "tokenizer.lex" +#line 603 "tokenizer.lex" {c();BEGIN(DEFAULT);a3_lval.id="";return T_DO;} YY_BREAK case 45: YY_RULE_SETUP -#line 608 "tokenizer.lex" +#line 604 "tokenizer.lex" {c();BEGIN(DEFAULT);a3_lval.id="";return T_WHILE;} YY_BREAK case 46: YY_RULE_SETUP -#line 609 "tokenizer.lex" +#line 605 "tokenizer.lex" {c();BEGIN(DEFAULT);a3_lval.id="";return T_SWITCH;} YY_BREAK case 47: YY_RULE_SETUP -#line 611 "tokenizer.lex" +#line 607 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_ANDAND);} YY_BREAK case 48: YY_RULE_SETUP -#line 612 "tokenizer.lex" +#line 608 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_OROR);} YY_BREAK case 49: YY_RULE_SETUP -#line 613 "tokenizer.lex" +#line 609 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_NE);} YY_BREAK case 50: YY_RULE_SETUP -#line 614 "tokenizer.lex" +#line 610 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_NEE);} YY_BREAK case 51: YY_RULE_SETUP -#line 615 "tokenizer.lex" +#line 611 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_EQEQEQ);} YY_BREAK case 52: YY_RULE_SETUP -#line 616 "tokenizer.lex" +#line 612 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_EQEQ);} YY_BREAK case 53: YY_RULE_SETUP -#line 617 "tokenizer.lex" +#line 613 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_GE);} YY_BREAK case 54: YY_RULE_SETUP -#line 618 "tokenizer.lex" +#line 614 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_LE);} YY_BREAK case 55: YY_RULE_SETUP -#line 619 "tokenizer.lex" +#line 615 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(T_MINUSMINUS);} YY_BREAK case 56: YY_RULE_SETUP -#line 620 "tokenizer.lex" +#line 616 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(T_PLUSPLUS);} YY_BREAK case 57: YY_RULE_SETUP -#line 621 "tokenizer.lex" +#line 617 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_PLUSBY);} YY_BREAK case 58: YY_RULE_SETUP -#line 622 "tokenizer.lex" +#line 618 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_XORBY);} YY_BREAK case 59: YY_RULE_SETUP -#line 623 "tokenizer.lex" +#line 619 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_MINUSBY);} YY_BREAK case 60: YY_RULE_SETUP -#line 624 "tokenizer.lex" +#line 620 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_DIVBY);} YY_BREAK case 61: YY_RULE_SETUP -#line 625 "tokenizer.lex" +#line 621 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_MODBY);} YY_BREAK case 62: YY_RULE_SETUP -#line 626 "tokenizer.lex" +#line 622 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_MULBY);} YY_BREAK case 63: YY_RULE_SETUP -#line 627 "tokenizer.lex" +#line 623 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_ORBY);} YY_BREAK case 64: YY_RULE_SETUP -#line 628 "tokenizer.lex" +#line 624 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_ANDBY);} YY_BREAK case 65: YY_RULE_SETUP -#line 629 "tokenizer.lex" +#line 625 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_SHRBY);} YY_BREAK case 66: YY_RULE_SETUP -#line 630 "tokenizer.lex" +#line 626 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_SHLBY);} YY_BREAK case 67: YY_RULE_SETUP -#line 631 "tokenizer.lex" +#line 627 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_USHRBY);} YY_BREAK case 68: YY_RULE_SETUP -#line 632 "tokenizer.lex" +#line 628 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_SHL);} YY_BREAK case 69: YY_RULE_SETUP -#line 633 "tokenizer.lex" +#line 629 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_USHR);} YY_BREAK case 70: YY_RULE_SETUP -#line 634 "tokenizer.lex" +#line 630 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_SHR);} YY_BREAK case 71: YY_RULE_SETUP -#line 635 "tokenizer.lex" +#line 631 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_DOTDOTDOT);} YY_BREAK case 72: YY_RULE_SETUP -#line 636 "tokenizer.lex" +#line 632 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_DOTDOT);} YY_BREAK case 73: YY_RULE_SETUP -#line 637 "tokenizer.lex" +#line 633 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m('.');} YY_BREAK case 74: YY_RULE_SETUP -#line 638 "tokenizer.lex" +#line 634 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(T_COLONCOLON);} YY_BREAK case 75: YY_RULE_SETUP -#line 639 "tokenizer.lex" +#line 635 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(':');} YY_BREAK case 76: YY_RULE_SETUP -#line 640 "tokenizer.lex" +#line 636 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_INSTANCEOF);} YY_BREAK case 77: YY_RULE_SETUP -#line 641 "tokenizer.lex" +#line 637 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_IMPLEMENTS);} YY_BREAK case 78: YY_RULE_SETUP -#line 642 "tokenizer.lex" +#line 638 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_INTERFACE);} YY_BREAK case 79: YY_RULE_SETUP -#line 643 "tokenizer.lex" +#line 639 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_PROTECTED);} YY_BREAK case 80: YY_RULE_SETUP -#line 644 "tokenizer.lex" +#line 640 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_NAMESPACE);} YY_BREAK case 81: YY_RULE_SETUP -#line 645 "tokenizer.lex" +#line 641 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_UNDEFINED);} YY_BREAK case 82: YY_RULE_SETUP -#line 646 "tokenizer.lex" +#line 642 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_ARGUMENTS);} YY_BREAK case 83: YY_RULE_SETUP -#line 647 "tokenizer.lex" +#line 643 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_CONTINUE);} YY_BREAK case 84: YY_RULE_SETUP -#line 648 "tokenizer.lex" +#line 644 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_OVERRIDE);} YY_BREAK case 85: YY_RULE_SETUP -#line 649 "tokenizer.lex" +#line 645 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_INTERNAL);} YY_BREAK case 86: YY_RULE_SETUP -#line 650 "tokenizer.lex" +#line 646 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_FUNCTION);} YY_BREAK case 87: YY_RULE_SETUP -#line 651 "tokenizer.lex" +#line 647 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_FINALLY);} YY_BREAK case 88: YY_RULE_SETUP -#line 652 "tokenizer.lex" +#line 648 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_DEFAULT);} YY_BREAK case 89: YY_RULE_SETUP -#line 653 "tokenizer.lex" +#line 649 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_PACKAGE);} YY_BREAK case 90: YY_RULE_SETUP -#line 654 "tokenizer.lex" +#line 650 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_PRIVATE);} YY_BREAK case 91: YY_RULE_SETUP -#line 655 "tokenizer.lex" +#line 651 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_DYNAMIC);} YY_BREAK case 92: YY_RULE_SETUP -#line 656 "tokenizer.lex" +#line 652 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_EXTENDS);} YY_BREAK case 93: YY_RULE_SETUP -#line 657 "tokenizer.lex" +#line 653 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_DELETE);} YY_BREAK case 94: YY_RULE_SETUP -#line 658 "tokenizer.lex" +#line 654 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_RETURN);} YY_BREAK case 95: YY_RULE_SETUP -#line 659 "tokenizer.lex" +#line 655 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_PUBLIC);} YY_BREAK case 96: YY_RULE_SETUP -#line 660 "tokenizer.lex" +#line 656 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_NATIVE);} YY_BREAK case 97: YY_RULE_SETUP -#line 661 "tokenizer.lex" +#line 657 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_STATIC);} YY_BREAK case 98: YY_RULE_SETUP -#line 662 "tokenizer.lex" +#line 658 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_IMPORT);} YY_BREAK case 99: YY_RULE_SETUP -#line 663 "tokenizer.lex" +#line 659 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_TYPEOF);} YY_BREAK case 100: YY_RULE_SETUP -#line 664 "tokenizer.lex" +#line 660 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_THROW);} YY_BREAK case 101: YY_RULE_SETUP -#line 665 "tokenizer.lex" +#line 661 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_CLASS);} YY_BREAK case 102: YY_RULE_SETUP -#line 666 "tokenizer.lex" +#line 662 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_CONST);} YY_BREAK case 103: YY_RULE_SETUP -#line 667 "tokenizer.lex" +#line 663 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_CATCH);} YY_BREAK case 104: YY_RULE_SETUP -#line 668 "tokenizer.lex" +#line 664 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_FINAL);} YY_BREAK case 105: YY_RULE_SETUP -#line 669 "tokenizer.lex" +#line 665 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_FALSE);} YY_BREAK case 106: YY_RULE_SETUP -#line 670 "tokenizer.lex" +#line 666 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_BREAK);} YY_BREAK case 107: YY_RULE_SETUP -#line 671 "tokenizer.lex" +#line 667 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_SUPER);} YY_BREAK case 108: YY_RULE_SETUP -#line 672 "tokenizer.lex" +#line 668 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_EACH);} YY_BREAK case 109: YY_RULE_SETUP -#line 673 "tokenizer.lex" +#line 669 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_VOID);} YY_BREAK case 110: YY_RULE_SETUP -#line 674 "tokenizer.lex" +#line 670 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_TRUE);} YY_BREAK case 111: YY_RULE_SETUP -#line 675 "tokenizer.lex" +#line 671 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_NULL);} YY_BREAK case 112: YY_RULE_SETUP -#line 676 "tokenizer.lex" +#line 672 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_ELSE);} YY_BREAK case 113: YY_RULE_SETUP -#line 677 "tokenizer.lex" +#line 673 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_CASE);} YY_BREAK case 114: YY_RULE_SETUP -#line 678 "tokenizer.lex" +#line 674 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_WITH);} YY_BREAK case 115: YY_RULE_SETUP -#line 679 "tokenizer.lex" +#line 675 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_USE);} YY_BREAK case 116: YY_RULE_SETUP -#line 680 "tokenizer.lex" +#line 676 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_NEW);} YY_BREAK case 117: YY_RULE_SETUP -#line 681 "tokenizer.lex" +#line 677 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_GET);} YY_BREAK case 118: YY_RULE_SETUP -#line 682 "tokenizer.lex" +#line 678 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_SET);} YY_BREAK case 119: YY_RULE_SETUP -#line 683 "tokenizer.lex" +#line 679 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_VAR);} YY_BREAK case 120: YY_RULE_SETUP -#line 684 "tokenizer.lex" +#line 680 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_TRY);} YY_BREAK case 121: YY_RULE_SETUP -#line 685 "tokenizer.lex" +#line 681 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_IS) ;} YY_BREAK case 122: YY_RULE_SETUP -#line 686 "tokenizer.lex" +#line 682 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_IN) ;} YY_BREAK case 123: YY_RULE_SETUP -#line 687 "tokenizer.lex" +#line 683 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(KW_IF) ;} YY_BREAK case 124: YY_RULE_SETUP -#line 688 "tokenizer.lex" +#line 684 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(KW_AS);} YY_BREAK case 125: YY_RULE_SETUP -#line 689 "tokenizer.lex" +#line 685 "tokenizer.lex" {c();BEGIN(DEFAULT);return handleIdentifier();} YY_BREAK case 126: YY_RULE_SETUP -#line 691 "tokenizer.lex" +#line 687 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(as3_text[0]);} YY_BREAK case 127: YY_RULE_SETUP -#line 692 "tokenizer.lex" +#line 688 "tokenizer.lex" {c();BEGIN(REGEXPOK);return m(as3_text[0]);} YY_BREAK case 128: YY_RULE_SETUP -#line 693 "tokenizer.lex" +#line 689 "tokenizer.lex" {c();BEGIN(DEFAULT);return m(as3_text[0]);} YY_BREAK case 129: YY_RULE_SETUP -#line 696 "tokenizer.lex" +#line 692 "tokenizer.lex" {tokenerror();} YY_BREAK @@ -3007,7 +3086,7 @@ case YY_STATE_EOF(REGEXPOK): case YY_STATE_EOF(BEGINNING): case YY_STATE_EOF(DEFAULT): -#line 698 "tokenizer.lex" +#line 694 "tokenizer.lex" {l(); void*b = leave_file(); if (!b) { @@ -3022,10 +3101,10 @@ YY_BREAK case 130: YY_RULE_SETUP -#line 710 "tokenizer.lex" +#line 706 "tokenizer.lex" ECHO; YY_BREAK -#line 3029 "tokenizer.yy.c" +#line 3108 "tokenizer.yy.c" case YY_END_OF_BUFFER: { @@ -3210,7 +3289,7 @@ else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -3224,7 +3303,7 @@ if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -3255,7 +3334,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -3317,7 +3396,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 629 ) + if ( yy_current_state >= 705 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -3345,11 +3424,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 629 ) + if ( yy_current_state >= 705 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 628); + yy_is_jam = (yy_current_state == 704); return yy_is_jam ? 0 : yy_current_state; } @@ -3366,7 +3445,7 @@ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; + register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -3415,7 +3494,7 @@ else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -3439,7 +3518,7 @@ case EOB_ACT_END_OF_FILE: { if ( as3_wrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -3577,19 +3656,9 @@ as3_free((void *) b ); } -#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */ -#ifdef __cplusplus -extern "C" { -#endif -#ifdef __THROW /* this is a gnuism */ -extern int isatty (int ) __THROW; -#else +#ifndef __cplusplus extern int isatty (int ); -#endif -#ifdef __cplusplus -} -#endif -#endif +#endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, @@ -3703,7 +3772,7 @@ */ static void as3_ensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -3800,12 +3869,11 @@ * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE as3__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE as3__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3887,7 +3955,7 @@ /** Get the length of the current token. * */ -int as3_get_leng (void) +yy_size_t as3_get_leng (void) { return as3_leng; } @@ -4035,7 +4103,7 @@ #define YYTABLES_NAME "yytables" -#line 710 "tokenizer.lex" +#line 706 "tokenizer.lex" @@ -4060,7 +4128,7 @@ if(c1>='0' && c1<='9') syntaxerror("syntax error: %s (identifiers must not start with a digit)"); else - syntaxerror("syntax error [%d]: %s", (yy_start-1)/2, buf); + syntaxerror("syntax error [state=%d]: %s", (yy_start-1)/2, buf); printf("\n"); exit(1); yyterminate(); diff -Nru swftools-0.9.0/lib/base64.c swftools-0.9.2/lib/base64.c --- swftools-0.9.0/lib/base64.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/base64.c 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,65 @@ +/* base64.c + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include "base64.h" + +static const char base64[65]= +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +void write_base64(FILE*fi, const char* s) +{ + const unsigned char*b = (const unsigned char*)s; + const unsigned char*end = b + strlen(b); + const unsigned char*end_minus_3 = end - 3; + + while(b <= end_minus_3) { + char data[4]; + data[0] = base64[(b[0]>>2)&63 ]; + data[1] = base64[(b[0]<<4|b[1]>>4)&63]; + data[2] = base64[(b[1]<<2|b[2]>>6)&63]; + data[3] = base64[(b[2])&63 ]; + fwrite(data, 4, 1, fi); + b += 3; + } + + unsigned char data[4]; + switch(end - b) { + case 0: + return; //done + case 1: + data[0] = base64[(b[0]>>2)&63]; + data[1] = base64[(b[0]<<4)&63]; + data[2] = '='; + data[3] = '='; + break; + case 2: + data[0] = base64[(b[0]>>2)&63]; + data[1] = base64[(b[0]<<4|b[1]>>4)&63]; + data[2] = base64[(b[1]<<2)&63]; + data[3] = '='; + break; + default: + fprintf(stderr, "internal error in base64 implementation (%d)\n", end-b); + break; + } + fwrite(data, 4, 1, fi); +} diff -Nru swftools-0.9.0/lib/base64.h swftools-0.9.2/lib/base64.h --- swftools-0.9.0/lib/base64.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/base64.h 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,25 @@ +/* base64.h + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __base64_h__ +#define __base64_h__ + +void write_base64(FILE*fi, const char* s); + +#endif diff -Nru swftools-0.9.0/lib/bitio.c swftools-0.9.2/lib/bitio.c --- swftools-0.9.0/lib/bitio.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/bitio.c 2011-10-07 03:20:17.000000000 +0000 @@ -28,7 +28,9 @@ #endif #include #include +#define __USE_LARGEFILE64 #include +#include #include "../config.h" @@ -49,9 +51,14 @@ { memset(r, 0, sizeof(reader_t)); } +static int reader_nullseek(reader_t*r, int pos) +{ + return pos; +} void reader_init_nullreader(reader_t*r) { r->read = reader_nullread; + r->seek = reader_nullseek; r->dealloc = reader_nullread_dealloc; r->internal = 0; r->type = READER_TYPE_NULL; @@ -68,15 +75,44 @@ reader->pos += ret; return ret; } +static void reader_fileread_dealloc(reader_t*r) +{ + if(r->type == READER_TYPE_FILE2) { + close((ptroff_t)r->internal); + } + memset(r, 0, sizeof(reader_t)); +} +static int reader_fileread_seek(reader_t*r, int pos) +{ + return lseek((ptroff_t)r->internal, pos, SEEK_SET); +} void reader_init_filereader(reader_t*r, int handle) { r->read = reader_fileread; + r->seek = reader_fileread_seek; + r->dealloc = reader_fileread_dealloc; r->internal = (void*)handle; r->type = READER_TYPE_FILE; r->mybyte = 0; r->bitpos = 8; r->pos = 0; } +int reader_init_filereader2(reader_t*r, const char*filename) +{ +#ifdef HAVE_OPEN64 + int fi = open64 +#else + int fi = open +#endif + (filename, +#ifdef O_BINARY + O_BINARY| +#endif + O_RDONLY); + reader_init_filereader(r, fi); + r->type = READER_TYPE_FILE2; + return fi; +} /* ---------------------------- mem reader ------------------------------- */ @@ -93,10 +129,21 @@ if(mr->length - reader->pos < len) { len = mr->length - reader->pos; } + if(!len) return 0; memcpy(data, &mr->data[reader->pos], len); reader->pos += len; return len; } +static int reader_memseek(reader_t*reader, int pos) +{ + memread_t*mr = (memread_t*)reader->internal; + if(pos>=0 && pos<=mr->length) { + reader->pos = pos; + return pos; + } else { + return -1; + } +} static void reader_memread_dealloc(reader_t*reader) { if(reader->internal) @@ -109,6 +156,7 @@ mr->data = (unsigned char*)newdata; mr->length = newlength; r->read = reader_memread; + r->seek = reader_memseek; r->dealloc = reader_memread_dealloc; r->internal = (void*)mr; r->type = READER_TYPE_MEM; @@ -117,6 +165,33 @@ r->pos = 0; } +/* ---------------------------- zzip reader ------------------------------ */ +#ifdef HAVE_ZZIP +static int reader_zzip_read(reader_t*reader, void* data, int len) +{ + return zzip_file_read((ZZIP_FILE*)reader->internal, data, len); +} +static void reader_zzip_dealloc(reader_t*reader) +{ + memset(reader, 0, sizeof(reader_t)); +} +static int reader_zzip_seek(reader_t*reader, int pos) +{ + return zzip_seek((ZZIP_FILE*)reader->internal, pos, SEEK_SET); +} +void reader_init_zzipreader(reader_t*r,ZZIP_FILE*z) +{ + r->read = reader_zzip_read; + r->seek = reader_zzip_seek; + r->dealloc = reader_zzip_dealloc; + r->internal = z; + r->type = READER_TYPE_ZZIP; + r->mybyte = 0; + r->bitpos = 8; + r->pos = 0; +} +#endif + /* ---------------------------- mem writer ------------------------------- */ typedef struct _memwrite @@ -262,7 +337,10 @@ { filewrite_t * fw= (filewrite_t*)w->internal; w->pos += len; - return write(fw->handle, data, len); + int l = write(fw->handle, data, len); + if(l < len) + fprintf(stderr, "Error writing to file: %d/%d", l, len); + return l; } static void writer_filewrite_finish(writer_t*w) { @@ -288,7 +366,12 @@ } void writer_init_filewriter2(writer_t*w, char*filename) { - int fi = open("movie.swf", +#ifdef HAVE_OPEN64 + int fi = open64 +#else + int fi = open +#endif + (filename, #ifdef O_BINARY O_BINARY| #endif @@ -338,7 +421,7 @@ msg, ret, zs->msg?zs->msg:"unknown"); - perror("errno:"); + if(errno) perror("errno:"); exit(1); } #endif @@ -390,6 +473,11 @@ exit(1); #endif } +static int reader_zlibseek(reader_t*reader, int pos) +{ + fprintf(stderr, "Erro: seeking not supported for zlib streams"); + return -1; +} static void reader_zlibinflate_dealloc(reader_t*reader) { #ifdef HAVE_ZLIB @@ -411,6 +499,7 @@ memset(r, 0, sizeof(reader_t)); r->internal = z; r->read = reader_zlibinflate; + r->seek = reader_zlibseek; r->dealloc = reader_zlibinflate_dealloc; r->type = READER_TYPE_ZLIB; r->pos = 0; @@ -652,6 +741,14 @@ } return b; } +S8 reader_readS8(reader_t*r) +{ + S8 b = 0; + if(r->read(r, &b, 1)<1) { + fprintf(stderr, "bitio.c:reader_readU8: Read over end of memory region\n"); + } + return b; +} U16 reader_readU16(reader_t*r) { U8 b1=0,b2=0; @@ -676,6 +773,7 @@ fprintf(stderr, "bitio.c:reader_readU32: Read over end of memory region\n"); return b1|b2<<8|b3<<16|b4<<24; } + float reader_readFloat(reader_t*r) { float f; @@ -715,6 +813,38 @@ g.finish(&g); return string; } +unsigned int read_compressed_uint(reader_t*r) +{ + unsigned int u = 0; + unsigned int b; + do { + b = reader_readU8(r); + u = u<<7|b&0x7f; + } while(b&0x80); + return u; +} +int read_compressed_int(reader_t*r) +{ + int i = 0; + int b; + + b = reader_readS8(r); + i = b&0x7f; + + if(b&0x40) + i|=0xffffff80; //sign extension + + if(!(b&0x80)) + return i; + + do { + b = reader_readS8(r); + i = i<<7|b&0x7f; + } while(b&0x80); + + return i; +} + void writer_writeString(writer_t*w, const char*s) { @@ -783,3 +913,51 @@ w->write(w, &b7, 1); w->write(w, &b8, 1); } +void write_compressed_uint(writer_t*w, unsigned int u) +{ + if(u<0x80) { + writer_writeU8(w, u); + } else if(u<0x4000) { + writer_writeU8(w, u>>7|0x80); + writer_writeU8(w, u&0x7f); + } else if(u<0x200000) { + writer_writeU8(w, u>>14|0x80); + writer_writeU8(w, u>>7|0x80); + writer_writeU8(w, u&0x7f); + } else if(u<0x10000000) { + writer_writeU8(w, u>>21|0x80); + writer_writeU8(w, u>>14|0x80); + writer_writeU8(w, u>>7|0x80); + writer_writeU8(w, u&0x7f); + } else { + writer_writeU8(w, u>>28|0x80); + writer_writeU8(w, u>>21|0x80); + writer_writeU8(w, u>>14|0x80); + writer_writeU8(w, u>>7|0x80); + writer_writeU8(w, u&0x7f); + } +} +void write_compressed_int(writer_t*w, int i) +{ + if(i>=-0x40 && i<0x40) { + writer_writeU8(w, i&0x7f); + } else if(i>=-0x2000 && i<0x2000) { + writer_writeU8(w, (i>>7)&0x7f|0x80); + writer_writeU8(w, i&0x7f); + } else if(i>=-0x100000 && i<0x100000) { + writer_writeU8(w, (i>>14)&0x7f|0x80); + writer_writeU8(w, (i>>7)&0x7f|0x80); + writer_writeU8(w, (i)&0x7f); + } else if(i>=-0x8000000 && i<0x8000000) { + writer_writeU8(w, (i>>21)&0x7f|0x80); + writer_writeU8(w, (i>>14)&0x7f|0x80); + writer_writeU8(w, (i>>7)&0x7f|0x80); + writer_writeU8(w, (i)&0x7f); + } else { + writer_writeU8(w, (i>>28)&0x7f|0x80); + writer_writeU8(w, (i>>21)&0x7f|0x80); + writer_writeU8(w, (i>>14)&0x7f|0x80); + writer_writeU8(w, (i>>7)&0x7f|0x80); + writer_writeU8(w, (i)&0x7f); + } +} diff -Nru swftools-0.9.0/lib/bitio.h swftools-0.9.2/lib/bitio.h --- swftools-0.9.0/lib/bitio.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/bitio.h 2011-10-07 03:20:17.000000000 +0000 @@ -21,6 +21,11 @@ #include #include "types.h" +#include "../config.h" + +#ifdef HAVE_ZZIP +#include "zzip/lib.h" +#endif #ifndef __rfxswf_bitio_h__ #define __rfxswf_bitio_h__ @@ -31,6 +36,8 @@ #define READER_TYPE_ZLIB_C 4 #define READER_TYPE_ZLIB READER_TYPE_ZLIB_U #define READER_TYPE_NULL 5 +#define READER_TYPE_FILE2 6 +#define READER_TYPE_ZZIP 7 #define WRITER_TYPE_FILE 1 #define WRITER_TYPE_MEM 2 @@ -43,6 +50,7 @@ typedef struct _reader { int (*read)(struct _reader*, void*data, int len); + int (*seek)(struct _reader*, int pos); void (*dealloc)(struct _reader*); void *internal; @@ -76,6 +84,9 @@ double reader_readDouble(reader_t*r); char*reader_readString(reader_t*r); +unsigned int read_compressed_uint(reader_t*r); +int read_compressed_int(reader_t*r); + void writer_resetbits(writer_t*w); void writer_writebit(writer_t*w, int bit); void writer_writebits(writer_t*w, unsigned int data, int bits); @@ -87,12 +98,19 @@ void writer_writeDouble(writer_t*w, double f); void writer_writeString(writer_t*w, const char*s); +void write_compressed_uint(writer_t*w, unsigned int u); +void write_compressed_int(writer_t*w, int i); + /* standard readers / writers */ void reader_init_filereader(reader_t*r, int handle); +int reader_init_filereader2(reader_t*r, const char*filename); void reader_init_zlibinflate(reader_t*r, reader_t*input); void reader_init_memreader(reader_t*r, void*data, int length); void reader_init_nullreader(reader_t*r); +#ifdef HAVE_ZZIP +void reader_init_zzipreader(reader_t*r,ZZIP_FILE*z); +#endif void writer_init_filewriter(writer_t*w, int handle); void writer_init_filewriter2(writer_t*w, char*filename); diff -Nru swftools-0.9.0/lib/devices/bbox.c swftools-0.9.2/lib/devices/bbox.c --- swftools-0.9.0/lib/devices/bbox.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/bbox.c 2010-11-12 18:52:49.000000000 +0000 @@ -127,7 +127,7 @@ } } -void bbox_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void bbox_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; } diff -Nru swftools-0.9.0/lib/devices/dummy.c swftools-0.9.2/lib/devices/dummy.c --- swftools-0.9.0/lib/devices/dummy.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/dummy.c 2010-11-12 18:52:36.000000000 +0000 @@ -102,11 +102,11 @@ i->out->drawchar(i->out, font, glyphnr, color, matrix); } -void dummy_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void dummy_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; if(i->out) - i->out->drawlink(i->out, line, action); + i->out->drawlink(i->out, line, action, text); } void dummy_endpage(gfxdevice_t*dev) diff -Nru swftools-0.9.0/lib/devices/file.c swftools-0.9.2/lib/devices/file.c --- swftools-0.9.0/lib/devices/file.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/file.c 2010-11-12 18:52:40.000000000 +0000 @@ -133,7 +133,7 @@ internal_t*i = (internal_t*)dev->internal; } -void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; fprintf(i->fi, "drawlink %s\n", action); diff -Nru swftools-0.9.0/lib/devices/ocr.c swftools-0.9.2/lib/devices/ocr.c --- swftools-0.9.0/lib/devices/ocr.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/ocr.c 2010-11-12 18:52:48.000000000 +0000 @@ -73,7 +73,7 @@ void ocr_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) { ((internal_t*)dev->internal)->render->fillgradient(((internal_t*)dev->internal)->render, line, gradient, type, matrix); } void ocr_addfont(gfxdevice_t*dev, gfxfont_t*font) { ((internal_t*)dev->internal)->render->addfont(((internal_t*)dev->internal)->render, font); } void ocr_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) { ((internal_t*)dev->internal)->render->drawchar(((internal_t*)dev->internal)->render, font, glyphnr, color, matrix); } -void ocr_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) { ((internal_t*)dev->internal)->render->drawlink(((internal_t*)dev->internal)->render, line, action); } +void ocr_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { ((internal_t*)dev->internal)->render->drawlink(((internal_t*)dev->internal)->render, line, action, text); } void ocr_result_write(gfxresult_t*r, int filedesc) { diff -Nru swftools-0.9.0/lib/devices/opengl.c swftools-0.9.2/lib/devices/opengl.c --- swftools-0.9.0/lib/devices/opengl.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/devices/opengl.c 2011-10-07 03:20:17.000000000 +0000 @@ -5,7 +5,6 @@ #include "../gfxdevice.h" #include "../gfxtools.h" -#include "../MD5.h" #include "../types.h" #include @@ -15,10 +14,6 @@ #include -//#define ZSTEP (1/65536.0) -#define ZSTEP (1/32.0) -//#define ZSTEP (1/4.0) - typedef struct _fontlist { gfxfont_t*font; struct _fontlist*next; @@ -30,6 +25,8 @@ fontlist_t* fontlist; int width, height; int currentz; + + double zstep; int config_polygonoutlines; @@ -122,6 +119,8 @@ dbg("setparameter %s=%s", key, value); if(!strcmp(key, "polygonoutlines")) { i->config_polygonoutlines = atoi(value); + } else if(!strcmp(key, "zstep")) { + i->zstep = atof(value); } return 0; } @@ -149,7 +148,7 @@ { dbg("stroke"); internal_t*i = (internal_t*)dev->internal; - i->currentz++; + i->currentz+=1; char running = 0; gfxline_t*l=0; @@ -160,7 +159,7 @@ width = 1.0; } glLineWidth(width); - double z = i->currentz*ZSTEP; + double z = i->currentz*i->zstep; glPolygonOffset(0.0, 500.0); @@ -273,7 +272,7 @@ glColor4f(color->r/255.0, color->g/255.0, color->b/255.0, color->a/255.0); i->currentz ++; - z = (i->currentz*ZSTEP); + z = (i->currentz*i->zstep); tesselatePolygon(i->tesselator, z, line); //tesselatePolygon(i->tesselator_line, z, line); @@ -306,7 +305,8 @@ int size = img->width*img->height*4; U8*data = (U8*)img->data; gfxhash_t hash; - hash_md5(data, size, hash.d); + memset(&hash, 0, sizeof(hash)); + *(int*)&hash.d[0] = string_hash3(data, size); return hash; } @@ -448,7 +448,7 @@ xyz[len*5+0] = l->x; xyz[len*5+1] = l->y; - xyz[len*5+2] = (i->currentz*ZSTEP); + xyz[len*5+2] = (i->currentz*i->zstep); xyz[len*5+3] = 0; xyz[len*5+4] = 0; gfxmatrix_transform(&m2, /*src*/&xyz[len*5+0], /*dest*/&xyz[len*5+3]); @@ -536,7 +536,7 @@ -void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void opengl_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { dbg("link"); } @@ -601,6 +601,8 @@ dev->endpage = opengl_endpage; dev->finish = opengl_finish; + i->zstep = 1.0 / 32; + i->tesselator = gluNewTess(); gluTessCallback(i->tesselator, GLU_TESS_ERROR, (callbackfunction_t)errorCallback); gluTessCallback(i->tesselator, GLU_TESS_VERTEX, (callbackfunction_t)vertexCallback); diff -Nru swftools-0.9.0/lib/devices/ops.c swftools-0.9.2/lib/devices/ops.c --- swftools-0.9.0/lib/devices/ops.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/devices/ops.c 2010-11-12 18:52:44.000000000 +0000 @@ -66,7 +66,7 @@ col2.r = col->r; col2.g = col->g; col2.b = col->b; - col2.a = (col->a * i->alpha)>>8; + col2.a = (col->a * i->alpha)/255; return col2; } @@ -146,10 +146,10 @@ i->out->drawchar(i->out, font, glyphnr, color, matrix); } -void ops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void ops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; - i->out->drawlink(i->out, line, action); + i->out->drawlink(i->out, line, action, text); } void ops_endpage(struct _gfxdevice*dev) diff -Nru swftools-0.9.0/lib/devices/pdf.c swftools-0.9.2/lib/devices/pdf.c --- swftools-0.9.0/lib/devices/pdf.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/devices/pdf.c 2010-11-12 18:52:41.000000000 +0000 @@ -0,0 +1,597 @@ +/* pdf.c + + Part of the swftools package. + + Copyright (c) 2007 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "../os.h" +#include "../q.h" +#include "../log.h" +#include "../jpeg.h" +#include "../types.h" +#include "../mem.h" +#include "../log.h" +#include "../gfxdevice.h" +#include "../gfxtools.h" +#include "../gfximage.h" +#include "../gfxfont.h" + +typedef struct _internal { + PDF* p; + + char config_addblankpages; + double config_xpad; + double config_ypad; + int config_maxdpi; + int config_mindpi; + + int width,height; + int num_pages; + + char*tempfile; + char*page_opts; + double lastx,lasty; + gfxfontlist_t*fontlist; + + char has_matrix; + double m00, m01, m10, m11; +} internal_t; + +static void restore_matrix(internal_t*i) +{ + if(i->has_matrix) { + PDF_restore(i->p); + i->has_matrix=0; + i->m00 = 0; + i->m01 = 0; + i->m10 = 0; + i->m11 = 0; + } +} +static void set_matrix(internal_t*i, double m00, double m01, double m10, double m11) +{ + restore_matrix(i); + + i->m00 = m00; + i->m01 = m01; + i->m10 = m10; + i->m11 = m11; + + PDF_save(i->p); + PDF_setmatrix(i->p, m00, -m01, m10, -m11, 0, i->height+2*i->config_ypad); + i->has_matrix = 1; +} +static void reset_matrix(internal_t*i) +{ + set_matrix(i, 1.0, 0.0, 0.0, 1.0); +} +static void transform_back(internal_t*i, double x, double y, double *ox, double *oy) +{ + double det = i->m00*i->m11 - i->m10*i->m01; + if(!det) { + msg(" Codependent text matrix"); + *ox=*oy=0; + return; + } + *ox = (x*i->m11 - i->m10*y)/det; + *oy = (i->m00*y - x*i->m01)/det; +} + +void pdf_startpage(gfxdevice_t*dev, int width, int height) +{ + internal_t*i = (internal_t*)dev->internal; + + if(!i->tempfile) { + i->tempfile = strdup(mktempname(0, "pdf")); + + PDF_begin_document(i->p, i->tempfile, 0, ""); + //PDF_set_value(i->p, "compress", 0); + PDF_set_parameter(i->p, "usercoordinates", "true"); + PDF_set_parameter(i->p, "topdown", "true"); + } + + int width_plus_pad = width+floor(i->config_xpad*2); + int height_plus_pad = height+floor(i->config_ypad*2); + PDF_begin_page_ext(i->p, width_plus_pad, height_plus_pad, i->page_opts); + PDF_set_value(i->p, "CropBox/llx", 0); + PDF_set_value(i->p, "CropBox/lly", 0); + PDF_set_value(i->p, "CropBox/urx", width_plus_pad); + PDF_set_value(i->p, "CropBox/ury", height_plus_pad); + if(i->config_xpad || i->config_ypad) { + PDF_set_value(i->p, "TrimBox/llx", i->config_xpad); + PDF_set_value(i->p, "TrimBox/lly", i->config_ypad); + PDF_set_value(i->p, "TrimBox/urx", i->config_xpad+width); + PDF_set_value(i->p, "TrimBox/ury", i->config_ypad+height); + } + + PDF_set_parameter(i->p, "fillrule", "evenodd"); + i->width = width; + i->height = height; + i->num_pages++; + + reset_matrix(i); +} + +int pdf_setparameter(gfxdevice_t*dev, const char*key, const char*value) +{ + internal_t*i = (internal_t*)dev->internal; + if(!strcmp(key, "addblankpages")) { + i->config_addblankpages = atoi(value); + } else if(!strcmp(key, "maxdpi")) { + i->config_maxdpi = atoi(value); + } else if(!strcmp(key, "mindpi")) { + i->config_mindpi = atoi(value); + } else if(!strcmp(key, "xpad")) { + i->config_xpad = atof(value); + } else if(!strcmp(key, "ypad")) { + i->config_ypad = atof(value); + } + return 0; +} + + +static int mkline(gfxline_t*line, PDF*p, double mx, double my, double scale, char fill) +{ + double x=0,y=0; + char first = 1; + int ret = 0; + gfxline_t*free_line = 0; + if(fill) { + line = gfxline_restitch(gfxline_clone(line)); + free_line = line; + } + while(line) { + if(line->type == gfx_moveTo && (x!=line->x || y!=line->y || first)) { + first = 0; + PDF_moveto(p, line->x*scale+mx, line->y*scale+my); + } else if(line->type == gfx_lineTo) { + PDF_lineto(p, line->x*scale+mx, line->y*scale+my); + ret = 1; + } else { + /* when converting a quadratic bezier to a cubic bezier, the + two new control points are both 2/3 the way from the + endpoints to the old control point */ + double c1x = (x + line->sx*2)/3; + double c1y = (y + line->sy*2)/3; + double c2x = (line->x + line->sx*2)/3; + double c2y = (line->y + line->sy*2)/3; + PDF_curveto(p, c1x*scale+mx, c1y*scale+my, + c2x*scale+mx, c2y*scale+my, + line->x*scale+mx, line->y*scale+my); + ret = 1; + } + x = line->x; + y = line->y; + line = line->next; + } + if(free_line) + gfxline_free(free_line); + return ret; +} + +void pdf_startclip(gfxdevice_t*dev, gfxline_t*line) +{ + internal_t*i = (internal_t*)dev->internal; + + restore_matrix(i); + PDF_save(i->p); + + if(mkline(line, i->p, i->config_xpad, i->config_ypad, 1.0, 1)) + PDF_clip(i->p); + else + ; // TODO: strictly speaking, an empty clip clears everything + + reset_matrix(i); +} +void pdf_endclip(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + restore_matrix(i); + PDF_restore(i->p); +} +void pdf_stroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit) +{ + internal_t*i = (internal_t*)dev->internal; + if(width<1e-6) + return; + reset_matrix(i); + PDF_setlinewidth(i->p, width); + PDF_setlinecap(i->p, cap_style==gfx_capButt?0:(cap_style==gfx_capRound?1:2)); + PDF_setlinejoin(i->p, joint_style==gfx_joinMiter?0:(joint_style==gfx_joinRound?1:2)); + + PDF_setrgbcolor_stroke(i->p, color->r/255.0, color->g/255.0, color->b/255.0); + + if(joint_style==gfx_joinMiter) + PDF_setmiterlimit(i->p, miterLimit); + if(mkline(line, i->p, i->config_xpad, i->config_ypad, 1.0, 0)) + PDF_stroke(i->p); +} + +void pdf_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color) +{ + internal_t*i = (internal_t*)dev->internal; + reset_matrix(i); + PDF_setrgbcolor_fill(i->p, color->r/255.0, color->g/255.0, color->b/255.0); + /* + pdf-x (pdf 1.3) doesn't support opacityfill + if(color->a!=255) { + char opacityfill[80]; + sprintf(opacityfill, "opacityfill %f", color->a/256.0); + int gstate = PDF_create_gstate(i->p, opacityfill); + PDF_set_gstate(i->p, gstate); + }*/ + + if(mkline(line, i->p, i->config_xpad, i->config_ypad, 1.0, 1)) { + PDF_fill(i->p); + } +} + +void pdf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform) +{ + internal_t*i = (internal_t*)dev->internal; + + int t,size=img->width*img->height; + int has_alpha=0; + for(t=0;tdata[t].a!=255) { + has_alpha=1; + break; + } + } + + double w = sqrt(matrix->m00*matrix->m00+matrix->m01*matrix->m01); + double h = sqrt(matrix->m10*matrix->m10+matrix->m11*matrix->m11); + double l1 = w*img->width; + double l2 = h*img->height; + + double dpi_x = 72.0 / w; + double dpi_y = 72.0 / h; + double dpi = dpi_x>dpi_y?dpi_x:dpi_y; + gfximage_t*rescaled_image = 0; + if(i->config_maxdpi && dpi > i->config_maxdpi) { + int newwidth = img->width*i->config_maxdpi/dpi; + int newheight = img->height*i->config_maxdpi/dpi; + rescaled_image = gfximage_rescale(img, newwidth, newheight); + msg(" Downscaling %dx%d image (dpi %f, %.0fx%.0f on page) to %dx%d (dpi %d)", + img->width, img->height, dpi, l1, l2, newwidth, newheight, i->config_maxdpi); + img = rescaled_image; + } + if(i->config_mindpi && dpi < i->config_mindpi && img->width>1 && img->height>1) { + msg(" Found image of size %dx%d with dpi %f, minimum allowed dpi is %d", + img->width, img->height, dpi, i->config_mindpi); + exit(1); + } + + char tempfile[128]; + mktempname(tempfile, "jpg"); + + gfximage_save_jpeg(img, tempfile, 96); + + int imgid=-1; + if(has_alpha) { + char tempfile2[128]; + mktempname(tempfile2, "jpg"); + int t; + int size = img->width*img->height; + unsigned char*alpha = malloc(size); + for(t=0;tdata[t].a; + } + jpeg_save_gray(alpha, img->width, img->height, 97, tempfile2); + free(alpha); + int maskid = PDF_load_image(i->p, "jpeg", tempfile2, 0, "mask"); + unlink(tempfile2); + char masked[80]; + if(maskid<0) { + msg(" Couldn't process mask jpeg of size %dx%d: error code %d", img->width, img->height, maskid); + return; + } + sprintf(masked, "masked %d", maskid); + imgid = PDF_load_image(i->p, "jpeg", tempfile, 0, masked); + } else { + imgid = PDF_load_image(i->p, "jpeg", tempfile, 0, ""); + } + + if(imgid<0) { + msg(" Couldn't process jpeg of size %dx%d: error code %d, file %s", img->width, img->height, imgid, tempfile); + return; + } + unlink(tempfile); + + char options[80]; + set_matrix(i, matrix->m00, matrix->m01, matrix->m10, matrix->m11); + /* an image's (0,0) is at the lower left corner */ + double x=matrix->tx + i->config_xpad + matrix->m10*img->height; + double y=matrix->ty + i->config_ypad + matrix->m11*img->height; + double tx,ty; + transform_back(i, x, y, &tx, &ty); + PDF_place_image(i->p, imgid, tx, ty, 1.0); + PDF_close_image(i->p, imgid); + + if(rescaled_image) + gfximage_free(rescaled_image); +} + +void pdf_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) +{ + internal_t*i = (internal_t*)dev->internal; +} + +static const char type3 = 0; +static const char ttf = 1; + +void pdf_addfont(gfxdevice_t*dev, gfxfont_t*font) +{ + internal_t*i = (internal_t*)dev->internal; + + int num = font->num_glyphs<256-32?font->num_glyphs:256-32; + if(type3) { + int fontid = 0; + if(!gfxfontlist_hasfont(i->fontlist, font)) { + + static int fontnr = 1; + char fontname[32]; + sprintf(fontname, "font%d", fontnr++); + int l = strlen(fontname); + char fontname2[64]; + int t; + for(t=0;tp, fontname2, l*2, 1.0, 0.0, 0.0, -1.0, 0.0, 0.0, ""); + for(t=0;tglyphs[t]; + gfxbbox_t bbox = gfxline_getbbox(g->line); + char name[32]; + sprintf(name, "chr%d", t+32); + PDF_encoding_set_char(i->p, fontname, t+32, name, 0); + PDF_begin_glyph(i->p, name, g->advance, bbox.xmin/64.0, bbox.ymin/64.0, bbox.xmax/64.0, bbox.ymax/64.0); + if(mkline(g->line, i->p, 0, 0, 1.0/64.0, 1)) + PDF_fill(i->p); + PDF_end_glyph(i->p); + } + PDF_end_font(i->p); + fontid = PDF_load_font(i->p, fontname2, l*2, fontname, ""); + + i->fontlist = gfxfontlist_addfont2(i->fontlist, font, (void*)(ptroff_t)fontid); + } + } else if(ttf) { + int fontid = 0; + if(!gfxfontlist_hasfont(i->fontlist, font)) { + char fontname[32],filename[32],fontname2[64]; + static int fontnr = 1; + sprintf(fontname, "font%d", fontnr); + sprintf(filename, "font%d.ttf", fontnr); + fontnr++; + const char*old_id = font->id; + font->id = fontname; + int t; + for(t=0;tglyphs[t].unicode = 32+t; + } + font->max_unicode = 0; + font->unicode2glyph = 0; + gfxfont_save(font, filename); + font->id=old_id; + +#ifdef RUN_TTX + /* for testing the generated fonts: run everything through ttx (fonttools) */ + char cmd[256]; + sprintf(cmd, "mv %s.ttf test.ttf", fontname);system(cmd); + system("rm -f test.ttx"); + if(system("ttx test.ttf")&0xff00) exit(1); + sprintf(cmd, "mv test.ttf %s.old.ttf", fontname, fontname);system(cmd); + sprintf(cmd, "ttx test.ttx;mv test.ttf %s.ttf", fontname);system(cmd); + sprintf(cmd, "rm -f test.ttx");system(cmd); +#endif + + int l = strlen(fontname); + for(t=0;tp, fontname2, l*2, "host", "embedding=true"); + i->fontlist = gfxfontlist_addfont2(i->fontlist, font, (void*)(ptroff_t)fontid); + unlink(filename); + } + } +} + +void pdf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) +{ + internal_t*i = (internal_t*)dev->internal; + + if(!font) + return; + + gfxglyph_t*glyph = &font->glyphs[glyphnr]; + char as_shape = 0; + if(!type3 && !ttf) {msg(" No type3 enabled. Drawing char %d as shape", glyphnr);as_shape=1;} + if(glyphnr>256-32) {msg(" Drawing char %d as shape (not < 224)", glyphnr);as_shape=1;} + + if(as_shape) { + reset_matrix(i); + PDF_setrgbcolor_fill(i->p, color->r/255.0, color->g/255.0, color->b/255.0); + gfxline_t*line2 = gfxline_clone(glyph->line); + gfxline_transform(line2, matrix); + if(mkline(line2, i->p, i->config_xpad, i->config_ypad, 1.0, 1)) { + PDF_fill(i->p); + } + gfxline_free(line2); + } else { + assert(gfxfontlist_hasfont(i->fontlist, font)); + int fontid = (int)(ptroff_t)gfxfontlist_getuserdata(i->fontlist, font->id); + + gfxmatrix_t m = *matrix; + + m.m00*=64; + m.m01*=64; + m.m10*=64; + m.m11*=64; + if(ttf) { + m.m10 = -m.m10; + m.m11 = -m.m11; + } + + if(!(fabs(m.m00 - i->m00) < 1e-6 && + fabs(m.m01 - i->m01) < 1e-6 && + fabs(m.m10 - i->m10) < 1e-6 && + fabs(m.m11 - i->m11) < 1e-6)) { + set_matrix(i, m.m00, m.m01, m.m10, m.m11); + } + double tx, ty; + transform_back(i, m.tx+i->config_xpad, m.ty+i->config_ypad, &tx, &ty); + + PDF_setfont(i->p, fontid, ttf?16.0:1.0); + PDF_setrgbcolor_fill(i->p, color->r/255.0, color->g/255.0, color->b/255.0); + + char name[32]; + sprintf(name, "%c", glyphnr+32); + + if(fabs(tx - i->lastx) > 0.001 || ty != i->lasty) { + PDF_show_xy2(i->p, name, strlen(name), tx, ty); + } else { + PDF_show2(i->p, name, strlen(name)); + } + + i->lastx = tx + glyph->advance; + i->lasty = ty; + } +} + +void pdf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) +{ + internal_t*i = (internal_t*)dev->internal; +} + +void pdf_endpage(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + restore_matrix(i); + PDF_end_page(i->p); +} + +typedef struct pdfresult_internal { + char*tempfile; +} pdfresult_internal_t; + +void pdfresult_destroy(gfxresult_t*gfx) +{ + pdfresult_internal_t*i = (pdfresult_internal_t*)gfx->internal; + unlink(i->tempfile); + free(i->tempfile); + free(gfx->internal);gfx->internal = 0; + free(gfx); +} + +int pdfresult_save(gfxresult_t*gfx, const char*filename) +{ + pdfresult_internal_t*i = (pdfresult_internal_t*)gfx->internal; + FILE*fi = fopen(i->tempfile, "rb"); + FILE*fo = fopen(filename, "wb"); + if(!fo) { + perror(filename); + return -1; + } + char buffer[4096]; + int size = 0; + while((size = fread(buffer, 1, 4096, fi))) { + fwrite(buffer, 1, size, fo); + } + fclose(fi); + fclose(fo); + return 0; +} + +void* pdfresult_get(gfxresult_t*gfx, const char*name) +{ + return 0; +} + +gfxresult_t* pdf_finish(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + + if(i->config_addblankpages) { + int mod = i->num_pages%i->config_addblankpages; + if(mod) { + int count = i->config_addblankpages - mod; + int t; + for(t=0;tstartpage(dev, i->width, i->height); + dev->endpage(dev); + } + } + } + + PDF_end_document(i->p, ""); + //PDF_close(i->p); + PDF_delete(i->p); + + gfxresult_t*result = (gfxresult_t*)malloc(sizeof(gfxresult_t)); + memset(result, 0, sizeof(gfxresult_t)); + result->save = pdfresult_save; + result->get = pdfresult_get; + result->destroy = pdfresult_destroy; + result->internal = 0; + result->internal = malloc(sizeof(pdfresult_internal_t)); + pdfresult_internal_t*ri = (pdfresult_internal_t*)result->internal; + ri->tempfile = i->tempfile;i->tempfile=0; + free(dev->internal);dev->internal = 0;i=0; + return result; +} + +void gfxdevice_pdf_init(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + memset(dev, 0, sizeof(gfxdevice_t)); + + dev->name = "pdf"; + + dev->internal = i; + + dev->setparameter = pdf_setparameter; + dev->startpage = pdf_startpage; + dev->startclip = pdf_startclip; + dev->endclip = pdf_endclip; + dev->stroke = pdf_stroke; + dev->fill = pdf_fill; + dev->fillbitmap = pdf_fillbitmap; + dev->fillgradient = pdf_fillgradient; + dev->addfont = pdf_addfont; + dev->drawchar = pdf_drawchar; + dev->drawlink = pdf_drawlink; + dev->endpage = pdf_endpage; + dev->finish = pdf_finish; + + i->page_opts = ""; + i->lastx = -1e38; + i->lasty = -1e38; + i->has_matrix = 0; + i->p = PDF_new(); +} diff -Nru swftools-0.9.0/lib/devices/pdf.h swftools-0.9.2/lib/devices/pdf.h --- swftools-0.9.0/lib/devices/pdf.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/devices/pdf.h 2010-11-12 18:52:47.000000000 +0000 @@ -0,0 +1,37 @@ +/* pdf.h + Header file for pdf.c + + Part of the swftools package. + + Copyright (c) 2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __gfxdevice_pdf_h__ +#define __gfxdevice_pdf_h__ + +#include "../gfxdevice.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void gfxdevice_pdf_init(gfxdevice_t*dev); + +#ifdef __cplusplus +} +#endif + +#endif //__gfxdevice_pdf_h__ diff -Nru swftools-0.9.0/lib/devices/polyops.c swftools-0.9.2/lib/devices/polyops.c --- swftools-0.9.0/lib/devices/polyops.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/devices/polyops.c 2010-11-12 18:52:32.000000000 +0000 @@ -92,7 +92,7 @@ internal_t*i = (internal_t*)dev->internal; gfxpoly_t* oldclip = i->clip?i->clip->poly:0; - gfxpoly_t* poly = gfxpoly_fillToPoly(line); + gfxpoly_t* poly = gfxpoly_from_fill(line, DEFAULT_GRID); if(poly) i->good_polygons++; else @@ -105,13 +105,17 @@ a gfxline into a gfxpoly- for polygons which are too complex or just degenerate, this might fail. So handle all the cases where polygon conversion or intersection - might go awry */ + might go awry + UPDATE: this is not needed anymore. The new gfxpoly + implementation is stable enough so it always returns + a valid result. Still, it's good practice. + */ if(!poly && !oldclip) { i->out->startclip(i->out,line); currentclip = 0; type = 1; } else if(!poly && oldclip) { - gfxline_t*oldclipline = gfxpoly_to_gfxline(oldclip); + gfxline_t*oldclipline = gfxline_from_gfxpoly(oldclip); i->out->startclip(i->out,oldclipline); i->out->startclip(i->out,line); currentclip = 0; @@ -121,12 +125,12 @@ if(intersection) { i->good_polygons++; // this case is what usually happens - gfxpoly_free(poly);poly=0; + gfxpoly_destroy(poly);poly=0; currentclip = intersection; type = 0; } else { i->bad_polygons++; - gfxline_t*oldclipline = gfxpoly_to_gfxline(oldclip); + gfxline_t*oldclipline = gfxline_from_gfxpoly(oldclip); i->out->startclip(i->out, oldclipline); currentclip = poly; type = 1; @@ -156,7 +160,7 @@ clip_t*old = i->clip; i->clip = i->clip->next; if(old->poly) { - gfxpoly_free(old->poly);old->poly = 0; + gfxpoly_destroy(old->poly);old->poly = 0; } int t; for(t=0;topenclips;t++) @@ -172,7 +176,7 @@ gfxpoly_t*old = i->polyunion; gfxpoly_t*newpoly = gfxpoly_union(poly,i->polyunion); i->polyunion = newpoly; - gfxpoly_free(old); + gfxpoly_destroy(old); } } @@ -183,7 +187,7 @@ gfxpoly_t*old = poly; if(poly) { poly = gfxpoly_intersect(poly, i->clip->poly); - gfxpoly_free(old); + gfxpoly_destroy(old); } } @@ -196,8 +200,8 @@ gfxline_t*gfxline = 0; if(poly) { // this is the case where everything went right - gfxline_t*line = gfxpoly_to_gfxline(poly); - gfxpoly_free(poly); + gfxline_t*line = gfxline_from_gfxpoly(poly); + gfxpoly_destroy(poly); *ok = 1; return line; } else { @@ -205,10 +209,10 @@ /* convert current clipping from a polygon to an actual "startclip" written to the output */ assert(i->clip->openclips <= 1); - gfxline_t*clipline = gfxpoly_to_gfxline(i->clip->poly); + gfxline_t*clipline = gfxline_from_gfxpoly(i->clip->poly); i->out->startclip(i->out, clipline); gfxline_free(clipline); - gfxpoly_free(i->clip->poly);i->clip->poly = 0; + gfxpoly_destroy(i->clip->poly);i->clip->poly = 0; i->clip->openclips++; return 0; } else { @@ -222,7 +226,7 @@ dbg("polyops_stroke"); internal_t*i = (internal_t*)dev->internal; - gfxpoly_t* poly = gfxpoly_strokeToPoly(line, width, cap_style, joint_style, miterLimit); + gfxpoly_t* poly = gfxpoly_from_stroke(line, width, cap_style, joint_style, miterLimit, DEFAULT_GRID); char ok = 0; gfxline_t*line2 = handle_poly(dev, poly, &ok); @@ -240,7 +244,7 @@ dbg("polyops_fill"); internal_t*i = (internal_t*)dev->internal; - gfxpoly_t*poly = gfxpoly_fillToPoly(line); + gfxpoly_t*poly = gfxpoly_from_fill(line, DEFAULT_GRID); char ok = 0; gfxline_t*line2 = handle_poly(dev, poly, &ok); @@ -257,7 +261,7 @@ dbg("polyops_fillbitmap"); internal_t*i = (internal_t*)dev->internal; - gfxpoly_t*poly = gfxpoly_fillToPoly(line); + gfxpoly_t*poly = gfxpoly_from_fill(line, DEFAULT_GRID); char ok = 0; gfxline_t*line2 = handle_poly(dev, poly, &ok); @@ -274,7 +278,7 @@ dbg("polyops_fillgradient"); internal_t*i = (internal_t*)dev->internal; - gfxpoly_t*poly = gfxpoly_fillToPoly(line); + gfxpoly_t*poly = gfxpoly_from_fill(line, DEFAULT_GRID); char ok = 0; gfxline_t*line2 = handle_poly(dev, poly, &ok); @@ -304,7 +308,10 @@ if(i->clip && i->clip->poly) { gfxbbox_t bbox = gfxline_getbbox(glyph); - gfxpoly_t*dummybox = gfxpoly_createbox(bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax); + gfxpoly_t*dummybox = gfxpoly_createbox(bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax, DEFAULT_GRID); + gfxline_t*dummybox2 = gfxline_from_gfxpoly(dummybox); + bbox = gfxline_getbbox(dummybox2); + gfxline_free(dummybox2); char ok=0; gfxline_t*gfxline = handle_poly(dev, dummybox, &ok); @@ -312,12 +319,15 @@ gfxbbox_t bbox2 = gfxline_getbbox(gfxline); double w = bbox2.xmax - bbox2.xmin; double h = bbox2.ymax - bbox2.ymin; - if(w < 0.001 || h < 0.001) /* character was clipped completely */ { - } else if(fabs((bbox.xmax - bbox.xmin) - w) > 0.05 || - fabs((bbox.ymax - bbox.ymin) - h) > 0.05) { + if(fabs((bbox.xmax - bbox.xmin) - w) > DEFAULT_GRID*2 || + fabs((bbox.ymax - bbox.ymin) - h) > DEFAULT_GRID*2) { /* notable change in character size: character was clipped TODO: how to deal with diagonal cuts? */ + msg(" Character %d was clipped: (%f,%f,%f,%f) -> (%f,%f,%f,%f)", + glyphnr, + bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax, + bbox2.xmin,bbox2.ymin,bbox2.xmax,bbox2.ymax); polyops_fill(dev, glyph, color); } else { if(i->out) i->out->drawchar(i->out, font, glyphnr, color, matrix); @@ -325,6 +335,7 @@ } else { if(i->out) i->out->drawchar(i->out, font, glyphnr, color, matrix); } + gfxline_free(gfxline); } else { if(i->out) i->out->drawchar(i->out, font, glyphnr, color, matrix); } @@ -332,11 +343,11 @@ gfxline_free(glyph); } -void polyops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void polyops_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { dbg("polyops_drawlink"); internal_t*i = (internal_t*)dev->internal; - if(i->out) i->out->drawlink(i->out, line, action); + if(i->out) i->out->drawlink(i->out, line, action, text); } void polyops_endpage(struct _gfxdevice*dev) @@ -351,16 +362,17 @@ dbg("polyops_finish"); internal_t*i = (internal_t*)dev->internal; - if(i->polyunion) { - gfxpoly_free(i->polyunion);i->polyunion=0; + gfxpoly_destroy(i->polyunion);i->polyunion=0; } else { if(i->bad_polygons) { msg(" --flatten success rate: %.1f%% (%d failed polygons)", i->good_polygons*100.0 / (i->good_polygons + i->bad_polygons), i->bad_polygons); } } - if(i->out) { - return i->out->finish(i->out); + gfxdevice_t*out = i->out; + free(i);memset(dev, 0, sizeof(gfxdevice_t)); + if(out) { + return out->finish(out); } else { return 0; } @@ -369,7 +381,7 @@ gfxline_t*gfxdevice_union_getunion(struct _gfxdevice*dev) { internal_t*i = (internal_t*)dev->internal; - return gfxpoly_to_gfxline(i->polyunion); + return gfxline_from_gfxpoly(i->polyunion); } void gfxdevice_removeclippings_init(gfxdevice_t*dev, gfxdevice_t*out) @@ -425,6 +437,7 @@ dev->finish = polyops_finish; i->out = out; - i->polyunion = gfxpoly_strokeToPoly(0, 0, gfx_capButt, gfx_joinMiter, 0); + /* create empty polygon */ + i->polyunion = gfxpoly_from_stroke(0, 0, gfx_capButt, gfx_joinMiter, 0, DEFAULT_GRID); } diff -Nru swftools-0.9.0/lib/devices/record.c swftools-0.9.2/lib/devices/record.c --- swftools-0.9.0/lib/devices/record.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/record.c 2011-01-02 03:30:29.000000000 +0000 @@ -29,21 +29,55 @@ #ifdef HAVE_IO_H #include #endif +#include #include +#include #include "../gfxdevice.h" #include "../gfxtools.h" +#include "../gfxfont.h" #include "../types.h" #include "../bitio.h" #include "../log.h" +#include "../os.h" +#include "../png.h" +#ifdef HAVE_FASTLZ +#include "../fastlz.h" +#endif #include "record.h" +//#define STATS +//#define COMPRESS_IMAGES +//#define FILTER_IMAGES + +typedef struct _state { + char*last_string[16]; + gfxcolor_t last_color[16]; + gfxmatrix_t last_matrix[16]; + +#ifdef STATS + int size_matrices; + int size_positions; + int size_images; + int size_lines; + int size_colors; + int size_fonts; + int size_chars; +#endif +} state_t; + typedef struct _internal { gfxfontlist_t* fontlist; + state_t state; + writer_t w; int cliplevel; + char use_tempfile; + char*filename; } internal_t; typedef struct _internal_result { + char use_tempfile; + char*filename; void*data; int length; } internal_result_t; @@ -63,43 +97,50 @@ #define OP_ENDPAGE 0x0c #define OP_FINISH 0x0d -#define OP_MOVETO 0x0e -#define OP_LINETO 0x0f -#define OP_SPLINETO 0x10 +#define FLAG_SAME_AS_LAST 0x10 +#define FLAG_ZERO_FONT 0x20 -static int record_setparameter(struct _gfxdevice*dev, const char*key, const char*value) -{ - internal_t*i = (internal_t*)dev->internal; - msg(" record: %08x SETPARAM %s %s\n", dev, key, value); - writer_writeU8(&i->w, OP_SETPARAM); - writer_writeString(&i->w, key); - writer_writeString(&i->w, value); - return 1; -} +#define LINE_MOVETO 0x0e +#define LINE_LINETO 0x0f +#define LINE_SPLINETO 0x10 + +/* ----------------- reading/writing of low level primitives -------------- */ -static void dumpLine(writer_t*w, gfxline_t*line) +static void dumpLine(writer_t*w, state_t*state, gfxline_t*line) { while(line) { if(line->type == gfx_moveTo) { - writer_writeU8(w, OP_MOVETO); + writer_writeU8(w, LINE_MOVETO); writer_writeDouble(w, line->x); writer_writeDouble(w, line->y); +#ifdef STATS + state->size_lines += 1+8+8; +#endif } else if(line->type == gfx_lineTo) { - writer_writeU8(w, OP_LINETO); + writer_writeU8(w, LINE_LINETO); writer_writeDouble(w, line->x); writer_writeDouble(w, line->y); +#ifdef STATS + state->size_lines += 1+8+8; +#endif } else if(line->type == gfx_splineTo) { - writer_writeU8(w, OP_SPLINETO); + writer_writeU8(w, LINE_SPLINETO); writer_writeDouble(w, line->x); writer_writeDouble(w, line->y); writer_writeDouble(w, line->sx); writer_writeDouble(w, line->sy); +#ifdef STATS + state->size_lines += 1+8+8+8+8; +#endif } line = line->next; } writer_writeU8(w, OP_END); +#ifdef STATS + state->size_lines += 1; +#endif } -static gfxline_t* readLine(reader_t*r) +static gfxline_t* readLine(reader_t*r, state_t*s) { gfxline_t*start = 0, *pos = 0; while(1) { @@ -113,15 +154,15 @@ pos->next = line; pos = line; } - if(op == OP_MOVETO) { + if(op == LINE_MOVETO) { line->type = gfx_moveTo; line->x = reader_readDouble(r); line->y = reader_readDouble(r); - } else if(op == OP_LINETO) { + } else if(op == LINE_LINETO) { line->type = gfx_lineTo; line->x = reader_readDouble(r); line->y = reader_readDouble(r); - } else if(op == OP_SPLINETO) { + } else if(op == LINE_SPLINETO) { line->type = gfx_splineTo; line->x = reader_readDouble(r); line->y = reader_readDouble(r); @@ -131,16 +172,116 @@ } return start; } -static gfximage_t readImage(reader_t*r) + +static void dumpImage(writer_t*w, state_t*state, gfximage_t*img) +{ + int oldpos = w->pos; + writer_writeU16(w, img->width); + writer_writeU16(w, img->height); +#ifdef COMPRESS_IMAGES + //35.3% images (2027305 bytes) (with filter, Z_BEST_COMPRESSION) + //39.9% images (2458904 bytes) (with filter, Z_BEST_SPEED) + //45.2% images (3055340 bytes) (without filter) + //45.9% images (3149247 bytes) (without filter, 5) + //48.0% images (3480495 bytes) (with filter, fastlz) + //48.0% images (3488650 bytes) (without filter, Z_BEST_SPEED) + //55.3% images (4665889 bytes) (without filter, fastlz level 2) + //55.6% images (4726334 bytes) (without filter, fastlz level 1) + //83.0% images (18091804 bytes) (no compression) + + gfxcolor_t*image; +#ifdef FILTER_IMAGES + unsigned char*filter = malloc(img->height); + int y; + image = malloc(img->width*img->height*sizeof(gfxcolor_t)); + for(y=0;yheight;y++) { + filter[y] = png_apply_filter_32( + (void*)&image[y*img->width], + (void*)&img->data[y*img->width], img->width, y); + } +#else + image = img->data; +#endif + int size = img->width*img->height; + uLongf compressdata_size = compressBound(size*sizeof(gfxcolor_t)); + void*compressdata = malloc(compressdata_size); + +#ifdef HAVE_FASTLZ + compressdata_size = fastlz_compress_level(2, (void*)image, size*sizeof(gfxcolor_t), compressdata); +#else + compress2(compressdata, &compressdata_size, (void*)image, sizeof(gfxcolor_t)*size, Z_BEST_SPEED); +#endif + + writer_writeU32(w, compressdata_size); +#ifdef FILTER_IMAGES + w->write(w, filter, img->height); + free(filter); + free(image); +#endif + w->write(w, compressdata, compressdata_size); + free(compressdata); +#else + w->write(w, img->data, img->width*img->height*sizeof(gfxcolor_t)); +#endif +#ifdef STATS + state->size_images += w->pos - oldpos; +#endif +} +static gfximage_t readImage(reader_t*r, state_t*state) { gfximage_t img; img.width = reader_readU16(r); img.height = reader_readU16(r); - img.data = (gfxcolor_t*)rfx_alloc(img.width*img.height*4); - r->read(r, img.data, img.width*img.height*4); + uLongf size = img.width*img.height*sizeof(gfxcolor_t); + img.data = malloc(size); +#ifdef COMPRESS_IMAGES + uLongf compressdata_size = reader_readU32(r); + void*compressdata = malloc(compressdata_size); +# ifdef FILTER_IMAGES + unsigned char*filter = malloc(img.height); + r->read(r, filter, img.height); +# endif + r->read(r, compressdata, compressdata_size); + +# ifdef HAVE_FASTLZ + fastlz_decompress(compressdata, compressdata_size, (void*)img.data, size); +# else + uncompress((void*)img.data, &size, compressdata, compressdata_size); +# endif + free(compressdata); + +# ifdef FILTER_IMAGES + int y; + unsigned char*line = malloc(img.width*sizeof(gfxcolor_t)); + for(y=0;yread(r, img.data, size); +#endif return img; } -static gfxmatrix_t readMatrix(reader_t*r) + +static void dumpMatrix(writer_t*w, state_t*state, gfxmatrix_t*matrix) +{ + writer_writeDouble(w, matrix->m00); + writer_writeDouble(w, matrix->m01); + writer_writeDouble(w, matrix->m10); + writer_writeDouble(w, matrix->m11); + writer_writeDouble(w, matrix->tx); + writer_writeDouble(w, matrix->ty); +#ifdef STATS + state->size_matrices += 6*8; +#endif +} +static gfxmatrix_t readMatrix(reader_t*r, state_t*state) { gfxmatrix_t matrix; matrix.m00 = reader_readDouble(r); @@ -151,7 +292,31 @@ matrix.ty = reader_readDouble(r); return matrix; } -static gfxcolor_t readColor(reader_t*r) +static void dumpXY(writer_t*w, state_t*state, gfxmatrix_t*matrix) +{ + writer_writeDouble(w, matrix->tx); + writer_writeDouble(w, matrix->ty); +#ifdef STATS + state->size_positions += 2*8; +#endif +} +static void readXY(reader_t*r, state_t*state, gfxmatrix_t*m) +{ + m->tx = reader_readDouble(r); + m->ty = reader_readDouble(r); +} + +static void dumpColor(writer_t*w, state_t*state, gfxcolor_t*color) +{ + writer_writeU8(w, color->r); + writer_writeU8(w, color->g); + writer_writeU8(w, color->b); + writer_writeU8(w, color->a); +#ifdef STATS + state->size_colors += 4; +#endif +} +static gfxcolor_t readColor(reader_t*r, state_t*state) { gfxcolor_t col; col.r = reader_readU8(r); @@ -160,7 +325,18 @@ col.a = reader_readU8(r); return col; } -static gfxgradient_t* readGradient(reader_t*r) + +static void dumpGradient(writer_t*w, state_t*state, gfxgradient_t*gradient) +{ + while(gradient) { + writer_writeU8(w, 1); + dumpColor(w, state, &gradient->color); + writer_writeFloat(w, gradient->pos); + gradient = gradient->next; + } + writer_writeU8(w, 0); +} +static gfxgradient_t* readGradient(reader_t*r, state_t*state) { gfxgradient_t*start = 0, *pos = 0; while(1) { @@ -174,57 +350,13 @@ pos->next = g; pos = g; } - g->color = readColor(r); + g->color = readColor(r, state); g->pos = reader_readFloat(r); } return start; } -static gfxcxform_t* readCXForm(reader_t*r) -{ - U8 type = reader_readU8(r); - if(!type) - return 0; - gfxcxform_t* c = (gfxcxform_t*)rfx_calloc(sizeof(gfxcxform_t)); - c->rr = reader_readFloat(r); c->rg = reader_readFloat(r); c->rb = reader_readFloat(r); c->ra = reader_readFloat(r); - c->gr = reader_readFloat(r); c->gg = reader_readFloat(r); c->gb = reader_readFloat(r); c->ga = reader_readFloat(r); - c->br = reader_readFloat(r); c->bg = reader_readFloat(r); c->bb = reader_readFloat(r); c->ba = reader_readFloat(r); - c->ar = reader_readFloat(r); c->ag = reader_readFloat(r); c->ab = reader_readFloat(r); c->aa = reader_readFloat(r); - return c; -} -static void dumpColor(writer_t*w, gfxcolor_t*color) -{ - writer_writeU8(w, color->r); - writer_writeU8(w, color->g); - writer_writeU8(w, color->b); - writer_writeU8(w, color->a); -} -static void dumpMatrix(writer_t*w, gfxmatrix_t*matrix) -{ - writer_writeDouble(w, matrix->m00); - writer_writeDouble(w, matrix->m01); - writer_writeDouble(w, matrix->m10); - writer_writeDouble(w, matrix->m11); - writer_writeDouble(w, matrix->tx); - writer_writeDouble(w, matrix->ty); -} -static void dumpGradient(writer_t*w, gfxgradient_t*gradient) -{ - while(gradient) { - writer_writeU8(w, 1); - dumpColor(w, &gradient->color); - writer_writeFloat(w, gradient->pos); - gradient = gradient->next; - } - writer_writeU8(w, 0); -} -static void dumpImage(writer_t*w, gfximage_t*image) -{ - writer_writeU16(w, image->width); - writer_writeU16(w, image->height); - w->write(w, image->data, image->width*image->height*4); -} -static void dumpCXForm(writer_t*w, gfxcxform_t*c) +static void dumpCXForm(writer_t*w, state_t*state, gfxcxform_t*c) { if(!c) { writer_writeU8(w, 0); @@ -236,14 +368,33 @@ writer_writeFloat(w, c->ar); writer_writeFloat(w, c->ag); writer_writeFloat(w, c->ab); writer_writeFloat(w, c->aa); } } -static void dumpFont(writer_t*w, gfxfont_t*font) +static gfxcxform_t* readCXForm(reader_t*r, state_t*state) { + U8 type = reader_readU8(r); + if(!type) + return 0; + gfxcxform_t* c = (gfxcxform_t*)rfx_calloc(sizeof(gfxcxform_t)); + c->rr = reader_readFloat(r); c->rg = reader_readFloat(r); c->rb = reader_readFloat(r); c->ra = reader_readFloat(r); + c->gr = reader_readFloat(r); c->gg = reader_readFloat(r); c->gb = reader_readFloat(r); c->ga = reader_readFloat(r); + c->br = reader_readFloat(r); c->bg = reader_readFloat(r); c->bb = reader_readFloat(r); c->ba = reader_readFloat(r); + c->ar = reader_readFloat(r); c->ag = reader_readFloat(r); c->ab = reader_readFloat(r); c->aa = reader_readFloat(r); + return c; +} + +static void dumpFont(writer_t*w, state_t*state, gfxfont_t*font) +{ + int oldpos = w->pos; +#ifdef STATS + int old_size_lines = state->size_lines; +#endif writer_writeString(w, font->id); writer_writeU32(w, font->num_glyphs); writer_writeU32(w, font->max_unicode); + writer_writeDouble(w, font->ascent); + writer_writeDouble(w, font->descent); int t; for(t=0;tnum_glyphs;t++) { - dumpLine(w, font->glyphs[t].line); + dumpLine(w, state, font->glyphs[t].line); writer_writeDouble(w, font->glyphs[t].advance); writer_writeU32(w, font->glyphs[t].unicode); if(font->glyphs[t].name) { @@ -255,18 +406,24 @@ for(t=0;tmax_unicode;t++) { writer_writeU32(w, font->unicode2glyph[t]); } +#ifdef STATS + state->size_lines = old_size_lines; + state->size_fonts += w->pos - oldpos; +#endif } -static gfxfont_t*readFont(reader_t*r) +static gfxfont_t*readFont(reader_t*r, state_t*state) { gfxfont_t* font = (gfxfont_t*)rfx_calloc(sizeof(gfxfont_t)); font->id = reader_readString(r); font->num_glyphs = reader_readU32(r); font->max_unicode = reader_readU32(r); + font->ascent = reader_readDouble(r); + font->descent = reader_readDouble(r); font->glyphs = (gfxglyph_t*)rfx_calloc(sizeof(gfxglyph_t)*font->num_glyphs); font->unicode2glyph = (int*)rfx_calloc(sizeof(font->unicode2glyph[0])*font->max_unicode); int t; for(t=0;tnum_glyphs;t++) { - font->glyphs[t].line = readLine(r); + font->glyphs[t].line = readLine(r, state); font->glyphs[t].advance = reader_readDouble(r); font->glyphs[t].unicode = reader_readU32(r); font->glyphs[t].name = reader_readString(r); @@ -281,6 +438,67 @@ return font; } +/* ----------------- reading/writing of primitives with caching -------------- */ + +void state_clear(state_t*state) +{ + int t; + for(t=0;tlast_string)/sizeof(state->last_string[0]);t++) { + if(state->last_string[t]) { + free(state->last_string[t]); + state->last_string[t] = 0; + } + } +} + +static char* read_string(reader_t*r, state_t*state, U8 id, U8 flags) +{ + assert(id>=0 && id<16); + if(flags&FLAG_SAME_AS_LAST) { + assert(state->last_string[id]); + return strdup(state->last_string[id]); + } + char*s = reader_readString(r); + if(state->last_string[id]) { + free(state->last_string[id]); + } + state->last_string[id] = strdup(s); + return s; +} +static gfxcolor_t read_color(reader_t*r, state_t*state, U8 id, U8 flags) +{ + assert(id>=0 && id<16); + if(flags&FLAG_SAME_AS_LAST) + return state->last_color[id]; + gfxcolor_t c = readColor(r, state); + state->last_color[id] = c; + return c; +} +static gfxmatrix_t read_matrix(reader_t*r, state_t*state, U8 id, U8 flags) +{ + assert(id>=0 && id<16); + if(flags&FLAG_SAME_AS_LAST) { + gfxmatrix_t m = state->last_matrix[id]; + readXY(r, state, &m); + return m; + } + gfxmatrix_t m = readMatrix(r, state); + state->last_matrix[id] = m; + return m; +} + +/* --------------------------- record device operations ---------------------- */ + +static int record_setparameter(struct _gfxdevice*dev, const char*key, const char*value) +{ + internal_t*i = (internal_t*)dev->internal; + msg(" record: %08x SETPARAM %s %s\n", dev, key, value); + writer_writeU8(&i->w, OP_SETPARAM); + writer_writeString(&i->w, key); + writer_writeString(&i->w, value); + return 1; +} + static void record_stroke(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit) { internal_t*i = (internal_t*)dev->internal; @@ -288,10 +506,10 @@ writer_writeU8(&i->w, OP_STROKE); writer_writeDouble(&i->w, width); writer_writeDouble(&i->w, miterLimit); - dumpColor(&i->w, color); + dumpColor(&i->w, &i->state, color); writer_writeU8(&i->w, cap_style); writer_writeU8(&i->w, joint_style); - dumpLine(&i->w, line); + dumpLine(&i->w, &i->state, line); } static void record_startclip(struct _gfxdevice*dev, gfxline_t*line) @@ -299,7 +517,7 @@ internal_t*i = (internal_t*)dev->internal; msg(" record: %08x STARTCLIP\n", dev); writer_writeU8(&i->w, OP_STARTCLIP); - dumpLine(&i->w, line); + dumpLine(&i->w, &i->state, line); i->cliplevel++; } @@ -319,8 +537,8 @@ internal_t*i = (internal_t*)dev->internal; msg(" record: %08x FILL\n", dev); writer_writeU8(&i->w, OP_FILL); - dumpColor(&i->w, color); - dumpLine(&i->w, line); + dumpColor(&i->w, &i->state, color); + dumpLine(&i->w, &i->state, line); } static void record_fillbitmap(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform) @@ -328,10 +546,10 @@ internal_t*i = (internal_t*)dev->internal; msg(" record: %08x FILLBITMAP\n", dev); writer_writeU8(&i->w, OP_FILLBITMAP); - dumpImage(&i->w, img); - dumpMatrix(&i->w, matrix); - dumpLine(&i->w, line); - dumpCXForm(&i->w, cxform); + dumpImage(&i->w, &i->state, img); + dumpMatrix(&i->w, &i->state, matrix); + dumpLine(&i->w, &i->state, line); + dumpCXForm(&i->w, &i->state, cxform); } static void record_fillgradient(struct _gfxdevice*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) @@ -340,9 +558,9 @@ msg(" record: %08x FILLGRADIENT %08x\n", dev, gradient); writer_writeU8(&i->w, OP_FILLGRADIENT); writer_writeU8(&i->w, type); - dumpGradient(&i->w, gradient); - dumpMatrix(&i->w, matrix); - dumpLine(&i->w, line); + dumpGradient(&i->w, &i->state, gradient); + dumpMatrix(&i->w, &i->state, matrix); + dumpLine(&i->w, &i->state, line); } static void record_addfont(struct _gfxdevice*dev, gfxfont_t*font) @@ -351,7 +569,7 @@ msg(" record: %08x ADDFONT %s\n", dev, font->id); if(font && !gfxfontlist_hasfont(i->fontlist, font)) { writer_writeU8(&i->w, OP_ADDFONT); - dumpFont(&i->w, font); + dumpFont(&i->w, &i->state, font); i->fontlist = gfxfontlist_addfont(i->fontlist, font); } } @@ -364,14 +582,44 @@ } msg(" record: %08x DRAWCHAR %d\n", glyphnr, dev); - writer_writeU8(&i->w, OP_DRAWCHAR); - if(font) - writer_writeString(&i->w, font->id); - else - writer_writeString(&i->w, "*NULL*"); + const char*font_id = (font&&font->id)?font->id:"*NULL*"; + + gfxmatrix_t*l = &i->state.last_matrix[OP_DRAWCHAR]; + + U8 flags = 0; + if(!font) + flags |= FLAG_ZERO_FONT; + + char same_font = i->state.last_string[OP_DRAWCHAR] && !strcmp(i->state.last_string[OP_DRAWCHAR], font_id); + char same_matrix = (l->m00 == matrix->m00) && (l->m01 == matrix->m01) && (l->m10 == matrix->m10) && (l->m11 == matrix->m11); + char same_color = !memcmp(color, &i->state.last_color[OP_DRAWCHAR], sizeof(gfxcolor_t)); + + /* FIXME + if(same_font && same_matrix && same_color) + flags |= FLAG_SAME_AS_LAST; + */ + + writer_writeU8(&i->w, OP_DRAWCHAR|flags); writer_writeU32(&i->w, glyphnr); - dumpColor(&i->w, color); - dumpMatrix(&i->w, matrix); +#ifdef STATS + i->state.size_chars += 5; +#endif + + if(!(flags&FLAG_SAME_AS_LAST)) { + if(!(flags&FLAG_ZERO_FONT)) + writer_writeString(&i->w, font_id); + dumpColor(&i->w, &i->state, color); + dumpMatrix(&i->w, &i->state, matrix); + + if(i->state.last_string[OP_DRAWCHAR]) + free(i->state.last_string[OP_DRAWCHAR]); + i->state.last_string[OP_DRAWCHAR] = strdup(font_id); + + i->state.last_color[OP_DRAWCHAR] = *color; + i->state.last_matrix[OP_DRAWCHAR] = *matrix; + } else { + dumpXY(&i->w, &i->state, matrix); + } } static void record_startpage(struct _gfxdevice*dev, int width, int height) @@ -390,29 +638,39 @@ writer_writeU8(&i->w, OP_ENDPAGE); } -static void record_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +static void record_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; msg(" record: %08x DRAWLINK\n", dev); writer_writeU8(&i->w, OP_DRAWLINK); - dumpLine(&i->w, line); - writer_writeString(&i->w, action); + dumpLine(&i->w, &i->state, line); + writer_writeString(&i->w, action?action:""); + writer_writeString(&i->w, text?text:""); } -static void replay(struct _gfxdevice*dev, gfxdevice_t*out, void*data, int length) +/* ------------------------------- replaying --------------------------------- */ + +static void replay(struct _gfxdevice*dev, gfxdevice_t*out, reader_t*r, gfxfontlist_t**fontlist) { internal_t*i = 0; if(dev) { i = (internal_t*)dev->internal; } + gfxfontlist_t*_fontlist=0; + if(!fontlist) { + fontlist = &_fontlist; + } - reader_t r2; - reader_t*r = &r2; - reader_init_memreader(r, data, length); - gfxfontlist_t* fontlist = gfxfontlist_create(); + state_t state; + memset(&state, 0, sizeof(state)); + + while(1) { + unsigned char op; + if(r->read(r, &op, 1)!=1) + break; + unsigned char flags = op&0xf0; + op&=0x0f; - while(r->pos < length) { - unsigned char op = reader_readU8(r); switch(op) { case OP_END: goto finish; @@ -436,6 +694,7 @@ } case OP_ENDPAGE: { msg(" replay: ENDPAGE"); + out->endpage(out); break; } case OP_FINISH: { @@ -446,7 +705,7 @@ msg(" replay: STROKE"); double width = reader_readDouble(r); double miterlimit = reader_readDouble(r); - gfxcolor_t color = readColor(r); + gfxcolor_t color = readColor(r, &state); gfx_capType captype; int v = reader_readU8(r); switch (v) { @@ -461,14 +720,14 @@ case 1: jointtype = gfx_joinRound; break; case 2: jointtype = gfx_joinBevel; break; } - gfxline_t* line = readLine(r); + gfxline_t* line = readLine(r, &state); out->stroke(out, line, width, &color, captype, jointtype,miterlimit); gfxline_free(line); break; } case OP_STARTCLIP: { msg(" replay: STARTCLIP"); - gfxline_t* line = readLine(r); + gfxline_t* line = readLine(r, &state); out->startclip(out, line); gfxline_free(line); break; @@ -480,18 +739,18 @@ } case OP_FILL: { msg(" replay: FILL"); - gfxcolor_t color = readColor(r); - gfxline_t* line = readLine(r); + gfxcolor_t color = readColor(r, &state); + gfxline_t* line = readLine(r, &state); out->fill(out, line, &color); gfxline_free(line); break; } case OP_FILLBITMAP: { msg(" replay: FILLBITMAP"); - gfximage_t img = readImage(r); - gfxmatrix_t matrix = readMatrix(r); - gfxline_t* line = readLine(r); - gfxcxform_t* cxform = readCXForm(r); + gfximage_t img = readImage(r, &state); + gfxmatrix_t matrix = readMatrix(r, &state); + gfxline_t* line = readLine(r, &state); + gfxcxform_t* cxform = readCXForm(r, &state); out->fillbitmap(out, line, &img, &matrix, cxform); gfxline_free(line); if(cxform) @@ -509,73 +768,95 @@ case 1: type = gfxgradient_linear; break; } - gfxgradient_t*gradient = readGradient(r); - gfxmatrix_t matrix = readMatrix(r); - gfxline_t* line = readLine(r); + gfxgradient_t*gradient = readGradient(r, &state); + gfxmatrix_t matrix = readMatrix(r, &state); + gfxline_t* line = readLine(r, &state); out->fillgradient(out, line, gradient, type, &matrix); break; } case OP_DRAWLINK: { msg(" replay: DRAWLINK"); - gfxline_t* line = readLine(r); + gfxline_t* line = readLine(r, &state); char* s = reader_readString(r); - out->drawlink(out,line,s); + char* t = reader_readString(r); + out->drawlink(out,line,s, t); gfxline_free(line); free(s); break; } case OP_ADDFONT: { msg(" replay: ADDFONT out=%08x(%s)", out, out->name); - gfxfont_t*font = readFont(r); - fontlist = gfxfontlist_addfont(fontlist, font); - out->addfont(out, font); + gfxfont_t*font = readFont(r, &state); + if(!gfxfontlist_hasfont(*fontlist, font)) { + *fontlist = gfxfontlist_addfont(*fontlist, font); + out->addfont(out, font); + } else { + gfxfont_free(font); + } break; } case OP_DRAWCHAR: { - char* id = reader_readString(r); - gfxfont_t*font = id?gfxfontlist_findfont(fontlist, id):0; + U32 glyph = reader_readU32(r); + gfxmatrix_t m = {1,0,0, 0,1,0}; + char* id = 0; + if(!(flags&FLAG_ZERO_FONT)) + id = read_string(r, &state, op, flags); + gfxcolor_t color = read_color(r, &state, op, flags); + gfxmatrix_t matrix = read_matrix(r, &state, op, flags); + + gfxfont_t*font = id?gfxfontlist_findfont(*fontlist, id):0; if(i && !font) { font = gfxfontlist_findfont(i->fontlist, id); } - U32 glyph = reader_readU32(r); - msg(" replay: DRAWCHAR font=%s glyph=%d", id, glyph); - gfxcolor_t color = readColor(r); - gfxmatrix_t matrix = readMatrix(r); + msg(" replay: DRAWCHAR font=%s glyph=%d (flags=%d)", id, glyph, flags); out->drawchar(out, font, glyph, &color, &matrix); - free(id); + if(id) + free(id); break; } } } finish: + state_clear(&state); r->dealloc(r); - /* problem: if we just replayed into a device which stores the - font for later use (the record device itself is a nice example), - then we can't free it yet */ - //gfxfontlist_free(fontlist, 1); - gfxfontlist_free(fontlist, 0); + if(_fontlist) + gfxfontlist_free(_fontlist, 0); } -void gfxresult_record_replay(gfxresult_t*result, gfxdevice_t*device) +void gfxresult_record_replay(gfxresult_t*result, gfxdevice_t*device, gfxfontlist_t**fontlist) { internal_result_t*i = (internal_result_t*)result->internal; - replay(0, device, i->data, i->length); + + reader_t r; + if(i->use_tempfile) { + reader_init_filereader2(&r, i->filename); + } else { + reader_init_memreader(&r, i->data, i->length); + } + + replay(0, device, &r, fontlist); } static void record_result_write(gfxresult_t*r, int filedesc) { internal_result_t*i = (internal_result_t*)r->internal; - write(filedesc, i->data, i->length); + if(i->data) { + write(filedesc, i->data, i->length); + } } static int record_result_save(gfxresult_t*r, const char*filename) { internal_result_t*i = (internal_result_t*)r->internal; - FILE*fi = fopen(filename, "wb"); - if(!fi) { - fprintf(stderr, "Couldn't open file %s for writing\n", filename); - return -1; + if(i->use_tempfile) { + move_file(i->filename, filename); + } else { + FILE*fi = fopen(filename, "wb"); + if(!fi) { + fprintf(stderr, "Couldn't open file %s for writing\n", filename); + return -1; + } + fwrite(i->data, i->length, 1, fi); + fclose(fi); } - fwrite(i->data, i->length, 1, fi); - fclose(fi); return 0; } static void*record_result_get(gfxresult_t*r, const char*name) @@ -594,6 +875,10 @@ if(i->data) { free(i->data);i->data = 0; } + if(i->filename) { + unlink(i->filename); + free(i->filename); + } free(r->internal);r->internal = 0; free(r); } @@ -623,15 +908,22 @@ } } -void gfxdevice_record_flush(gfxdevice_t*dev, gfxdevice_t*out) +void gfxdevice_record_flush(gfxdevice_t*dev, gfxdevice_t*out, gfxfontlist_t**fontlist) { internal_t*i = (internal_t*)dev->internal; if(out) { - int len=0; - void*data = writer_growmemwrite_memptr(&i->w, &len); - replay(dev, out, data, len); + if(!i->use_tempfile) { + int len=0; + void*data = writer_growmemwrite_memptr(&i->w, &len); + reader_t r; + reader_init_memreader(&r, data, len); + replay(dev, out, &r, fontlist); + writer_growmemwrite_reset(&i->w); + } else { + msg(" Flushing not supported for file based record device"); + exit(1); + } } - writer_growmemwrite_reset(&i->w); } static gfxresult_t* record_finish(struct _gfxdevice*dev) @@ -642,14 +934,38 @@ if(i->cliplevel) { msg(" Warning: unclosed cliplevels"); } + + state_clear(&i->state); + +#ifdef STATS + int total = i->w.pos; + if(total && i->use_tempfile) { + state_t*s = &i->state; + msg(" record device finished. stats:"); + msg(" %4.1f%% matrices (%d bytes)", s->size_matrices*100.0/total, s->size_matrices); + msg(" %4.1f%% positions (%d bytes)", s->size_positions*100.0/total, s->size_positions); + msg(" %4.1f%% colors (%d bytes)", s->size_colors*100.0/total, s->size_colors); + msg(" %4.1f%% lines (%d bytes)", s->size_lines*100.0/total, s->size_lines); + msg(" %4.1f%% fonts (%d bytes)", s->size_fonts*100.0/total, s->size_fonts); + msg(" %4.1f%% images (%d bytes)", s->size_images*100.0/total, s->size_images); + msg(" %4.1f%% characters (%d bytes)", s->size_chars*100.0/total, s->size_chars); + msg(" total: %d bytes", total); + } +#endif writer_writeU8(&i->w, OP_END); gfxfontlist_free(i->fontlist, 0); internal_result_t*ir = (internal_result_t*)rfx_calloc(sizeof(gfxresult_t)); - ir->data = writer_growmemwrite_getmem(&i->w); - ir->length = i->w.pos; + + ir->use_tempfile = i->use_tempfile; + if(i->use_tempfile) { + ir->filename = i->filename; + } else { + ir->data = writer_growmemwrite_getmem(&i->w); + ir->length = i->w.pos; + } i->w.finish(&i->w); gfxresult_t*result= (gfxresult_t*)rfx_calloc(sizeof(gfxresult_t)); @@ -662,7 +978,8 @@ return result; } -void gfxdevice_record_init(gfxdevice_t*dev) + +void gfxdevice_record_init(gfxdevice_t*dev, char use_tempfile) { internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); memset(dev, 0, sizeof(gfxdevice_t)); @@ -670,8 +987,15 @@ dev->name = "record"; dev->internal = i; - - writer_init_growingmemwriter(&i->w, 1048576); + + i->use_tempfile = use_tempfile; + if(!use_tempfile) { + writer_init_growingmemwriter(&i->w, 1048576); + } else { + char buffer[128]; + i->filename = strdup(mktempname(buffer, "gfx")); + writer_init_filewriter2(&i->w, i->filename); + } i->fontlist = gfxfontlist_create(); i->cliplevel = 0; diff -Nru swftools-0.9.0/lib/devices/record.h swftools-0.9.2/lib/devices/record.h --- swftools-0.9.0/lib/devices/record.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/record.h 2010-11-12 18:52:37.000000000 +0000 @@ -23,17 +23,20 @@ #define __record_h__ #include "../gfxdevice.h" +#include "../gfxtools.h" #ifdef __cplusplus extern "C" { #endif -void gfxdevice_record_init(gfxdevice_t*); +void gfxdevice_record_init(gfxdevice_t*, char use_tempfile); -void gfxdevice_record_flush(gfxdevice_t*, gfxdevice_t*); +gfxdevice_t* gfxdevice_record_new(char*filename); -void gfxresult_record_replay(gfxresult_t*, gfxdevice_t*); +void gfxdevice_record_flush(gfxdevice_t*, gfxdevice_t*, gfxfontlist_t**); + +void gfxresult_record_replay(gfxresult_t*, gfxdevice_t*, gfxfontlist_t**); #ifdef __cplusplus } diff -Nru swftools-0.9.0/lib/devices/render.c swftools-0.9.2/lib/devices/render.c --- swftools-0.9.0/lib/devices/render.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/render.c 2011-10-07 03:20:17.000000000 +0000 @@ -25,9 +25,8 @@ #include "../gfxdevice.h" #include "../gfxtools.h" #include "../mem.h" -#define PNG_INLINE_EXPORTS #include "../types.h" -#include "../png.c" +#include "../png.h" #include "../log.h" #include "render.h" @@ -89,7 +88,7 @@ gfxmatrix_t*matrix; gfxcxform_t*cxform; RGBA*gradient; - char clip_or_radial; + char linear_or_radial; } fillinfo_t; @@ -275,16 +274,16 @@ if(col.a!=255) { int ainv = 255-col.a; - col.r = (col.r*col.a)>>8; - col.g = (col.g*col.a)>>8; - col.b = (col.b*col.a)>>8; + col.r = (col.r*col.a)/255; + col.g = (col.g*col.a)/255; + col.b = (col.b*col.a)/255; do { if(z[bitpos]&bit) { - line[x].r = ((line[x].r*ainv)>>8)+col.r; - line[x].g = ((line[x].g*ainv)>>8)+col.g; - line[x].b = ((line[x].b*ainv)>>8)+col.b; + line[x].r = ((line[x].r*ainv)/255)+col.r; + line[x].g = ((line[x].g*ainv)/255)+col.g; + line[x].b = ((line[x].b*ainv)/255)+col.b; //line[x].a = 255; - line[x].a = ((line[x].a*ainv)>>8)+col.a; + line[x].a = ((line[x].a*ainv)/255)+col.a; } bit <<= 1; if(!bit) { @@ -338,7 +337,7 @@ int yy = (int)(yy1 - x * yinc1); int ainv; - if(info->clip_or_radial) { + if(info->linear_or_radial) { if(xx<0) xx=0; if(xx>=b->width) xx = b->width-1; if(yy<0) yy=0; @@ -354,9 +353,9 @@ ainv = 255-col.a; /* needs bitmap with premultiplied alpha */ - line[x].r = ((line[x].r*ainv)>>8)+col.r; - line[x].g = ((line[x].g*ainv)>>8)+col.g; - line[x].b = ((line[x].b*ainv)>>8)+col.b; + line[x].r = ((line[x].r*ainv)/255)+col.r; + line[x].g = ((line[x].g*ainv)/255)+col.g; + line[x].b = ((line[x].b*ainv)/255)+col.b; line[x].a = 255; } bit <<= 1; @@ -378,6 +377,7 @@ /* x direction equals y direction */ return; } + det = 1.0/det; double xx1 = ( (-m->tx) * m->m11 - (y - m->ty) * m->m10) * det; double yy1 = (- (-m->tx) * m->m01 + (y - m->ty) * m->m00) * det; @@ -393,7 +393,7 @@ int ainv; int pos = 0; - if(info->clip_or_radial) { + if(info->linear_or_radial) { double xx = xx1 + x * xinc1; double yy = yy1 + y * yinc1; double r = sqrt(xx*xx + yy*yy); @@ -409,9 +409,9 @@ ainv = 255-col.a; /* needs bitmap with premultiplied alpha */ - line[x].r = ((line[x].r*ainv)>>8)+col.r; - line[x].g = ((line[x].g*ainv)>>8)+col.g; - line[x].b = ((line[x].b*ainv)>>8)+col.b; + line[x].r = ((line[x].r*ainv)/255)+col.r; + line[x].g = ((line[x].g*ainv)/255)+col.g; + line[x].b = ((line[x].b*ainv)/255)+col.b; line[x].a = 255; } bit <<= 1; @@ -535,10 +535,7 @@ c->data = (U32*)rfx_calloc(sizeof(U32) * i->bitwidth * i->height2); c->next = i->clipbuf; i->clipbuf = c; - if(c->next) - memcpy(c->data, c->next->data, i->bitwidth*i->height2); - else - memset(c->data, 0, sizeof(U32)*i->bitwidth*i->height2); + memset(c->data, 0, sizeof(U32)*i->bitwidth*i->height2); } void endclip(struct _gfxdevice*dev, char removelast) @@ -608,7 +605,7 @@ static void draw_line(gfxdevice_t*dev, gfxline_t*line) { internal_t*i = (internal_t*)dev->internal; - double x,y; + double x=0,y=0; while(line) { @@ -714,7 +711,7 @@ m2.m00 *= i->zoom; m2.m01 *= i->zoom; m2.tx *= i->zoom; m2.m10 *= i->zoom; m2.m11 *= i->zoom; m2.ty *= i->zoom; - info.clip_or_radial = type == gfxgradient_radial; + info.linear_or_radial = type == gfxgradient_radial; int pos = 0; gfxcolor_t color = {0,0,0,0}; @@ -800,18 +797,18 @@ while(i->next) { sprintf(filenamebuf, "%s.%d.png", origname, nr); if(!i->palette) { - writePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + png_write(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); } else { - writePalettePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + png_write_palette_based_2(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); } nr++; } free(origname); } else { if(!i->palette) { - writePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + png_write(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); } else { - writePalettePNG(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); + png_write_palette_based_2(filename, (unsigned char*)i->img.data, i->img.width, i->img.height); } } return 1; @@ -821,7 +818,7 @@ int d= 256/depth; char*str = (char*)malloc(img->width*img->height*4 + 500 + 16*depth*depth*depth); char*p = str; - p+= sprintf(p, "static char *noname[] = {\n\"%d %d 262144 3\",\n"); + p+= sprintf(p, "static char *noname[] = {\n\"%d %d 262144 3\",\n", img->width, img->height); int r,g,b; for(r=0;rheight2 = 0; } -void render_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action) +void render_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text) { /* not supported for this output device */ } diff -Nru swftools-0.9.0/lib/devices/rescale.c swftools-0.9.2/lib/devices/rescale.c --- swftools-0.9.0/lib/devices/rescale.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/devices/rescale.c 2010-11-12 18:52:42.000000000 +0000 @@ -121,6 +121,12 @@ if(!strcmp(key, "keepratio")) { i->keepratio = atoi(value); return 1; + } else if(!strcmp(key, "centerx")) { + i->centerx = atoi(value); + return 1; + } else if(!strcmp(key, "centery")) { + i->centery = atoi(value); + return 1; } else { if(i->out) { return i->out->setparameter(i->out,key,value); @@ -235,11 +241,11 @@ i->out->drawchar(i->out, font, glyphnr, color, &m2); } -void rescale_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void rescale_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { internal_t*i = (internal_t*)dev->internal; gfxline_t*line2 = transformgfxline(i, line); - i->out->drawlink(i->out, line2, action); + i->out->drawlink(i->out, line2, action, text); gfxline_free(line2); } diff -Nru swftools-0.9.0/lib/devices/swf.c swftools-0.9.2/lib/devices/swf.c --- swftools-0.9.0/lib/devices/swf.c 2009-04-17 16:37:46.000000000 +0000 +++ swftools-0.9.2/lib/devices/swf.c 2011-12-15 20:29:09.000000000 +0000 @@ -42,20 +42,33 @@ #include "../gfxtools.h" #include "swf.h" #include "../gfxpoly.h" -#include "../png.h" +#include "../gfximage.h" -#define CHARDATAMAX 8192 +#define CHARDATAMAX 1024 #define CHARMIDX 0 #define CHARMIDY 0 -typedef struct _chardata { +typedef struct _charatposition { int charid; - int fontid; /* TODO: use a SWFFONT instead */ + SWFFONT*font; int x; int y; int size; RGBA color; -} chardata_t; +} charatposition_t; + +typedef struct _chararray { + charatposition_t chr[CHARDATAMAX+1]; + int pos; + struct _chararray *next; +} chararray_t; + +typedef struct _charbuffer { + MATRIX matrix; + chararray_t*array; + chararray_t*last; + struct _charbuffer *next; +} charbuffer_t; typedef struct _fontlist { @@ -77,6 +90,7 @@ double config_ppmsubpixels; double config_jpegsubpixels; char hasbuttons; + int config_invisibletexttofront; int config_dots; int config_simpleviewer; int config_opennewwindow; @@ -88,17 +102,24 @@ int config_storeallcharacters; int config_enablezlib; int config_insertstoptag; + int config_showimages; int config_watermark; + int config_noclips; int config_flashversion; int config_reordertags; int config_showclipshapes; int config_splinemaxerror; int config_fontsplinemaxerror; int config_filloverlap; + int config_local_with_network; + int config_local_with_filesystem; int config_protect; int config_bboxvars; int config_disable_polygon_conversion; int config_normalize_polygon_positions; + int config_alignfonts; + double config_override_line_widths; + double config_remove_small_polygons; char config_disablelinks; RGBA config_linkcolor; float config_minlinewidth; @@ -126,7 +147,7 @@ SHAPE* shape; int shapeid; - int textid; + int textmode; int watermarks; @@ -166,8 +187,11 @@ SRECT pagebbox; - chardata_t chardata[CHARDATAMAX]; - int chardatapos; + gfxline_t*stored_clipshapes; //for config_showclipshapes + + charbuffer_t* chardata; + charbuffer_t* topchardata; //chars supposed to be above everything else + int firstpage; char pagefinished; @@ -187,21 +211,26 @@ char* mark; } swfoutput_internal; + +static const int NO_FONT3=0; -static void swf_fillbitmap(gfxdevice_t*driver, gfxline_t*line, gfximage_t*img, gfxmatrix_t*move, gfxcxform_t*cxform); +static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform); static int swf_setparameter(gfxdevice_t*driver, const char*key, const char*value); static void swf_drawstroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit); static void swf_startclip(gfxdevice_t*dev, gfxline_t*line); static void swf_endclip(gfxdevice_t*dev); static void swf_stroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit); static void swf_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color); -static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform); static void swf_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix); static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix); static void swf_addfont(gfxdevice_t*dev, gfxfont_t*font); -static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action); +static void swf_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text); static void swf_startframe(gfxdevice_t*dev, int width, int height); static void swf_endframe(gfxdevice_t*dev); +static void swfoutput_namedlink(gfxdevice_t*dev, char*name, gfxline_t*points); +static void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points); +static void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*points); + static gfxresult_t* swf_finish(gfxdevice_t*driver); static swfoutput_internal* init_internal_struct() @@ -216,7 +245,7 @@ i->startdepth = 0; i->linewidth = 0; i->shapeid = -1; - i->textid = -1; + i->textmode = 0; i->frameno = 0; i->lastframeno = 0; @@ -234,7 +263,7 @@ i->fillstylechanged = 0; i->bboxrectpos = -1; - i->chardatapos = 0; + i->chardata = 0; i->firstpage = 1; i->pagefinished = 1; @@ -255,8 +284,11 @@ i->config_splinemaxerror=1; i->config_fontsplinemaxerror=1; i->config_filloverlap=0; + i->config_local_with_network=0; + i->config_local_with_filesystem=0; i->config_protect=0; i->config_bboxvars=0; + i->config_override_line_widths=0; i->config_showclipshapes=0; i->config_minlinewidth=0.05; i->config_caplinewidth=1; @@ -313,12 +345,38 @@ double x,y; } plotxy_t; +static inline int twipsnap(double f) +{ + /* if(f < -0x40000000/20.0) { + fprintf(stderr, "Warning: Coordinate underflow (%f)\n", f); + f = -0x40000000/20.0; + } else if(f>0x3fffffff/20.0) { + fprintf(stderr, "Warning: Coordinate overflow (%f)\n", f); + f = 0x3fffffff/20.0; + }*/ + + /* clamp coordinates to a rectangle with the property that we + can represent a line from the upper left corner to the upper + right corner using no more than 64 strokes */ + const double min = -(1<<(18+4))/20.0; + const double max = ((1<<(18+4))-1)/20.0; + if(f < min) { + fprintf(stderr, "Warning: Coordinate underflow (%f)\n", f); + f = min; + } else if(f>max) { + fprintf(stderr, "Warning: Coordinate overflow (%f)\n", f); + f = max; + } + + return (int)(f*20); +} + // write a move-to command into the swf static int movetoxy(gfxdevice_t*dev, TAG*tag, plotxy_t p0) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; - int rx = (int)(p0.x*20); - int ry = (int)(p0.y*20); + int rx = twipsnap(p0.x); + int ry = twipsnap(p0.y); if(rx!=i->swflastx || ry!=i->swflasty || i->fillstylechanged) { swf_ShapeSetMove (tag, i->shape, rx,ry); i->fillstylechanged = 0; @@ -380,8 +438,8 @@ static void linetoxy(gfxdevice_t*dev, TAG*tag, plotxy_t p0) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; - int px = (int)(p0.x*20); - int py = (int)(p0.y*20); + int px = twipsnap(p0.x); + int py = twipsnap(p0.y); int rx = (px-i->swflastx); int ry = (py-i->swflasty); if(rx|ry) { @@ -419,12 +477,12 @@ int lastlastx = i->swflastx; int lastlasty = i->swflasty; - int cx = ((int)(control.x*20)-i->swflastx); - int cy = ((int)(control.y*20)-i->swflasty); + int cx = (twipsnap(control.x)-i->swflastx); + int cy = (twipsnap(control.y)-i->swflasty); i->swflastx += cx; i->swflasty += cy; - int ex = ((int)(end.x*20)-i->swflastx); - int ey = ((int)(end.y*20)-i->swflasty); + int ex = (twipsnap(end.x)-i->swflastx); + int ey = (twipsnap(end.y)-i->swflasty); i->swflastx += ex; i->swflasty += ey; @@ -479,7 +537,7 @@ } } -static inline int colorcompare(gfxdevice_t*dev, RGBA*a,RGBA*b) +static inline int colorcompare(RGBA*a,RGBA*b) { if(a->r!=b->r || @@ -491,58 +549,57 @@ return 1; } -static SRECT getcharacterbbox(gfxdevice_t*dev, SWFFONT*font, MATRIX* m) +static SRECT getcharacterbbox(chararray_t*chardata, MATRIX* m, int flashversion) { - swfoutput_internal*i = (swfoutput_internal*)dev->internal; SRECT r; char debug = 0; memset(&r, 0, sizeof(r)); int t; if(debug) printf("\n"); - for(t=0;tchardatapos;t++) - { - if(i->chardata[t].fontid != font->id) { - msg(" Internal error: fontid %d != fontid %d", i->chardata[t].fontid, font->id); - exit(1); - } - SRECT b = font->layout->bounds[i->chardata[t].charid]; - b.xmin *= i->chardata[t].size; - b.ymin *= i->chardata[t].size; - b.xmax *= i->chardata[t].size; - b.ymax *= i->chardata[t].size; - - /* divide by 1024, rounding xmax/ymax up */ - b.xmax += 1023; b.ymax += 1023; b.xmin /= 1024; b.ymin /= 1024; b.xmax /= 1024; b.ymax /= 1024; - - b.xmin += i->chardata[t].x; - b.ymin += i->chardata[t].y; - b.xmax += i->chardata[t].x; - b.ymax += i->chardata[t].y; - - /* until we solve the INTERNAL_SCALING problem (see below) - make sure the bounding box is big enough */ - b.xmin -= 20; - b.ymin -= 20; - b.xmax += 20; - b.ymax += 20; - - b = swf_TurnRect(b, m); - - if(debug) printf("(%f,%f,%f,%f) -> (%f,%f,%f,%f) [font %d/%d, char %d]\n", - font->layout->bounds[i->chardata[t].charid].xmin/20.0, - font->layout->bounds[i->chardata[t].charid].ymin/20.0, - font->layout->bounds[i->chardata[t].charid].xmax/20.0, - font->layout->bounds[i->chardata[t].charid].ymax/20.0, - b.xmin/20.0, - b.ymin/20.0, - b.xmax/20.0, - b.ymax/20.0, - i->chardata[t].fontid, - font->id, - i->chardata[t].charid - ); - swf_ExpandRect2(&r, &b); + + double div = 1.0 / 1024.0; + if(flashversion>=8 && !NO_FONT3) { + div = 1.0 / 20480.0; + } + + while(chardata) { + for(t=0;tpos;t++) { + charatposition_t*chr = &chardata->chr[t]; + SRECT b = chr->font->layout->bounds[chr->charid]; + b.xmin = floor((b.xmin*(double)chr->size) *div); + b.ymin = floor((b.ymin*(double)chr->size) *div); + b.xmax = ceil((b.xmax*(double)chr->size) *div); + b.ymax = ceil((b.ymax*(double)chr->size) *div); + + b.xmin += chr->x; + b.ymin += chr->y; + b.xmax += chr->x; + b.ymax += chr->y; + + /* until we solve the INTERNAL_SCALING problem (see below) + make sure the bounding box is big enough */ + b.xmin -= 20; + b.ymin -= 20; + b.xmax += 20; + b.ymax += 20; + + b = swf_TurnRect(b, m); + + if(debug) printf("(%f,%f,%f,%f) -> (%f,%f,%f,%f) [font %d, char %d]\n", + chr->font->layout->bounds[chr->charid].xmin/20.0, + chr->font->layout->bounds[chr->charid].ymin/20.0, + chr->font->layout->bounds[chr->charid].xmax/20.0, + chr->font->layout->bounds[chr->charid].ymax/20.0, + b.xmin/20.0, + b.ymin/20.0, + b.xmax/20.0, + b.ymax/20.0, + chr->font->id, + chr->charid); + swf_ExpandRect2(&r, &b); + } + chardata = chardata->next; } if(debug) printf("-----> (%f,%f,%f,%f)\n", r.xmin/20.0, @@ -552,20 +609,31 @@ return r; } -static void putcharacters(gfxdevice_t*dev, TAG*tag) +static chararray_t*chararray_reverse(chararray_t*buf) +{ + chararray_t*prev = 0; + while(buf) { + chararray_t*next = buf->next; + buf->next = prev; + prev = buf; + buf = next; + } + return prev; +} + +static void chararray_writetotag(chararray_t*_chardata, TAG*tag) { - swfoutput_internal*i = (swfoutput_internal*)dev->internal; - int t; SWFFONT font; RGBA color; - color.r = i->chardata[0].color.r^255; + color.r = _chardata?_chardata->chr[0].color.r^255:0; color.g = 0; color.b = 0; color.a = 0; - int lastfontid; + SWFFONT*lastfont; int lastx; int lasty; int lastsize; + int lastchar; int charids[128]; int charadvance[128]; int charstorepos; @@ -575,20 +643,21 @@ if(tag->id != ST_DEFINETEXT && tag->id != ST_DEFINETEXT2) { - msg(" internal error: putcharacters needs an text tag, not %d\n",tag->id); + msg(" internal error: charbuffer_put needs an text tag, not %d\n",tag->id); exit(1); } - if(!i->chardatapos) { - msg(" putcharacters called with zero characters"); + if(!_chardata) { + msg(" charbuffer_put called with zero characters"); } for(pass = 0; pass < 2; pass++) { charstorepos = 0; - lastfontid = -1; + lastfont = 0; lastx = CHARMIDX; lasty = CHARMIDY; lastsize = -1; + lastchar = -1; if(pass==1) { @@ -597,114 +666,157 @@ swf_SetU8(tag, advancebits); } - for(t=0;t<=i->chardatapos;t++) - { - if(lastfontid != i->chardata[t].fontid || - lastx!=i->chardata[t].x || - lasty!=i->chardata[t].y || - !colorcompare(dev,&color, &i->chardata[t].color) || - charstorepos==127 || - lastsize != i->chardata[t].size || - t == i->chardatapos) - { - if(charstorepos && pass==0) - { - int s; - for(s=0;s=(1<=(1<writeBit = 0; // Q&D - swf_SetBits(tag, 0, 1); // GLYPH Record - swf_SetBits(tag, charstorepos, 7); // number of glyphs - int s; - for(s=0;schardatapos) - { - RGBA*newcolor=0; - SWFFONT*newfont=0; - int newx = 0; - int newy = 0; - if(lastx != i->chardata[t].x || - lasty != i->chardata[t].y) - { - newx = i->chardata[t].x; - newy = i->chardata[t].y; - if(newx == 0) - newx = SET_TO_ZERO; - if(newy == 0) - newy = SET_TO_ZERO; - } - if(!colorcompare(dev,&color, &i->chardata[t].color)) - { - color = i->chardata[t].color; - newcolor = &color; - } - font.id = i->chardata[t].fontid; - if(lastfontid != i->chardata[t].fontid || lastsize != i->chardata[t].size) - newfont = &font; - - tag->writeBit = 0; // Q&D - swf_TextSetInfoRecord(tag, newfont, i->chardata[t].size, newcolor, newx,newy); - } - - lastfontid = i->chardata[t].fontid; - lastx = i->chardata[t].x; - lasty = i->chardata[t].y; - lastsize = i->chardata[t].size; - } - - if(t==i->chardatapos) - break; - - int advance; - int nextt = t==i->chardatapos-1?t:t+1; - int rel = i->chardata[nextt].x-i->chardata[t].x; - if(rel>=0 && (rel<(1<<(advancebits-1)) || pass==0)) { - advance = rel; - lastx=i->chardata[nextt].x; - } - else { - advance = 0; - lastx=i->chardata[t].x; - } - charids[charstorepos] = i->chardata[t].charid; - charadvance[charstorepos] = advance; - charstorepos ++; - } + chararray_t*chardata = _chardata; + + while(chardata) { + int t; + + assert(!chardata->next || chardata->pos == CHARDATAMAX); + assert(chardata->pos); + + int to = chardata->next?chardata->pos-1:chardata->pos; + + for(t=0;t<=to;t++) + { + char islast = t==chardata->pos; + + charatposition_t*chr = &chardata->chr[t]; + + if(lastfont != chr->font || + lastx!=chr->x || + lasty!=chr->y || + !colorcompare(&color, &chardata->chr[t].color) || + charstorepos==127 || + lastsize != chardata->chr[t].size || + islast) + { + if(charstorepos && pass==0) + { + int s; + for(s=0;s=(1<=(1<writeBit = 0; // Q&D + swf_SetBits(tag, 0, 1); // GLYPH Record + swf_SetBits(tag, charstorepos, 7); // number of glyphs + int s; + for(s=0;sx || + lasty != chr->y) + { + newx = chr->x; + newy = chr->y; + if(newx == 0) + newx = SET_TO_ZERO; + if(newy == 0) + newy = SET_TO_ZERO; + } + if(!colorcompare(&color, &chr->color)) + { + color = chr->color; + newcolor = &color; + } + font.id = chr->font->id; + if(lastfont != chr->font || lastsize != chr->size) + newfont = &font; + + tag->writeBit = 0; // Q&D + swf_TextSetInfoRecord(tag, newfont, chr->size, newcolor, newx, newy); + } + + lastfont = chr->font; + lastx = chr->x; + lasty = chr->y; + lastsize = chr->size; + } + + if(islast) + break; + + int nextx = chr->x; + if(tpos-1) nextx = chardata->chr[t+1].x; + if(t==chardata->pos-1 && chardata->next) nextx = chardata->next->chr[0].x; + int dx = nextx-chr->x; + + int advance; + if(dx>=0 && (dx<(1<<(advancebits-1)) || pass==0)) { + advance = dx; + lastx=nextx; + } else { + advance = 0; + lastx=chr->x; + } + + charids[charstorepos] = chr->charid; + charadvance[charstorepos] = advance; + lastchar = chr->charid; + charstorepos ++; + } + chardata = chardata->next; + } } - i->chardatapos = 0; } -static void putcharacter(gfxdevice_t*dev, int fontid, int charid, int x,int y, int size, RGBA color) +static void chararray_destroy(chararray_t*chr) { - swfoutput_internal*i = (swfoutput_internal*)dev->internal; - if(i->chardatapos == CHARDATAMAX) - { - msg(" Character buffer too small. SWF will be slightly bigger"); - endtext(dev); - starttext(dev); + while(chr) { + chararray_t*next = chr->next; + chr->next = 0; + free(chr); + chr = next; } - i->chardata[i->chardatapos].fontid = fontid; - i->chardata[i->chardatapos].charid = charid; - i->chardata[i->chardatapos].x = x; - i->chardata[i->chardatapos].y = y; - i->chardata[i->chardatapos].color = color; - i->chardata[i->chardatapos].size = size; - i->chardatapos++; +} + +static inline int matrix_diff(MATRIX*m1, MATRIX*m2) +{ + return memcmp(m1,m2,sizeof(MATRIX)); +} +static charbuffer_t*charbuffer_append(charbuffer_t*buf, SWFFONT*font, int charid, int x,int y, int size, RGBA color, MATRIX*m) +{ + if(!buf || matrix_diff(&buf->matrix,m)) { + charbuffer_t*n = rfx_calloc(sizeof(charbuffer_t)); + n->matrix = *m; + n->next = buf; + buf = n; + } + if(!buf->last || buf->last->pos == CHARDATAMAX) { + chararray_t*n = rfx_calloc(sizeof(chararray_t)); + if(!buf->array) { + buf->array = buf->last = n; + } else { + buf->last->next = n; + buf->last = n; + } + } + chararray_t*a = buf->last; + a->chr[a->pos].font = font; + a->chr[a->pos].charid = charid; + a->chr[a->pos].x = x; + a->chr[a->pos].y = y; + a->chr[a->pos].color = color; + a->chr[a->pos].size = size; + a->pos++; + return buf; } /* Notice: we can only put chars in the range -1639,1638 (-32768/20,32768/20). @@ -712,30 +824,27 @@ If we set it to low, however, the char positions will be inaccurate */ #define GLYPH_SCALE 1 -static void endtext(gfxdevice_t*dev) +static void chararray_writetodev(gfxdevice_t*dev, chararray_t*array, MATRIX*matrix, char invisible) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; - if(i->textid<0) - return; - + + int textid = getNewID(dev); i->tag = swf_InsertTag(i->tag,ST_DEFINETEXT2); - swf_SetU16(i->tag, i->textid); - + swf_SetU16(i->tag, textid); SRECT r; - r = getcharacterbbox(dev, i->swffont, &i->fontmatrix); + r = getcharacterbbox(array, matrix, i->config_flashversion); r = swf_ClipRect(i->pagebbox, r); swf_SetRect(i->tag,&r); + swf_SetMatrix(i->tag, matrix); + msg(" Placing text as ID %d", textid); + chararray_writetotag(array, i->tag); + i->chardata = 0; - swf_SetMatrix(i->tag,&i->fontmatrix); - - msg(" Placing text (%d characters) as ID %d", i->chardatapos, i->textid); - - putcharacters(dev, i->tag); swf_SetU8(i->tag,0); if(i->swf->fileVersion >= 8) { i->tag = swf_InsertTag(i->tag, ST_CSMTEXTSETTINGS); - swf_SetU16(i->tag, i->textid); + swf_SetU16(i->tag, textid); //swf_SetU8(i->tag, /*subpixel grid*/(2<<3)|/*flashtype*/0x40); swf_SetU8(i->tag, /*grid*/(1<<3)|/*flashtype*/0x40); @@ -743,51 +852,37 @@ swf_SetU32(i->tag, 0);//thickness swf_SetU32(i->tag, 0);//sharpness + //swf_SetU32(i->tag, 0x20000);//thickness + //swf_SetU32(i->tag, 0x800000);//sharpness swf_SetU8(i->tag, 0);//reserved } - i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2); - - swf_ObjectPlace(i->tag,i->textid,getNewDepth(dev),&i->page_matrix,NULL,NULL); - i->textid = -1; + if(invisible && i->config_flashversion>=8) { + i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT3); + swf_ObjectPlaceBlend(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL,BLENDMODE_MULTIPLY); + } else { + i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2); + swf_ObjectPlace(i->tag,textid,getNewDepth(dev),&i->page_matrix,NULL,NULL); + } } -/* set's the matrix which is to be applied to characters drawn by swfoutput_drawchar() */ -static void setfontscale(gfxdevice_t*dev,double m11,double m12, double m21,double m22,double x, double y, char force) +static void charbuffer_writetodevandfree(gfxdevice_t*dev, charbuffer_t*buf, char invisible) +{ + while(buf) { + charbuffer_t*next = buf->next;buf->next = 0; + chararray_writetodev(dev, buf->array, &buf->matrix, invisible); + chararray_destroy(buf->array); + free(buf); + buf = next; + } +} + +static void endtext(gfxdevice_t*dev) { - m11 *= 1024; - m12 *= 1024; - m21 *= 1024; - m22 *= 1024; swfoutput_internal*i = (swfoutput_internal*)dev->internal; - if(i->lastfontm11 == m11 && - i->lastfontm12 == m12 && - i->lastfontm21 == m21 && - i->lastfontm22 == m22 && !force) + if(!i->textmode) return; - if(i->textid>=0) - endtext(dev); - - i->lastfontm11 = m11; - i->lastfontm12 = m12; - i->lastfontm21 = m21; - i->lastfontm22 = m22; - - double xsize = sqrt(m11*m11 + m12*m12); - double ysize = sqrt(m21*m21 + m22*m22); - i->current_font_size = (xsize>ysize?xsize:ysize)*1; - if(i->current_font_size < 1) - i->current_font_size = 1; - double ifs = 1.0 / (i->current_font_size*GLYPH_SCALE); - - MATRIX m; - m.sx = (S32)((m11*ifs)*65536); m.r1 = (S32)((m21*ifs)*65536); - m.r0 = (S32)((m12*ifs)*65536); m.sy = (S32)((m22*ifs)*65536); - /* this is the position of the first char to set a new fontmatrix- - we hope that it's close enough to all other characters using the - font, so we use its position as origin for the matrix */ - m.tx = x*20; - m.ty = y*20; - i->fontmatrix = m; + charbuffer_writetodevandfree(dev, i->chardata, 0);i->chardata = 0; + i->textmode = 0; } static int watermark2_width=47; @@ -863,20 +958,31 @@ i->watermarks++; } +static void drawoutline(gfxdevice_t*dev, gfxline_t*line); static void endpage(gfxdevice_t*dev) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; if(i->pagefinished) - return; + return; + if(i->shapeid>=0) - endshape(dev); - if(i->textid>=0) - endtext(dev); + endshape(dev); + if(i->textmode) + endtext(dev); + if(i->topchardata) { + charbuffer_writetodevandfree(dev, i->topchardata, 1); + i->topchardata=0; + } while(i->clippos) dev->endclip(dev); + if(i->stored_clipshapes) { + // in case of config_showclipshapes + drawoutline(dev, i->stored_clipshapes); + } + if(i->config_watermark) { insert_watermark(dev, 1); } @@ -1002,6 +1108,7 @@ i->lastframeno = i->frameno; i->firstpage = 0; i->pagefinished = 0; + i->chardata = 0; } void swf_endframe(gfxdevice_t*dev) @@ -1086,7 +1193,6 @@ dev->startclip = swf_startclip; dev->endclip = swf_endclip; dev->fill = swf_fill; - dev->fillbitmap = swf_fillbitmap; dev->fillgradient = swf_fillgradient; dev->addfont = swf_addfont; dev->drawchar = swf_drawchar; @@ -1106,8 +1212,13 @@ i->swf->movieSize.ymin = 0; i->swf->movieSize.xmax = 0; i->swf->movieSize.ymax = 0; - i->swf->fileAttributes = 9; // as3, local-with-network - + + if(i->config_local_with_filesystem) { + i->swf->fileAttributes = 8; // as3, local-with-filesystem + } else { + i->swf->fileAttributes = 9; // as3, local-with-network + } + i->swf->firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR); i->tag = i->swf->firstTag; RGBA rgb; @@ -1172,7 +1283,7 @@ if(i->config_watermark) { insert_watermark(dev, 0); } - i->textid = getNewID(dev); + i->textmode = 1; i->swflastx=i->swflasty=0; } @@ -1308,10 +1419,6 @@ m.ty += i->shapeposy; swf_ObjectPlace(i->tag,i->shapeid,getNewDepth(dev),&m,NULL,NULL); - if(i->config_animate) { - i->tag = swf_InsertTag(i->tag,ST_SHOWFRAME); - } - swf_ShapeFree(i->shape); i->shape = 0; i->shapeid = -1; @@ -1379,6 +1486,8 @@ endpage(dev); fontlist_t *iterator = i->fontlist; + char use_font3 = i->config_flashversion>=8 && !NO_FONT3; + while(iterator) { TAG*mtag = i->swf->firstTag; if(iterator->swffont) { @@ -1388,16 +1497,25 @@ } int used = iterator->swffont->use && iterator->swffont->use->used_glyphs; if(used) { - mtag = swf_InsertTag(mtag, ST_DEFINEFONT2); - swf_FontSetDefine2(mtag, iterator->swffont); + if(!use_font3) { + mtag = swf_InsertTag(mtag, ST_DEFINEFONT2); + swf_FontSetDefine2(mtag, iterator->swffont); + } else { + mtag = swf_InsertTag(mtag, ST_DEFINEFONT3); + swf_FontSetDefine2(mtag, iterator->swffont); + } } } iterator = iterator->next; } - + i->tag = swf_InsertTag(i->tag,ST_END); TAG* tag = i->tag->prev; + + if(use_font3 && i->config_storeallcharacters && i->config_alignfonts) { + swf_FontPostprocess(i->swf); // generate alignment information + } /* remove the removeobject2 tags between the last ST_SHOWFRAME and the ST_END- they confuse the flash player */ @@ -1416,7 +1534,7 @@ /* Add AVM2 actionscript */ if(i->config_flashversion>=9 && - (i->config_insertstoptag || i->hasbuttons)) { + (i->config_insertstoptag || i->hasbuttons) && !i->config_linknameurl) { swf_AddButtonLinks(i->swf, i->config_insertstoptag, i->config_internallinkfunction||i->config_externallinkfunction); } @@ -1555,7 +1673,7 @@ } -static void drawlink(gfxdevice_t*dev, ActionTAG*,ActionTAG*, gfxline_t*points, char mouseover, const char*url); +static void drawlink(gfxdevice_t*dev, ActionTAG*,ActionTAG*, gfxline_t*points, char mouseover, char*type, const char*url); static void swfoutput_namedlink(gfxdevice_t*dev, char*name, gfxline_t*points); static void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points); static void swfoutput_linktourl(gfxdevice_t*dev, const char*url, gfxline_t*points); @@ -1566,7 +1684,7 @@ dev->drawlink(dev, points, url); }*/ -void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, const char*url) +void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, const char*url, const char*text) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; @@ -1601,7 +1719,7 @@ swfoutput_internal*i = (swfoutput_internal*)dev->internal; if(i->shapeid>=0) endshape(dev); - if(i->textid>=0) + if(i->textmode) endtext(dev); /* TODO: escape special characters in url */ @@ -1621,8 +1739,8 @@ } actions = action_End(actions); - drawlink(dev, actions, 0, points, 0, url); - + drawlink(dev, actions, 0, points, 0, "url", url); + swf_ActionFree(actions); } void swfoutput_linktopage(gfxdevice_t*dev, int page, gfxline_t*points) @@ -1632,7 +1750,7 @@ if(i->shapeid>=0) endshape(dev); - if(i->textid>=0) + if(i->textmode) endtext(dev); if(!i->config_internallinkfunction || i->config_flashversion>=9) { @@ -1649,7 +1767,7 @@ char name[80]; sprintf(name, "page%d", page); - drawlink(dev, actions, 0, points, 0, name); + drawlink(dev, actions, 0, points, 0, "page", name); swf_ActionFree(actions); } @@ -1666,9 +1784,10 @@ if(i->shapeid>=0) endshape(dev); - if(i->textid>=0) + if(i->textmode) endtext(dev); + char*type = 0; if(!strncmp(tmp, "call:", 5)) { char*x = strchr(&tmp[5], ':'); @@ -1687,6 +1806,7 @@ } actions2 = action_End(0); mouseover = 0; + type = "call"; } else { @@ -1699,9 +1819,10 @@ actions2 = action_PushString(actions2, ""); actions2 = action_SetVariable(actions2); actions2 = action_End(actions2); + type = "subtitle"; } - drawlink(dev, actions1, actions2, points, mouseover, name); + drawlink(dev, actions1, actions2, points, mouseover, type, name); swf_ActionFree(actions1); swf_ActionFree(actions2); @@ -1748,7 +1869,7 @@ } -static void drawlink(gfxdevice_t*dev, ActionTAG*actions1, ActionTAG*actions2, gfxline_t*points, char mouseover, const char*url) +static void drawlink(gfxdevice_t*dev, ActionTAG*actions1, ActionTAG*actions2, gfxline_t*points, char mouseover, char*type, const char*url) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; RGBA rgb; @@ -1762,6 +1883,11 @@ int buttonid = getNewID(dev); gfxbbox_t bbox = gfxline_getbbox(points); + if(i->config_linknameurl) { + actions1 = 0; + actions2 = 0; + } + i->hasbuttons = 1; /* shape */ @@ -1845,10 +1971,14 @@ swf_ButtonPostProcess(i->tag, 1); } } + char buf[80]; + char*buf2 = 0; const char* name = 0; if(i->config_linknameurl) { - name = url; + buf2 = malloc(strlen(type)+strlen(url)+2); + sprintf(buf2, "%s:%s", type, url); + name = buf2; } else { name = buf; sprintf(buf, "button%d", buttonid); @@ -1866,10 +1996,13 @@ m = i->page_matrix; m.tx = p.x; m.ty = p.y; - swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&m,0,name); + swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&m,0,(U8*)name); } else { - swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&i->page_matrix,0,name); + swf_ObjectPlace(i->tag, buttonid, getNewDepth(dev),&i->page_matrix,0,(U8*)name); } + + if(buf2) + free(buf2); } @@ -1941,6 +2074,12 @@ } } else if(!strcmp(name, "filloverlap")) { i->config_filloverlap = atoi(value); + } else if(!strcmp(name, "local_with_network")) { + i->config_local_with_network = atoi(value); + i->config_local_with_filesystem = !i->config_local_with_network; + } else if(!strcmp(name, "local_with_filesystem")) { + i->config_local_with_filesystem = atoi(value); + i->config_local_with_network = !i->config_local_with_filesystem; } else if(!strcmp(name, "linksopennewwindow")) { i->config_opennewwindow = atoi(value); } else if(!strcmp(name, "opennewwindow")) { @@ -1991,14 +2130,27 @@ } } else if(!strcmp(name, "minlinewidth")) { i->config_minlinewidth = atof(value); + } else if(!strcmp(name, "remove_small_polygons")) { + i->config_remove_small_polygons = atof(value); } else if(!strcmp(name, "caplinewidth")) { i->config_caplinewidth = atof(value); } else if(!strcmp(name, "linktarget")) { i->config_linktarget = strdup(value); + } else if(!strcmp(name, "invisibletexttofront")) { + i->config_invisibletexttofront = atoi(value); + } else if(!strcmp(name, "noclips")) { + i->config_noclips = atoi(value); } else if(!strcmp(name, "dumpfonts")) { i->config_dumpfonts = atoi(value); + } else if(!strcmp(name, "override_line_widths")) { + i->config_override_line_widths = atof(value); } else if(!strcmp(name, "animate")) { i->config_animate = atoi(value); + i->config_framerate = 25; + } else if(!strcmp(name, "linknameurl")) { + i->config_linknameurl = atoi(value); + } else if(!strcmp(name, "showimages")) { + i->config_showimages = atoi(value); } else if(!strcmp(name, "disablelinks")) { i->config_disablelinks = atoi(value); } else if(!strcmp(name, "simpleviewer")) { @@ -2042,7 +2194,7 @@ printf("linkcolor==7)\n"); + printf("enablezlib switch on zlib compression (also done if flashversion>=6)\n"); printf("bboxvars store the bounding box of the SWF file in actionscript variables\n"); printf("dots Take care to handle dots correctly\n"); printf("reordertags=0/1 (default: 1) perform some tag optimizations\n"); @@ -2134,7 +2286,9 @@ if(newsizex Scaling %dx%d image to %dx%d", sizex, sizey, newsizex, newsizey); - newpic = swf_ImageScale(mem, sizex, sizey, newsizex, newsizey); + gfximage_t*ni = gfximage_rescale(img, newsizex, newsizey); + newpic = (RGBA*)ni->data; + free(ni); *newwidth = sizex = newsizex; *newheight = sizey = newsizey; mem = newpic; @@ -2183,6 +2337,16 @@ return bitid; } +int line_is_empty(gfxline_t*line) +{ + while(line) { + if(line->type != gfx_moveTo) + return 0; + line = line->next; + } + return 1; +} + static SRECT gfxline_getSWFbbox(gfxline_t*line) { gfxbbox_t bbox = gfxline_getbbox(line); @@ -2194,16 +2358,6 @@ return r; } -int line_is_empty(gfxline_t*line) -{ - while(line) { - if(line->type != gfx_moveTo) - return 0; - line = line->next; - } - return 1; -} - static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; @@ -2236,6 +2390,11 @@ SHAPE*shape; swf_ShapeNew(&shape); int fsid = swf_ShapeAddBitmapFillStyle(shape,&m,bitid,1); + int lsid = 0; + if(i->config_showimages) { + RGBA pink = {255,255,0,255}; + lsid = swf_ShapeAddLineStyle(shape, 20, &pink); + } swf_SetU16(i->tag, myshapeid); SRECT r = gfxline_getSWFbbox(line); r = swf_ClipRect(i->pagebbox, r); @@ -2243,7 +2402,7 @@ swf_SetShapeStyles(i->tag,shape); swf_ShapeCountBits(shape,NULL,NULL); swf_SetShapeBits(i->tag,shape); - swf_ShapeSetAll(i->tag,shape,UNDEFINED_COORD,UNDEFINED_COORD,0,fsid,0); + swf_ShapeSetAll(i->tag,shape,UNDEFINED_COORD,UNDEFINED_COORD,lsid,fsid,0); i->swflastx = i->swflasty = UNDEFINED_COORD; drawgfxline(dev, line, 1); swf_ShapeSetEnd(i->tag); @@ -2255,8 +2414,7 @@ swf_ObjectPlace(i->tag,myshapeid,getNewDepth(dev),&i->page_matrix,&cxform2,NULL); } -static RGBA col_black = {255,0,0,0}; - +static RGBA col_purple = {255,255,0,255}; static void drawoutline(gfxdevice_t*dev, gfxline_t*line) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; @@ -2266,7 +2424,7 @@ SHAPE*shape; swf_ShapeNew(&shape); - int lsid = swf_ShapeAddLineStyle(shape,1,&col_black); + int lsid = swf_ShapeAddLineStyle(shape,60,&col_purple); swf_SetU16(i->tag,myshapeid); SRECT r = gfxline_getSWFbbox(line); @@ -2287,6 +2445,8 @@ static void swf_startclip(gfxdevice_t*dev, gfxline_t*line) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; + if(i->config_noclips) + return; endtext(dev); endshape(dev); @@ -2297,8 +2457,9 @@ i->clippos --; } - if(i->config_showclipshapes) - drawoutline(dev, line); + if(i->config_showclipshapes) { + i->stored_clipshapes = gfxline_append(i->stored_clipshapes, gfxline_clone(line)); + } int myshapeid = getNewID(dev); i->tag = swf_InsertTag(i->tag,ST_DEFINESHAPE3); @@ -2353,7 +2514,9 @@ static void swf_endclip(gfxdevice_t*dev) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; - if(i->textid>=0) + if(i->config_noclips) + return; + if(i->textmode) endtext(dev); if(i->shapeid>=0) endshape(dev); @@ -2499,6 +2662,10 @@ gfxbbox_t r = gfxline_getbbox(line); int is_outside_page = !is_inside_page(dev, r.xmin, r.ymin) || !is_inside_page(dev, r.xmax, r.ymax); + if(i->config_override_line_widths) { + width = i->config_override_line_widths; + } + /* TODO: * split line into segments, and perform this check for all segments */ if(i->config_disable_polygon_conversion || /*type>=5 ||*/ @@ -2514,11 +2681,11 @@ if(has_dots) gfxline_fix_short_edges(line); /* we need to convert the line into a polygon */ - gfxpoly_t* poly = gfxpoly_strokeToPoly(line, width, cap_style, joint_style, miterLimit); - gfxline_t*gfxline = gfxpoly_to_gfxline(poly); + gfxpoly_t* poly = gfxpoly_from_stroke(line, width, cap_style, joint_style, miterLimit, DEFAULT_GRID); + gfxline_t*gfxline = gfxline_from_gfxpoly(poly); dev->fill(dev, gfxline, color); gfxline_free(gfxline); - gfxpoly_free(poly); + gfxpoly_destroy(poly); return; } @@ -2556,10 +2723,16 @@ return; if(!color->a) return; + gfxbbox_t r = gfxline_getbbox(line); int is_outside_page = !is_inside_page(dev, r.xmin, r.ymin) || !is_inside_page(dev, r.xmax, r.ymax); - //if(i->chardatapos && i->chardata[i->chardatapos-1].color.a) { + if(r.xmax - r.xmin < i->config_remove_small_polygons && + r.ymax - r.ymin < i->config_remove_small_polygons) { + msg(" Not drawing %.2fx%.2f polygon", r.xmax - r.xmin, r.ymax - r.ymin); + return; + } + endtext(dev); if(!i->config_ignoredraworder) @@ -2669,13 +2842,13 @@ swf_FreeGradient(swfgradient);free(swfgradient); } -static SWFFONT* gfxfont_to_swffont(gfxfont_t*font, const char* id) +static SWFFONT* gfxfont_to_swffont(gfxfont_t*font, const char* id, int version) { SWFFONT*swffont = (SWFFONT*)rfx_calloc(sizeof(SWFFONT)); int t; SRECT bounds = {0,0,0,0}; swffont->id = -1; - swffont->version = 2; + swffont->version = version; swffont->name = (U8*)strdup(id); swffont->layout = (SWFLAYOUT*)rfx_calloc(sizeof(SWFLAYOUT)); swffont->layout->ascent = 0; @@ -2689,21 +2862,26 @@ swffont->glyph2ascii = (U16*)rfx_calloc(sizeof(U16)*swffont->numchars); swffont->glyph = (SWFGLYPH*)rfx_calloc(sizeof(SWFGLYPH)*swffont->numchars); swffont->glyphnames = (char**)rfx_calloc(sizeof(char*)*swffont->numchars); - for(t=0;tmax_unicode;t++) { - swffont->ascii2glyph[t] = font->unicode2glyph[t]; - } + SRECT max = {0,0,0,0}; for(t=0;tnum_glyphs;t++) { drawer_t draw; gfxline_t*line; double advance = 0; - swffont->glyph2ascii[t] = font->glyphs[t].unicode; - if(swffont->glyph2ascii[t] == 0xffff || swffont->glyph2ascii[t] == 0x0000) { + int u = font->glyphs[t].unicode; + int s; + char twice=0; + for(s=0;snum_glyphs;s++) { + if(swffont->glyph2ascii[s]==u) + twice=1; + } + if(u >= 0xd800 || u == 0x0000 || twice) { /* flash 8 flashtype requires unique unicode IDs for each character. We use the Unicode private user area to assign characters, hoping that - the font doesn't contain more than 2048 glyphs */ - swffont->glyph2ascii[t] = 0xe000 + (t&0x1fff); + the font doesn't contain more than 8192 glyphs */ + u = 0xe000 + (t&0x1fff); } + swffont->glyph2ascii[t] = u; if(font->glyphs[t].name) { swffont->glyphnames[t] = strdup(font->glyphs[t].name); @@ -2714,10 +2892,18 @@ swf_Shape01DrawerInit(&draw, 0); line = font->glyphs[t].line; + + const double scale = GLYPH_SCALE; while(line) { FPOINT c,to; - c.x = line->sx * GLYPH_SCALE; c.y = line->sy * GLYPH_SCALE; - to.x = line->x * GLYPH_SCALE; to.y = line->y * GLYPH_SCALE; + c.x = line->sx * scale; c.y = -line->sy * scale; + //to.x = floor(line->x * scale); to.y = floor(-line->y * scale); + to.x = line->x * scale; to.y = -line->y * scale; + + /*if(strstr(swffont->name, "BIRNU") && t==90) { + to.x += 1; + }*/ + if(line->type == gfx_moveTo) { draw.moveTo(&draw, &to); } else if(line->type == gfx_lineTo) { @@ -2746,6 +2932,7 @@ swf_ExpandRect2(&bounds, &swffont->layout->bounds[t]); } + for(t=0;tnum_glyphs;t++) { SRECT bbox = swffont->layout->bounds[t]; @@ -2773,22 +2960,19 @@ The baseline is defined as the y-position zero */ - swffont->layout->ascent = -bounds.ymin; - if(swffont->layout->ascent < 0) - swffont->layout->ascent = 0; - swffont->layout->descent = bounds.ymax; - if(swffont->layout->descent < 0) - swffont->layout->descent = 0; + swffont->layout->ascent = bounds.ymin<0?-bounds.ymin:0; + swffont->layout->descent = bounds.ymax>0?bounds.ymax:0; swffont->layout->leading = bounds.ymax - bounds.ymin; /* if the font has proper ascent/descent values (>0) and those define - greater line spacing that what we estimated from the bounding boxes, - use the font's parameters */ - if(font->ascent*20 > swffont->layout->ascent) + greater (but not overly large) line spacing than what we estimated + from the bounding boxes, use the font's parameters */ + if(font->ascent*20 > swffont->layout->ascent && font->ascent*20*2 < swffont->layout->ascent) swffont->layout->ascent = font->ascent*20; - if(font->descent*20 > swffont->layout->descent) + if(font->descent*20 > swffont->layout->descent && font->descent*20*2 < swffont->layout->descent) swffont->layout->descent = font->descent*20; + swf_FontSort(swffont); return swffont; } @@ -2808,7 +2992,7 @@ l = l->next; } l = (fontlist_t*)rfx_calloc(sizeof(fontlist_t)); - l->swffont = gfxfont_to_swffont(font, font->id); + l->swffont = gfxfont_to_swffont(font, font->id, (i->config_flashversion>=8 && !NO_FONT3)?3:2); l->next = 0; if(last) { last->next = l; @@ -2828,6 +3012,12 @@ msg(" | Maxascii: %d", l->swffont->maxascii); msg(" | Style: %d", l->swffont->style); msg(" | Encoding: %d", l->swffont->encoding); + if(l->swffont->layout) { + msg(" | Ascent: %.2f", l->swffont->layout->ascent / 20.0); + msg(" | Descent: %.2f", l->swffont->layout->descent / 20.0); + msg(" | Leading: %.2f", l->swffont->layout->leading / 20.0); + } + for(iii=0; iiiswffont->numchars;iii++) { msg(" | Glyph %d) name=%s, unicode=%d size=%d bbox=(%.2f,%.2f,%.2f,%.2f)\n", iii, l->swffont->glyphnames?l->swffont->glyphnames[iii]:"", l->swffont->glyph2ascii[iii], l->swffont->glyph[iii].shape->bitlen, l->swffont->layout->bounds[iii].xmin/20.0, @@ -2835,11 +3025,6 @@ l->swffont->layout->bounds[iii].xmax/20.0, l->swffont->layout->bounds[iii].ymax/20.0 ); - int t; - for(t=0;tswffont->maxascii;t++) { - if(l->swffont->ascii2glyph[t] == iii) - msg(" | - maps to %d",t); - } } } } @@ -2863,6 +3048,56 @@ return; } +/* sets the matrix which is to be applied to characters drawn by swfoutput_drawchar() */ +static void setfontscale(gfxdevice_t*dev,double m11,double m12, double m21,double m22,double x, double y, char force) +{ + m11 *= 1024; + m12 *= 1024; + m21 *= 1024; + m22 *= 1024; + swfoutput_internal*i = (swfoutput_internal*)dev->internal; + if(i->lastfontm11 == m11 && + i->lastfontm12 == m12 && + i->lastfontm21 == m21 && + i->lastfontm22 == m22 && !force) + return; + if(i->textmode) + endtext(dev); + + i->lastfontm11 = m11; + i->lastfontm12 = m12; + i->lastfontm21 = m21; + i->lastfontm22 = m22; + + double xsize = sqrt(m11*m11 + m12*m12); + double ysize = sqrt(m21*m21 + m22*m22); + + int extrazoom = 1; + if(i->config_flashversion>=8 && !NO_FONT3) + extrazoom = 20; + + i->current_font_size = (xsize>ysize?xsize:ysize)*extrazoom; + if(i->current_font_size < 1) + i->current_font_size = 1; + + MATRIX m; + swf_GetMatrix(0, &m); + + if(m21 || m12 || fabs(m11+m22)>0.001 || m11<0) { + double ifs = (double)extrazoom/(i->current_font_size); + m.sx = (S32)((m11*ifs)*65536); m.r1 = -(S32)((m21*ifs)*65536); + m.r0 = (S32)((m12*ifs)*65536); m.sy = -(S32)((m22*ifs)*65536); + } + + /* this is the position of the first char to set a new fontmatrix- + we hope that it's close enough to all other characters using the + font, so we use its position as origin for the matrix */ + m.tx = x*20; + m.ty = y*20; + i->fontmatrix = m; +} + + static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix) { swfoutput_internal*i = (swfoutput_internal*)dev->internal; @@ -2882,11 +3117,9 @@ if(!i->swffont || !i->swffont->name || strcmp((char*)i->swffont->name,font->id)) // not equal to current font { - /* TODO: remove the need for this (enhance getcharacterbbox so that it can cope - with multiple fonts */ - endtext(dev); swf_switchfont(dev, font->id); // set the current font } + if(!i->swffont) { msg(" swf_drawchar: Font is NULL"); return; @@ -2895,6 +3128,7 @@ msg(" No character %d in font %s (%d chars)", glyph, FIXNULL((char*)i->swffont->name), i->swffont->numchars); return; } + glyph = i->swffont->glyph2glyph[glyph]; setfontscale(dev, matrix->m00, matrix->m01, matrix->m10, matrix->m11, matrix->tx, matrix->ty, 0); @@ -2902,7 +3136,7 @@ i->fontmatrix.r0/65536.0 * i->fontmatrix.r1/65536.0; if(fabs(det) < 0.0005) { /* x direction equals y direction- the text is invisible */ - msg(" Not drawing invisible character character %d (det=%f, m=[%f %f;%f %f]\n", glyph, + msg(" Not drawing invisible character %d (det=%f, m=[%f %f;%f %f]\n", glyph, det, i->fontmatrix.sx/65536.0, i->fontmatrix.r1/65536.0, i->fontmatrix.r0/65536.0, i->fontmatrix.sy/65536.0); @@ -2932,13 +3166,28 @@ if(i->shapeid>=0) endshape(dev); - if(i->textid<0) - starttext(dev); + + if(i->config_animate) { + endtext(dev); + i->tag = swf_InsertTag(i->tag,ST_SHOWFRAME); + } + if(!i->textmode) + starttext(dev); + msg(" Drawing char %d in font %d at %d,%d in color %02x%02x%02x%02x", glyph, i->swffont->id, x, y, color->r, color->g, color->b, color->a); - putcharacter(dev, i->swffont->id, glyph, x, y, i->current_font_size, *(RGBA*)color); - swf_FontUseGlyph(i->swffont, glyph); + if(color->a == 0 && i->config_invisibletexttofront) { + RGBA color2 = *(RGBA*)color; + if(i->config_flashversion>=8) { + // use "multiply" blend mode + color2.a = color2.r = color2.g = color2.b = 255; + } + i->topchardata = charbuffer_append(i->topchardata, i->swffont, glyph, x, y, i->current_font_size, color2, &i->fontmatrix); + } else { + i->chardata = charbuffer_append(i->chardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix); + } + swf_FontUseGlyph(i->swffont, glyph, i->current_font_size); return; } diff -Nru swftools-0.9.0/lib/devices/text.c swftools-0.9.2/lib/devices/text.c --- swftools-0.9.0/lib/devices/text.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/devices/text.c 2010-11-12 18:52:45.000000000 +0000 @@ -133,7 +133,7 @@ } } -void text_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +void text_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*drawlink) { internal_t*i = (internal_t*)dev->internal; } diff -Nru swftools-0.9.0/lib/filters/alpha.c swftools-0.9.2/lib/filters/alpha.c --- swftools-0.9.0/lib/filters/alpha.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/alpha.c 2010-11-12 18:53:11.000000000 +0000 @@ -0,0 +1,117 @@ +/* alpha.c + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../types.h" +#include "../mem.h" + +typedef struct _internal { + U8 alpha; +} internal_t; + +static inline gfxcolor_t transform_color(internal_t*i, gfxcolor_t*col) +{ + gfxcolor_t col2; + col2.r = col->r; + col2.g = col->g; + col2.b = col->b; + col2.a = (col->a * i->alpha)/255; + return col2; +} + +static void maketransparent_stroke(gfxfilter_t*f, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxcolor_t color2 = transform_color(i, color); + out->stroke(out, line, width, &color2, cap_style, joint_style, miterLimit); +} +static void maketransparent_fill(gfxfilter_t*f, gfxline_t*line, gfxcolor_t*color, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxcolor_t color2 = transform_color(i, color); + out->fill(out, line, &color2); +} +static void maketransparent_fillbitmap(gfxfilter_t*f, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfximage_t img2; + img2.width = img->width; + img2.height = img->height; + img2.data = (gfxcolor_t*)rfx_alloc(img->width*img->height*4); + int x,y; + for(y=0;yheight;y++) { + gfxcolor_t*in = &img->data[y*img->width]; + gfxcolor_t*out = &img2.data[y*img->width]; + for(x=0;xwidth;x++) { + out[x] = transform_color(i, &in[x]); + } + } + out->fillbitmap(out, line, &img2, matrix, cxform); + rfx_free(img2.data); +} +static void maketransparent_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxcolor_t color2 = transform_color(i, color); + out->drawchar(out, font, glyphnr, color, matrix); +} +static void maketransparent_fillgradient(gfxfilter_t*f, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + + gfxgradient_t*g = 0, *prev = 0; + + while(gradient) { + gfxgradient_t*n = rfx_alloc(sizeof(gfxgradient_t)); + n->pos = gradient->pos; + n->color = transform_color(i, &gradient->color); + n->next = 0; + if(prev) { + prev->next = n; + prev = n; + } else { + g = prev = n; + } + gradient = gradient->next; + } + + out->fillgradient(out, line, g, type, matrix); + gfxgradient_destroy(g); +} + +void gfxfilter_maketransparent_init(gfxfilter_t*f, U8 alpha) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + i->alpha = alpha; + + memset(f, 0, sizeof(gfxfilter_t)); + f->type = gfxfilter_onepass; + f->name = "maketransparent"; + f->internal = i; + f->stroke = maketransparent_stroke; + f->fill = maketransparent_fill; + f->fillbitmap = maketransparent_fillbitmap; + f->fillgradient = maketransparent_fillgradient; + f->drawchar = maketransparent_drawchar; +} + diff -Nru swftools-0.9.0/lib/filters/flatten.c swftools-0.9.2/lib/filters/flatten.c --- swftools-0.9.0/lib/filters/flatten.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/flatten.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,392 @@ +/* flatten.c + + Part of the swftools package. + + Copyright (c) 2008-2011 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#ifndef WIN32 +#include +#endif +#include +#include +#include +#include +#include "../mem.h" +#include "../gfxdevice.h" +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../gfxpoly.h" +#include "../log.h" + +typedef struct _clip { + gfxpoly_t*poly; + int openclips; + struct _clip*next; +} clip_t; + +typedef struct _internal { + clip_t*clip; + + char config_dont_clip_characters; + + int good_polygons; + int bad_polygons; +} internal_t; + +static int verbose = 0; + +static void dbg(char*format, ...) +{ + if(!verbose) + return; + char buf[1024]; + int l; + va_list arglist; + va_start(arglist, format); + vsnprintf(buf, sizeof(buf)-1, format, arglist); + va_end(arglist); + l = strlen(buf); + while(l && buf[l-1]=='\n') { + buf[l-1] = 0; + l--; + } + printf("(device-polyops) %s\n", buf); + fflush(stdout); +} + +int flatten_setparameter(gfxfilter_t*dev, const char*key, const char*value, gfxdevice_t*out) +{ + dbg("flatten_setparameter"); + internal_t*i = (internal_t*)dev->internal; + if(!strcmp(key, "dont_clip_characters")) { + i->config_dont_clip_characters = atoi(value); + } + return out->setparameter(out,key,value); +} + +void flatten_startpage(gfxfilter_t*dev, int width, int height, gfxdevice_t*out) +{ + dbg("flatten_startpage"); + internal_t*i = (internal_t*)dev->internal; + out->startpage(out,width,height); +} + +void flatten_startclip(gfxfilter_t*dev, gfxline_t*line, gfxdevice_t*out) +{ + dbg("flatten_startclip"); + internal_t*i = (internal_t*)dev->internal; + + gfxpoly_t* oldclip = i->clip?i->clip->poly:0; + gfxpoly_t* poly = gfxpoly_from_fill(line, DEFAULT_GRID); + if(poly) + i->good_polygons++; + else + i->bad_polygons++; + + gfxpoly_t* currentclip = 0; + int type = 0; + + /* we can't rely on gfxpoly actually being able to convert + a gfxline into a gfxpoly- for polygons which are too + complex or just degenerate, this might fail. So handle + all the cases where polygon conversion or intersection + might go awry + UPDATE: this is not needed anymore. The new gfxpoly + implementation is stable enough so it always returns + a valid result. Still, it's good practice. + */ + if(!poly && !oldclip) { + out->startclip(out,line); + currentclip = 0; + type = 1; + } else if(!poly && oldclip) { + gfxline_t*oldclipline = gfxline_from_gfxpoly(oldclip); + out->startclip(out,oldclipline); + out->startclip(out,line); + currentclip = 0; + type = 2; + } else if(poly && oldclip) { + gfxpoly_t*intersection = gfxpoly_intersect(poly, oldclip); + if(intersection) { + i->good_polygons++; + // this case is what usually happens + gfxpoly_destroy(poly);poly=0; + currentclip = intersection; + type = 0; + } else { + i->bad_polygons++; + gfxline_t*oldclipline = gfxline_from_gfxpoly(oldclip); + out->startclip(out, oldclipline); + currentclip = poly; + type = 1; + } + } else if(poly && !oldclip) { + currentclip = poly; + type = 0; + } + + clip_t*n = i->clip; + i->clip = (clip_t*)rfx_calloc(sizeof(clip_t)); + i->clip->next = n; + i->clip->poly = currentclip; + i->clip->openclips = type; +} + +void flatten_endclip(gfxfilter_t*dev, gfxdevice_t*out) +{ + dbg("flatten_endclip"); + internal_t*i = (internal_t*)dev->internal; + + if(!i->clip) { + msg(" endclip without startclip (in: polyops)\n"); + return; + } + + clip_t*old = i->clip; + i->clip = i->clip->next; + if(old->poly) { + gfxpoly_destroy(old->poly);old->poly = 0; + } + int t; + for(t=0;topenclips;t++) + out->endclip(out); + + old->next = 0;free(old); +} + +static gfxline_t* handle_poly(internal_t*i, gfxpoly_t*poly, char*ok, gfxdevice_t*out) +{ + if(i->clip && i->clip->poly) { + gfxpoly_t*old = poly; + if(poly) { + poly = gfxpoly_intersect(poly, i->clip->poly); + gfxpoly_destroy(old); + } + } + + if(poly) + i->good_polygons++; + else + i->bad_polygons++; + + gfxline_t*gfxline = 0; + if(poly) { + // this is the case where everything went right + gfxline_t*line = gfxline_from_gfxpoly(poly); + gfxpoly_destroy(poly); + *ok = 1; + return line; + } else { + if(i->clip && i->clip->poly) { + /* convert current clipping from a polygon to an + actual "startclip" written to the output */ + assert(i->clip->openclips <= 1); + gfxline_t*clipline = gfxline_from_gfxpoly(i->clip->poly); + out->startclip(out, clipline); + gfxline_free(clipline); + gfxpoly_destroy(i->clip->poly);i->clip->poly = 0; + i->clip->openclips++; + return 0; + } else { + return 0; + } + } +} + +void flatten_stroke(gfxfilter_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, gfxdevice_t*out) +{ + dbg("flatten_stroke"); + internal_t*i = (internal_t*)dev->internal; + + gfxpoly_t* poly = gfxpoly_from_stroke(line, width, cap_style, joint_style, miterLimit, DEFAULT_GRID); + char ok = 0; + gfxline_t*line2 = handle_poly(i, poly, &ok, out); + + if(ok) { + if(out && line2) out->fill(out, line2, color); + gfxline_free(line2); + } else { + msg(" .."); + out->stroke(out, line, width, color, cap_style, joint_style, miterLimit); + } +} + +void flatten_fill(gfxfilter_t*dev, gfxline_t*line, gfxcolor_t*color, gfxdevice_t*out) +{ + dbg("flatten_fill"); + internal_t*i = (internal_t*)dev->internal; + + gfxpoly_t*poly = gfxpoly_from_fill(line, DEFAULT_GRID); + char ok = 0; + gfxline_t*line2 = handle_poly(i, poly, &ok, out); + + if(ok) { + if(out && line2) out->fill(out, line2, color); + gfxline_free(line2); + } else { + out->fill(out, line, color); + } +} + +void flatten_fillbitmap(gfxfilter_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform, gfxdevice_t*out) +{ + dbg("flatten_fillbitmap"); + internal_t*i = (internal_t*)dev->internal; + + gfxpoly_t*poly = gfxpoly_from_fill(line, DEFAULT_GRID); + char ok = 0; + gfxline_t*line2 = handle_poly(i, poly, &ok, out); + + if(ok) { + if(out && line2) out->fillbitmap(out, line2, img, matrix, cxform); + gfxline_free(line2); + } else { + out->fillbitmap(out, line, img, matrix, cxform); + } +} + +void flatten_fillgradient(gfxfilter_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + dbg("flatten_fillgradient"); + internal_t*i = (internal_t*)dev->internal; + + gfxpoly_t*poly = gfxpoly_from_fill(line, DEFAULT_GRID); + char ok = 0; + gfxline_t*line2 = handle_poly(i, poly, &ok, out); + + if(ok) { + if(out && line2) out->fillgradient(out, line2, gradient, type, matrix); + gfxline_free(line2); + } else { + out->fillgradient(out, line, gradient, type, matrix); + } +} + +void flatten_addfont(gfxfilter_t*dev, gfxfont_t*font, gfxdevice_t*out) +{ + dbg("flatten_addfont"); + internal_t*i = (internal_t*)dev->internal; + out->addfont(out, font); +} + +void flatten_drawchar(gfxfilter_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + dbg("flatten_drawchar"); + if(!font) + return; + internal_t*i = (internal_t*)dev->internal; + gfxline_t*glyph = gfxline_clone(font->glyphs[glyphnr].line); + gfxline_transform(glyph, matrix); + + if(i->clip && i->clip->poly) { + gfxbbox_t bbox = gfxline_getbbox(glyph); + gfxpoly_t*dummybox = gfxpoly_createbox(bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax, DEFAULT_GRID); + gfxline_t*dummybox2 = gfxline_from_gfxpoly(dummybox); + bbox = gfxline_getbbox(dummybox2); + gfxline_free(dummybox2); + + char ok=0; + gfxline_t*gfxline = handle_poly(i, dummybox, &ok, out); + if(ok) { + gfxbbox_t bbox2 = gfxline_getbbox(gfxline); + double w = bbox2.xmax - bbox2.xmin; + double h = bbox2.ymax - bbox2.ymin; + if(fabs((bbox.xmax - bbox.xmin) - w) > DEFAULT_GRID*2 || + fabs((bbox.ymax - bbox.ymin) - h) > DEFAULT_GRID*2) { + /* notable change in character size: character was clipped + TODO: how to deal with diagonal cuts? + */ + msg(" Character %d was clipped: (%f,%f,%f,%f) -> (%f,%f,%f,%f)", + glyphnr, + bbox.xmin,bbox.ymin,bbox.xmax,bbox.ymax, + bbox2.xmin,bbox2.ymin,bbox2.xmax,bbox2.ymax); + if(!i->config_dont_clip_characters) { + flatten_fill(dev, glyph, color, out); + } else { + if(bbox2.xmin < bbox2.xmax && + bbox2.ymin < bbox2.ymax) { + out->drawchar(out, font, glyphnr, color, matrix); + } + } + } else { + out->drawchar(out, font, glyphnr, color, matrix); + } + } else { + out->drawchar(out, font, glyphnr, color, matrix); + } + gfxline_free(gfxline); + } else { + out->drawchar(out, font, glyphnr, color, matrix); + } + + gfxline_free(glyph); +} + +void flatten_drawlink(gfxfilter_t*dev, gfxline_t*line, const char*action, const char*text, gfxdevice_t*out) +{ + dbg("flatten_drawlink"); + internal_t*i = (internal_t*)dev->internal; + out->drawlink(out, line, action, text); +} + +void flatten_endpage(gfxfilter_t*dev, gfxdevice_t*out) +{ + dbg("flatten_endpage"); + internal_t*i = (internal_t*)dev->internal; + out->endpage(out); +} + +gfxresult_t* flatten_finish(gfxfilter_t*dev, gfxdevice_t*out) +{ + dbg("flatten_finish"); + internal_t*i = (internal_t*)dev->internal; + + if(i->bad_polygons) { + msg(" --flatten success rate: %.1f%% (%d failed polygons)", i->good_polygons*100.0 / (i->good_polygons + i->bad_polygons), i->bad_polygons); + } + + free(i);dev->internal = 0; + return out->finish(out); +} + +void gfxfilter_flatten_init(gfxfilter_t*f) +{ + dbg("flatten filter"); + memset(f, 0, sizeof(gfxfilter_t)); + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + + f->internal = i; + f->name = "flatten"; + f->type = gfxfilter_onepass; + + f->setparameter = flatten_setparameter; + f->startpage = flatten_startpage; + f->startclip = flatten_startclip; + f->endclip = flatten_endclip; + f->stroke = flatten_stroke; + f->fill = flatten_fill; + f->fillbitmap = flatten_fillbitmap; + f->fillgradient = flatten_fillgradient; + f->addfont = flatten_addfont; + f->drawchar = flatten_drawchar; + f->drawlink = flatten_drawlink; + f->endpage = flatten_endpage; + f->finish = flatten_finish; +} diff -Nru swftools-0.9.0/lib/filters/one_big_font.c swftools-0.9.2/lib/filters/one_big_font.c --- swftools-0.9.0/lib/filters/one_big_font.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/one_big_font.c 2010-11-12 18:53:12.000000000 +0000 @@ -0,0 +1,117 @@ +/* remove_font_transform.c + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../gfxfont.h" +#include "../types.h" +#include "../mem.h" + +typedef struct _internal { + gfxfontlist_t*fonts; + gfxfont_t*font; + int num_glyphs; +} internal_t; + +typedef struct _fontdata { + gfxfont_t*font; + int start; +} fontdata_t; + +static void pass1_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + fontdata_t*d = gfxfontlist_getuserdata(i->fonts, font->id); + if(!d) { + d = rfx_calloc(sizeof(fontdata_t)); + d->font = font; + d->start = i->num_glyphs; + i->num_glyphs += font->num_glyphs; + i->fonts = gfxfontlist_addfont2(i->fonts, font, d); + } + out->drawchar(out, font, glyphnr, color, matrix); +} +static gfxresult_t*pass1_finish(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxfont_t*font = i->font = rfx_calloc(sizeof(gfxfont_t)); + font->id = strdup("onebigfont"); + font->num_glyphs = i->num_glyphs; + font->glyphs = rfx_calloc(sizeof(gfxglyph_t)*i->num_glyphs); + gfxfontlist_t*l = i->fonts; + while(l) { + gfxfont_t*old = l->font; + fontdata_t*d = l->user; + memcpy(font->glyphs + d->start, old->glyphs, sizeof(gfxglyph_t)*old->num_glyphs); + if(old->ascent > font->ascent) + font->ascent = old->ascent; + if(old->descent > font->descent) + font->descent = old->descent; + l = l->next; + } + gfxfont_fix_unicode(font, 0); + return out->finish(out); +} + +static void pass2_addfont(gfxfilter_t*f, gfxfont_t*font, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + out->addfont(out, i->font); +} +static void pass2_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + fontdata_t*d = gfxfontlist_getuserdata(i->fonts, font->id); + out->drawchar(out, i->font, glyphnr + d->start, color, matrix); +} +static gfxresult_t*pass2_finish(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + // clean up + gfxfontlist_t*l = i->fonts; + while(l) { + free(l->user);l->user=0; + l=l->next; + } + gfxfontlist_free(i->fonts, 0);i->fonts=0; + return out->finish(out); +} + +void gfxtwopassfilter_one_big_font_init(gfxtwopassfilter_t*f) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + + memset(f, 0, sizeof(gfxtwopassfilter_t)); + f->type = gfxfilter_twopass; + + f->pass1.name = "filter \"one big font\" pass 1"; + f->pass1.drawchar = pass1_drawchar; + f->pass1.finish = pass1_finish; + f->pass1.internal = i; + + f->pass2.name = "filter \"one big font\" pass 2"; + f->pass2.addfont = pass2_addfont; + f->pass2.drawchar = pass2_drawchar; + f->pass2.finish = pass2_finish; + f->pass2.internal = i; +} + diff -Nru swftools-0.9.0/lib/filters/remove_font_transforms.c swftools-0.9.2/lib/filters/remove_font_transforms.c --- swftools-0.9.0/lib/filters/remove_font_transforms.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/remove_font_transforms.c 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,326 @@ +/* remove_font_transform.c + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../gfxfont.h" +#include "../types.h" +#include "../mem.h" +#include "../q.h" +#include "../log.h" + +typedef struct _mymatrix { + float m00,m01,m10,m11; + char*id; + unsigned char alpha; +} mymatrix_t; + +static void* mymatrix_clone(const void*_m) { + if(_m==0) + return 0; + const mymatrix_t*m1=_m; + mymatrix_t*m2 = malloc(sizeof(mymatrix_t)); + *m2 = *m1; + m2->id = strdup(m1->id); + return m2; +} +static unsigned int mymatrix_hash(const void*_m) { + if(!_m) + return 0; + const mymatrix_t*m = (mymatrix_t*)_m; + unsigned int h=0; + h = crc32_add_bytes(h, (char*)&m->m00, sizeof(m->m00)); + h = crc32_add_bytes(h, (char*)&m->m01, sizeof(m->m01)); + h = crc32_add_bytes(h, (char*)&m->m10, sizeof(m->m10)); + h = crc32_add_bytes(h, (char*)&m->m11, sizeof(m->m11)); + h = crc32_add_bytes(h, (char*)&m->alpha, 1); + h = crc32_add_string(h, m->id); + return h; +} +static void mymatrix_destroy(void*_m) { + mymatrix_t*m = (mymatrix_t*)_m; + free(m->id);m->id=0; + free(m); +} +static char mymatrix_equals(const void*_m1, const void*_m2) { + const mymatrix_t*m1=_m1; + const mymatrix_t*m2=_m2; + if(!m1 || !m2) + return m1==m2; + + /* we do a binary comparison of the float32 + bits here instead of a numerical comparison + to prevent the compiler from e.g. removing the + (float) cast during optimization, which would break + the equivalence between equals() and hash() (as + the hash is derived from the float32 values) */ + return *(U32*)&m1->m00 == *(U32*)&m2->m00 && + *(U32*)&m1->m01 == *(U32*)&m2->m01 && + *(U32*)&m1->m10 == *(U32*)&m2->m10 && + *(U32*)&m1->m11 == *(U32*)&m2->m11 && + m1->alpha == m2->alpha && + !strcmp(m1->id, m2->id); +} +type_t mymatrix_type = { + dup: mymatrix_clone, + hash: mymatrix_hash, + free: mymatrix_destroy, + equals: mymatrix_equals +}; + +typedef struct _internal { + dict_t*matrices; + char first; +} internal_t; + + +#ifdef __GNUC__ +int __attribute__((noinline)) + matrix_convert(gfxmatrix_t*in, const char*id, mymatrix_t*out, gfxmatrix_t*scalematrix, unsigned char alpha) +#else +int matrix_convert(gfxmatrix_t*in, const char*id, mymatrix_t*out, gfxmatrix_t*scalematrix, unsigned char alpha) +#endif +{ + double l1 = sqrt(in->m00 * in->m00 + in->m01 * in->m01); + double l2 = sqrt(in->m10 * in->m10 + in->m11 * in->m11); + double l = (l1+l2)/2.0; + if(l < 1e-10) { + memset(out, 0, sizeof(*out)); + return 0; + } + out->m00 = in->m00 / l; + out->m10 = in->m10 / l; + out->m01 = -in->m01 / l; + out->m11 = -in->m11 / l; + out->id = (char*)id; + out->alpha = alpha?1:0; + + if(scalematrix) { + scalematrix->m00 = l; + scalematrix->m01 = 0; + scalematrix->m10 = 0; + scalematrix->m11 = -l; + scalematrix->tx = in->tx; + scalematrix->ty = in->ty; + } + return 1; +} + +typedef struct _matrixdata { + gfxfontlist_t*fonts; +} matrixdata_t; + +typedef struct _transformedfont { + gfxfont_t*orig; + gfxfont_t*font; + mymatrix_t matrix; + int*used; + double dx; +} transformedfont_t; + +static transformedfont_t* transformedfont_new(gfxfont_t*orig, mymatrix_t*m) +{ + transformedfont_t*f = rfx_calloc(sizeof(transformedfont_t)); + f->orig = orig; + f->matrix = *m; + f->used = rfx_calloc(sizeof(f->used[0])*orig->num_glyphs); + int t; + for(t=0;tnum_glyphs;t++) { + if(orig->glyphs[t].unicode==32 && + (!orig->glyphs[t].line || + !orig->glyphs[t].line->next || + !orig->glyphs[t].line->next->next)) + f->used[t]=1; //always preserve the space char in fonts + } + return f; +} + +static void pass1_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + mymatrix_t m; + if(!font->id) + msg(" Font has no ID"); + if(!matrix_convert(matrix, font->id?font->id:"unknown", &m, 0, color->a)) + return; + transformedfont_t*fd = dict_lookup(i->matrices, &m); + if(!fd) { + fd = transformedfont_new(font, &m); + dict_put(i->matrices, &m, fd); + } + fd->used[glyphnr]=1; + out->drawchar(out, font, glyphnr, color, matrix); +} + +static void glyph_transform(gfxglyph_t*g, mymatrix_t*mm) +{ + gfxmatrix_t m; + m.m00 = mm->m00; + m.m01 = mm->m01; + m.m10 = mm->m10; + m.m11 = mm->m11; + m.tx = 0; + m.ty = 0; + if(m.m00>0) + g->advance *= m.m00; + g->line = gfxline_clone(g->line); + gfxline_transform(g->line, &m); +} + +static gfxresult_t* pass1_finish(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + DICT_ITERATE_DATA(i->matrices, transformedfont_t*, fd) { + gfxfont_t*font = fd->font = rfx_calloc(sizeof(gfxfont_t)); + char id[80]; + static int fontcount=0; + sprintf(id, "font%d", fontcount++); + font->id = strdup(id); + int t; + int count=0; + for(t=0;torig->num_glyphs;t++) { + if(fd->used[t]) + count++; + } + font->num_glyphs = count; + font->glyphs = rfx_calloc(sizeof(gfxglyph_t)*font->num_glyphs); + count = 0; + for(t=0;torig->num_glyphs;t++) { + if(fd->used[t]) { + font->glyphs[count] = fd->orig->glyphs[t]; + glyph_transform(&font->glyphs[count], &fd->matrix); + fd->used[t] = count + 1; + count++; + } + } + + /* adjust the origin so that every character is to the + right of the origin */ + gfxbbox_t total = {0,0,0,0}; + double average_xmax = 0; + for(t=0;tglyphs[t].line; + gfxbbox_t b = gfxline_getbbox(line); + total = gfxbbox_expand_to_bbox(total, b); + } + if(count) + average_xmax /= count; + + fd->dx = 0;//-total.xmin; + + font->ascent = total.ymax; + font->descent = -total.ymin; + + for(t=0;tglyphs[t]; + gfxline_t*line = font->glyphs[t].line; + + if(fd->matrix.alpha) { + while(line) { + line->x += fd->dx; + line->sx += fd->dx; + line = line->next; + } + } else { + gfxline_free(g->line); + /* for OCR: remove the outlines of characters that are only + ever displayed with alpha=0 */ + g->line = (gfxline_t*)rfx_calloc(sizeof(gfxline_t)); + g->line->type = gfx_moveTo; + g->line->x = g->advance; + } + } + + gfxfont_fix_unicode(font, 1); + } + return out->finish(out); +} + +static void pass2_addfont(gfxfilter_t*f, gfxfont_t*font, gfxdevice_t*out) +{ + /* we throw away original fonts, and do the addfont() for the transformed + fonts in the first drawchar() */ +} + +static void pass2_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*_color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxcolor_t color = *_color; + + if(i->first) { + i->first = 0; + DICT_ITERATE_DATA(i->matrices, transformedfont_t*, fd) { + out->addfont(out, fd->font); + } + } + + mymatrix_t m; + gfxmatrix_t scalematrix; + matrix_convert(matrix, font->id?font->id:"unknown", &m, &scalematrix, color.a); + transformedfont_t*d = dict_lookup(i->matrices, &m); + scalematrix.tx -= d->dx*scalematrix.m00; + + /* if this character is invisible (alpha=0), then we will have removed the + outline, so we make set the alpha color channel to "fully visible" again to allow + output devices to be more performant (transparency is expensive) */ + if(!m.alpha) + color.a = 255; + + out->drawchar(out, d->font, d->used[glyphnr]-1, &color, &scalematrix); +} + +static gfxresult_t* pass2_finish(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + DICT_ITERATE_DATA(i->matrices, transformedfont_t*, fd) { + if(fd->used) { + free(fd->used);fd->used=0; + } + free(fd); + } + dict_destroy(i->matrices);i->matrices=0; + return out->finish(out); +} + +void gfxtwopassfilter_remove_font_transforms_init(gfxtwopassfilter_t*f) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + + memset(f, 0, sizeof(gfxtwopassfilter_t)); + f->type = gfxfilter_twopass; + + f->pass1.name = "remove font transforms pass 1"; + f->pass1.drawchar = pass1_drawchar; + f->pass1.finish = pass1_finish; + f->pass1.internal = i; + + f->pass2.name = "remove font transforms pass 2"; + f->pass2.addfont = pass2_addfont; + f->pass2.drawchar = pass2_drawchar; + f->pass2.finish = pass2_finish; + f->pass2.internal = i; + + i->matrices = dict_new2(&mymatrix_type); + i->first = 1; +} + diff -Nru swftools-0.9.0/lib/filters/remove_invisible_characters.c swftools-0.9.2/lib/filters/remove_invisible_characters.c --- swftools-0.9.0/lib/filters/remove_invisible_characters.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/remove_invisible_characters.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,242 @@ +/* remove_invisible_characters.c + + Part of the swftools package. + + Copyright (c) 2011 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../gfxfont.h" +#include "../gfxpoly.h" +#include "../gfximage.h" +#include "../types.h" +#include "../mem.h" +#include "../devices/render.h" + +typedef struct _page { + uint8_t* visible; + int size8; + int size; + struct _page*next; +} page_t; + +typedef struct _internal { + gfxdevice_t render; + int count; + + double area; + + page_t*first_page; + page_t*last_page; + + page_t*current_page; +} internal_t; + +static gfxcolor_t black = {255,0,0,0}; + +static void pass1_startpage(gfxfilter_t*f, int width, int height, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxdevice_render_init(&i->render); + i->render.startpage(&i->render, width, height); + out->startpage(out, width, height); + i->count = 0; +} +static void pass1_endpage(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->render.endpage(&i->render); + out->endpage(out); + gfxresult_t*result = i->render.finish(&i->render); + + page_t*page = (page_t*)rfx_calloc(sizeof(page_t)); + if(!i->first_page) { + i->first_page = i->last_page = i->current_page = page; + } else { + i->last_page->next = page; + i->last_page = page; + } + page->size = i->count + 1; + page->size8 = (page->size+7) >> 3; + page->visible = (uint8_t*)rfx_calloc(page->size8); + + gfximage_t*img = (gfximage_t*)result->get(result, "page0"); + int size = img->width*img->height; + int t; + for(t=0;tdata[t])>>8); + page->visible[index>>3] |= (1<<(index&7)); + } + result->destroy(result); +} +static void pass1_fill(gfxfilter_t*f, gfxline_t*line, gfxcolor_t*color, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + if(color->a == 255) { + i->render.fill(&i->render, line, &black); + } + out->fill(out, line, color); +} +static void pass1_stroke(gfxfilter_t*f, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + if(color->a == 255) { + i->render.stroke(&i->render, line, width, &black, cap_style, joint_style, miterLimit); + } + out->stroke(out, line, width, color, cap_style, joint_style, miterLimit); +} +static void pass1_fillbitmap(gfxfilter_t*f, gfxline_t*line, gfximage_t* bitmap, gfxmatrix_t*imgcoord2devcoord, gfxcxform_t*cxform, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfximage_t*img = gfximage_new(bitmap->width, bitmap->height); + int size = img->width*img->height; + memset(img->data, 0, size*sizeof(gfxcolor_t)); + int t; + for(t=0;tdata[t].a = bitmap->data[t].a == 255 ? 255 : 0; + } + i->render.fillbitmap(&i->render, line, img, imgcoord2devcoord, 0); + gfximage_free(img); + out->fillbitmap(out, line, bitmap, imgcoord2devcoord, cxform); +} +static void pass1_fillgradient(gfxfilter_t*f, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*gradcoord2devcoord, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->render.fill(&i->render, line, &black); + out->fillgradient(out, line, gradient, type, gradcoord2devcoord); +} +static void pass1_startclip(gfxfilter_t*f, gfxline_t*line, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->render.startclip(&i->render, line); + out->startclip(out, line); +} +static void pass1_endclip(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->render.endclip(&i->render); + out->endclip(out); +} +static void pass1_addfont(gfxfilter_t*f, gfxfont_t*font, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + /* Don't pass this to device->render(). We're not in a page + yet, and the render device doesn't need addfont() */ + //i->render.addfont(&i->render, font); + out->addfont(out, font); +} +static void pass1_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->count++; + gfxcolor_t c; + *(uint32_t*)&c = i->count<<8|0xff; + + double advance = font->glyphs[glyphnr].advance; + gfxline_t*box = gfxline_makerectangle(0,0,advance,font->ascent); + gfxline_transform(box, matrix); + i->render.fill(&i->render, box, &c); + if(font->ascent < 512) { + i->render.drawchar(&i->render, font, glyphnr, &c, matrix); + } + gfxline_free(box); + + out->drawchar(out, font, glyphnr, color, matrix); +} +static gfxresult_t*pass1_finish(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + return out->finish(out); +} + +static void pass2_startpage(gfxfilter_t*f, int width, int height, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + out->startpage(out, width, height); + i->count = 0; +} +static void pass2_endpage(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->current_page = i->current_page->next; + out->endpage(out); +} +static void pass2_addfont(gfxfilter_t*f, gfxfont_t*font, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + out->addfont(out, font); +} +static void pass2_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + i->count++; + if(i->current_page->visible[i->count>>3]&(1<<(i->count&7))) { + out->drawchar(out, font, glyphnr, color, matrix); + } else { +#ifdef DEBUG_AREA + gfxline_t*line = gfxline_clone(font->glyphs[glyphnr].line); + gfxline_transform(line, matrix); + gfxpoly_t*poly = gfxpoly_from_fill(line, 0.05); + double area = gfxpoly_area(poly); + gfxpoly_destroy(poly); + gfxline_free(line); + i->area += area; +#endif + } +} +static gfxresult_t*pass2_finish(gfxfilter_t*f, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; +#ifdef DEBUG_AREA + printf("%f\n", i->area); +#endif + return out->finish(out); +} + +void gfxtwopassfilter_remove_invisible_characters_init(gfxtwopassfilter_t*f) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + + memset(f, 0, sizeof(gfxtwopassfilter_t)); + f->type = gfxfilter_twopass; + + f->pass1.name = "filter \"remove invisible characters\" pass 1"; + f->pass1.addfont = pass1_addfont; + f->pass1.drawchar = pass1_drawchar; + f->pass1.fill = pass1_fill; + f->pass1.fillbitmap = pass1_fillbitmap; + f->pass1.fillgradient = pass1_fillgradient; + f->pass1.stroke = pass1_stroke; + f->pass1.startclip= pass1_startclip; + f->pass1.endclip = pass1_endclip; + f->pass1.startpage = pass1_startpage; + f->pass1.endpage = pass1_endpage; + f->pass1.finish = pass1_finish; + f->pass1.internal = i; + + f->pass2.name = "filter \"remove invisible characters\" pass 2"; + f->pass2.addfont = pass2_addfont; + f->pass2.drawchar = pass2_drawchar; + f->pass2.startpage = pass2_startpage; + f->pass2.endpage = pass2_endpage; + f->pass2.finish = pass2_finish; + f->pass2.internal = i; +} + diff -Nru swftools-0.9.0/lib/filters/rescale_images.c swftools-0.9.2/lib/filters/rescale_images.c --- swftools-0.9.0/lib/filters/rescale_images.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/rescale_images.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,106 @@ +/* rescale_images.c + + Part of the swftools package. + + Copyright (c) 2011 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include +#include "../mem.h" +#include "../gfxdevice.h" +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../gfximage.h" +#include "../log.h" + +typedef struct _internal { + double config_subpixels; +} internal_t; + +int rescale_images_setparameter(gfxfilter_t*dev, const char*key, const char*value, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)dev->internal; + if(!strcmp(key, "subpixels")) { + i->config_subpixels = atof(value); + } + return out->setparameter(out,key,value); +} + +void rescale_images_startpage(gfxfilter_t*dev, int width, int height, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)dev->internal; + out->startpage(out,width,height); +} + +void rescale_images_fillbitmap(gfxfilter_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)dev->internal; + + if(img->width<=0 || img->height<=0) + return; + + int target_width = (int)(sqrt(matrix->m00*matrix->m00 + matrix->m01*matrix->m01)*img->width); + int target_height = (int)(sqrt(matrix->m10*matrix->m10 + matrix->m11*matrix->m11)*img->height); + + int new_width = (int)ceil(target_width*i->config_subpixels); + int new_height = (int)ceil(target_height*i->config_subpixels); + + if(new_width<=0) + new_width = 1; + if(new_height<=0) + new_height = 1; + + if(new_width < img->width || new_height < img->height) { + msg(" Scaling %dx%d image to %dx%d", img->width, img->height, new_width, new_height); + gfximage_t*new_image = gfximage_rescale(img, new_width, new_height); + gfxmatrix_t m = *matrix; + m.m00 = (m.m00 * img->width) / new_width; + m.m01 = (m.m01 * img->width) / new_width; + m.m10 = (m.m10 * img->height) / new_height; + m.m11 = (m.m11 * img->height) / new_height; + out->fillbitmap(out, line, new_image, &m, cxform); + gfximage_free(new_image); + } else { + out->fillbitmap(out, line, img, matrix, cxform); + } +} + +gfxresult_t* rescale_images_finish(gfxfilter_t*dev, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)dev->internal; + free(i);dev->internal = 0; + return out->finish(out); +} + +void gfxfilter_rescale_images_init(gfxfilter_t*f) +{ + memset(f, 0, sizeof(gfxfilter_t)); + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + + i->config_subpixels = 1.0; + + f->internal = i; + f->name = "rescale_images"; + f->type = gfxfilter_onepass; + + f->fillbitmap = rescale_images_fillbitmap; + f->finish = rescale_images_finish; +} diff -Nru swftools-0.9.0/lib/filters/vectors_to_glyphs.c swftools-0.9.2/lib/filters/vectors_to_glyphs.c --- swftools-0.9.0/lib/filters/vectors_to_glyphs.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/filters/vectors_to_glyphs.c 2010-11-12 18:53:09.000000000 +0000 @@ -0,0 +1,165 @@ +/* vectors_to_fonts.c + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include "../gfxfilter.h" +#include "../gfxtools.h" +#include "../gfxpoly.h" +#include "../gfxfont.h" +#include "../types.h" +#include "../mem.h" +#include "../q.h" + +typedef struct _vglyph { + gfxglyph_t glyph; + struct _vglyph*next; +} vglyph_t; + +typedef struct _internal { + vglyph_t*first_glyph; + vglyph_t*last_glyph; + gfxfont_t*font; + char first; + int glyph_nr; +} internal_t; + +#define FONT_SIZE 1024.0 + +static void pass1_fill(gfxfilter_t*f, gfxline_t*line, gfxcolor_t*color, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + gfxbbox_t bbox = gfxline_getbbox(line); + double height = bbox.ymax - bbox.ymin; + double width = bbox.xmax - bbox.xmin; + double size = fmax(width,height); + if(fabs(size) < 1e-3) return; + double scale = FONT_SIZE/size; + gfxmatrix_t m = {scale, 0, -bbox.xmin*scale, + 0, scale, -bbox.ymax*scale}; + line = gfxline_clone(line); + gfxline_transform(line, &m); + line = gfxline_restitch(line); + vglyph_t*v = rfx_calloc(sizeof(vglyph_t)); + v->glyph.line = line; + v->glyph.advance = width*scale; + v->glyph.unicode = 32+i->glyph_nr; + + i->last_glyph->next = v; + i->last_glyph = v; + + gfxmatrix_t m2 = {1.0/scale, 0, bbox.xmin, + 0, 1.0/scale, bbox.ymax}; + out->drawchar(out, 0, i->glyph_nr, color, &m2); + + i->glyph_nr++; +} +static void pass1_stroke(gfxfilter_t*f, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, gfxdevice_t*out) +{ + return; + internal_t*i = (internal_t*)f->internal; + gfxpoly_t*poly = gfxpoly_from_stroke(line, width, cap_style, joint_style, miterLimit, DEFAULT_GRID); + gfxline_t*line2 = gfxline_from_gfxpoly_with_direction(poly); + pass1_fill(f, line2, color, out); + gfxline_free(line2); + gfxpoly_destroy(poly); +} + +static void make_font(internal_t*i) +{ + i->font = rfx_calloc(sizeof(gfxfont_t)); + i->font->id = "SWFTools-Vector-Magic"; + i->font->num_glyphs = i->glyph_nr; + i->font->glyphs = malloc(sizeof(gfxglyph_t)*i->font->num_glyphs); + i->font->ascent = FONT_SIZE; + i->font->descent = 0; + int pos = 0; + vglyph_t*g = i->first_glyph; + while(g) { + i->font->glyphs[pos] = g->glyph; + pos++; + g = g->next; + } + gfxfont_fix_unicode(i->font, 1); +} + +static void pass2_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)f->internal; + if(i->first) { + make_font(i); + out->addfont(out, i->font); + i->first = 0; + } + if(!font) { + font = i->font; + + gfxcolor_t red = {255,254,1,1}; + int x; + gfxmatrix_t m = {1.0, 0,0, + 0, 1.0,0}; + out->drawchar(out, font, 1, &red, &m); + + /*gfxmatrix_t m2 = {1.0, 0,600, + 0, 1.0,600}; + out->drawchar(out, font, 1, &red, &m2);*/ + gfxline_t*line = gfxline_makerectangle(0, 0, 1, 1); + gfximage_t img; + img.data = color; + img.width = 1; + img.height = 1; + out->fillbitmap(out, line, &img, &m, 0); + } + out->drawchar(out, font, glyphnr, color, matrix); +} + +void gfxtwopassfilter_vectors_to_glyphs_init(gfxtwopassfilter_t*f) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + + memset(f, 0, sizeof(gfxtwopassfilter_t)); + f->type = gfxfilter_twopass; + + f->pass1.name = "vectors to glyphs pass 1"; + f->pass1.fill = pass1_fill; + f->pass1.stroke = pass1_stroke; + f->pass1.internal = i; + + f->pass2.name = "vectors to glyphs pass 2"; + f->pass2.drawchar = pass2_drawchar; + f->pass2.internal = i; + + i->first = 1; + + i->first_glyph = rfx_calloc(sizeof(vglyph_t)); + i->first_glyph->glyph.line = 0; + i->first_glyph->glyph.advance = FONT_SIZE; + i->first_glyph->glyph.unicode = 32; + i->last_glyph = rfx_calloc(sizeof(vglyph_t)); + // dummy char + i->first_glyph->next = i->last_glyph; + i->last_glyph->glyph.line = 0; + i->last_glyph->glyph.advance = FONT_SIZE/8; + i->last_glyph->glyph.unicode = 33; + i->glyph_nr = 2; +} + + diff -Nru swftools-0.9.0/lib/gfxdevice.h swftools-0.9.2/lib/gfxdevice.h --- swftools-0.9.0/lib/gfxdevice.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/gfxdevice.h 2011-01-02 03:30:29.000000000 +0000 @@ -61,8 +61,8 @@ /* if the data contains an alpha layer (a != 255), the r,g,b values will have to be premultiplied */ gfxcolor_t*data; - int width; - int height; + unsigned width; + unsigned height; } gfximage_t; /* gradients: A radial gradient will start at 0,0 and have a radius of 1,0 @@ -111,14 +111,17 @@ void (*endclip)(struct _gfxdevice*dev); void (*stroke)(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit); void (*fill)(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color); + + /* expects alpha channel in image to be non-premultiplied */ void (*fillbitmap)(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*imgcoord2devcoord, gfxcxform_t*cxform); //cxform? tiling? + void (*fillgradient)(struct _gfxdevice*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*gradcoord2devcoord); //? - /* deprecated */ void (*addfont)(struct _gfxdevice*dev, gfxfont_t*font); + void (*addfont)(struct _gfxdevice*dev, gfxfont_t*font); void (*drawchar)(struct _gfxdevice*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix); - void (*drawlink)(struct _gfxdevice*dev, gfxline_t*line, const char*action); + void (*drawlink)(struct _gfxdevice*dev, gfxline_t*line, const char*action, const char*text); void (*endpage)(struct _gfxdevice*dev); diff -Nru swftools-0.9.0/lib/gfxfilter.c swftools-0.9.2/lib/gfxfilter.c --- swftools-0.9.0/lib/gfxfilter.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxfilter.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,448 @@ +/* gfxfilter.c + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include "mem.h" +#include "gfxfilter.h" +#include "devices/record.h" +#include "q.h" + +typedef struct _internal { + gfxfilter_t*filter; + gfxdevice_t*out; + + /* for two pass filters: */ + gfxdevice_t*final_out; + int pass; + int num_passes; + gfxdevice_t record; + gfxtwopassfilter_t*twopass; +} internal_t; + +static int filter_setparameter(gfxdevice_t*dev, const char*key, const char*value) +{ + internal_t*i = (internal_t*)dev->internal; + return i->filter->setparameter(i->filter, key, value, i->out); +} +static void filter_startpage(gfxdevice_t*dev, int width, int height) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->startpage(i->filter, width, height, i->out); +} +static void filter_startclip(gfxdevice_t*dev, gfxline_t*line) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->startclip(i->filter, line, i->out); +} +static void filter_endclip(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->endclip(i->filter, i->out); +} +static void filter_stroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->stroke(i->filter, line, width, color, cap_style, joint_style, miterLimit, i->out); +} +static void filter_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->fill(i->filter, line, color, i->out); +} +static void filter_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->fillbitmap(i->filter, line, img, matrix, cxform, i->out); +} +static void filter_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->fillgradient(i->filter, line, gradient, type, matrix, i->out); +} +static void filter_addfont(gfxdevice_t*dev, gfxfont_t*font) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->addfont(i->filter, font, i->out); +} +static void filter_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->drawchar(i->filter, font, glyphnr, color, matrix, i->out); +} +static void filter_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->drawlink(i->filter, line, action, text, i->out); +} +static void filter_endpage(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + i->filter->endpage(i->filter, i->out); +} +static gfxresult_t* filter_finish(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + gfxresult_t*r; + if(i->filter->finish) { + r = i->filter->finish(i->filter, i->out); + } else { + r = i->out->finish(i->out); + } + if(i->filter->internal) { + free(i->filter->internal); + i->filter->internal = 0; + } + free(i->filter);i->filter=0; + free(dev->internal);dev->internal=0;free(dev); + return r; +} + + +static int passthrough_setparameter(gfxdevice_t*dev, const char*key, const char*value) +{ + internal_t*i = (internal_t*)dev->internal; + return i->out->setparameter(i->out, key, value); +} +static void passthrough_startpage(gfxdevice_t*dev, int width, int height) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->startpage(i->out, width, height); +} +static void passthrough_startclip(gfxdevice_t*dev, gfxline_t*line) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->startclip(i->out, line); +} +static void passthrough_endclip(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->endclip(i->out); +} +static void passthrough_stroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->stroke(i->out, line, width, color, cap_style, joint_style, miterLimit); +} +static void passthrough_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->fill(i->out, line, color); +} +static void passthrough_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->fillbitmap(i->out, line, img, matrix, cxform); +} +static void passthrough_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->fillgradient(i->out, line, gradient, type, matrix); +} +static void passthrough_addfont(gfxdevice_t*dev, gfxfont_t*font) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->addfont(i->out, font); +} +static void passthrough_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->drawchar(i->out, font, glyphnr, color, matrix); +} +static void passthrough_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->drawlink(i->out, line, action, text); +} +static void passthrough_endpage(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + i->out->endpage(i->out); +} + +int discard_setparameter(gfxdevice_t*dev, const char*key, const char*value) +{ + return 0; +} +static void discard_startpage(gfxdevice_t*dev, int width, int height) +{ +} +static void discard_startclip(gfxdevice_t*dev, gfxline_t*line) +{ +} +static void discard_endclip(gfxdevice_t*dev) +{ +} +static void discard_stroke(gfxdevice_t*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit) +{ +} +static void discard_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color) +{ +} +static void discard_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform) +{ +} +static void discard_fillgradient(gfxdevice_t*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix) +{ +} +static void discard_addfont(gfxdevice_t*dev, gfxfont_t*font) +{ +} +static void discard_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) +{ +} +static void discard_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) +{ +} +static void discard_endpage(gfxdevice_t*dev) +{ +} +static gfxresult_t* discard_finish(gfxdevice_t*dev) +{ + return 0; +} + +gfxdevice_t*gfxfilter_apply(gfxfilter_t*_filter, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + gfxdevice_t*dev = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); + gfxfilter_t*filter = (gfxfilter_t*)rfx_alloc(sizeof(gfxfilter_t)); + memcpy(filter, _filter, sizeof(gfxfilter_t)); + + i->out = out; + i->filter = filter; + i->pass = 1; + + dev->internal = i; + dev->name = filter->name?filter->name:"filter"; + dev->setparameter = filter->setparameter?filter_setparameter:passthrough_setparameter; + dev->startpage = filter->startpage?filter_startpage:passthrough_startpage; + dev->startclip = filter->startclip?filter_startclip:passthrough_startclip; + dev->endclip = filter->endclip?filter_endclip:passthrough_endclip; + dev->stroke = filter->stroke?filter_stroke:passthrough_stroke; + dev->fill = filter->fill?filter_fill:passthrough_fill; + dev->fillbitmap = filter->fillbitmap?filter_fillbitmap:passthrough_fillbitmap; + dev->fillgradient = filter->fillgradient?filter_fillgradient:passthrough_fillgradient; + dev->addfont = filter->addfont?filter_addfont:passthrough_addfont; + dev->drawchar = filter->drawchar?filter_drawchar:passthrough_drawchar; + dev->drawlink = filter->drawlink?filter_drawlink:passthrough_drawlink; + dev->endpage = filter->endpage?filter_endpage:passthrough_endpage; + dev->finish = filter_finish; + return dev; +} + +static void setup_twopass(gfxdevice_t*dev, gfxfilter_t*filter) +{ + dev->name = filter->name?filter->name:"filter"; + dev->setparameter = filter->setparameter?filter_setparameter:passthrough_setparameter; + dev->startpage = filter->startpage?filter_startpage:passthrough_startpage; + dev->startclip = filter->startclip?filter_startclip:passthrough_startclip; + dev->endclip = filter->endclip?filter_endclip:passthrough_endclip; + dev->stroke = filter->stroke?filter_stroke:passthrough_stroke; + dev->fill = filter->fill?filter_fill:passthrough_fill; + dev->fillbitmap = filter->fillbitmap?filter_fillbitmap:passthrough_fillbitmap; + dev->fillgradient = filter->fillgradient?filter_fillgradient:passthrough_fillgradient; + dev->addfont = filter->addfont?filter_addfont:passthrough_addfont; + dev->drawchar = filter->drawchar?filter_drawchar:passthrough_drawchar; + dev->drawlink = filter->drawlink?filter_drawlink:passthrough_drawlink; + dev->endpage = filter->endpage?filter_endpage:passthrough_endpage; +} + +static gfxresult_t* twopass_finish(gfxdevice_t*dev) +{ + internal_t*i = (internal_t*)dev->internal; + + gfxresult_t*r; + if(i->filter->finish) { + r = i->filter->finish(i->filter, i->out); + } else { + r = i->out->finish(i->out); + } + + if(i->pass == i->num_passes) { + free(i->twopass); + i->twopass = 0; + i->filter = 0; + free(i); + dev->internal=0; + free(dev); + return r; + } + + /* switch to next pass filter */ + i->filter = &i->twopass->pass2; + setup_twopass(dev, i->filter); + dev->finish = twopass_finish; + + if(i->pass == i->num_passes-1) { + /* we don't record in the final pass- we just stream out to the + next output device */ + i->out = i->final_out; + } else { + // switch to a new tempfile- this only happens for 3 passes or more + assert(i->num_passes>2); + gfxdevice_record_init(&i->record, /*use tempfile*/1); + i->out = &i->record; + } + + i->pass++; + gfxresult_record_replay(r, dev, 0); + r->destroy(r); + + return twopass_finish(dev); +} + +gfxdevice_t*gfxtwopassfilter_apply(gfxtwopassfilter_t*_twopass, gfxdevice_t*out) +{ + internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t)); + gfxdevice_t*dev = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); + + gfxtwopassfilter_t*twopass = (gfxtwopassfilter_t*)rfx_alloc(sizeof(gfxtwopassfilter_t)); + memcpy(twopass, _twopass, sizeof(gfxtwopassfilter_t)); + + gfxdevice_record_init(&i->record, /*use tempfile*/1); + + i->out = &i->record; + i->final_out = out; + i->twopass = twopass; + i->pass = 1; + i->num_passes = 2; + + dev->internal = i; + + i->filter = &twopass->pass1; + setup_twopass(dev, i->filter); + dev->finish = twopass_finish; + + return dev; +} + +static void add_to_chain(char*cmd, dict_t*params, gfxfilterchain_t**chain, gfxfilterchain_t**next) +{ + gfxfilterbase_t*f = 0; + if(!strcmp(cmd, "maketransparent")) { + char*alphastr = dict_lookup(params, "alpha"); + int alpha = 255; + if(alphastr) alpha=atoi(alphastr); + f = malloc(sizeof(gfxfilter_t)); + gfxfilter_maketransparent_init((gfxfilter_t*)f, alpha); + } else if(!strcmp(cmd, "flatten")) { + f = malloc(sizeof(gfxfilter_t)); + gfxfilter_flatten_init((gfxfilter_t*)f); + } else if(!strcmp(cmd, "rescale_images")) { + f = malloc(sizeof(gfxfilter_t)); + gfxfilter_rescale_images_init((gfxfilter_t*)f); + } else if(!strcmp(cmd, "remove_font_transforms")) { + f = malloc(sizeof(gfxtwopassfilter_t)); + gfxtwopassfilter_remove_font_transforms_init((gfxtwopassfilter_t*)f); + } else if(!strcmp(cmd, "remove_invisible_characters")) { + f = malloc(sizeof(gfxtwopassfilter_t)); + gfxtwopassfilter_remove_invisible_characters_init((gfxtwopassfilter_t*)f); + } else if(!strcmp(cmd, "vectors_to_glyphs")) { + f = malloc(sizeof(gfxtwopassfilter_t)); + gfxtwopassfilter_vectors_to_glyphs_init((gfxtwopassfilter_t*)f); + } else if(!strcmp(cmd, "one_big_font")) { + f = malloc(sizeof(gfxtwopassfilter_t)); + gfxtwopassfilter_one_big_font_init((gfxtwopassfilter_t*)f); + } else { + fprintf(stderr, "Unknown filter: %s\n", cmd); + } + dict_clear(params); + gfxfilterchain_t*n = rfx_calloc(sizeof(gfxfilterchain_t)); + if(!(*chain)) { + (*chain) = (*next) = n; + } else { + (*next)->next = n; + (*next) = n; + } + n->filter = f; +} + +gfxfilterchain_t* gfxfilterchain_parse(const char*_filterexpr) +{ + char*filterexpr = strdup(_filterexpr); + char*f = filterexpr; + char*end = filterexpr+strlen(filterexpr); + dict_t* params = dict_new2(&charptr_type); + char*cmd = 0; + + gfxfilterchain_t*chain = 0; + gfxfilterchain_t*next = 0; + + while(*f) { + char* eq = strchr(f, '='); + char* colon = strchr(f, ':'); + if(!colon) { + colon = end; + } + *colon = 0; + + if(eq && eq < colon) { // parameter + *eq = 0; + if(!cmd) { + fprintf(stderr, "Error: need a filter before specifying parameters (%s=%s)\n", f, eq+1); + return 0; + } + dict_put(params, f, strdup(eq+1)); + } else { + if(cmd) { + add_to_chain(cmd, params, &chain, &next); + cmd = 0; + } + cmd = f; + } + if(colon == end) + break; + f = colon+1; + } + if(cmd) { + add_to_chain(cmd, params, &chain, &next); + } + free(filterexpr); + + dict_destroy(params); + return chain; +} + +gfxdevice_t* gfxfilterchain_apply(gfxfilterchain_t*chain, gfxdevice_t*dev) +{ + while(chain) { + if(chain->filter->type == gfxfilter_onepass) { + dev = gfxfilter_apply((gfxfilter_t*)chain->filter, dev); + } else if(chain->filter->type == gfxfilter_twopass) { + dev = gfxtwopassfilter_apply((gfxtwopassfilter_t*)chain->filter, dev); + } else { + fprintf(stderr, "Internal error in gfxfilterchain_apply- unknown filter type %d\n", chain->filter->type); + } + chain = chain->next; + } + return dev; +} + +void gfxfilterchain_destroy(gfxfilterchain_t*chain) +{ + while(chain) { + gfxfilterchain_t*next = chain->next; + free(chain); + chain = next; + } +} diff -Nru swftools-0.9.0/lib/gfxfilter.h swftools-0.9.2/lib/gfxfilter.h --- swftools-0.9.0/lib/gfxfilter.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxfilter.h 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,109 @@ +/* gfxfilter.h + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __gfxfilter_h__ +#define __gfxfilter_h__ + +#include "gfxdevice.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum {gfxfilter_none, gfxfilter_onepass, gfxfilter_twopass} gfxfiltertype_t; + +typedef struct _gfxfilterbase +{ + gfxfiltertype_t type; +} gfxfilterbase_t; + +typedef struct _gfxfilter +{ + gfxfiltertype_t type; + int num_passes; + const char*name; + + int pass; + + int (*setparameter)(struct _gfxfilter*in, const char*key, const char*value, struct _gfxdevice*out); + void (*startpage)(struct _gfxfilter*in, int width, int height, struct _gfxdevice*out); + void (*startclip)(struct _gfxfilter*in, gfxline_t*line, struct _gfxdevice*out); + void (*endclip)(struct _gfxfilter*in, struct _gfxdevice*out); + void (*stroke)(struct _gfxfilter*in, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, struct _gfxdevice*out); + void (*fill)(struct _gfxfilter*in, gfxline_t*line, gfxcolor_t*color, struct _gfxdevice*out); + void (*fillbitmap)(struct _gfxfilter*in, gfxline_t*line, gfximage_t*img, gfxmatrix_t*imgcoord2devcoord, gfxcxform_t*cxform, struct _gfxdevice*out); //cxform? tiling? + void (*fillgradient)(struct _gfxfilter*in, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*gradcoord2devcoord, struct _gfxdevice*out); //? + void (*addfont)(struct _gfxfilter*in, gfxfont_t*font, struct _gfxdevice*out); + void (*drawchar)(struct _gfxfilter*in, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix, struct _gfxdevice*out); + void (*drawlink)(struct _gfxfilter*in, gfxline_t*line, const char*action, const char*text, struct _gfxdevice*out); + void (*endpage)(struct _gfxfilter*in, struct _gfxdevice*out); + gfxresult_t* (*finish)(struct _gfxfilter*in, struct _gfxdevice*out); + + void (*dealloc)(struct _gfxfilter*f); + + void* internal; +} gfxfilter_t; + +typedef struct _gfxtwopassfilter +{ + gfxfiltertype_t type; + gfxfilter_t pass1; + gfxfilter_t pass2; +} gfxtwopassfilter_t; + +gfxdevice_t*gfxfilter_apply(gfxfilter_t*filter, gfxdevice_t*dev); +gfxdevice_t*gfxtwopassfilter_apply(gfxtwopassfilter_t*filter, gfxdevice_t*dev); + +typedef struct _gfxfilterchain { + gfxfilterbase_t*filter; + struct _gfxfilterchain*next; +} gfxfilterchain_t; + +gfxfilterchain_t* gfxfilterchain_parse(const char*filterexpr); +gfxdevice_t* gfxfilterchain_apply(gfxfilterchain_t*chain, gfxdevice_t*dev); +void gfxfilterchain_destroy(gfxfilterchain_t*chain); + +#define wrap_filter(dev, name, args...) \ + {gfxfilter_t f_##name; \ + gfxfilter_##name##_init(&f_##name, ## args); \ + dev = gfxfilter_apply(&f_##name, dev); \ + } + +#define wrap_filter2(dev, name, args...) \ + {gfxtwopassfilter_t f_##name; \ + gfxtwopassfilter_##name##_init(&f_##name, ## args); \ + dev = gfxtwopassfilter_apply(&f_##name, dev); \ + } + +/* known filters */ +void gfxfilter_maketransparent_init(gfxfilter_t*f, U8 alpha); +void gfxfilter_flatten_init(gfxfilter_t*f); +void gfxfilter_rescale_images_init(gfxfilter_t*f); +void gfxtwopassfilter_remove_font_transforms_init(gfxtwopassfilter_t*f); +void gfxtwopassfilter_one_big_font_init(gfxtwopassfilter_t*f); +void gfxtwopassfilter_vectors_to_glyphs_init(gfxtwopassfilter_t*f); +void gfxtwopassfilter_remove_invisible_characters_init(gfxtwopassfilter_t*f); + +#ifdef __cplusplus +} +#endif + +#endif //__gfxfilter_h__ diff -Nru swftools-0.9.0/lib/gfxfont.c swftools-0.9.2/lib/gfxfont.c --- swftools-0.9.0/lib/gfxfont.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/gfxfont.c 2011-01-02 03:30:29.000000000 +0000 @@ -21,14 +21,29 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include +#include #include "../config.h" #include "gfxdevice.h" #include "gfxtools.h" #include "gfxfont.h" +#include "ttf.h" +#include "mem.h" +#include "log.h" static int loadfont_scale = 64; static int full_unicode = 1; +static void glyph_clear(gfxglyph_t*g) +{ + gfxline_t*line; + if(g->name) { + free((void*)g->name); g->name = 0; + } + gfxline_free(g->line);g->line = 0; +} + #ifdef HAVE_FREETYPE #ifdef HAVE_FT2BUILD_H @@ -126,20 +141,11 @@ return dest; } -static void glyph_clear(gfxglyph_t*g) -{ - gfxline_t*line; - if(g->name) { - free((void*)g->name); g->name = 0; - } - gfxline_free(g->line);g->line = 0; -} - static int errorno = 0; //#define DEBUG 1 -gfxfont_t* gfxfont_load(char*id, char*filename, unsigned int flags, double quality) +gfxfont_t* gfxfont_load(const char*id, const char*filename, unsigned int flags, double quality) { FT_Face face; FT_Error error; @@ -173,7 +179,7 @@ return 0; } if(face->num_glyphs <= 0) { - fprintf(stderr, "File %s contains %d glyphs\n", face->num_glyphs); + fprintf(stderr, "File %s contains %d glyphs\n", filename, (int)face->num_glyphs); return 0; } @@ -333,9 +339,9 @@ error = FT_Load_Glyph(face, t, FT_LOAD_NO_BITMAP); if(error) { if(hasname) - fprintf(stderr, "Warning: glyph %d/%d (unicode %d, name %s) has return code %d\n", t, face->num_glyphs, glyph2unicode[t], name, error); + fprintf(stderr, "Warning: glyph %d/%d (unicode %d, name %s) has return code %d\n", t, (int)face->num_glyphs, glyph2unicode[t], name, error); else - fprintf(stderr, "Warning: glyph %d/%d (unicode %d) has return code %d\n", t, face->num_glyphs, glyph2unicode[t], error); + fprintf(stderr, "Warning: glyph %d/%d (unicode %d) has return code %d\n", t, (int)face->num_glyphs, glyph2unicode[t], error); omit = 2; #if 0 @@ -358,7 +364,7 @@ if(!omit) { error = FT_Get_Glyph(face->glyph, &glyph); if(error) { - fprintf(stderr, "Couldn't get glyph %d/%d, error:%d\n", t, face->num_glyphs, error); + fprintf(stderr, "Couldn't get glyph %d/%d, error:%d\n", t, (int)face->num_glyphs, error); omit = 3; } } @@ -389,7 +395,7 @@ } l = l->next; } - if(!ok && !name) { + if(!ok && !hasname) { gfxline_free(font->glyphs[font->num_glyphs].line); font->glyphs[font->num_glyphs].line = 0; font->glyphs[font->num_glyphs].advance = 0; @@ -488,9 +494,10 @@ } #else -gfxfont_t* gfxfont_load(char*id, char*filename, unsigned int flags, double quality) +gfxfont_t* gfxfont_load(const char*id, const char*filename, unsigned int flags, double quality) { fprintf(stderr, "No freetype support compiled in! Not able to load %s\n", filename); + return 0; } #endif @@ -515,3 +522,249 @@ free(font); } +static inline int invalid_unicode(int u) +{ + return (u<32 || (u>=0xd800 && u<0xf900)); +} +void gfxfont_fix_unicode(gfxfont_t*font, char remove_duplicates) +{ + int t; + + /* find the current maximum unicode2glyph */ + int max = 0; + for(t=0;tnum_glyphs;t++) { + int u = font->glyphs[t].unicode; + if(u > max) + max = u; + } + char*used = rfx_calloc(max+1); + + /* now, remap all duplicates (and invalid characters) and + calculate the new maximum */ + int remap_pos=0; + max = 0; + for(t=0;tnum_glyphs;t++) { + int u = font->glyphs[t].unicode; + if(u>=0) { + if(remove_duplicates && used[u]) { + u = font->glyphs[t].unicode = 0xe000 + remap_pos++; + } if(invalid_unicode(u)) { + u = font->glyphs[t].unicode = 0xe000 + remap_pos++; + } else { + used[u] = 1; + } + } + if(u > max) + max = u; + } + free(used); + if(font->unicode2glyph) { + free(font->unicode2glyph); + } + font->unicode2glyph = 0; + font->max_unicode = 0; +} + +void gfxfont_add_unicode2glyph(gfxfont_t*font) +{ + int t; + int max = 0; + for(t=0;tnum_glyphs;t++) { + int u = font->glyphs[t].unicode; + if(u > max) + max = u; + } + if(!font->unicode2glyph) { + /* (re)generate unicode2glyph-to-glyph mapping table by reverse mapping + the glyph unicode2glyph's indexes into the mapping table. For collisions, + we prefer the smaller unicode2glyph value.*/ + font->max_unicode = max+1; + font->unicode2glyph = malloc(sizeof(font->unicode2glyph[0])*(font->max_unicode)); + memset(font->unicode2glyph, -1, sizeof(font->unicode2glyph[0])*(font->max_unicode)); + + for(t=0;tnum_glyphs;t++) { + int u = font->glyphs[t].unicode; + if(u>=0 && font->unicode2glyph[u]<0) { + assert(umax_unicode); + font->unicode2glyph[u] = t; + } + } + } else { + /* add the new glyph indexes (most probably, that's only the remapped values + at 0xe000) to the unicode2glyph table. Notice: Unlike glyph2unicode, we don't + care about collisions in the unicode2glyph table */ + int new_max_unicode = max+1; + if(font->max_unicode < new_max_unicode) { + font->unicode2glyph = rfx_realloc(font->unicode2glyph, sizeof(font->unicode2glyph[0])*(font->max_unicode)); + memset(font->unicode2glyph+font->max_unicode, -1, sizeof(font->unicode2glyph[0])*(new_max_unicode - font->max_unicode)); + } + for(t=0;tnum_glyphs;t++) { + int u = font->glyphs[t].unicode; + if(u>=0 && font->unicode2glyph[u]<0) { + font->unicode2glyph[u] = t; + } + } + font->max_unicode = new_max_unicode; + } +} + +ttf_t* gfxfont_to_ttf(gfxfont_t*font, char eot) +{ + ttf_t*ttf = ttf_new(); + int num_glyphs = font->num_glyphs; + int offset = 0; + int t; + char has_nondef_glyph = + font->num_glyphs && font->glyphs[0].unicode==-1 && + (!font->glyphs[0].line || !font->glyphs[0].line->next); + + if(!has_nondef_glyph) { + /* insert a new .nondef glyph at the start of the font */ + offset++; + num_glyphs++; + } + ttf->num_glyphs = num_glyphs; + ttf->glyphs = rfx_calloc(num_glyphs*sizeof(ttfglyph_t)); + double scale = 1.0; + int max_unicode = font->max_unicode; + int remap_pos=0; + for(t=0;tnum_glyphs;t++) { + gfxglyph_t*src = &font->glyphs[t]; + ttfglyph_t*dest = &ttf->glyphs[t+offset]; + gfxline_t*line = src->line; + int count = 0; + while(line) { + count++; + if(line->type == gfx_splineTo) + count++; + line=line->next; + } + dest->num_points = count; + dest->points = rfx_calloc(count*sizeof(ttfpoint_t)); + count = 0; + line = src->line; + while(line) { + if(line->type == gfx_splineTo) { + dest->points[count].x = line->sx*scale; + dest->points[count].y = line->sy*scale; + count++; + } + dest->points[count].x = line->x*scale; + dest->points[count].y = line->y*scale; + dest->points[count].flags |= GLYPH_ON_CURVE; + if(line->type == gfx_moveTo) { + dest->points[count].flags |= GLYPH_CONTOUR_START; + if(count) + dest->points[count-1].flags |= GLYPH_CONTOUR_END; + } + count++; + line=line->next; + } + if(count) + dest->points[count-1].flags |= GLYPH_CONTOUR_END; + + /* compute bounding box */ + int s; + if(count) { + dest->xmin = dest->xmax = dest->points[0].x; + dest->ymin = dest->ymax = dest->points[0].y; + for(s=1;spoints[s].x < dest->xmin) + dest->xmin = dest->points[s].x; + if(dest->points[s].y < dest->ymin) + dest->ymin = dest->points[s].y; + if(dest->points[s].x > dest->xmax) + dest->xmax = dest->points[s].x; + if(dest->points[s].y > dest->ymax) + dest->ymax = dest->points[s].y; + } + } + + if(eot) { + dest->bearing = dest->xmin; + /* for windows font rendering, make sure coordinates are always + to the right of the origin (and use bearing to shift them "back".) + Don't do this for non-windows platforms though because e.g. OS X + ignores bearing. */ + int xshift=0; + if(dest->xmin < 0) { + xshift = -dest->xmin; + for(s=0;spoints[s].x += xshift; + } + dest->xmin += xshift; + dest->xmax += xshift; + } + } + dest->advance = src->advance*scale; + + //dest->xmin=0; //TODO: might be necessary for some font engines? + + dest->advance = src->advance*scale; + + int u = font->glyphs[t].unicode; + if(u > max_unicode) + max_unicode = u; + } + ttf->unicode_size = max_unicode+1; + ttf->unicode = rfx_calloc(sizeof(unicode_t)*ttf->unicode_size); + + if(!font->unicode2glyph) { + for(t=0;tnum_glyphs;t++) { + gfxglyph_t*src = &font->glyphs[t]; + int u = font->glyphs[t].unicode; + if(u<=0) + continue; + if(u<32) { + msg(" gfxfont_to_ttf: glyph %d has an invalid unicode (%d)", t, u); + continue; + } else if(ttf->unicode[u]) { + msg(" gfxfont_to_ttf: glyph %d has a duplicate unicode (%d)", t, u); + continue; + } + if(uunicode_size) + ttf->unicode[u] = t+offset; + } + } else { + int u; + for(u=1;umax_unicode;u++) { + int g = font->unicode2glyph[u]; + if(g>=0 && u<32) { + msg(" gfxfont_to_ttf: Font contains an invalid unicode (%d)", u); + continue; + } + if(g>=0 && gnum_glyphs && !ttf->unicode[u]) { + ttf->unicode[u] = g+offset; + } + } + } + + ttf->ascent = font->ascent; + ttf->descent = -font->descent; + ttf->lineGap = 0; + + ttf->full_name = strdup(font->id); + ttf->family_name = strdup(font->id); + ttf->subfamily_name = strdup(font->id); + ttf->postscript_name = strdup(font->id); + ttf->version_string = strdup("Version 1.0"); + ttf->font_uid = strdup(font->id); + + ttf_create_truetype_tables(ttf); + return ttf; +} + +void gfxfont_save(gfxfont_t*font, const char*filename) +{ + ttf_t*ttf = gfxfont_to_ttf(font, 0); + ttf_save(ttf, filename); + ttf_destroy(ttf); +} + +void gfxfont_save_eot(gfxfont_t*font, const char*filename) +{ + ttf_t*ttf = gfxfont_to_ttf(font, 1); + ttf_save_eot(ttf, filename); + ttf_destroy(ttf); +} + diff -Nru swftools-0.9.0/lib/gfxfont.h swftools-0.9.2/lib/gfxfont.h --- swftools-0.9.0/lib/gfxfont.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/gfxfont.h 2010-11-12 18:57:33.000000000 +0000 @@ -32,8 +32,12 @@ /* The quality parameter is given by 1 divided by the zoom factor at which the font still looks good. 1=normal, 0.5=double resolution etc. */ -gfxfont_t* gfxfont_load(char*id, char*filename, unsigned int flags, double quality); +gfxfont_t* gfxfont_load(const char*id, const char*filename, unsigned int flags, double quality); +void gfxfont_save(gfxfont_t*font, const char*filename); +void gfxfont_save_eot(gfxfont_t*font, const char*filename); +void gfxfont_fix_unicode(gfxfont_t*font, char remove_duplicates); void gfxfont_free(gfxfont_t*font); +void gfxfont_add_unicode2glyph(gfxfont_t*font); #ifdef __cplusplus } diff -Nru swftools-0.9.0/lib/gfximage.c swftools-0.9.2/lib/gfximage.c --- swftools-0.9.0/lib/gfximage.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfximage.c 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,502 @@ +#include +#include +#include +#include +#include +#include "../config.h" +#include "jpeg.h" +#include "png.h" +#include "mem.h" +#include "gfximage.h" +#include "types.h" +#ifdef HAVE_FFTW3 +#include +#endif + +#define MOD(x,d) (((x)+(d))%(d)) + +gfximage_t*gfximage_new(int width, int height) +{ + gfximage_t*i = rfx_calloc(sizeof(gfximage_t)); + i->data = rfx_calloc(width*height*4); + i->width = width; + i->height = height; + return i; +} + +void gfximage_save_jpeg(gfximage_t*img, const char*filename, int quality) +{ + int x,y; + int l = img->width*img->height; + unsigned char*data = (unsigned char*)rfx_alloc(img->width*img->height*3); + int s,t; + for(t=0,s=0;tdata[t].r; + data[s+1] = img->data[t].g; + data[s+2] = img->data[t].b; + } + jpeg_save(data, img->width, img->height, quality, filename); + free(data); +} + +void gfximage_save_png(gfximage_t*image, const char*filename) +{ + png_write(filename, (void*)image->data, image->width, image->height); +} + +void gfximage_save_png_quick(gfximage_t*image, const char*filename) +{ + png_write_quick(filename, (void*)image->data, image->width, image->height); +} + +typedef struct scale_lookup { + int pos; + unsigned int weight; +} scale_lookup_t; + +typedef struct rgba_int { + unsigned int r,g,b,a; +} rgba_int_t; + +static int bicubic = 0; + +static scale_lookup_t**make_scale_lookup(int width, int newwidth) +{ + scale_lookup_t*lookupx = (scale_lookup_t*)rfx_alloc((width>newwidth?width:newwidth)*2*sizeof(scale_lookup_t)); + scale_lookup_t**lblockx = (scale_lookup_t**)rfx_alloc((newwidth+1)*sizeof(scale_lookup_t**)); + double fx = ((double)width)/((double)newwidth); + double px = 0; + int x; + scale_lookup_t*p_x = lookupx; + + if(newwidth<=width) { + for(x=0;x=width) tox = width-1; + for(xx=fromx;xx<=tox;xx++) { + if(xx==fromx && xx==tox) p_x->weight = 256; + else if(xx==fromx) p_x->weight = xweight; + else if(xx==tox) p_x->weight = 256-w; + else p_x->weight = i; + w+=p_x->weight; + p_x->pos = xx; + p_x++; + } + px = ex; + } + } else { + for(x=0;x=width) ix2=width-1; + lblockx[x] = p_x; + if(bicubic) + r = -2*r*r*r+3*r*r; + p_x[0].weight = (int)(256*(1-r)); + p_x[0].pos = ix1; + p_x[1].weight = 256-p_x[0].weight; + p_x[1].pos = ix2; + p_x+=2; + px += fx; + } + } + lblockx[newwidth] = p_x; + return lblockx; +} + +static void encodeMonochromeImage(gfxcolor_t*data, int width, int height, gfxcolor_t*colors) +{ + int t; + int len = width*height; + + U32* img = (U32*)data; + U32 color1 = img[0]; + U32 color2 = 0; + for(t=1;t> 8; + data[t].g = (colors[0].g * (255-m) + colors[1].g * m) >> 8; + data[t].b = (colors[0].b * (255-m) + colors[1].b * m) >> 8; + data[t].a = (colors[0].a * (255-m) + colors[1].a * m) >> 8; + } +} + +void blurImage(gfxcolor_t*src, int width, int height, int r) __attribute__ ((noinline)); + +void blurImage(gfxcolor_t*src, int width, int height, int r) +{ + int e = 2; // r times e is the sampling interval + double*gauss = (double*)rfx_alloc(r*e*sizeof(double)); + double sum=0; + int x; + for(x=0;x> 16; + d[x].g = g >> 16; + d[x].b = b >> 16; + d[x].a = a >> 16; + } + for(;x> 16; + d[yy].g = g >> 16; + d[yy].b = b >> 16; + d[yy].a = a >> 16; + yy += width; + } + for(;ywidth; + int height = img->height; + + int size = width*height; + int t; + U32* data = (U32*)img->data; + U32 color1 = data[0]; + U32 color2 = 0; + for(t=1;twidth; + int height = image->height; + gfxcolor_t*data = image->data; + + if(gfximage_getNumberOfPaletteEntries(image) == 2) { + monochrome=1; + encodeMonochromeImage(data, width, height, monochrome_colors); + int r1 = width / newwidth; + int r2 = height / newheight; + int r = r14) { + /* high-resolution monochrome images are usually dithered, so + low-pass filter them first to get rid of any moire patterns */ + blurImage(data, width, height, r+1); + } + } + + tmpline = (rgba_int_t*)rfx_alloc(width*sizeof(rgba_int_t)); + newdata = (gfxcolor_t*)rfx_alloc(newwidth*newheight*sizeof(gfxcolor_t)); + + lblockx = make_scale_lookup(width, newwidth); + lblocky = make_scale_lookup(height, newheight); + + for(p=lblocky[0];ppos*=width; + + for(y=0;ypos]; + scale_lookup_t*p_x; + int weight = p_y->weight; + for(x=0;xpos]; + unsigned int weight = p_x->weight; + r += col->r*weight; + g += col->g*weight; + b += col->b*weight; + a += col->a*weight; + p_x++; + } while (p_xr = r >> 16; + destline->g = g >> 16; + destline->b = b >> 16; + destline->a = a >> 16; + + destline++; + } + } + + if(monochrome) + decodeMonochromeImage(newdata, newwidth, newheight, monochrome_colors); + + rfx_free(tmpline); + rfx_free(*lblockx); + rfx_free(lblockx); + rfx_free(*lblocky); + rfx_free(lblocky); + + gfximage_t*image2 = (gfximage_t*)malloc(sizeof(gfximage_t)); + image2->data = newdata; + image2->width = newwidth; + image2->height = newheight; + return image2; +} + +#ifdef HAVE_FFTW3 +gfximage_t* gfximage_rescale_fft(gfximage_t*image, int newwidth, int newheight) +{ + int channel; + + int oldwidth = image->width; + int oldheight = image->height; + + unsigned char*rgba = (unsigned char*)image->data; + + bool has_alpha = gfximage_has_alpha(image); + bool monochrome = 0; + gfxcolor_t monochrome_colors[2]; + if(gfximage_getNumberOfPaletteEntries(image) == 2) { + monochrome=1; + encodeMonochromeImage(image->data, image->width, image->height, monochrome_colors); + } + + float*data = fftwf_malloc(sizeof(float)*oldwidth*oldheight); + int osize = oldwidth*oldheight; + int nsize = newwidth*newheight; + + assert(newwidth <= oldwidth && newheight <= oldheight); + + gfxcolor_t*rgba_new = malloc(newwidth*newheight*sizeof(gfxcolor_t)); + unsigned char*rgba_new_asbytes = (unsigned char*)rgba_new; + + int oxwidth = oldwidth/2+1; + int oxsize = oxwidth*oldheight; + fftwf_complex* fft = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex)*oxwidth*oldheight); + fftwf_complex* fft2 = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex)*newwidth*newheight); + fftwf_complex* data2 = fftwf_malloc(sizeof(fftwf_complex)*newwidth*newheight); + fftwf_plan plan1 = fftwf_plan_dft_r2c_2d(oldheight, oldwidth, data, fft, FFTW_ESTIMATE); + fftwf_plan plan2 = fftwf_plan_dft_2d(newheight, newwidth, fft2, data2, FFTW_BACKWARD, FFTW_ESTIMATE); + + double ff = 1.0/osize; + + for(channel=0;channel<4;channel++) { + if(channel==0 && !has_alpha) + continue; + if(channel>=1 && monochrome) + continue; + int t; + for(t=0;t> 2; + for(y=0;y255?255:f); + } + } + fftwf_destroy_plan(plan1); + fftwf_destroy_plan(plan2); + free(fft); + free(fft2); + if(!has_alpha) { + int t; + for(t=0;tdata = rgba_new; + image2->width = newwidth; + image2->height = newheight; + return image2; +} +#endif + +#ifdef HAVE_FFTW3 +gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight) +{ + //return gfximage_rescale_fft(image, newwidth, newheight); + return gfximage_rescale_old(image, newwidth, newheight); +} +#else +gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight) +{ + return gfximage_rescale_old(image, newwidth, newheight); +} +#endif + +bool gfximage_has_alpha(gfximage_t*img) +{ + int size = img->width*img->height; + gfxcolor_t*data = img->data; + int t; + for(t=0;tdata); + b->data = 0; + free(b); +} + diff -Nru swftools-0.9.0/lib/gfximage.h swftools-0.9.2/lib/gfximage.h --- swftools-0.9.0/lib/gfximage.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfximage.h 2010-11-12 18:56:57.000000000 +0000 @@ -0,0 +1,15 @@ +#ifndef __gfximage_h__ +#define __gfximage_h__ + +#include +#include "gfxdevice.h" + +gfximage_t*gfximage_new(int width, int height); +void gfximage_save_jpeg(gfximage_t*image, const char*filename, int quality); +void gfximage_save_png(gfximage_t*image, const char*filename); +void gfximage_save_png_quick(gfximage_t*image, const char*filename); +gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight); +bool gfximage_has_alpha(gfximage_t*image); +void gfximage_free(gfximage_t*b); + +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/active.c swftools-0.9.2/lib/gfxpoly/active.c --- swftools-0.9.0/lib/gfxpoly/active.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/active.c 2010-11-12 18:52:20.000000000 +0000 @@ -0,0 +1,693 @@ +#include +#include +#include +#include "../../config.h" +#include "../q.h" +#include "../types.h" +#include "active.h" + +actlist_t* actlist_new() +{ + NEW(actlist_t, a); + return a; +} +void actlist_destroy(actlist_t*a) +{ + free(a); +} + +void actlist_dump(actlist_t*a, int32_t y, double gridsize) +{ + segment_t*s = a->list; + double lastx; + char bad = 0; + if(!s) fprintf(stderr, "(empty)\n"); + while(s) { + if(y) { + double x = ((double)s->delta.x*(y-s->a.y)/s->delta.y)+s->a.x; + if(s!=a->list) { + if(lastx>x) + fprintf(stderr, "?%.2f<->%.2f? ", lastx * gridsize, x * gridsize); + } + lastx = x; + } + fprintf(stderr, "[%d]", (int)s->nr); + s = s->right; + if(s) fprintf(stderr, " "); + else fprintf(stderr, " y=%.2f\n", y * gridsize); + } +} +void actlist_verify(actlist_t*a, int32_t y) +{ + segment_t*s = a->list; + assert(!s || !s->left); + segment_t*l = 0; + while(s) { + if(y) { + if(l) { + /* we need to re-evaluate the x of the previous segment. if we + try to store it, it might end up being converted to a double, + which will make it non-equal to (and possibly larger than) the + "long double" the FPU has in its register. This only happens + when compiler optimizations are turned on. */ + assert((XPOS(s, y) - XPOS(l, y)) >= 0); + assert(XDIFF(s,l,y) >= 0); + } + l = s; + } + assert(!s->left || s->left->right == s); + assert(!s->right || s->right->left == s); + s = s->right; + } +} + +static inline double single_cmp(segment_t*s, point_t p1) +{ + return LINE_EQ(p1, s); +} + +static inline double cmp(segment_t*s, point_t p1, point_t p2) +{ + double d = LINE_EQ(p1, s); + if(d==0) { + d = LINE_EQ(p2, s); + if(d==0) { + /* We default to always inserting the new segment to the right of the old segment. + We do this so that we don't place new segments into the middle of already + overlapping lines which may have intersections scheduled. + */ + //fprintf(stderr, "Notice: actlist_find: both points (%d,%d) and (%d,%d) exactly on segment [%d]\n", p1.x, p1.y, p2.x, p2.y, s->nr); + } + } + return d; +} + +#ifdef SPLAY +static void actlist_splay_dump(actlist_t*a); +segment_t* actlist_find(actlist_t*a, point_t p1, point_t p2) +{ +#ifdef CHECKS + segment_t*t = a->list; + char to_the_left = 0; + char fail = 0; + while(t) { + /* this check doesn't work out with cmp() because during horizontal + processing, both segments ending as well as segments starting will + be active in this scanline */ + //double d = cmp(t, p1, p2); + double d = single_cmp(t, p1); + if(d>=0 && to_the_left) { + actlist_dump(a, p1.y, 1); + segment_t*s = a->list; + while(s) { + fprintf(stderr, "[%d] %f/%f (%d,%d) -> (%d,%d)\n", SEGNR(s), + single_cmp(s,p1), cmp(s,p1,p2), + s->a.x, s->a.y, s->b.x, s->b.y); + s = s->right; + } + } + assert(!(d>=0 && to_the_left)); + if(d<0) to_the_left=1; + t = t->right; + } +#if 0 + if(a->size > 100) { + static actlist_t*last = 0; + if(last != a) { + last = a; + actlist_splay_dump(a); + } + } +#endif +#endif + segment_t*last=0, *s = a->root; + if(!s) return 0; + double d=0; + int depth = 0; + while(s) { + last = s; + depth++; + d = single_cmp(s, p1); + if(d<=0) { + s = s->leftchild; + } else { + s = s->rightchild; + } + } +//#ifdef DEBUG +#if 0 + if(a->size > 1) { + /* 80% hit, average cost per miss ~ 4 nodes */ + int expected_depth = (int)((double)log2((double)a->size+1))+1; + static int hits = 0; + static int misses = 0; + static int miss_cost = 0; + if(depth <= expected_depth) hits++; + else {misses++; + miss_cost += depth - expected_depth; + } + if(hits && misses) + fprintf(stderr, "%02.2f%% %f\n", hits / (double)(hits+misses), miss_cost / (double)misses); + } +#endif + + /* this can be optimized for (is not needed in) normal mode (as opposed to horizontal postprocess mode) */ + segment_t*out = last; + if(d<0 || (d==0 && LINE_EQ(p2,last)<0)) { + last = last->left; + if(!last) { + assert(cmp(a->list, p1, p2)<0); + return 0; + } + } else { + while(last->right && cmp(last->right, p1, p2)>=0) { + last = last->right; + } + } + +#ifdef CHECKS + segment_t*l=0; + s = a->list; + while(s) { + if(cmp(s, p1, p2)<0) + break; + l = s;s = s->right; + } + if(l!=last) { + printf("[%d]!=[%d]\n", SEGNR(l), SEGNR(last)); + printf("after tree: [%d]\n", SEGNR(out)); + actlist_splay_dump(a); + s = a->list; + while(s) { + double d1 = single_cmp(s,p1); + double d2 = cmp(s,p1,p2); + int x1 = d1<0?-1:(d1>0?1:0); + int x2 = d2<0?-1:(d2>0?1:0); + printf("[%d](%d,%d) ", SEGNR(s), x1, x2); + s = s->right; + } + printf("\n"); + } + assert(l == last); +#endif + + return last; +} +#else +segment_t* actlist_find(actlist_t*a, point_t p1, point_t p2) +{ + segment_t*last=0, *s = a->list; + if(!s) return last; + while(s) { + double d = cmp(s, p1, p2); + if(d<0) + break; + last = s; + s = s->right; + } + return last; +} +#endif + +#ifdef SPLAY + +#define LINK(node,side,child) (node)->side = (child);if(child) {(child)->parent = (node);} + //;fprintf(stderr, "[%d]->%s now [%d]\n", SEGNR(node), __STRING(side), SEGNR(child)); + +// rotates segment's left node to the top +static inline segment_t*rotate_right(actlist_t*a, segment_t*s) +{ + /* s n + / \ + n -> s + \ / + l l + */ + assert(s->leftchild); + segment_t*p = s->parent; + segment_t*n = s->leftchild; + segment_t*l = n->rightchild; + LINK(n,rightchild,s); + LINK(s,leftchild,l); + n->parent = p; + if(p) { + if(p->leftchild == s) + p->leftchild = n; + else if(p->rightchild == s) + p->rightchild = n; + } else { + a->root = n; + } + return n; +} +// rotates segment's right node to the top +static inline segment_t*rotate_left(actlist_t*a, segment_t*s) +{ + /* s n + \ / + n -> s + / \ + r r + */ + assert(s->rightchild); + segment_t*p = s->parent; + segment_t*n = s->rightchild; + segment_t*r = n->leftchild; + LINK(n,leftchild,s); + LINK(s,rightchild,r); + n->parent = p; + if(p) { + if(p->leftchild == s) + p->leftchild = n; + else if(p->rightchild == s) + p->rightchild = n; + } else { + a->root = n; + } + return n; +} + +static int actlist_splay_walk(actlist_t*a, segment_t*s, segment_t**ss, segment_t*parent) +{ + if(!s) return 1; + if(parent != s->parent) { + fprintf(stderr, "Parent mismatch in [%d]: [%d] != [%d]\n", SEGNR(s), SEGNR(parent), SEGNR(s->parent)); + return 0; + } + if(!actlist_splay_walk(a, s->leftchild, ss, s)) return 0; + if(s != *ss) { + fprintf(stderr, "[%d] != [%d]\n", SEGNR(s), SEGNR(*ss)); + return 0; + } + (*ss) = (*ss)->right; + if(!actlist_splay_walk(a, s->rightchild, ss, s)) return 0; + return 1; +} + +static int actlist_splay_verify(actlist_t*a) +{ + segment_t*c = a->list; + if(!actlist_splay_walk(a, a->root, &c, 0)) return 0; + if(c) return 0; + return 1; +} +static void actlist_splay_dump2(actlist_t*a, segment_t*s, char*mid, char*up, char*down) +{ + if(!s) return; + + if(s->leftchild || s->rightchild) { + int t; + + if(s->leftchild) { + char*o3 = malloc(strlen(up)+3); + strcpy(o3, up);strcat(o3, "+-"); + char*newup = malloc(strlen(up)+3); + strcpy(newup, up);strcat(newup, "| "); + char*newup2 = malloc(strlen(up)+3); + strcpy(newup2, up);strcat(newup2, " "); + actlist_splay_dump2(a, s->leftchild, o3, newup2, newup); + fprintf(stderr, "%s| \n", up); + free(newup); + free(newup2); + free(o3); + } + fprintf(stderr, "%s[%d]\n", mid, SEGNR(s)); + if(s->rightchild) { + char*o3 = malloc(strlen(down)+3); + strcpy(o3, down);strcat(o3, "+-"); + char*newdown = malloc(strlen(down)+3); + strcpy(newdown, down);strcat(newdown, "| "); + char*newdown2 = malloc(strlen(down)+3); + strcpy(newdown2, down);strcat(newdown2, " "); + fprintf(stderr, "%s| \n", down); + actlist_splay_dump2(a, s->rightchild, o3, newdown, newdown2); + free(newdown); + free(newdown2); + free(o3); + } + } else { + fprintf(stderr, "%s[%d]\n", mid, SEGNR(s)); + } +} +static void actlist_splay_dump(actlist_t*a) +{ + actlist_splay_dump2(a, a->root, "", "", ""); +} + + +static void move_to_root(actlist_t*a, segment_t*s) +{ + if(!s) return; + /* this is a textbook implementation of the three splay operations + zig, zig-zig and zig-zag */ + int nr=0; + while(a->root != s) { + assert(s->parent); + segment_t*p = s->parent; + if(p == a->root) { + // zig + if(a->root->leftchild == s) { + rotate_right(a, a->root); + } else { + rotate_left(a, a->root); + } + assert(a->root == s); + } else { + segment_t*pp = p->parent; + if(p->leftchild == s && pp->leftchild == p) { + // zig-zig (left) + rotate_right(a, pp); + rotate_right(a, s->parent); + } else if(p->rightchild == s && pp->rightchild == p) { + // zig-zig (right) + rotate_left(a, pp); + rotate_left(a, s->parent); + } else if(p->leftchild == s && pp->rightchild == p) { + // zig-zag (left) + rotate_right(a, p); + rotate_left(a, s->parent); + } else if(p->rightchild == s && pp->leftchild == p) { + // zig-zag (right) + rotate_left(a, p); + rotate_right(a, s->parent); + } else { + assert(0); + } + } + } +} + +static void actlist_splay(actlist_t*a, point_t p1, point_t p2) +{ + if(!a->list) return; + + segment_t tmp; + memset(&tmp, 0, sizeof(tmp)); + segment_t*left=&tmp,*right=&tmp; + + int c = 0; + while(1) { + if(cmp(a->root,p1,p2)<0) { + /* we're to the left of the root */ + if(!a->root->leftchild) { + c = -1;break; + } + if(cmp(a->root->leftchild,p1,p2)<0) { + /* we're also to the left of the root's left child + -> rotate right, so that the left child is root */ + segment_t*s = a->root->leftchild; + LINK(a->root, leftchild, s->rightchild); + LINK(s, rightchild, a->root); + a->root = s; + if(!a->root->leftchild) { + c = -1;break; + } + } + LINK(right, leftchild, a->root); + right = a->root; + a->root = a->root->leftchild; + } else /* cmp(a->root,p1,p2)>=0 */ { + /* we're to the right of the root */ + if(!a->root->rightchild) { + c = 1;break; + } + if(cmp(a->root->rightchild,p1,p2)>=0) { + /* we're also to the right of the root's right child + -> rotate left, so that the right child is root */ + segment_t*s = a->root->rightchild; + LINK(a->root, rightchild, s->leftchild); + LINK(s, leftchild, a->root); + a->root = s; + if(!a->root->rightchild) + c = 1;break; + } + LINK(left, rightchild, a->root); + left = a->root; + a->root = a->root->rightchild; + } + } + LINK(left, rightchild, a->root->leftchild); + LINK(right, leftchild, a->root->rightchild); + LINK(a->root, leftchild, tmp.rightchild); + LINK(a->root, rightchild, tmp.leftchild); + a->root->parent = 0; +} + +#endif + +static void actlist_insert_after(actlist_t*a, segment_t*left, segment_t*s) +{ +#ifdef SPLAY + //fprintf(stderr, "insert [%d] after [%d]\n", SEGNR(s), SEGNR(left)); + //actlist_splay_dump(a); + //actlist_dump(a, s->a.y); +#endif + + s->left = left; + if(left) { + s->right = left->right; + } else { + s->right = a->list; + a->list = s; + } + if(s->left) + s->left->right = s; + if(s->right) + s->right->left = s; + +#ifdef SPLAY + // we insert nodes not trees + assert(!s->leftchild); + assert(!s->rightchild); + + if(a->root) { + move_to_root(a, left); + if(left) { + LINK(s,leftchild,a->root); + // steal right child from (previous) root + LINK(s,rightchild,a->root->rightchild); + a->root->rightchild = 0; + } else { + LINK(s,rightchild,a->root); + } + } + a->root = s; + a->root->parent = 0; + + assert(actlist_splay_verify(a)); +#endif + + a->size++; +} + +void actlist_delete(actlist_t*a, segment_t*s) +{ +#ifdef SPLAY + assert(actlist_splay_verify(a)); + move_to_root(a, s); + assert(actlist_splay_verify(a)); +#endif + if(s->left) { + s->left->right = s->right; + } else { + a->list = s->right; + } + if(s->right) { + s->right->left = s->left; + } + s->left = s->right = 0; + a->size--; +#ifdef SPLAY + assert(a->root == s); + // delete root node + if(!a->root->leftchild) { + a->root = a->root->rightchild; + } else if(!a->root->rightchild) { + a->root = a->root->leftchild; + } else { +#ifdef HAVE_LRAND48 + if(lrand48()&1) { +#else + if(((ptroff_t)s)&16) { +#endif + // free up root->left->right + segment_t*t = a->root->leftchild; + while(t->rightchild) { + segment_t*r = t->rightchild; + segment_t*l = r->leftchild; + LINK(r, leftchild, t); + LINK(t, rightchild, l); + t = r; + } + LINK(a->root,leftchild,t); + assert(!a->root->leftchild->rightchild); + LINK(a->root->leftchild,rightchild,a->root->rightchild); + a->root = a->root->leftchild; + } else { + // free up root->right->left + segment_t*t = a->root->rightchild; + while(t->leftchild) { + segment_t*l = t->leftchild; + segment_t*r = l->rightchild; + LINK(l, rightchild, t); + LINK(t, leftchild, r); + t = l; + } + LINK(a->root,rightchild,t); + assert(!a->root->rightchild->leftchild); + LINK(a->root->rightchild,leftchild,a->root->leftchild); + a->root = a->root->rightchild; + } + } + if(a->root) + a->root->parent = 0; + s->leftchild = s->rightchild = s->parent = 0; + + assert(actlist_splay_verify(a)); +#endif +} +int actlist_size(actlist_t*a) +{ + return a->size; +} + +segment_t* actlist_leftmost(actlist_t*a) +{ + return a->list; +} + +segment_t* actlist_rightmost(actlist_t*a) +{ + /* this is only used in checks, so it doesn't matter that it's slow */ +#ifndef CHECKS + fprintf(stderr, "Warning: actlist_rightmost should not be used\n"); +#endif + segment_t*s = a->list; + segment_t*last = 0; + while(s) { + last = s; + s = s->right; + } + return last; +} + +void actlist_insert(actlist_t*a, point_t p1, point_t p2, segment_t*s) +{ + segment_t*left = actlist_find(a, p1, p2); + actlist_insert_after(a, left, s); +} + +void actlist_swap(actlist_t*a, segment_t*s1, segment_t*s2) +{ +#ifdef SPLAY + assert(actlist_splay_verify(a)); +#endif +#ifdef CHECKS + /* test that s1 is to the left of s2- our swap + code depends on that */ + segment_t*s = s1; + while(s && s!=s2) s = s->right; + assert(s==s2); +#endif +/*#ifndef SPLAY + actlist_delete(a, s1); + actlist_insert_after(a, s2, s1); +#else*/ + segment_t*s1l = s1->left; + segment_t*s1r = s1->right; + segment_t*s2l = s2->left; + segment_t*s2r = s2->right; + if(s1l) s1l->right = s2; + else a->list = s2; + s2->left = s1l; + if(s2r) s2r->left = s1; + s1->right = s2r; + if(s2l!=s1) s1->left = s2l; + else s1->left = s2; + if(s1r!=s2) s2->right = s1r; + else s2->right = s1; + +#ifdef SPLAY + if(s2->parent==s1) { + /* + s1 s2 + / -> / + s2 s1 + */ + segment_t*l = s2->leftchild; + segment_t*r = s2->rightchild; + assert(s1->rightchild == s2); // because s1 < s2 + segment_t*l1 = s1->leftchild; + segment_t*p = s1->parent; + s1->parent = s2; + s2->parent = p; + if(p) { + if(p->leftchild == s1) p->leftchild=s2; + else {assert(p->rightchild == s1);p->rightchild=s2;} + } else { + a->root = s2; + } + s2->leftchild = l1; + s2->rightchild = s1; + s1->leftchild = l; + s1->rightchild = r; + } else if(s1->parent==s2) { + /* + s2 s1 + / -> / + s1 s2 + */ + segment_t*l = s1->leftchild; + segment_t*r = s1->rightchild; + segment_t*r2 = s2->rightchild; + assert(s2->leftchild == s1); // because s1 < s2 + segment_t*p = s2->parent; + s2->parent = s1; + s1->parent = p; + if(p) { + if(p->leftchild == s2) p->leftchild=s1; + else {assert(p->rightchild == s2);p->rightchild=s1;} + } else { + a->root = s1; + } + s1->leftchild = s2; + s1->rightchild = r2; + s2->leftchild = l; + s2->rightchild = r; + } else { + segment_t*s1p = s1->parent; + segment_t*s1l = s1->leftchild; + segment_t*s1r = s1->rightchild; + segment_t*s2p = s2->parent; + segment_t*s2l = s2->leftchild; + segment_t*s2r = s2->rightchild; + s2->parent = s1p; + s2->leftchild = s1l; + s2->rightchild = s1r; + s1->parent = s2p; + s1->leftchild = s2l; + s1->rightchild = s2r; + assert(s1p || s2p); + if(s1p) { + if(s1p->leftchild == s1) s1p->leftchild=s2; + else {assert(s1p->rightchild == s1);s1p->rightchild=s2;} + } else { + a->root = s2; + } + if(s2p) { + if(s2p->leftchild == s2) s2p->leftchild=s1; + else {assert(s2p->rightchild == s2);s2p->rightchild=s1;} + } else { + a->root = s1; + } + } + if(s1->leftchild) s1->leftchild->parent = s1; + if(s2->leftchild) s2->leftchild->parent = s2; + if(s1->rightchild) s1->rightchild->parent = s1; + if(s2->rightchild) s2->rightchild->parent = s2; + + assert(actlist_splay_verify(a)); +#endif + +//#endif +} diff -Nru swftools-0.9.0/lib/gfxpoly/active.h swftools-0.9.2/lib/gfxpoly/active.h --- swftools-0.9.0/lib/gfxpoly/active.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/active.h 2010-11-12 18:52:14.000000000 +0000 @@ -0,0 +1,30 @@ +#ifndef __active_h__ +#define __active_h__ + +#include "poly.h" + +typedef struct _actlist +{ + segment_t*list; + int size; +#ifdef SPLAY + segment_t*root; +#endif +} actlist_t; + +#define actlist_left(a,s) ((s)->left) +#define actlist_right(a,s) ((s)?(s)->right:(a)->list) + +actlist_t* actlist_new(); +void actlist_destroy(actlist_t*a); +int actlist_size(actlist_t*a); +void actlist_verify(actlist_t*a, int32_t y); +void actlist_dump(actlist_t*a, int32_t y, double gridsize); +segment_t* actlist_find(actlist_t*a, point_t p1, point_t p2); // finds segment immediately to the left of p1 (breaking ties w/ p2) +void actlist_insert(actlist_t*a, point_t p1, point_t p2, segment_t*s); +void actlist_delete(actlist_t*a, segment_t*s); +void actlist_swap(actlist_t*a, segment_t*s1, segment_t*s2); +segment_t* actlist_leftmost(actlist_t*a); +segment_t* actlist_rightmost(actlist_t*a); + +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/convert.c swftools-0.9.2/lib/gfxpoly/convert.c --- swftools-0.9.0/lib/gfxpoly/convert.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/convert.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,550 @@ +#include +#include +#include +#include "../gfxdevice.h" +#include "../mem.h" +#include "poly.h" +#include "convert.h" +#include "wind.h" + +/* factor that determines into how many line fragments a spline is converted */ +#define SUBFRACTION (2.4) + +static inline int32_t convert_coord(double x, double z) +{ + /* we clamp to 26 bit because: + a) we use a (x1-x2) shortcut when comparing coordinates + b) we need to be able to multiply two coordinates and store them in a double w/o loss of precision + */ + x *= z; + if(x < -0x2000000) x = -0x2000000; + if(x > 0x1ffffff) x = 0x1ffffff; + return ceil(x); +} + +static void convert_gfxline(gfxline_t*line, polywriter_t*w, double gridsize) +{ + assert(!line || line[0].type == gfx_moveTo); + double lastx=0,lasty=0; + double z = 1.0 / gridsize; + while(line) { + if(line->type == gfx_moveTo) { + if(line->next && line->next->type != gfx_moveTo && (line->x!=lastx || line->y!=lasty)) { + w->moveto(w, convert_coord(line->x,z), convert_coord(line->y,z)); + } + } else if(line->type == gfx_lineTo) { + w->lineto(w, convert_coord(line->x,z), convert_coord(line->y,z)); + } else if(line->type == gfx_splineTo) { + int parts = (int)(sqrt(fabs(line->x-2*line->sx+lastx) + + fabs(line->y-2*line->sy+lasty))*SUBFRACTION); + if(!parts) parts = 1; + double stepsize = 1.0/parts; + int i; + for(i=0;ix*t*t + 2*line->sx*t*(1-t) + lastx*(1-t)*(1-t)); + double sy = (line->y*t*t + 2*line->sy*t*(1-t) + lasty*(1-t)*(1-t)); + w->lineto(w, convert_coord(sx,z), convert_coord(sy,z)); + } + w->lineto(w, convert_coord(line->x,z), convert_coord(line->y,z)); + } + lastx = line->x; + lasty = line->y; + line = line->next; + } +} + +static char* readline(FILE*fi) +{ + char c; + while(1) { + int l = fread(&c, 1, 1, fi); + if(!l) + return 0; + if(c!=10 || c!=13) + break; + } + char line[256]; + int pos = 0; + while(1) { + line[pos++] = c; + line[pos] = 0; + int l = fread(&c, 1, 1, fi); + if(!l || c==10 || c==13) { + return strdup(line); + } + } +} + +static void convert_file(const char*filename, polywriter_t*w, double gridsize) +{ + FILE*fi = fopen(filename, "rb"); + if(!fi) { + perror(filename); + } + double z = 1.0 / gridsize; + int count = 0; + double g = 0; + double lastx=0,lasty=0; + while(1) { + char*line = readline(fi); + if(!line) + break; + double x,y; + char s[256]; + if(sscanf(line, "%lf %lf %s", &x, &y, (char*)&s) == 3) { + if(!strcmp(s,"moveto")) { + w->moveto(w, convert_coord(x,z), convert_coord(y,z)); + count++; + } else if(!strcmp(s,"lineto")) { + w->lineto(w, convert_coord(x,z), convert_coord(y,z)); + count++; + } else { + fprintf(stderr, "invalid command: %s\n", s); + } + } else if(sscanf(line, "%% gridsize %lf", &g) == 1) { + gridsize = g; + z = 1.0 / gridsize; + w->setgridsize(w, g); + } + free(line); + } + fclose(fi); + if(g) { + fprintf(stderr, "loaded %d points from %s (gridsize %f)\n", count, filename, g); + } else { + fprintf(stderr, "loaded %d points from %s\n", count, filename); + } +} + +typedef struct _compactpoly { + gfxpoly_t*poly; + point_t last; + point_t*points; + int num_points; + int points_size; + segment_dir_t dir; + char new; +} compactpoly_t; + +void finish_segment(compactpoly_t*data) +{ + if(data->num_points <= 1) + return; + point_t*p = malloc(sizeof(point_t)*data->num_points); + gfxpolystroke_t*s = rfx_calloc(sizeof(gfxpolystroke_t)); + s->fs = &edgestyle_default; + s->next = data->poly->strokes; + data->poly->strokes = s; + s->num_points = s->points_size = data->num_points; + s->dir = data->dir; + s->points = p; + assert(data->dir != DIR_UNKNOWN); + if(data->dir == DIR_UP) { + int t; + int s = data->num_points; + for(t=0;tnum_points;t++) { + p[--s] = data->points[t]; + } + } else { + memcpy(p, data->points, sizeof(point_t)*data->num_points); + } +#ifdef CHECKS + int t; + for(t=0;tnum_points-1;t++) { + assert(p[t].y<=p[t+1].y); + } +#endif +} +static void compactmoveto(polywriter_t*w, int32_t x, int32_t y) +{ + compactpoly_t*data = (compactpoly_t*)w->internal; + point_t p; + p.x = x; + p.y = y; + if(p.x != data->last.x || p.y != data->last.y) { + data->new = 1; + } + data->last = p; +} + +static inline int direction(point_t p1, point_t p2) +{ + int diff = p1.y - p2.y; + if(diff) return diff; + return p1.x - p2.x; +} + +static void compactlineto(polywriter_t*w, int32_t x, int32_t y) +{ + compactpoly_t*data = (compactpoly_t*)w->internal; + point_t p; + p.x = x; + p.y = y; + + int diff = direction(p, data->last); + if(!diff) + return; + segment_dir_t dir = diff<0?DIR_UP:DIR_DOWN; + + if(dir!=data->dir || data->new) { + finish_segment(data); + data->dir = dir; + data->points[0] = data->last; + data->num_points = 1; + } + data->new = 0; + + if(data->points_size == data->num_points) { + data->points_size <<= 1; + assert(data->points_size > data->num_points); + data->points = rfx_realloc(data->points, sizeof(point_t)*data->points_size); + } + data->points[data->num_points++] = p; + data->last = p; +} +static void compactsetgridsize(polywriter_t*w, double gridsize) +{ + compactpoly_t*d = (compactpoly_t*)w->internal; + d->poly->gridsize = gridsize; +} +/*static int compare_stroke(const void*_s1, const void*_s2) +{ + gfxpolystroke_t*s1 = (gfxpolystroke_t*)_s1; + gfxpolystroke_t*s2 = (gfxpolystroke_t*)_s2; + return s1->points[0].y - s2->points[0].y; +}*/ +static void*compactfinish(polywriter_t*w) +{ + compactpoly_t*data = (compactpoly_t*)w->internal; + finish_segment(data); + //qsort(data->poly->strokes, data->poly->num_strokes, sizeof(gfxpolystroke_t), compare_stroke); + free(data->points); + gfxpoly_t*poly = data->poly; + free(w->internal);w->internal = 0; + return (void*)poly; +} +void gfxpolywriter_init(polywriter_t*w) +{ + w->moveto = compactmoveto; + w->lineto = compactlineto; + w->setgridsize = compactsetgridsize; + w->finish = compactfinish; + compactpoly_t*data = w->internal = rfx_calloc(sizeof(compactpoly_t)); + data->poly = rfx_calloc(sizeof(gfxpoly_t)); + data->poly->gridsize = 1.0; + data->last.x = data->last.y = 0; + data->num_points = 0; + data->points_size = 16; + data->new = 1; + data->dir = DIR_UNKNOWN; + data->points = (point_t*)rfx_alloc(sizeof(point_t)*data->points_size); + data->poly->strokes = 0; +} + +gfxpoly_t* gfxpoly_from_fill(gfxline_t*line, double gridsize) +{ + polywriter_t writer; + gfxpolywriter_init(&writer); + writer.setgridsize(&writer, gridsize); + convert_gfxline(line, &writer, gridsize); + return (gfxpoly_t*)writer.finish(&writer); +} +gfxpoly_t* gfxpoly_from_file(const char*filename, double gridsize) +{ + polywriter_t writer; + gfxpolywriter_init(&writer); + writer.setgridsize(&writer, gridsize); + convert_file(filename, &writer, gridsize); + return (gfxpoly_t*)writer.finish(&writer); +} +void gfxpoly_destroy(gfxpoly_t*poly) +{ + int t; + gfxpolystroke_t*stroke = poly->strokes; + while(stroke) { + gfxpolystroke_t*next = stroke->next; + free(stroke->points); + free(stroke); + stroke = next; + } + free(poly); +} + +typedef struct _polydraw_internal +{ + double lx, ly; + int32_t lastx, lasty; + int32_t x0, y0; + double z; + char last; + polywriter_t writer; +} polydraw_internal_t; + +static void polydraw_moveTo(gfxdrawer_t*d, gfxcoord_t _x, gfxcoord_t _y) +{ + polydraw_internal_t*i = (polydraw_internal_t*)d->internal; + int32_t x = convert_coord(_x, i->z); + int32_t y = convert_coord(_y, i->z); + if(i->lastx != x || i->lasty != y) { + i->writer.moveto(&i->writer, x, y); + } + i->lx = _x; + i->ly = _y; + i->x0 = x; + i->y0 = y; + i->lastx = x; + i->lasty = y; + i->last = 1; +} +static void polydraw_lineTo(gfxdrawer_t*d, gfxcoord_t _x, gfxcoord_t _y) +{ + polydraw_internal_t*i = (polydraw_internal_t*)d->internal; + if(!i->last) { + polydraw_moveTo(d, _x, _y); + return; + } + int32_t x = convert_coord(_x, i->z); + int32_t y = convert_coord(_y, i->z); + if(i->lastx != x || i->lasty != y) { + i->writer.lineto(&i->writer, x, y); + } + i->lx = _x; + i->ly = _y; + i->lastx = x; + i->lasty = y; + i->last = 1; +} +static void polydraw_splineTo(gfxdrawer_t*d, gfxcoord_t sx, gfxcoord_t sy, gfxcoord_t x, gfxcoord_t y) +{ + polydraw_internal_t*i = (polydraw_internal_t*)d->internal; + if(!i->last) { + polydraw_moveTo(d, x, y); + return; + } + double c = fabs(x-2*sx+i->lx) + fabs(y-2*sy+i->ly); + int parts = (int)(sqrt(c)*SUBFRACTION); + if(!parts) parts = 1; + int t; + int32_t nx,ny; + for(t=0;tlx)/(double)(parts*parts), i->z); + ny = convert_coord((double)(t*t*y + 2*t*(parts-t)*sy + (parts-t)*(parts-t)*i->ly)/(double)(parts*parts), i->z); + if(nx != i->lastx || ny != i->lasty) { + i->writer.lineto(&i->writer, nx, ny); + i->lastx = nx; i->lasty = ny; + } + } + nx = convert_coord(x,i->z); + ny = convert_coord(y,i->z); + if(nx != i->lastx || ny != i->lasty) { + i->writer.lineto(&i->writer, nx, ny); + } + i->lx = x; + i->ly = y; + i->lastx = nx; + i->lasty = ny; + i->last = 1; +} +static void polydraw_close(gfxdrawer_t*d) +{ + polydraw_internal_t*i = (polydraw_internal_t*)d->internal; + assert(!(i->last && (i->x0 == INVALID_COORD || i->y0 == INVALID_COORD))); + if(!i->last) + return; + if(i->lastx != i->x0 || i->lasty != i->y0) { + i->writer.lineto(&i->writer, i->x0, i->y0); + i->lastx = i->x0; + i->lasty = i->y0; + } + i->last = 0; + i->x0 = INVALID_COORD; + i->y0 = INVALID_COORD; +} +static void* polydraw_result(gfxdrawer_t*d) +{ + polydraw_internal_t*i = (polydraw_internal_t*)d->internal; + void*result = i->writer.finish(&i->writer); + rfx_free(i); + memset(d, 0, sizeof(gfxdrawer_t)); + return result; +} + +void gfxdrawer_target_poly(gfxdrawer_t*d, double gridsize) +{ + polydraw_internal_t*i = (polydraw_internal_t*)rfx_calloc(sizeof(polydraw_internal_t)); + d->internal = i; + i->lastx = INVALID_COORD; // convert_coord can never return this value + i->lasty = INVALID_COORD; + i->x0 = INVALID_COORD; + i->y0 = INVALID_COORD; + d->moveTo = polydraw_moveTo; + d->lineTo = polydraw_lineTo; + d->splineTo = polydraw_splineTo; + d->close = polydraw_close; + d->result = polydraw_result; + gfxpolywriter_init(&i->writer); + i->writer.setgridsize(&i->writer, gridsize); + i->z = 1.0 / gridsize; +} + +#if 0 +gfxline_t*gfxline_from_gfxpoly(gfxpoly_t*poly) +{ + gfxpolystroke_t*stroke; + int count = 0; + for(stroke=poly->strokes;stroke;stroke=stroke->next) { + assert(stroke->num_points); + count += stroke->num_points; + } + if(!count) return 0; + gfxline_t*l = malloc(sizeof(gfxline_t)*count); + count = 0; + /* TODO: it might make sense to concatenate strokes */ + for(stroke=poly->strokes;stroke;stroke=stroke->next) { + int t; + for(t=0;tnum_points;t++) { + l[count+t].x = stroke->points[t].x * poly->gridsize; + l[count+t].y = stroke->points[t].y * poly->gridsize; + l[count+t].type = gfx_lineTo; + l[count+t].next = &l[count+t+1]; + } + l[count].type = gfx_moveTo; + count+=stroke->num_points; + } + l[count-1].next = 0; + return l; +} +#endif + +static gfxline_t*mkgfxline(gfxpoly_t*poly, char preserve_direction) +{ + gfxpolystroke_t*stroke; + int count = 0; + if(!poly->strokes) + return 0; + dict_t*d = dict_new2(&point_type); + dict_t*todo = dict_new2(&ptr_type); + gfxpolystroke_t*stroke_min= poly->strokes; + int32_t x_min=stroke_min->points[0].x; + int32_t y_min=stroke_min->points[0].y; + for(stroke=poly->strokes;stroke;stroke=stroke->next) { + dict_put(todo, stroke, stroke); + assert(stroke->num_points>1); + count += stroke->num_points; + if(stroke->dir == DIR_UP) { + dict_put(d, &stroke->points[stroke->num_points-1], stroke); + if(!preserve_direction) + dict_put(d, &stroke->points[0], stroke); + } else { + dict_put(d, &stroke->points[0], stroke); + if(!preserve_direction) + dict_put(d, &stroke->points[stroke->num_points-1], stroke); + } + if(stroke->points[0].y < y_min || + (stroke->points[0].y == y_min && stroke->points[0].x < x_min)) { + y_min = stroke->points[0].y; + stroke_min = stroke; + } + } + gfxpolystroke_t*next_todo = poly->strokes; + gfxline_t*l = malloc(sizeof(gfxline_t)*count); + count = 0; + stroke = stroke_min; + + point_t last = {INVALID_COORD, INVALID_COORD}; + char should_connect = 0; + while(stroke) { + if(stroke && !preserve_direction) { + char del1 = dict_del2(d, &stroke->points[0], stroke); + char del2 = dict_del2(d, &stroke->points[stroke->num_points-1], stroke); + assert(del1 && del2); + } + assert(dict_contains(todo, stroke)); + int t; + int pos = 0; + int incr = 1; + if(preserve_direction) { + if(stroke->dir == DIR_UP) { + pos = stroke->num_points-1; + incr = -1; + } + } else { + // try to find matching point on either end. + // Prefer downward. + if(last.x == stroke->points[stroke->num_points-1].x && + last.y == stroke->points[stroke->num_points-1].y) { + pos = stroke->num_points-1; + incr = -1; + } + } + if(last.x != stroke->points[pos].x || last.y != stroke->points[pos].y) { + l[count].x = stroke->points[pos].x * poly->gridsize; + l[count].y = stroke->points[pos].y * poly->gridsize; + l[count].type = gfx_moveTo; + l[count].next = &l[count+1]; + count++; + assert(!should_connect); + } + pos += incr; + for(t=1;tnum_points;t++) { + l[count].x = stroke->points[pos].x * poly->gridsize; + l[count].y = stroke->points[pos].y * poly->gridsize; + l[count].type = gfx_lineTo; + l[count].next = &l[count+1]; + count++; + pos += incr; + } + last = stroke->points[pos-incr]; + char del = dict_del(todo, stroke); + assert(del); + assert(!dict_contains(todo, stroke)); + + /* try to find a poly which starts at the point we drew last */ + stroke = dict_lookup(d, &last); + should_connect = 1; + while(!dict_contains(todo, stroke)) { + should_connect = 0; + stroke = next_todo; + if(!next_todo) { + stroke = 0; + break; + } + next_todo = next_todo->next; + } + } + l[count-1].next = 0; + dict_destroy(todo); + dict_destroy(d); + return l; +} + +gfxline_t*gfxline_from_gfxpoly(gfxpoly_t*poly) +{ + return mkgfxline(poly, 0); +} + +gfxline_t*gfxline_from_gfxpoly_with_direction(gfxpoly_t*poly) +{ + return mkgfxline(poly, 1); +} + +static windcontext_t onepolygon = {1}; +gfxline_t* gfxpoly_circular_to_evenodd(gfxline_t*line, double gridsize) +{ + gfxpoly_t*poly = gfxpoly_from_fill(line, gridsize); + gfxpoly_t*poly2 = gfxpoly_process(poly, 0, &windrule_circular, &onepolygon, 0); + gfxline_t*line2 = gfxline_from_gfxpoly(poly2); + gfxpoly_destroy(poly); + gfxpoly_destroy(poly2); + return line2; +} + +gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2, double gridsize) +{ + gfxline_t* line = gfxline_makerectangle(x1, y1, x2, y2); + gfxpoly_t* poly = gfxpoly_from_fill(line, gridsize); + gfxline_free(line); + return poly; +} + diff -Nru swftools-0.9.0/lib/gfxpoly/convert.h swftools-0.9.2/lib/gfxpoly/convert.h --- swftools-0.9.0/lib/gfxpoly/convert.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/convert.h 2010-11-12 18:52:12.000000000 +0000 @@ -0,0 +1,30 @@ +#ifndef __poly_convert_h__ +#define __poly_convert_h__ + +#include "../gfxdevice.h" +#include "../gfxtools.h" +#include "poly.h" + +typedef struct _polywriter +{ + void(*moveto)(struct _polywriter*, int32_t x, int32_t y); + void(*lineto)(struct _polywriter*, int32_t x, int32_t y); + void(*setgridsize)(struct _polywriter*, double g); + void*(*finish)(struct _polywriter*); + void*internal; +} polywriter_t; + +void gfxdrawer_target_poly(gfxdrawer_t*d, double gridsize); + +void gfxpolywriter_init(polywriter_t*w); +gfxpoly_t* gfxpoly_from_fill(gfxline_t*line, double gridsize); +gfxpoly_t* gfxpoly_from_file(const char*filename, double gridsize); +void gfxpoly_destroy(gfxpoly_t*poly); + +gfxline_t*gfxline_from_gfxpoly(gfxpoly_t*poly); +gfxline_t*gfxline_from_gfxpoly_with_direction(gfxpoly_t*poly); // preserves up/down + +gfxline_t* gfxpoly_circular_to_evenodd(gfxline_t*line, double gridsize); +gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2, double gridsize); + +#endif //__poly_convert_h__ diff -Nru swftools-0.9.0/lib/gfxpoly/heap.h swftools-0.9.2/lib/gfxpoly/heap.h --- swftools-0.9.0/lib/gfxpoly/heap.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/heap.h 2010-11-12 18:52:16.000000000 +0000 @@ -0,0 +1,74 @@ +/* heap.h + + An inline heap implementation + + Copyright (c) 2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#define HEAP_DEFINE(name,t,lt) \ +typedef struct { \ + t**elements; \ + int size; \ + int max_size; \ +} name##_t; \ +static void name##_put(name##_t*h, t*e) \ +{ \ + int parent = h->size++; \ + if(h->size>=h->max_size) { \ + h->max_size = h->max_size<15?15:(h->max_size+1)*2-1; \ + h->elements = (t**)realloc(h->elements, \ + h->max_size*sizeof(t*)); \ + } \ + int node; \ + do { \ + node = parent; \ + if(!node) break; \ + parent = (node-1)/2; \ + h->elements[node] = h->elements[parent]; \ + } while(lt(e, h->elements[parent])); \ + h->elements[node] = e; \ +} \ +static t* name##_get(name##_t*h) \ +{ \ + if(!h->size) return 0; \ + t*r = h->elements[0]; \ + int node,child = 0; \ + t*node_p = h->elements[--h->size]; \ + h->elements[0] = node_p; /* for the size==1 case */ \ + do { \ + node = child; \ + child = node<<1|1; \ + if(child >= h->size) { \ + break; \ + } \ + if(child+1 < h->size && lt(h->elements[child+1], \ + h->elements[child])) \ + child++; \ + h->elements[node] = h->elements[child]; \ + } while(lt(h->elements[child],node_p)); \ + h->elements[node] = node_p; \ + return r; \ +} \ +static void name##_init(name##_t*h) \ +{ \ + memset(h, 0, sizeof(*h)); \ + h->max_size = 15; \ + h->elements = malloc(h->max_size*sizeof(t*)); \ +} \ +static void name##_destroy(name##_t*h) \ +{ \ + free((h)->elements); \ +} diff -Nru swftools-0.9.0/lib/gfxpoly/moments.c swftools-0.9.2/lib/gfxpoly/moments.c --- swftools-0.9.0/lib/gfxpoly/moments.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/moments.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,57 @@ +#include "moments.h" + +#define MOMENTS + +void moments_update(moments_t*moments, actlist_t*actlist, int32_t y1, int32_t y2) +{ + segment_t* s = actlist_leftmost(actlist); + segment_t* l = 0; + + /* the actual coordinate of grid points is at the bottom right, hence + we have to add 1.0 to both coordinates (or just 1.0 to the sum) */ + double mid = (y1+y2)/2.0 + 1.0; + + double area = 0.0; + + while(s) { + if(l && l->wind.is_filled) { + area += (XPOS(s,mid) - XPOS(l,mid)); + +#ifdef MOMENTS + double dx1 = (l->b.x - l->a.x) / (double)(l->b.y - l->a.y); + double o1 = l->a.x - l->a.y*dx1; + + double dx2 = (s->b.x - s->a.x) / (double)(s->b.y - s->a.y); + double o2 = s->b.x - s->b.y*dx2; + +#ifdef DEBUG + printf("y=%f-%f\n\tl1=([%f,%f,%f,%f] dx=%f o=%f)\n\tl2=([%f,%f,%f,%f] dx=%f o=%f)\n", + y1*0.05, y2*0.05, + l->a.x*0.05, l->a.y*0.05, l->b.x*0.05, l->b.y*0.05, dx1*0.05, o1*0.05, + s->a.x*0.05, s->a.y*0.05, s->b.x*0.05, s->b.y*0.05, dx2*0.05, o2*0.05); +#endif + +#define S1(y) 0.5*(1/3.0*(dx2*dx2-dx1*dx1)*(y)*(y)*(y)+1/2.0*(2*dx2*o2-2*dx1*o1)*(y)*(y)+(o2*o2-o1*o1)*(y)) + double m1x = S1(y2)-S1(y1); +#define S2(y) (1/3.0)*(1/4.0*(dx2*dx2*dx2-dx1*dx1*dx1)*(y)*(y)*(y)*(y)+1/3.0*(3*dx2*dx2*o2-3*dx1*dx1*o1)*(y)*(y)*(y)+1/2.0*(3*dx2*o2*o2-3*dx1*o1*o1)*(y)*(y)+(o2*o2*o2-o1*o1*o1)*(y)) + double m2x = S2(y2)-S2(y1); + moments->m[0][0] += (XPOS(s,mid) - XPOS(l,mid))*(y2-y1); + moments->m[1][0] += m1x; + moments->m[2][0] += m2x; +#endif + } + l = s; + s = s->right; + } + + area *= (y2-y1); + + moments->area += area; +} +void moments_normalize(moments_t*moments, double gridsize) +{ + moments->area *= gridsize*gridsize; + moments->m[0][0] *= gridsize*gridsize; + moments->m[1][0] *= gridsize*gridsize*gridsize*gridsize; + moments->m[2][0] *= gridsize*gridsize*gridsize*gridsize*gridsize*gridsize; +} diff -Nru swftools-0.9.0/lib/gfxpoly/moments.h swftools-0.9.2/lib/gfxpoly/moments.h --- swftools-0.9.0/lib/gfxpoly/moments.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/moments.h 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,9 @@ +#ifndef __moments_h__ +#define __moments_h__ + +#include "poly.h" +#include "active.h" + +void moments_update(moments_t*moments, actlist_t*actlist, int32_t y1, int32_t y2); +void moments_normalize(moments_t*moments, double gridsize); +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/poly.c swftools-0.9.2/lib/gfxpoly/poly.c --- swftools-0.9.0/lib/gfxpoly/poly.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/poly.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,1635 @@ +#include +#include +#include +#include +#include +#include "../mem.h" +#include "../types.h" +#include "poly.h" +#include "active.h" +#include "xrow.h" +#include "wind.h" +#include "convert.h" +#include "heap.h" +#include "moments.h" + +#ifdef HAVE_MD5 +#include "MD5.h" +#endif + +static gfxpoly_t*current_polygon = 0; +void gfxpoly_fail(char*expr, char*file, int line, const char*function) +{ + if(!current_polygon) { + fprintf(stderr, "assert(%s) failed in %s in line %d: %s\n", expr, file, line, function); + exit(1); + } + + char filename[32+4+1]; +#ifdef HAVE_MD5 + void*md5 = initialize_md5(); + + int s,t; + gfxpolystroke_t*stroke = current_polygon->strokes; + for(;stroke;stroke=stroke->next) { + for(t=0;tnum_points;t++) { + update_md5(md5, (unsigned char*)&stroke->points[t].x, sizeof(stroke->points[t].x)); + update_md5(md5, (unsigned char*)&stroke->points[t].y, sizeof(stroke->points[t].y)); + } + } + unsigned char h[16]; + finish_md5(md5, h); + sprintf(filename, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x.ps", + h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]); +#else + sprintf(filename, "%d", (int)time(0)); +#endif + + fprintf(stderr, "assert(%s) failed in %s in line %d: %s\n", expr, file, line, function); + fprintf(stderr, "I'm saving a debug file \"%s\" to the current directory.\n", filename); + + gfxpoly_save(current_polygon, filename); + exit(1); +} + +static char point_equals(const void*o1, const void*o2) +{ + const point_t*p1 = o1; + const point_t*p2 = o2; + return p1->x == p2->x && p1->y == p2->y; +} +static unsigned int point_hash(const void*o) +{ + const point_t*p = o; + return p->x^p->y; +} +static void* point_dup(const void*o) +{ + const point_t*p = o; + point_t*n = malloc(sizeof(point_t)); + n->x = p->x; + n->y = p->y; + return n; +} +static void point_free(void*o) +{ + point_t*p = o; + p->x = 0; + p->y = 0; + free(p); +} +type_t point_type = { + equals: point_equals, + hash: point_hash, + dup: point_dup, + free: point_free, +}; + +typedef struct _event { + eventtype_t type; + point_t p; + segment_t*s1; + segment_t*s2; +} event_t; + +/* compare_events_simple differs from compare_events in that it schedules + events from left to right regardless of type. It's only used in horizontal + processing, in order to get an x-wise sorting of the current scanline */ +static inline int compare_events_simple(const void*_a,const void*_b) +{ + event_t* a = (event_t*)_a; + event_t* b = (event_t*)_b; + int d = b->p.y - a->p.y; + if(d) return d; + d = b->p.x - a->p.x; + if(d) return d; + return 0; +} + +static inline int compare_events(const void*_a,const void*_b) +{ + event_t* a = (event_t*)_a; + event_t* b = (event_t*)_b; + int d = b->p.y - a->p.y; + if(d) return d; + /* we need to schedule end after intersect (so that a segment about + to end has a chance to tear up a few other segs first) and start + events after end (in order not to confuse the intersection check, which + assumes there's an actual y overlap between active segments, and + because ending segments in the active list make it difficult to insert + starting segments at the right position)). + Horizontal lines come last, because the only purpose + they have is to create snapping coordinates for the segments (still) + existing in this scanline. + */ + d = b->type - a->type; + if(d) return d; + return 0; + + /* I don't see any reason why we would need to order by x- at least as long + as we do horizontal lines in a seperate pass */ + //d = b->p.x - a->p.x; + //return d; +} + +#define COMPARE_EVENTS(x,y) (compare_events(x,y)>0) +#define COMPARE_EVENTS_SIMPLE(x,y) (compare_events_simple(x,y)>0) +HEAP_DEFINE(queue,event_t,COMPARE_EVENTS); +HEAP_DEFINE(hqueue,event_t,COMPARE_EVENTS_SIMPLE); + +typedef struct _horizontal { + int32_t y; + int32_t x1, x2; + edgestyle_t*fs; + segment_dir_t dir; + int polygon_nr; + int xpos; + int pos; +} horizontal_t; + +typedef struct _horizdata { + horizontal_t*data; + int num; + int size; +} horizdata_t; + +typedef struct _status { + int32_t y; + double gridsize; + actlist_t*actlist; + queue_t queue; + xrow_t*xrow; + windrule_t*windrule; + windcontext_t*context; + segment_t*ending_segments; + + horizdata_t horiz; + + gfxpolystroke_t*strokes; +#ifdef CHECKS + dict_t*seen_crossings; //list of crossing we saw so far + dict_t*intersecting_segs; //list of segments intersecting in this scanline + dict_t*segs_with_point; //lists of segments that received a point in this scanline +#endif +} status_t; + + +int gfxpoly_num_segments(gfxpoly_t*poly) +{ + gfxpolystroke_t*stroke = poly->strokes; + int count = 0; + for(;stroke;stroke=stroke->next) { + count++; + } + return count; +} +int gfxpoly_size(gfxpoly_t*poly) +{ + int s,t; + int edges = 0; + gfxpolystroke_t*stroke = poly->strokes; + for(;stroke;stroke=stroke->next) { + edges += stroke->num_points-1; + } + return edges; +} + +char gfxpoly_check(gfxpoly_t*poly, char updown) +{ + dict_t*d1 = dict_new2(&point_type); + dict_t*d2 = dict_new2(&point_type); + int s,t; + gfxpolystroke_t*stroke = poly->strokes; + for(;stroke;stroke=stroke->next) { + /* In order to not confuse the fill/wind logic, existing segments must have + a non-zero edge style */ + assert(stroke->fs); + + /* put all the segments into dictionaries so that we can check + that the endpoint multiplicity is two */ + for(s=0;snum_points;s++) { + point_t p = stroke->points[s]; + int num_xor = (s>=1 && snum_points-1)?2:1; // mid points are two points (start+end) + int num_circ = (s>=1 && snum_points-1)?0:(s==0?1:-1); + if(stroke->dir==DIR_UP) + num_circ=-num_circ; + + if(!dict_contains(d1, &p)) { + dict_put(d1, &p, (void*)(ptroff_t)num_xor); + if(updown) { + assert(!dict_contains(d2, &p)); + dict_put(d2, &p, (void*)(ptroff_t)num_circ); + } + } else { + int count = (ptroff_t)dict_lookup(d1, &p); + dict_del(d1, &p); + count+=num_xor; + dict_put(d1, &p, (void*)(ptroff_t)count); + + if(updown) { + assert(dict_contains(d2, &p)); + count = (ptroff_t)dict_lookup(d2, &p); + dict_del(d2, &p); + count+=num_circ; + dict_put(d2, &p, (void*)(ptroff_t)count); + } + } + } + } + DICT_ITERATE_ITEMS(d1, point_t*, p1, void*, c1) { + int count = (ptroff_t)c1; + if(count&1) { + fprintf(stderr, "Error: Point (%.2f,%.2f) occurs %d times\n", p1->x * poly->gridsize, p1->y * poly->gridsize, count); + dict_destroy(d1); + dict_destroy(d2); + return 0; + } + } + if(updown) { + DICT_ITERATE_ITEMS(d2, point_t*, p2, void*, c2) { + int count = (ptroff_t)c2; + assert(dict_contains(d1, p2)); + int ocount = (ptroff_t)dict_lookup(d1, p2); + if(count!=0) { + if(count>0) fprintf(stderr, "Error: Point (%.2f,%.2f) has %d more incoming than outgoing segments (%d incoming, %d outgoing)\n", p2->x * poly->gridsize, p2->y * poly->gridsize, count, (ocount+count)/2, (ocount-count)/2); + if(count<0) fprintf(stderr, "Error: Point (%.2f,%.2f) has %d more outgoing than incoming segments (%d incoming, %d outgoing)\n", p2->x * poly->gridsize, p2->y * poly->gridsize, -count, (ocount+count)/2, (ocount-count)/2); + gfxpolystroke_t*stroke = poly->strokes; + for(;stroke;stroke=stroke->next) { + for(s=0;snum_points-1;s++) { + point_t a = stroke->points[s]; + point_t b = stroke->points[s+1]; + if(a.x == p2->x && a.y == p2->y || + b.x == p2->x && b.y == p2->y) { + fprintf(stderr, "%.2f,%.2f -> %.2f,%.2f\n", + a.x * poly->gridsize, + a.y * poly->gridsize, + b.x * poly->gridsize, + b.y * poly->gridsize); + } + } + } + dict_destroy(d2); + return 0; + } + } + } + dict_destroy(d1); + dict_destroy(d2); + return 1; +} + +void gfxpoly_dump(gfxpoly_t*poly) +{ + int s,t; + double g = poly->gridsize; + fprintf(stderr, "polyon %p (gridsize: %.2f)\n", poly, poly->gridsize); + gfxpolystroke_t*stroke = poly->strokes; + for(;stroke;stroke=stroke->next) { + fprintf(stderr, "%11p", stroke); + if(stroke->dir==DIR_UP) { + for(s=stroke->num_points-1;s>=1;s--) { + point_t a = stroke->points[s]; + point_t b = stroke->points[s-1]; + fprintf(stderr, "%s (%.2f,%.2f) -> (%.2f,%.2f)%s%s\n", s!=stroke->num_points-1?" ":"", a.x*g, a.y*g, b.x*g, b.y*g, + s==1?"]":"", a.y==b.y?"H":""); + } + } else { + for(s=0;snum_points-1;s++) { + point_t a = stroke->points[s]; + point_t b = stroke->points[s+1]; + fprintf(stderr, "%s (%.2f,%.2f) -> (%.2f,%.2f)%s%s\n", s?" ":"", a.x*g, a.y*g, b.x*g, b.y*g, + s==stroke->num_points-2?"]":"", a.y==b.y?"H":""); + } + } + } +} + +void gfxpoly_save(gfxpoly_t*poly, const char*filename) +{ + FILE*fi = fopen(filename, "wb"); + fprintf(fi, "%% gridsize %f\n", poly->gridsize); + fprintf(fi, "%% begin\n"); + int s,t; + gfxpolystroke_t*stroke = poly->strokes; + for(;stroke;stroke=stroke->next) { + fprintf(fi, "%g setgray\n", stroke->dir==DIR_UP ? 0.7 : 0); + point_t p = stroke->points[0]; + fprintf(fi, "%d %d moveto\n", p.x, p.y); + for(s=1;snum_points;s++) { + p = stroke->points[s]; + fprintf(fi, "%d %d lineto\n", p.x, p.y); + } + fprintf(fi, "stroke\n"); + } + fprintf(fi, "showpage\n"); + fclose(fi); +} + +void gfxpoly_save_arrows(gfxpoly_t*poly, const char*filename) +{ + FILE*fi = fopen(filename, "wb"); + fprintf(fi, "%% gridsize %f\n", poly->gridsize); + fprintf(fi, "%% begin\n"); + int t; + double l = 5.0 / poly->gridsize; + double g = poly->gridsize; + gfxpolystroke_t*stroke = poly->strokes; + for(;stroke;stroke=stroke->next) { + fprintf(fi, "0 setgray\n"); + + int s = stroke->dir==DIR_UP?stroke->num_points-1:0; + int end = stroke->dir==DIR_UP?-1:stroke->num_points; + int dir = stroke->dir==DIR_UP?-1:1; + + point_t p = stroke->points[s]; + s+=dir; + point_t o = p; + fprintf(fi, "%f %f moveto\n", p.x * g, p.y * g); + for(;s!=end;s+=dir) { + p = stroke->points[s]; + int lx = p.x - o.x; + int ly = p.y - o.y; + double d = sqrt(lx*lx+ly*ly); + if(!d) d=1; + else d = l / d; + double d2 = d*1.5; + fprintf(fi, "%f %f lineto\n", (p.x - lx*d2) * g, (p.y - ly*d2) * g); + fprintf(fi, "%f %f lineto\n", (p.x - lx*d2 + (ly*d))*g, + (p.y - ly*d2 - (lx*d))*g); + fprintf(fi, "%f %f lineto\n", p.x * g, p.y * g); + fprintf(fi, "%f %f lineto\n", (p.x - lx*d2 - (ly*d))*g, + (p.y - ly*d2 + (lx*d))*g); + fprintf(fi, "%f %f lineto\n", (p.x - lx*d2) * g, (p.y - ly*d2) * g); + fprintf(fi, "%f %f moveto\n", p.x * g, p.y * g); + o = p; + } + fprintf(fi, "stroke\n"); + } + fprintf(fi, "showpage\n"); + fclose(fi); +} + +inline static event_t* event_new() +{ + event_t*e = rfx_calloc(sizeof(event_t)); + return e; +} +inline static void event_free(event_t*e) +{ + free(e); +} + +static void event_dump(status_t*status, event_t*e) +{ + if(e->type == EVENT_HORIZONTAL) { + fprintf(stderr, "Horizontal [%d] (%.2f,%.2f) -> (%.2f,%.2f)\n", (int)e->s1->nr, + e->s1->a.x * status->gridsize, e->s1->a.y * status->gridsize, e->s1->b.x * status->gridsize, e->s1->b.y * status->gridsize); + } else if(e->type == EVENT_START) { + fprintf(stderr, "event: segment [%d] starts at (%.2f,%.2f)\n", (int)e->s1->nr, + e->p.x * status->gridsize, e->p.y * status->gridsize); + } else if(e->type == EVENT_END) { + fprintf(stderr, "event: segment [%d] ends at (%.2f,%.2f)\n", (int)e->s1->nr, + e->p.x * status->gridsize, e->p.y * status->gridsize); + } else if(e->type == EVENT_CROSS) { + fprintf(stderr, "event: segment [%d] and [%d] intersect at (%.2f,%.2f)\n", (int)e->s1->nr, (int)e->s2->nr, + e->p.x * status->gridsize, e->p.y * status->gridsize); + } else { + assert(0); + } +} + +static inline int32_t max32(int32_t v1, int32_t v2) {return v1>v2?v1:v2;} +static inline int32_t min32(int32_t v1, int32_t v2) {return v1(%d,%d) ", (int)s->nr, s->a.x, s->a.y, s->b.x, s->b.y); + fprintf(stderr, " dx:%d dy:%d k:%f dx/dy=%f fs=%p\n", s->delta.x, s->delta.y, s->k, + (double)s->delta.x / s->delta.y, s->fs); +} + +static void segment_init(segment_t*s, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int polygon_nr, segment_dir_t dir) +{ + static int segment_count=0; + s->nr = segment_count++; + s->dir = dir; + if(y1!=y2) { + assert(y1x2) { + s->dir = DIR_INVERT(s->dir); + int32_t x = x1;x1=x2;x2=x; + int32_t y = y1;y1=y2;y2=y; + } +#ifdef DEBUG + fprintf(stderr, "Scheduling horizontal segment [%d] (%.2f,%.2f) -> (%.2f,%.2f) %s\n", + segment_count, + x1 * 0.05, y1 * 0.05, x2 * 0.05, y2 * 0.05, s->dir==DIR_UP?"up":"down"); +#endif + } + s->a.x = x1; + s->a.y = y1; + s->b.x = x2; + s->b.y = y2; + s->k = (double)x1*y2-(double)x2*y1; + s->left = s->right = 0; + s->delta.x = x2-x1; + s->delta.y = y2-y1; + s->minx = min32(x1,x2); + s->maxx = max32(x1,x2); + + s->pos = s->a; + s->polygon_nr = polygon_nr; + +#ifdef CHECKS + /* notice: on some systems (with some compilers), for the line + (1073741823,-1073741824)->(1073741823,1073741823) + we get LINE_EQ(s->a, s) == 1. + That's why we now clamp to 26 bit. + */ + assert(LINE_EQ(s->a, s) == 0); + assert(LINE_EQ(s->b, s) == 0); + + /* check that all signs are in order: + a a + |\ /| + | \ / | + minx-b b--maxx + < 0 > 0 + */ + point_t p = s->b; + p.x = min32(s->a.x, s->b.x); + assert(LINE_EQ(p, s) <= 0); + p.x = max32(s->a.x, s->b.x); + assert(LINE_EQ(p, s) >= 0); +#endif + +#ifndef DONT_REMEMBER_CROSSINGS + dict_init2(&s->scheduled_crossings, &ptr_type, 0); +#endif +} + +static segment_t* segment_new(point_t a, point_t b, int polygon_nr, segment_dir_t dir) +{ + segment_t*s = (segment_t*)rfx_calloc(sizeof(segment_t)); + segment_init(s, a.x, a.y, b.x, b.y, polygon_nr, dir); + return s; +} + +static void segment_clear(segment_t*s) +{ +#ifndef DONT_REMEMBER_CROSSINGS + dict_clear(&s->scheduled_crossings); +#endif +} +static void segment_destroy(segment_t*s) +{ + segment_clear(s); + free(s); +} + +static void advance_stroke(queue_t*queue, hqueue_t*hqueue, gfxpolystroke_t*stroke, int polygon_nr, int pos, double gridsize) +{ + if(!stroke) + return; + segment_t*s = 0; + /* we need to queue multiple segments at once because we need to process start events + before horizontal events */ + while(pos < stroke->num_points-1) { + assert(stroke->points[pos].y <= stroke->points[pos+1].y); + s = segment_new(stroke->points[pos], stroke->points[pos+1], polygon_nr, stroke->dir); + s->fs = stroke->fs; + pos++; + s->stroke = 0; + s->stroke_pos = 0; +#ifdef DEBUG + /*if(l->tmp) + s->nr = l->tmp;*/ + fprintf(stderr, "[%d] (%.2f,%.2f) -> (%.2f,%.2f) %s (stroke %p, %d more to come)\n", + s->nr, s->a.x * gridsize, s->a.y * gridsize, + s->b.x * gridsize, s->b.y * gridsize, + s->dir==DIR_UP?"up":"down", stroke, stroke->num_points - 1 - pos); +#endif + event_t* e = event_new(); + e->type = s->delta.y ? EVENT_START : EVENT_HORIZONTAL; + e->p = s->a; + e->s1 = s; + e->s2 = 0; + + if(queue) queue_put(queue, e); + else hqueue_put(hqueue, e); + + if(e->type != EVENT_HORIZONTAL) { + break; + } + } + if(s) { + s->stroke = stroke; + s->stroke_pos = pos; + } +} + +static void gfxpoly_enqueue(gfxpoly_t*p, queue_t*queue, hqueue_t*hqueue, int polygon_nr) +{ + int t; + gfxpolystroke_t*stroke = p->strokes; + for(;stroke;stroke=stroke->next) { + assert(stroke->num_points > 1); + +#ifdef CHECKS + int s; + for(s=0;snum_points-1;s++) { + assert(stroke->points[s].y <= stroke->points[s+1].y); + } +#endif + advance_stroke(queue, hqueue, stroke, polygon_nr, 0, p->gridsize); + } +} + +static void schedule_endpoint(status_t*status, segment_t*s) +{ + // schedule end point of segment + assert(s->b.y > status->y); + event_t*e = event_new(); + e->type = EVENT_END; + e->p = s->b; + e->s1 = s; + e->s2 = 0; + queue_put(&status->queue, e); +} + +static void schedule_crossing(status_t*status, segment_t*s1, segment_t*s2) +{ + /* the code that's required (and the checks you can perform) before + it can be said with 100% certainty that we indeed have a valid crossing + amazes me every time. -mk */ +#ifdef CHECKS + assert(s1!=s2); + assert(s1->right == s2); + assert(s2->left == s1); + int32_t miny1 = min32(s1->a.y,s1->b.y); + int32_t maxy1 = max32(s1->a.y,s1->b.y); + int32_t miny2 = min32(s2->a.y,s2->b.y); + int32_t maxy2 = max32(s2->a.y,s2->b.y); + int32_t minx1 = min32(s1->a.x,s1->b.x); + int32_t minx2 = min32(s2->a.x,s2->b.x); + int32_t maxx1 = max32(s1->a.x,s1->b.x); + int32_t maxx2 = max32(s2->a.x,s2->b.x); + /* check that precomputation is sane */ + assert(minx1 == s1->minx && minx2 == s2->minx); + assert(maxx1 == s1->maxx && maxx2 == s2->maxx); + /* both segments are active, so this can't happen */ + assert(!(maxy1 <= miny2 || maxy2 <= miny1)); + /* we know that right now, s2 is to the right of s1, so there's + no way the complete bounding box of s1 is to the right of s1 */ + assert(!(s1->minx > s2->maxx)); + assert(s1->minx != s2->maxx || (!s1->delta.x && !s2->delta.x)); +#endif + + if(s1->maxx <= s2->minx) { +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: bounding boxes don't intersect\n", s1->nr, s2->nr); +#endif + /* bounding boxes don't intersect */ + return; + } + +#ifndef DONT_REMEMBER_CROSSINGS + if(dict_contains(&s1->scheduled_crossings, (void*)(ptroff_t)s2->nr)) { + /* FIXME: this whole segment hashing thing is really slow */ +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: we already scheduled this intersection\n", s1->nr, s2->nr); +// DICT_ITERATE_KEY(&s1->scheduled_crossings, void*, x) { +// fprintf(stderr, "[%d]<->[%d]\n", s1->nr, (int)(ptroff_t)x); +// } +#endif + return; // we already know about this one + } +#endif + + double det = (double)s1->delta.x*s2->delta.y - (double)s1->delta.y*s2->delta.x; + if(!det) { + if(s1->k == s2->k) { + // lines are exactly on top of each other (ignored) +#ifdef DEBUG + fprintf(stderr, "Notice: segments [%d] and [%d] are exactly on top of each other\n", s1->nr, s2->nr); +#endif + return; + } else { +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: they are parallel to each other\n", s1->nr, s2->nr); +#endif + /* lines are parallel */ + return; + } + } + + double asign2 = LINE_EQ(s1->a, s2); + if(asign2==0) { + // segment1 touches segment2 in a single point (ignored) +#ifdef DEBUG + fprintf(stderr, "Notice: segment [%d]'s start point touches segment [%d]\n", s1->nr, s2->nr); +#endif + return; + } + double bsign2 = LINE_EQ(s1->b, s2); + if(bsign2==0) { + // segment1 touches segment2 in a single point (ignored) +#ifdef DEBUG + fprintf(stderr, "Notice: segment [%d]'s end point touches segment [%d]\n", s1->nr, s2->nr); +#endif + return; + } + + if(asign2<0 && bsign2<0) { + // segment1 is completely to the left of segment2 +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: [%d] is completely to the left of [%d]\n", s1->nr, s2->nr, s1->nr, s2->nr); +#endif + return; + } + if(asign2>0 && bsign2>0) { + // segment1 is completely to the right of segment2 +#ifndef DONT_REMEMBER_CROSSINGS + assert(0); +#endif +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: [%d] is completely to the left of [%d]\n", s1->nr, s2->nr, s2->nr, s1->nr); +#endif + return; + } + + double asign1 = LINE_EQ(s2->a, s1); + if(asign1==0) { + // segment2 touches segment1 in a single point (ignored) +#ifdef DEBUG + fprintf(stderr, "Notice: segment [%d]'s start point touches segment [%d]\n", s2->nr, s1->nr); +#endif + return; + } + double bsign1 = LINE_EQ(s2->b, s1); + if(asign2==0) { + // segment2 touches segment1 in a single point (ignored) +#ifdef DEBUG + fprintf(stderr, "Notice: segment [%d]'s end point touches segment [%d]\n", s2->nr, s1->nr); +#endif + return; + } + + if(asign1<0 && bsign1<0) { + // segment2 is completely to the left of segment1 +#ifndef DONT_REMEMBER_CROSSINGS + assert(0); +#endif +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: [%d] is completely to the left of [%d]\n", s1->nr, s2->nr, s1->nr, s2->nr); +#endif + return; + } + if(asign1>0 && bsign1>0) { + // segment2 is completely to the right of segment1 +#ifdef DEBUG + fprintf(stderr, "[%d] doesn't intersect with [%d] because: [%d] is completely to the left of [%d]\n", s1->nr, s2->nr, s2->nr, s1->nr); +#endif + return; + } + +#ifdef DONT_REMEMBER_CROSSINGS + /* s2 crosses s1 from *left* to *right*. This is a crossing we already processed- + there's not way s2 would be to the left of s1 otherwise */ + if(asign1<0 && bsign1>0) return; + if(asign2>0 && bsign2<0) return; +#endif + + assert(!(asign1<0 && bsign1>0)); + assert(!(asign2>0 && bsign2<0)); + + /* TODO: should we precompute these? */ + double la = (double)s1->a.x*(double)s1->b.y - (double)s1->a.y*(double)s1->b.x; + double lb = (double)s2->a.x*(double)s2->b.y - (double)s2->a.y*(double)s2->b.x; + + point_t p; + p.x = (int32_t)ceil((-la*s2->delta.x + lb*s1->delta.x) / det); + p.y = (int32_t)ceil((+lb*s1->delta.y - la*s2->delta.y) / det); + + assert(p.y >= status->y); +#ifdef CHECKS + assert(p.x >= s1->minx && p.x <= s1->maxx); + assert(p.x >= s2->minx && p.x <= s2->maxx); + + point_t pair; + pair.x = s1->nr; + pair.y = s2->nr; +#ifndef DONT_REMEMBER_CROSSINGS + assert(!dict_contains(status->seen_crossings, &pair)); + dict_put(status->seen_crossings, &pair, 0); +#endif +#endif +#ifdef DEBUG + fprintf(stderr, "schedule crossing between [%d] and [%d] at (%d,%d)\n", s1->nr, s2->nr, p.x, p.y); +#endif + +#ifndef DONT_REMEMBER_CROSSINGS + /* we insert into each other's intersection history because these segments might switch + places and we still want to look them up quickly after they did */ + dict_put(&s1->scheduled_crossings, (void*)(ptroff_t)(s2->nr), 0); + dict_put(&s2->scheduled_crossings, (void*)(ptroff_t)(s1->nr), 0); +#endif + + event_t* e = event_new(); + e->type = EVENT_CROSS; + e->p = p; + e->s1 = s1; + e->s2 = s2; + queue_put(&status->queue, e); + return; +} + +static void exchange_two(status_t*status, event_t*e) +{ + //exchange two segments in list + segment_t*s1 = e->s1; + segment_t*s2 = e->s2; +#ifdef CHECKS + if(!dict_contains(status->intersecting_segs, s1)) + dict_put(status->intersecting_segs, s1, 0); + if(!dict_contains(status->intersecting_segs, s2)) + dict_put(status->intersecting_segs, s2, 0); +#endif + assert(s2->left == s1); + assert(s1->right == s2); + actlist_swap(status->actlist, s1, s2); + assert(s2->right == s1); + assert(s1->left == s2); + segment_t*left = s2->left; + segment_t*right = s1->right; + if(left) + schedule_crossing(status, left, s2); + if(right) + schedule_crossing(status, s1, right); +} + +typedef struct _box { + point_t left1, left2, right1, right2; +} box_t; +static inline box_t box_new(int32_t x, int32_t y) +{ + box_t box; + box.right1.x = box.right2.x = x; + box.left1.x = box.left2.x = x-1; + box.left1.y = box.right1.y = y-1; + box.left2.y = box.right2.y = y; + return box; +} + +static void store_horizontal(status_t*status, point_t p1, point_t p2, edgestyle_t*fs, segment_dir_t dir, int polygon_nr); + +static void append_stroke(status_t*status, point_t a, point_t b, segment_dir_t dir, edgestyle_t*fs) +{ + gfxpolystroke_t*stroke = status->strokes; + /* find a stoke to attach this segment to. It has to have an endpoint + matching our start point, and a matching edgestyle */ + while(stroke) { + point_t p = stroke->points[stroke->num_points-1]; + if(p.x == a.x && p.y == a.y && stroke->fs == fs && stroke->dir == dir) + break; + stroke = stroke->next; + } + if(!stroke) { + stroke = rfx_calloc(sizeof(gfxpolystroke_t)); + stroke->dir = dir; + stroke->fs = fs; + stroke->next = status->strokes; + status->strokes = stroke; + stroke->points_size = 2; + stroke->points = rfx_calloc(sizeof(point_t)*stroke->points_size); + stroke->points[0] = a; + stroke->num_points = 1; + } else if(stroke->num_points == stroke->points_size) { + assert(stroke->fs); + stroke->points_size *= 2; + stroke->points = rfx_realloc(stroke->points, sizeof(point_t)*stroke->points_size); + } + stroke->points[stroke->num_points++] = b; +} + +static void insert_point_into_segment(status_t*status, segment_t*s, point_t p) +{ + assert(s->pos.x != p.x || s->pos.y != p.y); + +#ifdef CHECKS + if(!dict_contains(status->segs_with_point, s)) + dict_put(status->segs_with_point, s, 0); + assert(s->fs_out_ok); +#endif + + if(s->pos.y != p.y) { + /* non horizontal line- copy to output */ + if(s->fs_out) { + segment_dir_t dir = s->wind.is_filled?DIR_DOWN:DIR_UP; +#ifdef DEBUG + fprintf(stderr, "[%d] receives next point (%.2f,%.2f)->(%.2f,%.2f) (drawing (%s))\n", s->nr, + s->pos.x * status->gridsize, s->pos.y * status->gridsize, + p.x * status->gridsize, p.y * status->gridsize, + dir==DIR_UP?"up":"down" + ); +#endif + assert(s->pos.y != p.y); + append_stroke(status, s->pos, p, dir, s->fs_out); + } else { +#ifdef DEBUG + fprintf(stderr, "[%d] receives next point (%.2f,%.2f) (omitting)\n", s->nr, + p.x * status->gridsize, + p.y * status->gridsize); +#endif + } + } else { + /* horizontal line. we need to look at this more closely at the end of this + scanline */ + store_horizontal(status, s->pos, p, s->fs, s->dir, s->polygon_nr); + } + + s->pos = p; +} + +typedef struct _segrange { + double xmin; + segment_t*segmin; + double xmax; + segment_t*segmax; +} segrange_t; + +static void segrange_adjust_endpoints(segrange_t*range, int32_t y) +{ +#define XPOS_EQ(s1,s2,ypos) (XPOS((s1),(ypos))==XPOS((s2),(ypos))) + segment_t*min = range->segmin; + segment_t*max = range->segmax; + + /* we need this because if two segments intersect exactly on + the scanline, segrange_test_segment_{min,max} can't tell which + one is smaller/larger */ + if(min) while(min->left && XPOS_EQ(min, min->left, y)) { + min = min->left; + } + if(max) while(max->right && XPOS_EQ(max, max->right, y)) { + max = max->right; + } + range->segmin = min; + range->segmax = max; +} +static void segrange_test_segment_min(segrange_t*range, segment_t*seg, int32_t y) +{ + if(!seg) return; + /* we need to calculate the xpos anew (and can't use start coordinate or + intersection coordinate), because we need the xpos exactly at the end of + this scanline. + */ + double x = XPOS(seg, y); + if(!range->segmin || xxmin) { + range->segmin = seg; + range->xmin = x; + } +} +static void segrange_test_segment_max(segrange_t*range, segment_t*seg, int32_t y) +{ + if(!seg) return; + double x = XPOS(seg, y); + if(!range->segmax || x>range->xmax) { + range->segmax = seg; + range->xmax = x; + } +} + +/* + SLOPE_POSITIVE: + \+ \ + +------ I \I + -I\---- I + I \ --I\--- + I \ I \ ------- + + \ + \ +*/ +static void add_points_to_positively_sloped_segments(status_t*status, int32_t y, segrange_t*range) +{ + segment_t*first=0, *last = 0; + int t; + for(t=0;txrow->num;t++) { + box_t box = box_new(status->xrow->x[t], y); + segment_t*seg = actlist_find(status->actlist, box.left2, box.left2); + + seg = actlist_right(status->actlist, seg); + while(seg) { + if(seg->a.y == y) { + // this segment started in this scanline, ignore it + seg->changed = 1;last = seg;if(!first) {first=seg;} + } else if(seg->delta.x <= 0) { + // ignore segment w/ negative slope + } else { + last = seg;if(!first) {first=seg;} + double d1 = LINE_EQ(box.right1, seg); + double d2 = LINE_EQ(box.right2, seg); + if(d1>0 || d2>=0) { + seg->changed = 1; + insert_point_into_segment(status, seg, box.right2); + } else { + /* we unfortunately can't break here- the active list is sorted according + to the *bottom* of the scanline. hence pretty much everything that's still + coming might reach into our box */ + //break; + } + } + seg = seg->right; + } + } + segrange_test_segment_min(range, first, y); + segrange_test_segment_max(range, last, y); +} +/* SLOPE_NEGATIVE: + | + /| + / / + | I / | I / / + | I / | I/ / + | I/ | I / + | I | /I / + | /+ |/ + / +*/ +static void add_points_to_negatively_sloped_segments(status_t*status, int32_t y, segrange_t*range) +{ + segment_t*first=0, *last = 0; + int t; + for(t=status->xrow->num-1;t>=0;t--) { + box_t box = box_new(status->xrow->x[t], y); + segment_t*seg = actlist_find(status->actlist, box.right2, box.right2); + + while(seg) { + if(seg->a.y == y) { + // this segment started in this scanline, ignore it + seg->changed = 1;last = seg;if(!first) {first=seg;} + } else if(seg->delta.x > 0) { + // ignore segment w/ positive slope + } else { + last = seg;if(!first) {first=seg;} + double d1 = LINE_EQ(box.left1, seg); + double d2 = LINE_EQ(box.left2, seg); + if(d1<0 || d2<0) { + seg->changed = 1; + insert_point_into_segment(status, seg, box.right2); + } else { + //break; + } + } + seg = seg->left; + } + } + segrange_test_segment_min(range, last, y); + segrange_test_segment_max(range, first, y); +} + +/* segments ending in the current scanline need xrow treatment like everything else. + (consider an intersection taking place just above a nearly horizontal segment + ending on the current scanline- the intersection would snap down *below* the + ending segment if we don't add the intersection point to the latter right away) + we need to treat ending segments seperately, however. we have to delete them from + the active list right away to make room for intersect operations (which might + still be in the current scanline- consider two 45° polygons and a vertical polygon + intersecting on an integer coordinate). but once they're no longer in the active list, + we can't use the add_points_to_*_sloped_segments() functions anymore, and re-adding + them to the active list just for point snapping would be overkill. + (One other option to consider, however, would be to create a new active list only + for ending segments) +*/ +static void add_points_to_ending_segments(status_t*status, int32_t y) +{ + segment_t*seg = status->ending_segments; + while(seg) { + segment_t*next = seg->right;seg->right=0; + + assert(seg->b.y == status->y); + + if(status->xrow->num == 1) { + // shortcut + assert(seg->b.x == status->xrow->x[0]); + point_t p = {status->xrow->x[0], y}; + insert_point_into_segment(status, seg, p); + } else { + int t; + int start=0,end=status->xrow->num,dir=1; + if(seg->delta.x < 0) { + start = status->xrow->num-1; + end = dir = -1; + } +#ifdef CHECKS + char ok = 0; +#endif + for(t=start;t!=end;t+=dir) { + box_t box = box_new(status->xrow->x[t], y); + double d0 = LINE_EQ(box.left1, seg); + double d1 = LINE_EQ(box.left2, seg); + double d2 = LINE_EQ(box.right1, seg); + double d3 = LINE_EQ(box.right2, seg); + if(!(d0>=0 && d1>=0 && d2>=0 && d3>0 || + d0<=0 && d1<=0 && d2<=0 && d3<0)) { + insert_point_into_segment(status, seg, box.right2); + //break; +#ifdef CHECKS + ok = 1; +#endif + } + } + +#ifdef CHECKS + /* we *need* to find a point to insert. the segment's own end point + is in that list, for Pete's sake. */ + assert(ok); +#endif + } + // now that this is done, too, we can also finally free this segment + segment_destroy(seg); + seg = next; + } + status->ending_segments = 0; +} + +static void recalculate_windings(status_t*status, segrange_t*range) +{ +#ifdef DEBUG + fprintf(stderr, "range: [%d]..[%d]\n", SEGNR(range->segmin), SEGNR(range->segmax)); +#endif + segrange_adjust_endpoints(range, status->y); + + segment_t*s = range->segmin; + segment_t*end = range->segmax; + segment_t*last = 0; + +#ifdef DEBUG + s = actlist_leftmost(status->actlist); + while(s) { + fprintf(stderr, "[%d]%d%s ", s->nr, s->changed, + s == range->segmin?"S":( + s == range->segmax?"E":"")); + s = s->right; + } + fprintf(stderr, "\n"); + s = range->segmin; +#endif +#ifdef CHECKS + /* test sanity: verify that we don't have changed segments + outside of the given range */ + s = actlist_leftmost(status->actlist); + while(s && s!=range->segmin) { + assert(!s->changed); + s = s->right; + } + s = actlist_rightmost(status->actlist); + while(s && s!=range->segmax) { + assert(!s->changed); + s = s->left; + } + /* in check mode, go through the whole interval so we can test + that all polygons where the edgestyle changed also have seg->changed=1 */ + s = actlist_leftmost(status->actlist); + end = 0; +#endif + + if(end) + end = end->right; + while(s!=end) { +#ifndef CHECKS + if(s->changed) +#endif + { + segment_t* left = actlist_left(status->actlist, s); + windstate_t wind = left?left->wind:status->windrule->start(status->context); + s->wind = status->windrule->add(status->context, wind, s->fs, s->dir, s->polygon_nr); + edgestyle_t*fs_old = s->fs_out; + s->fs_out = status->windrule->diff(&wind, &s->wind); + +#ifdef DEBUG + fprintf(stderr, "[%d] dir=%s wind=%d wind.filled=%s fs_old/new=%s/%s %s\n", s->nr, s->dir==DIR_UP?"up":"down", s->wind.wind_nr, s->wind.is_filled?"fill":"nofill", + fs_old?"draw":"omit", s->fs_out?"draw":"omit", + fs_old!=s->fs_out?"CHANGED":""); +#endif + assert(!(!s->changed && fs_old!=s->fs_out)); + s->changed = 0; + +#ifdef CHECKS + s->fs_out_ok = 1; +#endif + } + s = s->right; + } +} + +/* we need to handle horizontal lines in order to add points to segments + we otherwise would miss during the windrule re-evaluation */ +static void intersect_with_horizontal(status_t*status, segment_t*h) +{ + segment_t* left = actlist_find(status->actlist, h->a, h->a); + segment_t* right = actlist_find(status->actlist, h->b, h->b); + + /* h->a.x is not strictly necessary, as it's also done by the event */ + xrow_add(status->xrow, h->a.x); + xrow_add(status->xrow, h->b.x); + + if(!right) { + assert(!left); + return; + } + + left = actlist_right(status->actlist, left); //first seg to the right of h->a + right = right->right; //first seg to the right of h->b + segment_t* s = left; + + point_t o = h->a; + while(s!=right) { + assert(s); + int32_t x = XPOS_INT(s, status->y); + point_t p = {x, status->y}; +#ifdef DEBUG + fprintf(stderr, "...intersecting with [%d] (%.2f,%.2f) -> (%.2f,%.2f) at (%.2f,%.2f)\n", + s->nr, + s->a.x * status->gridsize, s->a.y * status->gridsize, + s->b.x * status->gridsize, s->b.y * status->gridsize, + x * status->gridsize, status->y * status->gridsize + ); +#endif + assert(x >= h->a.x); + assert(x <= h->b.x); + assert(s->delta.x > 0 && x >= s->a.x || s->delta.x <= 0 && x <= s->a.x); + assert(s->delta.x > 0 && x <= s->b.x || s->delta.x <= 0 && x >= s->b.x); + xrow_add(status->xrow, x); + + o = p; + s = s->right; + } +} + +/* while, for a scanline, we need both starting as well as ending segments in order + to *reconstruct* horizontal lines, we only need one or the other to *process* + horizontal lines from the input data. + + So horizontal lines are processed twice: first they create hotpixels by intersecting + all segments on the scanline (EVENT_HORIZTONAL). Secondly, they are processed for + their actual content. The second also happens for all segments that received more than + one point in this scanline. +*/ +void horiz_reset(horizdata_t*horiz) +{ + horiz->num = 0; +} + +void horiz_destroy(horizdata_t*horiz) +{ + if(horiz->data) rfx_free(horiz->data); + horiz->data = 0; +} + +static windstate_t get_horizontal_first_windstate(status_t*status, int x1, int x2) +{ + point_t p1 = {x1,status->y}; + point_t p2 = {x2,status->y}; + segment_t*left = actlist_find(status->actlist, p1, p2); + + segment_t*a = actlist_right(status->actlist, left); + while(a) { + if(a->pos.y == status->y) { + /* we need to iterate through all segments that received a point in this + scanline, as actlist_find above will miss (positively sloped) segments + that are to the right of (x1,y) only as long as we don't take the + hotpixel re-routing into account + TODO: this is inefficient, we should probably be iterating through the + hotpixels on this scanline. + */ + if(a->pos.x == x1) + left = a; + if(a->pos.x > x1) + break; + } + a = a->right; + } + + assert(!left || left->fs_out_ok); +#ifdef DEBUG + fprintf(stderr, " fragment %.2f..%.2f\n", + x1 * status->gridsize, + x2 * status->gridsize); + if(left) { + fprintf(stderr, " segment [%d] (%.2f,%.2f -> %.2f,%2f, at %.2f,%.2f) is to the left\n", + SEGNR(left), + left->a.x * status->gridsize, + left->a.y * status->gridsize, + left->b.x * status->gridsize, + left->b.y * status->gridsize, + left->pos.x * status->gridsize, + left->pos.y * status->gridsize + ); + /* this segment might be a distance away from the left point + of the horizontal line if the horizontal line belongs to a stroke + with segments that just ended (so this horizontal line appears to + be "floating in space" from our current point of view) + assert(left->pos.y == h->y && left->pos.x == h->x1); + */ + } +#endif + return left?left->wind:status->windrule->start(status->context); +} + +static windstate_t process_horizontal_fragment(status_t*status, horizontal_t*h, int x1, int x2, windstate_t below) +{ + windstate_t above = status->windrule->add(status->context, below, h->fs, h->dir, h->polygon_nr); + edgestyle_t*fs = status->windrule->diff(&above, &below); + + segment_dir_t dir = above.is_filled?DIR_DOWN:DIR_UP; + point_t p1 = {x1,h->y}; + point_t p2 = {x2,h->y}; + + if(fs) { + //append_stroke(status, p1, p2, DIR_INVERT(h->dir), fs); + append_stroke(status, p1, p2, dir, fs); + } +#ifdef DEBUG + fprintf(stderr, " ...%s (below: (wind_nr=%d, filled=%d), above: (wind_nr=%d, filled=%d) %s %d-%d\n", + fs?"storing":"ignoring", + below.wind_nr, below.is_filled, + above.wind_nr, above.is_filled, + dir==DIR_UP?"up":"down", x1, x2); +#endif + return above; +} + +typedef enum {hevent_hotpixel,hevent_end,hevent_start} horizontal_event_type_t; +typedef struct _hevent { + int32_t x; + horizontal_t*h; + horizontal_event_type_t type; +} hevent_t; + +typedef struct _hevents { + hevent_t*events; + int num; +} hevents_t; + +static int compare_hevents(const void *_e1, const void *_e2) +{ + hevent_t*e1 = (hevent_t*)_e1; + hevent_t*e2 = (hevent_t*)_e2; + int diff = e1->x - e2->x; + if(diff) return diff; + return e1->type - e2->type; //schedule hotpixel before hend +} + +static hevents_t hevents_fill(status_t*status) +{ + horizdata_t*horiz = &status->horiz; + xrow_t*xrow = status->xrow; + + hevents_t e; + e.events = malloc(sizeof(hevent_t)*(horiz->num*2 + xrow->num)); + e.num = 0; + + int t; + for(t=0;tnum;t++) { + assert(horiz->data[t].x1 != horiz->data[t].x2); + e.events[e.num].x = horiz->data[t].x1; + e.events[e.num].h = &horiz->data[t]; + e.events[e.num].type = hevent_start; + e.num++; + e.events[e.num].x = horiz->data[t].x2; + e.events[e.num].h = &horiz->data[t]; + e.events[e.num].type = hevent_end; + e.num++; + } + for(t=0;tnum;t++) { + e.events[e.num].x = status->xrow->x[t]; + e.events[e.num].h = 0; + e.events[e.num].type = hevent_hotpixel; + e.num++; + } + qsort(e.events, e.num, sizeof(hevent_t), compare_hevents); + return e; + +} + +static void process_horizontals(status_t*status) +{ + horizdata_t*horiz = &status->horiz; + + if(!horiz->num) + return; + + hevents_t events = hevents_fill(status); + int num_open = 0; + horizontal_t**open = malloc(sizeof(horizontal_t*)*horiz->num); + + int s,t; + for(t=0;ttype) { + case hevent_start: + e->h->pos = num_open; + open[num_open++] = e->h; +#ifdef DEBUG + fprintf(stderr, "horizontal (y=%.2f): %.2f -> %.2f dir=%s fs=%p\n", + e->h->y * status->gridsize, + e->h->x1 * status->gridsize, + e->h->x2 * status->gridsize, + e->h->dir==DIR_UP?"up":"down", e->h->fs); +#endif + assert(e->h->y == status->y); + assert(xrow_contains(status->xrow, e->h->x1)); + assert(xrow_contains(status->xrow, e->h->x2)); + break; + case hevent_end: + num_open--; + if(num_open) { + open[num_open]->pos = e->h->pos; + open[e->h->pos] = open[num_open]; + } + break; + case hevent_hotpixel: + { + windstate_t below; + for(s=0;sxpos; + int x2 = e->x; + assert(status->y == open[s]->y); + if(!s) + below = get_horizontal_first_windstate(status, x1, x2); + open[s]->xpos = e->x; + assert(x1 < x2); + below = process_horizontal_fragment(status, open[s], x1, x2, below); + } + } + break; + } + } + free(open); + free(events.events); +} + +static void store_horizontal(status_t*status, point_t p1, point_t p2, edgestyle_t*fs, segment_dir_t dir, int polygon_nr) +{ + assert(p1.y == p2.y); + assert(p1.x != p2.x); // TODO: can this happen? + + if(p1.x > p2.x) { + dir = DIR_INVERT(dir); + point_t p_1 = p1; + point_t p_2 = p2; + p1 = p_2; + p2 = p_1; + } + + /* TODO: convert this into a linked list */ + if(status->horiz.size == status->horiz.num) { + if(!status->horiz.size) + status->horiz.size = 16; + status->horiz.size *= 2; + status->horiz.data = rfx_realloc(status->horiz.data, sizeof(status->horiz.data[0])*status->horiz.size); + } + horizontal_t*h = &status->horiz.data[status->horiz.num++]; + h->y = p1.y; + h->xpos = p1.x; + h->x1 = p1.x; + h->x2 = p2.x; + h->fs = fs; + h->dir = dir; + h->polygon_nr = polygon_nr; +} + + +static void event_apply(status_t*status, event_t*e) +{ +#ifdef DEBUG + event_dump(status, e); +#endif + + switch(e->type) { + case EVENT_HORIZONTAL: { + segment_t*s = e->s1; + intersect_with_horizontal(status, s); + store_horizontal(status, s->a, s->b, s->fs, s->dir, s->polygon_nr); + advance_stroke(&status->queue, 0, s->stroke, s->polygon_nr, s->stroke_pos, status->gridsize); + segment_destroy(s);e->s1=0; + break; + } + case EVENT_END: { + //delete segment from list + segment_t*s = e->s1; +#ifdef CHECKS + dict_del(status->intersecting_segs, s); + dict_del(status->segs_with_point, s); + assert(!dict_contains(status->intersecting_segs, s)); + assert(!dict_contains(status->segs_with_point, s)); +#endif + segment_t*left = s->left; + segment_t*right = s->right; + actlist_delete(status->actlist, s); + if(left && right) + schedule_crossing(status, left, right); + + /* schedule segment for xrow handling */ + s->left = 0; s->right = status->ending_segments; + status->ending_segments = s; + advance_stroke(&status->queue, 0, s->stroke, s->polygon_nr, s->stroke_pos, status->gridsize); + break; + } + case EVENT_START: { + //insert segment into list + segment_t*s = e->s1; + assert(e->p.x == s->a.x && e->p.y == s->a.y); + actlist_insert(status->actlist, s->a, s->b, s); + segment_t*left = s->left; + segment_t*right = s->right; + if(left) + schedule_crossing(status, left, s); + if(right) + schedule_crossing(status, s, right); + schedule_endpoint(status, s); + break; + } + case EVENT_CROSS: { + // exchange two segments + if(e->s1->right == e->s2) { + assert(e->s2->left == e->s1); + exchange_two(status, e); + } else { + assert(e->s2->left != e->s1); +#ifdef DEBUG + fprintf(stderr, "Ignore this crossing ([%d] not next to [%d])\n", e->s1->nr, e->s2->nr); +#endif +#ifndef DONT_REMEMBER_CROSSINGS + /* ignore this crossing for now (there are some line segments in between). + it'll get rescheduled as soon as the "obstacles" are gone */ + char del1 = dict_del(&e->s1->scheduled_crossings, (void*)(ptroff_t)e->s2->nr); + char del2 = dict_del(&e->s2->scheduled_crossings, (void*)(ptroff_t)e->s1->nr); + assert(del1 && del2); +#endif +#ifdef CHECKS + point_t pair; + pair.x = e->s1->nr; + pair.y = e->s2->nr; +#ifndef DONT_REMEMBER_CROSSINGS + assert(dict_contains(status->seen_crossings, &pair)); + dict_del(status->seen_crossings, &pair); +#endif +#endif + } + } + } +} + +#ifdef CHECKS +static void check_status(status_t*status) +{ + DICT_ITERATE_KEY(status->intersecting_segs, segment_t*, s) { + if((s->pos.x != s->b.x || + s->pos.y != s->b.y) && + !dict_contains(status->segs_with_point, s)) { + fprintf(stderr, "Error: segment [%d] (%sslope) intersects in scanline %d, but it didn't receive a point\n", + SEGNR(s), + s->delta.x<0?"-":"+", + status->y); + assert(0); + } + } +} +#endif + +gfxpoly_t* gfxpoly_process(gfxpoly_t*poly1, gfxpoly_t*poly2, windrule_t*windrule, windcontext_t*context, moments_t*moments) +{ + current_polygon = poly1; + + status_t status; + memset(&status, 0, sizeof(status_t)); + status.gridsize = poly1->gridsize; + status.windrule = windrule; + status.context = context; + status.actlist = actlist_new(); + + queue_init(&status.queue); + gfxpoly_enqueue(poly1, &status.queue, 0, /*polygon nr*/0); + if(poly2) { + assert(poly1->gridsize == poly2->gridsize); + gfxpoly_enqueue(poly2, &status.queue, 0, /*polygon nr*/1); + } + +#ifdef CHECKS + status.seen_crossings = dict_new2(&point_type); +#endif + int32_t lasty = INT_MIN; + if(moments) { + memset(moments, 0, sizeof(moments_t)); + } + + status.xrow = xrow_new(); + + event_t*e = queue_get(&status.queue); + while(e) { + assert(e->s1->fs); + status.y = e->p.y; +#ifdef CHECKS + assert(status.y > lasty); + status.intersecting_segs = dict_new2(&ptr_type); + status.segs_with_point = dict_new2(&ptr_type); +#endif + +#ifdef DEBUG + fprintf(stderr, "----------------------------------- %.2f\n", status.y * status.gridsize); + actlist_dump(status.actlist, status.y-1, status.gridsize); +#endif +#ifdef CHECKS + actlist_verify(status.actlist, status.y-1); +#endif + if(moments && lasty > INT_MIN) { + moments_update(moments, status.actlist, lasty, status.y); + } + + xrow_reset(status.xrow); + horiz_reset(&status.horiz); + + do { + xrow_add(status.xrow, e->p.x); + event_apply(&status, e); + event_free(e); + e = queue_get(&status.queue); + } while(e && status.y == e->p.y); + + xrow_sort(status.xrow); + segrange_t range; + memset(&range, 0, sizeof(range)); +#ifdef DEBUG + actlist_dump(status.actlist, status.y, status.gridsize); + xrow_dump(status.xrow, status.gridsize); +#endif + add_points_to_positively_sloped_segments(&status, status.y, &range); + add_points_to_negatively_sloped_segments(&status, status.y, &range); + add_points_to_ending_segments(&status, status.y); + + recalculate_windings(&status, &range); + + actlist_verify(status.actlist, status.y); + process_horizontals(&status); +#ifdef CHECKS + check_status(&status); + dict_destroy(status.intersecting_segs); + dict_destroy(status.segs_with_point); +#endif + lasty = status.y; + } +#ifdef CHECKS + dict_destroy(status.seen_crossings); +#endif + actlist_destroy(status.actlist); + queue_destroy(&status.queue); + horiz_destroy(&status.horiz); + xrow_destroy(status.xrow); + + gfxpoly_t*p = (gfxpoly_t*)malloc(sizeof(gfxpoly_t)); + p->gridsize = poly1->gridsize; + p->strokes = status.strokes; + +#ifdef CHECKS + /* we only add segments with non-empty edgestyles to strokes in + recalculate_windings, but better safe than sorry */ + gfxpolystroke_t*stroke = p->strokes; + while(stroke) { + assert(stroke->fs); + stroke = stroke->next; + } +#endif + return p; +} + +static windcontext_t onepolygon = {1}; +static windcontext_t twopolygons = {2}; +gfxpoly_t* gfxpoly_intersect(gfxpoly_t*p1, gfxpoly_t*p2) +{ + return gfxpoly_process(p1, p2, &windrule_intersect, &twopolygons, 0); +} +gfxpoly_t* gfxpoly_union(gfxpoly_t*p1, gfxpoly_t*p2) +{ + return gfxpoly_process(p1, p2, &windrule_union, &twopolygons, 0); +} +double gfxpoly_area(gfxpoly_t*p) +{ + moments_t moments; + gfxpoly_t*p2 = gfxpoly_process(p, 0, &windrule_evenodd, &onepolygon, &moments); + gfxpoly_destroy(p2); + moments_normalize(&moments, p->gridsize); + return moments.area; +} +double gfxpoly_intersection_area(gfxpoly_t*p1, gfxpoly_t*p2) +{ + moments_t moments; + gfxpoly_t*p3 = gfxpoly_process(p1, p2, &windrule_intersect, &twopolygons, &moments); + gfxpoly_destroy(p3); + + moments_normalize(&moments, p1->gridsize); + return moments.area; +} diff -Nru swftools-0.9.0/lib/gfxpoly/poly.h swftools-0.9.2/lib/gfxpoly/poly.h --- swftools-0.9.0/lib/gfxpoly/poly.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/poly.h 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,121 @@ +#ifndef __poly_h__ +#define __poly_h__ + +#include +#include "../q.h" +#include "../types.h" +#include "wind.h" + +/* features */ +#define SPLAY +#define DONT_REMEMBER_CROSSINGS + +typedef enum {EVENT_CROSS, EVENT_END, EVENT_START, EVENT_HORIZONTAL} eventtype_t; +typedef enum {SLOPE_POSITIVE, SLOPE_NEGATIVE} slope_t; + +#define INVALID_COORD (0x7fffffff) +typedef struct _point { + int32_t x; + int32_t y; +} point_t; +type_t point_type; + +#define SEGNR(s) ((int)((s)?(s)->nr:-1)) + +typedef struct _gfxpolystroke { + segment_dir_t dir; + edgestyle_t*fs; + int points_size; + int num_points; + point_t*points; + struct _gfxpolystroke*next; +} gfxpolystroke_t; +typedef struct _gfxpoly { + double gridsize; + gfxpolystroke_t*strokes; +} gfxpoly_t; + +typedef struct _segment { + point_t a; + point_t b; + point_t delta; + double k; //k = a.x*b.y-a.y*b.x = delta.y*a.x - delta.x*a.y (=0 for points on the segment) + int32_t minx, maxx; + + segment_dir_t dir; + edgestyle_t*fs; + edgestyle_t*fs_out; +#ifdef CHECKS + char fs_out_ok; +#endif + + int polygon_nr; + windstate_t wind; + ptroff_t nr; + +#ifdef SPLAY + struct _segment*parent; + struct _segment*leftchild; + struct _segment*rightchild; +#endif + struct _segment*left; + struct _segment*right; + char changed; + + point_t pos; + + gfxpolystroke_t*stroke; + int stroke_pos; + +#ifndef DONT_REMEMBER_CROSSINGS + dict_t scheduled_crossings; +#endif +} segment_t; + +typedef struct _moments { + double area; + double m[3][3]; +} moments_t; + +#define LINE_EQ(p,s) ((double)(s)->delta.y*(p).x - (double)(s)->delta.x*(p).y - (s)->k) + +/* x1 + ((x2-x1)*(y-y1)) / dy = + (x1*(y2-y1) + (x2-x1)*(y-y1)) / dy = + (x1*(y2-y) + x2 *(y-y1)) / dy = + (x1*y2 - x2*y1 + x2*y - y*x1) / dy = + (k + x2*y - x1*y) / dy + (k + dx*y) / dy +*/ +//#define XPOS(s,ypos) ((s)->a.x + ((s)->delta.x * (double)((ypos) - (s)->a.y)) / (s)->delta.y) +#define XPOS(s,ypos) (((s)->k + (double)(s)->delta.x*ypos) / (s)->delta.y) + +#define XPOS_INT(s,ypos) ((int)ceil(XPOS((s),ypos))) +#define XDIFF(s1,s2,ypos) (((s1)->k + (double)(s1)->delta.x*ypos)*(s2)->delta.y - \ + ((s2)->k + (double)(s2)->delta.x*ypos)*(s1)->delta.y) + +void gfxpoly_fail(char*expr, char*file, int line, const char*function); + +char gfxpoly_check(gfxpoly_t*poly, char updown); +int gfxpoly_num_segments(gfxpoly_t*poly); +int gfxpoly_size(gfxpoly_t*poly); +void gfxpoly_dump(gfxpoly_t*poly); +void gfxpoly_save(gfxpoly_t*poly, const char*filename); +void gfxpoly_save_arrows(gfxpoly_t*poly, const char*filename); +gfxpoly_t* gfxpoly_process(gfxpoly_t*poly1, gfxpoly_t*poly2, windrule_t*windrule, windcontext_t*context, moments_t*moments); + +gfxpoly_t* gfxpoly_intersect(gfxpoly_t*p1, gfxpoly_t*p2); +gfxpoly_t* gfxpoly_union(gfxpoly_t*p1, gfxpoly_t*p2); +double gfxpoly_area(gfxpoly_t*p); +double gfxpoly_intersection_area(gfxpoly_t*p1, gfxpoly_t*p2); + +#ifndef CHECKS +#ifdef assert +#undef assert +#endif +#define assert(x) +#else +#define assert(x) ((x)?0:gfxpoly_fail(__STRING(x), __FILE__, __LINE__, __PRETTY_FUNCTION__)) +#endif + + +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/renderpoly.c swftools-0.9.2/lib/gfxpoly/renderpoly.c --- swftools-0.9.0/lib/gfxpoly/renderpoly.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/renderpoly.c 2010-11-12 18:52:14.000000000 +0000 @@ -0,0 +1,400 @@ +#include +#include +#include +#include "renderpoly.h" + +typedef struct _renderpoint +{ + double x; + segment_dir_t dir; + edgestyle_t*fs; + int polygon_nr; +} renderpoint_t; + +typedef struct _renderline +{ + renderpoint_t*points; + int size; + int num; +} renderline_t; + +typedef struct _renderbuf +{ + intbbox_t bbox; + int width; + int height; + double zoom; + renderline_t*lines; +} renderbuf_t; + +static inline void add_pixel(renderbuf_t*buf, double x, int y, segment_dir_t dir, edgestyle_t*fs, int polygon_nr) +{ + renderpoint_t p; + p.x = x; + p.dir = dir; + p.fs = fs; + p.polygon_nr = polygon_nr; + + if(y >= buf->bbox.ymax || y < buf->bbox.ymin) + return; + + renderline_t*l = &buf->lines[y-buf->bbox.ymin]; + + if(l->num == l->size) { + l->size += 32; + l->points = (renderpoint_t*)rfx_realloc(l->points, l->size * sizeof(renderpoint_t)); + } + l->points[l->num] = p; + l->num++; +} +#define CUT 0.5 +static void add_line(renderbuf_t*buf, double x1, double y1, double x2, double y2, edgestyle_t*fs, segment_dir_t dir, int polygon_nr) +{ + x1 *= buf->zoom; + y1 *= buf->zoom; + x2 *= buf->zoom; + y2 *= buf->zoom; + double diffx, diffy; + double ny1, ny2, stepx; + + if(y2 < y1) { + dir ^= DIR_UP^DIR_DOWN; + double x,y; + x = x1;x1 = x2;x2=x; + y = y1;y1 = y2;y2=y; + } + + diffx = x2 - x1; + diffy = y2 - y1; + ny1 = floor(y1)+CUT; + ny2 = floor(y2)+CUT; + + if(ny1 < y1) { + ny1 = floor(y1) + 1.0 + CUT; + } + if(ny2 >= y2) { + ny2 = floor(y2) - 1.0 + CUT; + } + if(ny1 > ny2) + return; + + stepx = diffx/diffy; + x1 = x1 + (ny1-y1)*stepx; + x2 = x2 + (ny2-y2)*stepx; + + int posy=floor(ny1); + int endy=floor(ny2); + double posx=0; + double startx = x1; + + //printf("line %d from %f to %f dir=%s\n", polygon_nr, y1, y2, dir==DIR_UP?"up":"down"); + + while(posy<=endy) { + double xx = startx + posx; + add_pixel(buf, xx, posy, dir, fs, polygon_nr); + posx+=stepx; + posy++; + } +} + +static int compare_renderpoints(const void * _a, const void * _b) +{ + renderpoint_t*a = (renderpoint_t*)_a; + renderpoint_t*b = (renderpoint_t*)_b; + if(a->x < b->x) return -1; + if(a->x > b->x) return 1; + return 0; +} + +static void fill_bitwise(unsigned char*line, int x1, int x2) +{ + int p1 = x1>>3; + int p2 = x2>>3; + int b1 = 0xff >> (x1&7); + int b2 = 0xff << (1+7-(x2&7)); + if(p1==p2) { + line[p1] |= b1&b2; + } else { + line[p1] |= b1; + memset(&line[p1+1], 255, p2-(p1+1)); + line[p2] = b2; + } +} + +unsigned char* render_polygon(gfxpoly_t*polygon, intbbox_t*bbox, double zoom, windrule_t*rule, windcontext_t*context) +{ + renderbuf_t _buf, *buf=&_buf; + buf->width = (bbox->xmax - bbox->xmin); + buf->height = (bbox->ymax - bbox->ymin); + buf->bbox = *bbox; + buf->zoom = zoom * polygon->gridsize; + int width8 = (buf->width+7) >> 3; + char bleeding = 0; + unsigned char* image = (unsigned char*)malloc(width8*buf->height); + memset(image, 0, width8*buf->height); + + buf->lines = (renderline_t*)rfx_alloc(buf->height*sizeof(renderline_t)); + int y; + for(y=0;yheight;y++) { + memset(&buf->lines[y], 0, sizeof(renderline_t)); + buf->lines[y].points = 0; + buf->lines[y].num = 0; + } + + int polygon_nr = 0; + int s,t; + gfxpolystroke_t*stroke = polygon->strokes; + for(;stroke;stroke=stroke->next) { + for(t=0;tnum_points-1;t++) { + point_t a = stroke->points[t]; + point_t b = stroke->points[t+1]; + add_line(buf, a.x, a.y, b.x, b.y, stroke->fs, stroke->dir, polygon_nr); + } + } + + for(y=0;yheight;y++) { + renderpoint_t*points = buf->lines[y].points; + unsigned char*line = &image[width8*y]; + int n; + int num = buf->lines[y].num; + qsort(points, num, sizeof(renderpoint_t), compare_renderpoints); + int lastx = 0; + + windstate_t fill = rule->start(context); + for(n=0;nx - bbox->xmin); + + if(x < lastx) + x = lastx; + if(x > buf->width) + x = buf->width; + + if(fill.is_filled && lastxadd(context, fill, p->fs, p->dir, p->polygon_nr); + lastx = x; + } + if(fill.is_filled && lastx!=buf->width) { + /* we're bleeding, fill over padding, too. */ + fprintf(stderr, "Polygon %p is bleeding in line %d\n", polygon, y); + fill_bitwise(line, lastx, width8*8); + assert(line[width8-1]&0x01); + bleeding = 1; + exit(1); + + } + } + + for(y=0;yheight;y++) { + if(buf->lines[y].points) { + free(buf->lines[y].points); + } + memset(&buf->lines[y], 0, sizeof(renderline_t)); + } + if(bleeding) { + assert(!bitmap_ok(bbox, image)); + } + free(buf->lines);buf->lines=0; + return image; +} + +#define MAX_WIDTH 8192 +#define MAX_HEIGHT 4096 + +static inline double max(double a, double b) {return a>b?a:b;} +static inline double min(double a, double b) {return agridsize; + + if(polygon->strokes && polygon->strokes->num_points) { + b.xmin = polygon->strokes->points[0].x*g; + b.ymin = polygon->strokes->points[0].y*g; + b.xmax = polygon->strokes->points[0].x*g; + b.ymax = polygon->strokes->points[0].y*g; + } + int s,t; + gfxpolystroke_t*stroke = polygon->strokes; + for(;stroke;stroke=stroke->next) { + for(t=0;tnum_points;t++) { + point_t p = stroke->points[t]; + int x1 = floor(p.x); + int y1 = floor(p.y); + int x2 = ceil(p.x); + int y2 = ceil(p.y); + if(x1 < b.xmin) b.xmin = x1; + if(y1 < b.ymin) b.ymin = y1; + if(x2 > b.xmax) b.xmax = x2; + if(y2 > b.ymax) b.ymax = y2; + } + } + + if(b.xmax > (int)(MAX_WIDTH*zoom)) + b.xmax = (int)(MAX_WIDTH*zoom); + if(b.ymax > (int)(MAX_HEIGHT*zoom)) + b.ymax = (int)(MAX_HEIGHT*zoom); + if(b.xmin < -(int)(MAX_WIDTH*zoom)) + b.xmin = -(int)(MAX_WIDTH*zoom); + if(b.ymin < -(int)(MAX_HEIGHT*zoom)) + b.ymin = -(int)(MAX_HEIGHT*zoom); + + if(b.xmin > b.xmax) + b.xmin = b.xmax; + if(b.ymin > b.ymax) + b.ymin = b.ymax; + + b.xmax = adjust_x(b.xmin, b.xmax); + + b.width = b.xmax - b.xmin; + b.height = b.ymax - b.ymin; + return b; +} + +#define B11111000 0xf8 +#define B01111100 0x7c +#define B00111110 0x3e +#define B00011111 0x1f +#define B11100000 0xe0 +#define B01110000 0x70 +#define B00111000 0x38 +#define B00011100 0x1c +#define B00001110 0x0e +#define B00000111 0x07 +#define B10000000 0x80 +#define B01000000 0x40 +#define B00100000 0x20 +#define B00010000 0x10 +#define B00001000 0x08 +#define B00000100 0x04 +#define B00000010 0x02 +#define B00000001 0x01 + +int bitmap_ok(intbbox_t*bbox, unsigned char*data) +{ + int y; + int width8 = (bbox->width+7) >> 3; + for(y=0;yheight;y++) { + if(data[width8-1]&0x01) + return 0; //bleeding + data += width8; + } + return 1; +} + +int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2) +{ + if(!data1 || !data2) + return 0; + int x,y; + int height = bbox->height; + int width = bbox->width; + int width8 = (width+7) >> 3; + unsigned char*l1 = &data1[width8*2]; + unsigned char*l2 = &data2[width8*2]; + for(y=2;ywidth+7) >> 3; + unsigned char*data = malloc(b->width*b->height*4*4); + unsigned char*p = data; + int x,y; + unsigned char*b1 = data1; + unsigned char*b2 = data2; + compare_bitmaps(b, data1, data2); +//# define MARK ((abs(x-badx)<3 && abs(y-bady)<3)*255) +#define MARK 0 + for(y=0;yheight;y++) { + for(x=0;xwidth;x++) { + unsigned char c1 = (b1[x>>3]&(0x80>>(x&7)))?255:0; + unsigned char c2 = (b2[x>>3]&(0x80>>(x&7)))?255:0; + *p++ = 255; + *p++ = c1^c2; + *p++ = c1^c2; + *p++ = MARK; + } + for(x=0;xwidth;x++) { + unsigned char c = (b2[x>>3]&(0x80>>(x&7)))?255:0; + *p++ = 255; + *p++ = c; + *p++ = c; + *p++ = MARK; + } + b1 += width8; + b2 += width8; + } + b1 = data1; + for(y=0;yheight;y++) { + for(x=0;xwidth;x++) { + unsigned char c = (b1[x>>3]&(0x80>>(x&7)))?255:0; + *p++ = 255; + *p++ = c; + *p++ = c; + *p++ = MARK; + } + for(x=0;xwidth;x++) { + *p++ = 255; + *p++ = 0; + *p++ = 0; + *p++ = 0; + } + b1 += width8; + } + png_write(filename, data, b->width*2, b->height*2); + free(data); +} diff -Nru swftools-0.9.0/lib/gfxpoly/renderpoly.h swftools-0.9.2/lib/gfxpoly/renderpoly.h --- swftools-0.9.0/lib/gfxpoly/renderpoly.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/renderpoly.h 2010-11-12 18:52:22.000000000 +0000 @@ -0,0 +1,24 @@ +#ifndef __renderpoly_h__ +#define __renderpoly_h__ + +#include "poly.h" +#include "wind.h" + +typedef struct { + int xmin; + int ymin; + int xmax; + int ymax; + int width; + int height; +} intbbox_t; + +unsigned char* render_polygon(gfxpoly_t*polygon, intbbox_t*bbox, double zoom, windrule_t*rule, windcontext_t*context); + +intbbox_t intbbox_new(int x1, int y1, int x2, int y2); +intbbox_t intbbox_from_polygon(gfxpoly_t*polygon, double zoom); + +int bitmap_ok(intbbox_t*bbox, unsigned char*data); +int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2); + +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/stroke.c swftools-0.9.2/lib/gfxpoly/stroke.c --- swftools-0.9.0/lib/gfxpoly/stroke.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/stroke.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,233 @@ +#include +#include +#include +#include "../gfxdevice.h" +#include "../gfxtools.h" +#include "poly.h" +#include "wind.h" +#include "convert.h" + +/* notice: left/right for a coordinate system where y goes up, not down */ +typedef enum {LEFT=0, RIGHT=1} leftright_t; + +/* factor that determines into how many line fragments a spline is converted */ +#define SUBFRACTION (2.4) + +// spline equation: +// s(t) = t*t*x2 + 2*t*(1-t)*cx + (1-t)*(1-t)*x1 +// +// s(0.5) = 0.25*x2 + 0.5*cx + 0.25*x1 +// ds(t)/dt = 2*t*x2 + (2-2t)*cx + (2t-2)*x1 +// ds(0) = 2*(cx-x1) + +static void draw_arc(gfxdrawer_t*draw, double x, double y, double a1, double a2, double r) +{ + if(a2lineTo(draw, x+cos(a1)*r,y+sin(a1)*r); + for(t=1;t<=steps;t++) { + double a = a1 + t*step; + double c = cos(a)*r; + double s = sin(a)*r; + double xx = c + x; + double yy = s + y; + double dx = x + cos(a-step/2)*r2; + double dy = y + sin(a-step/2)*r2; + draw->splineTo(draw, dx, dy, xx, yy); + lastx = xx; + lasty = yy; + } +} + +static void draw_single_stroke(gfxpoint_t*p, int num, gfxdrawer_t*draw, double width, gfx_capType cap, gfx_joinType join, double limit) +{ + width/=2; + if(width<=0) + width = 0.05; + + /* remove duplicate points */ + int s=1,t; + gfxpoint_t last = p[0]; + for(t=1;t2 && p[0].x == p[num-1].x && p[0].y == p[num-1].y); + + int start = 0; + int end = num-1; + int incr = 1; + int pos = 0; + + double lastw=0; + /* iterate through the points two times: first forward, then backward, + adding a stroke outline to the right side and line caps after each + pass */ + int pass; + for(pass=0;pass<2;pass++) { + if(closed) { + double dx = p[end].x - p[end-incr].x; + double dy = p[end].y - p[end-incr].y; + lastw = atan2(dy,dx); + if(lastw<0) lastw+=M_PI*2; + } + + int pos; + for(pos=start;pos!=end;pos+=incr) { + //printf("%d) %.2f %.2f\n", pos, p[pos].x, p[pos].y); + double dx = p[pos+incr].x - p[pos].x; + double dy = p[pos+incr].y - p[pos].y; + double w = atan2(dy,dx); + if(w<0) w+=M_PI*2; + + if(closed || pos!=start) { + double d = w-lastw; + leftright_t turn; + if(d>=0 && d-M_PI) turn=RIGHT; + else if(d>=M_PI) {turn=RIGHT;} + else if(d<=-M_PI) {turn=LEFT;d+=M_PI*2;} + else {assert(0);} + if(turn!=LEFT || join==gfx_joinBevel) { + // nothing to do. bevel joins are easy + } else if(join==gfx_joinRound) { + draw_arc(draw, p[pos].x, p[pos].y, lastw-M_PI/2, w-M_PI/2, width); + } else if(join==gfx_joinMiter) { + double xw = M_PI/2 - d/2; + if(xw>0) { + double r2 = 1.0 / sin(M_PI/2-d/2); + if(r2 < limit) { + r2 *= width; + double addx = cos(lastw-M_PI/2+d/2)*r2; + double addy = sin(lastw-M_PI/2+d/2)*r2; + draw->lineTo(draw, p[pos].x+addx, p[pos].y+addy); + } + } + } + } + + double addx = cos(w-M_PI/2)*width; + double addy = sin(w-M_PI/2)*width; + draw->lineTo(draw, p[pos].x+addx, p[pos].y+addy); + double px2 = p[pos+incr].x + addx; + double py2 = p[pos+incr].y + addy; + draw->lineTo(draw, p[pos+incr].x+addx, p[pos+incr].y+addy); + lastw = w; + } + + if(closed) { + draw->close(draw); + } else { + /* draw stroke ends. We draw duplicates of some points here. The drawer + implementation should be smart enough to remove them. */ + double c = cos(lastw-M_PI/2)*width; + double s = sin(lastw-M_PI/2)*width; + if(cap == gfx_capButt) { + draw->lineTo(draw, p[pos].x+c, p[pos].y+s); + draw->lineTo(draw, p[pos].x-c, p[pos].y-s); + } else if(cap == gfx_capRound) { + draw_arc(draw, p[pos].x, p[pos].y, lastw-M_PI/2, lastw+M_PI/2, width); + } else if(cap == gfx_capSquare) { + double c = cos(lastw-M_PI/2)*width; + double s = sin(lastw-M_PI/2)*width; + draw->lineTo(draw, p[pos].x+c, p[pos].y+s); + draw->lineTo(draw, p[pos].x+c-s, p[pos].y+s+c); + draw->lineTo(draw, p[pos].x-c-s, p[pos].y-s+c); + draw->lineTo(draw, p[pos].x-c, p[pos].y-s); + } + lastw += M_PI; // for dots + } + start=num-1; + end=0; + incr=-1; + } + if(!closed) + draw->close(draw); +} + +void draw_stroke(gfxline_t*start, gfxdrawer_t*draw, double width, gfx_capType cap, gfx_joinType join, double miterLimit) +{ + if(!start) + return; + assert(start->type == gfx_moveTo); + gfxline_t*line = start; + // measure array size + int size = 0; + int pos = 0; + double lastx,lasty; + while(line) { + if(line->type == gfx_moveTo) { + if(pos>size) size = pos; + pos++; + } else if(line->type == gfx_lineTo) { + pos++; + } else if(line->type == gfx_splineTo) { + int parts = (int)(sqrt(fabs(line->x-2*line->sx+lastx) + fabs(line->y-2*line->sy+lasty))*SUBFRACTION); + if(!parts) parts = 1; + pos+=parts+1; + } + lastx = line->x; + lasty = line->y; + line = line->next; + } + if(pos>size) size = pos; + if(!size) return; + + gfxpoint_t* points = malloc(sizeof(gfxpoint_t)*size); + line = start; + pos = 0; + while(line) { + if(line->type == gfx_moveTo) { + if(pos) + draw_single_stroke(points, pos, draw, width, cap, join, miterLimit); + pos = 0; + } else if(line->type == gfx_splineTo) { + int parts = (int)(sqrt(fabs(line->x-2*line->sx+lastx) + fabs(line->y-2*line->sy+lasty))*SUBFRACTION); + if(!parts) parts = 1; + double stepsize = 1.0/parts; + int i; + for(i=0;ix*t*t + 2*line->sx*t*(1-t) + lastx*(1-t)*(1-t)); + points[pos].y = (line->y*t*t + 2*line->sy*t*(1-t) + lasty*(1-t)*(1-t)); + pos++; + } + } + lastx = points[pos].x = line->x; + lasty = points[pos].y = line->y; + pos++; + line = line->next; + } + if(pos) draw_single_stroke(points, pos, draw, width, cap, join, miterLimit); + free(points); +} + +static windcontext_t onepolygon = {1}; +gfxpoly_t* gfxpoly_from_stroke(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, double gridsize) +{ + gfxdrawer_t d; + gfxdrawer_target_poly(&d, gridsize); + draw_stroke(line, &d, width, cap_style, joint_style, miterLimit); + gfxpoly_t*poly = (gfxpoly_t*)d.result(&d); + assert(gfxpoly_check(poly, 1)); + gfxpoly_t*poly2 = gfxpoly_process(poly, 0, &windrule_circular, &onepolygon, 0); + gfxpoly_destroy(poly); + return poly2; +} + diff -Nru swftools-0.9.0/lib/gfxpoly/stroke.h swftools-0.9.2/lib/gfxpoly/stroke.h --- swftools-0.9.0/lib/gfxpoly/stroke.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/stroke.h 2010-11-12 18:52:17.000000000 +0000 @@ -0,0 +1,7 @@ +#ifndef __stroke_h__ +#define __stroke_h__ +#include "../gfxdevice.h" +#include "poly.h" +gfxpoly_t* gfxpoly_from_stroke(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, double gridsize); +void draw_stroke(gfxline_t*start, gfxdrawer_t*draw, double width, gfx_capType cap, gfx_joinType join, double miterLimit); +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/wind.c swftools-0.9.2/lib/gfxpoly/wind.c --- swftools-0.9.0/lib/gfxpoly/wind.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/wind.c 2010-11-12 18:52:21.000000000 +0000 @@ -0,0 +1,138 @@ +#include "poly.h" + +edgestyle_t edgestyle_default; + +windstate_t windstate_nonfilled = { + is_filled: 0, + wind_nr: 0, +}; + +// -------------------- even/odd ---------------------- + +windstate_t evenodd_start(windcontext_t*context) +{ + return windstate_nonfilled; +} +windstate_t evenodd_add(windcontext_t*context, windstate_t left, edgestyle_t*edge, segment_dir_t dir, int master) +{ + assert(edge); + left.is_filled ^= 1; + return left; +} +edgestyle_t* evenodd_diff(windstate_t*left, windstate_t*right) +{ + if(left->is_filled==right->is_filled) + return 0; + else + return &edgestyle_default; +} + +windrule_t windrule_evenodd = { + start: evenodd_start, + add: evenodd_add, + diff: evenodd_diff, +}; + +// -------------------- circular ---------------------- + +windstate_t circular_start(windcontext_t*context) +{ + return windstate_nonfilled; +} + +windstate_t circular_add(windcontext_t*context, windstate_t left, edgestyle_t*edge, segment_dir_t dir, int master) +{ + assert(edge); + /* which one is + and which one - doesn't actually make any difference */ + if(dir == DIR_DOWN) + left.wind_nr++; + else + left.wind_nr--; + + left.is_filled = left.wind_nr != 0; + return left; +} + +edgestyle_t* circular_diff(windstate_t*left, windstate_t*right) +{ + if(left->is_filled==right->is_filled) + return 0; + else + return &edgestyle_default; +} + +windrule_t windrule_circular = { + start: circular_start, + add: circular_add, + diff: circular_diff, +}; + +// -------------------- intersect ---------------------- + +windstate_t intersect_start(windcontext_t*context) +{ + return windstate_nonfilled; +} + +windstate_t intersect_add(windcontext_t*context, windstate_t left, edgestyle_t*edge, segment_dir_t dir, int master) +{ + assert(master < context->num_polygons); + + left.wind_nr ^= 1<num_polygons)-1); + return left; +} + +edgestyle_t* intersect_diff(windstate_t*left, windstate_t*right) +{ + if(left->is_filled==right->is_filled) + return 0; + else + return &edgestyle_default; +} + +windrule_t windrule_intersect = { + start: intersect_start, + add: intersect_add, + diff: intersect_diff, +}; + +// -------------------- union ---------------------- + +windstate_t union_start(windcontext_t*context) +{ + return windstate_nonfilled; +} + +windstate_t union_add(windcontext_t*context, windstate_t left, edgestyle_t*edge, segment_dir_t dir, int master) +{ + assert(masteris_filled==right->is_filled) + return 0; + else + return &edgestyle_default; +} + +windrule_t windrule_union = { + start: union_start, + add: union_add, + diff: union_diff, +}; + + +/* + } else if (rule == WIND_NONZERO) { + fill = wind!=0; + } else if (rule == WIND_ODDEVEN) { + fill = wind&1; + } else { // rule == WIND_POSITIVE + fill = wind>=1; + } + */ diff -Nru swftools-0.9.0/lib/gfxpoly/wind.h swftools-0.9.2/lib/gfxpoly/wind.h --- swftools-0.9.0/lib/gfxpoly/wind.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/wind.h 2010-11-12 18:52:13.000000000 +0000 @@ -0,0 +1,41 @@ +#ifndef __wind_h__ +#define __wind_h__ + +/* Every segment has an original direction, which is the direction + the segment had in the input data. + as our scanline moves from minimum y to maximum y, "DOWN" means + the the (original) segment's y2 is larger than its y1 */ +typedef enum {DIR_UP, DIR_DOWN, DIR_UNKNOWN} segment_dir_t; + +#define DIR_INVERT(d) ((d)^(DIR_UP^DIR_DOWN)) + +typedef struct _edgestyle { + void*internal; +} edgestyle_t; + +extern edgestyle_t edgestyle_default; + +typedef struct _windstate +{ + char is_filled; + int wind_nr; +} windstate_t; + +typedef struct _windcontext +{ + int num_polygons; +} windcontext_t; + +typedef struct _windrule +{ + windstate_t (*start)(windcontext_t* num_polygons); + windstate_t (*add)(windcontext_t*context, windstate_t left, edgestyle_t*edge, segment_dir_t dir, int polygon_nr); + edgestyle_t* (*diff)(windstate_t*left, windstate_t*right); +} windrule_t; + +extern windrule_t windrule_evenodd; +extern windrule_t windrule_circular; +extern windrule_t windrule_intersect; +extern windrule_t windrule_union; + +#endif diff -Nru swftools-0.9.0/lib/gfxpoly/xrow.c swftools-0.9.2/lib/gfxpoly/xrow.c --- swftools-0.9.0/lib/gfxpoly/xrow.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/xrow.c 2010-11-12 18:52:27.000000000 +0000 @@ -0,0 +1,101 @@ +#include +#include +#include +#include "../mem.h" +#include "xrow.h" +#include "poly.h" + +xrow_t* xrow_new() +{ + xrow_t*r = rfx_calloc(sizeof(xrow_t)); + r->size = 16; + r->x = rfx_alloc(sizeof(r->x[0])*r->size); + return r; +} + +void xrow_add(xrow_t*r, int32_t x) +{ + if(r->num && r->lastx==x) + return; + r->lastx = x; + if(r->num >= r->size) { + r->size *= 2; + r->x = rfx_realloc(r->x, sizeof(r->x[0])*r->size); + } + r->x[r->num++]=x; +} + +int compare_int32(const void*_i1,const void*_i2) +{ + int32_t*i1 = (int32_t*)_i1; + int32_t*i2 = (int32_t*)_i2; + return *i1-*i2; +} + +void xrow_sort(xrow_t*r) +{ + if(!r->num) + return; + qsort(r->x, r->num, sizeof(r->x[0]), compare_int32); + int t; + int pos = 1; + int32_t lastx=r->x[0]; + for(t=1;tnum;t++) { + if(r->x[t]!=lastx) { + r->x[pos++] = lastx = r->x[t]; + } + } + r->num = pos; +} + +int xrow_find(xrow_t*r, int32_t x) +{ + int min, max, i, l; + + for(min=0, max=r->num, i=r->num/2, l=r->num; i != l; l=i, i=(min+max)/2) { + if(x < r->x[i]) max=i; + else min=i; + } + +#ifdef CHECKS + int t; + for(t=0;tnum;t++) { + if(x < r->x[t]) + break; + } + assert(max == t); +#endif + + return max; +} + +char xrow_contains(xrow_t*r, int32_t x) +{ + int pos = xrow_find(r,x) - 1; + return (pos>=0 && r->x[pos]==x); +} + +void xrow_reset(xrow_t*r) +{ + r->num = 0; +} + +void xrow_dump(xrow_t*xrow, double gridsize) +{ + fprintf(stderr, "x: "); + int t; + for(t=0;tnum;t++) { + if(t) + fprintf(stderr, ", "); + fprintf(stderr, "%.2f", xrow->x[t] * gridsize); + } + fprintf(stderr, "\n"); +} + +void xrow_destroy(xrow_t*r) +{ + if(r->x) { + free(r->x);r->x = 0; + } + free(r); +} diff -Nru swftools-0.9.0/lib/gfxpoly/xrow.h swftools-0.9.2/lib/gfxpoly/xrow.h --- swftools-0.9.0/lib/gfxpoly/xrow.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly/xrow.h 2010-11-12 18:52:28.000000000 +0000 @@ -0,0 +1,25 @@ +#ifndef __xrow_h__ +#define __xrow_h__ + +#include + +#include "poly.h" + +typedef struct _xrow { + int32_t*x; + int num; + int size; + int32_t lastx; +} xrow_t; + +xrow_t* xrow_new(); + +void xrow_add(xrow_t*xrow, int32_t x); +void xrow_sort(xrow_t*xrow); +int xrow_find(xrow_t*r, int32_t x); +char xrow_contains(xrow_t*xrow, int32_t x); +void xrow_dump(xrow_t*xrow, double gridsize); +void xrow_reset(xrow_t*xrow); +void xrow_destroy(xrow_t*xrow); + +#endif diff -Nru swftools-0.9.0/lib/gfxpoly.c swftools-0.9.2/lib/gfxpoly.c --- swftools-0.9.0/lib/gfxpoly.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1197 +0,0 @@ -/* gfxpoly.c - - Various boolean polygon functions. - - Part of the swftools package. - - Copyright (c) 2005 Matthias Kramm - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include "../config.h" -#include "gfxdevice.h" -#include "gfxtools.h" -#include "gfxpoly.h" -#include "mem.h" -#ifdef INTERNAL_LIBART -#include "art/libart.h" -#include "art/art_svp_intersect.h" -#include "art/art_svp_ops.h" -#else -#include -#include -#include -#endif -#include "log.h" -#include -#include -#include - -#define PERTURBATE -//#define SHEAR -//#define DEBUG - -//----------------------------------------- svp renderer ---------------------------------------- - -typedef struct { - int xmin; - int ymin; - int xmax; - int ymax; - int width; - int height; -} intbbox_t; - -typedef struct _renderpoint -{ - double x; - signed char direction; -} renderpoint_t; - -typedef struct _renderline -{ - renderpoint_t*points; - int size; - int num; -} renderline_t; - -typedef struct _renderbuf -{ - intbbox_t bbox; - int width; - int height; - double zoom; - renderline_t*lines; -} renderbuf_t; - -static inline void add_pixel(renderbuf_t*buf, double x, int y, signed char direction) -{ - renderpoint_t p; - p.x = x; - p.direction = direction; - - if(x >= buf->bbox.xmax || y >= buf->bbox.ymax || y < buf->bbox.ymin) - return; - renderline_t*l = &buf->lines[y-buf->bbox.ymin]; - - if(l->num == l->size) { - l->size += 32; - l->points = (renderpoint_t*)rfx_realloc(l->points, l->size * sizeof(renderpoint_t)); - } - l->points[l->num] = p; - l->num++; -} -#define CUT 0.5 -#define INT(x) ((int)((x)+16)-16) -static void add_line(renderbuf_t*buf, double x1, double y1, double x2, double y2, signed char direction) -{ - x1 *= buf->zoom; - y1 *= buf->zoom; - x2 *= buf->zoom; - y2 *= buf->zoom; - double diffx, diffy; - double ny1, ny2, stepx; - if(y2 < y1) { - double x,y; - x = x1;x1 = x2;x2=x; - y = y1;y1 = y2;y2=y; - } - diffx = x2 - x1; - diffy = y2 - y1; - ny1 = INT(y1)+CUT; - ny2 = INT(y2)+CUT; - - if(ny1 < y1) { - ny1 = INT(y1) + 1.0 + CUT; - } - if(ny2 >= y2) { - ny2 = INT(y2) - 1.0 + CUT; - } - if(ny1 > ny2) - return; - - stepx = diffx/diffy; - x1 = x1 + (ny1-y1)*stepx; - x2 = x2 + (ny2-y2)*stepx; - - int posy=INT(ny1); - int endy=INT(ny2); - double posx=0; - double startx = x1; - - while(posy<=endy) { - double xx = startx + posx; - add_pixel(buf, xx, posy, direction); - posx+=stepx; - posy++; - } -} - -static int compare_renderpoints(const void * _a, const void * _b) -{ - renderpoint_t*a = (renderpoint_t*)_a; - renderpoint_t*b = (renderpoint_t*)_b; - if(a->x < b->x) return -1; - if(a->x > b->x) return 1; - return 0; -} - -static void fill_bitwise(unsigned char*line, int x1, int x2) -{ - int p1 = x1>>3; - int p2 = x2>>3; - int b1 = 0xff >> (x1&7); - int b2 = 0xff << (1+7-(x2&7)); - if(p1==p2) { - line[p1] |= b1&b2; - } else { - line[p1] |= b1; - memset(&line[p1+1], 255, p2-(p1+1)); - line[p2] = b2; - } -} - -unsigned char* render_svp(ArtSVP*svp, intbbox_t*bbox, double zoom, ArtWindRule rule) -{ - renderbuf_t _buf, *buf=&_buf; - buf->width = (bbox->xmax - bbox->xmin); - buf->height = (bbox->ymax - bbox->ymin); - buf->bbox = *bbox; - buf->zoom = zoom; - int width8 = (buf->width+7) >> 3; - unsigned char* image = (unsigned char*)malloc(width8*buf->height); - memset(image, 0, width8*buf->height); - - buf->lines = (renderline_t*)rfx_alloc(buf->height*sizeof(renderline_t)); - int y; - for(y=0;yheight;y++) { - memset(&buf->lines[y], 0, sizeof(renderline_t)); - buf->lines[y].points = 0; - buf->lines[y].num = 0; - } - - int t; - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int s; - for(s=0;sn_points-1;s++) { - int dir = seg->dir? 1 : -1; - add_line(buf, seg->points[s].x, seg->points[s].y, seg->points[s+1].x, seg->points[s+1].y, dir); - } - } - for(y=0;yheight;y++) { - renderpoint_t*points = buf->lines[y].points; - unsigned char*line = &image[width8*y]; - int n; - int num = buf->lines[y].num; - int wind = 0; - qsort(points, num, sizeof(renderpoint_t), compare_renderpoints); - int lastx = 0; - int fill = 0; - - for(n=0;nx - bbox->xmin); - - if(x < lastx) - x = lastx; - if(x > buf->width) { - break; - } - if(fill && x!=lastx) { - fill_bitwise(line, lastx, x); - } - wind += p->direction; - if(rule == ART_WIND_RULE_INTERSECT) { - fill = wind>=2; - } else if (rule == ART_WIND_RULE_NONZERO) { - fill = wind!=0; - } else if (rule == ART_WIND_RULE_ODDEVEN) { - fill = wind&1; - } else { // rule == ART_WIND_RULE_POSITIVE - fill = wind>=1; - } - lastx = x; - } - if(fill && lastx!=buf->width) - fill_bitwise(line, lastx, buf->width); - } - - for(y=0;yheight;y++) { - if(buf->lines[y].points) { - free(buf->lines[y].points); - } - memset(&buf->lines[y], 0, sizeof(renderline_t)); - } - free(buf->lines);buf->lines=0; - return image; -} - -#define MAX_WIDTH 8192 -#define MAX_HEIGHT 4096 - -intbbox_t get_svp_bbox(ArtSVP*svp, double zoom) -{ - int t; - intbbox_t b = {0,0,0,0}; - if(svp->n_segs && svp->segs[0].n_points) { - b.xmin = svp->segs[0].points[0].x; - b.ymin = svp->segs[0].points[0].y; - b.xmax = svp->segs[0].points[0].x; - b.ymax = svp->segs[0].points[0].y; - } - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int s; - for(s=0;sn_points;s++) { - double x = seg->points[s].x*zoom; - double y = seg->points[s].y*zoom; - int x1 = floor(x); - int x2 = ceil(x); - int y1 = floor(y); - int y2 = ceil(y); - if(x1 < b.xmin) b.xmin = x1; - if(y1 < b.ymin) b.ymin = y1; - if(x2 > b.xmax) b.xmax = x2; - if(y2 > b.xmax) b.ymax = y2; - } - } - if(b.xmax > (int)(MAX_WIDTH*zoom)) - b.xmax = (int)(MAX_WIDTH*zoom); - if(b.ymax > (int)(MAX_HEIGHT*zoom)) - b.ymax = (int)(MAX_HEIGHT*zoom); - if(b.xmin < -(int)(MAX_WIDTH*zoom)) - b.xmin = -(int)(MAX_WIDTH*zoom); - if(b.ymin < -(int)(MAX_HEIGHT*zoom)) - b.ymin = -(int)(MAX_HEIGHT*zoom); - - if(b.xmin > b.xmax) - b.xmin = b.xmax; - if(b.ymin > b.ymax) - b.ymin = b.ymax; - - b.width = b.xmax - b.xmin; - b.height = b.ymax - b.ymin; - return b; -} - -#define B11100000 0xe0 -#define B01110000 0x70 -#define B00111000 0x38 -#define B00011100 0x1c -#define B00001110 0x0e -#define B00000111 0x07 -#define B10000000 0x80 -#define B01000000 0x40 -#define B00100000 0x20 -#define B00010000 0x10 -#define B00001000 0x08 -#define B00000100 0x04 -#define B00000010 0x02 -#define B00000001 0x01 - -int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2) -{ - int similar = 0; - int x,y; - int height = bbox->height; - int width = bbox->width; - int width8 = (width+7) >> 3; - unsigned char*l1 = &data1[width8]; - unsigned char*l2 = &data2[width8]; - int fail = 0; - for(y=1;ytype == gfx_moveTo) { - pos ++; - } else if(l2->type == gfx_lineTo) { - pos ++; - } else if(l2->type == gfx_splineTo) { - int parts = (int)(sqrt(fabs(l2->x-2*l2->sx+x) + fabs(l2->y-2*l2->sy+y))*subfraction); - if(!parts) parts = 1; - pos += parts + 1; - } - x = l2->x; - y = l2->y; - l2 = l2->next; - } - pos++; - len = pos; - - vec = art_new (ArtVpath, len+1); - - pos = 0; - l2 = line; - int lastmove=-1; - while(l2) { - if(l2->type == gfx_moveTo) { - vec[pos].code = ART_MOVETO_OPEN; - vec[pos].x = l2->x; - vec[pos].y = l2->y; - lastmove=pos; - pos++; - assert(pos<=len); - } else if(l2->type == gfx_lineTo) { - vec[pos].code = ART_LINETO; - vec[pos].x = l2->x; - vec[pos].y = l2->y; - pos++; - assert(pos<=len); - } else if(l2->type == gfx_splineTo) { - int i; - int parts = (int)(sqrt(fabs(l2->x-2*l2->sx+x) + fabs(l2->y-2*l2->sy+y))*subfraction); - if(!parts) parts = 1; - double stepsize = 1.0/parts; - for(i=0;i<=parts;i++) { - double t = (double)i*stepsize; - vec[pos].code = ART_LINETO; - vec[pos].x = l2->x*t*t + 2*l2->sx*t*(1-t) + x*(1-t)*(1-t); - vec[pos].y = l2->y*t*t + 2*l2->sy*t*(1-t) + y*(1-t)*(1-t); - pos++; - assert(pos<=len); - } - } - x = l2->x; - y = l2->y; - - /* let closed line segments start w/ MOVETO instead of MOVETO_OPEN */ - if(lastmove>=0 && l2->type!=gfx_moveTo && (!l2->next || l2->next->type == gfx_moveTo)) { - if(vec[lastmove].x == l2->x && - vec[lastmove].y == l2->y) { - assert(vec[lastmove].code == ART_MOVETO_OPEN); - vec[lastmove].code = ART_MOVETO; - } - } - - l2 = l2->next; - } - vec[pos++].code = ART_END; - assert(pos == len); - - if(!fill) { - /* Fix "dotted" lines. Those are lines where singular points are created - by a moveto x,y lineto x,y combination. We "fix" these by shifting the - point in the lineto a little bit to the right - These should only occur in strokes, not in fills, so do this only - when we know we're not filling. - */ - int t; - for(t=0;vec[t].code!=ART_END;t++) { - if(t>0 && (vec[t-1].code==ART_MOVETO_OPEN || vec[t-1].code==ART_MOVETO) - && vec[t].code==ART_LINETO && vec[t+1].code!=ART_LINETO && - vec[t-1].x == vec[t].x && - vec[t-1].y == vec[t].y) { - vec[t].x += 0.01; - } - } - } - - /* Find adjacent identical points. If an ajdacent pair of identical - points is found, the second is removed. - So moveto x,y lineto x,y becomes moveto x,y - lineto x,y lineto x,y becomes lineto x,y - lineto x,y moveto x,y becomes lineto x,y - moveto x,y moveto x,y becomes moveto x,y - lineto x,y lineto x2,y2 becomes lineto x2,y2 (if dir(x,y) ~= dir(x2,y2)) - */ - pos = 0; - int outpos = 0; - while(1) - { - if(vec[pos].code == ART_END) { - vec[outpos++] = vec[pos++]; - break; - } - - char samedir = 0, samepoint = 0; - if(outpos) { - double dx = vec[pos].x-vec[pos-1].x; - double dy = vec[pos].y-vec[pos-1].y; - /*if(pos= 0) { - samedir=1; - } - }*/ - if(fabs(dx) + fabs(dy) < 0.0001) { - samepoint=1; - } - } - if(!samepoint && !samedir) { - vec[outpos++] = vec[pos++]; - } else { - pos++; // skip - } - } - - return vec; -} - -static void shear_svp(ArtSVP*svp, double v) -{ - /* do a "shearing" on the polygon. We do this to eliminate all - horizontal lines (which libart can't handle properly, even though - it tries). */ - - int t; - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int s; - for(s=0;sn_points;s++) { - ArtPoint* point = &seg->points[s]; - point->y += point->x*v; - } - } -} - -static double find_shear_value(ArtSVP*svp) -{ - /* We try random values until we find one - where there's no slope below a given value, or if that fails, - at least no slope of 0 */ - - double v = 0; - int tries = 0; - while(1) { - char fail = 0; - int t; - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int s; - for(s=0;sn_points-1;s++) { - ArtPoint* p1 = &seg->points[s]; - ArtPoint* p2 = &seg->points[s+1]; - double dx = p2->x - p1->x; - double dy = p2->y - p1->y; - dy += dx*v; - if(dy==0) { - fail = 1; - break; - } - if(tries<100 && dx && fabs(dy / dx) < 1e-5) { - fail = 1; - break; - } - } - if(fail) - break; - } - if(!fail) - break; -#ifdef HAVE_LRAND48 - v = lrand48() / 2000000000.0;; -#elif HAVE_RAND - v = rand() / 2000000000.0; -#else -#error "no lrand48()/rand() implementation found" -#endif - tries++; - } - return v; -} - -void show_path(ArtSVP*path) -{ - int t; - printf("Segments: %d\n", path->n_segs); - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &path->segs[t]; - printf("Segment %d: %d points, %s, BBox: (%f,%f,%f,%f)\n", - t, seg->n_points, seg->dir==0?"UP ":"DOWN", - seg->bbox.x0, seg->bbox.y0, seg->bbox.x1, seg->bbox.y1); - int p; - for(p=0;pn_points;p++) { - ArtPoint* point = &seg->points[p]; - printf(" (%f,%f)\n", point->x, point->y); - } - } - printf("\n"); -} - - -typedef struct svp_segment_part -{ - double y1; - double y2; - char active; -} svp_segment_part_t; - -int compare_double(const void*_y1, const void*_y2) -{ - const double*y1 = _y1; - const double*y2 = _y2; - if(*y1<*y2) return -1; - if(*y1>*y2) return 1; - else return 0; -} - -int compare_seg_start(const void*_s1, const void*_s2) -{ - svp_segment_part_t*s1 = *(svp_segment_part_t**)_s1; - svp_segment_part_t*s2 = *(svp_segment_part_t**)_s2; - if(s1->y1 < s2->y1) return -1; - if(s1->y1 > s2->y1) return 1; - else return 0; -} - -int compare_seg_end(const void*_s1, const void*_s2) -{ - svp_segment_part_t*s1 = *(svp_segment_part_t**)_s1; - svp_segment_part_t*s2 = *(svp_segment_part_t**)_s2; - if(s1->y2 < s2->y2) return -1; - if(s1->y2 > s2->y2) return 1; - else return 0; -} - -void clean_svp(ArtSVP*svp) -{ - int t; - int oldpoints = 0; - int newpoints = 0; - int oldsegs = 0; - int newsegs = 0; - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int p; - int pos=0; - double lasty = 0; - oldpoints += seg->n_points; - for(p=0;pn_points;p++) { - ArtPoint* p1 = &seg->points[p]; - if(!p || lasty!=p1->y) { - seg->points[pos] = seg->points[p]; - pos++; - lasty = p1->y; - } - } - seg->n_points = pos; - newpoints += seg->n_points; - } - int pos = 0; - oldsegs = svp->n_segs; - for(t=0;tn_segs;t++) { - if(svp->segs[t].n_points > 1) { - svp->segs[pos++] = svp->segs[t]; - } - } - svp->n_segs = pos; - newsegs = svp->n_segs; - if(newsegs < oldsegs || newpoints < oldpoints) { - msg(" Simplified polygon from %d points to %d points, %d to %d segs", - oldpoints, newpoints, oldsegs, newsegs); - } -} - -int check_svp(ArtSVP*svp) -{ - /* count number of y coordinates and segs */ - int t; - int num_points = 0; - int num_segs = 0; - for(t=0;tn_segs;t++) { - if(!svp->segs[t].n_points) { - msg(" svp contains segment with zero points\n"); - return 0; - } - num_points += svp->segs[t].n_points; - num_segs += svp->segs[t].n_points - 1; - } - - /* create segs and ys */ - double*y = malloc(sizeof(double)*num_points); - svp_segment_part_t*segs = malloc(sizeof(svp_segment_part_t)*num_segs); - svp_segment_part_t**seg_start = malloc(sizeof(svp_segment_part_t*)*num_segs); - svp_segment_part_t**seg_end = malloc(sizeof(svp_segment_part_t*)*num_segs); - - int c1=0; - num_segs = 0; - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int p; - for(p=0;pn_points;p++) { - y[c1++] = seg->points[p].y; - assert(c1 <= num_points); - } - for(p=0;pn_points-1;p++) { - ArtPoint* p1 = &seg->points[p]; - ArtPoint* p2 = &seg->points[p+1]; - - if(p1->y >= p2->y) { - if(p1->y > p2->y) { - msg(" bad svp, y in seg is non-increasing %.16f -> %.16f\n", p1->y, p2->y); - } - } else { - segs[num_segs].y1 = p1->y; - segs[num_segs].y2 = p2->y; - segs[num_segs].active = 0; - seg_start[num_segs] = &segs[num_segs]; - seg_end[num_segs] = &segs[num_segs]; - num_segs++; - } - } - } - - qsort(y, num_points, sizeof(double), compare_double); - qsort(seg_start, num_segs, sizeof(svp_segment_part_t*), compare_seg_start); - qsort(seg_end, num_segs, sizeof(svp_segment_part_t*), compare_seg_end); - - double lasty = num_points?y[0]+1:0; - int num_active = 0; - int bleed = 0; - double bleedy1=0,bleedy2 = 0; - for(t=0;t svp bleeds from y=%.16f to y=%.16f (%d/%d active segments)\n", - bleedy1, bleedy2, - bleed, num_segs); - free(y);free(segs);free(seg_start);free(seg_end); - return 0; - } - - free(y); - free(segs); - free(seg_start); - free(seg_end); - - return 1; -} - -void write_svp_postscript(const char*filename, ArtSVP*svp) -{ - if(!svp) - return; - FILE*fi = fopen(filename, "wb"); - int i, j; - double xmin=0,ymin=0,xmax=0,ymax=0; - fprintf(fi, "%% begin\n"); - for (i = 0; i < svp->n_segs; i++) { - for (j = 0; j < svp->segs[i].n_points; j++) { - double x = svp->segs[i].points[j].x; - double y = svp->segs[i].points[j].y; - if(i==0 && j==0) { - xmin = xmax = x; - ymin = ymax = y; - } else { - if(x < xmin) xmin = x; - if(x > xmax) xmax = x; - if(y < ymin) ymin = y; - if(y > ymax) ymax = y; - } - } - } - if(xmax == xmin) xmax=xmin+1; - if(ymax == ymin) ymax=ymin+1; - - for (i = 0; i < svp->n_segs; i++) - { - fprintf(fi, "%g setgray\n", svp->segs[i].dir ? 0.7 : 0); - for (j = 0; j < svp->segs[i].n_points; j++) - { - //fprintf(fi, "%g %g %s\n", - // 20 + 550*(svp->segs[i].points[j].x-xmin)/(xmax-xmin), - // 820 - 800*(svp->segs[i].points[j].y-ymin)/(ymax-ymin), - // j ? "lineto" : "moveto"); - fprintf(fi, "%.32f %.32f %s\n", - svp->segs[i].points[j].x, - svp->segs[i].points[j].y, - j ? "lineto" : "moveto"); - } - fprintf(fi, "stroke\n"); - } - - fprintf(fi, "showpage\n"); - fclose(fi); -} - -void write_vpath_postscript(const char*filename, ArtVpath*path) -{ - FILE*fi = fopen(filename, "wb"); - int i, j; - double xmin=0,ymin=0,xmax=0,ymax=0; - fprintf(fi, "%% begin\n"); - ArtVpath*p = path; - char first = 1; - while(p->code != ART_END) { - if(p->code == ART_MOVETO || p->code == ART_MOVETO_OPEN) { - if(!first) - fprintf(fi, "stroke\n"); - first = 0; - fprintf(fi, "0.0 setgray\n"); - fprintf(fi, "%.32f %.32f moveto\n", p->x, p->y); - } else { - fprintf(fi, "%.32f %.32f lineto\n", p->x, p->y); - } - p++; - } - if(!first) - fprintf(fi, "stroke\n"); - fprintf(fi, "showpage\n"); - fclose(fi); -} - -void write_gfxline_postscript(const char*filename, gfxline_t*line) -{ - FILE*fi = fopen(filename, "wb"); - int i, j; - fprintf(fi, "%% begin\n"); - char first = 1; - while(line) { - if(line->type == gfx_moveTo) { - if(!first) - fprintf(fi, "stroke\n"); - first = 0; - fprintf(fi, "0.0 setgray\n"); - fprintf(fi, "%.32f %.32f moveto\n", line->x, line->y); - } else { - fprintf(fi, "%.32f %.32f lineto\n", line->x, line->y); - } - line = line->next; - } - if(!first) - fprintf(fi, "stroke\n"); - fprintf(fi, "showpage\n"); - fclose(fi); -} - -static int vpath_len(ArtVpath*svp) -{ - int len = 0; - while(svp->code != ART_END) { - svp ++; - len ++; - } - return len; -} - -int gfxline_len(gfxline_t*line) -{ - gfxline_t*i = line; - int len = 0; - while(i) { - len ++; - i = i->next; - } - return len; -} - -static ArtVpath*pvpath= 0; -static int cmppos(const void*_p1, const void*_p2) -{ - int*p1 = (int*)_p1; - int*p2 = (int*)_p2; - ArtVpath*v1 = &pvpath[*p1]; - ArtVpath*v2 = &pvpath[*p2]; - if(v1->y < v2->y) - return -1; - else if(v1->y > v2->y) - return 1; - else if(v1->x < v2->x) - return -2; - else if(v1->x > v2->x) - return 2; - else - return 0; -} - -#define PERTURBATION 2e-3 -static void my_perturb(ArtVpath*vpath) -{ - int t; - int len = vpath_len(vpath); - int*pos = (int*)malloc(len*sizeof(int)); - for(t=0;t Casting gfxline of %d segments (%d line segments) to a gfxpoly", gfxline_len(line), vpath_len(vec)); - - if(perturb) { - //ArtVpath* vec2 = art_vpath_perturb(vec); - //free(vec); - //vec = vec2; - my_perturb(vec); - } - ArtSVP *svp = art_svp_from_vpath(vec); - free(vec); - - return svp; -} - -//#ifdef SHEAR -// double shear = find_shear_value(svp); -// gfxline_t*line = gfxpoly_to_gfxline((gfxpoly_t*)svp); -// gfxline_t*l = line; -// while(l) { -// l->y += l->x*shear; -// l->sy += l->sx*shear; -// l= l->next; -// } -// svp = (ArtSVP*)gfxpoly_fillToPoly(line); -// printf("shearing svp by %.16f\n", shear); -//#endif -// .... -//#ifdef SHEAR -// art_svp_free(svp); -// shear_svp(result, -shear); -//#endif - - -ArtSVP* run_intersector(ArtSVP*svp, ArtWindRule rule) -{ - ArtSvpWriter * swr = art_svp_writer_rewind_new(rule); - - double zoom = 1.0; - intbbox_t bbox = get_svp_bbox(svp, zoom); - - art_svp_intersector(svp, swr); - ArtSVP*result = art_svp_writer_rewind_reap(swr); - clean_svp(result); - if(!check_svp(result)) { - current_svp = result; - art_report_error(); // might set art_error_in_intersector - } else { - msg(" Comparing polygon renderings of size %dx%d and %dx%d", bbox.width, bbox.height, bbox.width, bbox.height); - unsigned char*data1 = render_svp(svp, &bbox, zoom, rule); - unsigned char*data2 = render_svp(result, &bbox, zoom, ART_WIND_RULE_ODDEVEN); - if(!compare_bitmaps(&bbox, data1, data2)) { - msg(" Bad SVP rewinding result- polygons don't match"); - current_svp = result; - art_report_error(); // might set art_error_in_intersector - } - free(data1); - free(data2); - } - - if(art_error_in_intersector) { - msg(" Error in polygon processing"); - art_svp_free(result); - art_error_in_intersector=0; - return 0; - } - return result; -} - -gfxline_t* gfxpoly_to_gfxline(gfxpoly_t*poly) -{ - ArtSVP*svp = (ArtSVP*)poly; - int size = 0; - int t; - int pos = 0; - - msg(" Casting polygon of %d segments back to gfxline", svp->n_segs); - - for(t=0;tn_segs;t++) { - size += svp->segs[t].n_points; - } - size = size + 1; - gfxline_t* lines = (gfxline_t*)rfx_alloc(sizeof(gfxline_t)*size); - - for(t=0;tn_segs;t++) { - ArtSVPSeg* seg = &svp->segs[t]; - int p; - for(p=0;pn_points;p++) { - lines[pos].type = p==0?gfx_moveTo:gfx_lineTo; - ArtPoint* point = &seg->points[p]; - lines[pos].x = point->x; - lines[pos].y = point->y; - lines[pos].next = &lines[pos+1]; - pos++; - } - } - if(pos) { - lines[pos-1].next = 0; - return lines; - } else { - return 0; - } -} - -gfxpoly_t* gfxpoly_fillToPoly(gfxline_t*line) -{ - /* I'm not sure whether doing perturbation here is actually - a good idea- if that line has been run through the machinery - several times already, it might be safer to leave it alone, - since it should already be in a format libart can handle */ -#ifdef PERTURBATE - ArtSVP* svp = gfxfillToSVP(line, 1); -#else - ArtSVP* svp = gfxfillToSVP(line, 0); -#endif - -#ifdef DEBUG - char filename[80]; - static int counter = 0; - sprintf(filename, "svp%d.ps", counter); - write_svp_postscript(filename, svp); - sprintf(filename, "gfxline%d.ps", counter); - write_gfxline_postscript(filename, line); -#endif - - /* we do xor-filling by default, so dir is always 1 - (actually for oddeven rewinding it makes no difference, but - it's "cleaner") - */ - int t; - for(t=0; tn_segs; t++) { - svp->segs[t].dir = 1; - } - - /* for some reason, we need to rewind / self-intersect the polygons that gfxfillToSVP - returns- art probably uses a different fill mode (circular?) for vpaths */ - ArtSVP*svp_uncrossed=0; - -#ifdef DEBUG - sprintf(filename, "svp%d_in.ps", counter); - write_svp_postscript(filename, svp); - counter++; -#endif - - svp_uncrossed = run_intersector(svp, ART_WIND_RULE_ODDEVEN); - - art_svp_free(svp); - svp=svp_uncrossed; - - return (gfxpoly_t*)svp; -} - -gfxpoly_t* gfxpoly_intersect(gfxpoly_t*poly1, gfxpoly_t*poly2) -{ - ArtSvpWriter *swr; - - static int counter = 0; - - ArtSVP* svp1 = (ArtSVP*)poly1; - ArtSVP* svp2 = (ArtSVP*)poly2; - msg(" Intersecting two polygons of %d and %d segments", svp1->n_segs, svp2->n_segs); - -#ifdef DEBUG - char filename[80]; - sprintf(filename, "isvp%d_src1.ps", counter); - write_svp_postscript(filename, svp1); - sprintf(filename, "isvp%d_src2.ps", counter); - write_svp_postscript(filename, svp2); -#endif - - ArtSVP* svp3 = art_svp_merge (svp1, svp2); - -#ifdef DEBUG - sprintf(filename, "isvp%d_src.ps", counter); - write_svp_postscript(filename, svp3); -#endif - - //write_svp_postscript("svp.ps", svp3); - ArtSVP*svp_new = run_intersector(svp3, ART_WIND_RULE_INTERSECT); - - art_free (svp3); /* shallow free because svp3 contains shared segments */ - -#ifdef DEBUG - sprintf(filename, "isvp%d.ps", counter); - write_svp_postscript(filename, svp_new); -#endif - - counter++; - - //write_svp_postscript("svp_new.ps", svp_new); - - return (gfxpoly_t*)svp_new; -} - -gfxpoly_t* gfxpoly_union(gfxpoly_t*poly1, gfxpoly_t*poly2) -{ - ArtSVP* svp1 = (ArtSVP*)poly1; - ArtSVP* svp2 = (ArtSVP*)poly2; - msg(" Unifying two polygons of %d and %d segments", svp1->n_segs, svp2->n_segs); - - ArtSVP* svp = art_svp_union(svp1, svp2); - return (gfxpoly_t*)svp; -} - -gfxpoly_t* gfxpoly_strokeToPoly(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, double miterLimit) -{ - ArtVpath* vec = gfxline_to_ArtVpath(line, 0); - msg(" Casting gfxline of %d segments to a stroke-polygon", gfxline_len(line)); - - ArtVpath* vec2 = art_vpath_perturb(vec); - free(vec); - vec = vec2; - - ArtSVP *svp = art_svp_vpath_stroke (vec, - (joint_style==gfx_joinMiter)?ART_PATH_STROKE_JOIN_MITER: - ((joint_style==gfx_joinRound)?ART_PATH_STROKE_JOIN_ROUND: - ((joint_style==gfx_joinBevel)?ART_PATH_STROKE_JOIN_BEVEL:ART_PATH_STROKE_JOIN_BEVEL)), - (cap_style==gfx_capButt)?ART_PATH_STROKE_CAP_BUTT: - ((cap_style==gfx_capRound)?ART_PATH_STROKE_CAP_ROUND: - ((cap_style==gfx_capSquare)?ART_PATH_STROKE_CAP_SQUARE:ART_PATH_STROKE_CAP_SQUARE)), - width, //line_width - miterLimit, //miter_limit - 0.05 //flatness - ); - free(vec); - return (gfxpoly_t*)svp; -} - -gfxline_t* gfxline_circularToEvenOdd(gfxline_t*line) -{ - msg(" Converting circular-filled gfxline of %d segments to even-odd filled gfxline", gfxline_len(line)); - ArtSVP* svp = gfxfillToSVP(line, 1); - - /* TODO: ART_WIND_RULE_POSITIVE means that a shape is visible if - positive and negative line segments add up to something positive. - I *think* that clockwise fill in PDF is defined in a way, however, - that the *last* shape's direction will determine whether something - is filled */ - ArtSVP* svp_rewinded; - - svp_rewinded = run_intersector(svp, ART_WIND_RULE_POSITIVE); - if(!svp_rewinded) { - art_svp_free(svp); - return 0; - } - - gfxline_t* result = gfxpoly_to_gfxline((gfxpoly_t*)svp_rewinded); - art_svp_free(svp); - art_svp_free(svp_rewinded); - return result; -} - -gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2) -{ - ArtVpath *vec = art_new (ArtVpath, 5+1); - vec[0].code = ART_MOVETO; - vec[0].x = x1; - vec[0].y = y1; - vec[1].code = ART_LINETO; - vec[1].x = x1; - vec[1].y = y2; - vec[2].code = ART_LINETO; - vec[2].x = x2; - vec[2].y = y2; - vec[3].code = ART_LINETO; - vec[3].x = x2; - vec[3].y = y1; - vec[4].code = ART_LINETO; - vec[4].x = x1; - vec[4].y = y1; - vec[5].code = ART_END; - vec[5].x = 0; - vec[5].y = 0; - ArtSVP *svp = art_svp_from_vpath(vec); - free(vec); - return (gfxpoly_t*)svp; -} - -void gfxpoly_free(gfxpoly_t*poly) -{ - ArtSVP*svp = (ArtSVP*)poly; - art_svp_free(svp); -} diff -Nru swftools-0.9.0/lib/gfxpoly.h swftools-0.9.2/lib/gfxpoly.h --- swftools-0.9.0/lib/gfxpoly.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/gfxpoly.h 2011-10-07 03:20:17.000000000 +0000 @@ -28,27 +28,37 @@ #endif #include -#include "../lib/mem.h" -#include "../lib/gfxdevice.h" -#include "../lib/gfxtools.h" +#include "mem.h" +#include "gfxdevice.h" +#include "gfxtools.h" + +/* A "grid" value is the granularity at which polygon intersection operates. + It usually makes sense to set this to the smallest value that can actually be represented + in the output device (like 0.05 = 1 twip for SWF). */ +#define DEFAULT_GRID (0.05) typedef struct _gfxpoly { } gfxpoly_t; -void gfxpoly_free(gfxpoly_t*); +void gfxpoly_destroy(gfxpoly_t*poly); /* constructors */ -gfxpoly_t* gfxpoly_fillToPoly(gfxline_t*line); -gfxpoly_t* gfxpoly_strokeToPoly(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, double miterLimit); -gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2); - -/* boolean operations */ -gfxpoly_t* gfxpoly_intersect(gfxpoly_t*line1, gfxpoly_t*line2); -gfxpoly_t* gfxpoly_union(gfxpoly_t*line1, gfxpoly_t*line2); - -/* other things */ -gfxline_t* gfxpoly_to_gfxline(gfxpoly_t*poly); -gfxline_t* gfxline_circularToEvenOdd(gfxline_t*line); +gfxpoly_t* gfxpoly_from_fill(gfxline_t*line, double gridsize); +gfxpoly_t* gfxpoly_from_stroke(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, double gridsize); + +/* operators */ +gfxpoly_t* gfxpoly_intersect(gfxpoly_t*p1, gfxpoly_t*p2); +gfxpoly_t* gfxpoly_union(gfxpoly_t*p1, gfxpoly_t*p2); + +/* area functions */ +double gfxpoly_area(gfxpoly_t*p); +double gfxpoly_intersection_area(gfxpoly_t*p1, gfxpoly_t*p2); + +/* conversion functions */ +gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2, double gridsize); +gfxline_t* gfxline_from_gfxpoly(gfxpoly_t*poly); +gfxline_t* gfxline_from_gfxpoly_with_direction(gfxpoly_t*poly); +gfxline_t* gfxpoly_circular_to_evenodd(gfxline_t*line, double gridsize); #ifdef __cplusplus } diff -Nru swftools-0.9.0/lib/gfxsource.h swftools-0.9.2/lib/gfxsource.h --- swftools-0.9.0/lib/gfxsource.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/gfxsource.h 2010-11-12 19:06:51.000000000 +0000 @@ -33,7 +33,7 @@ typedef struct _gfxsource { - void (*set_parameter)(struct _gfxsource*src, const char*name, const char*value); + void (*setparameter)(struct _gfxsource*src, const char*name, const char*value); struct _gfxdocument* (*open)(struct _gfxsource*src, const char*filename); void (*destroy)(struct _gfxsource*src); void*internal; @@ -45,7 +45,7 @@ int num_pages; void* (*get)(struct _gfxdocument*gfx, const char*name); void (*destroy)(struct _gfxdocument*gfx); - void (*set_parameter)(struct _gfxdocument*gfx, const char*name, const char*value); + void (*setparameter)(struct _gfxdocument*gfx, const char*name, const char*value); char* (*getinfo)(struct _gfxdocument*gfx, const char*key); struct _gfxpage* (*getpage)(struct _gfxdocument*gfx, int page); void (*prepare)(struct _gfxdocument*gfx, gfxdevice_t*device); diff -Nru swftools-0.9.0/lib/gfxtools.c swftools-0.9.2/lib/gfxtools.c --- swftools-0.9.0/lib/gfxtools.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/gfxtools.c 2011-10-07 03:20:17.000000000 +0000 @@ -26,13 +26,18 @@ #include #include #include +#include #include "gfxtools.h" #include "gfxfont.h" +#include "jpeg.h" +#include "q.h" typedef struct _linedraw_internal { gfxline_t*start; gfxline_t*next; + gfxcoord_t x0,y0; + char has_moveto; } linedraw_internal_t; static void linedraw_moveTo(gfxdrawer_t*d, gfxcoord_t x, gfxcoord_t y) @@ -40,12 +45,9 @@ linedraw_internal_t*i = (linedraw_internal_t*)d->internal; gfxline_t*l = (gfxline_t*)rfx_alloc(sizeof(gfxline_t)); l->type = gfx_moveTo; - if((int)((d->x * 5120) == (int)(x * 5120)) && - (int)((d->y * 5120) == (int)(y * 5120))) { - /* never mind- we're already there */ - return; - - } + i->has_moveto = 1; + i->x0 = x; + i->y0 = y; l->sx = l->sy = 0; d->x = l->x = x; d->y = l->y = y; @@ -59,14 +61,14 @@ static void linedraw_lineTo(gfxdrawer_t*d, gfxcoord_t x, gfxcoord_t y) { linedraw_internal_t*i = (linedraw_internal_t*)d->internal; - gfxline_t*l = (gfxline_t*)rfx_alloc(sizeof(gfxline_t)); - - if(!i->start) { - /* starts with a line, not with a moveto. That needs we first - need an explicit moveto to (0,0) */ - linedraw_moveTo(d, 0, 0); + if(!i->has_moveto) { + /* starts with a line, not with a moveto. As this is the first + entry in the list, this is probably *meant* to be a moveto */ + linedraw_moveTo(d, x, y); + return; } - + + gfxline_t*l = (gfxline_t*)rfx_alloc(sizeof(gfxline_t)); l->type = gfx_lineTo; d->x = l->x = x; d->y = l->y = y; @@ -81,14 +83,12 @@ static void linedraw_splineTo(gfxdrawer_t*d, gfxcoord_t sx, gfxcoord_t sy, gfxcoord_t x, gfxcoord_t y) { linedraw_internal_t*i = (linedraw_internal_t*)d->internal; - gfxline_t*l = (gfxline_t*)rfx_alloc(sizeof(gfxline_t)); - - if(!i->start) { - /* starts with a line, not with a moveto. That needs we first - need an explicit moveto to (0,0) */ - linedraw_moveTo(d, 0, 0); + if(!i->has_moveto) { + linedraw_moveTo(d, x, y); + return; } + gfxline_t*l = (gfxline_t*)rfx_alloc(sizeof(gfxline_t)); l->type = gfx_splineTo; d->x = l->x = x; d->y = l->y = y; @@ -101,6 +101,16 @@ if(!i->start) i->start = l; } +static void linedraw_close(gfxdrawer_t*d) +{ + linedraw_internal_t*i = (linedraw_internal_t*)d->internal; + if(!i->has_moveto) + return; + linedraw_lineTo(d, i->x0, i->y0); + i->has_moveto = 0; + i->x0 = 0; + i->y0 = 0; +} static void* linedraw_result(gfxdrawer_t*d) { linedraw_internal_t*i = (linedraw_internal_t*)d->internal; @@ -119,6 +129,7 @@ d->moveTo = linedraw_moveTo; d->lineTo = linedraw_lineTo; d->splineTo = linedraw_splineTo; + d->close = linedraw_close; d->result = linedraw_result; } @@ -195,8 +206,8 @@ void gfxtool_draw_dashed_line(gfxdrawer_t*d, gfxline_t*line, float*r, float phase) { double x=0,y=0; - double linepos,nextpos; - char on; + double linepos = 0,nextpos = 0; + char on = 0; int apos=0; if(line && line->type != gfx_moveTo) { @@ -223,8 +234,13 @@ } return; } + + if(phase < 0) { + phase = -phase; + } + if(r[0]<0 || phase<0) { - fprintf(stderr, "gfxtool: invalid (negative) dashes: %f, phase=%f", r[0], phase); + fprintf(stderr, "gfxtool: invalid (negative) dashes: %f, phase=%f\n", r[0], phase); return; } @@ -321,6 +337,74 @@ } } +static char* getToken(const char**p) +{ + const char*start; + char*result; + while(**p && strchr(" ,()\t\n\r", **p)) { + (*p)++; + } + start = *p; + if (strchr("LMlm", **p) && (isdigit(*(*p+1))||strchr("+-", *(*p+1)))) { + (*p)++; + } else while(**p && !strchr(" ,()\t\n\r", **p)) { + (*p)++; + } + result = (char*)malloc((*p)-start+1); + memcpy(result,start,(*p)-start+1); + result[(*p)-start] = 0; + return result; +} + +static float getFloat(const char** p) +{ + char* token = getToken(p); + float result = atof(token); + free(token); + return result; +} + +gfxline_t*gfxline_fromstring(const char*string) +{ + gfxdrawer_t d; + gfxdrawer_target_gfxline(&d); + + const char*p = string; + while(*p) { + char*token = getToken(&p); + if(!token) + break; + if (!*token) { + free(token); + break; + } + if(!strcmp(token, "M")) { + double x = getFloat(&p); + double y = getFloat(&p); + d.moveTo(&d, x, y); + } else if(!strncmp(token, "L", 1)) { + double x = getFloat(&p); + double y = getFloat(&p); + d.lineTo(&d, x, y); + } else if(!strncmp(token, "C", 1)) { + double x1 = getFloat(&p); + double y1 = getFloat(&p); + double x2 = getFloat(&p); + double y2 = getFloat(&p); + double x3 = getFloat(&p); + double y3 = getFloat(&p); + gfxdraw_cubicTo(&d, x1,y1, x2,y2, x3,y3, 0.9); + } else if(!strncmp(token, "z", 1)) { + //ignore + } else + fprintf(stderr, "gfxdraw: Warning: unknown primitive '%s'\n", token); + free(token); + } + gfxline_t*line = d.result(&d); + return line; +} + + gfxline_t * gfxline_clone(gfxline_t*line) { gfxline_t*dest = 0; @@ -646,6 +730,16 @@ return box; } +gfxbbox_t gfxbbox_expand_to_bbox(gfxbbox_t box, gfxbbox_t box2) +{ + if(box2.xmin==0 && box2.ymin==0 && box2.xmax==0 && box2.ymax==0) { + return box; + } + box = gfxbbox_expand_to_point(box, box2.xmin, box2.ymin); + box = gfxbbox_expand_to_point(box, box2.xmax, box2.ymax); + return box; +} + void gfxbbox_intersect(gfxbbox_t*box1, gfxbbox_t*box2) { if(box2->xmin > box1->xmin) @@ -654,7 +748,7 @@ box1->ymin = box2->ymin; if(box2->xmax < box1->xmax) box1->xmax = box2->xmax; - if(box2->ymax > box1->ymax) + if(box2->ymax < box1->ymax) box1->ymax = box2->ymax; if(box1->xmin > box1->xmax) box1->xmax = box1->xmin; @@ -718,8 +812,8 @@ void gfxmatrix_dump(gfxmatrix_t*m, FILE*fi, char*prefix) { - fprintf(fi, "%f %f | %f\n", m->m00, m->m10, m->tx); - fprintf(fi, "%f %f | %f\n", m->m01, m->m11, m->ty); + fprintf(fi, "%s%f %f | %f\n", prefix, m->m00, m->m10, m->tx); + fprintf(fi, "%s%f %f | %f\n", prefix, m->m01, m->m11, m->ty); } void gfxmatrix_transform(gfxmatrix_t*m, double* v, double*dest) @@ -786,7 +880,18 @@ } return 0; } -gfxfontlist_t*gfxfontlist_addfont(gfxfontlist_t*list, gfxfont_t*font) +void*gfxfontlist_getuserdata(gfxfontlist_t*list, const char*id) +{ + gfxfontlist_t*l = list; + while(l) { + if(!strcmp((char*)l->font->id, id)) { + return l->user; + } + l = l->next; + } + return 0; +} +gfxfontlist_t*gfxfontlist_addfont2(gfxfontlist_t*list, gfxfont_t*font, void*user) { gfxfontlist_t*last=0,*l = list; while(l) { @@ -801,6 +906,7 @@ } l = (gfxfontlist_t*)rfx_calloc(sizeof(gfxfontlist_t)); l->font = font; + l->user = user; l->next = 0; if(last) { last->next = l; @@ -809,6 +915,10 @@ return l; } } +gfxfontlist_t*gfxfontlist_addfont(gfxfontlist_t*list, gfxfont_t*font) +{ + return gfxfontlist_addfont2(list, font, 0); +} void gfxfontlist_free(gfxfontlist_t*list, char deletefonts) { gfxfontlist_t*l = list; @@ -823,7 +933,7 @@ } } -gfxline_t*gfxline_makerectangle(int x1,int y1,int x2, int y2) +gfxline_t*gfxline_makerectangle(double x1,double y1,double x2, double y2) { gfxline_t* line = (gfxline_t*)rfx_calloc(sizeof(gfxline_t)*5); line[0].x = x1;line[0].y = y1;line[0].type = gfx_moveTo;line[0].next = &line[1]; @@ -834,6 +944,42 @@ return line; } +gfxline_t*gfxline_makecircle(double x,double y,double rx, double ry) +{ + double C1 = 0.2930; + double C2 = 0.4140; + double begin = 0.7070; + gfxline_t** line = (gfxline_t**)rfx_calloc(sizeof(gfxline_t*)*9); + int t; + for(t=0;t<9;t++) { + line[t] = rfx_calloc(sizeof(gfxline_t)); + } + line[0]->type = gfx_moveTo; + line[0]->x = x+begin*rx; + line[0]->y = y+begin*ry; + for(t=1;t<9;t++) { + line[t-1]->next = line[t]; + line[t]->type = gfx_splineTo; + } + line[8]->next = 0; +#define R(nr,cx,cy,mx,my) \ + line[nr]->sx = line[nr-1]->x + (cx); \ + line[nr]->sy = line[nr-1]->y + (cy); \ + line[nr]->x = line[nr]->sx + (mx); \ + line[nr]->y = line[nr]->sy + (my); + R(1, -C1*rx, C1*ry, -C2*rx, 0); + R(2, -C2*rx, 0, -C1*rx, -C1*ry); + R(3, -C1*rx, -C1*ry, 0, -C2*ry); + R(4, 0, -C2*ry, C1*rx, -C1*ry); + R(5, C1*rx, -C1*ry, C2*rx, 0); + R(6, C2*rx, 0, C1*rx, C1*ry); + R(7, C1*rx, C1*ry, 0, C2*ry); + R(8, 0, C2*ry, -C1*rx, C1*ry); + gfxline_t*l = line[0]; + free(line); + return l; +} + gfxbbox_t* gfxline_isrectangle(gfxline_t*_l) { if(!_l) @@ -842,7 +988,7 @@ gfxline_t*l = gfxline_clone(_l); gfxline_optimize(l); - double x1,x2,y1,y2; + double x1=0,x2=0,y1=0,y2=0; int xc=0,yc=0; char corners=0; @@ -943,3 +1089,236 @@ } } +static char gfxpoint_equals(void*c1, void*c2) +{ + return !memcmp(c1, c2, sizeof(gfxpoint_t)); +} +static unsigned int gfxpoint_hash(void*c) +{ + return string_hash3(c, sizeof(gfxpoint_t)); +} +static void* gfxpoint_clone(void*c) +{ + void*n = malloc(sizeof(gfxpoint_t)); + memcpy(n, c, sizeof(gfxpoint_t)); + return n; +} +static void gfxpoint_destroy(void*c) +{ + free(c); +} +static type_t gfxpoint_type = { + hash: (hash_func)gfxpoint_hash, + equals: (equals_func)gfxpoint_equals, + dup: (dup_func)gfxpoint_clone, + free: (free_func)gfxpoint_destroy, +}; + +/* makes sure that a gfxline is drawn in a single stroke. + E.g. moveto 0,0 lineto 100,0 lineto 100,100 + moveto 0,0 lineto 0,100 lineto 100,100 + is converted to + moveto 0,0, lineto 0,100 lineto 100,100 lineto 100,0 lineto 0,0 +*/ +gfxline_t* gfxline_restitch(gfxline_t*line) +{ + dict_t*ff = dict_new2(&gfxpoint_type); + dict_t*rev = dict_new2(&gfxpoint_type); + + gfxline_t*prev=0; + while(line) { + gfxline_t*next = line->next; + if(line->type == gfx_moveTo && (line->next && line->next->type != gfx_moveTo)) { + gfxpoint_t xy = {line->x, line->y}; + dict_put(ff, &xy, line); + prev = line; + } else if(!line->next || line->next->type == gfx_moveTo) { + if(prev) { + gfxpoint_t xy = {line->x, line->y}; + dict_put(rev, &xy, prev); + line->next = 0; + prev=0; + } + } + line = next; + } + + gfxpoint_t pos = {0,0}; + + gfxline_t*result = 0; + gfxline_t*last = 0; + + char first = 1; + while(dict_count(ff)) { + char reverse = 0, stitch = 1; + gfxline_t*l = dict_lookup(ff, &pos); + if(l) { + char d = dict_del2(ff,&pos,l);assert(d); + } else { + l = dict_lookup(rev, &pos); + if(l) { + reverse = 1; + char d = dict_del2(rev,&pos,l);assert(d); + } + } + if(!l) { + /* try to find *any* entry. this is costly, but + doesn't happen too often */ + stitch = 0; + DICT_ITERATE_DATA(ff, gfxline_t*, l2) { + l = l2; + break; + } + assert(l); + gfxpoint_t xy = {l->x,l->y}; + char d = dict_del2(ff,&xy,l);assert(d); + } + + gfxline_t*end = l; + if(!reverse) { + while(end->next) end = end->next; + pos.x = end->x; + pos.y = end->y; + char d = dict_del2(rev,&pos,l);assert(d); + } else { + l = gfxline_reverse(l); + pos.x = end->x; + pos.y = end->y; + char d = dict_del2(ff,&pos,end);assert(d); + } + + assert(l->type == gfx_moveTo); + if(stitch && !first) { + /* cut away the moveTo */ + gfxline_t*next = l->next; + free(l); + l = next; + } + + if(!last) { + result = l; + last = end; + } else { + last->next = l; + last = end; + } + first = 0; + } + dict_destroy(ff); + dict_destroy(rev); + return result; +} + +gfxline_t* gfxline_reverse(gfxline_t*line) +{ + gfxline_t*b = 0; + while(line) { + gfxline_t*next = line->next; + if(next && next->type != gfx_moveTo) { + line->type = next->type; + line->sx = next->sx; + line->sy = next->sy; + } else { + line->type = gfx_moveTo; + } + line->next = b; + b = line; + line = next; + } + return b; +} + +void gfxline_normalize(gfxline_t*line, double sizex, double sizey) +{ + gfxbbox_t b = gfxline_getbbox(line); + if(b.xmax == b.xmin || b.ymax == b.ymin) + return; + gfxmatrix_t m; + double w = b.xmax - b.xmin; + double h = b.ymax - b.ymin; + double fx = sizex/w; + double fy = sizey/h; + double s = fmin(fx,fy); + + m.m00 = s; + m.m11 = s; + m.tx = -b.xmin * s; + m.ty = -b.ymin * s; + m.m01 = m.m10 = 0; + gfxline_transform(line, &m); +} + +void gfxgradient_destroy(gfxgradient_t*gradient) +{ + while(gradient) { + gfxgradient_t*next = gradient->next; + free(gradient); + gradient = next; + } +} + +gfxparams_t* gfxparams_new() +{ + return (gfxparams_t*)rfx_calloc(sizeof(gfxparams_t)); +} + +void gfxparams_store(gfxparams_t*params, const char*key, const char*value) +{ + gfxparam_t*o = params->params; + while(o) { + if(!strcmp(key, o->key)) { + /* overwrite old value */ + free((void*)o->value); + o->value = strdup(value); + return; + } + o = o->next; + } + gfxparam_t*p = (gfxparam_t*)malloc(sizeof(gfxparam_t)); + p->key = strdup(key); + p->value = strdup(value); + p->next = 0; + + if(params->last) { + params->last->next = p; + params->last = p; + } else { + params->params = p; + params->last = p; + } +} + +void gfxparams_free(gfxparams_t*params) +{ + gfxparam_t*p = params->params; + while(p) { + gfxparam_t*next = p->next; + free((void*)p->key); + if(p->value) free((void*)p->value); + free(p); + p = next; + } + free(params); +} + +static void turnpoint(double x, double y, gfxmatrix_t* m, double *_x, double*_y) +{ + *_x = m->m00*x + m->m10*y + m->tx; + *_y = m->m01*x + m->m11*y + m->ty; +} + +gfxbbox_t gfxbbox_transform(gfxbbox_t*bbox, gfxmatrix_t*m) +{ + double x1, y1, x2, y2, x3, y3, x4, y4; + turnpoint(bbox->xmin, bbox->xmin, m, &x1, &y1); + turnpoint(bbox->xmax, bbox->ymin, m, &x2, &y2); + turnpoint(bbox->xmin, bbox->ymax, m, &x3, &y3); + turnpoint(bbox->xmax, bbox->ymax, m, &x4, &y4); + + gfxbbox_t new_bbox = {x1, y1, x1, y1}; + new_bbox = gfxbbox_expand_to_point(new_bbox, x2, y2); + new_bbox = gfxbbox_expand_to_point(new_bbox, x3, y3); + new_bbox = gfxbbox_expand_to_point(new_bbox, x4, y4); + return new_bbox; +} + diff -Nru swftools-0.9.0/lib/gfxtools.h swftools-0.9.2/lib/gfxtools.h --- swftools-0.9.0/lib/gfxtools.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/gfxtools.h 2011-10-07 03:20:17.000000000 +0000 @@ -38,6 +38,7 @@ void (*moveTo)(struct _gfxdrawer*d, gfxcoord_t x, gfxcoord_t y); void (*lineTo)(struct _gfxdrawer*d, gfxcoord_t x, gfxcoord_t y); void (*splineTo)(struct _gfxdrawer*d, gfxcoord_t sx, gfxcoord_t sy, gfxcoord_t x, gfxcoord_t y); + void (*close)(struct _gfxdrawer*d); void* (*result)(struct _gfxdrawer*d); } gfxdrawer_t; @@ -49,6 +50,7 @@ typedef struct _gfxfontlist { gfxfont_t*font; + void*user; struct _gfxfontlist*next; } gfxfontlist_t; @@ -66,12 +68,19 @@ void gfxdraw_cubicTo(gfxdrawer_t*draw, double c1x, double c1y, double c2x, double c2y, double x, double y, double quality); void gfxdraw_conicTo(gfxdrawer_t*draw, double cx, double cy, double tox, double toy, double quality); +gfxline_t*gfxline_fromstring(const char*string); + gfxbbox_t gfxline_getbbox(gfxline_t*line); gfxbbox_t gfxbbox_expand_to_point(gfxbbox_t box, gfxcoord_t x, gfxcoord_t y); void gfxbbox_intersect(gfxbbox_t*box1, gfxbbox_t*box2); void gfxline_transform(gfxline_t*line, gfxmatrix_t*matrix); +/* tries to remove unnecessary moveTos from the gfxline */ +gfxline_t* gfxline_restitch(gfxline_t*line); +/* reverses in place */ +gfxline_t* gfxline_reverse(gfxline_t*line); + void gfxmatrix_dump(gfxmatrix_t*l, FILE*fi, char*prefix); void gfxmatrix_transform(gfxmatrix_t*m, gfxcoord_t* v1, gfxcoord_t*dest); void gfxmatrix_invert(gfxmatrix_t*src, gfxmatrix_t*dest); @@ -80,15 +89,38 @@ gfxfontlist_t* gfxfontlist_create(); gfxfontlist_t*gfxfontlist_addfont(gfxfontlist_t*list, gfxfont_t*font); +gfxfontlist_t*gfxfontlist_addfont2(gfxfontlist_t*list, gfxfont_t*font, void*user); gfxfont_t*gfxfontlist_findfont(gfxfontlist_t*list, char*id); char gfxfontlist_hasfont(gfxfontlist_t*list, gfxfont_t*font); +void* gfxfontlist_getuserdata(gfxfontlist_t*list, const char*id); void gfxfontlist_free(gfxfontlist_t*list, char deletefonts); gfxbbox_t* gfxline_isrectangle(gfxline_t*_l); +gfxbbox_t gfxbbox_expand_to_bbox(gfxbbox_t box, gfxbbox_t box2); -gfxline_t*gfxline_makerectangle(int x1, int y1, int x2, int y2); +gfxline_t*gfxline_makerectangle(double x1, double y1, double x2, double y2); +gfxline_t*gfxline_makecircle(double x,double y,double rx, double ry); void gfxline_show(gfxline_t*line, FILE*fi); +void gfxgradient_destroy(gfxgradient_t*gradient); + +typedef struct _gfxparam { + const char*key; + const char*value; + struct _gfxparam* next; +} gfxparam_t; +typedef struct _gfxparams { + gfxparam_t*params; + gfxparam_t*last; +} gfxparams_t; +gfxparams_t* gfxparams_new(); +void gfxparams_store(gfxparams_t*params, const char*name, const char*value); +void gfxparams_free(gfxparams_t*params); + +void gfxline_normalize(gfxline_t*line, double sizex, double sizey); + +gfxbbox_t gfxbbox_transform(gfxbbox_t*bbox, gfxmatrix_t*m); + #ifdef __cplusplus } #endif diff -Nru swftools-0.9.0/lib/graphcut.c swftools-0.9.2/lib/graphcut.c --- swftools-0.9.0/lib/graphcut.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/graphcut.c 2011-01-02 03:30:29.000000000 +0000 @@ -0,0 +1,679 @@ +/* + graphcut- a graphcut implementation based on the Boykov Kolmogorov algorithm + + Part of the swftools package. + + Copyright (c) 2007,2008,2009 Matthias Kramm + + 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 3 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include +#include +#include +#include "graphcut.h" +#include "mem.h" + +//#define DEBUG + +//#define CHECKS + +#ifdef DEBUG +#define DBG +#include +#else +#define DBG if(0) +#define assert(x) (x) +#endif + +#define ACTIVE 0x10 +#define IN_TREE 0x20 + +#define TWOTREES + +typedef struct _posqueue_entry { + node_t*pos; + struct _posqueue_entry*next; +} posqueue_entry_t; + +typedef struct _posqueue { + posqueue_entry_t*list; +} posqueue_t; + +typedef struct _graphcut_workspace { + unsigned char*flags1; + unsigned char*flags2; + halfedge_t**back; + graph_t*graph; + node_t*pos1; + node_t*pos2; + posqueue_t*queue1; + posqueue_t*queue2; + posqueue_t*tmpqueue; +} graphcut_workspace_t; + +static posqueue_t*posqueue_new() +{ + posqueue_t*m = (posqueue_t*)malloc(sizeof(posqueue_t)); + memset(m, 0, sizeof(posqueue_t)); + return m; +} +static void posqueue_delete(posqueue_t*q) +{ + posqueue_entry_t*l = q->list; + while(l) { + posqueue_entry_t*next = l->next; + free(l); + l = next; + } + free(q); +} +static inline void posqueue_addpos(posqueue_t*queue, node_t*pos) +{ + posqueue_entry_t*old = queue->list; + queue->list = malloc(sizeof(posqueue_entry_t)); + queue->list->pos = pos; + queue->list->next = old; +} +static inline node_t* posqueue_extract(posqueue_t*queue) +{ + posqueue_entry_t*item = queue->list; + node_t*pos; + if(!item) + return 0; + pos = item->pos; + queue->list = queue->list->next; + free(item); + return pos; +} +static inline int posqueue_notempty(posqueue_t*queue) +{ + return (int)queue->list; +} + +#define NR(p) ((p)->nr) + +static void posqueue_print(graphcut_workspace_t*w, posqueue_t*queue) +{ + posqueue_entry_t*e = queue->list; + while(e) { + halfedge_t*back = w->back[NR(e->pos)]; + printf("%d(%d) ", NR(e->pos), back?NR(back->fwd->node):-1); + e = e->next; + } + printf("\n"); +} +static void posqueue_purge(posqueue_t*queue) +{ + posqueue_entry_t*e = queue->list; + while(e) { + posqueue_entry_t*next = e->next; + e->next = 0;free(e); + e = next; + } + queue->list = 0; +} + +graph_t* graph_new(int num_nodes) +{ + graph_t*graph = rfx_calloc(sizeof(graph_t)); + graph->num_nodes = num_nodes; + graph->nodes = rfx_calloc(sizeof(node_t)*num_nodes); + int t; + for(t=0;tnodes[t].nr = t; + } + return graph; +} + +void graph_delete(graph_t*graph) +{ + int t; + for(t=0;tnum_nodes;t++) { + halfedge_t*e = graph->nodes[t].edges; + while(e) { + halfedge_t*next = e->next; + free(e); + e = next; + } + } + free(graph->nodes);graph->nodes=0; + free(graph); +} + +static graphcut_workspace_t*graphcut_workspace_new(graph_t*graph, node_t*pos1, node_t*pos2) +{ + graphcut_workspace_t*workspace = malloc(sizeof(graphcut_workspace_t)); + workspace->flags1 = rfx_calloc(graph->num_nodes); + workspace->flags2 = rfx_calloc(graph->num_nodes); + workspace->back = rfx_calloc(graph->num_nodes*sizeof(halfedge_t*)); + workspace->pos1 = pos1; + workspace->pos2 = pos2; + workspace->graph = graph; + workspace->queue1 = posqueue_new(); + workspace->queue2 = posqueue_new(); + workspace->tmpqueue = posqueue_new(); + return workspace; +} +static void graphcut_workspace_delete(graphcut_workspace_t*w) +{ + posqueue_delete(w->queue1);w->queue1=0; + posqueue_delete(w->queue2);w->queue2=0; + posqueue_delete(w->tmpqueue);w->tmpqueue=0; + if(w->flags1) free(w->flags1);w->flags1=0; + if(w->flags2) free(w->flags2);w->flags2=0; + if(w->back) free(w->back);w->back=0; + free(w); +} + +typedef struct _path { + node_t**pos; + halfedge_t**dir; + unsigned char*firsthalf; + int length; +} path_t; + +static path_t*path_new(int len) +{ + path_t*p = malloc(sizeof(path_t)); + p->pos = malloc(sizeof(node_t*)*len); + p->dir = malloc(sizeof(halfedge_t*)*len); + p->firsthalf = malloc(sizeof(unsigned char)*len); + p->length = len; + return p; +} +static void path_delete(path_t*path) +{ + free(path->pos);path->pos = 0; + free(path->dir);path->dir = 0; + free(path->firsthalf);path->firsthalf = 0; + free(path); +} + +static path_t*extract_path(graphcut_workspace_t*work, unsigned char*mytree, unsigned char*othertree, node_t*pos, node_t*newpos, halfedge_t*dir) +{ + int t; + node_t*p = pos; + node_t*nodes = work->graph->nodes; + int len1 = 0; + /* walk up tree1 */ + DBG printf("walk back up (1) to %d\n", NR(work->pos1)); + while(p != work->pos1) { + halfedge_t*back = work->back[NR(p)]; + DBG printf("walk backward (1): %d %d\n", NR(p), back?NR(back->fwd->node):-1); + node_t*old = p; + p = work->back[NR(p)]->fwd->node; + assert(p!=old); + len1++; + } + p = newpos; + int len2 = 0; + DBG printf("walk back up (2) to %d\n", NR(work->pos2)); + /* walk up tree2 */ + while(p != work->pos2) { + DBG printf("walk backward (2): %d\n", NR(p)); + p = work->back[NR(p)]->fwd->node; + len2++; + } + path_t*path = path_new(len1+len2+2); + + t = len1; + path->pos[t] = p = pos; + path->dir[t] = dir; + path->firsthalf[t] = 1; + while(p != work->pos1) { + assert(mytree[NR(p)]&IN_TREE); + halfedge_t*dir = work->back[NR(p)]; + assert(dir->node == p); + p = dir->fwd->node; + t--; + path->pos[t] = p; + path->dir[t] = dir->fwd; + path->firsthalf[t] = 1; + } + assert(!t); + + t = len1+1; + + p = newpos; + while(p != work->pos2) { + assert(othertree[NR(p)]&IN_TREE); + halfedge_t*dir = work->back[NR(p)]; + path->pos[t] = p; + path->dir[t] = dir; + path->firsthalf[t] = 0; + p = dir->fwd->node; + t++; + } + + /* terminator */ + path->pos[t] = p; + path->dir[t] = 0; // last node + path->firsthalf[t] = 0; + + assert(t == len1+len2+1); + return path; +} + +static void path_print(path_t*path) +{ + int t; + for(t=0;tlength;t++) { + node_t*n = path->pos[t]; + printf("%d (firsthalf: %d)", NR(n), path->firsthalf[t]); + if(tlength-1) { + printf(" -(%d/%d)-> \n", + path->dir[t]->used, + path->dir[t]->fwd->used); + } else { + printf("\n"); + } + } + + for(t=0;tlength-1;t++) { + if(path->firsthalf[t]==path->firsthalf[t+1]) { + assert(( path->firsthalf[t] && path->dir[t]->used) || + (!path->firsthalf[t] && path->dir[t]->fwd->used)); + } + } + printf("\n"); +} + + +static void workspace_print(graphcut_workspace_t*w) +{ + printf("queue1: ");posqueue_print(w, w->queue1); + printf("queue2: ");posqueue_print(w, w->queue2); +} + +static void myassert(graphcut_workspace_t*w, char assertion, const char*file, int line, const char*func) +{ + if(!assertion) { + printf("Assertion %s:%d (%s) failed:\n", file, line, func); + workspace_print(w); + exit(0); + } +} + +#define ASSERT(w,c) {myassert(w,c,__FILE__,__LINE__,__func__);} + +static path_t* expand_pos(graphcut_workspace_t*w, posqueue_t*queue, node_t*pos, char reverse, unsigned char*mytree, unsigned char*othertree) +{ + graph_t*graph = w->graph; + int dir; + if((mytree[NR(pos)]&(IN_TREE|ACTIVE)) != (IN_TREE|ACTIVE)) { + /* this node got deleted or marked inactive in the meantime. ignore it */ + DBG printf("node %d is deleted or inactive\n", NR(pos)); + return 0; + } + + halfedge_t*e = pos->edges; + for(;e;e=e->next) { + node_t*newpos = e->fwd->node; + weight_t weight = reverse?e->fwd->weight:e->weight; + if(mytree[NR(newpos)]) continue; // already known + + if(weight) { + if(othertree[NR(newpos)]) { + DBG printf("found connection: %d connects to %d\n", NR(pos), NR(newpos)); + posqueue_addpos(queue, pos); mytree[NR(pos)] |= ACTIVE; // re-add, this vertex might have other connections + + path_t*path; + if(reverse) { + path = extract_path(w, othertree, mytree, newpos, pos, e->fwd); + } else { + path = extract_path(w, mytree, othertree, pos, newpos, e); + } + return path; + } else { + DBG printf("advance from %d to new pos %d\n", NR(pos), NR(newpos)); + w->back[NR(newpos)] = e->fwd; + e->used = 1; + posqueue_addpos(queue, newpos); mytree[NR(newpos)] |= ACTIVE|IN_TREE; // add + } + } + } + /* if we can't expand this node anymore, it's now an inactive node */ + mytree[NR(pos)] &= ~ACTIVE; + return 0; +} + +static int node_count_edges(node_t*node) +{ + halfedge_t*e = node->edges; + int num = 0; + while(e) { + num++; + e = e->next; + } + return num; +} + +static void bool_op(graphcut_workspace_t*w, unsigned char*flags, node_t*pos, unsigned char and, unsigned char or) +{ + posqueue_t*q = w->tmpqueue; + posqueue_purge(q); + posqueue_addpos(q, pos); + + while(posqueue_notempty(q)) { + node_t*p = posqueue_extract(q); + flags[NR(p)] = (flags[NR(p)]&and)|or; + halfedge_t*e = p->edges; + while(e) { + if(e->used) { + posqueue_addpos(q, e->fwd->node); + } + e = e->next; + } + } +} + +static weight_t decrease_weights(graph_t*map, path_t*path) +{ + int t; + assert(path->length); + + weight_t min = path->dir[0]->weight; + for(t=0;tlength-1;t++) { + int w = path->dir[t]->weight; + DBG printf("%d->%d (%d)\n", NR(path->dir[t]->node), NR(path->dir[t]->fwd->node), w); + if(t==0 || w < min) min = w; + } + assert(min); + if(min<=0) + return 0; + + for(t=0;tlength-1;t++) { + path->dir[t]->weight-=min; + path->dir[t]->fwd->weight+=min; + } + return min; +} + +static int reconnect(graphcut_workspace_t*w, unsigned char*flags, node_t*pos, char reverse) +{ + graph_t*graph = w->graph; + + halfedge_t*e = pos->edges; + for(;e;e=e->next) { + node_t*newpos = e->fwd->node; + int weight; + if(!reverse) { + weight = e->fwd->weight; + } else { + weight = e->weight; + } + if(weight && (flags[NR(newpos)]&IN_TREE)) { + DBG printf("successfully reconnected node %d to %d (%d->%d) (reverse:%d)\n", + NR(pos), NR(newpos), NR(e->node), NR(e->fwd->node), reverse); + + w->back[NR(pos)] = e; + e->fwd->used = 1; + return 1; + } + } + return 0; +} + +static void clear_node(graphcut_workspace_t*w, node_t*n) +{ + w->flags1[NR(n)] = 0; + w->flags2[NR(n)] = 0; + w->back[NR(n)] = 0; + halfedge_t*e = n->edges; + while(e) {e->used = 0;e=e->next;} +} + +static void destroy_subtree(graphcut_workspace_t*w, unsigned char*flags, node_t*pos, posqueue_t*posqueue) +{ + DBG printf("destroying subtree starting with %d\n", NR(pos)); + + posqueue_t*q = w->tmpqueue; + posqueue_purge(q); + posqueue_addpos(q, pos); + + while(posqueue_notempty(q)) { + node_t*p = posqueue_extract(q); + halfedge_t*e = p->edges; + while(e) { + node_t*newpos = e->fwd->node; + if(e->used) { + posqueue_addpos(q, newpos); + } else if((flags[NR(newpos)]&(ACTIVE|IN_TREE)) == IN_TREE) { + // re-activate all nodes that surround our subtree. + // TODO: we should check the weight of the edge from that other + // node to our node. if it's zero, we don't need to activate that node. + posqueue_addpos(posqueue, newpos); + flags[NR(newpos)]|=ACTIVE; + } + e = e->next; + } + + clear_node(w, p); + DBG printf("removed pos %d\n", NR(p)); + } +} + +static void combust_tree(graphcut_workspace_t*w, posqueue_t*q1, posqueue_t*q2, path_t*path) +{ + graph_t*graph = w->graph; + int t; + for(t=0;tlength-1 && path->firsthalf[t+1];t++) { + node_t*pos = path->pos[t]; + halfedge_t*dir = path->dir[t]; + node_t*newpos = dir->fwd->node; + if(!dir->weight) { + /* disconnect node */ + DBG printf("remove link %d -> %d from tree 1\n", NR(pos), NR(newpos)); + + dir->used = 0; + w->flags1[NR(newpos)] &= ACTIVE; + bool_op(w, w->flags1, newpos, ~IN_TREE, 0); + + /* try to reconnect the path to some other tree part */ + if(reconnect(w, w->flags1, newpos, 0)) { + bool_op(w, w->flags1, newpos, ~0, IN_TREE); + } else { + destroy_subtree(w, w->flags1, newpos, q1); + break; + } + } + } + + for(t=path->length-1;t>0 && !path->firsthalf[t-1];t--) { + node_t*pos = path->pos[t]; + node_t*newpos = path->pos[t-1]; + halfedge_t*dir = path->dir[t-1]->fwd; + node_t*newpos2 = dir->fwd->node; + assert(newpos == newpos2); + if(!dir->fwd->weight) { + /* disconnect node */ + DBG printf("remove link %d->%d from tree 2\n", NR(pos), NR(newpos)); + + dir->used = 0; + w->flags2[NR(newpos)] &= ACTIVE; + bool_op(w, w->flags2, newpos, ~IN_TREE, 0); + + /* try to reconnect the path to some other tree part */ + if(reconnect(w, w->flags2, newpos, 1)) { + bool_op(w, w->flags2, newpos, ~0, IN_TREE); + } else { + destroy_subtree(w, w->flags2, newpos, q2); + break; + } + } + } +} + +static void check_graph(graph_t*g) +{ + int t; + for(t=0;tnum_nodes;t++) { + assert(g->nodes[t].nr==t); + halfedge_t*e = g->nodes[t].edges; + while(e) { + assert(!e->used || !e->fwd->used); + e = e->next; + } + } +} + +void graph_reset(graph_t*g) +{ + int t; + for(t=0;tnum_nodes;t++) { + g->nodes[t].nr = t; + assert(g->nodes[t].nr==t); + halfedge_t*e = g->nodes[t].edges; + while(e) { + e->used = 0; + e->weight = e->init_weight; + e = e->next; + } + } +} + +weight_t graph_maxflow(graph_t*graph, node_t*pos1, node_t*pos2) +{ + int max_flow = 0; + graphcut_workspace_t* w = graphcut_workspace_new(graph, pos1, pos2); + + graph_reset(graph); + DBG check_graph(graph); + + posqueue_addpos(w->queue1, pos1); w->flags1[pos1->nr] |= ACTIVE|IN_TREE; + posqueue_addpos(w->queue2, pos2); w->flags2[pos2->nr] |= ACTIVE|IN_TREE; + DBG workspace_print(w); + + while(1) { + path_t*path; + while(1) { + char done1=0,done2=0; + node_t* p1 = posqueue_extract(w->queue1); + if(!p1) { + graphcut_workspace_delete(w); + return max_flow; + } + DBG printf("extend 1 from %d (%d edges)\n", NR(p1), node_count_edges(p1)); + path = expand_pos(w, w->queue1, p1, 0, w->flags1, w->flags2); + if(path) + break; + DBG workspace_print(w); + +#ifdef TWOTREES + node_t* p2 = posqueue_extract(w->queue2); + if(!p2) { + graphcut_workspace_delete(w); + return max_flow; + } + DBG printf("extend 2 from %d (%d edges)\n", NR(p2), node_count_edges(p2)); + path = expand_pos(w, w->queue2, p2, 1, w->flags2, w->flags1); + if(path) + break; + DBG workspace_print(w); +#endif + + } + DBG printf("found connection between tree1 and tree2\n"); + DBG path_print(path); + + DBG printf("decreasing weights\n"); + max_flow += decrease_weights(graph, path); + DBG workspace_print(w); + + DBG printf("destroying trees\n"); + combust_tree(w, w->queue1, w->queue2, path); + DBG workspace_print(w); + + DBG check_graph(w->graph); + + path_delete(path); + } + graphcut_workspace_delete(w); + return max_flow; +} + +halfedge_t*graph_add_edge(node_t*from, node_t*to, weight_t forward_weight, weight_t backward_weight) +{ + halfedge_t*e1 = (halfedge_t*)rfx_calloc(sizeof(halfedge_t)); + halfedge_t*e2 = (halfedge_t*)rfx_calloc(sizeof(halfedge_t)); + e1->fwd = e2; + e2->fwd = e1; + e1->node = from; + e2->node = to; + e1->init_weight = forward_weight; + e2->init_weight = backward_weight; + e1->weight = forward_weight; + e2->weight = backward_weight; + + e1->next = from->edges; + from->edges = e1; + e2->next = to->edges; + to->edges = e2; + return e1; +} + +static void do_dfs(node_t*n, int color) +{ + int t; + n->tmp = color; + halfedge_t*e = n->edges; + while(e) { + if(e->fwd->node->tmp<0) + do_dfs(e->fwd->node, color); + e = e->next; + } +} + +int graph_find_components(graph_t*g) +{ + int t; + int count = 0; + for(t=0;tnum_nodes;t++) { + g->nodes[t].tmp = -1; + } + for(t=0;tnum_nodes;t++) { + if(g->nodes[t].tmp<0) { + do_dfs(&g->nodes[t], count++); + } + } + return count; +} + +#ifdef MAIN +int main() +{ + int t; + int s; + for(s=0;s<10;s++) { + int width = (lrand48()%8)+1; + graph_t*g = graph_new(width*width); + for(t=0;t0) graph_add_edge(&g->nodes[t], &g->nodes[t-1], R, R); + if(xnodes[t], &g->nodes[t+1], R, R); + if(y>0) graph_add_edge(&g->nodes[t], &g->nodes[t-width], R, R); + if(ynodes[t], &g->nodes[t+width], R, R); + } + + int x = graph_maxflow(g, &g->nodes[0], &g->nodes[width*width-1]); + printf("max flow: %d\n", x); + graph_delete(g); + } +} +#endif diff -Nru swftools-0.9.0/lib/graphcut.h swftools-0.9.2/lib/graphcut.h --- swftools-0.9.0/lib/graphcut.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/graphcut.h 2010-11-12 18:55:32.000000000 +0000 @@ -0,0 +1,60 @@ +/* + graphcut- a graphcut implementation based on the Boykov Kolmogorov algorithm + + Part of the swftools package. + + Copyright (c) 2007,2008,2009 Matthias Kramm + + 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 3 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +#ifndef __graphcut_h__ +#define __graphcut_h__ + +typedef signed int weight_t; + +typedef struct _halfedge halfedge_t; +typedef struct _node node_t; +typedef struct _graph graph_t; + +struct _halfedge { + node_t*node; + struct _halfedge*fwd; + weight_t weight; + weight_t init_weight; + char used; + halfedge_t*next; +}; + +struct _node { + halfedge_t*edges; + union { + int tmp; + int component; + int color; + }; + int nr; +}; + +struct _graph { + node_t* nodes; + int num_nodes; +}; + +graph_t* graph_new(int num_nodes); +halfedge_t*graph_add_edge(node_t*from, node_t*to, weight_t forward_weight, weight_t backward_weight); +weight_t graph_maxflow(graph_t*graph, node_t*pos1, node_t*pos2); +int graph_find_components(graph_t*g); +void graph_delete(graph_t*); + +#endif diff -Nru swftools-0.9.0/lib/h.263/swfvideo.c swftools-0.9.2/lib/h.263/swfvideo.c --- swftools-0.9.0/lib/h.263/swfvideo.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/h.263/swfvideo.c 2010-11-12 18:52:52.000000000 +0000 @@ -1514,8 +1514,8 @@ TAG * tag; RGBA* pic, *pic2, rgb; SWFPLACEOBJECT obj; - int width = 0; - int height = 0; + unsigned width = 0; + unsigned height = 0; int frames = 10; int framerate = 29; unsigned char*data; @@ -1532,7 +1532,7 @@ memset(&stream, 0, sizeof(stream)); - getPNG(fname, &width, &height, &data); + png_load(fname, &width, &height, &data); pic = (RGBA*)rfx_alloc(width*height*sizeof(RGBA)); pic2 = (RGBA*)rfx_alloc(width*height*sizeof(RGBA)); memcpy(pic, data, width*height*sizeof(RGBA)); diff -Nru swftools-0.9.0/lib/jpeg.c swftools-0.9.2/lib/jpeg.c --- swftools-0.9.0/lib/jpeg.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/jpeg.c 2011-10-14 20:46:10.000000000 +0000 @@ -76,7 +76,7 @@ dmgr->free_in_buffer = 0; } -int jpeg_save(unsigned char*data, int width, int height, int quality, const char*filename) +int jpeg_save(unsigned char*data, unsigned width, unsigned height, int quality, const char*filename) { struct jpeg_destination_mgr mgr; struct jpeg_compress_struct cinfo; @@ -124,14 +124,14 @@ return 1; } -int jpeg_save_to_file(unsigned char*data, int width, int height, int quality, FILE*_fi) +int jpeg_save_gray(unsigned char*data, unsigned width, unsigned height, int quality, const char*filename) { struct jpeg_destination_mgr mgr; struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; - int t; - fi = _fi; + if(filename) fi = fopen(filename, "wb"); + else fi = 0; memset(&cinfo, 0, sizeof(cinfo)); memset(&jerr, 0, sizeof(jerr)); @@ -143,50 +143,44 @@ mgr.empty_output_buffer = file_empty_output_buffer; mgr.term_destination = file_term_destination; cinfo.dest = &mgr; - - // init compression - cinfo.image_width = width; cinfo.image_height = height; - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; + cinfo.input_components = 1; + cinfo.in_color_space = JCS_GRAYSCALE; jpeg_set_defaults(&cinfo); - cinfo.dct_method = JDCT_IFAST; jpeg_set_quality(&cinfo,quality,TRUE); - - //jpeg_write_tables(&cinfo); - //jpeg_suppress_tables(&cinfo, TRUE); jpeg_start_compress(&cinfo, FALSE); - + int t; for(t=0;tsrc; - printf("skip %d +%d\n", size - mgr->bytes_in_buffer, num_bytes); + printf("skip %d +%ld\n", size - mgr->bytes_in_buffer, num_bytes); if(num_bytes<=0) return; mgr->next_input_byte += num_bytes; @@ -249,12 +306,11 @@ //printf("term %d\n", size - mgr->bytes_in_buffer); } -int jpeg_load_from_mem(unsigned char*_data, int _size, unsigned char*dest, int width, int height) +int jpeg_load_from_mem(unsigned char*_data, int _size, unsigned char**dest, unsigned*width, unsigned*height) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; struct jpeg_source_mgr mgr; - int y,x; data = _data; size = _size; @@ -273,12 +329,27 @@ cinfo.src = &mgr; jpeg_read_header(&cinfo, TRUE); + cinfo.out_color_space == JCS_RGB; jpeg_start_decompress(&cinfo); + + *width = cinfo.output_width; + *height = cinfo.output_height; + *dest = malloc(cinfo.output_width * cinfo.output_height * 4); - for(y=0;y 0xffffffff) { + *_width = 0; + *_height = 0; + return 0; + } + *dest = (unsigned char*)malloc(image_size); int y; for (y=0;y -#ifdef __CPLUSPLUS__ +#ifdef __cplusplus extern "C" { #endif -int jpeg_save(unsigned char*data, int width, int height, int quality, const char*filename); -int jpeg_save_to_file(unsigned char*data, int width, int height, int quality, FILE*fi); -int jpeg_save_to_mem(unsigned char*data, int width, int height, int quality, unsigned char*dest, int destsize); -int jpeg_load(const char*filename, unsigned char**dest, int*width, int*height); -int jpeg_load_from_mem(unsigned char*_data, int size, unsigned char*dest, int width, int height); +int jpeg_save(unsigned char*data, unsigned int width, unsigned int height, int quality, const char*filename); +int jpeg_save_gray(unsigned char*data, unsigned int width, unsigned int height, int quality, const char*filename); +int jpeg_save_to_file(unsigned char*data, unsigned int width, unsigned int height, int quality, FILE*fi); +int jpeg_save_to_mem(unsigned char*data, unsigned width, unsigned height, int quality, unsigned char*_dest, int _destlen, int components); +int jpeg_load(const char*filename, unsigned char**dest, unsigned int*width, unsigned int*height); +int jpeg_load_from_mem(unsigned char*_data, int _size, unsigned char**dest, unsigned int*width, unsigned int*height); +void jpeg_get_size(const char *fname, unsigned int *width, unsigned int *height); -#ifdef __CPLUSPLUS__ +#ifdef __cplusplus } #endif diff -Nru swftools-0.9.0/lib/kdtree.c swftools-0.9.2/lib/kdtree.c --- swftools-0.9.0/lib/kdtree.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/kdtree.c 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,531 @@ +/* kdtree.c + Implementation of 2d kd trees. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include "q.h" +#include "kdtree.h" + +/* 0=right 1=down 2=left 3=up */ +static int vx_and[4] = {INT_MAX, 0, INT_MAX, 0}; +static int vy_and[4] = {0, INT_MAX, 0, INT_MAX}; +static int vx[4] = {1, 0, -1, 0}; +static int vy[4] = {0, 1, 0, -1}; +static int vsign[4] = {1,1,-1,-1}; +static char* vname[4] = {"right", "down", "left", "up"}; + +kdarea_t* kdarea_new(void*data) +{ + NEW(kdarea_t,area); + area->bbox.xmin = INT_MIN; + area->bbox.ymin = INT_MIN; + area->bbox.xmax = INT_MAX; + area->bbox.ymax = INT_MAX; + area->data = data; + return area; +} + +kdtree_t* kdtree_new() +{ + NEW(kdtree_t,tree); + tree->root = kdarea_new(0); + return tree; +} + +static inline int32_t max32(int32_t v1, int32_t v2) {return v1>v2?v1:v2;} +static inline int32_t min32(int32_t v1, int32_t v2) {return v1type = type; + b->xy = xy; + return b; +} + +kdarea_t*kdbranch_follow(const kdbranch_t*tree, int32_t x, int32_t y) +{ + /* + int follow = 0; + switch(tree->type) { + case KD_LEFT: + follow = (x < tree->xy); + break; + case KD_RIGHT: + follow = (x > tree->xy); + break; + case KD_UP: + follow = (y < tree->xy); + break; + case KD_DOWN: + follow = (y > tree->xy); + break; + } + return &tree->side[follow]; + */ + int32_t s = x*vx[tree->type] + y*vy[tree->type]; + int32_t v = tree->xy*vsign[tree->type]; + return tree->side[s < v]; +} + +static kdarea_list_t* kdarea_list_new(kdarea_t*area) +{ + NEW(kdarea_list_t,b); + b->area = area; + b->next = b->prev = b; + return b; +} + +static kdarea_list_t*kdarea_list_concatenate(kdarea_list_t*l1, kdarea_list_t*l2) +{ + if(!l1) return l2; + if(!l2) return l1; + l2->prev->next = l1->next; + l1->next->prev = l2->prev; + l2->prev = l1; + l1->next = l2; + return l1; +} + +static kdbbox_t bbox_for_halfplane(int xy, int dir) +{ + kdbbox_t b = {INT_MIN,INT_MIN,INT_MAX,INT_MAX}; + switch(dir) { + case KD_LEFT: + b.xmax = xy; + break; + case KD_RIGHT: + b.xmin = xy; + break; + case KD_UP: + b.ymax = xy; + break; + case KD_DOWN: + b.ymin = xy; + break; + } + return b; +} + +static kdbbox_t intersect_bbox(const kdbbox_t*box1, const kdbbox_t*box2) +{ + kdbbox_t b = *box1; + if(box2->xmin > b.xmin) + b.xmin = box2->xmin; + if(box2->ymin > b.ymin) + b.ymin = box2->ymin; + if(box2->xmax < b.xmax) + b.xmax = box2->xmax; + if(box2->ymax < b.ymax) + b.ymax = box2->ymax; + if(b.xmin > b.xmax) + b.xmax = b.xmin; + if(b.ymin > b.ymax) + b.ymax = b.ymin; + return b; +} + +static void kdarea_split(kdarea_t*area, int xy, int dir, + int32_t x1, int32_t y1, + int32_t x2, int32_t y2) +{ + if(!area->split) { + kdbranch_t*b = area->split = kdbranch_new(xy, dir); + kdbbox_t b1 = bbox_for_halfplane(xy, dir); + kdbbox_t b2 = bbox_for_halfplane(xy, dir^2); + b->side[0] = kdarea_new(area->data); + b->side[1] = kdarea_new(area->data); + b->side[0]->bbox = intersect_bbox(&area->bbox,&b1); + b->side[1]->bbox = intersect_bbox(&area->bbox,&b2); + memcpy(b->side[0]->neighbors, area->neighbors, sizeof(area->neighbors)); + memcpy(b->side[1]->neighbors, area->neighbors, sizeof(area->neighbors)); + b->side[0]->neighbors[dir^2] = b->side[1]; + b->side[1]->neighbors[dir] = b->side[0]; + area->data = 0; + } else { + kdbranch_t*split = area->split; + kdarea_t*first = kdbranch_follow(split, x1,y1); + kdarea_t*second = kdbranch_follow(split, x2,y2); + + if(!first) { + if(!second) { + /* line is on top of an already existing segment */ + return; + } else { + /* first point is directly on the split */ + kdarea_split(second, xy, dir, x1,y1, x2,y2); + return; + } + } else { + if(!second) { + /* second point is directly on the split */ + kdarea_split(first, xy, dir, x1,y1, x2,y2); + return; + } else if(first == second) { + /* both points are to the same side of this split */ + kdarea_split(first, xy, dir, x1,y1, x2,y2); + return; + } else { + kdarea_split(first, xy, dir, x1,y1, x2,y2); + kdarea_split(second, xy, dir, x1,y1, x2,y2); + return; + } + } + } +} + +static kdarea_list_t* kdarea_filter(kdarea_t*area, int xy, int dir) +{ + if(!area->split) { + return kdarea_list_new(area); + } else { + kdbranch_t*branch = area->split; + if((branch->type^dir) == 0) { + /* both filter as well as branch point into the same direction */ + if(xy*vsign[dir] >= branch->xy*vsign[dir]) { + /* filter splits the primary node. We can skip the other one. */ +#ifdef DEBUG + printf("%p: using %p, skipping %p (looking to %s of %d)\n", area, branch->side[0], branch->side[1], vname[dir], xy); +#endif + return kdarea_filter(branch->side[0], xy, dir); + } else { + /* filter splits the secondary node. the primary node is left completely intact, + and returned as such */ +#ifdef DEBUG + printf("%p: expanding %p, filtering %p (looking to %s of %d)\n", area, branch->side[0], branch->side[1], vname[dir], xy); +#endif + kdarea_list_t*l1 = kdarea_list_new(branch->side[0]); + kdarea_list_t*l2 = kdarea_filter(branch->side[1], xy, dir); + return kdarea_list_concatenate(l1,l2); + } + } else if((branch->type^dir) == 2) { + /* filter and branch point into opposite directions */ + if(xy*vsign[dir] >= branch->xy*vsign[dir]) { + // filter splits the secondary node. We can skip the primary node. +#ifdef DEBUG + printf("%p: skipping %p, using %p (looking to %s of %d)\n", area, branch->side[0], branch->side[1], vname[dir], xy); +#endif + return kdarea_filter(branch->side[1], xy, dir); + } else { + /* filter splits the primary node. the secondary node is left completely intact, + and returned as such */ +#ifdef DEBUG + printf("%p: filtering %p, expanding %p (looking to %s of %d)\n", area, branch->side[0], branch->side[1], vname[dir], xy); +#endif + kdarea_list_t*l1 = kdarea_filter(branch->side[0], xy, dir); + kdarea_list_t*l2 = kdarea_list_new(branch->side[1]); + return kdarea_list_concatenate(l1,l2); + } + } else { + /* filter segment is perpendicular to the node */ + return kdarea_list_new(area); + } + } +} + +static kdarea_t* kdarea_find(kdarea_t*node, int x, int y) +{ + while(node) { + if(!node->split) + break; + node = kdbranch_follow(node->split, x,y); + } + return node; +} + +kdarea_t*kdtree_find(kdtree_t*tree, int x, int y) +{ + return kdarea_find(tree->root, x,y); +} + +void kdarea_list_destroy(kdarea_list_t*list) +{ + kdarea_list_t*i = list; + if(i) do { + kdarea_list_t*next = i->next; + free(i); + i = next; + } while(i!=list); +} + +static kdarea_list_t* kdarea_list_add(kdarea_list_t*l, kdarea_t*area) +{ + return kdarea_list_concatenate(l,kdarea_list_new(area)); +} + +static kdarea_list_t* kdarea_all_children(kdarea_t*area, int32_t x1, int32_t y1, int32_t x2, int32_t y2, kdarea_list_t*result) +{ + if(!area->split) { + if(area->bbox.xmin >= x1 && + area->bbox.ymin >= y1 && + area->bbox.xmax <= x2 && + area->bbox.ymax <= y2) { + result = kdarea_list_add(result, area); + } + } else { + result = kdarea_all_children(area->split->side[0], x1, y1, x2, y2, result); + result = kdarea_all_children(area->split->side[1], x1, y1, x2, y2, result); + } + return result; +} + +/* return all areas that are contained in, or partly intersect, the given bounding box */ +kdarea_list_t* kdtree_filter(kdtree_t*tree, int32_t x1, int32_t y1, int32_t x2, int32_t y2, char leafs) +{ + kdarea_list_t*result = 0; + kdarea_list_t*branches1 = kdarea_filter(tree->root, x2, KD_LEFT); + kdarea_list_t*i = branches1; + +#ifdef DEBUG + kdarea_list_t*u = branches1; + if(u) do {printf("%p [%d %d %d %d] is to the left of %d\n", u->area, u->area->bbox.xmin, u->area->bbox.ymin, u->area->bbox.xmax, u->area->bbox.ymax, x2);u = u->next;} while(u!=branches1); +#endif + if(i) do { + kdarea_list_t*branches2 = kdarea_filter(i->area, y2, KD_UP); + kdarea_list_t*j = branches2; + +#ifdef DEBUG + kdarea_list_t*u = branches2; + if(u) do {printf("%p [%d %d %d %d] is above %d\n", u->area, u->area->bbox.xmin, u->area->bbox.ymin, u->area->bbox.xmax, u->area->bbox.ymax, y2);u = u->next;} while(u!=branches2); +#endif + if(j) do { + kdarea_list_t*branches3 = kdarea_filter(j->area, x1, KD_RIGHT); + kdarea_list_t*k = branches3; +#ifdef DEBUG + kdarea_list_t*u = branches3; + if(u) do {printf("%p [%d %d %d %d] is to the right of %d\n", u->area, u->area->bbox.xmin, u->area->bbox.ymin, u->area->bbox.xmax, u->area->bbox.ymax, x1);u = u->next;} while(u!=branches3); +#endif + if(k) do { + kdarea_list_t*branches4 = kdarea_filter(k->area, y1, KD_DOWN); + kdarea_list_t*l = branches4; +#ifdef DEBUG + kdarea_list_t*u = branches4; + if(u) do {printf("%p [%d %d %d %d] is below %d\n", u->area, u->area->bbox.xmin, u->area->bbox.ymin, u->area->bbox.xmax, u->area->bbox.ymax, y1);u = u->next;} while(u!=branches4); +#endif + if(leafs) { + if(l) do { + result = kdarea_list_concatenate(result, kdarea_all_children(l->area, x1, y1, x2, y2, 0)); + l = l->next; + } while(l!=branches4); + kdarea_list_destroy(branches4); + } else { + result = kdarea_list_concatenate(result, l); + } + k = k->next; + } while(k!=branches3); + kdarea_list_destroy(branches3); + j = j->next; + } while(j!=branches2); + kdarea_list_destroy(branches2); + i = i->next; + } while(i!=branches1); + kdarea_list_destroy(branches1); + return result; +} + +static void kdtree_modify_box(kdtree_t*tree, int32_t x1, int32_t y1, int32_t x2, int32_t y2, void*(*f)(void*user,void*data), void*user) +{ + kdarea_split(tree->root, x2, KD_LEFT, x2,y1, x2,y2); + kdarea_split(tree->root, y2, KD_UP, x1,y2, x2,y2); + kdarea_split(tree->root, x1, KD_RIGHT, x1,y1, x1,y2); + kdarea_split(tree->root, y1, KD_DOWN, x1,y1, x2,y1); +#ifdef DEBUG + printf("inserting (%d,%d,%d,%d) %p\n", x1, y1, x2, y2, user); +#endif + kdarea_list_t*l = kdtree_filter(tree, x1, y1, x2, y2, 1); + kdarea_list_t*i = l; + if(l) do { +#ifdef DEBUG + printf("%p [%d,%d,%d,%d], is contained in [%d %d %d %d]\n", i->area, + i->area->bbox.xmin, + i->area->bbox.ymin, + i->area->bbox.xmax, + i->area->bbox.ymax, + x1, y1, x2, y2); +#endif + i->area->data = f(user, i->area->data); + i = i->next; + } while(i!=l); + kdarea_list_destroy(l); +} + +static void* overwrite(void*user, void*data) +{ + return user; +} + +void kdtree_add_box(kdtree_t*tree, int32_t x1, int32_t y1, int32_t x2, int32_t y2, void*data) +{ + kdtree_modify_box(tree, x1, y1, x2, y2, overwrite, data); +} + +static void* add_to_dict(void*user, void*data) +{ + dict_t*items = (dict_t*)user; + if(!dict_contains(items, data)) { + dict_put(items, data, data); + } + return data; +} + +kdresult_list_t*kdtree_find_in_box(kdtree_t*tree, int32_t x1, int32_t y1, int32_t x2, int32_t y2) +{ + dict_t*items = dict_new2(&ptr_type); + kdtree_modify_box(tree, x1, y1, x2, y2, add_to_dict, items); + kdresult_list_t*list = 0; + DICT_ITERATE_KEY(items, void*, d) { + if(d) { + NEW(kdresult_list_t,r); + r->data = d; + r->next = list; + list = r; + } + }; + dict_destroy(items); + return list; +} + +kdarea_t*kdarea_neighbor(kdarea_t*area, int dir, int xy) +{ + int x,y; + switch(dir) { + case KD_LEFT: + x = area->bbox.xmin; + y = xy; + break; + case KD_RIGHT: + x = area->bbox.xmax; + y = xy; + break; + case KD_UP: + x = xy; + y = area->bbox.ymin; + break; + case KD_DOWN: + x = xy; + y = area->bbox.ymax; + break; + } + kdarea_t*n = area->neighbors[dir]; + if(!n) + return 0; + return kdarea_find(n, x, y); +} + +static void do_indent(int l) +{ + int i; + for(i=0;itype], branch->xy); + kdbbox_t b = bbox_for_halfplane(branch->xy, branch->type); + kdarea_print(branch->side[0], indent+4); + kdarea_print(branch->side[1], indent+4); +} + +void kdarea_print(kdarea_t*area, int indent) +{ + int i; + assert(area); + do_indent(indent);printf("[%p] area (%d,%d,%d,%d) %p (l:%p r:%p u:%p d:%p)\n", area, + area->bbox.xmin, + area->bbox.ymin, + area->bbox.xmax, + area->bbox.ymax, + area->data, + area->neighbors[KD_LEFT], + area->neighbors[KD_RIGHT], + area->neighbors[KD_UP], + area->neighbors[KD_DOWN]); + if(area->split) { + kdbranch_print(area->split, indent+4); + } +} + +void kdtree_print(kdtree_t*tree) +{ + kdarea_print(tree->root, 0); +} + + +void kdbranch_destroy(kdbranch_t*b) +{ + if(b->side[0]) { + kdarea_destroy(b->side[0]); + b->side[0] = 0; + } + if(b->side[1]) { + kdarea_destroy(b->side[1]); + b->side[1] = 0; + } + free(b); +} + +void kdarea_destroy(kdarea_t*area) +{ + if(area->split) { + kdbranch_destroy(area->split); + } + free(area); +} + +void kdtree_destroy(kdtree_t*tree) +{ + kdarea_destroy(tree->root); + tree->root = 0; + free(tree); +} + +#ifdef MAIN +int main() +{ + assert((1^vx[2]) < 0); + + kdtree_t*tree = kdtree_new(); + kdtree_add_box(tree, 10,30,20,40, "hello world"); + kdtree_add_box(tree, 12,50,15,60, "hello world"); + //kdtree_print(tree); + kdarea_t*a = kdtree_find(tree, 15,35); + kdarea_t*left = kdarea_neighbor(a, KD_LEFT, /*y*/35); + kdarea_t*right = kdarea_neighbor(a, KD_RIGHT, /*y*/35); + kdarea_t*up = kdarea_neighbor(a, KD_UP, /*x*/15); + kdarea_t*down = kdarea_neighbor(a, KD_DOWN, /*x*/15); + + a = kdtree_find(tree, 15,25); + assert(!a || !a->data); + a = kdtree_find(tree, 15,45); + assert(!a || !a->data); + a = kdtree_find(tree, 5,35); + assert(!a || !a->data); + a = kdtree_find(tree, 45,35); + assert(!a || !a->data); + + kdtree_destroy(tree); +} +#endif diff -Nru swftools-0.9.0/lib/kdtree.h swftools-0.9.2/lib/kdtree.h --- swftools-0.9.0/lib/kdtree.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/kdtree.h 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,105 @@ +/* kdtree.h + Implementation of 2d kd trees. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __kdtree_h__ +#define __kdtree_h__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* + 3 + A + | + | + 2 <---- ----> 0 + | + | + V + 1 +*/ + +typedef enum {KD_RIGHT=0, KD_DOWN=1, KD_LEFT=2, KD_UP=3} kdtype_t; + +typedef struct _kdbbox { + int32_t xmin, ymin, xmax, ymax; +} kdbbox_t; + +struct _kdbranch; +struct _kdarea; +typedef struct _kdbranch kdbranch_t; +typedef struct _kdarea kdarea_t; + +struct _kdbranch { + kdtype_t type; + kdarea_t*side[2]; + int32_t xy; +}; + +struct _kdarea { + kdarea_t*neighbors[4]; + kdbbox_t bbox; + kdbranch_t*split; + void*data; +}; + +typedef struct _kdtree { + kdarea_t*root; +} kdtree_t; + +/* usually a subset of the tree, e.g. caused by + intersecting the tree with a halfplane */ +typedef struct _kdarea_list { + struct _kdarea_list*next; + struct _kdarea_list*prev; + kdarea_t*area; +} kdarea_list_t; + +typedef struct _kdresult_list { + void*data; + struct _kdresult_list*next; +} kdresult_list_t; + +kdtree_t* kdtree_new(); +void kdarea_destroy(kdarea_t*area); +void kdbranch_destroy(kdbranch_t*b); +void kdtree_destroy(kdtree_t*tree); +kdarea_t* kdtree_find(kdtree_t*tree, int x, int y); +void kdtree_add_box(kdtree_t*tree, int32_t x1, int32_t y1, int32_t x2, int32_t y2, void*data); +kdresult_list_t*kdtree_find_in_box(kdtree_t*tree, int32_t x1, int32_t y1, int32_t x2, int32_t y2); + +void kdtree_print(kdtree_t*tree); + +kdarea_t*kdarea_neighbor(kdarea_t*area, int dir, int xy); + +#define kdarea_left_neighbor(area, y) (kdarea_neighbor((area), KD_LEFT, (y))) +#define kdarea_right_neighbor(area, y) (kdarea_neighbor((area), KD_RIGHT, (y))) +#define kdarea_top_neighbor(area, x) (kdarea_neighbor((area), KD_TOP, (x))) +#define kdarea_bottom_neighbor(area, x) (kdarea_neighbor((area), KD_BOTTOM, (x))) + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru swftools-0.9.0/lib/log.c swftools-0.9.2/lib/log.c --- swftools-0.9.0/lib/log.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/log.c 2011-10-07 03:20:17.000000000 +0000 @@ -36,10 +36,10 @@ #include "log.h" +int maxloglevel = 1; static int screenloglevel = 1; static int fileloglevel = -1; static FILE *logFile = 0; -static int maxloglevel = 1; int getScreenLogLevel() { @@ -191,7 +191,14 @@ } log_str(buf); } -void msg(const char* format, ...) + +char char2loglevel[32] = +/* a b c d e f g h i j k l m n o */ +{-1,-1,-1,-1, /*debug*/5, /*error*/1, /*fatal*/0, -1, -1, -1,-1,-1,-1,-1,/*notice*/3,-1, +/* p q r s t u v w x y z */ + -1,-1,-1, -1, /*trace*/6, -1,/*verbose*/4,/*warning*/2, -1,-1,-1, -1,-1,-1,-1,-1}; + +int msg_internal(const char* format, ...) { char buf[1024]; va_list arglist; @@ -202,12 +209,13 @@ char*z = "fewnvdt"; char*x = strchr(z,format[1]); if(x && (x-z)>maxloglevel) - return; + return 0; } vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); strcat(buf, "\n"); log_str(buf); + return 0; } diff -Nru swftools-0.9.0/lib/log.h swftools-0.9.2/lib/log.h --- swftools-0.9.0/lib/log.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/log.h 2010-11-12 18:53:44.000000000 +0000 @@ -44,7 +44,13 @@ extern void setConsoleLogging(int level); extern void setFileLogging(char*filename, int level, char append); -extern void msg(const char* logFormat, ...); +extern int maxloglevel; +extern char char2loglevel[32]; + +#define msg(fmt,args...) \ + (((fmt)[0]=='<' && char2loglevel[(fmt)[1]&31]<=maxloglevel)?msg_internal((fmt),## args):0) + +extern int msg_internal(const char* logFormat, ...); extern void msg_str(const char* log); extern void exitLog(void); diff -Nru swftools-0.9.0/lib/Makefile.in swftools-0.9.2/lib/Makefile.in --- swftools-0.9.0/lib/Makefile.in 2009-04-12 23:25:30.000000000 +0000 +++ swftools-0.9.2/lib/Makefile.in 2011-10-07 03:35:18.000000000 +0000 @@ -3,9 +3,7 @@ top_srcdir = @top_srcdir@ include ../Makefile.common -DEVICES = devices/swf.$(O) #devices/lrf.$(O) devices/opengl.$(O) - -all: librfxswf$(A) libpdf$(A) libbase$(A) libgfx$(A) libgfxswf$(A) libocr$(A) $(DEVICES) +all: librfxswf$(A) libgfxpdf$(A) libbase$(A) libgfx$(A) libgfxswf$(A) libocr$(A) lame_objects = lame/psymodel.$(O) lame/fft.$(O) lame/newmdct.$(O) lame/quantize.$(O) lame/takehiro.$(O) lame/reservoir.$(O) lame/quantize_pvt.$(O) lame/vbrquantize.$(O) lame/encoder.$(O) lame/id3tag.$(O) lame/version.$(O) lame/tables.$(O) lame/util.$(O) lame/bitstream.$(O) lame/set_get.$(O) lame/VbrTag.$(O) lame/lame.$(O) lame_in_source = @lame_in_source@ @@ -15,17 +13,17 @@ as12compiler_objects = action/assembler.$(O) action/compile.$(O) action/lex.swf4.$(O) action/lex.swf5.$(O) action/libming.$(O) action/swf4compiler.tab.$(O) action/swf5compiler.tab.$(O) action/actioncompiler.$(O) as12compiler_in_source = $(as12compiler_objects) -as3compiler_objects = as3/abc.$(O) as3/pool.$(O) as3/files.$(O) as3/opcodes.$(O) as3/code.$(O) as3/registry.$(O) as3/builtin.$(O) as3/parser.tab.$(O) as3/tokenizer.yy.$(O) as3/scripts.$(O) as3/compiler.$(O) as3/import.$(O) as3/expr.$(O) as3/common.$(O) as3/initcode.$(O) - -rfxswf_modules = modules/swfbits.c modules/swfaction.c modules/swfdump.c modules/swfcgi.c modules/swfbutton.c modules/swftext.c modules/swffont.c modules/swftools.c modules/swfsound.c modules/swfshape.c modules/swfobject.c modules/swfdraw.c modules/swffilter.c modules/swfrender.c h.263/swfvideo.c +as3compiler_objects = as3/abc.$(O) as3/pool.$(O) as3/files.$(O) as3/opcodes.$(O) as3/code.$(O) as3/registry.$(O) as3/builtin.$(O) as3/tokenizer.yy.$(O) as3/parser.tab.$(O) as3/scripts.$(O) as3/compiler.$(O) as3/import.$(O) as3/expr.$(O) as3/parser_help.$(O) as3/state.$(O) as3/common.$(O) as3/initcode.$(O) as3/assets.$(O) +gfxpoly_objects = gfxpoly/active.$(O) gfxpoly/convert.$(O) gfxpoly/poly.$(O) gfxpoly/renderpoly.$(O) gfxpoly/stroke.$(O) gfxpoly/wind.$(O) gfxpoly/xrow.$(O) gfxpoly/moments.$(O) -base_objects=q.$(O) utf8.$(O) png.$(O) jpeg.$(O) wav.$(O) mp3.$(O) os.$(O) bitio.$(O) log.$(O) mem.$(O) -gfx_objects=gfxtools.$(O) gfxfont.$(O) gfxpoly.$(O) devices/dummy.$(O) devices/file.$(O) devices/render.$(O) devices/text.$(O) devices/record.$(O) devices/ops.$(O) devices/polyops.$(O) devices/bbox.$(O) devices/rescale.$(O) @DEVICE_OPENGL@ +rfxswf_modules = modules/swfbits.c modules/swfaction.c modules/swfdump.c modules/swfcgi.c modules/swfbutton.c modules/swftext.c modules/swffont.c modules/swftools.c modules/swfsound.c modules/swfshape.c modules/swfobject.c modules/swfdraw.c modules/swffilter.c modules/swfrender.c h.263/swfvideo.c modules/swfalignzones.c -art_objects = art/art_affine.$(O) art/art_alphagamma.$(O) art/art_bpath.$(O) art/art_gray_svp.$(O) art/art_misc.$(O) art/art_pixbuf.$(O) art/art_rect.$(O) art/art_rect_svp.$(O) art/art_rect_uta.$(O) art/art_render.$(O) art/art_render_gradient.$(O) art/art_render_mask.$(O) art/art_render_svp.$(O) art/art_rgb.$(O) art/art_rgb_a_affine.$(O) art/art_rgb_affine.$(O) art/art_rgb_affine_private.$(O) art/art_rgb_bitmap_affine.$(O) art/art_rgb_pixbuf_affine.$(O) art/art_rgb_rgba_affine.$(O) art/art_rgb_svp.$(O) art/art_rgba.$(O) art/art_svp.$(O) art/art_svp_intersect.$(O) art/art_svp_ops.$(O) art/art_svp_point.$(O) art/art_svp_render_aa.$(O) art/art_svp_vpath.$(O) art/art_svp_vpath_stroke.$(O) art/art_svp_wind.$(O) art/art_uta.$(O) art/art_uta_ops.$(O) art/art_uta_rect.$(O) art/art_uta_svp.$(O) art/art_uta_vpath.$(O) art/art_vpath.$(O) art/art_vpath_bpath.$(O) art/art_vpath_dash.$(O) art/art_vpath_svp.$(O) -art_in_source = @art_in_source@ +base_objects=q.$(O) base64.$(O) utf8.$(O) png.$(O) jpeg.$(O) wav.$(O) mp3.$(O) os.$(O) bitio.$(O) log.$(O) mem.$(O) xml.$(O) ttf.$(O) kdtree.$(O) graphcut.$(O) +devices=devices/dummy.$(O) devices/file.$(O) devices/render.$(O) devices/text.$(O) devices/record.$(O) devices/ops.$(O) devices/polyops.$(O) devices/bbox.$(O) devices/rescale.$(O) @DEVICE_OPENGL@ @DEVICE_PDF@ +filters=filters/alpha.$(O) filters/remove_font_transforms.$(O) filters/one_big_font.$(O) filters/vectors_to_glyphs.$(O) filters/remove_invisible_characters.$(O) filters/flatten.$(O) filters/rescale_images.$(O) +gfx_objects=gfximage.$(O) gfxtools.$(O) gfxfont.$(O) gfxfilter.$(O) $(devices) $(filters) -rfxswf_objects=modules/swfaction.$(O) modules/swfbits.$(O) modules/swfbutton.$(O) modules/swfcgi.$(O) modules/swfdraw.$(O) modules/swfdump.$(O) modules/swffilter.$(O) modules/swffont.$(O) modules/swfobject.$(O) modules/swfrender.$(O) modules/swfshape.$(O) modules/swfsound.$(O) modules/swftext.$(O) modules/swftools.$(O) +rfxswf_objects=modules/swfaction.$(O) modules/swfbits.$(O) modules/swfbutton.$(O) modules/swfcgi.$(O) modules/swfdraw.$(O) modules/swfdump.$(O) modules/swffilter.$(O) modules/swffont.$(O) modules/swfobject.$(O) modules/swfrender.$(O) modules/swfshape.$(O) modules/swfsound.$(O) modules/swftext.$(O) modules/swftools.$(O) modules/swfalignzones.$(O) ocr_objects=gocr/box.$(O) gocr/database.$(O) gocr/detect.$(O) gocr/job.$(O) gocr/lines.$(O) gocr/list.$(O) gocr/ocr0.$(O) gocr/ocr0n.$(O) gocr/ocr1.$(O) gocr/otsu.$(O) gocr/output.$(O) gocr/pgm2asc.$(O) gocr/pixel.$(O) gocr/progress.$(O) gocr/remove.$(O) gocr/unicode.$(O) %.$(O): %.c @@ -36,6 +34,8 @@ $(C) $< -o $@ as3/%.$(O): as3/%.c $(C) $< -o $@ +gfxpoly/%.$(O): gfxpoly/%.c + $(C) $< -o $@ bitio.$(O): bitio.c bitio.h $(C) bitio.c -o $@ @@ -55,6 +55,12 @@ $(C) mp3.c -o $@ wav.$(O): wav.c wav.h $(top_builddir)/config.h $(C) wav.c -o $@ +xml.$(O): xml.c xml.h bitio.h + $(C) xml.c -o $@ +graphcut.$(O): graphcut.c graphcut.h + $(C) graphcut.c -o $@ +ttf.$(O): ttf.c ttf.h + $(C) ttf.c -o $@ os.$(O): os.c os.h $(top_builddir)/config.h $(C) -DSWFTOOLS_DATADIR=\"$(pkgdatadir)\" os.c -o $@ modules/swfaction.$(O): modules/swfaction.c rfxswf.h @@ -71,6 +77,8 @@ $(C) modules/swfdump.c -o $@ modules/swffilter.$(O): modules/swffilter.c rfxswf.h $(C) modules/swffilter.c -o $@ +modules/swfalignzones.$(O): modules/swfalignzones.c rfxswf.h + $(C) modules/swfalignzones.c -o $@ modules/swffont.$(O): modules/swffont.c rfxswf.h $(C) modules/swffont.c -o $@ modules/swfobject.$(O): modules/swfobject.c rfxswf.h @@ -85,20 +93,21 @@ $(C) modules/swftext.c -o $@ modules/swftools.$(O): modules/swftools.c rfxswf.h $(C) modules/swftools.c -o $@ +gfximage.$(O): gfximage.c gfximage.h gfxdevice.h $(top_builddir)/config.h + $(C) gfximage.c -o $@ gfxtools.$(O): gfxtools.c gfxtools.h $(top_builddir)/config.h $(C) gfxtools.c -o $@ -gfxpoly.$(O): gfxpoly.c gfxpoly.h $(top_builddir)/config.h - $(C) gfxpoly.c -o $@ -gfxfont.$(O): gfxfont.c gfxfont.h $(top_builddir)/config.h +gfxfont.$(O): gfxfont.c gfxfont.h ttf.h $(top_builddir)/config.h $(C) gfxfont.c -o $@ +gfxfilter.$(O): gfxfilter.c gfxfilter.h ttf.h $(top_builddir)/config.h + $(C) gfxfilter.c -o $@ gfxwindow.$(O): gfxwindow_win32.c gfxwindow_unix.c gfxwindow.c gfxwindow.h $(C) gfxwindow.c -o $@ -MD5.$(O): MD5.c MD5.h - $(C) MD5.c -o $@ log.$(O): log.c log.h $(C) log.c -o $@ -rfxswf.$(O): rfxswf.c rfxswf.h drawer.h bitio.h log.h MD5.h $(top_builddir)/config.h + +rfxswf.$(O): rfxswf.c rfxswf.h drawer.h bitio.h log.h $(top_builddir)/config.h $(C) rfxswf.c -o $@ #$(as12compiler_objects): @@ -138,29 +147,49 @@ devices/ocr.$(O): devices/ocr.c devices/ocr.h gocr/gocr.h $(C) devices/ocr.c -o devices/ocr.$(O) +filters/alpha.$(O): filters/alpha.c gfxfilter.h + $(C) filters/alpha.c -o filters/alpha.$(O) +filters/flatten.$(O): filters/flatten.c gfxfilter.h + $(C) filters/flatten.c -o filters/flatten.$(O) +filters/remove_font_transform.$(O): filters/remove_font_transform.c gfxfilter.h + $(C) filters/remove_font_transform.c -o filters/remove_font_transform.$(O) +filters/remove_invisible_characters.$(O): filters/remove_invisible_characters.c gfxfilter.h + $(C) filters/remove_invisible_characters.c -o filters/remove_invisible_characters.$(O) +filters/rescale_images.$(O): filters/rescale_images.c gfxfilter.h + $(C) filters/rescale_images.c -o filters/rescale_images.$(O) + readers/swf2.$(O): readers/swf.c readers/swf.h $(C) readers/swf.c -o readers/swf2.$(O) readers/image.$(O): readers/image.c readers/image.h $(C) readers/image.c -o readers/image.$(O) libocr$(A): $(ocr_objects) devices/ocr.$(O) + rm -f libocr$(A) $(AR) r libocr$(A) $(ocr_objects) devices/ocr.$(O) + $(RANLIB) libocr$(A) libbase$(A): $(base_objects) Makefile + rm -f libbase$(A) $(AR) r libbase$(A) $(base_objects) + $(RANLIB) libbase$(A) libgfxswf$(A): devices/swf.$(O) readers/swf2.$(O) readers/image.$(O) + rm -f libgfxswf$(A) $(AR) r libgfxswf$(A) devices/swf.$(O) readers/swf2.$(O) readers/image.$(O) + $(RANLIB) libgfxswf$(A) -libgfx$(A): $(gfx_objects) $(art_in_source) Makefile - $(AR) r libgfx$(A) $(gfx_objects) $(art_in_source) - -librfxswf$(A): Makefile $(rfxswf_objects) rfxswf.$(O) drawer.$(O) MD5.$(O) $(lame_in_source) $(h263_objects) $(as12compiler_in_source) $(as3compiler_objects) Makefile - $(AR) r librfxswf$(A) $(rfxswf_objects) rfxswf.$(O) drawer.$(O) MD5.$(O) $(lame_in_source) $(h263_objects) $(as12compiler_in_source) $(as3compiler_objects) +libgfx$(A): $(gfx_objects) $(gfxpoly_objects) Makefile + rm -f libgfx$(A) + $(AR) r libgfx$(A) $(gfx_objects) $(gfxpoly_objects) + $(RANLIB) libgfx$(A) + +librfxswf$(A): Makefile $(rfxswf_objects) rfxswf.$(O) drawer.$(O) $(lame_in_source) $(h263_objects) $(as12compiler_in_source) $(as3compiler_objects) Makefile + rm -f librfxswf$(A) + $(AR) r librfxswf$(A) $(rfxswf_objects) rfxswf.$(O) drawer.$(O) $(lame_in_source) $(h263_objects) $(as12compiler_in_source) $(as3compiler_objects) $(RANLIB) librfxswf$(A) -libpdf$(A): pdf/GFXOutputDev.cc pdf/GFXOutputDev.h pdf/pdf.cc pdf/pdf.h - cd pdf;$(MAKE) libpdf +libgfxpdf$(A): pdf/VectorGraphicOutputDev.cc pdf/VectorGraphicOutputDev.h pdf/pdf.cc pdf/pdf.h + cd pdf;$(MAKE) libgfxpdf tests: png.test.c $(L) png.test.c -o png.test $(LIBS) @@ -170,7 +199,7 @@ clean: rm -f *.o *.obj *.lo *.a *.lib *.la gmon.out - for dir in art modules devices swf as3 h.263;do rm -f $$dir/*.o $$dir/*.obj $$dir/*.lo $$dir/*.a $$dir/*.lib $$dir/*.la $$dir/gmon.out;done + for dir in modules filters devices swf as3 readers art gocr h.263 gfxpoly;do rm -f $$dir/*.o $$dir/*.obj $$dir/*.lo $$dir/*.a $$dir/*.lib $$dir/*.la $$dir/gmon.out;done cd lame && $(MAKE) clean && cd .. || true cd action && $(MAKE) clean && cd .. cd python && $(MAKE) clean && cd .. diff -Nru swftools-0.9.0/lib/MD5.c swftools-0.9.2/lib/MD5.c --- swftools-0.9.0/lib/MD5.c 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/MD5.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,576 +0,0 @@ -/* $FreeBSD: src/sys/crypto/md5.h,v 1.4 2002/03/20 05:13:50 alfred Exp $ */ -/* $KAME: md5.h,v 1.4 2000/03/27 04:36:22 sumikawa Exp $ */ - -/* - * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "../config.h" - -#include - -#ifndef _NETINET6_MD5_H_ -#define _NETINET6_MD5_H_ - -#define MD5_BUFLEN 64 - -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1 -#endif -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 2 -#endif -#ifndef BYTE_ORDER -#ifdef WORDS_BIGENDIAN -#define BYTE_ORDER BIG_ENDIAN -#else -#define BYTE_ORDER LITTLE_ENDIAN -#endif -#endif - -typedef long unsigned int u_int32_t; -typedef long long unsigned int u_int64_t; -typedef unsigned char u_int8_t; -typedef unsigned int u_int; -typedef unsigned long u_long; -typedef unsigned char u_char; - -typedef struct { - union { - u_int32_t md5_state32[4]; - u_int8_t md5_state8[16]; - } md5_st; - -#define md5_sta md5_st.md5_state32[0] -#define md5_stb md5_st.md5_state32[1] -#define md5_stc md5_st.md5_state32[2] -#define md5_std md5_st.md5_state32[3] -#define md5_st8 md5_st.md5_state8 - - union { - u_int64_t md5_count64; - u_int8_t md5_count8[8]; - } md5_count; -#define md5_n md5_count.md5_count64 -#define md5_n8 md5_count.md5_count8 - - u_int md5_i; - u_int8_t md5_buf[MD5_BUFLEN]; -} md5_ctxt; - -static void md5_init(md5_ctxt *); -static void md5_loop(md5_ctxt *, const u_int8_t *, u_int); -static void md5_pad(md5_ctxt *); -static void md5_result(u_int8_t *, md5_ctxt *); - -/* compatibility */ -#define MD5_CTX md5_ctxt -#define MD5Init(x) md5_init((x)) -#define MD5Update(x, y, z) md5_loop((x), (y), (z)) -#define MD5Final(x, y) \ -do { \ - md5_pad((y)); \ - md5_result((x), (y)); \ -} while (0) - -#endif /* ! _NETINET6_MD5_H_*/ - -/*- - * Copyright (c) 2003 Poul-Henning Kamp - * Copyright (c) 1999 - * University of California. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -/* - * UNIX password - */ - -#ifndef HAVE_BCOPY -void bcopy(const void*src, void*dest, int len) -{ - memcpy(dest, src, len); -} -#endif - -#ifndef HAVE_BZERO -void bzero(void*mem, int len) -{ - memset(mem, 0, len); -} -#endif - -#define MD4_SIZE 16 -#define MD5_SIZE 16 - -static char itoa64[] = /* 0 ... 63 => ascii - 64 */ - "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - -static void -_crypt_to64(char *s, u_long v, int n) -{ - while (--n >= 0) { - *s++ = itoa64[v&0x3f]; - v >>= 6; - } -} - -void hash_md5(const unsigned char*buf, int len, unsigned char*dest) -{ - u_char final[MD5_SIZE]; - - MD5_CTX ctx; - MD5Init(&ctx); - MD5Update(&ctx, buf, len); - MD5Final(dest, &ctx); -} - -char * crypt_md5(const char *pw, const char *salt) -{ - MD5_CTX ctx,ctx1; - unsigned long l; - int sl, pl; - u_int i; - u_char final[MD5_SIZE]; - static const char *sp, *ep; - static char passwd[120], *p; - static const char *magic = "$1$"; - - /* Refine the Salt first */ - sp = salt; - - /* If it starts with the magic string, then skip that */ - if(!strncmp(sp, magic, strlen(magic))) - sp += strlen(magic); - - /* It stops at the first '$', max 8 chars */ - for(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++) - continue; - - /* get the length of the true salt */ - sl = ep - sp; - - MD5Init(&ctx); - - /* The password first, since that is what is most unknown */ - MD5Update(&ctx, (const u_char *)pw, strlen(pw)); - - /* Then our magic string */ - MD5Update(&ctx, (const u_char *)magic, strlen(magic)); - - /* Then the raw salt */ - MD5Update(&ctx, (const u_char *)sp, (u_int)sl); - - /* Then just as many characters of the MD5(pw,salt,pw) */ - MD5Init(&ctx1); - MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); - MD5Update(&ctx1, (const u_char *)sp, (u_int)sl); - MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); - MD5Final(final, &ctx1); - for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE) - MD5Update(&ctx, (const u_char *)final, - (u_int)(pl > MD5_SIZE ? MD5_SIZE : pl)); - - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); - - /* Then something really weird... */ - for (i = strlen(pw); i; i >>= 1) - if(i & 1) - MD5Update(&ctx, (const u_char *)final, 1); - else - MD5Update(&ctx, (const u_char *)pw, 1); - - /* Now make the output string */ - strcpy(passwd, magic); - strncat(passwd, sp, (u_int)sl); - strcat(passwd, "$"); - - MD5Final(final, &ctx); - - /* - * and now, just to make sure things don't run too fast - * On a 60 Mhz Pentium this takes 34 msec, so you would - * need 30 seconds to build a 1000 entry dictionary... - */ - for(i = 0; i < 1000; i++) { - MD5Init(&ctx1); - if(i & 1) - MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); - else - MD5Update(&ctx1, (const u_char *)final, MD5_SIZE); - - if(i % 3) - MD5Update(&ctx1, (const u_char *)sp, (u_int)sl); - - if(i % 7) - MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); - - if(i & 1) - MD5Update(&ctx1, (const u_char *)final, MD5_SIZE); - else - MD5Update(&ctx1, (const u_char *)pw, strlen(pw)); - MD5Final(final, &ctx1); - } - - p = passwd + strlen(passwd); - - l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; - _crypt_to64(p, l, 4); p += 4; - l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; - _crypt_to64(p, l, 4); p += 4; - l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; - _crypt_to64(p, l, 4); p += 4; - l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; - _crypt_to64(p, l, 4); p += 4; - l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; - _crypt_to64(p, l, 4); p += 4; - l = final[11]; - _crypt_to64(p, l, 2); p += 2; - *p = '\0'; - - /* Don't leave anything around in vm they could use. */ - memset(final, 0, sizeof(final)); - - return (passwd); -} - -/* $KAME: md5.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */ -/* - * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#define SHIFT(X, s) (((X) << (s)) | ((X) >> (32 - (s)))) - -#define F(X, Y, Z) (((X) & (Y)) | ((~X) & (Z))) -#define G(X, Y, Z) (((X) & (Z)) | ((Y) & (~Z))) -#define H(X, Y, Z) ((X) ^ (Y) ^ (Z)) -#define I(X, Y, Z) ((Y) ^ ((X) | (~Z))) - -#define ROUND1(a, b, c, d, k, s, i) { \ - (a) = (a) + F((b), (c), (d)) + X[(k)] + T[(i)]; \ - (a) = SHIFT((a), (s)); \ - (a) = (b) + (a); \ -} - -#define ROUND2(a, b, c, d, k, s, i) { \ - (a) = (a) + G((b), (c), (d)) + X[(k)] + T[(i)]; \ - (a) = SHIFT((a), (s)); \ - (a) = (b) + (a); \ -} - -#define ROUND3(a, b, c, d, k, s, i) { \ - (a) = (a) + H((b), (c), (d)) + X[(k)] + T[(i)]; \ - (a) = SHIFT((a), (s)); \ - (a) = (b) + (a); \ -} - -#define ROUND4(a, b, c, d, k, s, i) { \ - (a) = (a) + I((b), (c), (d)) + X[(k)] + T[(i)]; \ - (a) = SHIFT((a), (s)); \ - (a) = (b) + (a); \ -} - -#define Sa 7 -#define Sb 12 -#define Sc 17 -#define Sd 22 - -#define Se 5 -#define Sf 9 -#define Sg 14 -#define Sh 20 - -#define Si 4 -#define Sj 11 -#define Sk 16 -#define Sl 23 - -#define Sm 6 -#define Sn 10 -#define So 15 -#define Sp 21 - -#define MD5_A0 0x67452301 -#define MD5_B0 0xefcdab89 -#define MD5_C0 0x98badcfe -#define MD5_D0 0x10325476 - -/* Integer part of 4294967296 times abs(sin(i)), where i is in radians. */ -static const u_int32_t T[65] = { - 0, - 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, - 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, - 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, - 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, - - 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, - 0xd62f105d, 0x2441453, 0xd8a1e681, 0xe7d3fbc8, - 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, - 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, - - 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, - 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, - 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05, - 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, - - 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, - 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, - 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, - 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391, -}; - -static const u_int8_t md5_paddat[MD5_BUFLEN] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static void md5_calc(u_int8_t *, md5_ctxt *); - -static void md5_init(md5_ctxt *ctxt) -{ - ctxt->md5_n = 0; - ctxt->md5_i = 0; - ctxt->md5_sta = MD5_A0; - ctxt->md5_stb = MD5_B0; - ctxt->md5_stc = MD5_C0; - ctxt->md5_std = MD5_D0; - bzero(ctxt->md5_buf, sizeof(ctxt->md5_buf)); -} - -static void md5_loop(md5_ctxt *ctxt, const u_int8_t *input, u_int len) -{ - u_int gap, i; - - ctxt->md5_n += len * 8; /* byte to bit */ - gap = MD5_BUFLEN - ctxt->md5_i; - - if (len >= gap) { - bcopy((void *)input, (void *)(ctxt->md5_buf + ctxt->md5_i), - gap); - md5_calc(ctxt->md5_buf, ctxt); - - for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) { - md5_calc((u_int8_t *)(input + i), ctxt); - } - - ctxt->md5_i = len - i; - bcopy((void *)(input + i), (void *)ctxt->md5_buf, ctxt->md5_i); - } else { - bcopy((void *)input, (void *)(ctxt->md5_buf + ctxt->md5_i), - len); - ctxt->md5_i += len; - } -} - -static void md5_pad(md5_ctxt *ctxt) -{ - u_int gap; - - /* Don't count up padding. Keep md5_n. */ - gap = MD5_BUFLEN - ctxt->md5_i; - if (gap > 8) { - bcopy(md5_paddat, - (void *)(ctxt->md5_buf + ctxt->md5_i), - gap - sizeof(ctxt->md5_n)); - } else { - /* including gap == 8 */ - bcopy(md5_paddat, (void *)(ctxt->md5_buf + ctxt->md5_i), - gap); - md5_calc(ctxt->md5_buf, ctxt); - bcopy((md5_paddat + gap), - (void *)ctxt->md5_buf, - MD5_BUFLEN - sizeof(ctxt->md5_n)); - } - - /* 8 byte word */ -#if BYTE_ORDER == LITTLE_ENDIAN - bcopy(&ctxt->md5_n8[0], &ctxt->md5_buf[56], 8); -#endif -#if BYTE_ORDER == BIG_ENDIAN - ctxt->md5_buf[56] = ctxt->md5_n8[7]; - ctxt->md5_buf[57] = ctxt->md5_n8[6]; - ctxt->md5_buf[58] = ctxt->md5_n8[5]; - ctxt->md5_buf[59] = ctxt->md5_n8[4]; - ctxt->md5_buf[60] = ctxt->md5_n8[3]; - ctxt->md5_buf[61] = ctxt->md5_n8[2]; - ctxt->md5_buf[62] = ctxt->md5_n8[1]; - ctxt->md5_buf[63] = ctxt->md5_n8[0]; -#endif - - md5_calc(ctxt->md5_buf, ctxt); -} - -static void md5_result(u_int8_t *digest, md5_ctxt *ctxt) -{ - /* 4 byte words */ -#if BYTE_ORDER == LITTLE_ENDIAN - bcopy(&ctxt->md5_st8[0], digest, 16); -#endif -#if BYTE_ORDER == BIG_ENDIAN - digest[ 0] = ctxt->md5_st8[ 3]; digest[ 1] = ctxt->md5_st8[ 2]; - digest[ 2] = ctxt->md5_st8[ 1]; digest[ 3] = ctxt->md5_st8[ 0]; - digest[ 4] = ctxt->md5_st8[ 7]; digest[ 5] = ctxt->md5_st8[ 6]; - digest[ 6] = ctxt->md5_st8[ 5]; digest[ 7] = ctxt->md5_st8[ 4]; - digest[ 8] = ctxt->md5_st8[11]; digest[ 9] = ctxt->md5_st8[10]; - digest[10] = ctxt->md5_st8[ 9]; digest[11] = ctxt->md5_st8[ 8]; - digest[12] = ctxt->md5_st8[15]; digest[13] = ctxt->md5_st8[14]; - digest[14] = ctxt->md5_st8[13]; digest[15] = ctxt->md5_st8[12]; -#endif -} - -static void md5_calc(u_int8_t *b64, md5_ctxt *ctxt) -{ - u_int32_t A = ctxt->md5_sta; - u_int32_t B = ctxt->md5_stb; - u_int32_t C = ctxt->md5_stc; - u_int32_t D = ctxt->md5_std; -#if BYTE_ORDER == LITTLE_ENDIAN - u_int32_t *X = (u_int32_t *)b64; -#endif -#if BYTE_ORDER == BIG_ENDIAN - u_int32_t X[16]; - /* 4 byte words */ - /* what a brute force but fast! */ - u_int8_t *y = (u_int8_t *)X; - y[ 0] = b64[ 3]; y[ 1] = b64[ 2]; y[ 2] = b64[ 1]; y[ 3] = b64[ 0]; - y[ 4] = b64[ 7]; y[ 5] = b64[ 6]; y[ 6] = b64[ 5]; y[ 7] = b64[ 4]; - y[ 8] = b64[11]; y[ 9] = b64[10]; y[10] = b64[ 9]; y[11] = b64[ 8]; - y[12] = b64[15]; y[13] = b64[14]; y[14] = b64[13]; y[15] = b64[12]; - y[16] = b64[19]; y[17] = b64[18]; y[18] = b64[17]; y[19] = b64[16]; - y[20] = b64[23]; y[21] = b64[22]; y[22] = b64[21]; y[23] = b64[20]; - y[24] = b64[27]; y[25] = b64[26]; y[26] = b64[25]; y[27] = b64[24]; - y[28] = b64[31]; y[29] = b64[30]; y[30] = b64[29]; y[31] = b64[28]; - y[32] = b64[35]; y[33] = b64[34]; y[34] = b64[33]; y[35] = b64[32]; - y[36] = b64[39]; y[37] = b64[38]; y[38] = b64[37]; y[39] = b64[36]; - y[40] = b64[43]; y[41] = b64[42]; y[42] = b64[41]; y[43] = b64[40]; - y[44] = b64[47]; y[45] = b64[46]; y[46] = b64[45]; y[47] = b64[44]; - y[48] = b64[51]; y[49] = b64[50]; y[50] = b64[49]; y[51] = b64[48]; - y[52] = b64[55]; y[53] = b64[54]; y[54] = b64[53]; y[55] = b64[52]; - y[56] = b64[59]; y[57] = b64[58]; y[58] = b64[57]; y[59] = b64[56]; - y[60] = b64[63]; y[61] = b64[62]; y[62] = b64[61]; y[63] = b64[60]; -#endif - - ROUND1(A, B, C, D, 0, Sa, 1); ROUND1(D, A, B, C, 1, Sb, 2); - ROUND1(C, D, A, B, 2, Sc, 3); ROUND1(B, C, D, A, 3, Sd, 4); - ROUND1(A, B, C, D, 4, Sa, 5); ROUND1(D, A, B, C, 5, Sb, 6); - ROUND1(C, D, A, B, 6, Sc, 7); ROUND1(B, C, D, A, 7, Sd, 8); - ROUND1(A, B, C, D, 8, Sa, 9); ROUND1(D, A, B, C, 9, Sb, 10); - ROUND1(C, D, A, B, 10, Sc, 11); ROUND1(B, C, D, A, 11, Sd, 12); - ROUND1(A, B, C, D, 12, Sa, 13); ROUND1(D, A, B, C, 13, Sb, 14); - ROUND1(C, D, A, B, 14, Sc, 15); ROUND1(B, C, D, A, 15, Sd, 16); - - ROUND2(A, B, C, D, 1, Se, 17); ROUND2(D, A, B, C, 6, Sf, 18); - ROUND2(C, D, A, B, 11, Sg, 19); ROUND2(B, C, D, A, 0, Sh, 20); - ROUND2(A, B, C, D, 5, Se, 21); ROUND2(D, A, B, C, 10, Sf, 22); - ROUND2(C, D, A, B, 15, Sg, 23); ROUND2(B, C, D, A, 4, Sh, 24); - ROUND2(A, B, C, D, 9, Se, 25); ROUND2(D, A, B, C, 14, Sf, 26); - ROUND2(C, D, A, B, 3, Sg, 27); ROUND2(B, C, D, A, 8, Sh, 28); - ROUND2(A, B, C, D, 13, Se, 29); ROUND2(D, A, B, C, 2, Sf, 30); - ROUND2(C, D, A, B, 7, Sg, 31); ROUND2(B, C, D, A, 12, Sh, 32); - - ROUND3(A, B, C, D, 5, Si, 33); ROUND3(D, A, B, C, 8, Sj, 34); - ROUND3(C, D, A, B, 11, Sk, 35); ROUND3(B, C, D, A, 14, Sl, 36); - ROUND3(A, B, C, D, 1, Si, 37); ROUND3(D, A, B, C, 4, Sj, 38); - ROUND3(C, D, A, B, 7, Sk, 39); ROUND3(B, C, D, A, 10, Sl, 40); - ROUND3(A, B, C, D, 13, Si, 41); ROUND3(D, A, B, C, 0, Sj, 42); - ROUND3(C, D, A, B, 3, Sk, 43); ROUND3(B, C, D, A, 6, Sl, 44); - ROUND3(A, B, C, D, 9, Si, 45); ROUND3(D, A, B, C, 12, Sj, 46); - ROUND3(C, D, A, B, 15, Sk, 47); ROUND3(B, C, D, A, 2, Sl, 48); - - ROUND4(A, B, C, D, 0, Sm, 49); ROUND4(D, A, B, C, 7, Sn, 50); - ROUND4(C, D, A, B, 14, So, 51); ROUND4(B, C, D, A, 5, Sp, 52); - ROUND4(A, B, C, D, 12, Sm, 53); ROUND4(D, A, B, C, 3, Sn, 54); - ROUND4(C, D, A, B, 10, So, 55); ROUND4(B, C, D, A, 1, Sp, 56); - ROUND4(A, B, C, D, 8, Sm, 57); ROUND4(D, A, B, C, 15, Sn, 58); - ROUND4(C, D, A, B, 6, So, 59); ROUND4(B, C, D, A, 13, Sp, 60); - ROUND4(A, B, C, D, 4, Sm, 61); ROUND4(D, A, B, C, 11, Sn, 62); - ROUND4(C, D, A, B, 2, So, 63); ROUND4(B, C, D, A, 9, Sp, 64); - - ctxt->md5_sta += A; - ctxt->md5_stb += B; - ctxt->md5_stc += C; - ctxt->md5_std += D; -} - diff -Nru swftools-0.9.0/lib/MD5.h swftools-0.9.2/lib/MD5.h --- swftools-0.9.0/lib/MD5.h 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/lib/MD5.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* MD5.h - - Header for the FreeBSD MD5 password hashing algorithm - - Part of the swftools package. - - Copyright (c) 2003, 2004 Matthias Kramm - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - -#ifndef __MD5_h__ -#define __MD5_h__ -char * crypt_md5(const char *pw, const char *salt); -void hash_md5(const unsigned char*buf, int len, unsigned char*dest); //dest needs to be 16 bytes wide -#endif diff -Nru swftools-0.9.0/lib/mem.c swftools-0.9.2/lib/mem.c --- swftools-0.9.0/lib/mem.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/mem.c 2010-11-12 18:56:28.000000000 +0000 @@ -66,7 +66,7 @@ return 0; } #ifdef HAVE_CALLOC - ptr = calloc(size); + ptr = calloc(1, size); #else ptr = malloc(size); #endif @@ -80,6 +80,12 @@ #endif return ptr; } +#ifndef HAVE_CALLOC +void* rfx_calloc_replacement(int nmemb, int size) +{ + rfx_calloc(nmemb*size); +} +#endif #ifdef MEMORY_INFO long rfx_memory_used() diff -Nru swftools-0.9.0/lib/mem.h swftools-0.9.2/lib/mem.h --- swftools-0.9.0/lib/mem.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/mem.h 2011-12-12 21:29:27.000000000 +0000 @@ -5,11 +5,21 @@ extern "C" { #endif +#include + +#include "../config.h" + #define ALLOC_ARRAY(type, num) (((type)*)rfxalloc(sizeof(type)*(num))) void* rfx_alloc(int size); void* rfx_calloc(int size); void* rfx_realloc(void*data, int size); void rfx_free(void*data); + +#ifndef HAVE_CALLOC +void* rfx_calloc_replacement(int nmemb, int size); +#define calloc rfx_calloc_replacement +#endif + #ifdef MEMORY_INFO long rfx_memory_used(); char* rfx_memory_used_str(); diff -Nru swftools-0.9.0/lib/modules/swfaction.c swftools-0.9.2/lib/modules/swfaction.c --- swftools-0.9.0/lib/modules/swfaction.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfaction.c 2010-11-12 18:55:38.000000000 +0000 @@ -182,7 +182,6 @@ void swf_ActionFree(ActionTAG*action) { if(!action) { - fprintf(stderr, "Warning: freeing zero action"); return; } action = action->parent; @@ -208,6 +207,9 @@ void swf_ActionSet(TAG*tag, ActionTAG*action) { + if(!action) { + return; + } action=action->parent; while(action) { @@ -832,7 +834,7 @@ if (a1->op == ACTION_IF || a1->op == ACTION_JUMP) { - *(U16*)(a1->data) = SWAP16(len); + *(U16*)(a1->data) = LE_16_TO_NATIVE(len); } else if(a1->op == ACTION_WAITFORFRAME) { @@ -922,20 +924,20 @@ ActionTAG* action_GotoFrame(ActionTAG*atag, U16 frame) { atag = swf_AddActionTAG(atag, ACTION_GOTOFRAME, 0, 2); - *(U16*)atag->tmp = SWAP16(frame); + *(U16*)atag->tmp = LE_16_TO_NATIVE(frame); return atag; } ActionTAG* action_Jump(ActionTAG*atag, U16 branch) { atag = swf_AddActionTAG(atag, ACTION_JUMP, 0, 2); - *(U16*)atag->tmp = SWAP16(branch); + *(U16*)atag->tmp = LE_16_TO_NATIVE(branch); return atag; } ActionTAG* action_If(ActionTAG*atag, U16 branch) { atag = swf_AddActionTAG(atag, ACTION_IF, 0, 2); - *(U16*)atag->tmp = SWAP16(branch); + *(U16*)atag->tmp = LE_16_TO_NATIVE(branch); return atag; } ActionTAG* action_StoreRegister(ActionTAG*atag, U8 reg) @@ -965,7 +967,7 @@ ActionTAG* action_WaitForFrame(ActionTAG*atag, U16 frame, U8 skip) { atag = swf_AddActionTAG(atag, ACTION_WAITFORFRAME, 0, 3); - *(U16*)atag->tmp = SWAP16(frame); + *(U16*)atag->tmp = LE_16_TO_NATIVE(frame); *(U8*)&atag->tmp[2] = skip; return atag; } diff -Nru swftools-0.9.0/lib/modules/swfalignzones.c swftools-0.9.2/lib/modules/swfalignzones.c --- swftools-0.9.0/lib/modules/swfalignzones.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfalignzones.c 2010-11-12 18:55:47.000000000 +0000 @@ -0,0 +1,366 @@ +#include "../rfxswf.h" +#include "../graphcut.c" +#include "../log.h" + +static inline double sqr(double x) {return x*x;} + +static void draw_line(float*row, float x1, float x2, float y1, float y2, int min, int max, double weight) +{ + if(x2max) { + fprintf(stderr, "error: glyph x stroke out of bounds\n"); + return; + } + x1 -= min; + x2 -= min; + + double d = sqrt(sqr(y2-y1)+sqr(x2-x1)); + if(floor(x1)==floor(x2)) { + row[(int)floor(x1)] += d*weight; + } else { + double i = d/(x2-x1); + int x; + int xx1 = ceil(x1); + int xx2 = floor(x2); + row[xx1] += i*(xx1-x1)*weight; + row[xx2] += i*(x2-xx2)*weight; + for(x=xx1;xxmin, area->xmax, weight); + draw_line(column, y1, y2, x1, x2, area->ymin, area->ymax, weight); +} + +static void find_best(float*_row, int width, int*_x1, int*_x2, int min_size, int from, int to, int num, char debug) +{ + int x1=-1, x2=-1; + float max1=-1e20,max2=-1e20; + int t; + + if(from==to) { + *_x1 = from; + return; + } + + float*row = malloc(sizeof(float)*(width+1)); + int filter_size = 25; + float* filter = malloc(sizeof(float)*(filter_size*2+1)); + double var = filter_size/3; + double sum = 0; + for(t=-filter_size;t<=filter_size;t++) { + double v = t/var; + float r = v*v/2; + filter[filter_size+t] = exp(-r); + sum += filter[filter_size+t]; + } + for(t=-filter_size;t<=filter_size;t++) { + filter[filter_size+t]/=sum; + } + + //filter[0]=1;filter_size=0; + + for(t=0;t<=width;t++) { + int s; + double sum = 0; + for(s=-filter_size;s<=filter_size;s++) { + if(t+s<0) continue; + if(t+s>width) continue; + sum += _row[t+s]*filter[s+filter_size]; + } + row[t] = sum; + } + free(filter); + + for(t=from;t<=to;t++) { + if(row[t]>max1) { + max1 = row[t]; + x1 = t; + } + } + + + if(num<=1) { + *_x1=x1; + } else { + /* this code is slightly wrong, in that it assumes that the glyph distortion problem + gets worse when the font sizes get smaller. it doesn't. in fact, the smaller + the font size, the more of the scaling bugs disappear (http://www.quiss.org/files/scaletest.swf) + A better way would probably to use the font size you need for the two alignzones + to come to lie in different pixels, which what I think is what makes the problems + appear/disappear. + */ + + double scale = min_size/1024.0; + for(t=from;t<=to;t++) { + if(t==x1) { + row[t]=-1e20; + continue; + } + double r1 = (t=1 || add2>=1) { + row[t]=-1e20; + } + } + + for(t=from;t<=to;t++) { + if(row[t]>max2) { + max2 = row[t]; + x2 = t; + } + } + + if(x1>=0 && x2>=0 && x1>x2) {int x=x1;x1=x2;x2=x;} + + *_x1=x1; + *_x2=x2; + } + + free(row); +} + +static void negate_y(SRECT* b) +{ + // negate y + int by1=b->ymin,by2=b->ymax; + b->ymin = -by2; + b->ymax = -by1; +} + +static void draw_char(SWFFONT * f, int nr, float*row, float*column, SRECT b, double weight) +{ + SWFGLYPH*g = &f->glyph[nr]; + + SHAPE2*s = swf_ShapeToShape2(g->shape); + SHAPELINE*l = s->lines; + int x=0,y=0; + while(l) { + if(l->type == lineTo) { + draw_line_xy(row,column,x,-y,l->x,-l->y,&b,weight); + } else if(l->type == splineTo) { + double x1=x,x2=l->sx,x3=l->x; + double y1=y,y2=l->sy,y3=l->y; + double c = fabs(x3-2*x2+x1) + fabs(y3-2*y2+y1); + int parts = ((int)(sqrt(c)/6))*2+1; + float xx=x1,yy=y1; + int t; + for(t=1;t<=parts;t++) { + float nx = ((t*t*x3 + 2*t*(parts-t)*x2 + (parts-t)*(parts-t)*x1)/(double)(parts*parts)); + float ny = ((t*t*y3 + 2*t*(parts-t)*y2 + (parts-t)*(parts-t)*y1)/(double)(parts*parts)); + draw_line_xy(row,column,xx,-yy,nx,-ny,&b,weight); + xx = nx; + yy = ny; + } + } + x = l->x; + y = l->y; + l = l->next; + } + swf_Shape2Free(s); + free(s); +} + +static ALIGNZONE detect_for_char(SWFFONT * f, float*row, float*column, SRECT font_bbox, SRECT char_bbox) +{ + ALIGNZONE a = {0xffff,0xffff,0xffff,0xffff}; + int width = font_bbox.xmax - font_bbox.xmin; + int height = font_bbox.ymax - font_bbox.ymin; + if(!width || !height) + return a; + + /* find two best x values */ + int x1=-1,y1=-1,x2=-1,y2=-1; + + int nr_x = 0; + find_best(row, width, &x1, &x2, f->use->smallest_size, + char_bbox.xmin - font_bbox.xmin, + char_bbox.xmax - font_bbox.xmin, nr_x, + 0); + if(nr_x>0 && x1>=0) a.x = floatToF16((x1+font_bbox.xmin) / 20480.0); + if(nr_x>1 && x2>=0) a.dx = floatToF16((x2-x1) / 20480.0); + + find_best(column, height, &y1, &y2, f->use->smallest_size, + char_bbox.ymin - font_bbox.ymin, + char_bbox.ymax - font_bbox.ymin, 2, + 0); + if(y1>=0) a.y = floatToF16((y1+font_bbox.ymin) / 20480.0); + if(y2>=0) a.dy = floatToF16((y2-y1) / 20480.0); + return a; +} + +static graph_t*make_graph(SWFFONT*f) +{ + FONTUSAGE*use = f->use; + graph_t*g = graph_new(f->numchars); + int s,t; + for(s=1;snumchars;s++) { + for(t=0;tglyph2ascii) { + int c1 = f->glyph2ascii[s]; + int c2 = f->glyph2ascii[t]; + if((c1<'a' && c2>='a' && c2<='z') || + (c2<'a' && c1>='a' && c1<='z')) { + /* never connect lowercase with any uppercase + or punctuation */ + continue; + } + } + + int pos1 = swf_FontUseGetPair(f, s, t); + int pos2 = swf_FontUseGetPair(f, t, s); + if(pos1 || pos2) { + int weight1 = pos1?use->neighbors[pos1-1].num:0; + int weight2 = pos2?use->neighbors[pos2-1].num:0; + int weight = weight1+weight2; + + /*printf("font %d: pair %c and %c\n", + f->id, f->glyph2ascii[t], f->glyph2ascii[s]);*/ + graph_add_edge(&g->nodes[s], &g->nodes[t], weight, weight); + } + } + } + return g; +} + +void swf_FontCreateAlignZones(SWFFONT * f) +{ + if(f->alignzones) + return; + + if(!f->layout) { + fprintf(stderr, "Error: font needs a layout for alignzones to be detected."); + return; + } + + f->alignzones = (ALIGNZONE*)rfx_calloc(sizeof(ALIGNZONE)*f->numchars); + f->alignzone_flags = FONTALIGN_MEDIUM; + + if(!f->layout || !f->use) { + int t; + for(t=0;tnumchars;t++) { + // just align the baseline + f->alignzones[t].x = 0xffff; + f->alignzones[t].y = 0; + f->alignzones[t].dx = 0xffff; + f->alignzones[t].dy = 0xffff;//floatToF16(460.80 / 1024.0); + } + } else { + graph_t*g = make_graph(f); + + int num_components = graph_find_components(g); + msg(" Building font alignzone information for font %d (%d characters, %d components, %d pairs)\n", + f->id, f->numchars, num_components, f->use->num_neighbors); + + SRECT bounds = {0,0,0,0}; + int t; + for(t=0;tnumchars;t++) { + SRECT b = f->layout->bounds[t]; + negate_y(&b); + swf_ExpandRect2(&bounds, &b); + } + + int width = bounds.xmax - bounds.xmin; + int height = bounds.ymax - bounds.ymin; + float*row = rfx_calloc(sizeof(float)*(width+1)); + float*global_column = rfx_calloc(sizeof(float)*(height+1)); + float*column = rfx_calloc(sizeof(float)*(height+1)); + + const double SELF_WEIGHT = 0.00; // ignore own char + + int c; + for(c=0;cnumchars;t++) { + if(g->nodes[t].tmp == c) { + draw_char(f, t, row, global_column, bounds, 1.0-SELF_WEIGHT); + SRECT b = f->layout->bounds[t]; + negate_y(&b); + swf_ExpandRect2(&local_bounds, &b); + drawn++; + } + } + + for(t=0;t<=height;t++) { + global_column[t] /= drawn; + } + + memcpy(column, global_column, sizeof(float)*(height+1)); + memset(row, 0, sizeof(float)*(width+1)); + ALIGNZONE a = detect_for_char(f, row, column, bounds, local_bounds); + + for(t=0;tnumchars;t++) { + if(g->nodes[t].tmp == c) { + f->alignzones[t] = a; + } + } + } + free(row); + free(column); + free(global_column); + + graph_delete(g); + } +} + +void swf_FontPostprocess(SWF*swf) +{ + TAG*tag = swf->firstTag; + while(tag) { + TAG*next = tag->next; + if(tag->id == ST_DEFINEFONT3) { + U16 id = swf_GetDefineID(tag); + SWFFONT*font = 0; + swf_FontExtract(swf, id, &font); + if(!font->alignzones) { + swf_FontCreateAlignZones(font); + tag = swf_InsertTag(tag, ST_DEFINEFONTALIGNZONES); + swf_FontSetAlignZones(tag, font); + } + swf_FontFree(font); + } + tag = next; + } +} + +void swf_FontSetAlignZones(TAG*t, SWFFONT *f) +{ + swf_SetU16(t, f->id); + swf_SetU8(t, f->alignzone_flags); + int i; + for(i=0;inumchars;i++) { + ALIGNZONE*a = &f->alignzones[i]; + U8 flags = 0; + if((a->x & a->dx)!=0xffff) + flags |= 1; + if((a->y & a->dy)!=0xffff) + flags |= 2; + int num = 1; + if(a->dx != 0xffff || a->dy != 0xffff) + num++; + swf_SetU8(t, num); + if(flags&1) swf_SetU16(t, a->x); else swf_SetU16(t, 0); + if(flags&2) swf_SetU16(t, a->y); else swf_SetU16(t, 0); + if(num==2) { + if((flags&1) && a->dx!=0xffff) swf_SetU16(t, a->dx); else swf_SetU16(t, 0); + if((flags&2) && a->dy!=0xffff) swf_SetU16(t, a->dy); else swf_SetU16(t, 0); + } + swf_SetU8(t, flags); + } +} + diff -Nru swftools-0.9.0/lib/modules/swfbits.c swftools-0.9.2/lib/modules/swfbits.c --- swftools-0.9.0/lib/modules/swfbits.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfbits.c 2011-10-07 03:20:17.000000000 +0000 @@ -61,30 +61,6 @@ return hasalpha; } -int swf_ImageGetNumberOfPaletteEntries2(RGBA*_img, int width, int height) -{ - int len = width*height; - int t; - U32* img = (U32*)_img; - U32 color1 = img[0]; - U32 color2 = 0; - for(t=1;tclient_data; - if (tag->data[tag->pos + 0] == 0xff && + if (tag->pos + 4 <= tag->len && + tag->data[tag->pos + 0] == 0xff && tag->data[tag->pos + 1] == 0xd9 && tag->data[tag->pos + 2] == 0xff && tag->data[tag->pos + 3] == 0xd8) { @@ -675,6 +652,9 @@ U8*aline = &alphadata[y*cinfo.output_width]; int x; for(x=0;xid = ST_DEFINEBITSLOSSLESS; } else { tag->id = ST_DEFINEBITSLOSSLESS2; + /* FIXME: we're destroying the callers data here */ swf_PreMultiplyAlpha(data, width, height); } num = swf_ImageGetNumberOfPaletteEntries(data, width, height, 0); @@ -1181,12 +1162,19 @@ int has_alpha = swf_ImageHasAlpha(mem,width,height); /* try lossless image */ + +#ifdef NO_LOSSLESS + tag1 = swf_InsertTag(0, /*ST_DEFINEBITSLOSSLESS1/2*/0); + tag1->len = 0x7fffffff; +#else tag1 = swf_InsertTag(0, /*ST_DEFINEBITSLOSSLESS1/2*/0); swf_SetU16(tag1, bitid); swf_SetLosslessImage(tag1, mem, width, height); +#endif #if defined(HAVE_JPEGLIB) - /* try jpeg image */ + /* try jpeg image. Notice that if (and only if) we tried the lossless compression + above, the data will now be premultiplied with alpha. */ if(has_alpha) { tag2 = swf_InsertTag(0, ST_DEFINEBITSJPEG3); swf_SetU16(tag2, bitid); @@ -1279,286 +1267,3 @@ swf_DeleteTag(swf, tables_tag); } -typedef struct scale_lookup { - int pos; - unsigned int weight; -} scale_lookup_t; - -typedef struct rgba_int { - unsigned int r,g,b,a; -} rgba_int_t; - -static int bicubic = 0; - -static scale_lookup_t**make_scale_lookup(int width, int newwidth) -{ - scale_lookup_t*lookupx = (scale_lookup_t*)malloc((width>newwidth?width:newwidth)*2*sizeof(scale_lookup_t)); - scale_lookup_t**lblockx = (scale_lookup_t**)malloc((newwidth+1)*sizeof(scale_lookup_t**)); - double fx = ((double)width)/((double)newwidth); - double px = 0; - int x; - scale_lookup_t*p_x = lookupx; - - if(newwidth<=width) { - for(x=0;x=width) tox = width-1; - for(xx=fromx;xx<=tox;xx++) { - if(xx==fromx && xx==tox) p_x->weight = 256; - else if(xx==fromx) p_x->weight = xweight; - else if(xx==tox) p_x->weight = 256-w; - else p_x->weight = i; - w+=p_x->weight; - p_x->pos = xx; - p_x++; - } - px = ex; - } - } else { - for(x=0;x=width) ix2=width-1; - lblockx[x] = p_x; - if(bicubic) - r = -2*r*r*r+3*r*r; - p_x[0].weight = (int)(256*(1-r)); - p_x[0].pos = ix1; - p_x[1].weight = 256-p_x[0].weight; - p_x[1].pos = ix2; - p_x+=2; - px += fx; - } - } - lblockx[newwidth] = p_x; - return lblockx; -} - -static void encodeMonochromeImage(RGBA*data, int width, int height, RGBA*colors) -{ - int t; - int len = width*height; - - U32* img = (U32*)data; - U32 color1 = img[0]; - U32 color2 = 0; - for(t=1;t> 8; - data[t].g = (colors[0].g * (255-m) + colors[1].g * m) >> 8; - data[t].b = (colors[0].b * (255-m) + colors[1].b * m) >> 8; - data[t].a = (colors[0].a * (255-m) + colors[1].a * m) >> 8; - } -} - -static void blurImage(RGBA*src, int width, int height, int r) -{ - int e = 2; // r times e is the sampling interval - double*gauss = (double*)malloc(r*e*sizeof(double)); - double sum=0; - int x; - for(x=0;x> 16; - d[x].g = g >> 16; - d[x].b = b >> 16; - d[x].a = a >> 16; - } - for(x=width-range;x> 16; - d[yy].g = g >> 16; - d[yy].b = b >> 16; - d[yy].a = a >> 16; - yy += width; - } - for(y=0;y4) { - /* high-resolution monochrome images are usually dithered, so - low-pass filter them first to get rid of any moire patterns */ - blurImage(data, width, height, r+1); - } - } - - tmpline = (rgba_int_t*)malloc(width*sizeof(rgba_int_t)); - newdata = (RGBA*)malloc(newwidth*newheight*sizeof(RGBA)); - - lblockx = make_scale_lookup(width, newwidth); - lblocky = make_scale_lookup(height, newheight); - - for(p=lblocky[0];ppos*=width; - - for(y=0;ypos]; - scale_lookup_t*p_x; - int weight = p_y->weight; - for(x=0;xpos]; - unsigned int weight = p_x->weight; - r += col->r*weight; - g += col->g*weight; - b += col->b*weight; - a += col->a*weight; - p_x++; - } while (p_xr = r >> 16; - destline->g = g >> 16; - destline->b = b >> 16; - destline->a = a >> 16; - - destline++; - } - } - - if(monochrome) - decodeMonochromeImage(newdata, newwidth, newheight, monochrome_colors); - - free(tmpline); - free(*lblockx); - free(lblockx); - free(*lblocky); - free(lblocky); - return newdata; -} - - diff -Nru swftools-0.9.0/lib/modules/swfdraw.c swftools-0.9.2/lib/modules/swfdraw.c --- swftools-0.9.0/lib/modules/swfdraw.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfdraw.c 2011-01-02 03:30:29.000000000 +0000 @@ -97,8 +97,14 @@ static void swf_ShapeDrawerMoveTo(drawer_t*draw, FPOINT * to) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; - int x = to->x*20+0.001; - int y = to->y*20+0.001; + int x = floor(to->x*20); + int y = floor(to->y*20); + + /* Flash will ignore a moveto (0,0) in glyphs. Hence, we map + all (0,0)s to (0.05,0)s in moveto,lineto and splineto. */ + + if(!x&&!y) + x++; /* we need to write moveto always- it might be that it signals the end of a polygon, otherwise @@ -119,8 +125,10 @@ static void swf_ShapeDrawerLineTo(drawer_t*draw, FPOINT * to) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; - int x = to->x*20+0.001; - int y = to->y*20+0.001; + int x = floor(to->x*20); + int y = floor(to->y*20); + if(!x&&!y) + x++; if(sdraw->lastx < sdraw->bbox.xmin) sdraw->bbox.xmin = sdraw->lastx; if(sdraw->lasty < sdraw->bbox.ymin) sdraw->bbox.ymin = sdraw->lasty; if(sdraw->lastx > sdraw->bbox.xmax) sdraw->bbox.xmax = sdraw->lastx; @@ -137,10 +145,12 @@ static void swf_ShapeDrawerSplineTo(drawer_t*draw, FPOINT * c1, FPOINT* to) { SWFSHAPEDRAWER*sdraw = (SWFSHAPEDRAWER*)draw->internal; - int tx = c1->x*20+0.001; - int ty = c1->y*20+0.001; - int x = to->x*20+0.001; - int y = to->y*20+0.001; + int tx = floor(c1->x*20); + int ty = floor(c1->y*20); + int x = floor(to->x*20); + int y = floor(to->y*20); + if(!x&&!y) + x++; if(sdraw->lastx < sdraw->bbox.xmin) sdraw->bbox.xmin = sdraw->lastx; if(sdraw->lasty < sdraw->bbox.ymin) sdraw->bbox.ymin = sdraw->lasty; if(sdraw->lastx > sdraw->bbox.xmax) sdraw->bbox.xmax = sdraw->lastx; diff -Nru swftools-0.9.0/lib/modules/swffont.c swftools-0.9.2/lib/modules/swffont.c --- swftools-0.9.0/lib/modules/swffont.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swffont.c 2010-11-12 18:55:45.000000000 +0000 @@ -116,7 +116,7 @@ static FT_Library ftlibrary = 0; -SWFFONT* swf_LoadTrueTypeFont(const char*filename) +SWFFONT* swf_LoadTrueTypeFont(const char*filename, char flashtype) { FT_Face face; FT_Error error; @@ -141,17 +141,19 @@ fprintf(stderr, "Couldn't load file %s- not a TTF file?\n", filename); return 0; } - - FT_Set_Pixel_Sizes (face, 16*loadfont_scale, 16*loadfont_scale); + + int scale = flashtype?20:1; + FT_Set_Pixel_Sizes (face, 16*loadfont_scale*scale, 16*loadfont_scale*scale); if(face->num_glyphs <= 0) { - fprintf(stderr, "File %s contains %d glyphs\n", face->num_glyphs); + fprintf(stderr, "File %s contains %d glyphs\n", filename, (int)face->num_glyphs); return 0; } font = (SWFFONT*)rfx_calloc(sizeof(SWFFONT)); font->id = -1; - font->version = 2; + font->version = flashtype?3:2; + font->layout = (SWFLAYOUT*)rfx_calloc(sizeof(SWFLAYOUT)); font->layout->bounds = (SRECT*)rfx_calloc(face->num_glyphs*sizeof(SRECT)); font->style = ((face->style_flags&FT_STYLE_FLAG_ITALIC)?FONT_STYLE_ITALIC:0) @@ -347,13 +349,18 @@ //font->layout->descent = abs(face->descender)*FT_SCALE*loadfont_scale*20/FT_SUBPIXELS/2; //face->bbox.xMax; //font->layout->leading = font->layout->ascent + font->layout->descent; - font->layout->ascent = -fontbbox.ymin; - if(font->layout->ascent < 0) + if(-fontbbox.ymin < 0) font->layout->ascent = 0; - font->layout->descent = fontbbox.ymax; - if(font->layout->descent < 0) + else + font->layout->ascent = -fontbbox.ymin; + + if(fontbbox.ymax < 0) font->layout->descent = 0; - font->layout->leading = fontbbox.ymax - fontbbox.ymin; + else + font->layout->descent = fontbbox.ymax; + + int leading = fontbbox.ymax - fontbbox.ymin; + font->layout->leading = leading>0x7fff?0x7fff:leading; /* notice: if skip_unused is true, font->glyph2ascii, font->glyphnames and font->layout->bounds will have more memory allocated than just font->numchars, but only the first font->numchars @@ -373,7 +380,7 @@ } #else //HAVE_FREETYPE -SWFFONT* swf_LoadTrueTypeFont(const char*filename) +SWFFONT* swf_LoadTrueTypeFont(const char*filename, char flashtype) { fprintf(stderr, "Warning: no freetype library- not able to load %s\n", filename); return 0; @@ -571,7 +578,7 @@ return 0; } -SWFFONT* swf_LoadFont(const char*filename) +SWFFONT* swf_LoadFont(const char*filename, char flashtype) { int is_swf; if(filename == 0) @@ -580,11 +587,14 @@ if(is_swf<0) return 0; if(is_swf) { - return swf_ReadFont(filename); + SWFFONT*font = swf_ReadFont(filename); + if(flashtype && font->version==2) + fprintf(stderr, "Warning: Can't load font v2 file as flashtype (%s)\n", filename); + return font; } #if defined(HAVE_FREETYPE) - return swf_LoadTrueTypeFont(filename); + return swf_LoadTrueTypeFont(filename, flashtype); #elif defined(HAVE_T1LIB) return swf_LoadT1Font(filename); #else diff -Nru swftools-0.9.0/lib/modules/swfobject.c swftools-0.9.2/lib/modules/swfobject.c --- swftools-0.9.0/lib/modules/swfobject.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfobject.c 2010-11-12 18:55:35.000000000 +0000 @@ -57,7 +57,7 @@ return 0; } -static int objectplace(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name, U16 clipaction, U8 blendmode, FILTERLIST*filters) +static int objectplace(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char * name, U16 clipaction, U8 blendmode, FILTERLIST*filters) { U8 flags,flags2; if (!t) return -1; @@ -87,15 +87,15 @@ swf_SetU8(t,blendmode); return 0; } -int swf_ObjectPlace(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name) +int swf_ObjectPlace(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char * name) { return objectplace(t,id,depth,m,cx,name,0,0,0); } -int swf_ObjectPlaceClip(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name, U16 clipaction) +int swf_ObjectPlaceClip(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char * name, U16 clipaction) { return objectplace(t,id,depth,m,cx,name,clipaction,0,0); } -int swf_ObjectPlaceBlend(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name, U8 blend) +int swf_ObjectPlaceBlend(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char * name, U8 blend) { if(t->id != ST_PLACEOBJECT3) fprintf(stderr, "wrong tag- ignoring blend mode\n"); @@ -153,8 +153,10 @@ void swf_GetPlaceObject(TAG * tag,SWFPLACEOBJECT* obj) { - if(!tag) { + if(obj) memset(obj, 0, sizeof(SWFPLACEOBJECT)); + + if(!tag) { swf_GetMatrix(0, &obj->matrix); swf_GetCXForm(0, &obj->cxform, 1); //obj->internal = PF_CHAR|PF_MATRIX|PF_CXFORM; @@ -178,6 +180,7 @@ swf_GetMatrix(0,&obj->matrix); swf_GetCXForm(0,&obj->cxform,1); + obj->flags = flags; obj->depth = swf_GetU16(tag); //obj->internal = flags; if(flags&PF_MOVE) obj->move = 1; @@ -196,7 +199,7 @@ l = strlen((const char *)&tag->data[tag->pos]); t = 0; data = (U8*)rfx_alloc(l+1); - obj->name = data; + obj->name = (char*)data; while((data[t++] = swf_GetU8(tag))); } if(flags2&PF2_BLENDMODE) { diff -Nru swftools-0.9.0/lib/modules/swfrender.c swftools-0.9.2/lib/modules/swfrender.c --- swftools-0.9.0/lib/modules/swfrender.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfrender.c 2010-11-12 18:55:50.000000000 +0000 @@ -680,8 +680,6 @@ RGBA col; double xx = ( (x - rx) * m22 - (y - ry) * m21)*det; double yy = (- (x - rx) * m12 + (y - ry) * m11)*det; - int ainv; - ainv = 255-col.a; if(type == FILL_LINEAR) { int xr = xx*256; @@ -698,7 +696,8 @@ xr = 511; col = palette[xr]; } - + int ainv; + ainv = 255-col.a; line[x].r = clamp(((line[x].r*ainv)>>8)+col.r); line[x].g = clamp(((line[x].g*ainv)>>8)+col.g); line[x].b = clamp(((line[x].b*ainv)>>8)+col.b); @@ -833,7 +832,7 @@ layer_t*before=0, *self=0, *after=0; if(DEBUG&2) { - printf("[(%d,%d)/%d/%d-%d]", p->x, y, p->depth, p->shapeline->fillstyle0, p->shapeline->fillstyle1); + printf("[(%f,%d)/%d/%d-%d]", p->x, y, p->depth, p->shapeline->fillstyle0, p->shapeline->fillstyle1); } search_layer(state, p->depth, &before, &self, &after); diff -Nru swftools-0.9.0/lib/modules/swfshape.c swftools-0.9.2/lib/modules/swfshape.c --- swftools-0.9.0/lib/modules/swfshape.c 2009-03-29 19:17:45.000000000 +0000 +++ swftools-0.9.2/lib/modules/swfshape.c 2010-11-12 18:55:40.000000000 +0000 @@ -425,9 +425,9 @@ b = swf_CountBits(y,b); if (b<2) b=2; if(b >= 18) { - if(b >= 18 + 6) { + if(b > 18 + 6) { /* do not split into more than 64 segments. If the line is *that* long, something's broken */ - fprintf(stderr, "Warning: Line to %.2f,%.2f is too long\n", (double)x,(double)y); + fprintf(stderr, "Warning: Line to %.2f,%.2f is too long (%d bits)\n", (double)x,(double)y, b); return -1; } else { /* split line */ @@ -474,7 +474,7 @@ if(b >= 18) { fprintf(stderr, "Bit overflow in swf_ShapeSetCurve- %d (%d,%d,%d,%d)\n", b, ax,ay,x,y); - b = 17; + return swf_ShapeSetLine(t, s, x+ax, y+ay); } swf_SetBits(t,2,2); @@ -616,6 +616,35 @@ return 1; } +char swf_ShapeIsEmpty(SHAPE*s) +{ + if(!s || !s->data) return 1; + TAG _tag; + TAG* tag = &_tag; + memset(tag, 0, sizeof(TAG)); + tag->data = s->data; + tag->len = tag->memsize = (s->bitlen+7)/8; + tag->pos = 0; + + while(1) { + if(!swf_GetBits(tag, 1)) { + U16 flags = swf_GetBits(tag, 5); + if(!flags) break; + if(flags&1) { //move + int n = swf_GetBits(tag, 5); + swf_GetSBits(tag, n); //x + swf_GetSBits(tag, n); //y + } + if(flags&2) swf_GetBits(tag, s->bits.fill); + if(flags&4) swf_GetBits(tag, s->bits.fill); + if(flags&8) swf_GetBits(tag, s->bits.line); + if(flags&16) {return 0;} + } else { + return 0; + } + } + return 1; +} /* todo: merge this with swf_GetSimpleShape */ static SHAPELINE* swf_ParseShapeData(U8*data, int bits, int fillbits, int linebits, int version, SHAPE2*shape2) @@ -888,6 +917,59 @@ swf_ShapeFree(shape); } +void swf_ShapeSetRectangle(TAG*tag, U16 shapeid, int width, int height, RGBA*rgba) +{ + RGBA white={255,255,255,255}; + if(!rgba) { + rgba = &white; + } + SHAPE* s; + swf_ShapeNew(&s); + int fs = swf_ShapeAddSolidFillStyle(s, rgba); + swf_SetU16(tag,shapeid); + SRECT r; + r.xmin = 0; + r.xmax = 0; + r.ymin = width; + r.ymax = height; + swf_SetRect(tag,&r); + swf_SetShapeHeader(tag,s); + swf_ShapeSetAll(tag,s,0,0,0,fs,0); + swf_ShapeSetLine(tag,s,width,0); + swf_ShapeSetLine(tag,s,0,height); + swf_ShapeSetLine(tag,s,-width,0); + swf_ShapeSetLine(tag,s,0,-height); + swf_ShapeSetEnd(tag); + swf_ShapeFree(s); +} + +void swf_ShapeSetRectangleWithBorder(TAG*tag, U16 shapeid, int width, int height, RGBA*rgba, int linewidth, RGBA*linecolor) +{ + RGBA white={255,255,255,255}; + if(!rgba) { + rgba = &white; + } + SHAPE* s; + swf_ShapeNew(&s); + int fs = swf_ShapeAddSolidFillStyle(s, rgba); + int ls = swf_ShapeAddLineStyle(s, linewidth, linecolor); + swf_SetU16(tag,shapeid); + SRECT r; + r.xmin = 0; + r.xmax = 0; + r.ymin = width; + r.ymax = height; + swf_SetRect(tag,&r); + swf_SetShapeHeader(tag,s); + swf_ShapeSetAll(tag,s,0,0,ls,fs,0); + swf_ShapeSetLine(tag,s,width,0); + swf_ShapeSetLine(tag,s,0,height); + swf_ShapeSetLine(tag,s,-width,0); + swf_ShapeSetLine(tag,s,0,-height); + swf_ShapeSetEnd(tag); + swf_ShapeFree(s); +} + void swf_Shape2ToShape(SHAPE2*shape2, SHAPE*shape) { TAG*tag = swf_InsertTag(0,0); diff -Nru swftools-0.9.0/lib/modules/swftext.c swftools-0.9.2/lib/modules/swftext.c --- swftools-0.9.0/lib/modules/swftext.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swftext.c 2010-11-12 18:55:43.000000000 +0000 @@ -6,7 +6,7 @@ Part of the swftools package. Copyright (c) 2001 Rainer Böhme - Copyright (c) 2003,2004 Matthias Kramm + Copyright (c) 2003,2004,2005,2006,2007,2008,2009 Matthias Kramm 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 @@ -113,7 +113,7 @@ n = 0; while (t) { - if (swf_GetTagID(t) == ST_DEFINEFONT2 || swf_GetTagID(t) == ST_DEFINEFONT) { + if (swf_isFontTag(t)) { n++; if (FontCallback) { U16 id; @@ -253,15 +253,15 @@ int fid; U32 offset_start; U32 *offset; - U8 flags1, flags2, namelen; + U8 flags1, langcode, namelen; swf_SetTagPos(tag, 0); - font->version = 2; + font->version = tag->id==ST_DEFINEFONT3?3:2; fid = swf_GetU16(tag); if (id && id != fid) return id; font->id = fid; flags1 = swf_GetU8(tag); - flags2 = swf_GetU8(tag); //reserved flags + langcode = swf_GetU8(tag); //reserved flags if (flags1 & 1) font->style |= FONT_STYLE_BOLD; @@ -278,7 +278,6 @@ font->name = (U8 *) rfx_alloc(namelen + 1); font->name[namelen] = 0; swf_GetBlock(tag, font->name, namelen); - font->version = 2; glyphcount = swf_GetU16(tag); font->numchars = glyphcount; @@ -318,7 +317,7 @@ maxcode = 0; for (t = 0; t < glyphcount; t++) { int code; - if (flags1 & 4) // wide codes + if (flags1 & 4) // wide codes (always on for definefont3) code = swf_GetU16(tag); else code = swf_GetU8(tag); @@ -350,6 +349,13 @@ for (t = 0; t < glyphcount; t++) { swf_ResetReadBits(tag); swf_GetRect(tag, &font->layout->bounds[t]); + SRECT b = font->layout->bounds[t]; + if((b.xmin|b.xmax|b.ymin|b.ymax) == 0) { + // recalculate bounding box + SHAPE2 *shape2 = swf_ShapeToShape2(font->glyph[t].shape); + font->layout->bounds[t] = swf_GetShapeBoundingBox(shape2); + swf_Shape2Free(shape2);free(shape2); + } } kerningcount = swf_GetU16(tag); @@ -373,6 +379,54 @@ return font->id; } +int swf_FontExtract_DefineFontAlignZones(int id, SWFFONT * font, TAG * tag) +{ + U16 fid; + swf_SetTagPos(tag, 0); + fid = swf_GetU16(tag); + + if (fid == id) { + font->alignzone_flags = swf_GetU8(tag); + font->alignzones = rfx_calloc(sizeof(ALIGNZONE)*font->numchars); + int i=0; + while(tag->pos < tag->len) { + if(i>=font->numchars) + break; + int nr = swf_GetU8(tag); // should be 2 + if(nr!=1 && nr!=2) { + fprintf(stderr, "rfxswf: Can't parse alignzone tags with %d zones", nr); + break; + } + U16 x = swf_GetU16(tag); + U16 y = swf_GetU16(tag); + U16 dx = (nr==2)?swf_GetU16(tag):0xffff; + U16 dy = (nr==2)?swf_GetU16(tag):0xffff; + U8 xy = swf_GetU8(tag); + +#ifdef DEBUG_RFXSWF + if((!(xy&1) && (x!=0 || (dx!=0 && dx!=0xffff))) || + (!(xy&2) && (y!=0 || (dy!=0 && dy!=0xffff)))) { + fprintf(stderr, "Warning: weird combination of alignzone bits and values (%d x:%04x-%04x y:%04x-%04x)\n", xy, + x,dx,y,dy); + } +#endif + if(!(xy&1)) { + x = 0xffff; + dx = 0xffff; + } else if(!(xy&2)) { + y = 0xffff; + dy = 0xffff; + } + font->alignzones[i].x = x; + font->alignzones[i].y = y; + font->alignzones[i].dx = dx; + font->alignzones[i].dy = dy; + i++; + } + } + return id; +} + #define FEDTJ_PRINT 0x01 #define FEDTJ_MODIFY 0x02 @@ -468,7 +522,7 @@ } int swf_ParseDefineText(TAG * tag, - void (*callback) (void *self, int *chars, int *ypos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA * color), void *self) + void (*callback) (void *self, int *chars, int *xpos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA * color), void *self) { return swf_FontExtract_DefineTextCallback(-1, 0, tag, FEDTJ_CALLBACK, callback, self); } @@ -478,6 +532,52 @@ return swf_FontExtract_DefineTextCallback(id, f, t, jobs, 0, 0); } +typedef struct _usagetmp { + SWFFONT*font; + int lastx,lasty; + int last; +} usagetmp_t; +static void updateusage(void *self, int *chars, int *xpos, int nr, + int fontid, int fontsize, int xstart, int ystart, RGBA * color) +{ + usagetmp_t*u = (usagetmp_t*)self; + if(!u->font->use) { + swf_FontInitUsage(u->font); + } + if(fontid!=u->font->id) + return; + + int t; + for(t=0;tu->font->numchars) + continue; + swf_FontUseGlyph(u->font, c, fontsize); + if(u->lasty == y && x>=u->lastx-200 && abs(u->lastx-x)<200 && + u->last!=c && !swf_ShapeIsEmpty(u->font->glyph[u->last].shape) && + !swf_ShapeIsEmpty(u->font->glyph[c].shape)) + { + swf_FontUsePair(u->font, u->last, c); + } + u->lasty = y; + /* FIXME: do we still need to divide advance by 20 for definefont3? */ + u->lastx = x + (u->font->glyph[c].advance*fontsize/20480); + u->last = c; + } +} + +void swf_FontUpdateUsage(SWFFONT*f, TAG* tag) +{ + usagetmp_t u; + u.font = f; + u.lastx = -0x80000000; + u.lasty = -0x80000000; + u.last = 0; + swf_ParseDefineText(tag, updateusage, &u); +} + int swf_FontExtract(SWF * swf, int id, SWFFONT * *font) { TAG *t; @@ -498,9 +598,14 @@ break; case ST_DEFINEFONT2: + case ST_DEFINEFONT3: nid = swf_FontExtract_DefineFont2(id, f, t); break; + case ST_DEFINEFONTALIGNZONES: + nid = swf_FontExtract_DefineFontAlignZones(id, f, t); + break; + case ST_DEFINEFONTINFO: case ST_DEFINEFONTINFO2: nid = swf_FontExtract_DefineFontInfo(id, f, t); @@ -508,7 +613,11 @@ case ST_DEFINETEXT: case ST_DEFINETEXT2: - nid = swf_FontExtract_DefineText(id, f, t, f->layout ? 0 : FEDTJ_MODIFY); + if(!f->layout) { + nid = swf_FontExtract_DefineText(id, f, t, FEDTJ_MODIFY); + } + if(f->version>=3 && f->layout) + swf_FontUpdateUsage(f, t); break; case ST_GLYPHNAMES: @@ -572,6 +681,12 @@ if(f->use->chars) { rfx_free(f->use->chars);f->use->chars = 0; } + if(f->use->neighbors) { + rfx_free(f->use->neighbors);f->use->neighbors = 0; + } + if(f->use->neighbors_hash) { + rfx_free(f->use->neighbors_hash);f->use->neighbors_hash = 0; + } rfx_free(f->use); f->use = 0; } } @@ -724,6 +839,14 @@ return 0; } +static SWFFONT* font_to_sort; +int cmp_chars(const void*a, const void*b) +{ + int x = *(const int*)a; + int y = *(const int*)b; + return 0; +} + void swf_FontSort(SWFFONT * font) { int i, j; @@ -737,6 +860,8 @@ for (i = 0; i < font->numchars; i++) { newplace[i] = i; } + //qsort(newplace, sizeof(newplace[0]), font->numchars, cmp_chars); + for (i = 0; i < font->numchars; i++) for (j = 0; j < i; j++) { if (font->glyph2ascii[i] < font->glyph2ascii[j]) { @@ -779,8 +904,8 @@ font->ascii2glyph[i] = newpos[font->ascii2glyph[i]]; } - rfx_free(newpos); rfx_free(newplace); + font->glyph2glyph = newpos; } void swf_FontPrepareForEditText(SWFFONT * font) @@ -798,11 +923,9 @@ fprintf(stderr, "Usage initialized twice"); return -1; } - f->use = (FONTUSAGE*)rfx_alloc(sizeof(FONTUSAGE)); - f->use->is_reduced = 0; - f->use->used_glyphs = 0; + f->use = (FONTUSAGE*)rfx_calloc(sizeof(FONTUSAGE)); + f->use->smallest_size = 0xffff; f->use->chars = (int*)rfx_calloc(sizeof(f->use->chars[0]) * f->numchars); - f->use->glyphs_specified = 0; return 0; } @@ -820,22 +943,22 @@ return -1; while (*s) { if(*s < f->maxascii && f->ascii2glyph[*s]>=0) - swf_FontUseGlyph(f, f->ascii2glyph[*s]); + swf_FontUseGlyph(f, f->ascii2glyph[*s], /*FIXME*/0xffff); s++; } return 0; } -int swf_FontUseUTF8(SWFFONT * f, U8 * s) +int swf_FontUseUTF8(SWFFONT * f, const U8 * s, U16 size) { if( (!s)) return -1; int ascii; while (*s) { - ascii = readUTF8char(&s); + ascii = readUTF8char((U8**)&s); if(ascii < f->maxascii && f->ascii2glyph[ascii]>=0) - swf_FontUseGlyph(f, f->ascii2glyph[ascii]); + swf_FontUseGlyph(f, f->ascii2glyph[ascii], size); } return 0; } @@ -852,7 +975,81 @@ return 0; } -int swf_FontUseGlyph(SWFFONT * f, int glyph) +static unsigned hash2(int char1, int char2) +{ + unsigned hash = char1^(char2<<8); + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; +} +static void hashadd(FONTUSAGE*u, int char1, int char2, int nr) +{ + unsigned hash = hash2(char1, char2); + while(1) { + hash = hash%u->neighbors_hash_size; + if(!u->neighbors_hash[hash]) { + u->neighbors_hash[hash] = nr+1; + return; + } + hash++; + } +} +int swf_FontUseGetPair(SWFFONT * f, int char1, int char2) +{ + FONTUSAGE*u = f->use; + if(!u || !u->neighbors_hash_size) + return 0; + unsigned hash = hash2(char1, char2); + while(1) { + hash = hash%u->neighbors_hash_size; + int pos = u->neighbors_hash[hash]; + if(!pos) + return 0; + if(pos && + u->neighbors[pos-1].char1 == char1 && + u->neighbors[pos-1].char2 == char2) { + return pos; + } + hash++; + } + +} +void swf_FontUsePair(SWFFONT * f, int char1, int char2) +{ + if (!f->use) + swf_FontInitUsage(f); + FONTUSAGE*u = f->use; + + if(u->num_neighbors*3 >= u->neighbors_hash_size*2) { + if(u->neighbors_hash) { + free(u->neighbors_hash); + } + u->neighbors_hash_size = u->neighbors_hash_size?u->neighbors_hash_size*2:1024; + u->neighbors_hash = rfx_calloc(u->neighbors_hash_size*sizeof(int)); + int t; + for(t=0;tnum_neighbors;t++) { + hashadd(u, u->neighbors[t].char1, u->neighbors[t].char2, t); + } + } + + int nr = swf_FontUseGetPair(f, char1, char2); + if(!nr) { + if(u->num_neighbors == u->neighbors_size) { + u->neighbors_size += 4096; + u->neighbors = rfx_realloc(u->neighbors, sizeof(SWFGLYPHPAIR)*u->neighbors_size); + } + u->neighbors[u->num_neighbors].char1 = char1; + u->neighbors[u->num_neighbors].char2 = char2; + u->neighbors[u->num_neighbors].num = 1; + hashadd(u, char1, char2, u->num_neighbors); + u->num_neighbors++; + } else { + u->neighbors[nr-1].num++; + } +} + +int swf_FontUseGlyph(SWFFONT * f, int glyph, U16 size) { if (!f->use) swf_FontInitUsage(f); @@ -861,6 +1058,8 @@ if(!f->use->chars[glyph]) f->use->used_glyphs++; f->use->chars[glyph] = 1; + if(size && size < f->use->smallest_size) + f->use->smallest_size = size; return 0; } @@ -1006,12 +1205,15 @@ if (f->layout) { swf_SetU16(tag, f->layout->ascent); swf_SetU16(tag, f->layout->descent); - swf_SetU16(tag, f->layout->leading); + swf_SetU16(tag, 0); // flash ignores leading + for (t = 0; t < f->numchars; t++) swf_SetU16(tag, f->glyph[t].advance); for (t = 0; t < f->numchars; t++) { swf_ResetWriteBits(tag); - swf_SetRect(tag, &f->layout->bounds[t]); + /* not used by flash, so leave this empty */ + SRECT b = {0,0,0,0}; + swf_SetRect(tag, &b); } swf_SetU16(tag, f->layout->kerningcount); for (t = 0; t < f->layout->kerningcount; t++) { @@ -1090,6 +1292,13 @@ return 0; } +static void font_freealignzones(SWFFONT * f) +{ + if(f->alignzones) + free(f->alignzones); + f->alignzones = 0; +} + void swf_FontFree(SWFFONT * f) { int i; @@ -1117,10 +1326,15 @@ rfx_free(f->glyph2ascii); f->glyph2ascii = NULL; } + if (f->glyph2glyph) { + rfx_free(f->glyph2glyph); + f->glyph2glyph = NULL; + } font_freename(f); font_freelayout(f); font_freeglyphnames(f); font_freeusage(f); + font_freealignzones(f); rfx_free(f); } @@ -1347,183 +1561,6 @@ } } -void swf_WriteFont(SWFFONT * font, char *filename) -{ - SWF swf; - TAG *t; - SRECT r; - RGBA rgb; - int f; - int useDefineFont2 = 0; - int storeGlyphNames = 1; - - if (font->layout) - useDefineFont2 = 1; /* the only thing new in definefont2 - is layout information. */ - - font->id = WRITEFONTID; //"FN" - - memset(&swf, 0x00, sizeof(SWF)); - - swf.fileVersion = 9; - swf.frameRate = 0x4000; - - /* if we use DefineFont1 to store the characters, - we have to build a textfield to store the - advance values. While at it, we can also - make the whole .swf viewable */ - - /* we now always create viewable swfs, even if we - did use definefont2 -mk */ - t = swf_InsertTag(NULL, ST_SETBACKGROUNDCOLOR); - swf.firstTag = t; - rgb.r = 0xef; - rgb.g = 0xef; - rgb.b = 0xff; - swf_SetRGB(t, &rgb); - if (!useDefineFont2) { - t = swf_InsertTag(t, ST_DEFINEFONT); - swf_FontSetDefine(t, font); - t = swf_InsertTag(t, ST_DEFINEFONTINFO); - swf_FontSetInfo(t, font); - } else { - t = swf_InsertTag(t, ST_DEFINEFONT2); - swf_FontSetDefine2(t, font); - } - if(font->name) { - t = swf_InsertTag(t, ST_NAMECHARACTER); - swf_SetU16(t, WRITEFONTID); - swf_SetString(t, font->name); - t = swf_InsertTag(t, ST_EXPORTASSETS); - swf_SetU16(t, 1); - swf_SetU16(t, WRITEFONTID); - swf_SetString(t, font->name); - - t = swf_AddAS3FontDefine(t, WRITEFONTID, font->name); - } - - if (storeGlyphNames && font->glyphnames) { - int c; - t = swf_InsertTag(t, ST_GLYPHNAMES); - swf_SetU16(t, WRITEFONTID); - swf_SetU16(t, font->numchars); - for (c = 0; c < font->numchars; c++) { - if (font->glyphnames[c]) - swf_SetString(t, (U8*)font->glyphnames[c]); - else - swf_SetString(t, (U8*)""); - } - } - - if (1) //neccessary only for df1, but pretty to look at anyhow, so do it always - { - int textscale = 400; - int s; - int xmax = 0; - int ymax = 0; - int ypos = 1; - U8 gbits, abits; - int x, y, c; - int range = font->maxascii; - - c = 0; - if (useDefineFont2 && range > 256) { - range = 256; - } - - for (s = 0; s < range; s++) { - int g = font->ascii2glyph[s]; - if (g >= 0) { - if ((font->glyph[g].advance * textscale / 20) / 64 > xmax) { - xmax = (font->glyph[g].advance * textscale / 20) / 64; - } - c++; - } - if ((s & 15) == 0) { - if (c) { - ypos++; - } - c = 0; - } - } - ymax = ypos * textscale * 2; - - swf.movieSize.xmax = xmax * 20; - swf.movieSize.ymax = ymax; - - t = swf_InsertTag(t, ST_DEFINETEXT); - - swf_SetU16(t, font->id + 1); // ID - - r.xmin = 0; - r.ymin = 0; - r.xmax = swf.movieSize.xmax; - r.ymax = swf.movieSize.ymax; - - swf_SetRect(t, &r); - - swf_SetMatrix(t, NULL); - - abits = swf_CountBits(xmax * 16, 0); - gbits = 8; - - swf_SetU8(t, gbits); - swf_SetU8(t, abits); - - rgb.r = 0x00; - rgb.g = 0x00; - rgb.b = 0x00; - ypos = 1; - for (y = 0; y < ((range + 15) / 16); y++) { - int c = 0, lastx = -1; - for (x = 0; x < 16; x++) { - int g = (y * 16 + x < range) ? font->ascii2glyph[y * 16 + x] : -1; - if (g >= 0 && font->glyph[g].shape) { - c++; - if (lastx < 0) - lastx = x * xmax; - } - } - if (c) { - swf_TextSetInfoRecord(t, font, textscale, &rgb, lastx + 1, textscale * ypos * 2); - for (x = 0; x < 16; x++) { - int g = (y * 16 + x < range) ? font->ascii2glyph[y * 16 + x] : -1; - if (g >= 0 && font->glyph[g].shape) { - if (lastx != x * xmax) { - swf_TextSetInfoRecord(t, 0, 0, 0, x * xmax + 1, 0); - } - swf_SetU8(t, 1); - swf_SetBits(t, g, gbits); - swf_SetBits(t, font->glyph[g].advance / 20, abits); - lastx = x * xmax + (font->glyph[g].advance / 20); - swf_ResetWriteBits(t); - } - } - ypos++; - } - } - swf_SetU8(t, 0); - - - t = swf_InsertTag(t, ST_PLACEOBJECT2); - - swf_ObjectPlace(t, font->id + 1, 1, NULL, NULL, NULL); - - t = swf_InsertTag(t, ST_SHOWFRAME); - - } - - t = swf_InsertTag(t, ST_END); - - f = open(filename, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0644); - if FAILED - (swf_WriteSWF(f, &swf)) fprintf(stderr, "WriteSWF() failed in writeFont().\n"); - close(f); - - swf_FreeTags(&swf); -} - - void swf_SetEditText(TAG * tag, U16 flags, SRECT r, const char *text, RGBA * color, int maxlength, U16 font, U16 height, EditTextLayout * layout, const char *variable) { swf_SetRect(tag, &r); @@ -1560,9 +1597,9 @@ swf_SetU16(tag, layout->indent); //indent swf_SetU16(tag, layout->leading); //leading } - swf_SetString(tag, (U8*)variable); + swf_SetString(tag, variable); if (flags & ET_HASTEXT) - swf_SetString(tag, (U8*)text); + swf_SetString(tag, text); } SRECT swf_SetDefineText(TAG * tag, SWFFONT * font, RGBA * rgb, const char *text, int scale) @@ -1628,10 +1665,11 @@ } /* now set the text params- notice that a font size of - 1024 means that the glyphs will be displayed exactly - as they would be in/with a defineshape. (Try to find - *that* in the flash specs) + 1024 (or 1024*20 for definefont3) means that the glyphs will + be displayed exactly as they would be in/with a defineshape. + This is not documented in the specs. */ + /* set the actual text- notice that we just pass our scale parameter over, as TextSetCharRecord calculates with percent, too */ @@ -1656,8 +1694,8 @@ f->layout = (SWFLAYOUT *) rfx_calloc(sizeof(SWFLAYOUT)); f->layout->bounds = (SRECT *) rfx_alloc(f->numchars * sizeof(SRECT)); - f->layout->ascent = -32767; - f->layout->descent = -32767; + f->layout->ascent = 0; + f->layout->descent = 0; for (t = 0; t < f->numchars; t++) { SHAPE2 *shape2; @@ -1682,7 +1720,7 @@ f->glyph[t].advance = width; if (-bbox.ymin > f->layout->ascent) - f->layout->ascent = bbox.ymin; + f->layout->ascent = -bbox.ymin; if (bbox.ymax > f->layout->descent) f->layout->descent = bbox.ymax; } @@ -1730,3 +1768,395 @@ advance += font->glyph[g].advance * size / 100.0 / 20.0; } } + +void swf_WriteFont_AS3(SWFFONT * font, char *filename) +{ + if(!font->layout) + swf_FontCreateLayout(font); + + SWF swf; + memset(&swf, 0, sizeof(SWF)); + swf.fileVersion = 9; + swf.frameRate = 0x4000; + swf.movieSize.xmax = 200; + swf.movieSize.ymax = 200; + + if(!font->id) font->id=1; + + TAG *tag; + swf.firstTag = tag = swf_InsertTag(tag, ST_DEFINEFONT3); + swf_FontSetDefine2(tag, font); + + char*name = font->name?(char*)font->name:"font"; + + tag = swf_InsertTag(tag, ST_NAMECHARACTER); + swf_SetU16(tag, font->id); + swf_SetString(tag, name); + tag = swf_InsertTag(tag, ST_EXPORTASSETS); + swf_SetU16(tag, 1); + swf_SetU16(tag, font->id); + swf_SetString(tag, name); + tag = swf_AddAS3FontDefine(tag, font->id, (char*)font->name); + + tag = swf_InsertTag(tag, ST_END); + swf_SaveSWF(&swf, filename); + swf_FreeTags(&swf); +} + +void swf_WriteFont(SWFFONT * font, char *filename) +{ + if(!font->layout) + swf_FontCreateLayout(font); + + char viewer = 1; + U16 id = 1; + U16 depth = 1; + + font->id = id++; + + SWF swf; + memset(&swf, 0, sizeof(SWF)); + swf.fileVersion = 8; + swf.frameRate = 0x4000; + swf.movieSize.xmax = 1024*20; + swf.movieSize.ymax = 768*20; + + TAG *tag; + swf.firstTag = tag = swf_InsertTag(NULL, ST_SETBACKGROUNDCOLOR); + swf_SetU8(tag, 0xe0);swf_SetU8(tag, 0xe0);swf_SetU8(tag, 0xff); + + tag = swf_InsertTag(tag, ST_DEFINEFONT3); + swf_FontSetDefine2(tag, font); + + if(font->glyphnames) { + int c; + tag = swf_InsertTag(tag, ST_GLYPHNAMES); + swf_SetU16(tag, font->id); + swf_SetU16(tag, font->numchars); + for (c = 0; c < font->numchars; c++) { + if (font->glyphnames[c]) + swf_SetString(tag, font->glyphnames[c]); + else + swf_SetString(tag, ""); + } + } + + if(viewer) + { + RGBA white = {255,255,255,255}; + RGBA black = {255,0,0,0}; + RGBA gray50 = {255,128,128,128}; + RGBA green = {255,0,255,0}; + int t; + SCOORD miny = SCOORD_MAX; + SCOORD maxy = SCOORD_MIN; + double width = 0; + U16 max_advance = 0; + char*flags = rfx_calloc(font->numchars); + double*xmin = rfx_calloc(sizeof(double)*(font->numchars+1)); + double*xmax = rfx_calloc(sizeof(double)*(font->numchars+1)); + int*xpos = rfx_calloc(sizeof(int)*(font->numchars+1)); + for(t=0;tnumchars;t++) { + SHAPE*s = font->glyph[t].shape; + SHAPE2*s2 = swf_ShapeToShape2(s); + SRECT r = swf_GetShapeBoundingBox(s2); + + // inside a definefont3, everything is 20x the resolution: + double rx1 = r.xmin / 20.0; + double ry1 = r.ymin / 20.0; + double rx2 = r.xmax / 20.0; + double ry2 = r.ymax / 20.0; + + xmin[t]= rx1; + xmax[t]= rx2; + + if(ry1maxy) {maxy=ry2;} + swf_Shape2Free(s2);free(s2); + width += font->glyph[t].advance; + if(font->glyph[t].advance>max_advance) + max_advance = font->glyph[t].advance; + } + + if(miny==SCOORD_MAX) miny=maxy=0; + if(miny==maxy) maxy=miny+1; + + /* scale the font so that it's 256 pixels high */ + double scale = (int)((256.0*1024.0/(maxy-miny))*20.0); + double overlarge_factor; + int fontsize; + if(scale > 32767) { + fontsize = 32767; + overlarge_factor = scale / 32767.0; + } else { + fontsize = scale; + overlarge_factor = 1.0; + } + + int textid = id++; + int spriteid = id++; + SRECT r; + r.xmin = 0; + r.ymin = miny*fontsize/1024; + r.xmax = width*fontsize/20480; + r.ymax = maxy*fontsize/1024; + tag = swf_InsertTag(tag, ST_DEFINETEXT); + swf_SetU16(tag, textid); + swf_SetRect(tag, &r); + swf_SetMatrix(tag, NULL); + + U8 abits = 15; + U8 gbits = swf_CountBits(font->numchars, 0); + swf_SetU8(tag, gbits); + swf_SetU8(tag, abits); + + RGBA rgb = {255,0,0,0}; + + swf_TextSetInfoRecord(tag, font, fontsize, &rgb, SET_TO_ZERO, SET_TO_ZERO); + ActionTAG*array = 0; + double x=0; + array = action_PushString(array, "xpos"); + for(t=0;tnumchars;t++) { + swf_SetU8(tag, 1); + int width = abs((xmax[t] - xmin[t+1])*fontsize/1024) + 60; + array = action_PushInt(array, x/20 +(xmin[t]*scale/1024)/20); + x += width * overlarge_factor; + swf_SetBits(tag, t, gbits); + swf_SetBits(tag, width, abits); + swf_SetU8(tag, 128); + } + array = action_PushInt(array, x/20); + array = action_PushInt(array, font->numchars+1); + array = action_InitArray(array); + array = action_SetVariable(array); + swf_SetU8(tag, 0); + + if(font->layout) { + tag = swf_InsertTag(tag, ST_DEFINESHAPE2); + SHAPE* s; + swf_ShapeNew(&s); + int ls = swf_ShapeAddLineStyle(s,20,&white); + int shapeid = id++; + swf_SetU16(tag,shapeid); + SRECT r; + r.xmin = 0; + r.xmax = 1024*20; + r.ymin = 0; + r.ymax = 256*20; + swf_SetRect(tag,&r); + swf_SetShapeHeader(tag,s); + swf_ShapeSetAll(tag,s,0,0,ls,0,0); + + /* Ç and  are good chars to test ascent/descent extend */ + int y1 = (-font->layout->ascent-miny*20.0)*256.0/(maxy-miny); + int y2 = (font->layout->descent-miny*20.0)*256.0/(maxy-miny); + + swf_ShapeSetMove(tag,s,0,y1); + swf_ShapeSetLine(tag,s,width,0); + swf_ShapeSetMove(tag,s,0,y2); + swf_ShapeSetLine(tag,s,width,0); + + swf_ShapeSetEnd(tag); + swf_ShapeFree(s); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, shapeid, depth++, NULL, NULL, NULL); + } + + /* shapes */ + + for(t=0;tnumchars;t++) { + tag = swf_InsertTag(tag, ST_DEFINESHAPE2); + SHAPE* s; + swf_ShapeNew(&s); + int ls = swf_ShapeAddLineStyle(s,20*2,&black); + int ls2 = swf_ShapeAddLineStyle(s,20*2,&green); + int fs = swf_ShapeAddSolidFillStyle(s, &gray50); + int shapeid = id++; + swf_SetU16(tag,shapeid); + SRECT r; + r.xmin = 0; + r.xmax = 1024*20; + r.ymin = 0; + r.ymax = 512*20; + swf_SetRect(tag,&r); + swf_SetShapeHeader(tag,s); + swf_ShapeSetAll(tag,s,0,0,ls,fs,0); + SHAPE2*s2 = swf_ShapeToShape2(font->glyph[t].shape); + SHAPELINE*l = s2->lines; + int lastx=0,lasty=0; + + double x1 = (1024*20 - (xmax[t] - xmin[t])*20*2*scale/20480.0)/2; + double y1 = -miny*20*scale*2/20480.0; + double scalex = scale*2/20480.0; + double scaley = scale*2/20480.0; + + while(l) { + int lx = (l->x)*scalex+x1; + int ly = (l->y)*scaley+y1; + int sx = (l->sx)*scalex+x1; + int sy = (l->sy)*scaley+y1; + if(l->type == moveTo) { + swf_ShapeSetMove(tag,s,lx,ly); + } else if(l->type == lineTo) { + swf_ShapeSetLine(tag,s,lx-lastx,ly-lasty); + } else if(l->type == splineTo) { + swf_ShapeSetCurve(tag,s,sx-lastx,sy-lasty,lx-sx,ly-sy); + } + lastx = lx; + lasty = ly; + l = l->next; + } + + if(font->alignzones) { + ALIGNZONE*zone = &font->alignzones[t]; + swf_ShapeSetAll(tag,s,0,0,ls2,SET_TO_ZERO,SET_TO_ZERO); + if((zone->x&zone->dx)!=0xffff) { + double x = F16toFloat(zone->x)*20480.0*scalex+x1; + double dx = (F16toFloat(zone->x)+F16toFloat(zone->dx))*20480.0*scalex+x1; + swf_ShapeSetMove(tag,s,x,0); + swf_ShapeSetLine(tag,s,0,1024*20); + swf_ShapeSetMove(tag,s,dx,0); + swf_ShapeSetLine(tag,s,0,1024*20); + } + if((zone->y&zone->dy)!=0xffff) { + double y = -F16toFloat(zone->y)*20480.0*scaley+y1; + double dy = -(F16toFloat(zone->y)+F16toFloat(zone->dy))*20480.0*scaley+y1; + swf_ShapeSetMove(tag,s,0,y); + swf_ShapeSetLine(tag,s,1024*20,0); + swf_ShapeSetMove(tag,s,0,dy); + swf_ShapeSetLine(tag,s,1024*20,0); + } + } + + swf_ShapeSetEnd(tag); + swf_ShapeFree(s); + + tag = swf_InsertTag(tag, ST_DEFINESPRITE); + U16 spriteid=id++; + swf_SetU16(tag, spriteid); + swf_SetU16(tag, 1); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, shapeid, 1, NULL, NULL, NULL); + tag = swf_InsertTag(tag, ST_END); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + MATRIX m; + swf_GetMatrix(0, &m); + m.ty = 20000; + char txt[80]; + sprintf(txt, "char%d", font->numchars-t); + swf_ObjectPlace(tag, spriteid, depth++, &m, NULL, txt); + } + + /* marker */ + tag = swf_InsertTag(tag, ST_DEFINESHAPE2); + int shapeid=id++; + RGBA blue = {0xff,0xc0,0xc0,0xff}; + swf_ShapeSetRectangle(tag, shapeid, 20, 20, &blue); + tag = swf_InsertTag(tag, ST_DEFINESPRITE); + U16 spriteid2=id++; + swf_SetU16(tag, spriteid2); + swf_SetU16(tag, 1); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, shapeid, 1, NULL, NULL, NULL); + tag = swf_InsertTag(tag, ST_END); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, spriteid2, depth++, NULL, NULL, "marker"); + + /* textbar */ + tag = swf_InsertTag(tag, ST_DEFINESPRITE); + swf_SetU16(tag, spriteid); + swf_SetU16(tag, 1); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + MATRIX m; + swf_GetMatrix(0, &m); + m.sx = 65536 * overlarge_factor; + m.sy = 65536 * overlarge_factor; + m.tx = 0; + m.ty = -miny*256*20/(maxy-miny); + swf_ObjectPlace(tag, textid, 1, &m, NULL, NULL); + tag = swf_InsertTag(tag, ST_END); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, spriteid, depth++, NULL, NULL, "textbar"); + + /* marker2 */ + RGBA blue2 = {0x80,0x80,0xff,0x80}; + tag = swf_InsertTag(tag, ST_DEFINESHAPE3); + int shapeid2=id++; + swf_ShapeSetRectangleWithBorder(tag, shapeid2, 20, 20, &blue2, 0, &white); + tag = swf_InsertTag(tag, ST_DEFINESPRITE); + U16 spriteid3=id++; + swf_SetU16(tag, spriteid3); + swf_SetU16(tag, 1); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, shapeid2, 1, NULL, NULL, NULL); + tag = swf_InsertTag(tag, ST_END); + tag = swf_InsertTag(tag, ST_PLACEOBJECT2); + swf_ObjectPlace(tag, spriteid3, depth++, NULL, NULL, "marker2"); + + +char*data = +" var mouseListener = new Object();" +" var speed = 0;" +" var myx = 0;" +" var currentMouseOver, currentChar;" +" mouseListener.onMouseDown = function() { " +" eval(\"_root.char\"+currentChar)._y = 20000;" +" currentChar = currentMouseOver;" +" var i = currentMouseOver;" +" eval(\"_root.char\"+i)._y = 256;" +" _root.marker2._yscale=256*100;" +" _root.marker2._xscale=(xpos[i-1]-xpos[i])*100;" +" _root.marker2._x=xpos[i]+myx;" +" };" +" mouseListener.onMouseMove = function() { " +" if(_ymouse<256) {" +" speed = Math.abs(_xmouse-512)>256?(512-_xmouse)/8:0;" +" } else {" +" speed = 0;" +" }; " +" }; " +" setInterval( function(){ " +" if(_ymouse<256) {" +" var i, x=_xmouse-_root.textbar._x;" +" for(i=xpos.length-1;i>0;i--) {" +" if(x0) {" +" speed=0;" +" } else if(myx+speed<-xpos[0]+1024) {" +" speed=0;" +" }" +" myx+=speed;" +" _root.textbar._x = myx;" +" _root.marker._x += speed;" +" _root.marker2._x += speed;" +" }, 20);" +" Mouse.addListener(mouseListener);" +; + ActionTAG* atag = swf_ActionCompile(data, 6); + + tag = swf_InsertTag(tag, ST_DOACTION); + swf_ActionSet(tag, array); + swf_ActionSet(tag, atag); + swf_SetU8(tag, 0); + swf_ActionFree(atag); + + tag = swf_InsertTag(tag, ST_SHOWFRAME); + + free(flags); + free(xmin); + free(xmax); + } + + tag = swf_InsertTag(tag, ST_END); + + swf.compressed = -1; + swf_SaveSWF(&swf, filename); + swf_FreeTags(&swf); +} diff -Nru swftools-0.9.0/lib/modules/swftools.c swftools-0.9.2/lib/modules/swftools.c --- swftools-0.9.0/lib/modules/swftools.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/modules/swftools.c 2010-11-12 18:55:39.000000000 +0000 @@ -584,10 +584,13 @@ case ST_DEFINEBUTTONSOUND: { int t; callback(tag, tag->pos + base, callback_data); + swf_GetU16(tag); //button id for(t=0;t<4;t++) { int flags; callback(tag, tag->pos + base, callback_data); - swf_GetU16(tag); //sound id + U16 sound_id = swf_GetU16(tag); //sound id + if(!sound_id) + continue; flags = swf_GetU8(tag); if(flags&1) swf_GetU32(tag); // in point @@ -612,6 +615,7 @@ callback(tag, tag->pos + base, callback_data); //button id break; + case ST_SYMBOLCLASS: case ST_EXPORTASSETS: { int num = swf_GetU16(tag); int t; @@ -642,7 +646,6 @@ case ST_FREECHARACTER: /* unusual tags, which all start with an ID */ case ST_NAMECHARACTER: - case ST_DEFINEBINARY: case ST_DEFINEFONTNAME: case ST_GENERATORTEXT: callback(tag, tag->pos + base, callback_data); @@ -973,11 +976,24 @@ memset(slaveids, -1, sizeof(slaveids)); tag = swf->firstTag; char ok = 1; + + int current_id=0; +#define NEW_ID(n) \ + for(current_id++;current_id<65536;current_id++) { \ + if(!bitmap[current_id]) { \ + n = current_id; \ + break; \ + } \ + } \ + if(current_id==65536) { \ + fprintf(stderr, "swf_Relocate: Couldn't relocate: Out of IDs\n"); \ + return 0; \ + } + while(tag) { int num; int *ptr; - int t; if(swf_isDefiningTag(tag)) { @@ -988,21 +1004,12 @@ if(!bitmap[id]) { //free newid = id; + } else if(slaveids[id]>0) { + newid = slaveids[id]; } else { - newid = 0; - for (t=1;t<65536;t++) - { - if(!bitmap[t]) - { - newid = t; - break; - } - } - if(t==65536) { - fprintf(stderr, "swf_Relocate: Couldn't relocate: Out of IDs\n"); - return 0; - } + NEW_ID(newid); } + bitmap[newid] = 1; slaveids[id] = newid; @@ -1013,17 +1020,37 @@ if(num) { ptr = (int*)rfx_alloc(sizeof(int)*num); swf_GetUsedIDs(tag, ptr); - + int t; for(t=0;tdata[ptr[t]]); if(slaveids[id]<0) { - fprintf(stderr, "swf_Relocate: Mapping id (%d) never encountered before in %s\n", id, - swf_TagGetName(tag)); - ok = 0; + if(!id && bitmap[id]) { + /* id 0 is only used in SWF versions >=9. It's the ID of + the main timeline. It's used in e.g. SYMBOLTAG tags, but + never defined, so if we're asked to reallocate it, we have + to allocate an ID for it on the fly. */ + int newid; + NEW_ID(newid); + bitmap[newid] = 1; + slaveids[id] = newid; + id = newid; + } else if(!bitmap[id]) { + /* well- we don't know this id, but it's not reserved anyway, so just + leave it alone */ + } else { + /* this actually happens with files created with Flash CS4 and never. + Apparently e.g. DefineButton tags are able to use forward declarations of objects. */ + fprintf(stderr, "warning: Mapping id (%d) never encountered before in %s\n", id, + swf_TagGetName(tag)); + int newid; + NEW_ID(newid); + id = slaveids[id] = newid; + ok = 0; + } } else { id = slaveids[id]; - PUT16(&tag->data[ptr[t]], id); } + PUT16(&tag->data[ptr[t]], id); } free(ptr); } @@ -1141,6 +1168,7 @@ { if(tag->id == ST_DEFINEFONT || tag->id == ST_DEFINEFONT2 || + tag->id == ST_DEFINEFONT3 || tag->id == ST_DEFINEFONTINFO) return 1; return 0; diff -Nru swftools-0.9.0/lib/os.c swftools-0.9.2/lib/os.c --- swftools-0.9.0/lib/os.c 2009-02-11 17:17:09.000000000 +0000 +++ swftools-0.9.2/lib/os.c 2012-04-08 17:25:26.000000000 +0000 @@ -187,13 +187,14 @@ if(!dir) dir = getenv("temp"); if(!dir) dir = "C:\\"; #else - char* dir = "/tmp/"; + char*dir = getenv("SWFTOOLS_TMP"); + if(!dir) dir = "/tmp/"; #endif return dir; } -char* mktempname(char*ptr) { - static char tmpbuf[128]; +char* mktempname(char*ptr, const char*ext) { + static char tmpbuf[160]; char*dir = getTempDir(); int l = strlen(dir); char*sep = ""; @@ -207,20 +208,24 @@ #endif } - // used to be mktemp. This does remove the warnings, but - // It's not exactly an improvement. #ifdef HAVE_LRAND48 - sprintf(ptr, "%s%s%08x%08x",dir,sep,lrand48(),lrand48()); + unsigned int r1 = (unsigned int)lrand48(); + unsigned int r2 = (unsigned int)lrand48(); +#elif HAVE_RAND + unsigned int r1 = rand(); + unsigned int r2 = rand(); #else -# ifdef HAVE_RAND - sprintf(ptr, "%s%s%08x%08x",dir,sep,rand(),rand()); -# else - static int count = 1; - sprintf(ptr, "%s%s%08x%04x%04x",dir,sep,time(0),(unsigned int)tmpbuf^((unsigned int)tmpbuf)>>16,count); - count ++; -# endif + static int count = 1; + unsigned int r1 = time(0); + unsigned int r2 = (unsigned int)tmpbuf<<8^count; + count ++; #endif - return ptr; + if(ext) { + sprintf(ptr, "%s%s%04x%04x.%s",dir,sep,r1,r2,ext); + } else { + sprintf(ptr, "%s%s%04x%04x",dir,sep,r1,r2); + } + return ptr; } memfile_t* memfile_open(const char*path) @@ -240,6 +245,7 @@ } file->len = sb.st_size; file->data = mmap(0, sb.st_size, PROT_READ, MAP_PRIVATE, fi, 0); + close(fi); #else FILE*fi = fopen(path, "rb"); if(!fi) { @@ -274,3 +280,66 @@ free(file); } +void move_file(const char*from, const char*to) +{ + int result = rename(from, to); + + if(result==0) return; //done! + + /* if we can't rename, for some reason, copy the file + manually */ + FILE*fi = fopen(from, "rb"); + if(!fi) { + perror(from); + return; + } + FILE*fo = fopen(to, "wb"); + if(!fo) { + perror(to); + return; + } + char buffer[16384]; + while(1) { + int bytes = fread(buffer, 1, 16384, fi); + if(bytes<=0) + break; + fwrite(buffer, bytes, 1, fo); + } + + fclose(fo); + fclose(fi); + unlink(from); +} + +char file_exists(const char*filename) +{ +#ifdef HAVE_STAT + struct stat sb; + return stat(filename, &sb) >= 0; +#else + int fi = open(filename, O_RDONLY); + if(fi>=0) { + close(fi); + return 1; + } + return 0; +#endif +} + +int file_size(const char*filename) +{ +#ifdef HAVE_STAT + struct stat sb; + if(stat(filename, &sb) >= 0) { + return sb.st_size; + } +#endif + FILE*fi = fopen(filename, "rb"); + if(fi>=0) { + fseek(fi, 0, SEEK_END); + int size = ftell(fi); + fclose(fi); + return size; + } + return 0; +} diff -Nru swftools-0.9.0/lib/os.h swftools-0.9.2/lib/os.h --- swftools-0.9.0/lib/os.h 2009-02-11 17:17:09.000000000 +0000 +++ swftools-0.9.2/lib/os.h 2011-10-07 03:20:17.000000000 +0000 @@ -47,7 +47,11 @@ char* concatPaths(const char*base, const char*add); char* stripFilename(const char*filename, const char*newext); -char* mktempname(char*buffer); +char* mktempname(char*buffer, const char*ext); + +void move_file(const char*from, const char*to); +char file_exists(const char*filename); +int file_size(const char*filename); #ifdef __cplusplus } diff -Nru swftools-0.9.0/lib/pdf/aconf.h swftools-0.9.2/lib/pdf/aconf.h --- swftools-0.9.0/lib/pdf/aconf.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/aconf.h 2010-11-12 18:57:42.000000000 +0000 @@ -9,8 +9,12 @@ #define ACONF_H #include "../../config.h" +#define SYSTEM_XPDFRC "/etc/xpdf/xpdfrc" + #define HAVE_STRINGS_H 1 +#define TEXTOUT_WORD_LIST 1 + // todo: // // HAVE_STRINGS_H diff -Nru swftools-0.9.0/lib/pdf/bbox.c swftools-0.9.2/lib/pdf/bbox.c --- swftools-0.9.0/lib/pdf/bbox.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/bbox.c 2010-11-12 19:06:43.000000000 +0000 @@ -0,0 +1,481 @@ +#include +#include +#include +#include +#include +#include "../types.h" +#include "../mem.h" + +typedef struct _ibbox { + int xmin,ymin,xmax,ymax; + struct _ibbox*next; +} ibbox_t; + +ibbox_t* ibbox_new(int x1, int y1, int x2, int y2) +{ + ibbox_t*b = (ibbox_t*)rfx_calloc(sizeof(ibbox_t)); + b->xmin = x1; + b->ymin = y1; + b->xmax = x2; + b->ymax = y2; + return b; +} + +void ibbox_destroy(ibbox_t*b) +{ + while(b) { + ibbox_t*next = b->next; + free(b); + b = next; + } +} + +ibbox_t*get_bitmap_bboxes_simple(unsigned char*alpha, int width, int height, int rowsize) +{ + int ymin = -1; + int ymax = -1; + int xmin = width; + int xmax = 0; + + int x,y; + for(y=0;yxmax) xmax = right; + } + } + ibbox_t* bbox = 0; + if(xminwidth*y+x; + head_t*h = rfx_calloc(sizeof(head_t)); + h->magic = HEAD_MAGIC; + h->nr = context->count++; + h->pos = pos; + h->x = x; + h->y = y; + h->bbox.xmin = h->bbox.xmax = x; + h->bbox.ymin = h->bbox.ymax = y; + h->next = context->heads; + context->heads = h; + if(h->next) { + h->next->prev = h; + } + return h; +} + +static void head_delete(context_t*context, head_t*h) +{ + if(h->prev) { + h->prev->next = h->next; + } + if(h->next) { + h->next->prev = h->prev; + } + if(h==context->heads) { + assert(!h->prev); + context->heads = h->next; + } + free(h); +} + +#define POINTS_TO_HEAD(ptr) (((head_t*)(ptr))->magic==HEAD_MAGIC) + +static inline void link_to(context_t*context, int from, int to) +{ + // path compression + void**data = context->group; + int head = to; + assert(data[head]); + while(!POINTS_TO_HEAD(data[head])) { + assert(data[head]!=(void*)&data[head]); // check that we're not in an infinite loop + head=(void**)data[head]-(void**)data; + } + head_t*h = (head_t*)data[head]; + int x = from%context->width; + int y = from/context->width; + if(x < h->bbox.xmin) h->bbox.xmin = x; + if(y < h->bbox.ymin) h->bbox.ymin = y; + if(x > h->bbox.xmax) h->bbox.xmax = x; + if(y > h->bbox.ymax) h->bbox.ymax = y; + + data[from] = (void*)&data[head]; +} +static char ibbox_does_overlap(ibbox_t*b1, ibbox_t*b2) +{ + if(b1->xmax < b2->xmin) return 0; + if(b2->xmax < b1->xmin) return 0; + if(b1->ymax < b2->ymin) return 0; + if(b2->ymax < b1->ymin) return 0; + return 1; +} +static void ibbox_expand(ibbox_t*src, ibbox_t*add) +{ + if(add->xmin < src->xmin) + src->xmin = add->xmin; + if(add->ymin < src->ymin) + src->ymin = add->ymin; + if(add->xmax > src->xmax) + src->xmax = add->xmax; + if(add->ymax > src->ymax) + src->ymax = add->ymax; +} +static inline void merge(context_t*context, int set1, int set2) +{ + void**data = context->group; + assert(data[set1]); + assert(data[set2]); + int head1 = set1; + int head2 = set2; + while(!POINTS_TO_HEAD(data[head1])) { + head1=(void**)data[head1]-(void**)data; + } + while(!POINTS_TO_HEAD(data[head2])) { + head2=(void**)data[head2]-(void**)data; + } + head_t*h1 = (head_t*)data[head1]; + head_t*h2 = (head_t*)data[head2]; + if(h1==h2) + return; + + if(h1->rank>h2->rank) { + h1->rank++; + ibbox_expand(&h1->bbox,&h2->bbox); + data[head2] = (void*)&data[head1]; + head_delete(context, h2); + } else { + h2->rank++; + ibbox_expand(&h2->bbox,&h1->bbox); + data[head1] = (void*)&data[head2]; + head_delete(context, h1); + } +} + +ibbox_t ibbox_clip(ibbox_t* outer, ibbox_t* inner) +{ + ibbox_t i = {inner->xmin, inner->ymin, inner->xmax, inner->ymax, 0}; + if(i.xmax > outer->xmax) i.xmax = outer->xmax; + if(i.ymax > outer->ymax) i.ymax = outer->ymax; + if(i.xmax < outer->xmin) i.xmax = outer->xmin; + if(i.ymax < outer->ymin) i.ymax = outer->ymin; + + if(i.xmin > outer->xmax) i.xmin = outer->xmax; + if(i.ymin > outer->ymax) i.ymin = outer->ymax; + if(i.xmin < outer->xmin) i.xmin = outer->xmin; + if(i.ymin < outer->ymin) i.ymin = outer->ymin; + return i; +} + +static void** annotate(context_t*context) +{ + unsigned char*alpha = context->alpha; + int width = context->width; + int height = context->height; + void** group = rfx_calloc(width*height*sizeof(void*)); + context->group = group; + int x,y; + + for(x=1;xrowsize; + if(alpha[apos]) { + if(group[pos-width]) + link_to(context,pos,pos-width); + else + group[pos]=head_new(context,0,y); + } + for(x=1;xheads; + changed = 0; + while(h1) { + head_t*next = h1->next; + head_t*h2 = context->heads; + while(h2) { + if(h1!=h2) { + if(ibbox_does_overlap(&h1->bbox, &h2->bbox)) { + merge(context, h1->pos, h2->pos); + changed = 1; + break; + } + } + h2 = h2->next; + } + h1 = next; + } + } while(changed); +} + +typedef struct _circle_coord { + S16 x,y; +} circle_coord_t; + +static int compare_circle_coord(const void *_v1, const void *_v2) +{ + circle_coord_t*v1=(circle_coord_t*)_v1; + circle_coord_t*v2=(circle_coord_t*)_v2; + return (v1->x*v1->x + v1->y*v1->y) - (v2->x*v2->x + v2->y*v2->y); +} + +static head_t* search_vicinity(context_t*context, head_t*h, int max_radius, double*cos, double*sin) +{ + static circle_coord_t*circle_order = 0; + static int circle_order_size = 0; + + if(!circle_order) { + circle_order_size = (max_radius*(max_radius+1))/2; + circle_order = malloc(sizeof(circle_coord_t)*circle_order_size); + int x,y; + int i = 0; + for(y=0;ygroup; + int signx[4] = {-1,1,-1,1}; + int signy[4] = {-1,-1,1,1}; + for(t=1;tx+xx*signx[s]; + int y=h->y+yy*signy[s]; + if(x>=0 && y>=0 && xwidth && yheight) { + int pos = y*context->width+x; + if(data[pos]) { + while(!POINTS_TO_HEAD(data[pos])) { + pos=(void**)data[pos]-(void**)data; + } + head_t*new_head = (head_t*)data[pos]; + if(new_head != h) { + return new_head; + } + } + } + } + } + return 0; +} + +static void fix_small_boxes(context_t*context) +{ + double sintab[256]; + double costab[256]; + int t; + for(t=0;t<256;t++) { + sintab[t] = sin(t*M_PI/128); + costab[t] = cos(t*M_PI/128); + } + + head_t*h = context->heads; + while(h) { + h->seen = 0; + h = h->next; + } + + char changed; + do { + changed = 0; + head_t*h = context->heads; + while(h) { + head_t*next = h->next; + if(!h->seen) { + if(h->bbox.xmax - h->bbox.xmin < 32 + || h->bbox.ymax - h->bbox.ymin < 32) { + head_t*other = search_vicinity(context, h, 64, costab, sintab); + if(other) { + merge(context, h->pos, other->pos); + changed = 1; + break; + } else { + //printf("nothing in the vicinity of %d,%d,%d,%d\n", h->bbox); + h->seen = 1; + } + } /*else { + printf("area %d,%d,%d,%d is large enough (%dx%d)\n", + h->bbox.xmin, + h->bbox.ymin, + h->bbox.xmax, + h->bbox.ymax, + h->bbox.xmax - h->bbox.xmin, + h->bbox.ymax - h->bbox.ymin); + } */ + } + h = next; + } + } while(changed); +} + +static void display(context_t*context) +{ + int width = context->width; + int height = context->height; + void**group = context->group; + + int x,y; + for(y=0;ynr); + } else { + printf("x%02d ", (void**)group[y*width+x]-(void**)group); + } + } + printf("\n"); + } + + head_t*h = context->heads; + while(h) { + printf("head: %d\n", h->nr); + printf(" pos: %d/%d\n", h->pos%width, h->pos/width); + printf(" bbox: [%d/%d,%d/%d]\n", h->bbox.xmin, h->bbox.ymin, h->bbox.xmax, h->bbox.ymax); + h = h->next; + } +} + +ibbox_t*get_bitmap_bboxes(unsigned char*alpha, int width, int height, int rowsize) +{ + int size = width*height; + if(width<=1 || height<=1) + return get_bitmap_bboxes_simple(alpha, width, height, rowsize); + + context_t context; + context.alpha = alpha; + context.rowsize = rowsize; + context.width = width; + context.height = height; + context.heads = 0; + context.count = 1; + + void**group = annotate(&context); + fix_small_boxes(&context); + overlap_bboxes(&context); +#ifdef MAIN + display(&context); +#endif + + ibbox_t*bboxes = 0; + + head_t*h = context.heads; + while(h) { + head_t*next = h->next; + ibbox_t*bbox = malloc(sizeof(ibbox_t)); + memcpy(bbox, &h->bbox, sizeof(ibbox_t)); + + /* ibbox_t defines the open upper bound */ + bbox->xmax++; + bbox->ymax++; + + bbox->next = bboxes; + bboxes = bbox; + free(h); + h = next; + } + free(context.group); + return bboxes; +} + +#ifdef MAIN +int main(int argn, char*argv[]) +{ + unsigned char alpha[8*8]= + "\0\0\1\0\0\0\0\0" + "\1\0\0\1\0\1\0\0" + "\0\0\0\0\0\0\1\0" + "\0\0\1\0\1\0\0\0" + "\1\0\1\0\1\0\0\0" + "\1\0\1\1\1\0\0\1" + "\1\0\0\0\0\0\1\0" + "\1\1\1\0\0\0\0\0"; + + get_bitmap_bboxes(alpha, 8,8, 8); +} +#endif diff -Nru swftools-0.9.0/lib/pdf/bbox.h swftools-0.9.2/lib/pdf/bbox.h --- swftools-0.9.0/lib/pdf/bbox.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/bbox.h 2010-11-12 19:06:41.000000000 +0000 @@ -0,0 +1,23 @@ +#ifndef __bbox_h__ +#define __bbox_h__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _ibbox { + int xmin,ymin,xmax,ymax; + struct _ibbox*next; +} ibbox_t; + +ibbox_t ibbox_clip(ibbox_t* outer, ibbox_t* inner); + +ibbox_t* ibbox_new(int x1, int y1, int x2, int y2, int rowsize); +void ibbox_destroy(ibbox_t*b); +ibbox_t*get_bitmap_bboxes(unsigned char*alpha, int width, int height, int rowsize); + +#ifdef __cplusplus +} +#endif + +#endif //__bbox_h__ diff -Nru swftools-0.9.0/lib/pdf/BitmapOutputDev.cc swftools-0.9.2/lib/pdf/BitmapOutputDev.cc --- swftools-0.9.0/lib/pdf/BitmapOutputDev.cc 2009-04-01 07:56:44.000000000 +0000 +++ swftools-0.9.2/lib/pdf/BitmapOutputDev.cc 2011-01-02 03:30:29.000000000 +0000 @@ -18,18 +18,30 @@ #include #include +#include #include #include -#include "config.h" #include "BitmapOutputDev.h" -#include "GFXOutputDev.h" -#include "SplashBitmap.h" -#include "SplashPattern.h" -#include "Splash.h" +#include "CharOutputDev.h" + +#ifdef HAVE_POPPLER + #include "splash/SplashBitmap.h" + #include "splash/SplashPattern.h" + #include "splash/Splash.h" +#else + #include "xpdf/config.h" + #include "SplashBitmap.h" + #include "SplashGlyphBitmap.h" + #include "SplashPattern.h" + #include "Splash.h" +#endif + #include "../log.h" #include "../png.h" #include "../devices/record.h" +#include "../gfxtools.h" #include "../types.h" +#include "bbox.h" #define UNKNOWN_BOUNDING_BOX 0,0,0,0 @@ -43,7 +55,15 @@ this->written = 0; } -BitmapOutputDev::BitmapOutputDev(InfoOutputDev*info, PDFDoc*doc) +static gfxdevice_t* device_new_record() +{ + gfxdevice_t*dev = (gfxdevice_t*)malloc(sizeof(gfxdevice_t)); + gfxdevice_record_init(dev, 0); + return dev; +} + +BitmapOutputDev::BitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2) +:CommonOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2) { this->info = info; this->doc = doc; @@ -65,7 +85,7 @@ this->booltextdev = new SplashOutputDev(colorMode, 1, gFalse, splash_black, gTrue, gFalse); /* device for handling texts and links */ - this->gfxdev = new GFXOutputDev(info, this->doc); + this->gfxdev = new CharOutputDev(info, this->doc, page2page, num_pages, x, y, x1, y1, x2, y2); this->rgbdev->startDoc(this->xref); this->boolpolydev->startDoc(this->xref); @@ -73,12 +93,14 @@ this->clip0dev->startDoc(this->xref); this->clip1dev->startDoc(this->xref); - this->gfxoutput = (gfxdevice_t*)malloc(sizeof(gfxdevice_t)); - gfxdevice_record_init(this->gfxoutput); - + this->gfxoutput_string = device_new_record(); + this->gfxoutput = device_new_record(); this->gfxdev->setDevice(this->gfxoutput); this->config_extrafontdata = 0; + this->config_optimizeplaincolorfills = 0; + this->config_skewedtobitmap = 0; + this->config_alphatobitmap = 0; this->bboxpath = 0; //this->clipdev = 0; //this->clipstates = 0; @@ -90,6 +112,11 @@ r->destroy(r); free(this->gfxoutput);this->gfxoutput = 0; } + if(this->gfxoutput_string) { + gfxresult_t*r = this->gfxoutput_string->finish(this->gfxoutput_string); + r->destroy(r); + free(this->gfxoutput_string);this->gfxoutput_string = 0; + } if(this->bboxpath) { delete this->bboxpath;this->bboxpath = 0; } @@ -102,6 +129,12 @@ if(this->boolpolydev) { delete this->boolpolydev;this->boolpolydev = 0; } + if(this->stalepolybitmap) { + delete this->stalepolybitmap;this->stalepolybitmap = 0; + } + if(this->staletextbitmap) { + delete this->staletextbitmap;this->staletextbitmap = 0; + } if(this->booltextdev) { delete this->booltextdev;this->booltextdev = 0; } @@ -132,164 +165,181 @@ { this->dev = dev; } -void BitmapOutputDev::setMove(int x,int y) -{ - this->gfxdev->setMove(x,y); - this->user_movex = x; - this->user_movey = y; -} -void BitmapOutputDev::setClip(int x1,int y1,int x2,int y2) -{ - this->gfxdev->setClip(x1,y1,x2,y2); - this->user_clipx1 = x1; - this->user_clipy1 = y1; - this->user_clipx2 = x2; - this->user_clipy2 = y2; -} void BitmapOutputDev::setParameter(const char*key, const char*value) { if(!strcmp(key, "extrafontdata")) { this->config_extrafontdata = atoi(value); + } else if(!strcmp(key, "skewedtobitmap")) { + this->config_skewedtobitmap = atoi(value); + } else if(!strcmp(key, "alphatobitmap")) { + this->config_alphatobitmap = atoi(value); } + this->gfxdev->setParameter(key, value); } -void BitmapOutputDev::setPageMap(int*page2page, int num_pages) -{ - this->gfxdev->setPageMap(page2page, num_pages); -} -static void getBitmapBBox(Guchar*alpha, int width, int height, int*xmin, int*ymin, int*xmax, int*ymax) -{ - *ymin = -1; - *xmin = width; - *xmax = 0; - int x,y; - for(y=0;y*xmax) *xmax = right; - } - } - if(*xmin>=*xmax || *ymin>=*ymax) { - *xmin = 0; - *ymin = 0; - *xmax = 0; - *ymax = 0; - } -} +void writeBitmap(SplashBitmap*bitmap, char*filename); +void writeAlpha(SplashBitmap*bitmap, char*filename); + +static int dbg_btm_counter=1; void BitmapOutputDev::flushBitmap() { - int width = rgbdev->getBitmapWidth(); - int height = rgbdev->getBitmapHeight(); - - SplashColorPtr rgb = rgbbitmap->getDataPtr(); - Guchar*alpha = rgbbitmap->getAlphaPtr(); - Guchar*alpha2 = boolpolybitmap->getAlphaPtr(); - - int xmin,ymin,xmax,ymax; - getBitmapBBox(alpha, width, height, &xmin,&ymin,&xmax,&ymax); - - /* clip against (-movex, -movey, -movex+width, -movey+height) */ - if(xmin < -this->movex) xmin = -this->movex; - if(ymin < -this->movey) ymin = -this->movey; - if(xmax > -this->movex + width) xmax = -this->movex+this->width; - if(ymax > -this->movey + height) ymax = -this->movey+this->height; - - msg(" Flushing bitmap (bbox: %d,%d,%d,%d)", xmin,ymin,xmax,ymax); - - if((xmax-xmin)<=0 || (ymax-ymin)<=0) // no bitmap, nothing to do - return; + int bitmap_width = rgbdev->getBitmapWidth(); + int bitmap_height = rgbdev->getBitmapHeight(); if(sizeof(SplashColor)!=3) { msg(" sizeof(SplashColor)!=3"); return; } - //xmin = ymin = 0; - //xmax = width; - //ymax = height; - - int rangex = xmax-xmin; - int rangey = ymax-ymin; - gfximage_t*img = (gfximage_t*)malloc(sizeof(gfximage_t)); - img->data = (gfxcolor_t*)malloc(rangex * rangey * 4); - img->width = rangex; - img->height = rangey; - int x,y; - for(y=0;ydata[y*rangex]; - Guchar*ain = &alpha[(y+ymin)*width+xmin]; - Guchar*ain2 = &alpha2[(y+ymin)*width+xmin]; - if(this->emptypage) { - for(x=0;xgetBitmap(), "test.png"); + } counter++;*/ + + /*static int counter=0; + char filename[160]; + sprintf(filename, "test%d.png", counter++); + writeBitmap(rgbbitmap, filename);*/ + + SplashColorPtr rgb = rgbbitmap->getDataPtr(); + Guchar*alpha = rgbbitmap->getAlphaPtr(); + + Guchar*alpha2 = stalepolybitmap->getDataPtr(); + int bitmap_width8 = (stalepolybitmap->getWidth()+7)/8; + + /*char filename[80]; + sprintf(filename, "flush%d_mask.png", dbg_btm_counter); + writeAlpha(stalepolybitmap, filename); + sprintf(filename, "flush%d_alpha.png", dbg_btm_counter); + writeAlpha(rgbbitmap, filename); + sprintf(filename, "flush%d_bitmap.png", dbg_btm_counter); + writeBitmap(rgbbitmap, filename);*/ + + ibbox_t pagebox = {-movex, -movey, -movex + this->width, -movey + this->height, 0}; + ibbox_t bitmapbox = {0, 0, bitmap_width, bitmap_height, 0}; + ibbox_t c = ibbox_clip(&bitmapbox, &pagebox); + ibbox_t* boxes = get_bitmap_bboxes((unsigned char*)(alpha+c.ymin*bitmap_width+c.xmin), c.xmax - c.xmin, c.ymax - c.ymin, bitmap_width); + + ibbox_t*b; + for(b=boxes;b;b=b->next) { + int xmin = b->xmin - this->movex; + int ymin = b->ymin - this->movey; + int xmax = b->xmax - this->movex; + int ymax = b->ymax - this->movey; + + /* clip against (-movex, -movey, -movex+width, -movey+height) */ + + msg(" Flushing bitmap (bbox: %d,%d,%d,%d %dx%d) (clipped against %d,%d,%d,%d)", xmin,ymin,xmax,ymax, xmax-xmin, ymax-ymin, + -this->movex, -this->movey, -this->movex+this->width, -this->movey+this->height); + + if(xmin < -this->movex) { + xmin = -this->movex; + if(xmax < -this->movex) continue; + } + if(ymin < -this->movey) { + ymin = -this->movey; + if(ymax < -this->movey) continue; + } + if(xmax >= -this->movex + this->width) { + xmax = -this->movex+this->width; + if(xmin >= -this->movex + this->width) continue; + } + if(ymax >= -this->movey + this->height) { + ymax = -this->movey+this->height; + if(ymin >= -this->movey + this->height) continue; + } + + if((xmax-xmin)<=0 || (ymax-ymin)<=0) // no bitmap, nothing to do + continue; + + int rangex = xmax-xmin; + int rangey = ymax-ymin; + gfximage_t*img = (gfximage_t*)malloc(sizeof(gfximage_t)); + img->data = (gfxcolor_t*)malloc(rangex * rangey * 4); + img->width = rangex; + img->height = rangey; + int x,y; + for(y=0;ydata[y*rangex]; + Guchar*ain = &alpha[(y+ymin)*bitmap_width+xmin]; + Guchar*ain2 = &alpha2[(y+ymin)*bitmap_width8]; + if(this->emptypage) { + for(x=0;x>((x+xmin)&7)))) { + /* cut away pixels that we don't remember drawing (i.e., that are + not in the monochrome bitmap). Prevents some "hairlines" showing + up to the left and right of bitmaps. */ + out[x].r = 0;out[x].g = 0;out[x].b = 0;out[x].a = 0; + } else { + /* according to endPage()/compositeBackground() in xpdf/SplashOutputDev.cc, this + data has non-premultiplied alpha, which is exactly what the output device + expects, so don't premultiply it here, either. + */ + out[x].r = in[x*3+0]; + out[x].g = in[x*3+1]; + out[x].b = in[x*3+2]; + out[x].a = ain[x]; + } + } } } + + /* transform bitmap rectangle to "device space" */ + xmin += movex; + ymin += movey; + xmax += movex; + ymax += movey; + + gfxmatrix_t m; + m.tx = xmin; + m.ty = ymin; + m.m00 = m.m11 = 1; + m.m10 = m.m01 = 0; + m.tx -= 0.5; + m.ty -= 0.5; + + gfxline_t* line = gfxline_makerectangle(xmin, ymin, xmax, ymax); + dev->fillbitmap(dev, line, img, &m, 0); + gfxline_free(line); + + if(img->data) { + free(img->data);img->data=0; + } + free(img);img=0; } - /* transform bitmap rectangle to "device space" */ - xmin += movex; - ymin += movey; - xmax += movex; - ymax += movey; - - gfxmatrix_t m; - m.tx = xmin; - m.ty = ymin; - m.m00 = m.m11 = 1; - m.m10 = m.m01 = 0; - m.tx -= 0.5; - m.ty -= 0.5; - - gfxline_t* line = gfxline_makerectangle(xmin, ymin, xmax, ymax); - dev->fillbitmap(dev, line, img, &m, 0); - gfxline_free(line); + ibbox_destroy(boxes); memset(rgbbitmap->getAlphaPtr(), 0, rgbbitmap->getWidth()*rgbbitmap->getHeight()); memset(rgbbitmap->getDataPtr(), 0, rgbbitmap->getRowSize()*rgbbitmap->getHeight()); - free(img->data);img->data=0;free(img);img=0; - this->emptypage = 0; } void BitmapOutputDev::flushText() { - msg(" Flushing text/polygons"); - gfxdevice_record_flush(this->gfxoutput, this->dev); + msg(" Flushing text"); + + static gfxfontlist_t*output_font_list = 0; + static gfxdevice_t*last = 0; + if(last != this->dev) { + if(output_font_list) + gfxfontlist_free(output_font_list, 0); + output_font_list = gfxfontlist_create(); + } + gfxdevice_record_flush(this->gfxoutput, this->dev, &output_font_list); + last = this->dev; this->emptypage = 0; } @@ -307,14 +357,14 @@ gfxcolor_t*d = &b[width*y]; for(x=0;x>3]&(128>>(x&7))) { - d[x].r = d[x].g = d[x].b = 255; + d[x].r = d[x].b = d[x].a = 255; + d[x].g = 0; } else { - d[x].r = d[x].g = d[x].b = 0; + d[x].r = d[x].g = d[x].b = d[x].a = 0; } - d[x].a = 255; } } - writePNG(filename, (unsigned char*)b, width, height); + png_write_quick(filename, (unsigned char*)b, width, height); free(b); } @@ -343,7 +393,7 @@ line[x].a = bitmap->getAlpha(x,y); } } - writePNG(filename, (unsigned char*)data, width, height); + png_write_quick(filename, (unsigned char*)data, width, height); free(data); } @@ -366,15 +416,14 @@ for(x=0;xgetAlpha(x,y); line[x].r = a; - line[x].g = a; + line[x].g = 0; line[x].b = a; - line[x].a = 255; + line[x].a = a; } } - writePNG(filename, (unsigned char*)data, width, height); + png_write_quick(filename, (unsigned char*)data, width, height); free(data); } -static int dbg_btm_counter=1; static const char*STATE_NAME[] = {"parallel", "textabovebitmap", "bitmapabovetext"}; @@ -410,36 +459,200 @@ return 1; } -GBool BitmapOutputDev::checkNewText(int x1, int y1, int x2, int y2) +static inline GBool fixBBox(int*x1, int*y1, int*x2, int*y2, int width, int height) { - /* called once some new text was drawn on booltextdev, and - before the same thing is drawn on gfxdev */ - - msg(" Testing new text data against current bitmap data, state=%s, counter=%d\n", STATE_NAME[layerstate], dbg_btm_counter); + if(!(*x1|*y1|*x2|*y2)) { + // undefined bbox + *x1 = *y1 = 0; + *x2 = width; + *y2 = height; + return gTrue; + } + if(*x2<=*x1) return gFalse; + if(*x2<0) return gFalse; + if(*x1<0) *x1 = 0; + if(*x1>=width) return gFalse; + if(*x2>width) *x2=width; + + if(*y2<=*y1) return gFalse; + if(*y2<0) return gFalse; + if(*y1<0) *y1 = 0; + if(*y1>=height) return gFalse; + if(*y2>height) *y2=height; + return gTrue; +} + +static void update_bitmap(SplashBitmap*bitmap, SplashBitmap*update, int x1, int y1, int x2, int y2, char overwrite) +{ + assert(bitmap->getMode()==splashModeMono1); + assert(update->getMode()==splashModeMono1); + + int width8 = (bitmap->getWidth()+7)/8; + assert(width8 == bitmap->getRowSize()); + assert(width8 == update->getRowSize()); + int height = bitmap->getHeight(); + assert(height == update->getHeight()); + + if(!fixBBox(&x1, &y1, &x2, &y2, bitmap->getWidth(), bitmap->getHeight())) + return; + Guchar*b = bitmap->getDataPtr() + y1*width8 + x1/8; + Guchar*u = update->getDataPtr() + y1*width8 + x1/8; + int yspan = y2-y1; + int xspan = (x2+7)/8 - x1/8; + int size = (y2-y1)*width8; + + if(overwrite) { + int y; + for(y=0;ygetWidth(), btm->getHeight())) + return; + + if(btm->getMode()==splashModeMono1) { + int width8 = (btm->getWidth()+7)/8; + assert(width8 == btm->getRowSize()); + int width = btm->getWidth(); + int height = btm->getHeight(); + Guchar*data = btm->getDataPtr(); + memset(data+y1*width8, 0, width8*(y2-y1)); + } else { + int width = btm->getAlphaRowSize(); + int height = btm->getHeight(); + memset(btm->getAlphaPtr(), 0, width*height); + } +} + +void BitmapOutputDev::dbg_newdata(char*newdata) +{ if(0) { char filename1[80]; char filename2[80]; char filename3[80]; - sprintf(filename1, "state%dboolbitmap_afternewtext.png", dbg_btm_counter); - sprintf(filename2, "state%dbooltext_afternewtext.png", dbg_btm_counter); - sprintf(filename3, "state%dbitmap_afternewtext.png", dbg_btm_counter); - msg(" %s %s %s", filename1, filename2, filename3); + char filename4[80]; + char filename5[80]; + sprintf(filename1, "state%03dboolbitmap_after%s.png", dbg_btm_counter, newdata); + sprintf(filename2, "state%03dbooltext_after%s.png", dbg_btm_counter, newdata); + sprintf(filename3, "state%03dstalebitmap_after%s.png", dbg_btm_counter, newdata); + sprintf(filename4, "state%03dstaletext_after%s.png", dbg_btm_counter, newdata); + sprintf(filename5, "state%03dbitmap_after%s.png", dbg_btm_counter, newdata); + msg(" %s %s %s", filename1, filename2, filename5); writeAlpha(boolpolybitmap, filename1); writeAlpha(booltextbitmap, filename2); - writeBitmap(rgbdev->getBitmap(), filename3); + writeAlpha(stalepolybitmap, filename3); + writeAlpha(staletextbitmap, filename4); + writeBitmap(rgbdev->getBitmap(), filename5); } dbg_btm_counter++; +} + +static void getBitmapBBox(SplashBitmap*b, int*xmin, int*ymin, int*xmax, int*ymax) +{ + int width = b->getWidth(); + int height = b->getHeight(); + int width8 = (width+7)>>3; + Guchar*pixels = b->getDataPtr(); + int x,y; + *xmin = *ymin = *xmax = *ymax = 0; + for(x=0;x>xb)) { + *xmin = x*8+xb; + break; + } + } + } + if(y=0;x--) { + int xb; + for(xb=7;xb>=0;xb--) { + for(y=0;y>xb)) { + *xmax = x*8+xb; + break; + } + } + if(y=0;y--) { + for(x=0;x Testing new text data against current bitmap data, state=%s, counter=%d\n", STATE_NAME[layerstate], dbg_btm_counter); + GBool ret = false; - if(intersection(x1,y1,x2,y2)) { + if(intersection(booltextbitmap, stalepolybitmap, x1,y1,x2,y2)) { if(layerstate==STATE_PARALLEL) { - /* the new text is above the bitmap. So record that fact, - and also clear the bitmap buffer, so we can check for - new intersections */ + /* the new text is above the bitmap. So record that fact. */ msg(" Text is above current bitmap/polygon data"); layerstate=STATE_TEXT_IS_ABOVE; - clearBoolPolyDev(x1,y1,x2,y2); + update_bitmap(staletextbitmap, booltextbitmap, x1, y1, x2, y2, 0); } else if(layerstate==STATE_BITMAP_IS_ABOVE) { /* there's a bitmap above the (old) text. So we need to flush out that text, and record that the *new* @@ -448,72 +661,123 @@ msg(" Text is above current bitmap/polygon data (which is above some other text)"); flushText(); layerstate=STATE_TEXT_IS_ABOVE; - /* clear both bool devices- the text device because - we just dumped out all the (old) text, and the - poly dev so we can check for new intersections */ - clearBoolPolyDev(x1,y1,x2,y2); - /* FIXME this destroys the text pixels we just - drew to test for the intersection- however we need - those to check for the *new* intersections */ - clearBoolTextDev(x1,y1,x2,y2); + + clearBoolTextDev(); + /* re-apply the update (which we would otherwise lose) */ + update_bitmap(staletextbitmap, booltextbitmap, x1, y1, x2, y2, 1); ret = true; } else { /* we already know that the current text section is above the current bitmap section- now just new bitmap data *and* new text data was drawn, and - *again* it's above the current bitmap- so clear - the polygon bitmap again, so we can check for - new intersections */ + *again* it's above the current bitmap. */ msg(" Text is still above current bitmap/polygon data"); - clearBoolPolyDev(x1,y1,x2,y2); + update_bitmap(staletextbitmap, booltextbitmap, x1, y1, x2, y2, 0); } - } + } else { + update_bitmap(staletextbitmap, booltextbitmap, x1, y1, x2, y2, 0); + } + + /* clear the thing we just drew from our temporary drawing bitmap */ + clearBooleanBitmap(booltextbitmap, x1, y1, x2, y2); + +#ifdef DEBUG + if(intersection(booltextbitmap, booltextbitmap, UNKNOWN_BOUNDING_BOX)) { + msg(" Text bitmap is not empty after clear. Bad bounding box?"); + exit(1); + } + clearBooleanBitmap(booltextbitmap, UNKNOWN_BOUNDING_BOX); +#endif return ret; } - GBool BitmapOutputDev::checkNewBitmap(int x1, int y1, int x2, int y2) { /* similar to checkNewText() above, only in reverse */ msg(" Testing new graphics data against current text data, state=%s, counter=%d\n", STATE_NAME[layerstate], dbg_btm_counter); - if(0) { - char filename1[80]; - char filename2[80]; - char filename3[80]; - sprintf(filename1, "state%dboolbitmap_afternewgfx.png", dbg_btm_counter); - sprintf(filename2, "state%dbooltext_afternewgfx.png", dbg_btm_counter); - sprintf(filename3, "state%dbitmap_afternewgfx.png", dbg_btm_counter); - msg(" %s %s %s", filename1, filename2, filename3); - writeAlpha(boolpolybitmap, filename1); - writeAlpha(booltextbitmap, filename2); - writeBitmap(rgbdev->getBitmap(), filename3); - } - dbg_btm_counter++; - GBool ret = false; - if(intersection(x1,y1,x2,y2)) { + if(intersection(boolpolybitmap, staletextbitmap, x1,y1,x2,y2)) { if(layerstate==STATE_PARALLEL) { msg(" Bitmap is above current text data"); layerstate=STATE_BITMAP_IS_ABOVE; - clearBoolTextDev(x1,y1,x2,y2); + update_bitmap(stalepolybitmap, boolpolybitmap, x1, y1, x2, y2, 0); } else if(layerstate==STATE_TEXT_IS_ABOVE) { msg(" Bitmap is above current text data (which is above some bitmap)"); flushBitmap(); layerstate=STATE_BITMAP_IS_ABOVE; - clearBoolTextDev(x1,y1,x2,y2); - /* FIXME this destroys the polygon pixels we just - drew to test for the intersection- however we need - those to check for the *new* intersections */ - clearBoolPolyDev(x1,y1,x2,y2); + clearBoolPolyDev(); + update_bitmap(stalepolybitmap, boolpolybitmap, x1, y1, x2, y2, 1); ret = true; } else { msg(" Bitmap is still above current text data"); - clearBoolTextDev(x1,y1,x2,y2); + update_bitmap(stalepolybitmap, boolpolybitmap, x1, y1, x2, y2, 0); } - } + } else { + update_bitmap(stalepolybitmap, boolpolybitmap, x1, y1, x2, y2, 0); + } + + /* clear the thing we just drew from our temporary drawing bitmap */ + clearBooleanBitmap(boolpolybitmap, x1, y1, x2, y2); + +#ifdef DEBUG + if(intersection(boolpolybitmap, boolpolybitmap, UNKNOWN_BOUNDING_BOX)) { + writeAlpha(boolpolybitmap, "notempty.png"); + msg(" Polygon bitmap is not empty after clear. Bad bounding box?"); + int _x1, _y1, _x2, _y2; + getBitmapBBox(boolpolybitmap, &_x1, &_y1, &_x2, &_y2); + printf("expected: %d %d %d %d <=> real: %d %d %d %d (%d,%d)\n", + x1, y1, x2, y2, _x1, _y1, _x2, _y2, movex, movey); + exit(1); + } + clearBooleanBitmap(boolpolybitmap, UNKNOWN_BOUNDING_BOX); +#endif return ret; } +void scan_bitmap(SplashBitmap*bitmap) +{ + int width = bitmap->getWidth(); + int width8 = (width+7)/8; + int height = bitmap->getHeight(); + + int x,y; + int x1=width,y1=height,x2=0,y2=0; + for(y=0;ygetDataPtr() + y*width8; + for(x=0;xy2) y2=y; + int x8; + for(x8=0;x8<8;x8++) { + if((b[x]<=0;x--) { + if(b[x]) { + int x8; + for(x8=7;x8>=0;x8--) { + if((b[x]<x2) x2 = x; + break; + } + } + } + if(x1>x2 || y1>y2) { + printf("bitmap is empty\n"); + } else { + printf("bounding box of bitmap is %d,%d,%d,%d\n", x1, y1, x2, y2); + } +} + //void checkNewText() { // Guchar*alpha = rgbbitmap->getAlphaPtr(); // Guchar*charpixels = clip1bitmap->getDataPtr(); @@ -532,29 +796,6 @@ // break; //} -static inline GBool fixBBox(int*x1, int*y1, int*x2, int*y2, int width, int height) -{ - if(!(*x1|*y1|*x2|*y2)) { - // undefined bbox - *x1 = *y1 = 0; - *x2 = width; - *y2 = height; - return gTrue; - } - if(*x2<=*x1) return gFalse; - if(*x2<0) return gFalse; - if(*x1<0) *x1 = 0; - if(*x1>=width) return gFalse; - if(*x2>width) *x2=width; - - if(*y2<=*y1) return gFalse; - if(*y2<0) return gFalse; - if(*y1<0) *y1 = 0; - if(*y1>=height) return gFalse; - if(*y2>height) *y2=height; - return gTrue; -} - GBool BitmapOutputDev::clip0and1differ(int x1,int y1,int x2,int y2) { if(clip0bitmap->getMode()==splashModeMono1) { @@ -616,31 +857,12 @@ } } -static void clearBooleanBitmap(SplashBitmap*btm, int x1, int y1, int x2, int y2) -{ - if(!(x1|y1|x2|y2)) { - x1 = y1 = 0; - x2 = btm->getWidth(); - y2 = btm->getHeight(); - } - if(btm->getMode()==splashModeMono1) { - int width8 = (btm->getWidth()+7)/8; - int width = btm->getWidth(); - int height = btm->getHeight(); - memset(btm->getDataPtr(), 0, width8*height); - } else { - int width = btm->getAlphaRowSize(); - int height = btm->getHeight(); - memset(btm->getAlphaPtr(), 0, width*height); - } -} - GBool compare8(unsigned char*data1, unsigned char*data2, int len) { if(!len) return 0; if(((ptroff_t)data1&7)==((ptroff_t)data2&7)) { - // oh good, we can do aligning + // oh good, we can align both to 8 byte while((ptroff_t)data1&7) { if(*data1&*data2) return 1; @@ -673,11 +895,8 @@ return 0; } -GBool BitmapOutputDev::intersection(int x1, int y1, int x2, int y2) +GBool BitmapOutputDev::intersection(SplashBitmap*boolpoly, SplashBitmap*booltext, int x1, int y1, int x2, int y2) { - SplashBitmap*boolpoly = boolpolybitmap; - SplashBitmap*booltext = booltextbitmap; - if(boolpoly->getMode()==splashModeMono1) { /* alternative implementation, using one bit per pixel- needs the no-dither patch in xpdf */ @@ -714,10 +933,11 @@ int x,y; unsigned char*data1 = (unsigned char*)polypixels; unsigned char*data2 = (unsigned char*)textpixels; - msg(" Testing area (%d,%d,%d,%d), runx=%d,runy=%d", x1,y1,x2,y2, runx, runy); + msg(" Testing area (%d,%d,%d,%d), runx=%d,runy=%d,state=%d", x1,y1,x2,y2, runx, runy, dbg_btm_counter); for(y=0;y Bad bounding box: intersection outside bbox"); msg(" given bbox: %d %d %d %d", x1, y1, x2, y2); msg(" changed area: %d %d %d %d", ax1, ay1, ax2, ay2); - //writeAlpha(booltextbitmap, "alpha.png"); } return overlap2; } } +GBool BitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data), + void *abortCheckCbkData) +{ + this->setPage(page); + gfxdev->setPage(page); + return gTrue; +} -void BitmapOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2) +void BitmapOutputDev::beginPage(GfxState *state, int pageNum) { - double x1,y1,x2,y2; - state->transform(crop_x1,crop_y1,&x1,&y1); - state->transform(crop_x2,crop_y2,&x2,&y2); - if(x2movex = -(int)x1 - user_movex; - this->movey = -(int)y1 - user_movey; - - if(user_clipx1|user_clipy1|user_clipx2|user_clipy2) { - x1 = user_clipx1; - x2 = user_clipx2; - y1 = user_clipy1; - y2 = user_clipy2; - } - this->width = (int)(x2-x1); - this->height = (int)(y2-y1); - - msg(" startPage"); - rgbdev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); - boolpolydev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); - booltextdev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); - clip0dev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); - clip1dev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); - gfxdev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); + rgbdev->startPage(pageNum, state); + boolpolydev->startPage(pageNum, state); + booltextdev->startPage(pageNum, state); + clip0dev->startPage(pageNum, state); + clip1dev->startPage(pageNum, state); + gfxdev->startPage(pageNum, state); boolpolybitmap = boolpolydev->getBitmap(); + stalepolybitmap = new SplashBitmap(boolpolybitmap->getWidth(), boolpolybitmap->getHeight(), 1, boolpolybitmap->getMode(), 0); + assert(stalepolybitmap->getRowSize() == boolpolybitmap->getRowSize()); + booltextbitmap = booltextdev->getBitmap(); + staletextbitmap = new SplashBitmap(booltextbitmap->getWidth(), booltextbitmap->getHeight(), 1, booltextbitmap->getMode(), 0); + assert(staletextbitmap->getRowSize() == booltextbitmap->getRowSize()); + + msg(" startPage %dx%d (%dx%d)", this->width, this->height, booltextbitmap->getWidth(), booltextbitmap->getHeight()); + clip0bitmap = clip0dev->getBitmap(); clip1bitmap = clip1dev->getBitmap(); rgbbitmap = rgbdev->getBitmap(); @@ -809,8 +1028,8 @@ /* just in case any device did draw a white background rectangle into the device */ - clearBoolTextDev(UNKNOWN_BOUNDING_BOX); - clearBoolPolyDev(UNKNOWN_BOUNDING_BOX); + clearBoolTextDev(); + clearBoolPolyDev(); this->layerstate = STATE_PARALLEL; this->emptypage = 1; @@ -820,22 +1039,14 @@ void BitmapOutputDev::endPage() { msg(" endPage (BitmapOutputDev)"); - - /* notice: we're not fully done yet with this page- there might still be - a few calls to drawLink() yet to come */ } void BitmapOutputDev::finishPage() { msg(" finishPage (BitmapOutputDev)"); + + flushEverything(); gfxdev->endPage(); - - if(layerstate == STATE_BITMAP_IS_ABOVE) { - this->flushText(); - this->flushBitmap(); - } else { - this->flushBitmap(); - this->flushText(); - } + flushEverything(); /* splash will now destroy alpha, and paint the background color into the "holes" in the bitmap */ @@ -908,15 +1119,6 @@ clip1dev->needNonText(); return rgbdev->needNonText(); } -/*GBool BitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI, - int rotate, GBool useMediaBox, GBool crop, - int sliceX, int sliceY, int sliceW, int sliceH, - GBool printing, Catalog *catalog, - GBool (*abortCheckCbk)(void *data), - void *abortCheckCbkData) -{ - return gTrue; -}*/ void BitmapOutputDev::setDefaultCTM(double *ctm) { boolpolydev->setDefaultCTM(ctm); @@ -1211,15 +1413,6 @@ gfxdev->updateTextShift(state, shift); } -double max(double x, double y) -{ - return x>y?x:y; -} -double min(double x, double y) -{ - return xgetPath(); @@ -1239,10 +1432,10 @@ bbox.xmax = x; bbox.ymax = y; valid = 1; } else { - bbox.xmin = min(bbox.xmin, x); - bbox.ymin = min(bbox.ymin, y); - bbox.xmax = max(bbox.xmax, x); - bbox.ymax = max(bbox.ymax, y); + bbox.xmin = fmin(bbox.xmin, x); + bbox.ymin = fmin(bbox.ymin, y); + bbox.xmax = fmax(bbox.xmax, x); + bbox.ymax = fmax(bbox.ymax, y); } } } @@ -1254,57 +1447,83 @@ msg(" stroke"); boolpolydev->stroke(state); gfxbbox_t bbox = getBBox(state); - double width = state->getTransformedLineWidth(); + double width = ceil(state->getTransformedLineWidth()); bbox.xmin -= width; bbox.ymin -= width; bbox.xmax += width; bbox.ymax += width; checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); rgbdev->stroke(state); + dbg_newdata("stroke"); +} + +char area_is_plain_colored(GfxState*state, SplashBitmap*boolpoly, SplashBitmap*rgbbitmap, int x1, int y1, int x2, int y2) +{ + int width = boolpoly->getWidth(); + int height = boolpoly->getHeight(); + if(!fixBBox(&x1, &y1, &x2, &y2, width, height)) { + return 0; + } + gfxcolor_t color = gfxstate_getfillcolor(state); + SplashColorPtr rgb = rgbbitmap->getDataPtr() + + (y1*width+x1)*sizeof(SplashColor); + int width8 = (width+7)/8; + unsigned char*bits = (unsigned char*)boolpoly->getDataPtr() + + (y1*width8+x1); + int x,y; + int w = x2-x1; + int h = y2-y1; + for(y=0;y fill"); boolpolydev->fill(state); gfxbbox_t bbox = getBBox(state); - if(checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax))) { - boolpolydev->fill(state); + if(config_optimizeplaincolorfills) { + if(area_is_plain_colored(state, boolpolybitmap, rgbbitmap, bbox.xmin, bbox.ymin, bbox.xmax, bbox.ymax)) { + return; + } } + checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); rgbdev->fill(state); + dbg_newdata("fill"); } void BitmapOutputDev::eoFill(GfxState *state) { msg(" eoFill"); boolpolydev->eoFill(state); gfxbbox_t bbox = getBBox(state); - if(checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax))) { - boolpolydev->eoFill(state); - } + checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); rgbdev->eoFill(state); + dbg_newdata("eofill"); } -#if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207 -void BitmapOutputDev::tilingPatternFill(GfxState *state, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep) -{ - msg(" tilingPatternFill"); - boolpolydev->tilingPatternFill(state, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); - checkNewBitmap(UNKNOWN_BOUNDING_BOX); - rgbdev->tilingPatternFill(state, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); -} -#else -void BitmapOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, Object *str, + +POPPLER_TILING_PATERN_RETURN BitmapOutputDev::tilingPatternFill(GfxState *state, POPPLER_TILING_PATERN_GFX Object *str, int paintType, Dict *resDict, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) { msg(" tilingPatternFill"); - boolpolydev->tilingPatternFill(state, gfx, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); + boolpolydev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat, + bbox, x0, y0, x1, y1, xStep, yStep); checkNewBitmap(UNKNOWN_BOUNDING_BOX); - rgbdev->tilingPatternFill(state, gfx, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); -} + rgbdev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat, + bbox, x0, y0, x1, y1, xStep, yStep); + dbg_newdata("tilingpatternfill"); +#ifdef HAVE_POPPLER + return gTrue; #endif +} GBool BitmapOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) { @@ -1313,19 +1532,21 @@ checkNewBitmap(UNKNOWN_BOUNDING_BOX); return rgbdev->functionShadedFill(state, shading); } -GBool BitmapOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading) + +GBool BitmapOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading POPPLER_RAXIAL_MIN_MAX) { msg(" axialShadedFill"); - boolpolydev->axialShadedFill(state, shading); + boolpolydev->axialShadedFill(state, shading POPPLER_RAXIAL_MIN_MAX_ARG); checkNewBitmap(UNKNOWN_BOUNDING_BOX); - return rgbdev->axialShadedFill(state, shading); + return rgbdev->axialShadedFill(state, shading POPPLER_RAXIAL_MIN_MAX_ARG); } -GBool BitmapOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading) + +GBool BitmapOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading POPPLER_RAXIAL_MIN_MAX) { msg(" radialShadedFill"); - boolpolydev->radialShadedFill(state, shading); + boolpolydev->radialShadedFill(state, shading POPPLER_RAXIAL_MIN_MAX_ARG); checkNewBitmap(UNKNOWN_BOUNDING_BOX); - return rgbdev->radialShadedFill(state, shading); + return rgbdev->radialShadedFill(state, shading POPPLER_RAXIAL_MIN_MAX_ARG); } SplashColor black = {0,0,0}; @@ -1363,6 +1584,7 @@ clip1dev->beginStringOp(state); booltextdev->beginStringOp(state); gfxdev->beginStringOp(state); + this->gfxdev->setDevice(this->gfxoutput_string); } void BitmapOutputDev::beginString(GfxState *state, GString *s) { @@ -1371,21 +1593,91 @@ clip1dev->beginString(state, s); booltextdev->beginString(state, s); gfxdev->beginString(state, s); + text_x1 = INT_MAX; + text_y1 = INT_MAX; + text_x2 = INT_MIN; + text_y2 = INT_MIN; } -void BitmapOutputDev::clearClips() +void BitmapOutputDev::clearClips(int x1, int y1, int x2, int y2) { - clearBooleanBitmap(clip0bitmap, 0, 0, 0, 0); - clearBooleanBitmap(clip1bitmap, 0, 0, 0, 0); + clearBooleanBitmap(clip0bitmap, x1,y1,x2,y2); + clearBooleanBitmap(clip1bitmap, x1,y1,x2,y2); } -void BitmapOutputDev::clearBoolPolyDev(int x1, int y1, int x2, int y2) +void BitmapOutputDev::clearBoolPolyDev() { - clearBooleanBitmap(boolpolybitmap, x1, y1, x2, y2); + clearBooleanBitmap(stalepolybitmap, 0, 0, stalepolybitmap->getWidth(), stalepolybitmap->getHeight()); } -void BitmapOutputDev::clearBoolTextDev(int x1, int y1, int x2, int y2) +void BitmapOutputDev::clearBoolTextDev() { - clearBooleanBitmap(booltextbitmap, x1, y1, x2, y2); + clearBooleanBitmap(staletextbitmap, 0, 0, staletextbitmap->getWidth(), staletextbitmap->getHeight()); } + +#define USE_GETGLYPH_BBOX + +static void getGlyphBbox(GfxState*state, SplashOutputDev*splash, double x, double y, double originX, double originY, CharCode code, int*_x1, int*_y1, int*_x2, int*_y2) +{ +#ifdef USE_GETGLYPH_BBOX + /* use getglyph to derive bounding box */ + if(splash->needFontUpdate) { + splash->doUpdateFont(state); + } + SplashGlyphBitmap glyph; + double xt,yt; + state->transform(x-originX, y-originY, &xt, &yt); + int x1 = (int)xt, x2 = (int)xt+1, y1 = (int)yt, y2 = (int)yt+1; + SplashFont*font = splash->getCurrentFont(); + int x0 = splashFloor(xt); + int xFrac = splashFloor((xt - x0) * splashFontFraction); + int y0 = splashFloor(yt); + int yFrac = splashFloor((yt - y0) * splashFontFraction); + + SplashCoord*matrix = font->getMatrix(); + + if(font && font->getGlyph(code, xFrac, yFrac, &glyph)) { + x1 = floor(x0-glyph.x); + y1 = floor(y0-glyph.y); + x2 = ceil(x0-glyph.x+glyph.w); + y2 = ceil(y0-glyph.y+glyph.h); + if (glyph.freeData) { + gfree(glyph.data); + } + } +#else + /* derive bounding box from the polygon path */ + double x0,y0; + state->transform(x-originX,y-originY,&x0,&y0); + int x1 = (int)x0, x2 = (int)x0+1, y1 = (int)y0, y2 = (int)y0+1; + SplashFont*font = clip0dev->getCurrentFont(); + SplashPath*path = font?font->getGlyphPath(code):NULL; + if(path) { + path->offset((SplashCoord)x, (SplashCoord)y); + int t; + for(t=0;tgetLength();t++) { + double xx,yy; + Guchar f; + path->getPoint(t,&xx,&yy,&f); + state->transform(xx,yy,&xx,&yy); + int px = (int)xx; + int py = (int)yy; + if(!t) { + x1=x2=px; + y1=y2=py; + } + if(xx=x2) x2=px+1; + if(yy>=y2) y2=py+1; + } + delete(path);path=0; + } +#endif + *_x1 = x1; + *_y1 = y1; + *_x2 = x2; + *_y2 = y2; +} + void BitmapOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, @@ -1393,8 +1685,24 @@ { msg(" drawChar render=%d", state->getRender()); + char render_as_bitmap = 0; + + if(config_skewedtobitmap) { + if(text_matrix_is_skewed(state)) { + render_as_bitmap = 1; + } + } + if(config_alphatobitmap) { + double opaq = state->getFillOpacity(); + if(opaq < 0.9) + render_as_bitmap = 1; + } + if((state->getRender()&3)) { + render_as_bitmap = 1; + } + if(state->getRender()&RENDER_CLIP) { - //char is just a clipping boundary + //char is, amongst others, a clipping boundary rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); boolpolydev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); booltextdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); @@ -1402,72 +1710,69 @@ } else if(rgbbitmap != rgbdev->getBitmap()) { // we're doing softmasking or transparency grouping boolpolydev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); - //checkNewBitmap(UNKNOWN_BOUNDING_BOX); rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); } else { // we're drawing a regular char - clearClips(); + int x1, y1, x2, y2; + + /* Calculate the bbox of this character (relative to splash's coordinate + system, which is offset from our coordinate system by (-movex,-movey)) + */ + getGlyphBbox(state, boolpolydev, x, y, originX, originY, code, &x1, &y1, &x2, &y2); + + if(x1 < text_x1) text_x1 = x1; + if(y1 < text_y1) text_y1 = y1; + if(x2 > text_x2) text_x2 = x2; + if(y2 > text_y2) text_y2 = y2; + + /* only clear the area we're going to check */ + clearClips(x1,y1,x2,y2); clip0dev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); clip1dev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); - - /* calculate the bbox of this character */ - int x1 = (int)x, x2 = (int)x+1, y1 = (int)y, y2 = (int)y+1; - SplashFont*font = clip0dev->getCurrentFont(); - SplashPath*path = font?font->getGlyphPath(code):NULL; - - if(!path) { - if(code) - msg(" couldn't create outline for char %d", code); - return; - } - x-=originX; - y-=originY; - path->offset((SplashCoord)x, (SplashCoord)y); - int t; - for(t=0;tgetLength();t++) { - double xx,yy; - Guchar f; - path->getPoint(t,&xx,&yy,&f); - state->transform(xx,yy,&xx,&yy); - if(xx=x2) x2=(int)xx+1; - if(yy>=y2) y2=(int)yy+1; - } + + int page_area_x1 = -this->movex; + int page_area_y1 = -this->movey; + int page_area_x2 = this->width-this->movex; + int page_area_y2 = this->height-this->movey; + char char_is_outside = (x1page_area_x2 || + y2>page_area_y2); /* if this character is affected somehow by the various clippings (i.e., it looks different on a device without clipping), then draw it on the bitmap, not as text */ - if(clip0and1differ(x1,y1,x2,y2)) { - msg(" Char %d is affected by clipping", code); + if(char_is_outside || render_as_bitmap || clip0and1differ(x1,y1,x2,y2)) { + + if(char_is_outside) msg(" Char %d is outside the page (%d,%d,%d,%d)", code, x1, y1, x2, y2); + else if(render_as_bitmap) msg(" Char %d needs to be rendered as bitmap", code); + else msg(" Char %d is affected by clipping", code); + boolpolydev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); checkNewBitmap(x1,y1,x2,y2); rgbdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); - if(config_extrafontdata) { + if(config_extrafontdata && render_as_bitmap) { + /* we draw invisible glyphs on top of the bitmap text for text selection. + We don't do this for clipped text, though- there's no way the pass 1 font + logic would know that the text will end up being clipped */ int oldrender = state->getRender(); state->setRender(3); //invisible gfxdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); state->setRender(oldrender); } } else { - /* this char is not at all affected by clipping. Now just dump out the bitmap we're currently working on, if necessary. */ booltextdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); - checkNewText(x1,y1,x2,y2); - /* use polygonal output device to do the actual text handling */ gfxdev->drawChar(state, x, y, dx, dy, originX, originY, code, nBytes, u, uLen); } } + dbg_newdata("text"); } void BitmapOutputDev::drawString(GfxState *state, GString *s) { msg(" internal error: drawString not implemented"); return; - clip0dev->drawString(state, s); - clip1dev->drawString(state, s); - booltextdev->drawString(state, s); - gfxdev->drawString(state, s); } void BitmapOutputDev::endTextObject(GfxState *state) { @@ -1479,6 +1784,7 @@ /* the only thing "drawn" here is clipping */ //checkNewText(UNKNOWN_BOUNDING_BOX); gfxdev->endTextObject(state); + dbg_newdata("endtextobject"); } void BitmapOutputDev::endString(GfxState *state) { @@ -1486,11 +1792,11 @@ clip0dev->endString(state); clip1dev->endString(state); booltextdev->endString(state); - int render = state->getRender(); - if(render != RENDER_INVISIBLE && render != RENDER_FILL) { - checkNewText(UNKNOWN_BOUNDING_BOX); - } gfxdev->endString(state); + dbg_newdata("endstring"); + checkNewText(text_x1,text_y1,text_x2,text_y2); + gfxdevice_record_flush(this->gfxoutput_string, this->gfxoutput, 0); + this->gfxdev->setDevice(this->gfxoutput); } void BitmapOutputDev::endStringOp(GfxState *state) { @@ -1499,6 +1805,7 @@ clip1dev->endStringOp(state); booltextdev->endStringOp(state); gfxdev->endStringOp(state); + dbg_newdata("endstringop"); } /* TODO: these four operations below *should* do nothing, as type3 @@ -1563,82 +1870,107 @@ double x,y; state->transform(0, 1, &x, &y); bbox.xmin=bbox.xmax = x; - bbox.ymin=bbox.ymax = x; + bbox.ymin=bbox.ymax = y; state->transform(0, 0, &x, &y); - bbox.xmin=min(bbox.xmin,x); - bbox.ymin=min(bbox.ymin,y); - bbox.xmax=max(bbox.xmin,x); - bbox.ymax=max(bbox.ymin,y); + bbox.xmin=fmin(bbox.xmin,x); + bbox.ymin=fmin(bbox.ymin,y); + bbox.xmax=fmax(bbox.xmax,x); + bbox.ymax=fmax(bbox.ymax,y); state->transform(1, 0, &x, &y); - bbox.xmin=min(bbox.xmin,x); - bbox.ymin=min(bbox.ymin,y); - bbox.xmax=max(bbox.xmin,x); - bbox.ymax=max(bbox.ymin,y); + bbox.xmin=fmin(bbox.xmin,x); + bbox.ymin=fmin(bbox.ymin,y); + bbox.xmax=fmax(bbox.xmax,x); + bbox.ymax=fmax(bbox.ymax,y); state->transform(1, 1, &x, &y); - bbox.xmin=min(bbox.xmin,x); - bbox.ymin=min(bbox.ymin,y); - bbox.xmax=max(bbox.xmin,x); - bbox.ymax=max(bbox.ymin,y); + bbox.xmin=fmin(bbox.xmin,x); + bbox.ymin=fmin(bbox.ymin,y); + bbox.xmax=fmax(bbox.xmax,x); + bbox.ymax=fmax(bbox.ymax,y); return bbox; } + +GBool invalid_size(int width, int height) +{ + if((U64)width*(U64)height > 0x7fffffffll) + return 1; + return 0; +} + void BitmapOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, - int width, int height, GBool invert, + int width, int height, GBool invert, POPPLER_INTERPOLATE GBool inlineImg) { msg(" drawImageMask streamkind=%d", str->getKind()); - CopyStream*cpystr = 0; - if(inlineImg) { - cpystr = new CopyStream(str, height * ((width + 7) / 8)); - str = cpystr->getStream(); - } - boolpolydev->drawImageMask(state, ref, str, width, height, invert, inlineImg); + if(invalid_size(width,height)) return; + + CopyStream*cpystr = new CopyStream(str, height * ((width + 7) / 8)); + str = cpystr->getStream(); + + boolpolydev->drawImageMask(state, ref, str, width, height, invert, POPPLER_INTERPOLATE_ARG inlineImg); gfxbbox_t bbox = getImageBBox(state); checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); - rgbdev->drawImageMask(state, ref, str, width, height, invert, inlineImg); - if(cpystr) - delete cpystr; + rgbdev->drawImageMask(state, ref, str, width, height, invert, POPPLER_INTERPOLATE_ARG inlineImg); + delete cpystr; + dbg_newdata("imagemask"); } void BitmapOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE int *maskColors, GBool inlineImg) { msg(" drawImage streamkind=%d", str->getKind()); - CopyStream*cpystr = 0; - if(inlineImg) { - cpystr = new CopyStream(str, height * ((width * colorMap->getNumPixelComps() * colorMap->getBits() + 7) / 8)); - str = cpystr->getStream(); - } - boolpolydev->drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); + if(invalid_size(width,height)) return; + + CopyStream*cpystr = new CopyStream(str, height * ((width * colorMap->getNumPixelComps() * colorMap->getBits() + 7) / 8)); + str = cpystr->getStream(); + + boolpolydev->drawImage(state, ref, str, width, height, colorMap, POPPLER_INTERPOLATE_ARG maskColors, inlineImg); gfxbbox_t bbox=getImageBBox(state); checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); - rgbdev->drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); - if(cpystr) - delete cpystr; + rgbdev->drawImage(state, ref, str, width, height, colorMap, POPPLER_INTERPOLATE_ARG maskColors, inlineImg); + delete cpystr; + dbg_newdata("image"); } void BitmapOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert) + GBool maskInvert POPPLER_MASK_INTERPOLATE) { msg(" drawMaskedImage streamkind=%d", str->getKind()); - boolpolydev->drawMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskInvert); + if(invalid_size(width,height)) return; + + CopyStream*cpystr = new CopyStream(str, height * ((width * colorMap->getNumPixelComps() * colorMap->getBits() + 7) / 8)); + str = cpystr->getStream(); + + boolpolydev->drawMaskedImage(state, ref, str, width, height, colorMap, POPPLER_INTERPOLATE_ARG maskStr, maskWidth, maskHeight, maskInvert POPPLER_MASK_INTERPOLATE_ARG); gfxbbox_t bbox=getImageBBox(state); checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); - rgbdev->drawMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskInvert); + rgbdev->drawMaskedImage(state, ref, str, width, height, colorMap, POPPLER_INTERPOLATE_ARG maskStr, maskWidth, maskHeight, maskInvert POPPLER_MASK_INTERPOLATE_ARG); + delete cpystr; + dbg_newdata("maskedimage"); } void BitmapOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap) + GfxImageColorMap *maskColorMap POPPLER_MASK_INTERPOLATE) { msg(" drawSoftMaskedImage %dx%d (%dx%d) streamkind=%d", width, height, maskWidth, maskHeight, str->getKind()); - boolpolydev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskColorMap); + if(invalid_size(width,height)) return; + + CopyStream*cpystr = new CopyStream(str, height * ((width * colorMap->getNumPixelComps() * colorMap->getBits() + 7) / 8)); + str = cpystr->getStream(); + + boolpolydev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, POPPLER_INTERPOLATE_ARG maskStr, maskWidth, maskHeight, maskColorMap POPPLER_MASK_INTERPOLATE_ARG); gfxbbox_t bbox=getImageBBox(state); checkNewBitmap(bbox.xmin, bbox.ymin, ceil(bbox.xmax), ceil(bbox.ymax)); - rgbdev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskColorMap); + rgbdev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, POPPLER_INTERPOLATE_ARG maskStr, maskWidth, maskHeight, maskColorMap POPPLER_MASK_INTERPOLATE_ARG); + delete cpystr; + dbg_newdata("softmaskimage"); } void BitmapOutputDev::drawForm(Ref id) { @@ -1653,6 +1985,16 @@ msg(" processLink"); gfxdev->processLink(link, catalog); } +void BitmapOutputDev::flushEverything() +{ + if(layerstate == STATE_BITMAP_IS_ABOVE) { + this->flushText(); + this->flushBitmap(); + } else { + this->flushBitmap(); + this->flushText(); + } +} void BitmapOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, GfxColorSpace *blendingColorSpace, @@ -1676,6 +2018,7 @@ clip1dev->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, forSoftMask); delete state1; delete state2; + dbg_newdata("endtransparencygroup"); } void BitmapOutputDev::endTransparencyGroup(GfxState *state) { @@ -1697,6 +2040,7 @@ delete state1; delete state2; clip1dev->endTransparencyGroup(state); + dbg_newdata("endtransparencygroup"); } void BitmapOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) { @@ -1705,6 +2049,7 @@ checkNewBitmap(UNKNOWN_BOUNDING_BOX); rgbdev->paintTransparencyGroup(state,bbox); clip1dev->paintTransparencyGroup(state,bbox); + dbg_newdata("painttransparencygroup"); } void BitmapOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor) { @@ -1713,6 +2058,7 @@ checkNewBitmap(UNKNOWN_BOUNDING_BOX); rgbdev->setSoftMask(state, bbox, alpha, transferFunc, backdropColor); clip1dev->setSoftMask(state, bbox, alpha, transferFunc, backdropColor); + dbg_newdata("setsoftmask"); } void BitmapOutputDev::clearSoftMask(GfxState *state) { @@ -1721,4 +2067,5 @@ checkNewBitmap(UNKNOWN_BOUNDING_BOX); rgbdev->clearSoftMask(state); clip1dev->clearSoftMask(state); + dbg_newdata("clearsoftmask"); } diff -Nru swftools-0.9.0/lib/pdf/BitmapOutputDev.h swftools-0.9.2/lib/pdf/BitmapOutputDev.h --- swftools-0.9.0/lib/pdf/BitmapOutputDev.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/BitmapOutputDev.h 2011-01-02 03:30:29.000000000 +0000 @@ -24,11 +24,12 @@ #include "../gfxsource.h" #include "../gfxtools.h" -#include "config.h" -#include "GFXOutputDev.h" +#include "../../config.h" +#include "CharOutputDev.h" #include "InfoOutputDev.h" #include "PDFDoc.h" #include "CommonOutputDev.h" +#include "popplercompat.h" struct ClipState { @@ -44,15 +45,14 @@ class BitmapOutputDev: public CommonOutputDev { public: - BitmapOutputDev(InfoOutputDev*info, PDFDoc*doc); + BitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2); virtual ~BitmapOutputDev(); + + virtual void dbg_newdata(char*newdata); // CommonOutputDev: virtual void setDevice(gfxdevice_t*dev); - virtual void setMove(int x,int y); - virtual void setClip(int x1,int y1,int x2,int y2); virtual void setParameter(const char*key, const char*value); - virtual void setPageMap(int*page2page, int pagemap_size); // OutputDev: virtual GBool upsideDown(); @@ -63,14 +63,14 @@ virtual GBool interpretType3Chars(); virtual GBool needNonText(); virtual void setDefaultCTM(double *ctm); -/* virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, + virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, int rotate, GBool useMediaBox, GBool crop, int sliceX, int sliceY, int sliceW, int sliceH, GBool printing, Catalog *catalog, GBool (*abortCheckCbk)(void *data) = NULL, - void *abortCheckCbkData = NULL);*/ + void *abortCheckCbkData = NULL); - virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2); + virtual void beginPage(GfxState *state, int pageNum); virtual void endPage(); virtual void finishPage(); @@ -109,24 +109,17 @@ virtual void stroke(GfxState *state); virtual void fill(GfxState *state); virtual void eoFill(GfxState *state); -#if (xpdfMajorVersion < 3) || (xpdfMinorVersion < 2) || (xpdfUpdateVersion < 7) - virtual void tilingPatternFill(GfxState *state, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep); -#else - virtual void tilingPatternFill(GfxState *state, Gfx *gfx, Object *str, + virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill( + GfxState *state, POPPLER_TILING_PATERN_GFX Object *str, int paintType, Dict *resDict, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep); -#endif virtual GBool functionShadedFill(GfxState *state, GfxFunctionShading *shading); - virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading); - virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading); + virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading POPPLER_RAXIAL_MIN_MAX); + virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading POPPLER_RAXIAL_MIN_MAX); virtual void clip(GfxState *state); virtual void eoClip(GfxState *state); @@ -149,21 +142,27 @@ virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, + POPPLER_INTERPOLATE GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE int *maskColors, GBool inlineImg); virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert); + GBool maskInvert + POPPLER_MASK_INTERPOLATE); virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap); + GfxImageColorMap *maskColorMap + POPPLER_MASK_INTERPOLATE); virtual void type3D0(GfxState *state, double wx, double wy); virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury); @@ -186,28 +185,32 @@ private: - void clearClips(); - void clearBoolPolyDev(int x1, int y1, int x2, int y2); - void clearBoolTextDev(int x1, int y1, int x2, int y2); + void flushEverything(); + void clearClips(int x1, int y1, int x2, int y2); + void clearBoolPolyDev(); + void clearBoolTextDev(); void flushText(); void flushBitmap(); GBool checkNewText(int x1, int y1, int x2, int y2); GBool checkNewBitmap(int x1, int y1, int x2, int y2); GBool clip0and1differ(int x1,int y1,int x2,int y2); - GBool intersection(int x1,int y1,int x2,int y2); + GBool intersection(SplashBitmap*boolpoly, SplashBitmap*booltext, int x1, int y1, int x2, int y2); virtual gfxbbox_t getImageBBox(GfxState*state); virtual gfxbbox_t getBBox(GfxState*state); char config_extrafontdata; + char config_optimizeplaincolorfills; + char config_skewedtobitmap; + char config_alphatobitmap; + + int text_x1,text_y1,text_x2,text_y2; int layerstate; GBool emptypage; SplashPath*bboxpath; - PDFDoc*doc; - XRef*xref; SplashOutputDev*rgbdev; SplashOutputDev*clip0dev; SplashOutputDev*clip1dev; @@ -218,20 +221,15 @@ SplashBitmap*clip0bitmap; SplashBitmap*clip1bitmap; SplashBitmap*boolpolybitmap; + SplashBitmap*stalepolybitmap; SplashBitmap*booltextbitmap; + SplashBitmap*staletextbitmap; gfxdevice_t* gfxoutput; - GFXOutputDev*gfxdev; - InfoOutputDev*info; + gfxdevice_t* gfxoutput_string; + CharOutputDev*gfxdev; gfxdevice_t*dev; - int movex, movey; - int width, height; - - int user_movex, user_movey; - int user_clipx1, user_clipy1; - int user_clipx2, user_clipy2; - //ClipState*clipstates; }; diff -Nru swftools-0.9.0/lib/pdf/CharOutputDev.cc swftools-0.9.2/lib/pdf/CharOutputDev.cc --- swftools-0.9.0/lib/pdf/CharOutputDev.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/CharOutputDev.cc 2012-04-19 11:31:50.000000000 +0000 @@ -0,0 +1,1332 @@ +/* CharOutputDev.cc + implements a pdf output device (OutputDev). + + This file is part of swftools. + + Swftools 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. + + Swftools 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. + + You should have received a copy of the GNU General Public License + along with swftools; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include + +#include "../../config.h" +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_DIRENT_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_FONTCONFIG +#include +#endif + +// xpdf header files +#include "popplercompat.h" +#include "CharOutputDev.h" + +// swftools header files +#include "../os.h" +#include "../log.h" +#include "../mem.h" +#include "../utf8.h" +#include "../gfxdevice.h" +#include "../gfxtools.h" +#include "../gfxfont.h" +#include "../gfxpoly.h" +#include "../devices/record.h" +#include "../devices/ops.h" +#include "../devices/polyops.h" +#include "../devices/render.h" +#include "../png.h" + +// linked-in font data +#include "fonts.h" + +typedef struct _fontfile +{ + const char*filename; + int len; // basename length + int used; + struct _fontfile*next; +} fontfile_t; + +// for pdfswf_addfont +static fontfile_t* global_fonts = 0; +static fontfile_t* global_fonts_next = 0; + +static int fontnum = 0; + +/* config */ +struct fontentry { + const char*pdffont; + const char*filename; + char*afm; + int afmlen; + char*pfb; + int pfblen; + char*fullfilename; + DisplayFontParam *dfp; +} pdf2t1map[] ={ +{"Times-Roman", "n021003l", n021003l_afm, n021003l_afm_len, n021003l_pfb, n021003l_pfb_len}, +{"Times-Italic", "n021023l", n021023l_afm, n021023l_afm_len, n021023l_pfb, n021023l_pfb_len}, +{"Times-Bold", "n021004l", n021004l_afm, n021004l_afm_len, n021004l_pfb, n021004l_pfb_len}, +{"Times-BoldItalic", "n021024l", n021024l_afm, n021024l_afm_len, n021024l_pfb, n021024l_pfb_len}, +{"Helvetica", "n019003l", n019003l_afm, n019003l_afm_len, n019003l_pfb, n019003l_pfb_len}, +{"Helvetica-Oblique", "n019023l", n019023l_afm, n019023l_afm_len, n019023l_pfb, n019023l_pfb_len}, +{"Helvetica-Bold", "n019004l", n019004l_afm, n019004l_afm_len, n019004l_pfb, n019004l_pfb_len}, +{"Helvetica-BoldOblique", "n019024l", n019024l_afm, n019024l_afm_len, n019024l_pfb, n019024l_pfb_len}, +{"Courier", "n022003l", n022003l_afm, n022003l_afm_len, n022003l_pfb, n022003l_pfb_len}, +{"Courier-Oblique", "n022023l", n022023l_afm, n022023l_afm_len, n022023l_pfb, n022023l_pfb_len}, +{"Courier-Bold", "n022004l", n022004l_afm, n022004l_afm_len, n022004l_pfb, n022004l_pfb_len}, +{"Courier-BoldOblique", "n022024l", n022024l_afm, n022024l_afm_len, n022024l_pfb, n022024l_pfb_len}, +{"Symbol", "s050000l", s050000l_afm, s050000l_afm_len, s050000l_pfb, s050000l_pfb_len}, +{"ZapfDingbats", "d050000l", d050000l_afm, d050000l_afm_len, d050000l_pfb, d050000l_pfb_len}}; + + +typedef struct _drawnchar +{ + gfxcoord_t x,y; + int charid; + gfxcolor_t color; +} drawnchar_t; + +class CharBuffer +{ + drawnchar_t * chars; + int buf_size; + int num_chars; + +public: + + CharBuffer() + { + buf_size = 32; + chars = (drawnchar_t*)malloc(sizeof(drawnchar_t)*buf_size); + memset(chars, 0, sizeof(drawnchar_t)*buf_size); + num_chars = 0; + } + ~CharBuffer() + { + free(chars);chars = 0; + } + + void grow(int size) + { + if(size>=buf_size) { + buf_size += 32; + chars = (drawnchar_t*)realloc(chars, sizeof(drawnchar_t)*buf_size); + } + } + + void addChar(int charid, gfxcoord_t x, gfxcoord_t y, gfxcolor_t color) + { + grow(num_chars); + chars[num_chars].x = x; + chars[num_chars].y = y; + chars[num_chars].color = color; + chars[num_chars].charid = charid; + } +}; + +char* writeOutStdFont(fontentry* f) +{ + FILE*fi; + char namebuf1[512]; + char namebuf2[512]; + char* tmpFileName = mktmpname(namebuf1); + + sprintf(namebuf2, "%s.afm", tmpFileName); + fi = fopen(namebuf2, "wb"); + if(!fi) + return 0; + int written = fwrite(f->afm, 1, f->afmlen, fi); + if(written<0) + return 0; + fclose(fi); + + sprintf(namebuf2, "%s.pfb", tmpFileName); + fi = fopen(namebuf2, "wb"); + if(!fi) + return 0; + written = fwrite(f->pfb, 1, f->pfblen, fi); + if(written<0) + return 0; + fclose(fi); + return strdup(namebuf2); +} +void unlinkfont(char* filename) +{ + int l; + if(!filename) + return; + msg(" Removing temporary font file %s", filename); + l=strlen(filename); + unlink(filename); + if(!strncmp(&filename[l-4],".afm",4)) { + memcpy(&filename[l-4],".pfb",4); unlink(filename); + memcpy(&filename[l-4],".pfa",4); unlink(filename); + memcpy(&filename[l-4],".afm",4); + return; + } else + if(!strncmp(&filename[l-4],".pfa",4)) { + memcpy(&filename[l-4],".afm",4); unlink(filename); + memcpy(&filename[l-4],".pfa",4); + return; + } else + if(!strncmp(&filename[l-4],".pfb",4)) { + memcpy(&filename[l-4],".afm",4); unlink(filename); + memcpy(&filename[l-4],".pfb",4); + return; + } +} + +static int config_use_fontconfig = 1; +static int fcinitcalled = 0; + +GFXGlobalParams::GFXGlobalParams() +: GlobalParams((char*)"") +{ + //setupBaseFonts(char *dir); //not tested yet +} +GFXGlobalParams::~GFXGlobalParams() +{ + msg(" Performing cleanups"); + int t; + for(t=0;t=32 && *s1<=63) s1++; + while(*s2>=32 && *s2<=63) s2++; + if(*s1!=*s2) + break; + s1++;s2++; + } + return *s1 - *s2; +} + +static char fc_ismatch(FcPattern*match, char*family, char*style) +{ + char*fcfamily=0,*fcstyle=0,*fcfullname=0,*filename=0; + FcBool scalable=FcFalse, outline=FcFalse; + FcPatternGetString(match, "family", 0, (FcChar8**)&fcfamily); + FcPatternGetString(match, "style", 0, (FcChar8**)&fcstyle); + FcPatternGetString(match, "file", 0, (FcChar8**)&filename); + FcPatternGetBool(match, "outline", 0, &outline); + FcPatternGetBool(match, "scalable", 0, &scalable); + + if(scalable!=FcTrue || outline!=FcTrue) + return 0; + + if (!stralphacmp(fcfamily, family)) { + msg(" Font %s-%s (%s) is a match for %s%s%s", fcfamily, fcstyle, filename, family, style?"-":"", style?style:""); + return 1; + } else { + //msg(" Font %s-%s (%s) is NOT a match for %s%s%s", fcfamily, fcstyle, filename, family, style?"-":"", style?style:""); + return 0; + } +} +#endif + +static inline char islowercase(char c) +{ + return (c>='a' && c<='z'); +} + +char* fontconfig_searchForFont(char*name) +{ +#ifdef HAVE_FONTCONFIG + if(!config_use_fontconfig) + return 0; + + // call init ony once + if (!fcinitcalled) { + fcinitcalled = 1; + + // check whether we have a config file + char* configfile = (char*)FcConfigFilename(0); + int configexists = 0; + FILE*fi = fopen(configfile, "rb"); + if(fi) { + configexists = 1;fclose(fi); + msg(" Initializing FontConfig (configfile=%s)", configfile); + } else { + msg(" Initializing FontConfig (no configfile)"); + } + + if(!configexists) { + /* A fontconfig instance which didn't find a configfile is unbelievably + cranky, so let's just write out a small xml file and make fontconfig + happy */ + FcConfig*c = FcConfigCreate(); + char namebuf[512]; + char* tmpFileName = mktmpname(namebuf); + FILE*fi = fopen(tmpFileName, "wb"); + fprintf(fi, "\n\n");// +#ifdef WIN32 + fprintf(fi, "WINDOWSFONTDIR\n"); +#endif + fprintf(fi, "~/.fonts\n"); +#ifdef WIN32 + fprintf(fi, "WINDOWSTEMPDIR_FONTCONFIG_CACHE\n"); +#endif + fprintf(fi, "~/.fontconfig\n"); + fprintf(fi, "\n"); + fclose(fi); + FcConfigParseAndLoad(c, (FcChar8*)tmpFileName, 1); + FcConfigBuildFonts(c); + FcConfigSetCurrent(c); + } + + if(!FcInit()) { + msg(" FontConfig Initialization failed. Disabling."); + config_use_fontconfig = 0; + return 0; + } + FcConfig * config = FcConfigGetCurrent(); + if(!config) { + msg(" FontConfig Config Initialization failed. Disabling."); + config_use_fontconfig = 0; + return 0; + } + + /* add external fonts to fontconfig's config, too. */ + fontfile_t*fd = global_fonts; + while(fd) { + FcConfigAppFontAddFile(config, (FcChar8*)fd->filename); + msg(" Adding font %s to fontconfig", fd->filename); + fd = fd->next; + } + + FcFontSet * set = FcConfigGetFonts(config, FcSetSystem); + msg(" FontConfig initialized. Found %d fonts", set?set->nfont:0); + if(!set || !set->nfont) { + msg(" FontConfig has zero fonts. Disabling."); + config_use_fontconfig = 0; + return 0; + } + + if(getLogLevel() >= LOGLEVEL_TRACE) { + int t; + int p; + for(p=0;p<2;p++) { + if(set) { + for(t=0;tnfont;t++) { + char*fcfamily=0,*fcstyle=0,*filename=0; + FcBool scalable=FcFalse, outline=FcFalse; + FcPatternGetString(set->fonts[t], "family", 0, (FcChar8**)&fcfamily); + FcPatternGetString(set->fonts[t], "style", 0, (FcChar8**)&fcstyle); + FcPatternGetString(set->fonts[t], "file", 0, (FcChar8**)&filename); + FcPatternGetBool(set->fonts[t], "outline", 0, &outline); + FcPatternGetBool(set->fonts[t], "scalable", 0, &scalable); + if(scalable && outline) { + msg(" %s (%s) -> %s", fcfamily, fcstyle, filename); + } + } + } + set = FcConfigGetFonts(config, FcSetApplication); + } + } + } + + char*family = strdup(name); + int len = strlen(family); + + const char*styles[] = {"Medium", "Regular", "Bold", "Italic", "Black", "Narrow"}; + const char*style = 0; + int t; + for(t=0;tl+1 && !strcmp(family+len-l, styles[t]) && islowercase(family[len-l-1])) { + style = styles[t]; + family[len-l]=0; + break; + } + } + if(!style) { + char*dash = strchr(family, '-'); + if(!dash) dash = strchr(family, ','); + if(dash) { + *dash = 0; + style = dash+1; + } + } + FcPattern*pattern = 0; + if(style) { + msg(" FontConfig: Looking for font %s (family=%s style=%s)", name, family, style); + pattern = FcPatternBuild(NULL, FC_OUTLINE, FcTypeBool, FcTrue, FC_SCALABLE, FcTypeBool, FcTrue, FC_FAMILY, FcTypeString, family, FC_STYLE, FcTypeString, style, NULL); + } else { + msg(" FontConfig: Looking for font %s (family=%s)", name, family); + pattern = FcPatternBuild(NULL, FC_OUTLINE, FcTypeBool, FcTrue, FC_SCALABLE, FcTypeBool, FcTrue, FC_FAMILY, FcTypeString, family, NULL); + } + pattern = FcPatternBuild(NULL, FC_OUTLINE, FcTypeBool, FcTrue, FC_SCALABLE, FcTypeBool, FcTrue, FC_FAMILY, FcTypeString, family, NULL); + + FcResult result; + FcConfigSubstitute(0, pattern, FcMatchPattern); + FcDefaultSubstitute(pattern); + + FcFontSet*set = FcFontSort(0, pattern, 1, 0, &result); + if(set) { + int t; + for(t=0;tnfont;t++) { + FcPattern*match = set->fonts[t]; + //FcPattern*match = FcFontMatch(0, pattern, &result); + if(fc_ismatch(match, family, (char*)style)) { + char*filename=0; + if(FcPatternGetString(match, "file", 0, (FcChar8**)&filename) != FcResultMatch) { + msg(" FontConfig: Couldn't get fontconfig's filename for font %s", name); + filename=0; + } + //FcPatternDestroy(match); + msg(" fontconfig: returning filename %s", filename); + free(family); + FcPatternDestroy(pattern); + FcFontSetDestroy(set); + return filename?strdup(filename):0; + } + } + } + free(family); + FcPatternDestroy(pattern); + FcFontSetDestroy(set); + return 0; +#else + return 0; +#endif +} + +static DisplayFontParamKind detectFontType(const char*filename) +{ + if(strstr(filename, ".ttf") || strstr(filename, ".TTF")) + return displayFontTT; + if(strstr(filename, ".pfa") || strstr(filename, ".PFA") || strstr(filename, ".pfb")) + return displayFontT1; + return displayFontTT; +} + +DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName) +{ + msg(" looking for font %s", fontName->getCString()); + + char*name = fontName->getCString(); + + /* see if it is a pdf standard font */ + int t; + for(t=0;t Couldn't save default font- is the Temp Directory writable?"); + } else { + msg(" Storing standard PDF font %s at %s", name, pdf2t1map[t].fullfilename); + } + DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), displayFontT1); + dfp->t1.fileName = new GString(pdf2t1map[t].fullfilename); + pdf2t1map[t].dfp = dfp; + } + return pdf2t1map[t].dfp; + } + } + + int bestlen = 0x7fffffff; + const char*bestfilename = 0; + +#ifndef HAVE_FONTCONFIG + /* if we don't have fontconfig, try a simple filename-comparison approach */ + fontfile_t*f = global_fonts; + while(f) { + if(strstr(f->filename, name)) { + if(f->len < bestlen) { + bestlen = f->len; + bestfilename = f->filename; + } + } + f = f->next; + } +#endif + + /* if we didn't find anything up to now, try looking for the + font via fontconfig */ + char*filename = 0; + if(!bestfilename) { + filename = fontconfig_searchForFont(name); + } else { + filename = strdup(bestfilename); + } + + if(filename) { + msg(" Font %s maps to %s\n", name, filename); + DisplayFontParamKind kind = detectFontType(filename); + DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), kind); + if(kind == displayFontTT) { + dfp->tt.fileName = new GString(filename); + } else { + dfp->t1.fileName = new GString(filename); + } + free(filename); + return dfp; + } else { + msg(" Font %s not found\n", name); + return GlobalParams::getDisplayFont(fontName); + } +} + +DisplayFontParam *GFXGlobalParams::getDisplayCIDFont(GString *fontName, GString *collection) +{ + DisplayFontParam*dfp = GlobalParams::getDisplayCIDFont(fontName, collection); + if(!dfp) { + dfp = this->getDisplayFont(fontName); + } + return dfp; +} + +CharOutputDev::CharOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2) +:CommonOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2) +{ + this->type3active = 0; + this->xref = 0; + this->current_text_stroke = 0; + this->current_text_clip = 0; + this->config_bigchar=0; + this->config_extrafontdata = 0; + this->config_detectspaces = 1; + this->config_space_between_lines = 0; + this->config_linkdatafile = 0; + this->page2page = 0; + this->num_pages = 0; + this->links = 0; + this->last_link = 0; +}; + +CharOutputDev::~CharOutputDev() +{ +} + +void CharOutputDev::setParameter(const char*key, const char*value) +{ + if(!strcmp(key,"detectspaces")) { + this->config_detectspaces = atoi(value); + } else if(!strcmp(key,"space_between_lines")) { + this->config_space_between_lines = atoi(value); + } else if(!strcmp(key,"extrafontdata")) { + this->config_extrafontdata = atoi(value); + } else if(!strcmp(key,"linkdatafile")) { + this->config_linkdatafile = strdup(value); + } +} + +void CharOutputDev::setDevice(gfxdevice_t*dev) +{ + this->device = dev; +} + +static char*getFontName(GfxFont*font) +{ + char*fontid; + GString*gstr = font->getName(); + char* fname = gstr==0?0:gstr->getCString(); + if(fname==0) { + char buf[32]; + Ref*r=font->getID(); + sprintf(buf, "UFONT%d", r->num); + fontid = strdup(buf); + } else { + fontid = strdup(fname); + } + + char*fontname= 0; + char* plus = strchr(fontid, '+'); + if(plus && plus < &fontid[strlen(fontid)-1]) { + fontname = strdup(plus+1); + } else { + fontname = strdup(fontid); + } + free(fontid); + return fontname; +} + +static void dumpFontInfo(const char*loglevel, GfxFont*font); +static int lastdumps[1024]; +static int lastdumppos = 0; +/* nr = 0 unknown + nr = 1 substituting + nr = 2 type 3 + */ +static void showFontError(GfxFont*font, int nr) +{ + Ref*r=font->getID(); + int t; + for(t=0;tnum) + break; + if(t < lastdumppos) + return; + if(lastdumpposnum; + if(nr == 0) + msg(" The following font caused problems:"); + else if(nr == 1) + msg(" The following font caused problems (substituting):"); + else if(nr == 2) + msg(" The following Type 3 Font will be rendered as graphics:"); + dumpFontInfo("", font); +} + +static void dumpFontInfo(const char*loglevel, GfxFont*font) +{ + char* id = getFontID(font); + char* name = getFontName(font); + Ref* r=font->getID(); + msg("%s=========== %s (ID:%d,%d) ==========", loglevel, name, r->num,r->gen); + + GString*gstr = font->getTag(); + + msg("%s| Tag: %s", loglevel, id); + + if(font->isCIDFont()) msg("%s| is CID font", loglevel); + + GfxFontType type=font->getType(); + switch(type) { + case fontUnknownType: + msg("%s| Type: unknown",loglevel); + break; + case fontType1: + msg("%s| Type: 1",loglevel); + break; + case fontType1C: + msg("%s| Type: 1C",loglevel); + break; + case fontType3: + msg("%s| Type: 3",loglevel); + break; + case fontTrueType: + msg("%s| Type: TrueType",loglevel); + break; + case fontCIDType0: + msg("%s| Type: CIDType0",loglevel); + break; + case fontCIDType0C: + msg("%s| Type: CIDType0C",loglevel); + break; + case fontCIDType2: + msg("%s| Type: CIDType2",loglevel); + break; + } + + Ref embRef; + GBool embedded = font->getEmbeddedFontID(&embRef); + char*embeddedName=0; + if(font->getEmbeddedFontName()) { + embeddedName = font->getEmbeddedFontName()->getCString(); + } + if(embedded) + msg("%s| Embedded id: %s id: %d",loglevel, FIXNULL(embeddedName), embRef.num); + + gstr = font->getExtFontFile(); + if(gstr) + msg("%s| External Font file: %s", loglevel, FIXNULL(gstr->getCString())); + + // Get font descriptor flags. + if(font->isFixedWidth()) msg("%s| is fixed width", loglevel); + if(font->isSerif()) msg("%s| is serif", loglevel); + if(font->isSymbolic()) msg("%s| is symbolic", loglevel); + if(font->isItalic()) msg("%s| is italic", loglevel); + if(font->isBold()) msg("%s| is bold", loglevel); + + free(id); + free(name); +} + +GBool CharOutputDev::needNonText() +{ + return gFalse; +} + +void CharOutputDev::endPage() +{ + msg(" endPage (GfxOutputDev)"); + + if(this->links) { + kdtree_destroy(this->links); + this->links = 0; + } + GFXLink*l = this->last_link; + while(l) { + GFXLink*last = l->last; + l->draw(this,device); + delete l; + l = last; + } + this->last_link = 0; +} + +static inline double sqr(double x) {return x*x;} + +GBool CharOutputDev::upsideDown() +{ + return gTrue; +}; +GBool CharOutputDev::useDrawChar() +{ + return gTrue; +} + +const char*renderModeDesc[]= {"fill", "stroke", "fill+stroke", "invisible", + "clip+fill", "stroke+clip", "fill+stroke+clip", "clip"}; + +static char tmp_printstr[4096]; +char* makeStringPrintable(char*str) +{ + int len = strlen(str); + int dots = 0; + if(len>=80) { + len = 80; + dots = 1; + } + int t; + for(t=0;t124) { + c = '.'; + } + tmp_printstr[t] = c; + } + if(dots) { + tmp_printstr[len++] = '.'; + tmp_printstr[len++] = '.'; + tmp_printstr[len++] = '.'; + } + tmp_printstr[len] = 0; + return tmp_printstr; +} + +void CharOutputDev::updateTextMat(GfxState*state) +{ +} + +void CharOutputDev::beginString(GfxState *state, GString *s) +{ + int render = state->getRender(); + if(current_text_stroke) { + msg(" Error: Incompatible change of text rendering to %d while inside cliptext", render); + } + msg(" beginString(%s) render=%d", makeStringPrintable(s->getCString()), render); +} + +static gfxline_t* mkEmptyGfxShape(double x, double y) +{ + gfxline_t*line = (gfxline_t*)malloc(sizeof(gfxline_t)); + line->x = x;line->y = y;line->type = gfx_moveTo;line->next = 0; + return line; +} + +void CharOutputDev::drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode charid, int nBytes, Unicode *_u, int uLen) +{ + FontInfo*current_fontinfo = this->info->getFontInfo(state); + + if(!current_fontinfo || (unsigned)charid >= current_fontinfo->num_glyphs || !current_fontinfo->glyphs[charid]) { + msg(" Invalid charid %d for font %p (%d characters)", charid, current_fontinfo, current_fontinfo?current_fontinfo->num_glyphs:0); + return; + } + + gfxfont_t*current_gfxfont = current_fontinfo->getGfxFont(); + if(!current_fontinfo->seen) { + dumpFontInfo("", state->getFont()); + device->addfont(device, current_gfxfont); + current_fontinfo->seen = 1; + } + + CharCode glyphid = current_fontinfo->glyphs[charid]->glyphid; + + int render = state->getRender(); + gfxcolor_t col = gfxstate_getfillcolor(state); + + GFXLink*link = 0; + if(links) { + kdarea_t*a = kdtree_find(this->links, x+dx/2,y+dy/2); + if(a) { + link = (GFXLink*)a->data; +#if 0 + if(link) { + printf("area [%d %d %d %d] (link [%f %f %f %f]) contains (%f,%f)\n", + a->bbox.xmin, a->bbox.ymin, a->bbox.xmax, a->bbox.ymax, + link->x1, link->y1, link->x2, link->y2, + x+dx/2, y+dy/2 + ); + } +#endif + } + if(link != previous_link) { + previous_link = link; + device->setparameter(device, "link", link?link->action:""); + } + } + + // check for invisible text -- this is used by Acrobat Capture + if (render == RENDER_INVISIBLE) { + col.a = 0; + if(!config_extrafontdata) + return; + } + + GfxFont*font = state->getFont(); + + if(font->getType() == fontType3) { + /* type 3 chars are passed as graphics */ + msg(" type3 char at %f/%f", x, y); + return; + } + + Unicode u = uLen?(_u[0]):0; + + gfxmatrix_t m = current_fontinfo->get_gfxmatrix(state); + this->transformXY(state, x-originX, y-originY, &m.tx, &m.ty); + + gfxbbox_t bbox; + + msg(" drawChar(%f,%f,c='%c' (%d), u=%d <%d> '%c') CID=%d render=%d glyphid=%d font=%p size=%f", + m.tx, m.ty, (charid&127)>=32?charid:'?', charid, u, uLen, u, + font->isCIDFont(), render, glyphid, current_gfxfont, + m.m00); + + gfxglyph_t* gfxglyph = ¤t_gfxfont->glyphs[glyphid]; + + int space = current_fontinfo->space_char; + if(config_extrafontdata && config_detectspaces && space>=0 && m.m00 && !m.m01) { + /* space char detection */ + //bool different_y = last_char_y - m.ty; + bool different_y = m.ty < last_char_y - last_ascent*last_char_y_fontsize + || m.ty > last_char_y + last_descent*last_char_y_fontsize; + double expected_x = last_char_x + last_char_advance*last_char_x_fontsize; + double rightx = m.tx + gfxglyph->advance * m.m00; + if(different_y) { + expected_x = m.tx - width/2; + } + + if((!different_y || config_space_between_lines) && + !last_char_was_space && !current_fontinfo->usesSpaces()) { + int space = current_fontinfo->space_char; + float width = fmax(m.m00*current_fontinfo->average_advance, last_char_x_fontsize*last_average_advance); + if(m.tx - expected_x >= width*4/10) { + msg(" There's a %f pixel gap between char %d and char %d (expected no more than %f), I'm inserting a space here", + m.tx-expected_x, + last_char, glyphid, + width*4/10 + ); +#ifdef VISUALIZE_CHAR_GAPS + bbox = gfxline_getbbox(gfxglyph->line); + gfxline_t*rect = gfxline_makerectangle(last_char_x,m.ty,m.tx,m.ty+10); + gfxcolor_t red = {255,255,0,0}; + device->fill(device, rect, &red); + gfxline_free(rect); +#endif + gfxmatrix_t m2 = m; + m2.tx = expected_x + (m.tx - expected_x - current_gfxfont->glyphs[space].advance*m.m00)/2; + if(m2.tx < expected_x) m2.tx = expected_x; + device->drawchar(device, current_gfxfont, space, &col, &m2); + if(link) { + link->addchar(32); + } + } + } + last_average_advance = current_fontinfo->average_advance; + last_char_advance = gfxglyph->advance; + last_char_x_fontsize = m.m00; + last_char_y_fontsize = -m.m11; + last_char = glyphid; + last_char_x = m.tx; + last_char_y = m.ty; + last_ascent = current_gfxfont->ascent; + last_descent = fmax(current_gfxfont->descent, current_gfxfont->ascent/3); + last_char_was_space = GLYPH_IS_SPACE(gfxglyph); + + if(m.tx < expected_x && rightx < expected_x + 1 && GLYPH_IS_SPACE(gfxglyph)) { + msg(" Dropping dedented space char at %f-%f (before %f)", + m.tx, rightx, expected_x); + return; + } + + } + device->drawchar(device, current_gfxfont, glyphid, &col, &m); + + if(link) { + link->addchar(current_gfxfont->glyphs[glyphid].unicode); + } +} + +void CharOutputDev::endString(GfxState *state) +{ +} + +void CharOutputDev::endTextObject(GfxState *state) +{ +} + +/* the logic seems to be as following: + first, beginType3Char is called, with the charcode and the coordinates. + if this function returns true, it already knew about the char and has now drawn it. + if the function returns false, it's a new char, and type3D0 and/or type3D1 might be + called with some parameters. + Afterwards, all draw operations until endType3Char are part of the char (which in this moment is + at the position first passed to beginType3Char). the char ends with endType3Char. + + The drawing operations between beginType3Char and endType3Char are somewhat different to + the normal ones. For example, the fillcolor equals the stroke color. (Because the stroke + color determines the color of a font) +*/ + +GBool CharOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode charid, Unicode *u, int uLen) +{ + msg(" beginType3Char %d u=%d", charid, uLen?u[0]:0); + type3active = 1; + + if(config_extrafontdata) { + + FontInfo*current_fontinfo = info->getFontInfo(state); + if(!current_fontinfo) { + msg(" Couldn't find font info"); + return gFalse; + } + gfxfont_t*current_gfxfont = current_fontinfo->getGfxFont(); + + /*m.m00*=INTERNAL_FONT_SIZE; + m.m01*=INTERNAL_FONT_SIZE; + m.m10*=INTERNAL_FONT_SIZE; + m.m11*=INTERNAL_FONT_SIZE;*/ + + if(!current_fontinfo || (unsigned)charid >= current_fontinfo->num_glyphs || !current_fontinfo->glyphs[charid]) { + msg(" Invalid type3 charid %d for font %p", charid, current_fontinfo); + return gFalse; + } + gfxcolor_t col={0,0,0,0}; + CharCode glyphid = current_fontinfo->glyphs[charid]->glyphid; + gfxmatrix_t m = current_fontinfo->get_gfxmatrix(state); + this->transformXY(state, 0, 0, &m.tx, &m.ty); + device->drawchar(device, current_gfxfont, glyphid, &col, &m); + } + + + /* the character itself is going to be passed using the draw functions */ + return gFalse; /* gTrue= is_in_cache? */ +} + +void CharOutputDev::type3D0(GfxState *state, double wx, double wy) { +} +void CharOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) { +} + +void CharOutputDev::endType3Char(GfxState *state) +{ + type3active = 0; + msg(" endType3Char"); +} + +void CharOutputDev::beginPage(GfxState *state, int pageNum) +{ + this->currentpage = pageNum; + this->last_char_was_space = 1; + this->last_char_y = 0; + this->last_char_y_fontsize = 0; + this->last_ascent = 0; + this->last_descent = 0; + this->previous_link = 0; +} + +void GFXLink::draw(CharOutputDev*out, gfxdevice_t*dev) +{ + int x1,y1,x2,y2; + out->transformXY_stateless(this->x1, this->y1, &x1, &y1); + out->transformXY_stateless(this->x2, this->y2, &x2, &y2); + + gfxline_t points[5]; + points[0].type = gfx_moveTo; + points[0].x = x1; + points[0].y = y1; + points[0].next = &points[1]; + points[1].type = gfx_lineTo; + points[1].x = x1; + points[1].y = y2; + points[1].next = &points[2]; + points[2].type = gfx_lineTo; + points[2].x = x2; + points[2].y = y2; + points[2].next = &points[3]; + points[3].type = gfx_lineTo; + points[3].x = x2; + points[3].y = y1; + points[3].next = &points[4]; + points[4].type = gfx_lineTo; + points[4].x = x1; + points[4].y = y1; + points[4].next = 0; + msg(" drawing link %.2f/%.2f %.2f/%.2f %.2f/%.2f %.2f/%.2f to %s (\"%s\")", + points[0].x, points[0].y, + points[1].x, points[1].y, + points[2].x, points[2].y, + points[3].x, points[3].y, action, text); + + dev->drawlink(dev, points, action, text); +} + +void GFXLink::addchar(int unicode) +{ + msg(" Adding '%c' (%d) to link %s", unicode, unicode, action); + char buf[8]; + int l = writeUTF8(unicode, buf); + while(size+l+1>=buf_size) { + buf_size += 32; + text = (char*)rfx_realloc(text, buf_size); + } + strcpy(text+size, buf); + size += l; +} + +GFXLink::GFXLink(GFXLink*last, const char*action, double x1, double y1, double x2, double y2) +{ + this->buf_size = 0; + this->size = 0; + this->text = 0; + this->last = last; + this->action = strdup(action); + this->x1 = x1; + this->y1 = y1; + this->x2 = x2; + this->y2 = y2; +} + +GFXLink::~GFXLink() +{ + free((void*)this->action); + if(this->text) + free(this->text); + this->text = 0; + this->action = 0; +} + + +void CharOutputDev::processLink(Link *link, Catalog *catalog) +{ + double x1, y1, x2, y2; + + msg(" drawlink"); + + link->getRect(&x1, &y1, &x2, &y2); + + LinkAction*actionobj=link->getAction(); + char buf[128]; + char*s = 0; + const char*type = "-?-"; + char*named = 0; + int page = -1; + msg(" drawlink actionobj=%d", actionobj->getKind()); + switch(actionobj->getKind()) + { + case actionGoTo: { + type = "GoTo"; + LinkGoTo *ha=(LinkGoTo *)link->getAction(); + LinkDest *dest=NULL; + if (ha->getDest()==NULL) + dest=catalog->findDest(ha->getNamedDest()); + else + dest=ha->getDest()->copy(); + if (dest){ + if (dest->isPageRef()){ + Ref pageref=dest->getPageRef(); + page=catalog->findPage(pageref.num,pageref.gen); + } + else page=dest->getPageNum(); + sprintf(buf, "%d", page); + s = strdup(buf); + delete dest; + } + } + break; + case actionGoToR: { + type = "GoToR"; + LinkGoToR*l = (LinkGoToR*)actionobj; + GString*g = l->getFileName(); + if(g) + s = strdup(g->getCString()); + if(!s) { + /* if the GoToR link has no filename, then + try to find a refernce in the *local* + file */ + GString*g = l->getNamedDest(); + if(g) + s = strdup(g->getCString()); + } + } + break; + case actionNamed: { + type = "Named"; + LinkNamed*l = (LinkNamed*)actionobj; + GString*name = l->getName(); + if(name) { + s = strdup(name->lowerCase()->getCString()); + named = name->getCString(); + if(!strchr(s,':')) + { + if(strstr(s, "next") || strstr(s, "forward")) + { + page = currentpage + 1; + } + else if(strstr(s, "prev") || strstr(s, "back")) + { + page = currentpage - 1; + } + else if(strstr(s, "last") || strstr(s, "end")) + { + if(this->page2page && this->num_pages) { + page = this->page2page[this->num_pages-1]; + } + } + else if(strstr(s, "first") || strstr(s, "top")) + { + page = 1; + } + } + } + } + break; + case actionLaunch: { + type = "Launch"; + LinkLaunch*l = (LinkLaunch*)actionobj; + GString * str = new GString(l->getFileName()); + GString * params = l->getParams(); + if(params) + str->append(params); + s = strdup(str->getCString()); + delete str; + } + break; + case actionURI: { + char*url = 0; + type = "URI"; + LinkURI*l = (LinkURI*)actionobj; + GString*g = l->getURI(); + if(g) { + url = g->getCString(); + s = strdup(url); + } + } + break; + case actionUnknown: { + type = "Unknown"; + LinkUnknown*l = (LinkUnknown*)actionobj; + s = strdup(""); + } + break; + default: { + msg(" Unknown link type!"); + break; + } + } + + if(!s) s = strdup("-?-"); + + if(!getGfxGlobals()->linkinfo && (page || s)) + { + msg(" File contains links"); + getGfxGlobals()->linkinfo = 1; + } + + char*action = 0; + if(page>0) { + int t; + int lpage = -1; + for(t=1;t<=this->num_pages;t++) { + if(this->page2page[t]==page) { + lpage = t; + break; + } + } + if(lpage<0) { + lpage = page; + } + + char buf[80]; + sprintf(buf, "page%d", lpage); + action = buf; + } + else if(s) + { + action = s; + if(this->config_linkdatafile) { + FILE*fi = fopen(config_linkdatafile, "ab+"); + fprintf(fi, "%s\n", s); + fclose(fi); + } + } + + this->last_link = new GFXLink(this->last_link, action, x1, y1, x2, y2); + if(!this->links) { + this->links = kdtree_new(); + } + kdtree_add_box(this->links, x1,y1,x2,y2, this->last_link); +#if 0 + printf("adding link %p at %f %f %f %f to tree\n", this->last_link, x1, y1, x2, y2); +#endif + + msg(" storing \"%s\" link to \"%s\"", type, FIXNULL(action)); + free(s);s=0; +} + +void CharOutputDev::saveState(GfxState *state) { + msg(" saveState %p", state); + updateAll(state); +}; + +void CharOutputDev::restoreState(GfxState *state) +{ + updateAll(state); +} + +void CharOutputDev::updateFont(GfxState *state) +{ + GfxFont* gfxFont = state->getFont(); + if (!gfxFont) { + return; + } + + char*id = getFontID(gfxFont); + msg(" Updating font to %s", FIXNULL(id)); + free(id);id=0; + + if(gfxFont->getType() == fontType3) { + infofeature("Type3 fonts"); + } + updateTextMat(state); +} + +static const char* dirseparator() +{ +#ifdef WIN32 + return "\\"; +#else + return "/"; +#endif +} + +void addGlobalFont(const char*filename) +{ + fontfile_t* f = (fontfile_t*)malloc(sizeof(fontfile_t)); + memset(f, 0, sizeof(fontfile_t)); + f->filename = filename; + int len = strlen(filename); + char*r1 = strrchr((char*)filename, '/'); + char*r2 = strrchr((char*)filename, '\\'); + if(r2>r1) + r1 = r2; + if(r1) { + len = strlen(r1+1); + } + f->len = len; + + msg(" Adding font \"%s\".", filename); + if(global_fonts_next) { + global_fonts_next->next = f; + global_fonts_next = global_fonts_next->next; + } else { + global_fonts_next = global_fonts = f; + } +} + +void addGlobalLanguageDir(const char*dir) +{ +#ifdef HAVE_POPPLER + msg(" NOT adding %s to language pack directories (not implemented with poppler)", dir); +#else + msg(" Adding %s to language pack directories", dir); + + FILE*fi = 0; + char* config_file = (char*)malloc(strlen(dir) + 1 + sizeof("add-to-xpdfrc") + 1); + strcpy(config_file, dir); + strcat(config_file, dirseparator()); + strcat(config_file, "add-to-xpdfrc"); + + fi = fopen(config_file, "rb"); + if(!fi) { + msg(" Could not open %s", config_file); + return; + } + globalParams->parseFile(new GString(config_file), fi); + fclose(fi); +#endif +} + +void addGlobalFontDir(const char*dirname) +{ +#ifdef HAVE_DIRENT_H + DIR*dir = opendir(dirname); + if(!dir) { + msg(" Couldn't open directory %s", dirname); + return; + } + struct dirent*ent; + int fonts = 0; + while(1) { + ent = readdir (dir); + if (!ent) + break; + int l; + char*name = ent->d_name; + char type = 0; + if(!name) continue; + l=strlen(name); + if(l<4) + continue; + if(!strncasecmp(&name[l-4], ".pfa", 4)) + type=1; + if(!strncasecmp(&name[l-4], ".pfb", 4)) + type=3; + if(!strncasecmp(&name[l-4], ".ttf", 4)) + type=2; + if(type) { + char*fontname = (char*)malloc(strlen(dirname)+strlen(name)+2); + strcpy(fontname, dirname); + strcat(fontname, dirseparator()); + strcat(fontname, name); + addGlobalFont(fontname); + fonts++; + } + } + msg(" Added %s to font directories (%d fonts)", dirname, fonts); + closedir(dir); +#else + msg(" No dirent.h"); +#endif +} + diff -Nru swftools-0.9.0/lib/pdf/CharOutputDev.h swftools-0.9.2/lib/pdf/CharOutputDev.h --- swftools-0.9.0/lib/pdf/CharOutputDev.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/CharOutputDev.h 2011-12-12 21:29:27.000000000 +0000 @@ -0,0 +1,119 @@ +#ifndef __charoutputdev_h__ +#define __charoutputdev_h__ + +#include "../gfxdevice.h" +#include "../gfxsource.h" +#include "../gfxtools.h" +#include "../kdtree.h" + +#include "InfoOutputDev.h" +#include "PDFDoc.h" +#include "GlobalParams.h" +#include "CommonOutputDev.h" + +extern void addGlobalFont(const char*filename); +extern void addGlobalLanguageDir(const char*dir); +extern void addGlobalFontDir(const char*dirname); + +class GFXLink; + +class CharOutputDev: public CommonOutputDev { +public: + gfxdevice_t* device; + + CharOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2); + virtual ~CharOutputDev(); + + virtual void setDevice(gfxdevice_t*dev); + virtual void setParameter(const char*key, const char*value); + + virtual void beginPage(GfxState *state, int pageNum); + virtual void endPage(); + + virtual GBool upsideDown(); + virtual GBool useDrawChar(); + + virtual void processLink(Link *link, Catalog *catalog); + virtual void saveState(GfxState *state) ; + virtual void restoreState(GfxState *state) ; + + //----- update graphics state + virtual void updateFont(GfxState *state); + virtual void updateTextMat(GfxState *state); + + //----- text drawing + virtual void beginString(GfxState *state, GString *s) ; + virtual void endString(GfxState *state) ; + virtual void endTextObject(GfxState *state); + virtual void drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode code, int nBytes, Unicode *u, int uLen); + + //----- type 3 chars + virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen); + virtual void endType3Char(GfxState *state); + + virtual void type3D0(GfxState *state, double wx, double wy); + virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury); + + virtual GBool needNonText(); + + private: + + int currentpage; + int type3active; // are we between beginType3()/endType3()? + + gfxline_t* current_text_stroke; + gfxline_t* current_text_clip; + + // state variables for space char detection + int last_char; + double last_char_x; + double last_char_y; + double last_char_x_fontsize; + double last_char_y_fontsize; + double last_char_advance; + double last_average_advance; + double last_ascent; + double last_descent; + char last_char_was_space; + + GFXLink*last_link; + GFXLink*previous_link; + kdtree_t*links; + + /* config */ + int config_use_fontconfig; + int config_remapunicode; + int config_extrafontdata; + int config_bigchar; + int config_detectspaces; + int config_space_between_lines; + double config_fontquality; + char* config_linkdatafile; +}; + +class GFXLink { + double x1,y1,x2,y2; + int size; + int buf_size; + char*text; + public: + const char*action; + GFXLink*last; + void draw(CharOutputDev*out, gfxdevice_t*dev); + void addchar(int unicode); + GFXLink(GFXLink*last, const char*action, double x1, double y1, double x2, double y2); + ~GFXLink(); +}; + +class GFXGlobalParams: public GlobalParams { + public: + GFXGlobalParams(); + ~GFXGlobalParams(); + virtual DisplayFontParam *getDisplayFont(GString *fontName); + virtual DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection); +}; + +#endif //__charoutputdev_h__ diff -Nru swftools-0.9.0/lib/pdf/CommonOutputDev.cc swftools-0.9.2/lib/pdf/CommonOutputDev.cc --- swftools-0.9.0/lib/pdf/CommonOutputDev.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/CommonOutputDev.cc 2010-11-12 18:58:13.000000000 +0000 @@ -0,0 +1,153 @@ +#include "popplercompat.h" +#include "CommonOutputDev.h" +#include "../log.h" +#include "../gfxdevice.h" + +int config_break_on_warning = 0; + +CommonOutputDev::CommonOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2) +{ + this->info = info; + this->doc = doc; + this->xref = doc->getXRef(); + + if(x2user_movex = x; + this->user_movey = y; + this->user_clipx1 = x1; + this->user_clipy1 = y1; + this->user_clipx2 = x2; + this->user_clipy2 = y2; +} + +void CommonOutputDev::startPage(int pageNum, GfxState*state) +{ + double x1,y1,x2,y2; + PDFRectangle *r = this->page->getCropBox(); + state->transform(r->x1,r->y1,&x1,&y1); + state->transform(r->x2,r->y2,&x2,&y2); + if(x2movex = -(int)x1 - this->user_clipx1 + this->user_movex; + this->movey = -(int)y1 - this->user_clipy1 + this->user_movey; + + if(this->user_clipx1|this->user_clipy1|this->user_clipx2|this->user_clipy2) { + this->width = this->user_clipx2 - this->user_clipx1; + this->height = this->user_clipy2 - this->user_clipy1; + } else { + this->width = x2-x1; + this->height = y2-y1; + } + beginPage(state, pageNum); +} + +void CommonOutputDev::transformXY(GfxState*state, double x, double y, double*nx, double*ny) +{ + state->transform(x,y,nx,ny); + *nx += movex; + *ny += movey; +} +void CommonOutputDev::transformXY_stateless(double x, double y, int*xout, int*yout) +{ + cvtUserToDev(x, y, xout, yout); + *xout += movex; + *yout += movey; +} + +GBool CommonOutputDev::interpretType3Chars() +{ + return gTrue; +} + +GFXOutputGlobals::GFXOutputGlobals() +{ + this->featurewarnings = 0; + this->jpeginfo = 0; + this->textmodeinfo = 0; + this->linkinfo = 0; + this->pbminfo = 0; +} +GFXOutputGlobals::~GFXOutputGlobals() +{ + feature_t*f = this->featurewarnings; + while(f) { + feature_t*next = f->next; + if(f->string) { + free(f->string);f->string =0; + } + f->next = 0; + free(f); + f = next; + } + this->featurewarnings = 0; +} + +static GFXOutputGlobals*gfxglobals=0; + +static void showfeature(const char*feature, char fully, char warn) +{ + if(!gfxglobals) + gfxglobals = new GFXOutputGlobals(); + + feature_t*f = gfxglobals->featurewarnings; + while(f) { + if(!strcmp(feature, f->string)) + return; + f = f->next; + } + f = (feature_t*)malloc(sizeof(feature_t)); + f->string = strdup(feature); + f->next = gfxglobals->featurewarnings; + gfxglobals->featurewarnings = f; + if(warn) { + msg(" %s not yet %ssupported!",feature,fully?"fully ":""); + } else { + msg(" File contains %s",feature); + } +} +void warnfeature(const char*feature,char fully) +{ + showfeature(feature,fully,1); + if(config_break_on_warning) { + msg(" Aborting conversion due to unsupported feature"); + exit(1); + } +} +void infofeature(const char*feature) +{ + showfeature(feature,0,0); +} +GFXOutputGlobals* getGfxGlobals() +{ + if(!gfxglobals) + gfxglobals = new GFXOutputGlobals(); + return gfxglobals; +} + +gfxcolor_t gfxstate_getfillcolor(GfxState * state) +{ + GfxRGB rgb; + double opaq = state->getFillOpacity(); + state->getFillRGB(&rgb); + gfxcolor_t col; + col.r = colToByte(rgb.r); + col.g = colToByte(rgb.g); + col.b = colToByte(rgb.b); + col.a = (unsigned char)(opaq*255); + return col; +} + +bool text_matrix_is_skewed(GfxState * state) +{ + double*ctm = state->getCTM(); + double*tm = state->getTextMat(); + double m00 = ctm[0]*tm[0] + ctm[2]*tm[1]; + double m01 = ctm[1]*tm[0] + ctm[3]*tm[1]; + double m10 = ctm[0]*tm[2] + ctm[2]*tm[3]; + double m11 = ctm[1]*tm[2] + ctm[3]*tm[3]; + return (m00<0 || m10<0); +} + diff -Nru swftools-0.9.0/lib/pdf/CommonOutputDev.h swftools-0.9.2/lib/pdf/CommonOutputDev.h --- swftools-0.9.0/lib/pdf/CommonOutputDev.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/CommonOutputDev.h 2010-11-12 19:06:42.000000000 +0000 @@ -21,6 +21,8 @@ #define __commonoutputdev_h__ #include "OutputDev.h" +#include "InfoOutputDev.h" +#include "../gfxdevice.h" #define RENDER_FILL 0 #define RENDER_STROKE 1 @@ -28,15 +30,80 @@ #define RENDER_INVISIBLE 3 #define RENDER_CLIP 4 +typedef struct _feature +{ + char*string; + struct _feature*next; +} feature_t; + +class GFXOutputGlobals { +public: + feature_t*featurewarnings; + + int textmodeinfo; // did we write "Text will be rendered as polygon" yet? + int jpeginfo; // did we write "File contains jpegs" yet? + int pbminfo; // did we write "File contains jpegs" yet? + int linkinfo; // did we write "File contains links" yet? + + GFXOutputGlobals(); + ~GFXOutputGlobals(); +}; +extern GFXOutputGlobals* getGfxGlobals(); + +extern void warnfeature(const char*feature,char fully); +extern void infofeature(const char*feature); + +gfxcolor_t gfxstate_getfillcolor(GfxState * state); +bool text_matrix_is_skewed(GfxState * state); + class CommonOutputDev: public OutputDev { public: + CommonOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2); + virtual void setDevice(gfxdevice_t*dev) = 0; - virtual void setMove(int x,int y) = 0; - virtual void setClip(int x1,int y1,int x2,int y2) = 0; virtual void setParameter(const char*key, const char*value) = 0; - virtual void setPageMap(int*pagemap, int pagemap_len) = 0; + + virtual void startPage(int pageNum, GfxState*state); + virtual void beginPage(GfxState*state, int page) = 0; + virtual void setPage(Page *page) { this->page = page; } virtual void finishPage() {}; + + void transformXY(GfxState*state, double x, double y, double*nx, double*ny); + void transformXY_stateless(double x, double y, int*xout, int*yout); + + virtual GBool interpretType3Chars(); + + virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data) = NULL, + void *abortCheckCbkData = NULL) + { + this->setPage(page); + return gTrue; + } + + protected: + Page *page; + PDFDoc* doc; + XRef* xref; + InfoOutputDev* info; + + /* if set, will use a user bounding box instead of the PDF's bounding box */ + int user_movex,user_movey; + int user_clipx1,user_clipx2,user_clipy1,user_clipy2; + + /* movex,movey is the upper left corner of clipping rectangle (cropbox)- + this needs to be added to all drawing coordinates to give the + impression that all pages start at (0,0)*/ + int movex, movey; + int width, height; + + /* for page mapping */ + int* page2page; + int num_pages; }; #endif //__deviceinterface_h__ diff -Nru swftools-0.9.0/lib/pdf/FullBitmapOutputDev.cc swftools-0.9.2/lib/pdf/FullBitmapOutputDev.cc --- swftools-0.9.0/lib/pdf/FullBitmapOutputDev.cc 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/FullBitmapOutputDev.cc 2010-11-12 18:57:46.000000000 +0000 @@ -19,12 +19,20 @@ #include #include #include -#include "config.h" #include "FullBitmapOutputDev.h" -#include "GFXOutputDev.h" -#include "SplashBitmap.h" -#include "SplashPattern.h" -#include "Splash.h" +#include "CharOutputDev.h" + +#ifdef HAVE_POPPLER + #include "splash/SplashBitmap.h" + #include "splash/SplashPattern.h" + #include "splash/Splash.h" +#else + #include "xpdf/config.h" + #include "SplashBitmap.h" + #include "SplashPattern.h" + #include "Splash.h" +#endif + #include "../log.h" #include "../png.h" #include "../devices/record.h" @@ -32,7 +40,8 @@ static SplashColor splash_white = {255,255,255}; static SplashColor splash_black = {0,0,0}; -FullBitmapOutputDev::FullBitmapOutputDev(InfoOutputDev*info, PDFDoc*doc) +FullBitmapOutputDev::FullBitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2) +:CommonOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2) { this->doc = doc; this->xref = doc->getXRef(); @@ -43,7 +52,7 @@ this->rgbdev = new SplashOutputDev(splashModeRGB8, 1, gFalse, splash_white, gTrue, gTrue); /* device for handling links */ - this->gfxdev = new GFXOutputDev(info, this->doc); + this->gfxdev = new CharOutputDev(info, this->doc, page2page, num_pages, x, y, x1, y1, x2, y2); this->rgbdev->startDoc(this->xref); } @@ -70,28 +79,10 @@ this->dev = dev; gfxdev->setDevice(dev); } -void FullBitmapOutputDev::setMove(int x,int y) -{ - this->user_movex = x; - this->user_movey = y; - gfxdev->setMove(x,y); -} -void FullBitmapOutputDev::setClip(int x1,int y1,int x2,int y2) -{ - this->user_clipx1 = x1; - this->user_clipy1 = y1; - this->user_clipx2 = x2; - this->user_clipy2 = y2; - gfxdev->setClip(x1,y1,x2,y2); -} + void FullBitmapOutputDev::setParameter(const char*key, const char*value) { } -void FullBitmapOutputDev::setPageMap(int*pagemap, int pagemap_len) -{ - gfxdev->setPageMap(pagemap, pagemap_len); -} - static void getBitmapBBox(Guchar*alpha, int width, int height, int*xmin, int*ymin, int*xmax, int*ymax) { *ymin = -1; @@ -193,29 +184,23 @@ free(img->data);img->data=0;free(img);img=0; } -void FullBitmapOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2) -{ - double x1,y1,x2,y2; - state->transform(crop_x1,crop_y1,&x1,&y1); - state->transform(crop_x2,crop_y2,&x2,&y2); - if(x2movex = -(int)x1 - user_movex; - this->movey = -(int)y1 - user_movey; - - if(user_clipx1|user_clipy1|user_clipx2|user_clipy2) { - x1 = user_clipx1; - x2 = user_clipx2; - y1 = user_clipy1; - y2 = user_clipy2; - } - this->width = (int)(x2-x1); - this->height = (int)(y2-y1); +GBool FullBitmapOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data), + void *abortCheckCbkData) +{ + this->setPage(page); + gfxdev->setPage(page); + return gTrue; +} +void FullBitmapOutputDev::beginPage(GfxState *state, int pageNum) +{ msg(" startPage"); - rgbdev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); - gfxdev->startPage(pageNum, state, crop_x1, crop_y1, crop_x2, crop_y2); + rgbdev->startPage(pageNum, state); + gfxdev->startPage(pageNum, state); } void FullBitmapOutputDev::endPage() @@ -395,42 +380,34 @@ msg(" eoFill"); rgbdev->eoFill(state); } -#if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207 -void FullBitmapOutputDev::tilingPatternFill(GfxState *state, Object *str, +POPPLER_TILING_PATERN_RETURN FullBitmapOutputDev::tilingPatternFill(GfxState *state, POPPLER_TILING_PATERN_GFX + Object *str, int paintType, Dict *resDict, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) { msg(" tilingPatternFill"); - rgbdev->tilingPatternFill(state, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); -} -#else -void FullBitmapOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep) -{ - msg(" tilingPatternFill"); - rgbdev->tilingPatternFill(state, gfx, str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); -} +#ifdef HAVE_POPPLER + return #endif + rgbdev->tilingPatternFill(state, POPPLER_TILING_PATERN_GFX_ARG str, paintType, resDict, mat, bbox, x0, y0, x1, y1, xStep, yStep); +} GBool FullBitmapOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) { msg(" functionShadedFill"); return rgbdev->functionShadedFill(state, shading); } -GBool FullBitmapOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading) +GBool FullBitmapOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading POPPLER_RAXIAL_MIN_MAX) { msg(" axialShadedFill"); - return rgbdev->axialShadedFill(state, shading); + return rgbdev->axialShadedFill(state, shading POPPLER_RAXIAL_MIN_MAX_ARG); } -GBool FullBitmapOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading) +GBool FullBitmapOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading POPPLER_RAXIAL_MIN_MAX) { msg(" radialShadedFill"); - return rgbdev->radialShadedFill(state, shading); + return rgbdev->radialShadedFill(state, shading POPPLER_RAXIAL_MIN_MAX_ARG); } void FullBitmapOutputDev::clip(GfxState *state) @@ -517,37 +494,41 @@ rgbdev->endType3Char(state); } void FullBitmapOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, - int width, int height, GBool invert, + int width, int height, GBool invert, POPPLER_INTERPOLATE GBool inlineImg) { msg(" drawImageMask"); - rgbdev->drawImageMask(state, ref, str, width, height, invert, inlineImg); + rgbdev->drawImageMask(state, ref, str, width, height, invert, POPPLER_INTERPOLATE_ARG inlineImg); } void FullBitmapOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap *colorMap, + int width, int height, GfxImageColorMap *colorMap, POPPLER_INTERPOLATE int *maskColors, GBool inlineImg) { msg(" drawImage"); - rgbdev->drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg); + rgbdev->drawImage(state, ref, str, width, height, colorMap, + POPPLER_INTERPOLATE_ARG maskColors, inlineImg); } void FullBitmapOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, - GfxImageColorMap *colorMap, + GfxImageColorMap *colorMap, POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert) + GBool maskInvert POPPLER_MASK_INTERPOLATE) { msg(" drawMaskedImage"); - rgbdev->drawMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskInvert); + rgbdev->drawMaskedImage(state, ref, str, width, height, colorMap, + POPPLER_INTERPOLATE_ARG maskStr, maskWidth, maskHeight, + maskInvert POPPLER_MASK_INTERPOLATE_ARG); } void FullBitmapOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, - GfxImageColorMap *colorMap, - Stream *maskStr, - int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap) + GfxImageColorMap *colorMap, POPPLER_INTERPOLATE + Stream *maskStr, int maskWidth, int maskHeight, + GfxImageColorMap *maskColorMap POPPLER_MASK_INTERPOLATE) { msg(" drawSoftMaskedImage"); - rgbdev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, maskStr, maskWidth, maskHeight, maskColorMap); + rgbdev->drawSoftMaskedImage(state, ref, str, width, height, colorMap, + POPPLER_INTERPOLATE_ARG maskStr, maskWidth, maskHeight, + maskColorMap POPPLER_MASK_INTERPOLATE_ARG); } void FullBitmapOutputDev::drawForm(Ref id) { diff -Nru swftools-0.9.0/lib/pdf/FullBitmapOutputDev.h swftools-0.9.2/lib/pdf/FullBitmapOutputDev.h --- swftools-0.9.0/lib/pdf/FullBitmapOutputDev.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/FullBitmapOutputDev.h 2010-11-12 19:06:44.000000000 +0000 @@ -24,8 +24,8 @@ #include "../gfxsource.h" #include "../gfxtools.h" -#include "config.h" -#include "GFXOutputDev.h" +#include "../../config.h" +#include "CharOutputDev.h" #include "InfoOutputDev.h" #include "PDFDoc.h" #include "CommonOutputDev.h" @@ -36,15 +36,12 @@ class FullBitmapOutputDev: public CommonOutputDev { public: - FullBitmapOutputDev(InfoOutputDev*info, PDFDoc*doc); + FullBitmapOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2); virtual ~FullBitmapOutputDev(); // CommonOutputDev: virtual void setDevice(gfxdevice_t*dev); - virtual void setMove(int x,int y); - virtual void setClip(int x1,int y1,int x2,int y2); virtual void setParameter(const char*key, const char*value); - virtual void setPageMap(int*pagemap, int pagemap_len); // OutputDev: virtual GBool upsideDown(); @@ -55,14 +52,14 @@ virtual GBool interpretType3Chars(); virtual GBool needNonText(); virtual void setDefaultCTM(double *ctm); -/* virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, + virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, int rotate, GBool useMediaBox, GBool crop, int sliceX, int sliceY, int sliceW, int sliceH, GBool printing, Catalog *catalog, GBool (*abortCheckCbk)(void *data) = NULL, - void *abortCheckCbkData = NULL);*/ + void *abortCheckCbkData = NULL); - virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2); + virtual void beginPage(GfxState *state, int pageNum); virtual void endPage(); virtual void saveState(GfxState *state); @@ -100,24 +97,17 @@ virtual void stroke(GfxState *state); virtual void fill(GfxState *state); virtual void eoFill(GfxState *state); -#if (xpdfMajorVersion < 3) || (xpdfMinorVersion < 2) || (xpdfUpdateVersion < 7) - virtual void tilingPatternFill(GfxState *state, Object *str, + virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state, + POPPLER_TILING_PATERN_GFX Object *str, int paintType, Dict *resDict, double *mat, double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep); -#else - virtual void tilingPatternFill(GfxState *state, Gfx *gfx, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep); -#endif virtual GBool functionShadedFill(GfxState *state, GfxFunctionShading *shading); - virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading); - virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading); + virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading POPPLER_RAXIAL_MIN_MAX); + virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading POPPLER_RAXIAL_MIN_MAX); virtual void clip(GfxState *state); virtual void eoClip(GfxState *state); @@ -140,21 +130,27 @@ virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, + POPPLER_INTERPOLATE GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE int *maskColors, GBool inlineImg); virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert); + GBool maskInvert + POPPLER_MASK_INTERPOLATE); virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap); + GfxImageColorMap *maskColorMap + POPPLER_MASK_INTERPOLATE); virtual void type3D0(GfxState *state, double wx, double wy); virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury); @@ -179,19 +175,10 @@ private: void flushBitmap(); char config_extrafontdata; - PDFDoc*doc; - XRef*xref; SplashOutputDev*rgbdev; - GFXOutputDev*gfxdev; + CharOutputDev*gfxdev; gfxdevice_t*dev; - - int movex, movey; - int width, height; - - int user_movex, user_movey; - int user_clipx1, user_clipy1; - int user_clipx2, user_clipy2; }; #endif diff -Nru swftools-0.9.0/lib/pdf/GFXOutputDev.cc swftools-0.9.2/lib/pdf/GFXOutputDev.cc --- swftools-0.9.0/lib/pdf/GFXOutputDev.cc 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/pdf/GFXOutputDev.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,2839 +0,0 @@ -/* GFXOutputDev.cc - implements a pdf output device (OutputDev). - - This file is part of swftools. - - Swftools 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. - - Swftools 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. - - You should have received a copy of the GNU General Public License - along with swftools; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include -#include -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include "../../config.h" -#include "../os.h" -#ifdef HAVE_DIRENT_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FONTCONFIG -#include -#endif -//xpdf header files -#include "config.h" -#ifdef HAVE_POPPLER -#include -#include -#else -#include "gfile.h" -#include "GString.h" -#endif -#include "Object.h" -#include "Stream.h" -#include "Array.h" -#include "Dict.h" -#include "XRef.h" -#include "Catalog.h" -#include "Page.h" -#include "PDFDoc.h" -#include "Error.h" -#include "Link.h" -#include "OutputDev.h" -#include "GfxFont.h" -#include "GfxState.h" -//#include "NameToUnicodeTable.h" -#include "GlobalParams.h" -#include "GFXOutputDev.h" - -// swftools header files -#include "../log.h" -#include "../gfxdevice.h" -#include "../gfxtools.h" -#include "../gfxfont.h" -#include "../gfxpoly.h" -#include "../devices/record.h" -#include "../devices/ops.h" -#include "../devices/polyops.h" -#include "../devices/render.h" - -#include "../png.h" -#include "fonts.h" - -#include - -#define SQRT2 1.41421356237309504880 - -typedef struct _fontfile -{ - const char*filename; - int len; // basename length - int used; - struct _fontfile*next; -} fontfile_t; - -// for pdfswf_addfont - -static fontfile_t* global_fonts = 0; -static fontfile_t* global_fonts_next = 0; - -static int fontnum = 0; - -/* config */ - -struct fontentry { - const char*pdffont; - const char*filename; - char*afm; - int afmlen; - char*pfb; - int pfblen; - char*fullfilename; -} pdf2t1map[] ={ -{"Times-Roman", "n021003l", n021003l_afm, n021003l_afm_len, n021003l_pfb, n021003l_pfb_len}, -{"Times-Italic", "n021023l", n021023l_afm, n021023l_afm_len, n021023l_pfb, n021023l_pfb_len}, -{"Times-Bold", "n021004l", n021004l_afm, n021004l_afm_len, n021004l_pfb, n021004l_pfb_len}, -{"Times-BoldItalic", "n021024l", n021024l_afm, n021024l_afm_len, n021024l_pfb, n021024l_pfb_len}, -{"Helvetica", "n019003l", n019003l_afm, n019003l_afm_len, n019003l_pfb, n019003l_pfb_len}, -{"Helvetica-Oblique", "n019023l", n019023l_afm, n019023l_afm_len, n019023l_pfb, n019023l_pfb_len}, -{"Helvetica-Bold", "n019004l", n019004l_afm, n019004l_afm_len, n019004l_pfb, n019004l_pfb_len}, -{"Helvetica-BoldOblique", "n019024l", n019024l_afm, n019024l_afm_len, n019024l_pfb, n019024l_pfb_len}, -{"Courier", "n022003l", n022003l_afm, n022003l_afm_len, n022003l_pfb, n022003l_pfb_len}, -{"Courier-Oblique", "n022023l", n022023l_afm, n022023l_afm_len, n022023l_pfb, n022023l_pfb_len}, -{"Courier-Bold", "n022004l", n022004l_afm, n022004l_afm_len, n022004l_pfb, n022004l_pfb_len}, -{"Courier-BoldOblique", "n022024l", n022024l_afm, n022024l_afm_len, n022024l_pfb, n022024l_pfb_len}, -{"Symbol", "s050000l", s050000l_afm, s050000l_afm_len, s050000l_pfb, s050000l_pfb_len}, -{"ZapfDingbats", "d050000l", d050000l_afm, d050000l_afm_len, d050000l_pfb, d050000l_pfb_len}}; - - -static int verbose = 0; -static int dbgindent = 1; -static void dbg(const char*format, ...) -{ - char buf[1024]; - int l; - va_list arglist; - if(!verbose) - return; - va_start(arglist, format); - vsnprintf(buf, sizeof(buf)-1, format, arglist); - va_end(arglist); - l = strlen(buf); - while(l && buf[l-1]=='\n') { - buf[l-1] = 0; - l--; - } - printf("(pdf) "); - int indent = dbgindent; - while(indent) { - printf(" "); - indent--; - } - printf("%s\n", buf); - fflush(stdout); -} - -GFXOutputGlobals*gfxglobals=0; - -GFXOutputGlobals::GFXOutputGlobals() -{ - this->featurewarnings = 0; - this->jpeginfo = 0; - this->textmodeinfo = 0; - this->linkinfo = 0; - this->pbminfo = 0; -} -GFXOutputGlobals::~GFXOutputGlobals() -{ - feature_t*f = this->featurewarnings; - while(f) { - feature_t*next = f->next; - if(f->string) { - free(f->string);f->string =0; - } - f->next = 0; - free(f); - f = next; - } - this->featurewarnings = 0; -} - -void GFXOutputDev::showfeature(const char*feature, char fully, char warn) -{ - feature_t*f = gfxglobals->featurewarnings; - while(f) { - if(!strcmp(feature, f->string)) - return; - f = f->next; - } - f = (feature_t*)malloc(sizeof(feature_t)); - f->string = strdup(feature); - f->next = gfxglobals->featurewarnings; - gfxglobals->featurewarnings = f; - if(warn) { - msg(" %s not yet %ssupported!",feature,fully?"fully ":""); - if(this->config_break_on_warning) { - msg(" Aborting conversion due to unsupported feature"); - exit(1); - } - } else { - msg(" File contains %s",feature); - } -} -void GFXOutputDev::warnfeature(const char*feature,char fully) -{ - showfeature(feature,fully,1); -} -void GFXOutputDev::infofeature(const char*feature) -{ - showfeature(feature,0,0); -} - -GFXOutputState::GFXOutputState() { - this->clipping = 0; - this->createsoftmask = 0; - this->transparencygroup = 0; - this->softmask = 0; - this->grouprecording = 0; - this->isolated = 0; -} - -GBool GFXOutputDev::interpretType3Chars() -{ - return gTrue; -} - -typedef struct _drawnchar -{ - gfxcoord_t x,y; - int charid; - gfxcolor_t color; -} drawnchar_t; - -class CharBuffer -{ - drawnchar_t * chars; - int buf_size; - int num_chars; - -public: - - CharBuffer() - { - buf_size = 32; - chars = (drawnchar_t*)malloc(sizeof(drawnchar_t)*buf_size); - memset(chars, 0, sizeof(drawnchar_t)*buf_size); - num_chars = 0; - } - ~CharBuffer() - { - free(chars);chars = 0; - } - - void grow(int size) - { - if(size>=buf_size) { - buf_size += 32; - chars = (drawnchar_t*)realloc(chars, sizeof(drawnchar_t)*buf_size); - } - } - - void addChar(int charid, gfxcoord_t x, gfxcoord_t y, gfxcolor_t color) - { - grow(num_chars); - chars[num_chars].x = x; - chars[num_chars].y = y; - chars[num_chars].color = color; - chars[num_chars].charid = charid; - } -}; - -char* writeOutStdFont(fontentry* f) -{ - FILE*fi; - char namebuf1[512]; - char namebuf2[512]; - char* tmpFileName = mktmpname(namebuf1); - - sprintf(namebuf2, "%s.afm", tmpFileName); - fi = fopen(namebuf2, "wb"); - if(!fi) - return 0; - fwrite(f->afm, 1, f->afmlen, fi); - fclose(fi); - - sprintf(namebuf2, "%s.pfb", tmpFileName); - fi = fopen(namebuf2, "wb"); - if(!fi) - return 0; - fwrite(f->pfb, 1, f->pfblen, fi); - fclose(fi); - return strdup(namebuf2); -} -void unlinkfont(char* filename) -{ - int l; - if(!filename) - return; - msg(" Removing temporary font file %s", filename); - l=strlen(filename); - unlink(filename); - if(!strncmp(&filename[l-4],".afm",4)) { - memcpy(&filename[l-4],".pfb",4); unlink(filename); - memcpy(&filename[l-4],".pfa",4); unlink(filename); - memcpy(&filename[l-4],".afm",4); - return; - } else - if(!strncmp(&filename[l-4],".pfa",4)) { - memcpy(&filename[l-4],".afm",4); unlink(filename); - memcpy(&filename[l-4],".pfa",4); - return; - } else - if(!strncmp(&filename[l-4],".pfb",4)) { - memcpy(&filename[l-4],".afm",4); unlink(filename); - memcpy(&filename[l-4],".pfb",4); - return; - } -} - -static int config_use_fontconfig = 1; -static int fcinitcalled = 0; - -GFXGlobalParams::GFXGlobalParams() -: GlobalParams((char*)"") -{ - //setupBaseFonts(char *dir); //not tested yet -} -GFXGlobalParams::~GFXGlobalParams() -{ - msg(" Performing cleanups"); - int t; - for(t=0;t Font %s-%s (%s) is a match for %s%s%s", fcfamily, fcstyle, filename, family, style?"-":"", style?style:""); - return 1; - } else { - //msg(" Font %s-%s (%s) is NOT a match for %s%s%s", fcfamily, fcstyle, filename, family, style?"-":"", style?style:""); - return 0; - } -} -#endif - -char* fontconfig_searchForFont(char*name) -{ -#ifdef HAVE_FONTCONFIG - if(!config_use_fontconfig) - return 0; - - // call init ony once - if (!fcinitcalled) { - fcinitcalled = 1; - - // check whether we have a config file - char* configfile = (char*)FcConfigFilename(0); - int configexists = 0; - FILE*fi = fopen(configfile, "rb"); - if(fi) { - configexists = 1;fclose(fi); - msg(" Initializing FontConfig (configfile=%s)", configfile); - } else { - msg(" Initializing FontConfig (no configfile)"); - } - - if(!configexists) { - /* A fontconfig instance which didn't find a configfile is unbelievably - cranky, so let's just write out a small xml file and make fontconfig - happy */ - FcConfig*c = FcConfigCreate(); - char namebuf[512]; - char* tmpFileName = mktmpname(namebuf); - FILE*fi = fopen(tmpFileName, "wb"); - fprintf(fi, "\n\n");// -#ifdef WIN32 - fprintf(fi, "WINDOWSFONTDIR\n"); -#endif - fprintf(fi, "~/.fonts\n"); -#ifdef WIN32 - fprintf(fi, "WINDOWSTEMPDIR_FONTCONFIG_CACHE\n"); -#endif - fprintf(fi, "~/.fontconfig\n"); - fprintf(fi, "\n"); - fclose(fi); - FcConfigParseAndLoad(c, (FcChar8*)tmpFileName, 1); - FcConfigBuildFonts(c); - FcConfigSetCurrent(c); - } - - if(!FcInit()) { - msg(" FontConfig Initialization failed. Disabling."); - config_use_fontconfig = 0; - return 0; - } - FcConfig * config = FcConfigGetCurrent(); - if(!config) { - msg(" FontConfig Config Initialization failed. Disabling."); - config_use_fontconfig = 0; - return 0; - } - - /* add external fonts to fontconfig's config, too. */ - fontfile_t*fd = global_fonts; - while(fd) { - FcConfigAppFontAddFile(config, (FcChar8*)fd->filename); - fd = fd->next; - } - - FcFontSet * set = FcConfigGetFonts(config, FcSetSystem); - msg(" FontConfig initialized. Found %d fonts", set?set->nfont:0); - if(!set || !set->nfont) { - msg(" FontConfig has zero fonts. Disabling."); - config_use_fontconfig = 0; - return 0; - } - - if(getLogLevel() >= LOGLEVEL_TRACE) { - int t; - for(t=0;tnfont;t++) { - char*fcfamily=0,*fcstyle=0,*filename=0; - FcBool scalable=FcFalse, outline=FcFalse; - FcPatternGetString(set->fonts[t], "family", 0, (FcChar8**)&fcfamily); - FcPatternGetString(set->fonts[t], "style", 0, (FcChar8**)&fcstyle); - FcPatternGetString(set->fonts[t], "file", 0, (FcChar8**)&filename); - FcPatternGetBool(set->fonts[t], "outline", 0, &outline); - FcPatternGetBool(set->fonts[t], "scalable", 0, &scalable); - if(scalable && outline) { - msg(" %s-%s -> %s", fcfamily, fcstyle, filename); - } - } - } - } - - char*family = strdup(name); - char*style = 0; - char*dash = strchr(family, '-'); - FcPattern*pattern = 0; - if(dash) { - *dash = 0; - style = dash+1; - msg(" FontConfig: Looking for font %s (family=%s style=%s)", name, family, style); - pattern = FcPatternBuild(NULL, FC_OUTLINE, FcTypeBool, FcTrue, FC_SCALABLE, FcTypeBool, FcTrue, FC_FAMILY, FcTypeString, family, FC_STYLE, FcTypeString, style, NULL); - } else { - msg(" FontConfig: Looking for font %s (family=%s)", name, family); - pattern = FcPatternBuild(NULL, FC_OUTLINE, FcTypeBool, FcTrue, FC_SCALABLE, FcTypeBool, FcTrue, FC_FAMILY, FcTypeString, family, NULL); - } - - FcResult result; - FcConfigSubstitute(0, pattern, FcMatchPattern); - FcDefaultSubstitute(pattern); - - FcFontSet*set = FcFontSort(0, pattern, 1, 0, &result); - if(set) { - int t; - for(t=0;tnfont;t++) { - FcPattern*match = set->fonts[t]; - //FcPattern*match = FcFontMatch(0, pattern, &result); - if(fc_ismatch(match, family, style)) { - char*filename=0; - if(FcPatternGetString(match, "file", 0, (FcChar8**)&filename) != FcResultMatch) { - msg(" FontConfig: Couldn't get fontconfig's filename for font %s", name); - filename=0; - } - //FcPatternDestroy(match); - msg(" fontconfig: returning filename %s", filename); - free(family); - FcPatternDestroy(pattern); - FcFontSetDestroy(set); - return filename?strdup(filename):0; - } - } - } - free(family); - FcPatternDestroy(pattern); - FcFontSetDestroy(set); - return 0; -#else - return 0; -#endif -} - -static DisplayFontParamKind detectFontType(const char*filename) -{ - if(strstr(filename, ".ttf") || strstr(filename, ".TTF")) - return displayFontTT; - if(strstr(filename, ".pfa") || strstr(filename, ".PFA") || strstr(filename, ".pfb")) - return displayFontT1; - return displayFontTT; -} - -DisplayFontParam *GFXGlobalParams::getDisplayFont(GString *fontName) -{ - msg(" looking for font %s in global params", fontName->getCString()); - - char*name = fontName->getCString(); - - /* see if it is a pdf standard font */ - int t; - for(t=0;t Couldn't save default font- is the Temp Directory writable?"); - } else { - msg(" Storing standard PDF font %s at %s", name, pdf2t1map[t].fullfilename); - } - } - DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), displayFontT1); - dfp->t1.fileName = new GString(pdf2t1map[t].fullfilename); - return dfp; - } - } - - int bestlen = 0x7fffffff; - const char*bestfilename = 0; - -#ifndef HAVE_FONTCONFIG - /* if we don't have fontconfig, try a simple filename-comparison approach */ - fontfile_t*f = global_fonts; - while(f) { - if(strstr(f->filename, name)) { - if(f->len < bestlen) { - bestlen = f->len; - bestfilename = f->filename; - } - } - f = f->next; - } -#endif - - /* if we didn't find anything up to now, try looking for the - font via fontconfig */ - char*filename = 0; - if(!bestfilename) { - filename = fontconfig_searchForFont(name); - } else { - filename = strdup(bestfilename); - } - - if(filename) { - msg(" Font %s maps to %s\n", name, filename); - DisplayFontParamKind kind = detectFontType(filename); - DisplayFontParam *dfp = new DisplayFontParam(new GString(fontName), kind); - if(kind == displayFontTT) { - dfp->tt.fileName = new GString(filename); - } else { - dfp->t1.fileName = new GString(filename); - } - free(filename); - return dfp; - } - return GlobalParams::getDisplayFont(fontName); -} - -GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) -{ - if(!gfxglobals) - gfxglobals = new GFXOutputGlobals(); - - this->info = info; - this->doc = doc; - this->xref = doc->getXRef(); - - this->type3active = 0; - this->statepos = 0; - this->xref = 0; - this->user_movex = 0; - this->user_movey = 0; - this->clipmovex = 0; - this->clipmovey = 0; - this->user_clipx1 = 0; - this->user_clipy1 = 0; - this->user_clipx2 = 0; - this->user_clipy2 = 0; - this->current_fontinfo = 0; - this->current_text_stroke = 0; - this->current_text_clip = 0; - this->outer_clip_box = 0; - this->config_bigchar=0; - this->config_convertgradients=1; - this->config_break_on_warning=0; - this->config_remapunicode=0; - this->config_transparent=0; - this->config_extrafontdata = 0; - this->config_optimize_polygons = 0; - this->config_multiply = 1; - this->page2page = 0; - this->num_pages = 0; - - memset(states, 0, sizeof(states)); -}; - -void GFXOutputDev::setParameter(const char*key, const char*value) -{ - if(!strcmp(key,"breakonwarning")) { - this->config_break_on_warning = atoi(value); - } else if(!strcmp(key,"remapunicode")) { - this->config_remapunicode = atoi(value); - } else if(!strcmp(key,"transparent")) { - this->config_transparent = atoi(value); - } else if(!strcmp(key,"extrafontdata")) { - this->config_extrafontdata = atoi(value); - } else if(!strcmp(key,"convertgradients")) { - this->config_convertgradients = atoi(value); - } else if(!strcmp(key,"multiply")) { - this->config_multiply = atoi(value); - if(this->config_multiply<1) - this->config_multiply=1; - } else if(!strcmp(key,"optimize_polygons")) { - this->config_optimize_polygons = atoi(value); - } -} - -void GFXOutputDev::setDevice(gfxdevice_t*dev) -{ - this->device = dev; -} - -void GFXOutputDev::setMove(int x,int y) -{ - this->user_movex = x; - this->user_movey = y; -} - -void GFXOutputDev::setClip(int x1,int y1,int x2,int y2) -{ - if(x2user_clipx1 = x1; - this->user_clipy1 = y1; - this->user_clipx2 = x2; - this->user_clipy2 = y2; -} - -static char*getFontName(GfxFont*font) -{ - char*fontid; - GString*gstr = font->getName(); - char* fname = gstr==0?0:gstr->getCString(); - if(fname==0) { - char buf[32]; - Ref*r=font->getID(); - sprintf(buf, "UFONT%d", r->num); - fontid = strdup(buf); - } else { - fontid = strdup(fname); - } - - char*fontname= 0; - char* plus = strchr(fontid, '+'); - if(plus && plus < &fontid[strlen(fontid)-1]) { - fontname = strdup(plus+1); - } else { - fontname = strdup(fontid); - } - free(fontid); - return fontname; -} - -static void dumpFontInfo(const char*loglevel, GfxFont*font); -static int lastdumps[1024]; -static int lastdumppos = 0; -/* nr = 0 unknown - nr = 1 substituting - nr = 2 type 3 - */ -static void showFontError(GfxFont*font, int nr) -{ - Ref*r=font->getID(); - int t; - for(t=0;tnum) - break; - if(t < lastdumppos) - return; - if(lastdumpposnum; - if(nr == 0) - msg(" The following font caused problems:"); - else if(nr == 1) - msg(" The following font caused problems (substituting):"); - else if(nr == 2) - msg(" The following Type 3 Font will be rendered as graphics:"); - dumpFontInfo("", font); -} - -static void dumpFontInfo(const char*loglevel, GfxFont*font) -{ - char* id = getFontID(font); - char* name = getFontName(font); - Ref* r=font->getID(); - msg("%s=========== %s (ID:%d,%d) ==========", loglevel, name, r->num,r->gen); - - GString*gstr = font->getTag(); - - msg("%s| Tag: %s", loglevel, id); - - if(font->isCIDFont()) msg("%s| is CID font", loglevel); - - GfxFontType type=font->getType(); - switch(type) { - case fontUnknownType: - msg("%s| Type: unknown",loglevel); - break; - case fontType1: - msg("%s| Type: 1",loglevel); - break; - case fontType1C: - msg("%s| Type: 1C",loglevel); - break; - case fontType3: - msg("%s| Type: 3",loglevel); - break; - case fontTrueType: - msg("%s| Type: TrueType",loglevel); - break; - case fontCIDType0: - msg("%s| Type: CIDType0",loglevel); - break; - case fontCIDType0C: - msg("%s| Type: CIDType0C",loglevel); - break; - case fontCIDType2: - msg("%s| Type: CIDType2",loglevel); - break; - } - - Ref embRef; - GBool embedded = font->getEmbeddedFontID(&embRef); - char*embeddedName=0; - if(font->getEmbeddedFontName()) { - embeddedName = font->getEmbeddedFontName()->getCString(); - } - if(embedded) - msg("%s| Embedded id: %s id: %d",loglevel, FIXNULL(embeddedName), embRef.num); - - gstr = font->getExtFontFile(); - if(gstr) - msg("%s| External Font file: %s", loglevel, FIXNULL(gstr->getCString())); - - // Get font descriptor flags. - if(font->isFixedWidth()) msg("%s| is fixed width", loglevel); - if(font->isSerif()) msg("%s| is serif", loglevel); - if(font->isSymbolic()) msg("%s| is symbolic", loglevel); - if(font->isItalic()) msg("%s| is italic", loglevel); - if(font->isBold()) msg("%s| is bold", loglevel); - - free(id); - free(name); -} - -//void GFXOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) {printf("void GFXOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) \n");} -//void GFXOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) {printf("void GFXOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) \n");} - -void dump_outline(gfxline_t*line) -{ - /*gfxbbox_t*r = gfxline_isrectangle(line); - if(!r) - printf("is not a rectangle\n"); - else - printf("is a rectangle: (%f,%f)-(%f-%f)\n", r->xmin, r->ymin, r->xmax, r->ymax); - */ - - while(line) { - if(line->type == gfx_moveTo) { - msg(" | moveTo %.2f %.2f", line->x,line->y); - } else if(line->type == gfx_lineTo) { - msg(" | lineTo %.2f %.2f", line->x,line->y); - } else if(line->type == gfx_splineTo) { - msg(" | splineTo (%.2f %.2f) %.2f %.2f", line->sx,line->sy, line->x, line->y); - } - line = line->next; - } -} - -void gfxPath_dump(GfxPath*path) -{ - int num = path->getNumSubpaths(); - int t; - int cpos=0; - for(t = 0; t < num; t++) { - GfxSubpath *subpath = path->getSubpath(t); - int subnum = subpath->getNumPoints(); - int s; - for(s=0;sgetX(s); - double y=subpath->getY(s); - if(s==0 && !subpath->getCurve(s)) { - printf("M %f %f\n", x, y); - } else if(s==0 && subpath->getCurve(s)) { - printf("E %f %f\n", x, y); - } else if(subpath->getCurve(s)) { - printf("C %f %f\n", x, y); - } else { - printf("T %f %f\n", x, y); - } - } - } -} - -gfxline_t* GFXOutputDev::gfxPath_to_gfxline(GfxState*state, GfxPath*path, int closed, int user_movex, int user_movey) -{ - int num = path->getNumSubpaths(); - int s,t; - int cpos = 0; - double lastx=0,lasty=0,posx=0,posy=0; - int needsfix=0; - if(!num) { - msg(" empty path"); - return 0; - } - gfxdrawer_t draw; - gfxdrawer_target_gfxline(&draw); - - for(t = 0; t < num; t++) { - GfxSubpath *subpath = path->getSubpath(t); - int subnum = subpath->getNumPoints(); - double bx=0,by=0,cx=0,cy=0; - - for(s=0;stransformXY(state, subpath->getX(s),subpath->getY(s),&x,&y); - - if(s==0) { - if(closed && needsfix && (fabs(posx-lastx)+fabs(posy-lasty))>0.001) { - draw.lineTo(&draw, lastx, lasty); - } - draw.moveTo(&draw, x,y); - posx = lastx = x; - posy = lasty = y; - cpos = 0; - needsfix = 0; - } else if(subpath->getCurve(s) && cpos==0) { - bx = x; - by = y; - cpos = 1; - } else if(subpath->getCurve(s) && cpos==1) { - cx = x; - cy = y; - cpos = 2; - } else { - posx = x; - posy = y; - if(cpos==0) { - draw.lineTo(&draw, x,y); - } else { - gfxdraw_cubicTo(&draw, bx,by, cx,cy, x,y, 0.05); - } - needsfix = 1; - cpos = 0; - } - } - } - /* fix non-closed lines */ - if(closed && needsfix && (fabs(posx-lastx)+fabs(posy-lasty))>0.001) { - draw.lineTo(&draw, lastx, lasty); - } - gfxline_t*result = (gfxline_t*)draw.result(&draw); - - gfxline_optimize(result); - - return result; -} - -GBool GFXOutputDev::useTilingPatternFill() -{ - infofeature("tiled patterns"); -// if(config_convertgradients) -// return gTrue; - return gFalse; -} -GBool GFXOutputDev::useShadedFills() -{ - infofeature("shaded fills"); - if(config_convertgradients) - return gTrue; - return gFalse; -} - -void GFXOutputDev::transformXY(GfxState*state, double x, double y, double*nx, double*ny) -{ - state->transform(x,y,nx,ny); - *nx += user_movex + clipmovex; - *ny += user_movey + clipmovey; -} - - -#if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207 -void GFXOutputDev::tilingPatternFill(GfxState *state, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep) -#else -void GFXOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep) -#endif -{ - msg(" tilingPatternFill"); - infofeature("tiling pattern fills"); -} - -GBool GFXOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) -{ - msg(" functionShadedFill not supported yet"); - infofeature("function shaded fills"); - return gFalse; -} -static gfxcolor_t col2col(GfxColorSpace*colspace, GfxColor* col) -{ - gfxcolor_t c; - GfxRGB rgb; - colspace->getRGB(col, &rgb); - c.r = colToByte(rgb.r); - c.g = colToByte(rgb.g); - c.b = colToByte(rgb.b); - c.a = 255; - return c; -} - -GBool GFXOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading) -{ - double x0,y0,r0,x1,y1,x2,y2,x9,y9,r1; - shading->getCoords(&x0,&y0,&r0,&x9,&y9,&r1); - x1=x0+r1;y1=y0; - x2=x0; y2=y0+r1; - this->transformXY(state, x0,y0, &x0,&y0); - this->transformXY(state, x1,y1, &x1,&y1); - this->transformXY(state, x2,y2, &x2,&y2); - - GfxColor color0; - GfxColor color1; - GfxColor color2; - shading->getColor(0.0, &color0); - shading->getColor(0.5, &color1); - shading->getColor(1.0, &color2); - - GfxColorSpace* colspace = shading->getColorSpace(); - - msg(" radialShadedFill %f %f %f %f %f %f %02x%02x%02x->%02x%02x%02x", x0, y0, x1, y1, x2, y2, - colToByte(color0.c[0]), colToByte(color0.c[1]), colToByte(color0.c[2]), - colToByte(color1.c[0]), colToByte(color1.c[1]), colToByte(color1.c[2]), - colToByte(color2.c[0]), colToByte(color2.c[1]), colToByte(color2.c[2])); - infofeature("radial shaded fills"); - - gfxgradient_t*g = (gfxgradient_t*)malloc(sizeof(gfxgradient_t)*3); - g[0].next = &g[1]; - g[1].next = &g[2]; - g[2].next = 0; - g[0].color = col2col(colspace, &color0); - g[1].color = col2col(colspace, &color1); - g[2].color = col2col(colspace, &color2); - g[0].pos = 0.0; - g[1].pos = 0.5; - g[2].pos = 1.0; - - gfxbbox_t b = states[statepos].clipbbox; - gfxline_t p1,p2,p3,p4,p5; - p1.type=gfx_moveTo;p1.x=b.xmin; p1.y=b.ymin; p1.next=&p2; - p2.type=gfx_lineTo;p2.x=b.xmin; p2.y=b.ymax; p2.next=&p3; - p3.type=gfx_lineTo;p3.x=b.xmax; p3.y=b.ymax; p3.next=&p4; - p4.type=gfx_lineTo;p4.x=b.xmax; p4.y=b.ymin; p4.next=&p5; - p5.type=gfx_lineTo;p5.x=b.xmin; p5.y=b.ymin; p5.next=0; - - gfxmatrix_t m; - //m.m00 = (x3-x0); m.m10 = (x1-x0); - //m.m01 = (y3-y0); m.m11 = (y1-y0); - //x3/y3 specifies another (the ending) circle, not the second radius of an ellipse - m.m00 = (x1-x0); m.m10 = (x2-x0); - m.m01 = (y1-y0); m.m11 = (y2-y0); - m.tx = x0 - 0.5; - m.ty = y0 - 0.5; - - device->fillgradient(device, &p1, g, gfxgradient_radial, &m); - return gTrue; -} - -GBool GFXOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading) -{ - double x0,y0,x1,y1; - shading->getCoords(&x0,&y0,&x1,&y1); - this->transformXY(state, x0,y0,&x0,&y0); - this->transformXY(state, x1,y1,&x1,&y1); - - GfxColor color0; - GfxColor color1; - GfxColor color2; - shading->getColor(0.0, &color0); - shading->getColor(0.5, &color1); - shading->getColor(1.0, &color2); - - GfxColorSpace* colspace = shading->getColorSpace(); - - msg(" axialShadedFill %f %f %f %f %02x%02x%02x->%02x%02x%02x->%02x%02x%02x", x0, y0, x1, y1, - colToByte(color0.c[0]), colToByte(color0.c[1]), colToByte(color0.c[2]), - colToByte(color1.c[0]), colToByte(color1.c[1]), colToByte(color1.c[2]), - colToByte(color2.c[0]), colToByte(color2.c[1]), colToByte(color2.c[2]) - ); - infofeature("axial shaded fills"); - - gfxgradient_t*g = (gfxgradient_t*)malloc(sizeof(gfxgradient_t)*3); - g[0].next = &g[1]; - g[1].next = &g[2]; - g[2].next = 0; - g[0].color = col2col(colspace, &color0); - g[1].color = col2col(colspace, &color1); - g[2].color = col2col(colspace, &color2); - g[0].pos = 0.0; - g[1].pos = 0.5; - g[2].pos = 1.0; - - double xMin,yMin,xMax,yMax; - state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax); - this->transformXY(state, xMin, yMin, &xMin, &yMin); - msg(" userClipBox %f %f %f %f", xMin, yMin, xMax, yMax); - - xMin = 0; yMin = 0; - xMin = 1024; yMin = 1024; - - gfxbbox_t b = states[statepos].clipbbox; - gfxline_t p1,p2,p3,p4,p5; - p1.type=gfx_moveTo;p1.x=b.xmin; p1.y=b.ymin; p1.next=&p2; - p2.type=gfx_lineTo;p2.x=b.xmin; p2.y=b.ymax; p2.next=&p3; - p3.type=gfx_lineTo;p3.x=b.xmax; p3.y=b.ymax; p3.next=&p4; - p4.type=gfx_lineTo;p4.x=b.xmax; p4.y=b.ymin; p4.next=&p5; - p5.type=gfx_lineTo;p5.x=b.xmin; p5.y=b.ymin; p5.next=0; - - /* the gradient starts at (-1.0,0.0), so move (0,0) to - the middle of the two control points */ - gfxmatrix_t m; - m.m00 = (x1-x0)/2; m.m10 = -(y1-y0)/2; - m.m01 = (y1-y0)/2; m.m11 = (x1-x0)/2; - m.tx = (x0 + x1)/2 - 0.5; - m.ty = (y0 + y1)/2 - 0.5; - - device->fillgradient(device, &p1, g, gfxgradient_linear, &m); - - free(g); - return gTrue; -} - -GBool GFXOutputDev::useDrawForm() -{ - infofeature("forms"); - return gFalse; -} -void GFXOutputDev::drawForm(Ref id) -{ - msg(" drawForm not implemented"); -} -GBool GFXOutputDev::needNonText() -{ - return gTrue; -} -void GFXOutputDev::endPage() -{ - msg(" endPage (GfxOutputDev)"); - if(outer_clip_box) { - device->endclip(device); - outer_clip_box = 0; - } - /* notice: we're not fully done yet with this page- there might still be - a few calls to drawLink() yet to come */ -} - -static inline double sqr(double x) {return x*x;} - -#define STROKE_FILL 1 -#define STROKE_CLIP 2 -void GFXOutputDev::strokeGfxline(GfxState *state, gfxline_t*line, int flags) -{ - int lineCap = state->getLineCap(); // 0=butt, 1=round 2=square - int lineJoin = state->getLineJoin(); // 0=miter, 1=round 2=bevel - double miterLimit = state->getMiterLimit(); - double width = state->getTransformedLineWidth(); - - GfxRGB rgb; - double opaq = state->getStrokeOpacity(); - if(type3active) - state->getFillRGB(&rgb); - else - state->getStrokeRGB(&rgb); - gfxcolor_t col; - col.r = colToByte(rgb.r); - col.g = colToByte(rgb.g); - col.b = colToByte(rgb.b); - col.a = (unsigned char)(opaq*255); - - gfx_capType capType = gfx_capRound; - if(lineCap == 0) capType = gfx_capButt; - else if(lineCap == 1) capType = gfx_capRound; - else if(lineCap == 2) capType = gfx_capSquare; - else msg(" Invalid line cap type"); - - gfx_joinType joinType = gfx_joinRound; - if(lineJoin == 0) joinType = gfx_joinMiter; - else if(lineJoin == 1) joinType = gfx_joinRound; - else if(lineJoin == 2) joinType = gfx_joinBevel; - else msg(" Invalid line join type"); - - gfxline_t*line2 = 0; - - int dashLength = states[statepos].dashLength; - double*dashPattern = states[statepos].dashPattern; - double dashStart = states[statepos].dashStart; - if(dashLength && dashPattern) { - float * dash = (float*)malloc(sizeof(float)*(dashLength+1)); - int t; - - /* try to find out how much the transformation matrix would - stretch the dashes, and factor that into the dash lengths. - This is not the entirely correct approach- it would be - better to first convert the path to an unscaled version, - then apply dashing, and then transform the path using - the current transformation matrix. However there are few - PDFs which actually stretch a dashed path in a non-orthonormal - way */ - double tx1, ty1, tx2, ty2, tx3, ty3; - this->transformXY(state, 0, 0, &tx1, &ty1); - this->transformXY(state, 0, 1, &tx2, &ty2); - this->transformXY(state, 1, 0, &tx3, &ty3); - double d1 = sqrt(sqr(tx2-tx1)+sqr(ty2-ty1)); - double d2 = sqrt(sqr(tx3-tx1)+sqr(ty3-ty1)); - if(fabs(d1-d2)>0.5) - warnfeature("non-ortogonally dashed strokes", 0); - double f = (d1+d2)/2; - - msg(" %d dashes", dashLength); - msg(" | phase: %f", dashStart); - for(t=0;t | d%-3d: %f", t, dashPattern[t]); - } - dash[dashLength] = -1; - if(getLogLevel() >= LOGLEVEL_TRACE) { - dump_outline(line); - } - - line2 = gfxtool_dash_line(line, dash, (float)(dashStart*f)); - line = line2; - - free(dash); - msg(" After dashing:"); - } - - if(getLogLevel() >= LOGLEVEL_TRACE) { - msg(" stroke width=%f join=%s cap=%s dashes=%d color=%02x%02x%02x%02x", - width, - lineJoin==0?"miter": (lineJoin==1?"round":"bevel"), - lineCap==0?"butt": (lineCap==1?"round":"square"), - dashLength, - col.r,col.g,col.b,col.a - ); - dump_outline(line); - } - - if(flags&STROKE_FILL) { - gfxpoly_t* poly = gfxpoly_strokeToPoly(line, width, capType, joinType, miterLimit); - gfxline_t*gfxline = gfxpoly_to_gfxline(poly); - if(getLogLevel() >= LOGLEVEL_TRACE) { - dump_outline(gfxline); - } - if(!gfxline) { - msg(" Empty polygon (resulting from stroked line)"); - } - if(flags&STROKE_CLIP) { - device->startclip(device, gfxline); - states[statepos].clipping++; - } else { - device->fill(device, gfxline, &col); - } - gfxline_free(gfxline); - gfxpoly_free(poly); - } else { - if(flags&STROKE_CLIP) - msg(" Stroke&clip not supported at the same time"); - device->stroke(device, line, width, &col, capType, joinType, miterLimit); - } - - if(line2) - gfxline_free(line2); -} - -gfxcolor_t getFillColor(GfxState * state) -{ - GfxRGB rgb; - double opaq = state->getFillOpacity(); - state->getFillRGB(&rgb); - gfxcolor_t col; - col.r = colToByte(rgb.r); - col.g = colToByte(rgb.g); - col.b = colToByte(rgb.b); - col.a = (unsigned char)(opaq*255); - return col; -} - -void GFXOutputDev::fillGfxLine(GfxState *state, gfxline_t*line) -{ - gfxcolor_t col = getFillColor(state); - - if(getLogLevel() >= LOGLEVEL_TRACE) { - msg(" fill %02x%02x%02x%02x", col.r, col.g, col.b, col.a); - dump_outline(line); - } - device->fill(device, line, &col); -} - -void GFXOutputDev::clipToGfxLine(GfxState *state, gfxline_t*line) -{ - if(getLogLevel() >= LOGLEVEL_TRACE) { - dump_outline(line); - } - gfxbbox_t bbox = gfxline_getbbox(line); - gfxbbox_intersect(&states[statepos].clipbbox, &bbox); - - device->startclip(device, line); - states[statepos].clipping++; -} - -void GFXOutputDev::clip(GfxState *state) -{ - GfxPath * path = state->getPath(); - msg(" clip"); - gfxline_t*line = gfxPath_to_gfxline(state, path, 1, user_movex + clipmovex, user_movey + clipmovey); - if(config_optimize_polygons) { - gfxline_t*line2 = gfxline_circularToEvenOdd(line); - gfxline_free(line); - line = line2; - } - clipToGfxLine(state, line); - gfxline_free(line); -} - -void GFXOutputDev::eoClip(GfxState *state) -{ - GfxPath * path = state->getPath(); - gfxline_t*line = gfxPath_to_gfxline(state, path, 1, user_movex + clipmovex, user_movey + clipmovey); - clipToGfxLine(state, line); - gfxline_free(line); -} -void GFXOutputDev::clipToStrokePath(GfxState *state) -{ - GfxPath * path = state->getPath(); - gfxline_t*line= gfxPath_to_gfxline(state, path, 0, user_movex + clipmovex, user_movey + clipmovey); - - if(getLogLevel() >= LOGLEVEL_TRACE) { - double width = state->getTransformedLineWidth(); - msg(" cliptostrokepath width=%f", width); - dump_outline(line); - } - - strokeGfxline(state, line, STROKE_FILL|STROKE_CLIP); - gfxline_free(line); -} - -void GFXOutputDev::finish() -{ - if(outer_clip_box) { - if(device) { - device->endclip(device); - } - outer_clip_box = 0; - } -} - -GFXOutputDev::~GFXOutputDev() -{ - finish(); -}; -GBool GFXOutputDev::upsideDown() -{ - return gTrue; -}; -GBool GFXOutputDev::useDrawChar() -{ - return gTrue; -} - -const char*renderModeDesc[]= {"fill", "stroke", "fill+stroke", "invisible", - "clip+fill", "stroke+clip", "fill+stroke+clip", "clip"}; - -static char tmp_printstr[4096]; -char* makeStringPrintable(char*str) -{ - int len = strlen(str); - int dots = 0; - if(len>=80) { - len = 80; - dots = 1; - } - int t; - for(t=0;t124) { - c = '.'; - } - tmp_printstr[t] = c; - } - if(dots) { - tmp_printstr[len++] = '.'; - tmp_printstr[len++] = '.'; - tmp_printstr[len++] = '.'; - } - tmp_printstr[len] = 0; - return tmp_printstr; -} -void GFXOutputDev::updateFontMatrix(GfxState*state) -{ - double* ctm = state->getCTM(); - double fontSize = state->getFontSize(); - double*textMat = state->getTextMat(); - - /* taking the absolute value of horizScaling seems to be required for - some italic fonts. FIXME: SplashOutputDev doesn't need this- why? */ - double hscale = fabs(state->getHorizScaling()); - - // from xpdf-3.02/SplashOutputDev:updateFont - double mm11 = textMat[0] * fontSize * hscale; - double mm12 = textMat[1] * fontSize * hscale; - double mm21 = textMat[2] * fontSize; - double mm22 = textMat[3] * fontSize; - - // multiply with ctm, like state->getFontTransMat() does - this->current_font_matrix.m00 = (ctm[0]*mm11 + ctm[2]*mm12) / INTERNAL_FONT_SIZE; - this->current_font_matrix.m01 = (ctm[1]*mm11 + ctm[3]*mm12) / INTERNAL_FONT_SIZE; - this->current_font_matrix.m10 = (ctm[0]*mm21 + ctm[2]*mm22) / INTERNAL_FONT_SIZE; - this->current_font_matrix.m11 = (ctm[1]*mm21 + ctm[3]*mm22) / INTERNAL_FONT_SIZE; - this->current_font_matrix.tx = 0; - this->current_font_matrix.ty = 0; -} - -void GFXOutputDev::beginString(GfxState *state, GString *s) -{ - int render = state->getRender(); - if(current_text_stroke) { - msg(" Error: Incompatible change of text rendering to %d while inside cliptext", render); - } - msg(" beginString(%s) render=%d", makeStringPrintable(s->getCString()), render); -} - -static gfxline_t* mkEmptyGfxShape(double x, double y) -{ - gfxline_t*line = (gfxline_t*)malloc(sizeof(gfxline_t)); - line->x = x;line->y = y;line->type = gfx_moveTo;line->next = 0; - return line; -} - -static char isValidUnicode(int c) -{ - if(c>=32 && c<0x2fffe) - return 1; - return 0; -} - -void GFXOutputDev::drawChar(GfxState *state, double x, double y, - double dx, double dy, - double originX, double originY, - CharCode charid, int nBytes, Unicode *_u, int uLen) -{ - if(!current_fontinfo || (unsigned)charid >= current_fontinfo->num_glyphs || !current_fontinfo->glyphs[charid]) { - msg(" Invalid charid %d for font (%d characters)", charid, current_fontinfo?current_fontinfo->num_glyphs:0); - return; - } - - CharCode glyphid = current_fontinfo->glyphs[charid]->glyphid; - - int render = state->getRender(); - gfxcolor_t col = getFillColor(state); - - // check for invisible text -- this is used by Acrobat Capture - if (render == RENDER_INVISIBLE) { - col.a = 0; - if(!config_extrafontdata) - return; - } - - GfxFont*font = state->getFont(); - - if(font->getType() == fontType3) { - /* type 3 chars are passed as graphics */ - msg(" type3 char at %f/%f", x, y); - return; - } - - Unicode u = uLen?(_u[0]):0; - - gfxmatrix_t m = this->current_font_matrix; - this->transformXY(state, x-originX, y-originY, &m.tx, &m.ty); - //m.tx += originX; m.ty += originY; - - msg(" drawChar(%f,%f,c='%c' (%d), u=%d <%d>) CID=%d render=%d glyphid=%d font=%08x",m.tx,m.ty,(charid&127)>=32?charid:'?', charid, u, uLen, font->isCIDFont(), render, glyphid, current_gfxfont); - - if(render == RENDER_FILL || render == RENDER_INVISIBLE) { - device->drawchar(device, current_gfxfont, glyphid, &col, &m); - } else { - msg(" Drawing glyph %d as shape", charid); - if(!gfxglobals->textmodeinfo) { - msg(" Some texts will be rendered as shape"); - gfxglobals->textmodeinfo = 1; - } - gfxline_t*glyph = current_gfxfont->glyphs[glyphid].line; - gfxline_t*tglyph = gfxline_clone(glyph); - gfxline_transform(tglyph, &m); - if((render&3) != RENDER_INVISIBLE) { - gfxline_t*add = gfxline_clone(tglyph); - current_text_stroke = gfxline_append(current_text_stroke, add); - } - if(render&RENDER_CLIP) { - gfxline_t*add = gfxline_clone(tglyph); - current_text_clip = gfxline_append(current_text_clip, add); - if(!current_text_clip) { - current_text_clip = mkEmptyGfxShape(m.tx, m.ty); - } - } - gfxline_free(tglyph); - } -} - -void GFXOutputDev::endString(GfxState *state) -{ - int render = state->getRender(); - msg(" endString() render=%d textstroke=%08x", render, current_text_stroke); - - if(current_text_stroke) { - /* fillstroke and stroke text rendering objects we can process right - now (as there may be texts of other rendering modes in this - text object)- clipping objects have to wait until endTextObject, - however */ - device->setparameter(device, "mark","TXT"); - if((render&3) == RENDER_FILL) { - fillGfxLine(state, current_text_stroke); - gfxline_free(current_text_stroke); - current_text_stroke = 0; - } else if((render&3) == RENDER_FILLSTROKE) { - fillGfxLine(state, current_text_stroke); - strokeGfxline(state, current_text_stroke,0); - gfxline_free(current_text_stroke); - current_text_stroke = 0; - } else if((render&3) == RENDER_STROKE) { - strokeGfxline(state, current_text_stroke,0); - gfxline_free(current_text_stroke); - current_text_stroke = 0; - } - device->setparameter(device, "mark",""); - } -} - -void GFXOutputDev::endTextObject(GfxState *state) -{ - int render = state->getRender(); - msg(" endTextObject() render=%d textstroke=%08x clipstroke=%08x", render, current_text_stroke, current_text_clip); - - if(current_text_clip) { - device->setparameter(device, "mark","TXT"); - clipToGfxLine(state, current_text_clip); - device->setparameter(device, "mark",""); - gfxline_free(current_text_clip); - current_text_clip = 0; - } -} - -/* the logic seems to be as following: - first, beginType3Char is called, with the charcode and the coordinates. - if this function returns true, it already knew about the char and has now drawn it. - if the function returns false, it's a new char, and type3D0 and/or type3D1 might be - called with some parameters. - Afterwards, all draw operations until endType3Char are part of the char (which in this moment is - at the position first passed to beginType3Char). the char ends with endType3Char. - - The drawing operations between beginType3Char and endType3Char are somewhat different to - the normal ones. For example, the fillcolor equals the stroke color. (Because the stroke - color determines the color of a font) -*/ - -GBool GFXOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode charid, Unicode *u, int uLen) -{ - msg(" beginType3Char %d u=%d", charid, uLen?u[0]:0); - type3active = 1; - - if(config_extrafontdata && current_fontinfo) { - - gfxmatrix_t m = this->current_font_matrix; - this->transformXY(state, 0, 0, &m.tx, &m.ty); - m.m00*=INTERNAL_FONT_SIZE; - m.m01*=INTERNAL_FONT_SIZE; - m.m10*=INTERNAL_FONT_SIZE; - m.m11*=INTERNAL_FONT_SIZE; - - if(!current_fontinfo || (unsigned)charid >= current_fontinfo->num_glyphs || !current_fontinfo->glyphs[charid]) { - msg(" Invalid charid %d for font", charid); - return gFalse; - } - gfxcolor_t col={0,0,0,0}; - CharCode glyphid = current_fontinfo->glyphs[charid]->glyphid; - device->drawchar(device, current_gfxfont, glyphid, &col, &m); - } - - - /* the character itself is going to be passed using the draw functions */ - return gFalse; /* gTrue= is_in_cache? */ -} - -void GFXOutputDev::type3D0(GfxState *state, double wx, double wy) { -} -void GFXOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) { -} - -void GFXOutputDev::endType3Char(GfxState *state) -{ - type3active = 0; - msg(" endType3Char"); -} - -void GFXOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2) -{ - this->currentpage = pageNum; - double x1,y1,x2,y2; - int rot = doc->getPageRotate(1); - gfxcolor_t white = {255,255,255,255}; - gfxcolor_t black = {255,0,0,0}; - laststate = state; - gfxline_t clippath[5]; - - /* state->transform(state->getX1(),state->getY1(),&x1,&y1); - state->transform(state->getX2(),state->getY2(),&x2,&y2); - Use CropBox, not MediaBox, as page size - */ - - /*x1 = crop_x1; - y1 = crop_y1; - x2 = crop_x2; - y2 = crop_y2;*/ - state->transform(crop_x1,crop_y1,&x1,&y1); //x1 += user_movex; y1 += user_movey; - state->transform(crop_x2,crop_y2,&x2,&y2); //x2 += user_movex; y2 += user_movey; - - if(x2clipmovex = -(int)x1; - this->clipmovey = -(int)y1; - - /* apply user clip box */ - if(user_clipx1|user_clipy1|user_clipx2|user_clipy2) { - /*if(user_clipx1 > x1)*/ x1 = user_clipx1; - /*if(user_clipx2 < x2)*/ x2 = user_clipx2; - /*if(user_clipy1 > y1)*/ y1 = user_clipy1; - /*if(user_clipy2 < y2)*/ y2 = user_clipy2; - msg(" Using user clip box %f/%f/%f/%f",x1,y1,x2,y2); - } else { - x1 += this->clipmovex; - y1 += this->clipmovey; - x2 += this->clipmovex; - y2 += this->clipmovey; - } - - //msg(" Bounding box is (%f,%f)-(%f,%f) [shifted by %d/%d]", x1,y1,x2,y2, user_movex, user_movey); - - msg(" processing PDF page %d (%dx%d:%d:%d) (move:%d:%d)", pageNum, (int)x2-(int)x1,(int)y2-(int)y1, (int)x1, (int)y1, user_movex + clipmovex, user_movey + clipmovey); - if(rot!=0) - msg(" page is rotated %d degrees", rot); - - clippath[0].type = gfx_moveTo;clippath[0].x = x1; clippath[0].y = y1; clippath[0].next = &clippath[1]; - clippath[1].type = gfx_lineTo;clippath[1].x = x2; clippath[1].y = y1; clippath[1].next = &clippath[2]; - clippath[2].type = gfx_lineTo;clippath[2].x = x2; clippath[2].y = y2; clippath[2].next = &clippath[3]; - clippath[3].type = gfx_lineTo;clippath[3].x = x1; clippath[3].y = y2; clippath[3].next = &clippath[4]; - clippath[4].type = gfx_lineTo;clippath[4].x = x1; clippath[4].y = y1; clippath[4].next = 0; - device->startclip(device, clippath); outer_clip_box = 1; - if(!config_transparent) { - device->fill(device, clippath, &white); - } - states[statepos].clipbbox.xmin = x1; - states[statepos].clipbbox.ymin = x1; - states[statepos].clipbbox.xmax = x2; - states[statepos].clipbbox.ymax = y2; - - states[statepos].dashPattern = 0; - states[statepos].dashLength = 0; - states[statepos].dashStart = 0; -} - - -void GFXOutputDev::processLink(Link *link, Catalog *catalog) -{ - double x1, y1, x2, y2; - gfxline_t points[5]; - int x, y; - - msg(" drawlink"); - - link->getRect(&x1, &y1, &x2, &y2); - cvtUserToDev(x1, y1, &x, &y); - points[0].type = gfx_moveTo; - points[0].x = points[4].x = x + user_movex + clipmovex; - points[0].y = points[4].y = y + user_movey + clipmovey; - points[0].next = &points[1]; - cvtUserToDev(x2, y1, &x, &y); - points[1].type = gfx_lineTo; - points[1].x = x + user_movex + clipmovex; - points[1].y = y + user_movey + clipmovey; - points[1].next = &points[2]; - cvtUserToDev(x2, y2, &x, &y); - points[2].type = gfx_lineTo; - points[2].x = x + user_movex + clipmovex; - points[2].y = y + user_movey + clipmovey; - points[2].next = &points[3]; - cvtUserToDev(x1, y2, &x, &y); - points[3].type = gfx_lineTo; - points[3].x = x + user_movex + clipmovex; - points[3].y = y + user_movey + clipmovey; - points[3].next = &points[4]; - cvtUserToDev(x1, y1, &x, &y); - points[4].type = gfx_lineTo; - points[4].x = x + user_movex + clipmovex; - points[4].y = y + user_movey + clipmovey; - points[4].next = 0; - - msg(" drawlink %.2f/%.2f %.2f/%.2f %.2f/%.2f %.2f/%.2f", - points[0].x, points[0].y, - points[1].x, points[1].y, - points[2].x, points[2].y, - points[3].x, points[3].y); - - if(getLogLevel() >= LOGLEVEL_TRACE) { - dump_outline(points); - } - - LinkAction*action=link->getAction(); - char buf[128]; - char*s = 0; - const char*type = "-?-"; - char*named = 0; - int page = -1; - msg(" drawlink action=%d", action->getKind()); - switch(action->getKind()) - { - case actionGoTo: { - type = "GoTo"; - LinkGoTo *ha=(LinkGoTo *)link->getAction(); - LinkDest *dest=NULL; - if (ha->getDest()==NULL) - dest=catalog->findDest(ha->getNamedDest()); - else - dest=ha->getDest()->copy(); - if (dest){ - if (dest->isPageRef()){ - Ref pageref=dest->getPageRef(); - page=catalog->findPage(pageref.num,pageref.gen); - } - else page=dest->getPageNum(); - sprintf(buf, "%d", page); - s = strdup(buf); - delete dest; - } - } - break; - case actionGoToR: { - type = "GoToR"; - LinkGoToR*l = (LinkGoToR*)action; - GString*g = l->getFileName(); - if(g) - s = strdup(g->getCString()); - if(!s) { - /* if the GoToR link has no filename, then - try to find a refernce in the *local* - file */ - GString*g = l->getNamedDest(); - if(g) - s = strdup(g->getCString()); - } - } - break; - case actionNamed: { - type = "Named"; - LinkNamed*l = (LinkNamed*)action; - GString*name = l->getName(); - if(name) { - s = strdup(name->lowerCase()->getCString()); - named = name->getCString(); - if(!strchr(s,':')) - { - if(strstr(s, "next") || strstr(s, "forward")) - { - page = currentpage + 1; - } - else if(strstr(s, "prev") || strstr(s, "back")) - { - page = currentpage - 1; - } - else if(strstr(s, "last") || strstr(s, "end")) - { - if(this->page2page && this->num_pages) { - page = this->page2page[this->num_pages-1]; - } - } - else if(strstr(s, "first") || strstr(s, "top")) - { - page = 1; - } - } - } - } - break; - case actionLaunch: { - type = "Launch"; - LinkLaunch*l = (LinkLaunch*)action; - GString * str = new GString(l->getFileName()); - GString * params = l->getParams(); - if(params) - str->append(params); - s = strdup(str->getCString()); - delete str; - } - break; - case actionURI: { - char*url = 0; - type = "URI"; - LinkURI*l = (LinkURI*)action; - GString*g = l->getURI(); - if(g) { - url = g->getCString(); - s = strdup(url); - } - } - break; - case actionUnknown: { - type = "Unknown"; - LinkUnknown*l = (LinkUnknown*)action; - s = strdup(""); - } - break; - default: { - msg(" Unknown link type!"); - break; - } - } - - if(!s) s = strdup("-?-"); - - msg(" drawlink s=%s", s); - - if(!gfxglobals->linkinfo && (page || s)) - { - msg(" File contains links"); - gfxglobals->linkinfo = 1; - } - - if(page>0) { - int t; - int lpage = -1; - for(t=1;t<=this->num_pages;t++) { - if(this->page2page[t]==page) { - lpage = t; - break; - } - } - if(lpage<0) { - lpage = page; - } - - char buf[80]; - sprintf(buf, "page%d", lpage); - device->drawlink(device, points, buf); - } - else if(s) - { - device->drawlink(device, points, s); - } - - msg(" \"%s\" link to \"%s\" (%d)", type, FIXNULL(s), page); - free(s);s=0; -} - -void GFXOutputDev::saveState(GfxState *state) { - dbg("saveState %08x", state); dbgindent+=2; - - msg(" saveState %08x", state); - updateAll(state); - if(statepos>=64) { - msg(" Too many nested states in pdf."); - exit(1); - } - statepos ++; - states[statepos].state = state; - states[statepos].createsoftmask = states[statepos-1].createsoftmask; - states[statepos].transparencygroup = states[statepos-1].transparencygroup; - states[statepos].clipping = 0; - states[statepos].olddevice = 0; - states[statepos].clipbbox = states[statepos-1].clipbbox; - - states[statepos].dashPattern = states[statepos-1].dashPattern; - states[statepos].dashStart = states[statepos-1].dashStart; - states[statepos].dashLength = states[statepos-1].dashLength; -}; - -void GFXOutputDev::restoreState(GfxState *state) { - dbgindent-=2; dbg("restoreState %08x", state); - - if(statepos==0) { - msg(" Invalid restoreState"); - exit(1); - } - msg(" restoreState %08x%s%s", state, - states[statepos].softmask?" (end softmask)":"", - states[statepos].clipping?" (end clipping)":""); - if(states[statepos].softmask) { - clearSoftMask(state); - } - - if(states[statepos].dashPattern) { - if(!statepos || states[statepos-1].dashPattern != states[statepos].dashPattern) { - free(states[statepos].dashPattern); - states[statepos].dashPattern = 0; - } - } - - updateAll(state); - - while(states[statepos].clipping) { - device->endclip(device); - states[statepos].clipping--; - } - if(states[statepos].state!=state) { - msg(" bad state nesting"); - exit(1); - } - states[statepos].state=0; - statepos--; -} - -void GFXOutputDev::updateLineDash(GfxState *state) -{ - if(states[statepos].dashPattern && - (!statepos || states[statepos-1].dashPattern != states[statepos].dashPattern)) { - free(states[statepos].dashPattern); - states[statepos].dashPattern = 0; - } - double *pattern = 0; - int dashLength; - double dashStart; - state->getLineDash(&pattern, &dashLength, &dashStart); - msg(" updateLineDash, %d dashes", dashLength); - if(!dashLength) { - states[statepos].dashPattern = 0; - states[statepos].dashLength = 0; - } else { - double*p = (double*)malloc(dashLength*sizeof(states[statepos].dashPattern[0])); - memcpy(p, pattern, dashLength*sizeof(states[statepos].dashPattern[0])); - states[statepos].dashPattern = p; - states[statepos].dashLength = dashLength; - states[statepos].dashStart = dashStart; - } -} - -void GFXOutputDev::setPageMap(int*page2page, int num_pages) -{ - this->page2page = page2page; - this->num_pages = num_pages; -} - -void GFXOutputDev::updateLineWidth(GfxState *state) -{ - double width = state->getTransformedLineWidth(); -} - -void GFXOutputDev::updateLineCap(GfxState *state) -{ - int c = state->getLineCap(); -} - -void GFXOutputDev::updateLineJoin(GfxState *state) -{ - int j = state->getLineJoin(); -} - -void GFXOutputDev::updateFillColor(GfxState *state) -{ - GfxRGB rgb; - double opaq = state->getFillOpacity(); - state->getFillRGB(&rgb); -} -void GFXOutputDev::updateFillOpacity(GfxState *state) -{ - GfxRGB rgb; - double opaq = state->getFillOpacity(); - state->getFillRGB(&rgb); - dbg("update fillopaq %f", opaq); -} -void GFXOutputDev::updateStrokeOpacity(GfxState *state) -{ - double opaq = state->getFillOpacity(); - dbg("update strokeopaq %f", opaq); -} -void GFXOutputDev::updateFillOverprint(GfxState *state) -{ - double opaq = state->getFillOverprint(); - dbg("update filloverprint %f", opaq); -} -void GFXOutputDev::updateStrokeOverprint(GfxState *state) -{ - double opaq = state->getStrokeOverprint(); - dbg("update strokeoverprint %f", opaq); -} -void GFXOutputDev::updateTransfer(GfxState *state) -{ - dbg("update transfer"); -} - - -void GFXOutputDev::updateStrokeColor(GfxState *state) -{ - GfxRGB rgb; - double opaq = state->getStrokeOpacity(); - state->getStrokeRGB(&rgb); -} - -void GFXOutputDev::updateFont(GfxState *state) -{ - GfxFont* gfxFont = state->getFont(); - if (!gfxFont) { - return; - } - char*id = getFontID(gfxFont); - msg(" Updating font to %s", id); - if(gfxFont->getType() == fontType3) { - infofeature("Type3 fonts"); - if(!config_extrafontdata) { - return; - } - } - if(!id) { - msg(" Internal Error: FontID is null"); - return; - } - - this->current_fontinfo = this->info->getFont(id); - - if(!this->current_fontinfo) { - msg(" Internal Error: no fontinfo for font %s", id); - return; - } - if(!this->current_fontinfo->seen) { - dumpFontInfo("", gfxFont); - } - - current_gfxfont = this->current_fontinfo->getGfxFont(); - device->addfont(device, current_gfxfont); - free(id); - - updateFontMatrix(state); -} - -#define SQR(x) ((x)*(x)) - -unsigned char* antialize(unsigned char*data, int width, int height, int newwidth, int newheight, int palettesize) -{ - if((newwidth<1 || newheight<1) || - (width<=newwidth || height<=newheight)) - return 0; - unsigned char*newdata; - int x,y; - newdata= (unsigned char*)malloc(newwidth*newheight); - double fx = ((double)width)/newwidth; - double fy = ((double)height)/newheight; - double px = 0; - int blocksize = (int)(8192/(fx*fy)); - int r = 8192*256/palettesize; - for(x=0;x=width) - tox = width-1; - if(toy>=height) - toy = height-1; - for(xx=fromx;xx<=tox;xx++) - for(yy=fromy;yy<=toy;yy++) { - int b = 1-data[width*yy+xx]; - int weight=256; - if(xx==fromx) weight = (weight*xweight1)/256; - if(xx==tox) weight = (weight*xweight2)/256; - if(yy==fromy) weight = (weight*yweight1)/256; - if(yy==toy) weight = (weight*yweight2)/256; - a+=b*weight; - } - //if(a) a=(palettesize-1)*r/blocksize; - newdata[y*newwidth+x] = (a*blocksize)/r; - py = ey; - } - px = ex; - } - return newdata; -} - -#define IMAGE_TYPE_JPEG 0 -#define IMAGE_TYPE_LOSSLESS 1 - -static void drawimage(gfxdevice_t*dev, gfxcolor_t* data, int sizex,int sizey, - double x1,double y1, - double x2,double y2, - double x3,double y3, - double x4,double y4, int type, int multiply) -{ - gfxcolor_t*newpic=0; - - double l1 = sqrt((x4-x1)*(x4-x1) + (y4-y1)*(y4-y1)); - double l2 = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)); - - gfxline_t p1,p2,p3,p4,p5; - p1.type=gfx_moveTo;p1.x=x1; p1.y=y1;p1.next=&p2; - p2.type=gfx_lineTo;p2.x=x2; p2.y=y2;p2.next=&p3; - p3.type=gfx_lineTo;p3.x=x3; p3.y=y3;p3.next=&p4; - p4.type=gfx_lineTo;p4.x=x4; p4.y=y4;p4.next=&p5; - p5.type=gfx_lineTo;p5.x=x1; p5.y=y1;p5.next=0; - - {p1.x = (int)(p1.x*20)/20.0; - p1.y = (int)(p1.y*20)/20.0; - p2.x = (int)(p2.x*20)/20.0; - p2.y = (int)(p2.y*20)/20.0; - p3.x = (int)(p3.x*20)/20.0; - p3.y = (int)(p3.y*20)/20.0; - p4.x = (int)(p4.x*20)/20.0; - p4.y = (int)(p4.y*20)/20.0; - p5.x = (int)(p5.x*20)/20.0; - p5.y = (int)(p5.y*20)/20.0; - } - - gfxmatrix_t m; - m.m00 = (p4.x-p1.x)/sizex; m.m10 = (p2.x-p1.x)/sizey; - m.m01 = (p4.y-p1.y)/sizex; m.m11 = (p2.y-p1.y)/sizey; - - m.tx = p1.x - 0.5*multiply; - m.ty = p1.y - 0.5*multiply; - - gfximage_t img; - img.data = (gfxcolor_t*)data; - img.width = sizex; - img.height = sizey; - - if(type == IMAGE_TYPE_JPEG) - /* TODO: pass image_dpi to device instead */ - dev->setparameter(dev, "next_bitmap_is_jpeg", "1"); - - dump_outline(&p1); - dev->fillbitmap(dev, &p1, &img, &m, 0); -} - -void drawimagejpeg(gfxdevice_t*dev, gfxcolor_t*mem, int sizex,int sizey, - double x1,double y1, double x2,double y2, double x3,double y3, double x4,double y4, int multiply) -{ - drawimage(dev,mem,sizex,sizey,x1,y1,x2,y2,x3,y3,x4,y4, IMAGE_TYPE_JPEG, multiply); -} - -void drawimagelossless(gfxdevice_t*dev, gfxcolor_t*mem, int sizex,int sizey, - double x1,double y1, double x2,double y2, double x3,double y3, double x4,double y4, int multiply) -{ - drawimage(dev,mem,sizex,sizey,x1,y1,x2,y2,x3,y3,x4,y4, IMAGE_TYPE_LOSSLESS, multiply); -} - - -void GFXOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap*colorMap, GBool invert, - GBool inlineImg, int mask, int*maskColors, - Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GfxImageColorMap*maskColorMap) -{ - /* the code in this function is *old*. It's not pretty, but it works. */ - - double x1,y1,x2,y2,x3,y3,x4,y4; - ImageStream *imgStr; - Guchar pixBuf[4]; - GfxRGB rgb; - int ncomps = 1; - int bits = 1; - unsigned char* maskbitmap = 0; - - if(colorMap) { - ncomps = colorMap->getNumPixelComps(); - bits = colorMap->getBits(); - } - - if(maskStr) { - int x,y; - unsigned char buf[8]; - maskbitmap = (unsigned char*)malloc(maskHeight*maskWidth); - if(maskColorMap) { - ImageStream*imgMaskStr = new ImageStream(maskStr, maskWidth, maskColorMap->getNumPixelComps(), maskColorMap->getBits()); - imgMaskStr->reset(); - unsigned char pal[256]; - int n = 1 << colorMap->getBits(); - int t; - for(t=0;tgetGray(pixBuf, &gray); - pal[t] = colToByte(gray); - } - for (y = 0; y < maskHeight; y++) { - for (x = 0; x < maskWidth; x++) { - imgMaskStr->getPixel(buf); - maskbitmap[y*maskWidth+x] = pal[buf[0]]; - } - } - delete imgMaskStr; - } else { - ImageStream*imgMaskStr = new ImageStream(maskStr, maskWidth, 1, 1); - imgMaskStr->reset(); - for (y = 0; y < maskHeight; y++) { - for (x = 0; x < maskWidth; x++) { - imgMaskStr->getPixel(buf); - buf[0]^=maskInvert; - maskbitmap[y*maskWidth+x] = (buf[0]^1)*255; - } - } - delete imgMaskStr; - } - maskStr->close(); - } - - imgStr = new ImageStream(str, width, ncomps,bits); - imgStr->reset(); - - if(!width || !height || ((height+width)<=1 && (maskWidth+maskHeight)<=1)) - { - msg(" Ignoring %d by %d image", width, height); - unsigned char buf[8]; - int x,y; - for (y = 0; y < height; ++y) - for (x = 0; x < width; ++x) { - imgStr->getPixel(buf); - } - delete imgStr; - if(maskbitmap) - free(maskbitmap); - return; - } - - this->transformXY(state, 0, 1, &x1, &y1); - this->transformXY(state, 0, 0, &x2, &y2); - this->transformXY(state, 1, 0, &x3, &y3); - this->transformXY(state, 1, 1, &x4, &y4); - - if(type3active) { - /* as type 3 bitmaps are antialized, we need to place them - at integer coordinates, otherwise flash player's antializing - will kick in and make everything blurry */ - x1 = (int)(x1);y1 = (int)(y1); - x2 = (int)(x2);y2 = (int)(y2); - x3 = (int)(x3);y3 = (int)(y3); - x4 = (int)(x4);y4 = (int)(y4); - } - - if(!gfxglobals->pbminfo && !(str->getKind()==strDCT)) { - if(!type3active) { - msg(" File contains pbm pictures %s",mask?"(masked)":""); - gfxglobals->pbminfo = 1; - } - if(mask) - msg(" drawing %d by %d masked picture", width, height); - } - if(!gfxglobals->jpeginfo && (str->getKind()==strDCT)) { - msg(" File contains jpeg pictures"); - gfxglobals->jpeginfo = 1; - } - - if(mask) { - unsigned char buf[8]; - int x,y; - unsigned char*pic = new unsigned char[width*height]; - gfxcolor_t pal[256]; - GfxRGB rgb; - state->getFillRGB(&rgb); - - memset(pal,255,sizeof(pal)); - pal[0].r = (int)(colToByte(rgb.r)); pal[1].r = 0; - pal[0].g = (int)(colToByte(rgb.g)); pal[1].g = 0; - pal[0].b = (int)(colToByte(rgb.b)); pal[1].b = 0; - pal[0].a = 255; pal[1].a = 0; - - int numpalette = 2; - int realwidth = (int)sqrt(SQR(x2-x3) + SQR(y2-y3)); - int realheight = (int)sqrt(SQR(x1-x2) + SQR(y1-y2)); - for (y = 0; y < height; ++y) - for (x = 0; x < width; ++x) - { - imgStr->getPixel(buf); - if(invert) - buf[0]=1-buf[0]; - pic[width*y+x] = buf[0]; - } - - if(type3active) { - unsigned char*pic2 = 0; - numpalette = 16; - - pic2 = antialize(pic,width,height,realwidth,realheight,numpalette); - - if(!pic2) { - delete[] pic; - delete imgStr; - return; - } - - width = realwidth; - height = realheight; - delete[] pic; - pic = pic2; - - /* make a black/white palette */ - - float r = 255./(float)(numpalette-1); - int t; - for(t=0;tgetNumPixelComps()!=1 || str->getKind()==strDCT) { - gfxcolor_t*pic=new gfxcolor_t[width*height]; - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - imgStr->getPixel(pixBuf); - colorMap->getRGB(pixBuf, &rgb); - pic[width*y+x].r = (unsigned char)(colToByte(rgb.r)); - pic[width*y+x].g = (unsigned char)(colToByte(rgb.g)); - pic[width*y+x].b = (unsigned char)(colToByte(rgb.b)); - pic[width*y+x].a = 255;//(U8)(rgb.a * 255 + 0.5); - if(maskbitmap) { - int x1 = x*maskWidth/width; - int y1 = y*maskHeight/height; - int x2 = (x+1)*maskWidth/width; - int y2 = (y+1)*maskHeight/height; - int xx,yy; - unsigned int alpha=0; - unsigned int count=0; - for(xx=x1;xxgetKind()==strDCT) - drawimagejpeg(device, pic, width, height, x1,y1,x2,y2,x3,y3,x4,y4, config_multiply); - else - drawimagelossless(device, pic, width, height, x1,y1,x2,y2,x3,y3,x4,y4, config_multiply); - delete[] pic; - delete imgStr; - if(maskbitmap) free(maskbitmap); - return; - } else { - gfxcolor_t*pic=new gfxcolor_t[width*height]; - gfxcolor_t pal[256]; - int n = 1 << colorMap->getBits(); - int t; - for(t=0;t<256;t++) { - pixBuf[0] = t; - colorMap->getRGB(pixBuf, &rgb); - - {/*if(maskColors && *maskColors==t) { - msg(" Color %d is transparent", t); - if (imgData->maskColors) { - *alpha = 0; - for (i = 0; i < imgData->colorMap->getNumPixelComps(); ++i) { - if (pix[i] < imgData->maskColors[2*i] || - pix[i] > imgData->maskColors[2*i+1]) { - *alpha = 1; - break; - } - } - } else { - *alpha = 1; - } - if(!*alpha) { - pal[t].r = 0; - pal[t].g = 0; - pal[t].b = 0; - pal[t].a = 0; - } - } else {*/ - pal[t].r = (unsigned char)(colToByte(rgb.r)); - pal[t].g = (unsigned char)(colToByte(rgb.g)); - pal[t].b = (unsigned char)(colToByte(rgb.b)); - pal[t].a = 255;//(U8)(rgb.b * 255 + 0.5); - } - } - for (y = 0; y < height; ++y) { - for (x = 0; x < width; ++x) { - imgStr->getPixel(pixBuf); - pic[width*y+x] = pal[pixBuf[0]]; - } - } - if(maskbitmap) { - if(maskWidth < width && maskHeight < height) { - for(y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - pic[width*y+x].a = maskbitmap[(y*maskHeight/height)*maskWidth+(x*maskWidth/width)]; - } - } - } else { - msg(" resampling %dx%d to mask size (%dx%d)", width, height, maskWidth, maskHeight); - gfxcolor_t*newpic=new gfxcolor_t[maskWidth*maskHeight]; - double dx = width / maskWidth; - double dy = height / maskHeight; - double yy = 0; - for(y = 0; y < maskHeight; y++) { - double xx = 0; - for (x = 0; x < maskWidth; x++) { - newpic[maskWidth*y+x] = pic[int(yy)*width+int(xx)]; - newpic[maskWidth*y+x].a = maskbitmap[maskWidth*y+x]; - xx += dx; - } - yy += dy; - } - delete[] pic; - pic = newpic; - width = maskWidth; - height = maskHeight; - } - } - drawimagelossless(device, pic, width, height, x1,y1,x2,y2,x3,y3,x4,y4, config_multiply); - - delete[] pic; - delete imgStr; - if(maskbitmap) free(maskbitmap); - return; - } -} - -void GFXOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, - int width, int height, GBool invert, - GBool inlineImg) -{ - dbg("drawImageMask %dx%d, invert=%d inline=%d", width, height, invert, inlineImg); - msg(" drawImageMask %dx%d, invert=%d inline=%d", width, height, invert, inlineImg); - drawGeneralImage(state,ref,str,width,height,0,invert,inlineImg,1, 0, 0,0,0,0, 0); -} - -void GFXOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg) -{ - dbg("drawImage %dx%d, %s, %s, inline=%d", width, height, - colorMap?"colorMap":"no colorMap", - maskColors?"maskColors":"no maskColors", - inlineImg); - msg(" drawImage %dx%d, %s, %s, inline=%d", width, height, - colorMap?"colorMap":"no colorMap", - maskColors?"maskColors":"no maskColors", - inlineImg); - if(colorMap) - msg(" colorMap pixcomps:%d bits:%d mode:%d", colorMap->getNumPixelComps(), - colorMap->getBits(),colorMap->getColorSpace()->getMode()); - drawGeneralImage(state,ref,str,width,height,colorMap,0,inlineImg,0,maskColors, 0,0,0,0, 0); -} - -void GFXOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, - int width, int height, - GfxImageColorMap *colorMap, - Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert) -{ - dbg("drawMaskedImage %dx%d, %s, %dx%d mask", width, height, - colorMap?"colorMap":"no colorMap", - maskWidth, maskHeight); - msg(" drawMaskedImage %dx%d, %s, %dx%d mask", width, height, - colorMap?"colorMap":"no colorMap", - maskWidth, maskHeight); - if(colorMap) - msg(" colorMap pixcomps:%d bits:%d mode:%d", colorMap->getNumPixelComps(), - colorMap->getBits(),colorMap->getColorSpace()->getMode()); - drawGeneralImage(state,ref,str,width,height,colorMap,0,0,0,0, maskStr, maskWidth, maskHeight, maskInvert, 0); -} - -void GFXOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, - int width, int height, - GfxImageColorMap *colorMap, - Stream *maskStr, - int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap) -{ - dbg("drawSoftMaskedImage %dx%d, %s, %dx%d mask", width, height, - colorMap?"colorMap":"no colorMap", - maskWidth, maskHeight); - msg(" drawSoftMaskedImage %dx%d, %s, %dx%d mask", width, height, - colorMap?"colorMap":"no colorMap", - maskWidth, maskHeight); - if(colorMap) - msg(" colorMap pixcomps:%d bits:%d mode:%d", colorMap->getNumPixelComps(), - colorMap->getBits(),colorMap->getColorSpace()->getMode()); - drawGeneralImage(state,ref,str,width,height,colorMap,0,0,0,0, maskStr, maskWidth, maskHeight, 0, maskColorMap); -} - -void GFXOutputDev::stroke(GfxState *state) -{ - dbg("stroke"); - - GfxPath * path = state->getPath(); - gfxline_t*line= gfxPath_to_gfxline(state, path, 0, user_movex + clipmovex, user_movey + clipmovey); - strokeGfxline(state, line, 0); - gfxline_free(line); -} - -void GFXOutputDev::fill(GfxState *state) -{ - gfxcolor_t col = getFillColor(state); - dbg("fill %02x%02x%02x%02x",col.r,col.g,col.b,col.a); - - GfxPath * path = state->getPath(); - gfxline_t*line= gfxPath_to_gfxline(state, path, 1, user_movex + clipmovex, user_movey + clipmovey); - if(config_optimize_polygons) { - gfxline_t*line2 = gfxline_circularToEvenOdd(line); - gfxline_free(line); - line = line2; - } - fillGfxLine(state, line); - gfxline_free(line); -} - -void GFXOutputDev::eoFill(GfxState *state) -{ - gfxcolor_t col = getFillColor(state); - dbg("eofill %02x%02x%02x%02x",col.r,col.g,col.b,col.a); - - GfxPath * path = state->getPath(); - gfxline_t*line= gfxPath_to_gfxline(state, path, 1, user_movex + clipmovex, user_movey + clipmovey); - fillGfxLine(state, line); - gfxline_free(line); -} - - -static const char* dirseparator() -{ -#ifdef WIN32 - return "\\"; -#else - return "/"; -#endif -} - -void addGlobalFont(const char*filename) -{ - fontfile_t* f = (fontfile_t*)malloc(sizeof(fontfile_t)); - memset(f, 0, sizeof(fontfile_t)); - f->filename = filename; - int len = strlen(filename); - char*r1 = strrchr(filename, '/'); - char*r2 = strrchr(filename, '\\'); - if(r2>r1) - r1 = r2; - if(r1) { - len = strlen(r1+1); - } - f->len = len; - - msg(" Adding font \"%s\".", filename); - if(global_fonts_next) { - global_fonts_next->next = f; - global_fonts_next = global_fonts_next->next; - } else { - global_fonts_next = global_fonts = f; - } -} - -void addGlobalLanguageDir(const char*dir) -{ - msg(" Adding %s to language pack directories", dir); - - FILE*fi = 0; - char* config_file = (char*)malloc(strlen(dir) + 1 + sizeof("add-to-xpdfrc") + 1); - strcpy(config_file, dir); - strcat(config_file, dirseparator()); - strcat(config_file, "add-to-xpdfrc"); - - fi = fopen(config_file, "rb"); - if(!fi) { - msg(" Could not open %s", config_file); - return; - } - globalParams->parseFile(new GString(config_file), fi); - fclose(fi); -} - -void addGlobalFontDir(const char*dirname) -{ -#ifdef HAVE_DIRENT_H - DIR*dir = opendir(dirname); - if(!dir) { - msg(" Couldn't open directory %s", dirname); - return; - } - struct dirent*ent; - int fonts = 0; - while(1) { - ent = readdir (dir); - if (!ent) - break; - int l; - char*name = ent->d_name; - char type = 0; - if(!name) continue; - l=strlen(name); - if(l<4) - continue; - if(!strncasecmp(&name[l-4], ".pfa", 4)) - type=1; - if(!strncasecmp(&name[l-4], ".pfb", 4)) - type=3; - if(!strncasecmp(&name[l-4], ".ttf", 4)) - type=2; - if(type) { - char*fontname = (char*)malloc(strlen(dirname)+strlen(name)+2); - strcpy(fontname, dirname); - strcat(fontname, dirseparator()); - strcat(fontname, name); - addGlobalFont(fontname); - fonts++; - } - } - msg(" Added %s to font directories (%d fonts)", dirname, fonts); - closedir(dir); -#else - msg(" No dirent.h"); -#endif -} - -void GFXOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, - GfxColorSpace *blendingColorSpace, - GBool isolated, GBool knockout, - GBool forSoftMask) -{ - const char*colormodename = ""; - - if(blendingColorSpace) { - colormodename = GfxColorSpace::getColorSpaceModeName(blendingColorSpace->getMode()); - } - dbg("beginTransparencyGroup device=%08x %.1f/%.1f/%.1f/%.1f %s isolated=%d knockout=%d forsoftmask=%d", device, bbox[0],bbox[1],bbox[2],bbox[3], colormodename, isolated, knockout, forSoftMask); - msg(" beginTransparencyGroup %.1f/%.1f/%.1f/%.1f %s isolated=%d knockout=%d forsoftmask=%d", bbox[0],bbox[1],bbox[2],bbox[3], colormodename, isolated, knockout, forSoftMask); - - //states[statepos].createsoftmask |= forSoftMask; - states[statepos].createsoftmask = forSoftMask; - states[statepos].transparencygroup = !forSoftMask; - states[statepos].isolated = isolated; - - states[statepos].olddevice = this->device; - this->device = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); - dbg("this->device now %08x (old: %08x)", this->device, states[statepos].olddevice); - - gfxdevice_record_init(this->device); - - /*if(!forSoftMask) { ////??? - state->setFillOpacity(0.0); - }*/ - dbgindent+=2; -} - -void GFXOutputDev::endTransparencyGroup(GfxState *state) -{ - dbgindent-=2; - gfxdevice_t*r = this->device; - - dbg("endTransparencyGroup this->device now back to %08x (destroying %08x)", states[statepos].olddevice, this->device); - - this->device = states[statepos].olddevice; - if(!this->device) { - msg(" Bad state nesting in transparency group"); - msg(" Notice: this is a known problem, which will be fixed in 0.9.1"); - msg(" In the meantime, please convert the file with -s poly2bitmap"); - restoreState(state); - this->device = states[statepos].olddevice; - } - states[statepos].olddevice = 0; - - gfxresult_t*recording = r->finish(r); - - dbg(" forsoftmask=%d recording=%08x/%08x", states[statepos].createsoftmask, r, recording); - msg(" endTransparencyGroup forsoftmask=%d recording=%08x/%08x", states[statepos].createsoftmask, r, recording); - - if(states[statepos].createsoftmask) { - states[statepos-1].softmaskrecording = recording; - } else { - states[statepos-1].grouprecording = recording; - } - - states[statepos].createsoftmask = 0; - states[statepos].transparencygroup = 0; - free(r); -} - -void GFXOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) -{ - const char*blendmodes[] = {"normal","multiply","screen","overlay","darken", "lighten", - "colordodge","colorburn","hardlight","softlight","difference", - "exclusion","hue","saturation","color","luminosity"}; - - dbg("paintTransparencyGroup blend=%s softmaskon=%d recording=%08x", blendmodes[state->getBlendMode()], states[statepos].softmask, states[statepos].grouprecording); - msg(" paintTransparencyGroup blend=%s softmaskon=%d", blendmodes[state->getBlendMode()], states[statepos].softmask); - - if(state->getBlendMode() == gfxBlendNormal) - infofeature("transparency groups"); - else { - char buffer[80]; - sprintf(buffer, "%s blended transparency groups", blendmodes[state->getBlendMode()]); - warnfeature(buffer, 0); - } - - gfxresult_t*grouprecording = states[statepos].grouprecording; - - int blendmode = state->getBlendMode(); - if(blendmode == gfxBlendNormal || blendmode == gfxBlendMultiply) { - int alpha = (int)(state->getFillOpacity()*255); - if(blendmode == gfxBlendMultiply && alpha>200) - alpha = 128; - gfxdevice_t ops; - dbg("this->device=%08x, this->device->name=%s\n", this->device, this->device->name); - gfxdevice_ops_init(&ops, this->device, alpha); - gfxresult_record_replay(grouprecording, &ops); - ops.finish(&ops); - } - grouprecording->destroy(grouprecording); - - states[statepos].grouprecording = 0; -} - -void GFXOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *rgb) -{ - if(states[statepos].softmask) { - /* shouldn't happen, but *does* happen */ - clearSoftMask(state); - } - - /* alpha = 1: retrieve mask values from alpha layer - alpha = 0: retrieve mask values from luminance */ - - dbg("setSoftMask %.1f/%.1f/%.1f/%.1f alpha=%d backdrop=%02x%02x%02x", - bbox[0], bbox[1], bbox[2], bbox[3], alpha, colToByte(rgb->c[0]), colToByte(rgb->c[1]), colToByte(rgb->c[2])); - msg(" setSoftMask %.1f/%.1f/%.1f/%.1f alpha=%d backdrop=%02x%02x%02x", - bbox[0], bbox[1], bbox[2], bbox[3], alpha, colToByte(rgb->c[0]), colToByte(rgb->c[1]), colToByte(rgb->c[2])); - if(!alpha) - infofeature("soft masks"); - else - warnfeature("soft masks from alpha channel",0); - - if(states[statepos].olddevice) { - msg(" Internal error: badly balanced softmasks/transparency groups"); - exit(1); - } - states[statepos].olddevice = this->device; - this->device = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); - gfxdevice_record_init(this->device); - - dbg("softmaskrecording is %08x (dev=%08x) at statepos %d\n", states[statepos].softmaskrecording, this->device, statepos); - - states[statepos].softmask = 1; - states[statepos].softmask_alpha = alpha; -} - -static inline Guchar div255(int x) { - return (Guchar)((x + (x >> 8) + 0x80) >> 8); -} - -static unsigned char clampU8(unsigned char c, unsigned char min, unsigned char max) -{ - if(c < min) c = min; - if(c > max) c = max; - return c; -} - -void GFXOutputDev::clearSoftMask(GfxState *state) -{ - if(!states[statepos].softmask) - return; - states[statepos].softmask = 0; - dbg("clearSoftMask statepos=%d", statepos); - msg(" clearSoftMask statepos=%d", statepos); - - if(!states[statepos].softmaskrecording || strcmp(this->device->name, "record")) { - msg(" Error in softmask/tgroup ordering"); - return; - } - - gfxresult_t*mask = states[statepos].softmaskrecording; - gfxresult_t*below = this->device->finish(this->device);free(this->device); - this->device = states[statepos].olddevice; - - /* get outline of all objects below the soft mask */ - gfxdevice_t uniondev; - gfxdevice_union_init(&uniondev, 0); - gfxresult_record_replay(below, &uniondev); - gfxline_t*belowoutline = gfxdevice_union_getunion(&uniondev); - uniondev.finish(&uniondev); - gfxbbox_t bbox = gfxline_getbbox(belowoutline); - gfxline_free(belowoutline);belowoutline=0; -#if 0 - this->device->startclip(this->device, belowoutline); - gfxresult_record_replay(below, this->device); - gfxresult_record_replay(mask, this->device); - this->device->endclip(this->device); -#endif - - int width = (int)bbox.xmax,height = (int)bbox.ymax; - if(width<=0 || height<=0) - return; - - gfxdevice_t belowrender; - gfxdevice_render_init(&belowrender); - if(states[statepos+1].isolated) { - belowrender.setparameter(&belowrender, "fillwhite", "1"); - } - belowrender.setparameter(&belowrender, "antialize", "2"); - belowrender.startpage(&belowrender, width, height); - gfxresult_record_replay(below, &belowrender); - belowrender.endpage(&belowrender); - gfxresult_t* belowresult = belowrender.finish(&belowrender); - gfximage_t* belowimg = (gfximage_t*)belowresult->get(belowresult,"page0"); - //writePNG("below.png", (unsigned char*)belowimg->data, belowimg->width, belowimg->height); - - gfxdevice_t maskrender; - gfxdevice_render_init(&maskrender); - maskrender.startpage(&maskrender, width, height); - gfxresult_record_replay(mask, &maskrender); - maskrender.endpage(&maskrender); - gfxresult_t* maskresult = maskrender.finish(&maskrender); - gfximage_t* maskimg = (gfximage_t*)maskresult->get(maskresult,"page0"); - - if(belowimg->width != maskimg->width || belowimg->height != maskimg->height) { - msg(" Internal error in mask drawing"); - return; - } - - int y,x; - for(y=0;ydata[maskimg->width*y]; - gfxcolor_t* l2 = &belowimg->data[belowimg->width*y]; - for(x=0;xa; - } else { - alpha = (77*l1->r + 151*l1->g + 28*l1->b) >> 8; - } - - l2->a = div255(alpha*l2->a); - - /* DON'T premultiply alpha- this is done by fillbitmap, - depending on the output device */ - //l2->r = div255(alpha*l2->r); - //l2->g = div255(alpha*l2->g); - //l2->b = div255(alpha*l2->b); - - l1++; - l2++; - } - } - gfxline_t*line = gfxline_makerectangle(0,0,width,height); - - gfxmatrix_t matrix; - matrix.m00 = 1.0; matrix.m10 = 0.0; matrix.tx = 0.0; - matrix.m01 = 0.0; matrix.m11 = 1.0; matrix.ty = 0.0; - - this->device->fillbitmap(this->device, line, belowimg, &matrix, 0); - - mask->destroy(mask); - below->destroy(below); - maskresult->destroy(maskresult); - belowresult->destroy(belowresult); - states[statepos].softmaskrecording = 0; -} - -//class MemCheck -//{ -// public: ~MemCheck() -// { -// delete globalParams;globalParams=0; -// Object::memCheck(stderr); -// gMemReport(stderr); -// } -//} myMemCheck; - diff -Nru swftools-0.9.0/lib/pdf/GFXOutputDev.h swftools-0.9.2/lib/pdf/GFXOutputDev.h --- swftools-0.9.0/lib/pdf/GFXOutputDev.h 2009-03-29 21:17:57.000000000 +0000 +++ swftools-0.9.2/lib/pdf/GFXOutputDev.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,297 +0,0 @@ -#ifndef __gfxoutputdev_h__ -#define __gfxoutputdev_h__ - -#include "../gfxdevice.h" -#include "../gfxsource.h" -#include "../gfxtools.h" - -#include "config.h" -#include "InfoOutputDev.h" -#include "PDFDoc.h" -#include "GlobalParams.h" -#include "CommonOutputDev.h" - -class GFXOutputState { - public: - int clipping; - int textRender; - char createsoftmask; - char transparencygroup; - char softmask; - char softmask_alpha; - char isolated; - - gfxbbox_t clipbbox; - - GFXOutputState(); - - gfxresult_t* grouprecording; // for transparency groups - gfxresult_t* softmaskrecording; // for soft masks - - gfxdevice_t* olddevice; - - double *dashPattern; - int dashLength; - double dashStart; - - GfxState*state; -}; - -typedef struct _feature -{ - char*string; - struct _feature*next; -} feature_t; - -void addGlobalFont(const char*filename); -void addGlobalLanguageDir(const char*dir); -void addGlobalFontDir(const char*dirname); - -class GFXOutputGlobals { -public: - feature_t*featurewarnings; - - int textmodeinfo; // did we write "Text will be rendered as polygon" yet? - int jpeginfo; // did we write "File contains jpegs" yet? - int pbminfo; // did we write "File contains jpegs" yet? - int linkinfo; // did we write "File contains links" yet? - - GFXOutputGlobals(); - ~GFXOutputGlobals(); -}; - -class GFXOutputDev: public CommonOutputDev { -public: - gfxdevice_t* device; - - GFXOutputDev(InfoOutputDev*info, PDFDoc*doc); - virtual ~GFXOutputDev() ; - - virtual void setDevice(gfxdevice_t*dev); - virtual void setMove(int x,int y); - virtual void setClip(int x1,int y1,int x2,int y2); - virtual void setParameter(const char*key, const char*value); - - // Start a page. - virtual void startPage(int pageNum, GfxState *state, double x1, double y1, double x2, double y2) ; - virtual void endPage(); - - //----- get info about output device - - // Does this device use upside-down coordinates? - // (Upside-down means (0,0) is the top left corner of the page.) - virtual GBool upsideDown(); - - // Does this device use drawChar() or drawString()? - virtual GBool useDrawChar(); - - virtual GBool interpretType3Chars(); - - //virtual GBool useShadedFills() { return gTrue; } - - //----- link borders - virtual void processLink(Link *link, Catalog *catalog); - - //----- save/restore graphics state - virtual void saveState(GfxState *state) ; - virtual void restoreState(GfxState *state) ; - - //----- update graphics state - - virtual void updateLineDash(GfxState *state); - virtual void updateFont(GfxState *state); - virtual void updateFontMatrix(GfxState *state); - virtual void updateFillColor(GfxState *state); - virtual void updateStrokeColor(GfxState *state); - virtual void updateLineWidth(GfxState *state); - virtual void updateLineJoin(GfxState *state); - virtual void updateLineCap(GfxState *state); - virtual void updateFillOpacity(GfxState *state); - virtual void updateStrokeOpacity(GfxState *state); - virtual void updateFillOverprint(GfxState *state); - virtual void updateStrokeOverprint(GfxState *state); - virtual void updateTransfer(GfxState *state); - - virtual void updateAll(GfxState *state) - { - updateFont(state); - updateFillColor(state); - updateStrokeColor(state); - updateLineWidth(state); - updateLineJoin(state); - updateLineCap(state); - }; - - //----- path painting - virtual void stroke(GfxState *state) ; - virtual void fill(GfxState *state) ; - virtual void eoFill(GfxState *state) ; - - //----- path clipping - virtual void clip(GfxState *state) ; - virtual void eoClip(GfxState *state) ; - virtual void clipToStrokePath(GfxState *state); - - //----- shaded fills - virtual GBool useTilingPatternFill(); - virtual GBool useShadedFills(); - -#if (xpdfMajorVersion < 3) || (xpdfMinorVersion < 2) || (xpdfUpdateVersion < 7) - virtual void tilingPatternFill(GfxState *state, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep); -#else - virtual void tilingPatternFill(GfxState *state, Gfx *gfx, Object *str, - int paintType, Dict *resDict, - double *mat, double *bbox, - int x0, int y0, int x1, int y1, - double xStep, double yStep); -#endif - virtual GBool functionShadedFill(GfxState *state, - GfxFunctionShading *shading); - virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading); - virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading); - - //----- text drawing - virtual void beginString(GfxState *state, GString *s) ; - virtual void endString(GfxState *state) ; - virtual void endTextObject(GfxState *state); - virtual void drawChar(GfxState *state, double x, double y, - double dx, double dy, - double originX, double originY, - CharCode code, int nBytes, Unicode *u, int uLen); - - //----- image drawing - virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, - int width, int height, GBool invert, - GBool inlineImg); - virtual void drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap *colorMap, - int *maskColors, GBool inlineImg); - virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, - int width, int height, - GfxImageColorMap *colorMap, - Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert); - virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, - int width, int height, - GfxImageColorMap *colorMap, - Stream *maskStr, - int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap); - - //----- transparency groups and soft masks (xpdf >= ~ 3.01.16) - virtual void beginTransparencyGroup(GfxState *state, double *bbox, - GfxColorSpace *blendingColorSpace, - GBool isolated, GBool knockout, - GBool forSoftMask); - virtual void endTransparencyGroup(GfxState *state); - virtual void paintTransparencyGroup(GfxState *state, double *bbox); - virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor); - virtual void clearSoftMask(GfxState *state); - - //----- type 3 chars - virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen); - virtual void endType3Char(GfxState *state); - - virtual void type3D0(GfxState *state, double wx, double wy); - virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury); - - char* searchForSuitableFont(GfxFont*gfxFont); - - void finish(); - - virtual GBool useDrawForm(); - virtual void drawForm(Ref id); - virtual GBool needNonText(); - - //virtual void dump(); - //virtual void beginStringOp(GfxState *state); - //virtual void drawString(GfxState *state, GString *s); - //virtual void endStringOp(GfxState *state); - //virtual GBool getVectorAntialias() { return gFalse; } - //virtual void setVectorAntialias(GBool vaa) {} - //virtual void psXObject(Stream *psStream, Stream *level1Stream) {} - - virtual void setPageMap(int*pagemap, int pagemap_len); - - private: - gfxline_t* gfxPath_to_gfxline(GfxState*state, GfxPath*path, int closed, int user_movex, int user_movey); - - void transformXY(GfxState*state, double x, double y, double*nx, double*ny); - - void drawGeneralImage(GfxState *state, Object *ref, Stream *str, - int width, int height, GfxImageColorMap*colorMap, GBool invert, - GBool inlineImg, int mask, int *maskColors, - Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GfxImageColorMap*maskColorMap); - - void strokeGfxline(GfxState *state, gfxline_t*line, int flags); - void clipToGfxLine(GfxState *state, gfxline_t*line); - void fillGfxLine(GfxState *state, gfxline_t*line); - - gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src); - - void showfeature(const char*feature,char fully, char warn); - void warnfeature(const char*feature,char fully); - void infofeature(const char*feature); - - char* searchFont(const char*name); - char* substituteFont(GfxFont*gfxFont, char*oldname); - char* writeEmbeddedFontToFile(XRef*ref, GfxFont*font); - - /* for page mapping */ - int* page2page; - int num_pages; - - - int currentpage; - char outer_clip_box; //whether the page clip box is still on - InfoOutputDev*info; - GFXOutputState states[64]; - int statepos; - - PDFDoc*doc; - XRef*xref; - - int type3active; // are we between beginType3()/endType3()? - - GfxState *laststate; - - int user_movex,user_movey; - int user_clipx1,user_clipx2,user_clipy1,user_clipy2; - - /* upper left corner of clipping rectangle (cropbox)- needs to be - added to all drawing coordinates to give the impression that all - pages start at (0,0)*/ - int clipmovex; - int clipmovey; - - gfxline_t* current_text_stroke; - gfxline_t* current_text_clip; - gfxfont_t* current_gfxfont; - FontInfo*current_fontinfo; - gfxmatrix_t current_font_matrix; - - /* config */ - int config_use_fontconfig; - int config_break_on_warning; - int config_remapunicode; - int config_transparent; - int config_extrafontdata; - int config_convertgradients; - int config_optimize_polygons; - int config_multiply; - int config_bigchar; - double config_fontquality; -}; - -class GFXGlobalParams: public GlobalParams { - public: - GFXGlobalParams(); - ~GFXGlobalParams(); - virtual DisplayFontParam *getDisplayFont(GString *fontName); -}; - -#endif //__gfxoutputdev_h__ diff -Nru swftools-0.9.0/lib/pdf/InfoOutputDev.cc swftools-0.9.2/lib/pdf/InfoOutputDev.cc --- swftools-0.9.0/lib/pdf/InfoOutputDev.cc 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/InfoOutputDev.cc 2012-02-04 15:13:08.000000000 +0000 @@ -1,55 +1,126 @@ -#include "config.h" +#include "../../config.h" #include "Object.h" #include "InfoOutputDev.h" #include "SplashOutputDev.h" -#ifdef HAVE_POPPLER -#include -#include -#include -#include -#else -#include "SplashTypes.h" -#include "SplashPath.h" -#include "SplashFont.h" -#include "SplashFontFile.h" -#endif #include "GfxState.h" +#include "CommonOutputDev.h" #include "../log.h" +#include "../types.h" +#include "../q.h" +#include "../gfxdevice.h" +#include "../gfxfont.h" #include +#include -/* there's not yet a way to set this */ +int config_unique_unicode = 1; +int config_poly2bitmap_pass1 = 0; +int config_skewedtobitmap_pass1 = 0; +int config_addspace = 1; int config_fontquality = 10; int config_bigchar = 0; +int config_marker_glyph = 0; +int config_normalize_fonts = 0; +int config_remove_font_transforms = 0; +int config_remove_invisible_outlines = 0; + +static void* fontclass_clone(const void*_m) { + if(_m==0) + return 0; + const fontclass_t*m1=(const fontclass_t*)_m; + fontclass_t*m2 = (fontclass_t*)malloc(sizeof(fontclass_t)); + *m2 = *m1; + m2->id = strdup(m1->id); + return m2; +} +static unsigned int fontclass_hash(const void*_m) { + if(!_m) + return 0; + const fontclass_t*m = (fontclass_t*)_m; + unsigned int h=0; + if(config_remove_font_transforms) { + U32 m00 = (*(U32*)&m->m00)&0xfff00000; + U32 m01 = (*(U32*)&m->m01)&0xfff00000; + U32 m10 = (*(U32*)&m->m10)&0xfff00000; + U32 m11 = (*(U32*)&m->m11)&0xfff00000; + h = crc32_add_bytes(h, (char*)&m00, sizeof(m00)); + h = crc32_add_bytes(h, (char*)&m01, sizeof(m01)); + h = crc32_add_bytes(h, (char*)&m10, sizeof(m10)); + h = crc32_add_bytes(h, (char*)&m11, sizeof(m11)); + } + if(config_remove_invisible_outlines) { + h = crc32_add_bytes(h, (char*)&m->alpha, 1); + } + return crc32_add_string(h, m->id); +} +static void fontclass_destroy(void*_m) { + fontclass_t*m = (fontclass_t*)_m; + free(m->id);m->id=0; + free(m); +} +static char fontclass_equals(const void*_m1, const void*_m2) { + const fontclass_t*m1=(const fontclass_t*)_m1; + const fontclass_t*m2=(const fontclass_t*)_m2; + if(!m1 || !m2) + return m1==m2; + + if(config_remove_font_transforms) { + /* we do a binary comparison of the float32 + bits here instead of a numerical comparison + to prevent the compiler from e.g. removing the + (float) cast during optimization, which would break + the equivalence between equals() and hash() (as + the hash is derived from the float32 values) */ + if(((*(U32*)&m1->m00 ^ *(U32*)&m2->m00)&0xfff00000) || + ((*(U32*)&m1->m01 ^ *(U32*)&m2->m01)&0xfff00000) || + ((*(U32*)&m1->m10 ^ *(U32*)&m2->m10)&0xfff00000) || + ((*(U32*)&m1->m11 ^ *(U32*)&m2->m11)&0xfff00000)) + return 0; + } + if(config_remove_invisible_outlines) { + if(m1->alpha != m2->alpha) + return 0; + } + return !strcmp(m1->id, m2->id); +} + +static type_t fontclass_type = { + fontclass_equals, + fontclass_hash, + fontclass_clone, + fontclass_destroy +}; InfoOutputDev::InfoOutputDev(XRef*xref) { num_links = 0; num_jpeg_images = 0; num_ppm_images = 0; - num_textfields = 0; + num_chars = 0; num_fonts = 0; num_polygons= 0; - currentfont = 0; + num_layers = 0; + num_text_breaks = 0; currentglyph = 0; - id2font = new GHash(1); + previous_was_char = 0; SplashColor white = {255,255,255}; splash = new SplashOutputDev(splashModeRGB8,320,0,white,0,0); splash->startDoc(xref); + last_font = 0; + current_type3_font = 0; + fontcache = dict_new2(&fontclass_type); } InfoOutputDev::~InfoOutputDev() { GHashIter*i; - id2font->startIter(&i); - GString*key; - FontInfo*fontinfo; - while(id2font->getNext(&i, &key, (void**)&fontinfo)) { - delete fontinfo; + + DICT_ITERATE_DATA(this->fontcache, FontInfo*, fd) { + delete fd; } - id2font->killIter(&i); + dict_destroy(this->fontcache);this->fontcache=0; - delete id2font;id2font=0; delete splash;splash=0; } + void FontInfo::grow(int size) { if(size >= this->num_glyphs) { @@ -58,27 +129,34 @@ this->num_glyphs = size; } } -FontInfo::FontInfo(char*id) +FontInfo::FontInfo(fontclass_t*fontclass) { - this->id = strdup(id); - this->charid2glyph = 0; + if(config_remove_font_transforms) { + char buf[128]; + static int counter=1; + sprintf(buf, "font%d", counter++); + this->id = strdup(buf); + } else { + this->id = strdup(fontclass->id); + } + + this->fontclass = (fontclass_t*)fontclass_type.dup(fontclass); this->seen = 0; this->num_glyphs = 0; this->glyphs = 0; - this->splash_font = 0; - this->lastchar = -1; - this->lastx = 0; - this->lasty = 0; this->gfxfont = 0; + this->space_char = -1; + this->ascender = 0; + this->descender = 0; + this->scale = 1.0; + this->num_chars = 0; + this->num_spaces = 0; + resetPositioning(); } FontInfo::~FontInfo() { if(this->id) {free(this->id);this->id=0;} this->font = 0; - if(this->charid2glyph) { - free(this->charid2glyph); - this->charid2glyph = 0; - } int t; for(t=0;tgfxfont) gfxfont_free(this->gfxfont); + + if(this->fontclass) { + fontclass_type.free(this->fontclass); + this->fontclass=0; + } +} + +char FontInfo::usesSpaces() +{ + if(this->num_chars && + this->num_spaces / (double)this->num_chars >= 0.05) { + return 1; + } + return 0; +} + +void FontInfo::resetPositioning() +{ + this->lastchar = -1; + this->lastx = 0; + this->lasty = 0; + this->lastadvance = 0; } -gfxfont_t* createGfxFont(FontInfo*src) +static int findSpace(gfxfont_t*font) { - gfxfont_t*font = (gfxfont_t*)malloc(sizeof(gfxfont_t)); - memset(font, 0, sizeof(gfxfont_t)); + int first_space = -1; + int t; + for(t=0;tnum_glyphs;t++) { + gfxglyph_t*g = &font->glyphs[t]; + if(GLYPH_IS_SPACE(g)) { + if(g->unicode == 32) { + /* now that we have found a space char, make sure it's unique */ + int s; + for(s=0;snum_glyphs;s++) { + if(s!=t && font->glyphs[s].unicode==32) + font->glyphs[s].unicode=0; + } + return t; + } + } + } + return -1; +} - font->glyphs = (gfxglyph_t*)malloc(sizeof(gfxglyph_t)*src->num_glyphs); - memset(font->glyphs, 0, sizeof(gfxglyph_t)*src->num_glyphs); +static int addSpace(gfxfont_t*font) +{ + /* first, make sure the new space char is the only char that'll use unicode 32 */ + int t; + for(t=0;tnum_glyphs;t++) { + if(font->glyphs[t].unicode==32) + font->glyphs[t].unicode=0; + } + // createGfxFont reserves space for up to two extra characters, so we don't need to realloc. + int space_glyph = font->num_glyphs++; + gfxglyph_t*g = &font->glyphs[space_glyph]; + memset(g, 0, sizeof(*g)); + g->unicode = 32; + g->advance = fabs(font->ascent + font->descent) / 5.0; + if(font->max_unicode > 32) + font->unicode2glyph[32] = space_glyph; +#if 0 + g->line = gfxline_makerectangle(0, -font->ascent, g->advance, font->descent); +#endif + return space_glyph; +} + +static void transform_glyph(gfxglyph_t*g, fontclass_t*mm, double scale) +{ + gfxmatrix_t m; + m.m00 = mm->m00 * scale; + m.m01 = mm->m01 * scale; + m.m10 = mm->m10 * scale; + m.m11 = mm->m11 * scale; + m.tx = 0; + m.ty = 0; + if(m.m00>0) + g->advance *= m.m00; + g->line = gfxline_clone(g->line); + gfxline_transform(g->line, &m); +} + +void gfxfont_transform(gfxfont_t*font, gfxmatrix_t*m) +{ + int t; + for(t=0;tnum_glyphs;t++) { + gfxglyph_t*g = &font->glyphs[t]; + gfxline_t*line = g->line; + gfxline_transform(line, m); + if(m->m00>0) + g->advance *= m->m00; + } +} + +gfxbbox_t gfxfont_bbox(gfxfont_t*font) +{ + gfxbbox_t tmp = {0,0,0,0}; + int t; + for(t=0;tnum_glyphs;t++) { + gfxline_t*line = font->glyphs[t].line; + gfxbbox_t b = gfxline_getbbox(line); + tmp = gfxbbox_expand_to_bbox(tmp, b); + } + return tmp; +} + +gfxfont_t* FontInfo::createGfxFont() +{ + gfxfont_t*font = (gfxfont_t*)rfx_calloc(sizeof(gfxfont_t)); + + font->glyphs = (gfxglyph_t*)malloc(sizeof(gfxglyph_t)*(this->num_glyphs+2)); + memset(font->glyphs, 0, sizeof(gfxglyph_t)*this->num_glyphs); font->id = 0; int t; - double quality = (INTERNAL_FONT_SIZE * 200 / config_fontquality) / src->max_size; - double scale = 1; + double quality = (INTERNAL_FONT_SIZE * 200 / config_fontquality) / this->max_size; //printf("%d glyphs\n", font->num_glyphs); font->num_glyphs = 0; - font->ascent = fabs(src->descender); - font->descent = fabs(src->ascender); - - for(t=0;tnum_glyphs;t++) { - if(src->glyphs[t]) { - SplashPath*path = src->glyphs[t]->path; + font->ascent = fabs(this->ascender); + font->descent = fabs(this->descender); + + for(t=0;tnum_glyphs;t++) { + if(this->glyphs[t]) { + SplashPath*path = this->glyphs[t]->path; int len = path?path->getLength():0; //printf("glyph %d) %08x (%d line segments)\n", t, path, len); gfxglyph_t*glyph = &font->glyphs[font->num_glyphs]; - src->glyphs[t]->glyphid = font->num_glyphs; - glyph->unicode = src->glyphs[t]->unicode; - if(glyph->unicode >= font->max_unicode) - font->max_unicode = glyph->unicode+1; + this->glyphs[t]->glyphid = font->num_glyphs; + glyph->unicode = this->glyphs[t]->unicode; gfxdrawer_t drawer; gfxdrawer_target_gfxline(&drawer); int s; @@ -131,7 +309,7 @@ if(!s || x > xmax) xmax = x; if(f&splashPathFirst) { - drawer.moveTo(&drawer, x*scale, y*scale); + drawer.moveTo(&drawer, x, y); } if(f&splashPathCurve) { double x2,y2; @@ -139,12 +317,12 @@ if(f&splashPathCurve) { double x3,y3; path->getPoint(++s, &x3, &y3, &f); - gfxdraw_cubicTo(&drawer, x*scale, y*scale, x2*scale, y2*scale, x3*scale, y3*scale, quality); + gfxdraw_cubicTo(&drawer, x, y, x2, y2, x3, y3, quality); } else { - drawer.splineTo(&drawer, x*scale, y*scale, x2*scale, y2*scale); + drawer.splineTo(&drawer, x, y, x2, y2); } } else { - drawer.lineTo(&drawer, x*scale, y*scale); + drawer.lineTo(&drawer, x, y); } // printf("%f %f %s %s\n", x, y, (f&splashPathCurve)?"curve":"", // (f&splashPathFirst)?"first":"", @@ -152,14 +330,13 @@ } glyph->line = (gfxline_t*)drawer.result(&drawer); - if(src->glyphs[t]->advance>0) { - glyph->advance = src->glyphs[t]->advance; + if(this->glyphs[t]->advance>0) { + glyph->advance = this->glyphs[t]->advance; } else { - msg(" Approximating advance value for glyph %d", t); - glyph->advance = xmax*scale; + glyph->advance = fmax(xmax, 0); } if(config_bigchar) { - double max = src->glyphs[t]->advance_max; + double max = this->glyphs[t]->advance_max; if(max>0 && max > glyph->advance) { glyph->advance = max; } @@ -168,23 +345,101 @@ font->num_glyphs++; } } - font->unicode2glyph = (int*)malloc(sizeof(int)*font->max_unicode); - memset(font->unicode2glyph, -1, sizeof(int)*font->max_unicode); - for(t=0;tnum_glyphs;t++) { - if(font->glyphs[t].unicode>0 && font->glyphs[t].unicodemax_unicode) { - font->unicode2glyph[font->glyphs[t].unicode] = t; + + if(config_remove_font_transforms) { + gfxmatrix_t glyph_transform; + glyph_transform.m00 = fontclass->m00; + glyph_transform.m01 = fontclass->m01; + glyph_transform.m10 = fontclass->m10; + glyph_transform.m11 = fontclass->m11; + glyph_transform.tx = 0; + glyph_transform.ty = 0; + /* apply the font transformation to the font */ + gfxfont_transform(font, &glyph_transform); + + gfxbbox_t total = gfxfont_bbox(font); + font->ascent = total.ymax; + font->descent = -total.ymin; + } + + if(config_normalize_fonts) { + /* make all chars 1024 high */ + gfxbbox_t bbox = gfxfont_bbox(font); + double height = bbox.ymax - bbox.ymin; + double scale = 1.0; + if(height>1e-5) { + scale = 1024.0 / height; + } + this->scale = 1.0 / scale; + gfxmatrix_t scale_matrix = {scale,0,0, + 0,scale,0}; + gfxfont_transform(font, &scale_matrix); + font->ascent *= scale; + font->descent *= scale; + } + + if(config_remove_invisible_outlines) { + /* for OCR docs: remove the outlines of characters that are only + ever displayed with alpha=0 */ + if(!fontclass->alpha) { + for(t=0;tnum_glyphs;t++) { + gfxglyph_t*g = &font->glyphs[t]; + gfxline_t*line = font->glyphs[t].line; + gfxline_free(g->line); + g->line = (gfxline_t*)rfx_calloc(sizeof(gfxline_t)); + g->line->type = gfx_moveTo; + g->line->x = g->advance; + } } - } + return font; } +static float find_average_glyph_advance(gfxfont_t*f) +{ + if(!f->num_glyphs) + return 0.0; + + float*values = (float*)malloc(sizeof(float)*f->num_glyphs); + int t; + for(t=0;tnum_glyphs;t++) { + values[t] = f->glyphs[t].advance; + } + float m = medianf(values, f->num_glyphs); + free(values); + return m; +} gfxfont_t* FontInfo::getGfxFont() { if(!this->gfxfont) { - this->gfxfont = createGfxFont(this); + this->gfxfont = this->createGfxFont(); this->gfxfont->id = strdup(this->id); + this->space_char = findSpace(this->gfxfont); + this->average_advance = find_average_glyph_advance(this->gfxfont); + + if(this->space_char>=0) { + msg(" Font %s has space char %d (unicode=%d)", + this->id, this->space_char, + this->gfxfont->glyphs[this->space_char].unicode); + } else if(config_addspace) { + this->space_char = addSpace(this->gfxfont); + msg(" Appending space char to font %s, position %d, width %f", this->gfxfont->id, this->space_char, this->gfxfont->glyphs[this->space_char].advance); + } + gfxfont_fix_unicode(this->gfxfont, config_unique_unicode); + + /* optionally append a marker glyph */ + if(config_marker_glyph) { + msg(" Appending marker char to font %s, position %d, unicode %d", this->gfxfont->id, this->gfxfont->num_glyphs, config_marker_glyph); + gfxglyph_t*g = &this->gfxfont->glyphs[this->gfxfont->num_glyphs++]; + g->name = 0; + g->unicode = config_marker_glyph; + g->advance = 2048; + g->line = (gfxline_t*)rfx_calloc(sizeof(gfxline_t)); + g->line->type = gfx_moveTo; + g->line->x = g->advance; + } } return this->gfxfont; } @@ -192,13 +447,25 @@ GBool InfoOutputDev::upsideDown() {return gTrue;} GBool InfoOutputDev::useDrawChar() {return gTrue;} GBool InfoOutputDev::interpretType3Chars() {return gTrue;} -GBool InfoOutputDev::useTilingPatternFill() {return gTrue;} +GBool InfoOutputDev::useTilingPatternFill() {return gFalse;} -void InfoOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2) +GBool InfoOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data), + void *abortCheckCbkData) { + this->page = page; + return gTrue; +} + +void InfoOutputDev::startPage(int pageNum, GfxState *state) +{ + PDFRectangle *r = this->page->getCropBox(); double x1,y1,x2,y2; - state->transform(crop_x1,crop_y1,&x1,&y1); - state->transform(crop_x2,crop_y2,&x2,&y2); + state->transform(r->x1,r->y1,&x1,&y1); + state->transform(r->x2,r->y2,&x2,&y2); if(x2x1 = (int)x1; @@ -206,9 +473,19 @@ this->x2 = (int)x2; this->y2 = (int)y2; msg(" Generating info structure for page %d", pageNum); + num_links = 0; + num_jpeg_images = 0; + num_ppm_images = 0; + num_chars = 0; + num_fonts = 0; + num_polygons= 0; + num_layers = 0; + average_char_size = 0; } void InfoOutputDev::endPage() { + if(num_chars) + average_char_size /= num_chars; } void InfoOutputDev::drawLink(Link *link, Catalog *catalog) { @@ -224,16 +501,6 @@ } */ -double InfoOutputDev::getMaximumFontSize(char*id) -{ - FontInfo*info = (FontInfo*)id2font->lookup(id); - if(!info) { - msg(" Unknown font id: %s", id); - return 0.0; - } - return info->max_size; -} - char*getFontID(GfxFont*font) { Ref*ref = font->getID(); @@ -252,61 +519,220 @@ return strdup(buf); } +gfxmatrix_t gfxmatrix_from_state(GfxState*state) +{ + double* ctm = state->getCTM(); + double fontSize = state->getFontSize(); + double*textMat = state->getTextMat(); + + /* taking the absolute value of horizScaling seems to be required for + some italic fonts. FIXME: SplashOutputDev doesn't need this- why? */ + double hscale = fabs(state->getHorizScaling()); + + // from xpdf-3.02/SplashOutputDev:updateFont + double mm11 = textMat[0] * fontSize * hscale; + double mm12 = textMat[1] * fontSize * hscale; + double mm21 = textMat[2] * fontSize; + double mm22 = textMat[3] * fontSize; + + // multiply with ctm, like state->getFontTransMat() does + gfxmatrix_t m; + m.m00 = (ctm[0]*mm11 + ctm[2]*mm12) / INTERNAL_FONT_SIZE; + m.m01 = (ctm[1]*mm11 + ctm[3]*mm12) / INTERNAL_FONT_SIZE; + m.m10 = (ctm[0]*mm21 + ctm[2]*mm22) / INTERNAL_FONT_SIZE; + m.m11 = (ctm[1]*mm21 + ctm[3]*mm22) / INTERNAL_FONT_SIZE; + m.tx = 0; + m.ty = 0; + return m; +} + +void InfoOutputDev::updateTextMat(GfxState*state) +{ +} + +GBool InfoOutputDev::needNonText() +{ + /* this switches off certain expensive operations, like + pattern fill and forms */ + return gFalse; +} + void InfoOutputDev::updateFont(GfxState *state) { GfxFont*font = state->getFont(); if(!font) { - currentfont = 0; + current_splash_font = 0; return; } if(font->getType() == fontType3) { - currentfont = 0; + current_splash_font = 0; return; } - char*id = getFontID(font); + GfxState* state2 = state->copy(); + state2->setPath(0); + state2->setCTM(1.0,0,0,1.0,0,0); + splash->updateCTM(state2, 0,0,0,0,0,0); + state2->setTextMat(1.0,0,0,1.0,0,0); + state2->setFont(font, 1024.0); + splash->doUpdateFont(state2); - if(currentfont) - currentfont->splash_font = 0; + current_splash_font = splash->getCurrentFont(); + delete state2; +} - currentfont = (FontInfo*)id2font->lookup(id); - if(!currentfont) { - currentfont = new FontInfo(id); - currentfont->font = font; - currentfont->max_size = 0; - GString* idStr = new GString(id); - id2font->add(idStr, (void*)currentfont); - num_fonts++; - } +double matrix_scale_factor(gfxmatrix_t*m) +{ + double l1 = sqrt(m->m00 * m->m00 + m->m01 * m->m01); + double l2 = sqrt(m->m10 * m->m10 + m->m11 * m->m11); + return (l1+l2)/2.0; +} - state->setCTM(1.0,0,0,1.0,0,0); - splash->updateCTM(state, 0,0,0,0,0,0); - state->setTextMat(1.0,0,0,1.0,0,0); - state->setFont(font, 1024.0); - splash->doUpdateFont(state); - currentfont->splash_font = splash->getCurrentFont(); - if(currentfont->splash_font) { - currentfont->ascender = currentfont->splash_font->ascender; - currentfont->descender = currentfont->splash_font->descender; +#ifdef __GNUC__ +int __attribute__((noinline)) + font_classify(fontclass_t*out, gfxmatrix_t*in, const char*id, gfxcolor_t* color) +#else +int font_classify(fontclass_t*out, gfxmatrix_t*in, const char*id, gfxcolor_t* color) +#endif +{ + if(!config_remove_font_transforms) { + out->m00 = 1.0; + out->m11 = 1.0; + out->m01 = 0.0; + out->m10 = 0.0; } else { - currentfont->ascender = currentfont->descender = 0; + double l = matrix_scale_factor(in); + if(l < 1e-10) { + /* treat all singularity characters the same */ + memset(out, 0, sizeof(*out)); + l = 0; + } else { + out->m00 = in->m00 / l; + out->m10 = in->m10 / l; + out->m01 = -in->m01 / l; + out->m11 = -in->m11 / l; + } + + if(!color->a) { + /* for invisible characters, transforms don't need to be that + precise- use only 3 bits precision for mantissa. */ + + /* 0x80000000 //sign + 0x78000000 //exponent + 0x07ffffff //mantissa */ + *(U32*)&out->m00 = (*(U32*)&out->m00)&0xffe00000; + *(U32*)&out->m01 = (*(U32*)&out->m01)&0xffe00000; + *(U32*)&out->m10 = (*(U32*)&out->m10)&0xffe00000; + *(U32*)&out->m11 = (*(U32*)&out->m11)&0xffe00000; + } } + out->id = (char*)id; + out->alpha = color->a?1:0; - free(id); + return 1; } -void InfoOutputDev::fill(GfxState *state) +void fontclass_print(fontclass_t*cls) { - num_polygons++; + printf("[%f %f %f %f] %s alpha=%d\n", + cls->m00, cls->m01, cls->m10, cls->m11, + cls->id, + cls->alpha + ); } -void InfoOutputDev::eoFill(GfxState *state) +gfxcolor_t gfxstate_getfontcolor(GfxState*state) { - num_polygons++; + /* FIXME: instead of duplicating BitmapOutputDev's and VectorOutputDev's transparent + character logic here, we should move this code to CommonOutputDev and + call it from all three places */ + + gfxcolor_t col = gfxstate_getfillcolor(state); + /* HACK: if skewedtobitmap is on, weirdly rotated characters will + be drawn transparently in BitmapOutputDev. In order to anticipate this, + we duplicate the logic here */ + if(config_remove_invisible_outlines && + config_skewedtobitmap_pass1 && + text_matrix_is_skewed(state)) { + col.a = 0; + } + if(state->getRender() == RENDER_INVISIBLE) { + col.a = 0; + } + if(config_poly2bitmap_pass1 && (state->getRender()&3)) { + /* with poly2bitmap, stroke or stroke+fill characters are drawn + to the bitmap and potentially overlaid with a transparent character. + duplicate that logic here. */ + col.a = 0; + } + return col; } -FontInfo* InfoOutputDev::getFont(char*id) +static inline fontclass_t fontclass_from_state(GfxState*state) +{ + fontclass_t cls; + gfxcolor_t col = gfxstate_getfontcolor(state); + char*id = getFontID(state->getFont()); + gfxmatrix_t m = gfxmatrix_from_state(state); + font_classify(&cls, &m, id, &col); + return cls; +} +static inline void fontclass_clear(fontclass_t*cls) { - return (FontInfo*)id2font->lookup(id); + free(cls->id);cls->id=0; +} + +FontInfo* InfoOutputDev::getOrCreateFontInfo(GfxState*state) +{ + GfxFont*font = state->getFont(); + fontclass_t fontclass = fontclass_from_state(state); + + FontInfo* fontinfo = (FontInfo*)dict_lookup(this->fontcache, &fontclass); + if(!fontinfo) { + fontinfo = new FontInfo(&fontclass); + dict_put(this->fontcache, &fontclass, fontinfo); + fontinfo->font = font; + fontinfo->max_size = 0; + if(current_splash_font) { + fontinfo->ascender = current_splash_font->ascender; + fontinfo->descender = current_splash_font->descender; + } else { + fontinfo->ascender = fontinfo->descender = 0; + } + num_fonts++; + } + + if(last_font && fontinfo!=last_font) { + last_font->resetPositioning(); + } + + this->last_font = fontinfo; + fontclass_clear(&fontclass); + return fontinfo; +} + +FontInfo* InfoOutputDev::getFontInfo(GfxState*state) +{ + fontclass_t fontclass = fontclass_from_state(state); + FontInfo*result = (FontInfo*)dict_lookup(this->fontcache, &fontclass); + if(!result) { + printf("NOT FOUND: "); + fontclass_print(&fontclass); + } + fontclass_clear(&fontclass); + return result; +} + +gfxmatrix_t FontInfo::get_gfxmatrix(GfxState*state) +{ + gfxmatrix_t m = gfxmatrix_from_state(state); + if(!config_remove_font_transforms) { + return m; + } else { + double scale = matrix_scale_factor(&m) * this->scale; + gfxmatrix_t m = {scale, 0, 0, + 0, -scale, 0}; + return m; + } } void InfoOutputDev::drawChar(GfxState *state, double x, double y, @@ -321,38 +747,93 @@ double lenx = sqrt(m11*m11 + m12*m12); double leny = sqrt(m21*m21 + m22*m22); double len = lenx>leny?lenx:leny; - if(!currentfont || !currentfont->splash_font) { + + FontInfo*fontinfo = getOrCreateFontInfo(state); + + if(!fontinfo) { + msg(" Internal error: No fontinfo for font"); return; //error } - if(currentfont && currentfont->max_size < len) { - currentfont->max_size = len; + if(!current_splash_font) { + msg(" Internal error: No current splash fontinfo"); + return; //error } - - num_textfields++; + if(fontinfo->max_size < len) { + fontinfo->max_size = len; + } + fontinfo->num_chars++; + if(uLen && u[0]==32) { + fontinfo->num_spaces++; + } + + average_char_size += fmax(lenx,leny); + num_chars++; + + if(!previous_was_char) + num_layers++; + previous_was_char=1; - currentfont->grow(code+1); - GlyphInfo*g = currentfont->glyphs[code]; + fontinfo->grow(code+1); + GlyphInfo*g = fontinfo->glyphs[code]; if(!g) { - g = currentfont->glyphs[code] = new GlyphInfo(); + g = fontinfo->glyphs[code] = new GlyphInfo(); g->advance_max = 0; - currentfont->splash_font->last_advance = -1; - g->path = currentfont->splash_font->getGlyphPath(code); - g->advance = currentfont->splash_font->last_advance; + current_splash_font->last_advance = -1; + g->path = current_splash_font->getGlyphPath(code); + g->advance = current_splash_font->last_advance; g->unicode = 0; } - if(uLen && (u[0]>=32 && u[0]unicode || !g->unicode)) { + if(uLen && ((u[0]>=32 && u[0]unicode) || !g->unicode)) { g->unicode = u[0]; } - if(currentfont->lastchar>=0 && currentfont->lasty == y) { - double xshift = x - currentfont->lastx; + if(fontinfo->lastchar>=0 && fontinfo->lasty == y) { + double xshift = (x - fontinfo->lastx); if(xshift>=0 && xshift > g->advance_max) { g->advance_max = xshift; } + } else { + num_text_breaks++; } - currentfont->lastx = x; - currentfont->lasty = y; - currentfont->lastchar = code; + fontinfo->lastx = x; + fontinfo->lasty = y; + fontinfo->lastchar = code; + fontinfo->lastadvance = g->advance; +} + +static char path_is_rectangular(GfxState* state) +{ + GfxPath * path = state->getPath(); + int num = path->getNumSubpaths(); + if(num!=1) return 0; + GfxSubpath*subpath = path->getSubpath(0); + int subnum = path->getSubpath(0)->getNumPoints(); + + if(subnum>5) return 0; + int s; + for(s=1;sgetCurve(s)) + return 0; + if(subpath->getX(s) != subpath->getX(s-1) && + subpath->getY(s) != subpath->getY(s-1)) { + return 0; + } + } + return 1; +} + +void InfoOutputDev::fill(GfxState *state) +{ + if(!path_is_rectangular(state)) + previous_was_char=0; + num_polygons++; +} + +void InfoOutputDev::eoFill(GfxState *state) +{ + if(!path_is_rectangular(state)) + previous_was_char=0; + num_polygons++; } GBool InfoOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) @@ -363,27 +844,30 @@ if(font->getType() != fontType3) return gTrue; - char*id = getFontID(font); - currentfont = (FontInfo*)id2font->lookup(id); - if(!currentfont) { - currentfont = new FontInfo(id); - currentfont->font = font; - GString* idStr = new GString(id); - id2font->add(idStr, (void*)currentfont); + current_splash_font = 0; + + fontclass_t fontclass = fontclass_from_state(state); + FontInfo* fontinfo = (FontInfo*)dict_lookup(this->fontcache, &fontclass); + if(!fontinfo) { + fontinfo = new FontInfo(&fontclass); + dict_put(this->fontcache, &fontclass, fontinfo); + fontinfo->font = font; + fontinfo->max_size = 0; num_fonts++; } - currentfont = currentfont; - free(id); + fontclass_clear(&fontclass); - currentfont->grow(code+1); - if(!currentfont->glyphs[code]) { - currentglyph = currentfont->glyphs[code] = new GlyphInfo(); + current_type3_font = fontinfo; + fontinfo->grow(code+1); + if(!fontinfo->glyphs[code]) { + currentglyph = fontinfo->glyphs[code] = new GlyphInfo(); currentglyph->unicode = uLen?u[0]:0; currentglyph->path = new SplashPath(); currentglyph->x1=0; currentglyph->y1=0; currentglyph->x2=dx; currentglyph->y2=dy; + currentglyph->advance=dx; return gFalse; } else { return gTrue; @@ -400,6 +884,11 @@ void InfoOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) { + if(-lly>current_type3_font->descender) + current_type3_font->descender = -lly; + if(ury>current_type3_font->ascender) + current_type3_font->ascender = ury; + currentglyph->x1=llx; currentglyph->y1=lly; currentglyph->x2=urx; @@ -418,54 +907,73 @@ currentglyph->path->lineTo(x1,y2); currentglyph->path->close(); } + +void InfoOutputDev::saveState(GfxState *state) +{ + updateAll(state); +} + +void InfoOutputDev::restoreState(GfxState *state) +{ + updateAll(state); +} void InfoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, + POPPLER_INTERPOLATE GBool inlineImg) { + previous_was_char=0; if(str->getKind()==strDCT) num_jpeg_images++; else num_ppm_images++; - OutputDev::drawImageMask(state,ref,str,width,height,invert,inlineImg); + OutputDev::drawImageMask(state,ref,str,width,height,invert, POPPLER_INTERPOLATE_ARG inlineImg); } void InfoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE int *maskColors, GBool inlineImg) { + previous_was_char=0; if(str->getKind()==strDCT) num_jpeg_images++; else num_ppm_images++; - OutputDev::drawImage(state,ref,str,width,height,colorMap,maskColors,inlineImg); + OutputDev::drawImage(state,ref,str,width,height,colorMap, POPPLER_INTERPOLATE_ARG maskColors,inlineImg); } void InfoOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert) + GBool maskInvert + POPPLER_MASK_INTERPOLATE) { + previous_was_char=0; if(str->getKind()==strDCT) num_jpeg_images++; else num_ppm_images++; - OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskInvert); + OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap, POPPLER_INTERPOLATE_ARG maskStr,maskWidth,maskHeight,maskInvert POPPLER_MASK_INTERPOLATE_ARG); } void InfoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap) + GfxImageColorMap *maskColorMap + POPPLER_MASK_INTERPOLATE) { + previous_was_char=0; if(str->getKind()==strDCT) num_jpeg_images++; else num_ppm_images++; - OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskColorMap); + OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap, POPPLER_INTERPOLATE_ARG maskStr,maskWidth,maskHeight,maskColorMap POPPLER_MASK_INTERPOLATE_ARG); } void InfoOutputDev::dumpfonts(gfxdevice_t*dev) { GHashIter*i; GString*key; - FontInfo*font; - id2font->startIter(&i); - while(id2font->getNext(&i, &key, (void**)&font)) { - dev->addfont(dev, font->getGfxFont()); + + DICT_ITERATE_DATA(fontcache, FontInfo*, info) { + dev->addfont(dev, info->getGfxFont()); } } diff -Nru swftools-0.9.0/lib/pdf/InfoOutputDev.h swftools-0.9.2/lib/pdf/InfoOutputDev.h --- swftools-0.9.0/lib/pdf/InfoOutputDev.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/pdf/InfoOutputDev.h 2011-10-07 03:20:17.000000000 +0000 @@ -21,19 +21,23 @@ #ifndef __infooutputdev_h__ #define __infooutputdev_h__ +#include "popplercompat.h" #include "GfxFont.h" #include "OutputDev.h" #include "SplashOutputDev.h" +#include "Page.h" + #ifdef HAVE_POPPLER -#include -#include -#include -#include + #include + #include + #include + #include #else -#include "SplashTypes.h" -#include "SplashPath.h" -#include "SplashFont.h" -#include "SplashFontFile.h" + #include "xpdf/config.h" + #include "SplashTypes.h" + #include "SplashPath.h" + #include "SplashFont.h" + #include "SplashFontFile.h" #endif #ifdef HAVE_POPPLER @@ -44,8 +48,10 @@ #include "../gfxdevice.h" #include "../gfxtools.h" #include "../gfxfont.h" +#include "../q.h" #define INTERNAL_FONT_SIZE 1024.0 +#define GLYPH_IS_SPACE(g) ((!(g)->line || ((g)->line->type==gfx_moveTo && !(g)->line->next)) && (g)->advance) struct GlyphInfo { @@ -58,41 +64,66 @@ double advance_max; }; +typedef struct _fontclass { + float m00,m01,m10,m11; + char*id; + unsigned char alpha; +} fontclass_t; + class FontInfo { gfxfont_t*gfxfont; char*id; + double scale; + + gfxfont_t* createGfxFont(); public: - FontInfo(char*id); + fontclass_t*fontclass; + FontInfo(fontclass_t*fontclass); ~FontInfo(); + gfxmatrix_t get_gfxmatrix(GfxState*state); gfxfont_t* getGfxFont(); + char usesSpaces(); + double lastx,lasty; int lastchar; + double lastadvance; double ascender,descender; void grow(int size); + void resetPositioning(); GfxFont*font; double max_size; int num_glyphs; GlyphInfo**glyphs; - int*charid2glyph; - SplashFont*splash_font; + char seen; + int space_char; + float average_advance; + + int num_chars; + int num_spaces; }; extern char*getFontID(GfxFont*font); +extern gfxmatrix_t gfxmatrix_from_state(GfxState*state); class InfoOutputDev: public OutputDev { - GHash* id2font; - FontInfo* currentfont; GlyphInfo* currentglyph; SplashOutputDev*splash; + char previous_was_char; + Page *page; + + dict_t*fontcache; + FontInfo*last_font; + FontInfo*current_type3_font; + SplashFont*current_splash_font; public: int x1,y1,x2,y2; @@ -101,22 +132,34 @@ int num_jpeg_images; int num_fonts; int num_polygons; - int num_textfields; + int num_chars; + int num_layers; + int num_text_breaks; + double average_char_size; - void finish(); void dumpfonts(gfxdevice_t*dev); + FontInfo* getFontInfo(GfxState*state); InfoOutputDev(XRef*xref); virtual ~InfoOutputDev(); virtual GBool useTilingPatternFill(); virtual GBool upsideDown(); + virtual GBool needNonText(); virtual GBool useDrawChar(); virtual GBool interpretType3Chars(); - virtual void startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2); + virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data) = NULL, + void *abortCheckCbkData = NULL); + virtual void startPage(int pageNum, GfxState *state); virtual void endPage(); virtual void drawLink(Link *link, Catalog *catalog); - virtual double getMaximumFontSize(char*id); virtual void updateFont(GfxState *state); + + virtual void saveState(GfxState *state); + virtual void restoreState(GfxState *state); virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen); virtual void type3D0(GfxState *state, double wx, double wy); @@ -130,26 +173,36 @@ double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen); + + virtual void updateTextMat(GfxState*state); + virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, + POPPLER_INTERPOLATE GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE int *maskColors, GBool inlineImg); virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GBool maskInvert); + GBool maskInvert + POPPLER_MASK_INTERPOLATE); virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, + POPPLER_INTERPOLATE Stream *maskStr, int maskWidth, int maskHeight, - GfxImageColorMap *maskColorMap); - - virtual FontInfo* getFont(char*id); + GfxImageColorMap *maskColorMap + POPPLER_MASK_INTERPOLATE); + private: + + FontInfo* getOrCreateFontInfo(GfxState*state); }; #endif //__infooutputdev_h__ diff -Nru swftools-0.9.0/lib/pdf/Makefile.in swftools-0.9.2/lib/pdf/Makefile.in --- swftools-0.9.0/lib/pdf/Makefile.in 2009-03-27 07:31:08.000000000 +0000 +++ swftools-0.9.2/lib/pdf/Makefile.in 2010-11-12 18:57:42.000000000 +0000 @@ -4,11 +4,13 @@ top_srcdir = @top_srcdir@ include ../../Makefile.common -all: ../libpdf$(A) pdf2swf$(E) +all-local: ../libgfxpdf$(A) pdf2swf$(E) pdf2jpeg$(E) -libpdf: ../libpdf$(A) +all: ../libgfxpdf$(A) -libpdf_objects = GFXOutputDev.$(O) InfoOutputDev.$(O) BitmapOutputDev.$(O) FullBitmapOutputDev.$(O) pdf.$(O) fonts.$(O) +libgfxpdf: ../libgfxpdf$(A) + +libgfxpdf_objects = VectorGraphicOutputDev.$(O) BitmapOutputDev.$(O) FullBitmapOutputDev.$(O) CharOutputDev.$(O) CommonOutputDev.$(O) InfoOutputDev.$(O) XMLOutputDev.$(O) pdf.$(O) fonts.$(O) bbox.$(O) popplercompat.$(O) xpdf_in_source = @xpdf_in_source@ @@ -21,7 +23,8 @@ xpdf/JArithmeticDecoder.$(O) xpdf/Gfx.$(O) xpdf/GfxFont.$(O) xpdf/CMap.$(O) xpdf/CharCodeToUnicode.$(O) \ xpdf/PSTokenizer.$(O) xpdf/FontEncodingTables.$(O) xpdf/BuiltinFont.$(O) xpdf/BuiltinFontTables.$(O) \ xpdf/GfxState.$(O) xpdf/Function.$(O) xpdf/Annot.$(O) xpdf/NameToCharCode.$(O) xpdf/UnicodeMap.$(O) \ - xpdf/SecurityHandler.$(O) #xpdf/OptionalContent.$(O) + xpdf/SecurityHandler.$(O) xpdf/TextOutputDev.$(O) xpdf/UnicodeTypeTable.$(O) + #xpdf/OptionalContent.$(O) splash_in_source = @splash_in_source@ splash_objects = xpdf/SplashOutputDev.$(O) xpdf/SplashFont.$(O) xpdf/SplashState.$(O) xpdf/Splash.$(O) \ @@ -30,22 +33,41 @@ xpdf/SplashScreen.$(O) xpdf/SplashPath.$(O) xpdf/SplashXPath.$(O) xpdf/SplashXPathScanner.$(O) \ xpdf/SplashFTFontEngine.$(O) xpdf/SplashFTFontFile.$(O) xpdf/SplashFTFont.$(O) +xpdf_include = @xpdf_include@ + +popplercompat.$(O): popplercompat.cc + $(C) -I ./ $(xpdf_include) popplercompat.cc -o $@ fonts.$(O): fonts.c $(C) fonts.c -o $@ +bbox.$(O): bbox.c + $(C) bbox.c -o $@ cmyk.$(O): cmyk.cc - $(CC) -I ./ -I xpdf cmyk.cc -o $@ -GFXOutputDev.$(O): GFXOutputDev.cc GFXOutputDev.h CommonOutputDev.h ../gfxpoly.h - $(CC) -I ./ -I xpdf GFXOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) cmyk.cc -o $@ +CommonOutputDev.$(O): CommonOutputDev.cc InfoOutputDev.h + $(CC) -I ./ $(xpdf_include) CommonOutputDev.cc -o $@ +VectorGraphicOutputDev.$(O): VectorGraphicOutputDev.cc VectorGraphicOutputDev.h CharOutputDev.h CommonOutputDev.h InfoOutputDev.h ../gfxpoly.h + $(CC) -I ./ $(xpdf_include) VectorGraphicOutputDev.cc -o $@ +CharOutputDev.$(O): CharOutputDev.cc CharOutputDev.h CommonOutputDev.h InfoOutputDev.h ../gfxpoly.h + $(CC) -I ./ $(xpdf_include) CharOutputDev.cc -o $@ InfoOutputDev.$(O): InfoOutputDev.cc InfoOutputDev.h - $(CC) -I ./ -I xpdf InfoOutputDev.cc -o $@ -BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h - $(CC) -I ./ -I xpdf BitmapOutputDev.cc -o $@ -FullBitmapOutputDev.$(O): FullBitmapOutputDev.cc FullBitmapOutputDev.h CommonOutputDev.h - $(CC) -I ./ -I xpdf FullBitmapOutputDev.cc -o $@ -DummyOutputDev.$(O): DummyOutputDev.cc DummyOutputDev.h - $(CC) -I ./ -I xpdf DummyOutputDev.cc -o $@ -pdf.$(O): pdf.cc GFXOutputDev.h InfoOutputDev.h CommonOutputDev.h BitmapOutputDev.h FullBitmapOutputDev.h - $(CC) -I ./ -I xpdf pdf.cc -o $@ + $(CC) -I ./ $(xpdf_include) InfoOutputDev.cc -o $@ +BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h + $(CC) -I ./ $(xpdf_include) BitmapOutputDev.cc -o $@ +XMLOutputDev.$(O): XMLOutputDev.cc XMLOutputDev.h xpdf/TextOutputDev.h + $(CC) -I ./ $(xpdf_include) XMLOutputDev.cc -o $@ +FullBitmapOutputDev.$(O): FullBitmapOutputDev.cc FullBitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h + $(CC) -I ./ $(xpdf_include) FullBitmapOutputDev.cc -o $@ +DummyOutputDev.$(O): DummyOutputDev.cc DummyOutputDev.h InfoOutputDev.h + $(CC) -I ./ $(xpdf_include) DummyOutputDev.cc -o $@ +pdf.$(O): pdf.cc VectorGraphicOutputDev.h CharOutputDev.h InfoOutputDev.h CommonOutputDev.h BitmapOutputDev.h FullBitmapOutputDev.h InfoOutputDev.h + $(CC) -I ./ $(xpdf_include) pdf.cc -o $@ + +XPDFOK = xpdf/Gfx.cc +ifeq ($(shell echo inject*xpdf.pl),inject-xpdf.pl) +$(XPDFOK): Makefile.in inject-xpdf.pl xpdf-*tar.gz xpdf*patch + @if test xpdf-changes.patch -nt $(XPDFOK);then perl inject-xpdf.pl xpdf-3.02.tar.gz;fi + @if test '!' -d xpdf;then perl inject-xpdf.pl xpdf-3.02.tar.gz;fi +endif xpdf/UnicodeMap.$(O): xpdf/UnicodeMap.cc $(CC) -I ./ -I xpdf xpdf/UnicodeMap.cc -o $@ @@ -135,45 +157,61 @@ $(CC) -I ./ -I xpdf xpdf/gfile.cc -o $@ xpdf/gmem.$(O): xpdf/gmem.cc $(C) -I ./ -I xpdf xpdf/gmem.cc -o $@ +xpdf/parseargs.$(O): xpdf/parseargs.c + $(C) -I ./ -I xpdf xpdf/parseargs.c -o $@ xpdf/%.$(O): xpdf/%.cc $(CC) -I ./ -I xpdf $< -o $@ -../libpdf$(A): $(libpdf_objects) $(xpdf_in_source) $(splash_in_source) - $(AR) r ../libpdf$(A) $(libpdf_objects) $(xpdf_in_source) $(splash_in_source) - $(RANLIB) ../libpdf$(A) - - +../libgfxpdf$(A): $(XPDFOK) $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) + rm -f ../libgfxpdf$(A) + $(AR) r ../libgfxpdf$(A) $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) + $(RANLIB) ../libgfxpdf$(A) xpdfapp_sources=xpdf/XPDFApp.cc xpdf/XPDFCore.cc xpdf/XPDFTree.cc xpdf/XPDFViewer.cc xpdf/PDFCore.cc xpdf/TextOutputDev.cc xpdf/xpdf.cc xpdf/CoreOutputDev.cc xpdf/UnicodeTypeTable.cc xpdf/PSOutputDev.cc splash_sources=xpdf/Splash.cc xpdf/SplashBitmap.cc xpdf/SplashClip.cc xpdf/SplashFTFont.cc xpdf/SplashFTFontEngine.cc xpdf/SplashFTFontFile.cc xpdf/SplashFont.cc xpdf/SplashFontEngine.cc xpdf/SplashFontFile.cc xpdf/SplashFontFileID.cc xpdf/SplashOutputDev.cc xpdf/SplashPath.cc xpdf/SplashPattern.cc xpdf/SplashScreen.cc xpdf/SplashState.cc xpdf/SplashT1Font.cc xpdf/SplashT1FontEngine.cc xpdf/SplashT1FontFile.cc xpdf/SplashXPath.cc xpdf/SplashXPathScanner.cc -xpdfapp_objects=xpdf/XPDFApp.$(O) xpdf/XPDFCore.$(O) xpdf/XPDFTree.$(O) xpdf/XPDFViewer.$(O) xpdf/PDFCore.$(O) xpdf/TextOutputDev.$(O) xpdf/xpdf.$(O) xpdf/CoreOutputDev.$(O) xpdf/UnicodeTypeTable.$(O) xpdf/PSOutputDev.$(O) +xpdfapp_objects=xpdf/XPDFApp.$(O) xpdf/XPDFCore.$(O) xpdf/XPDFTree.$(O) xpdf/XPDFViewer.$(O) xpdf/PDFCore.$(O) xpdf/xpdf.$(O) xpdf/CoreOutputDev.$(O) xpdf/PSOutputDev.$(O) -#splash_objects=xpdf/Splash.$(O) xpdf/SplashBitmap.$(O) xpdf/SplashClip.$(O) xpdf/SplashFTFont.$(O) xpdf/SplashFTFontEngine.$(O) xpdf/SplashFTFontFile.$(O) xpdf/SplashFont.$(O) xpdf/SplashFontEngine.$(O) xpdf/SplashFontFile.$(O) xpdf/SplashFontFileID.$(O) xpdf/SplashOutputDev.$(O) xpdf/SplashPath.$(O) xpdf/SplashPattern.$(O) xpdf/SplashScreen.$(O) xpdf/SplashState.$(O) xpdf/SplashT1Font.$(O) xpdf/SplashT1FontEngine.$(O) xpdf/SplashT1FontFile.$(O) xpdf/SplashXPath.$(O) xpdf/SplashXPathScanner.$(O) xxpdf$(E): $(xpdf_objects) $(xpdfapp_objects) $(splash_objects) $(LL) $(CPPFLAGS) -DXPDFEXE -g -I xpdf -I . $(xpdfapp_objects) $(xpdf_objects) $(splash_objects) xpdf/parseargs.c -o xxpdf$(E) $(LIBS) -lXm -lX11 -pdftoppm$(E): $(xpdf_objects) xpdf/Splash*.cc - $(LL) $(CPPFLAGS) -DXPDFEXE -g -I xpdf -I . xpdf/pdftoppm.cc $(xpdf_objects) xpdf/Splash*.cc xpdf/parseargs.c -o pdftoppm$(E) $(LIBS) -pdftotext$(E): $(xpdf_objects) $(splash_objects) - $(LL) $(CPPFLAGS) -DXPDFEXE -g -I xpdf -I . xpdf/pdftotext.cc $(xpdf_objects) xpdf/TextOutput*.cc xpdf/UnicodeType*.cc xpdf/parseargs.c -o pdftotext$(E) $(LIBS) +pdftoppm.$(O): $(XPDFOK) xpdf/pdftoppm.cc $(xpdf_objects) $(splash_objects) + $(CC) -DXPDFEXE -I xpdf -I . xpdf/pdftoppm.cc +pdftotext.$(O): $(XPDFOK) xpdf/pdftotext.cc $(xpdf_objects) + $(CC) -DXPDFEXE -I xpdf -I . xpdf/pdftotext.cc +pdfinfo.$(O): $(XPDFOK) xpdf/pdfinfo.cc $(xpdf_objects) + $(CC) -DXPDFEXE -I xpdf -I . xpdf/pdfinfo.cc + +pdftoppm$(E): $(XPDFOK) xpdf/pdftoppm.$(O) xpdf/parseargs.$(O) $(xpdf_objects) $(splash_objects) + $(LL) $(CPPFLAGS) -DXPDFEXE -g $(xpdf_include) -I . xpdf/pdftoppm.$(O) $(xpdf_objects) $(splash_objects) xpdf/parseargs.$(O) -o pdftoppm$(E) $(LIBS) +pdftotext$(E): $(XPDFOK) xpdf/pdftotext.$(O) xpdf/parseargs.$(O) $(xpdf_objects) + $(LL) $(CPPFLAGS) -DXPDFEXE -g $(xpdf_include) -I . xpdf/pdftotext.$(O) $(xpdf_objects) xpdf/parseargs.$(O) -o pdftotext$(E) $(LIBS) +pdfinfo$(E): $(XPDFOK) xpdf/pdfinfo.$(O) xpdf/parseargs.$(O) $(xpdf_objects) + $(LL) $(CPPFLAGS) -DXPDFEXE -g $(xpdf_include) -I . xpdf/pdfinfo.$(O) $(xpdf_objects) xpdf/parseargs.$(O) -o pdfinfo$(E) $(LIBS) gfx_objects = ../libgfxswf$(A) ../libgfx$(A) ../librfxswf$(A) ../libbase$(A) -gfx_objects2 = $(gfx_objects) ../devices/lrf.$(O) ../libocr$(A) +gfx_objects2 = $(gfx_objects) ../libocr$(A) -pdf2swf$(E): ../../src/pdf2swf.c $(libpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) - $(LL) $(CPPFLAGS) -g ../../src/pdf2swf.c $(libpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -o pdf2swf$(E) $(LIBS) -gfx2gfx$(E): ../../src/gfx2gfx.c $(libpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects2) - $(LL) $(CPPFLAGS) -g ../../src/gfx2gfx.c $(libpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects2) -o gfx2gfx$(E) $(LIBS) +pdf2jpeg$(E): $(XPDFOK) pdf2jpeg.c ../libbase$(A) xpdf/parseargs.$(O) $(xpdf_objects) $(splash_objects) + $(LL) $(CPPFLAGS) -DXPDFEXE $(xpdf_include) -I. -g pdf2jpeg.c xpdf/parseargs.$(O) ../libbase$(A) $(xpdf_objects) $(splash_objects) -o pdf2jpeg$(E) $(LIBS) +pdf2swf$(E): $(XPDFOK) ../../src/pdf2swf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) + $(LL) $(CPPFLAGS) -g ../../src/pdf2swf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -o pdf2swf$(E) $(LIBS) +pdf2pdf$(E): $(XPDFOK) ../../src/pdf2pdf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) + $(LL) $(CPPFLAGS) -g ../../src/pdf2pdf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -o pdf2pdf$(E) $(LIBS) +gfx2gfx$(E): $(XPDFOK) ../../src/gfx2gfx.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects2) + $(LL) $(CPPFLAGS) -g ../../src/gfx2gfx.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects2) -o gfx2gfx$(E) $(LIBS) install: + $(mkinstalldirs) $(bindir) + @for file in pdfinfo pdftoppm pdftotext; do if test -f $$file;then $(INSTALL_BIN);fi;done + uninstall: clean: rm -f xpdf/*.o xpdf/*.obj *.o pdf2swf pdftoppm pdftotext pdf2swf.exe pdftoppm.exe pdftotext.exe *.obj *.lo *.a *.lib *.la gmon.out -.PHONY: clean install uninstall check all +.PHONY: clean install uninstall check all xpdf diff -Nru swftools-0.9.0/lib/pdf/pdf2jpeg.c swftools-0.9.2/lib/pdf/pdf2jpeg.c --- swftools-0.9.0/lib/pdf/pdf2jpeg.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/pdf2jpeg.c 2010-11-12 18:58:09.000000000 +0000 @@ -0,0 +1,163 @@ +/* pdf2jpeg.c + Converts a pdf page to a jpeg. + + Copyright (c) 2010 Matthias Kramm + Copyright (c) 1998-2009 Derek Noonburg + + Swftools 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. + + Swftools 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. + + You should have received a copy of the GNU General Public License + along with swftools; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include "parseargs.h" +#include "gmem.h" +#include "GString.h" +#include "GlobalParams.h" +#include "Object.h" +#include "PDFDoc.h" +#include "SplashBitmap.h" +#include "Splash.h" +#include "SplashOutputDev.h" +#include "config.h" +#include "../jpeg.h" + +static int page = 1; +static int width = 0; +static int resolution = 150; +static int quality = 95; +static char ownerPassword[33] = ""; +static char userPassword[33] = ""; +static char cfgFileName[256] = ""; +static GBool printVersion = gFalse; +static GBool printHelp = gFalse; +static char output[256] = "output.jpg"; + +static ArgDesc argDesc[] = { + {"-p", argInt, &page, 0, + "first page to print"}, + {"-r", argInt, &resolution, 0, + "resolution, in DPI (default is 150)"}, + {"-q", argInt, &quality, 0, + "jpeg conversion quality"}, + {"-w", argInt, &width, 0, + "zoom to this width"}, + {"-o", argString, &output, sizeof(output), + "resolution, in DPI (default is 150)"}, + {"-opw", argString, ownerPassword, sizeof(ownerPassword), + "owner password (for encrypted files)"}, + {"-upw", argString, userPassword, sizeof(userPassword), + "user password (for encrypted files)"}, + {"-cfg", argString, cfgFileName, sizeof(cfgFileName), + "configuration file to use in place of .xpdfrc"}, + {"-v", argFlag, &printVersion, 0, + "print copyright and version info"}, + {"-h", argFlag, &printHelp, 0, + "print usage information"}, + {"-help", argFlag, &printHelp, 0, + "print usage information"}, + {"--help", argFlag, &printHelp, 0, + "print usage information"}, + {"-?", argFlag, &printHelp, 0, + "print usage information"}, + {NULL} +}; + +int main(int argc, char *argv[]) { + PDFDoc *doc; + GString *fileName; + GString *ownerPW, *userPW; + SplashColor paperColor; + SplashOutputDev *splashOut; + GBool ok; + int exitCode; + int pg; + + exitCode = 99; + + // parse args + ok = parseArgs(argDesc, &argc, argv); + + if (!ok || argc != 2 || printVersion || printHelp) { + fprintf(stderr, "pdf2jpeg version %s\n", xpdfVersion); + fprintf(stderr, "%s\n", xpdfCopyright); + if (!printVersion) { + printUsage("pdf2jpeg", " -o ", argDesc); + } + goto err0; + } + fileName = new GString(argv[1]); + + // read config file + globalParams = new GlobalParams(cfgFileName); + globalParams->setupBaseFonts(NULL); + + // open PDF file + if (ownerPassword[0]) { + ownerPW = new GString(ownerPassword); + } else { + ownerPW = NULL; + } + if (userPassword[0]) { + userPW = new GString(userPassword); + } else { + userPW = NULL; + } + doc = new PDFDoc(fileName, ownerPW, userPW); + if (userPW) { + delete userPW; + } + if (ownerPW) { + delete ownerPW; + } + if (!doc->isOk()) { + exitCode = 1; + goto err1; + } + + paperColor[0] = paperColor[1] = paperColor[2] = 0xff; + splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor); + + splashOut->startDoc(doc->getXRef()); + + if(page>=1 && page<=doc->getNumPages()) { + double r = resolution; + if(width) { + int old_width = doc->getPageCropWidth(page); + r = 72.0*width/old_width; + } + doc->displayPage(splashOut, page, r, r, 0, gFalse, gTrue, gFalse); + SplashBitmap*bitmap = splashOut->getBitmap(); + if(bitmap) { + Guchar*rgb = bitmap->getDataPtr(); + int width = bitmap->getWidth(); + int height = bitmap->getHeight(); + jpeg_save(rgb, width, height, quality, output); + } + } + delete splashOut; + + exitCode = 0; + + // clean up + err1: + delete doc; + delete globalParams; + err0: + + // check for memory leaks + Object::memCheck(stderr); + gMemReport(stderr); + + return exitCode; +} diff -Nru swftools-0.9.0/lib/pdf/pdf.cc swftools-0.9.2/lib/pdf/pdf.cc --- swftools-0.9.0/lib/pdf/pdf.cc 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/pdf/pdf.cc 2011-01-02 03:30:29.000000000 +0000 @@ -1,38 +1,35 @@ +#include +#include #include "../gfxdevice.h" #include "../gfxsource.h" #include "../devices/rescale.h" #include "../log.h" -#include "config.h" +#include "../../config.h" +#ifdef HAVE_POPPLER + #include +#else + #include "xpdf/config.h" +#endif #include "GlobalParams.h" #include "InfoOutputDev.h" -#include "GFXOutputDev.h" +#include "CharOutputDev.h" #include "FullBitmapOutputDev.h" #include "BitmapOutputDev.h" +#include "VectorGraphicOutputDev.h" #include "../mem.h" #include "pdf.h" #define NO_ARGPARSER #include "../args.h" +#include "../utf8.h" static double zoom = 72; /* xpdf: 86 */ -static int jpeg_dpi = 0; -static int ppm_dpi = 0; -static int multiply = 1; +static int zoomtowidth = 0; +static double multiply = 1.0; static char* global_page_range = 0; +static int threadsafe = 0; static int globalparams_count=0; -typedef struct _parameter -{ - struct _parameter *next; - const char*name; - const char*value; -} parameter_t; -typedef struct _parameterlist -{ - parameter_t* device_config; - parameter_t* device_config_next; -} parameterlist_t; - typedef struct _pdf_page_info { int xMin, yMin, xMax, yMax; @@ -47,14 +44,18 @@ { char config_bitmap_optimizing; char config_full_bitmap_optimizing; + char config_only_text; char config_print; - parameterlist_t parameters; + gfxparams_t* parameters; int protect; int nocopy; int noprint; - + + GString*fileName; + GString*userPW; PDFDoc*doc; + Object docinfo; InfoOutputDev*info; @@ -81,7 +82,7 @@ typedef struct _gfxsource_internal { - parameterlist_t parameters; + gfxparams_t* parameters; } gfxsource_internal_t; @@ -94,34 +95,6 @@ #endif } -static void storeDeviceParameter(parameterlist_t*i, const char*name, const char*value) -{ - parameter_t*o = i->device_config; - while(o) { - if(!strcmp(name, o->name)) { - /* overwrite old value */ - free((void*)o->value); - o->value = strdup(value); - return; - } - o = o->next; - } - parameter_t*p = new parameter_t(); - p->name = strdup(name); - p->value = strdup(value); - p->next = 0; - - if(i->device_config_next) { - i->device_config_next->next = p; - i->device_config_next = p; - } else { - i->device_config = p; - i->device_config_next = p; - } -} - - - void pdfpage_destroy(gfxpage_t*pdf_page) { pdf_page_internal_t*i= (pdf_page_internal_t*)pdf_page->internal; @@ -139,37 +112,36 @@ CommonOutputDev*outputDev = 0; if(pi->config_full_bitmap_optimizing) { - FullBitmapOutputDev*d = new FullBitmapOutputDev(pi->info, pi->doc); + FullBitmapOutputDev*d = new FullBitmapOutputDev(pi->info, pi->doc, pi->pagemap, pi->pagemap_pos, x, y, x1, y1, x2, y2); outputDev = (CommonOutputDev*)d; } else if(pi->config_bitmap_optimizing) { - BitmapOutputDev*d = new BitmapOutputDev(pi->info, pi->doc); + BitmapOutputDev*d = new BitmapOutputDev(pi->info, pi->doc, pi->pagemap, pi->pagemap_pos, x, y, x1, y1, x2, y2); + outputDev = (CommonOutputDev*)d; + } else if(pi->config_only_text) { + CharOutputDev*d = new CharOutputDev(pi->info, pi->doc, pi->pagemap, pi->pagemap_pos, x, y, x1, y1, x2, y2); outputDev = (CommonOutputDev*)d; } else { - GFXOutputDev*d = new GFXOutputDev(pi->info, pi->doc); + VectorGraphicOutputDev*d = new VectorGraphicOutputDev(pi->info, pi->doc, pi->pagemap, pi->pagemap_pos, x, y, x1, y1, x2, y2); outputDev = (CommonOutputDev*)d; } + /* pass global parameters to PDF driver*/ - parameter_t*p = i->parameters.device_config; + gfxparam_t*p = i->parameters->params; while(p) { - outputDev->setParameter(p->name, p->value); + outputDev->setParameter(p->key, p->value); p = p->next; } - p = pi->parameters.device_config; + p = pi->parameters->params; while(p) { - outputDev->setParameter(p->name, p->value); + outputDev->setParameter(p->key, p->value); p = p->next; } - outputDev->setPageMap(pi->pagemap, pi->pagemap_pos); - outputDev->setMove(x,y); - outputDev->setClip(x1,y1,x2,y2); - gfxdevice_t* middev=0; - if(multiply>1) { + if(multiply!=1.0) { middev = (gfxdevice_t*)malloc(sizeof(gfxdevice_t)); gfxdevice_rescale_init(middev, 0x00000000, 0, 0, 1.0 / multiply); gfxdevice_rescale_setdevice(middev, dev); - middev->setparameter(middev, "protect", "1"); dev = middev; } @@ -188,8 +160,8 @@ } outputDev->setDevice(dev); - pi->doc->displayPage((OutputDev*)outputDev, page->nr, zoom*multiply, zoom*multiply, /*rotate*/0, true, true, pi->config_print); pi->doc->processLinks((OutputDev*)outputDev, page->nr); + pi->doc->displayPage((OutputDev*)outputDev, page->nr, zoom*multiply, zoom*multiply, /*rotate*/0, true, true, pi->config_print); outputDev->finishPage(); outputDev->setDevice(0); delete outputDev; @@ -223,8 +195,22 @@ { pdf_doc_internal_t*i= (pdf_doc_internal_t*)gfx->internal; - delete i->doc; i->doc=0; + if (i->userPW) { + delete i->userPW;i->userPW = 0; + } + if (i->fileName) { + /* will be freed by PDFDoc::~PDFDoc */ + i->fileName = 0; + } + + if(i->doc) { + delete i->doc; i->doc=0; + } free(i->pages); i->pages = 0; + + if(i->pagemap) { + free(i->pagemap); + } i->docinfo.free(); @@ -235,6 +221,10 @@ if(i->info) { delete i->info;i->info=0; } + if(i->parameters) { + gfxparams_free(i->parameters); + i->parameters=0; + } free(gfx->internal);gfx->internal=0; free(gfx);gfx=0; @@ -275,7 +265,7 @@ i->pagemap_pos = pdfpage; } -void pdf_doc_set_parameter(gfxdocument_t*gfx, const char*name, const char*value) +void pdf_doc_setparameter(gfxdocument_t*gfx, const char*name, const char*value) { pdf_doc_internal_t*i= (pdf_doc_internal_t*)gfx->internal; if(!strcmp(name, "pagemap")) { @@ -287,15 +277,25 @@ } else if(!strcmp(name, "bitmapfonts") || !strcmp(name, "bitmap")) { i->config_full_bitmap_optimizing = atoi(value); } else if(!strcmp(name, "asprint")) { - i->config_print = 1; + i->config_print = atoi(value); + } else if(!strcmp(name, "onlytext")) { + i->config_only_text = atoi(value); } else { - storeDeviceParameter(&i->parameters, name, value); + gfxparams_store(i->parameters, name, value); } } gfxpage_t* pdf_doc_getpage(gfxdocument_t*doc, int page) { pdf_doc_internal_t*di= (pdf_doc_internal_t*)doc->internal; + if(threadsafe) { + /* for multi-thread operation, we need to create a new PDFDoc instance + for each thread */ + di->doc = 0; + } + if(!di->doc) { + di->doc = new PDFDoc(di->fileName, di->userPW); + } if(page < 1 || page > doc->num_pages) return 0; @@ -321,6 +321,7 @@ Object obj; GString *s1, *s2; int i; + unsigned int u; if (infoDict && infoDict->lookup((char*)key, &obj)->isString()) { s1 = obj.getString(); @@ -328,13 +329,8 @@ (s1->getChar(1) & 0xff) == 0xff) { s2 = new GString(); for (i = 2; i < obj.getString()->getLength(); i += 2) { - if (s1->getChar(i) == '\0') { - s2->append(s1->getChar(i+1)); - } else { - delete s2; - s2 = new GString(""); - break; - } + u = ((s1->getChar(i) & 0xff) << 8) | (s1->getChar(i+1) & 0xff); + s2->append(getUTF8(u)); } char*ret = strdup(s2->getCString()); delete s2; @@ -386,45 +382,81 @@ else if(!strcmp(name, "oktoaddnotes")) return strdup(i->doc->okToAddNotes() ? "yes" : "no"); else if(!strcmp(name, "version")) { char buf[32]; +#ifdef HAVE_POPPLER + sprintf(buf, "%d.%d", i->doc->getPDFMajorVersion(), i->doc->getPDFMinorVersion()); +#else sprintf(buf, "%.1f", i->doc->getPDFVersion()); +#endif return strdup(buf); } - return 0; + return strdup(""); } -static void pdf_set_parameter(gfxsource_t*src, const char*name, const char*value) +/* shortcut to InfoOutputDev.cc */ +extern int config_unique_unicode; +extern int config_poly2bitmap_pass1; +extern int config_skewedtobitmap_pass1; +extern int config_addspace; +extern int config_fontquality; +extern int config_bigchar; +extern int config_marker_glyph; +extern int config_normalize_fonts; +extern int config_remove_font_transforms; +extern int config_remove_invisible_outlines; +extern int config_break_on_warning; + +static void pdf_setparameter(gfxsource_t*src, const char*name, const char*value) { gfxsource_internal_t*i = (gfxsource_internal_t*)src->internal; - parameterlist_t*p = &i->parameters; + + gfxparams_store(i->parameters, name, value); + msg(" setting parameter %s to \"%s\"", name, value); if(!strncmp(name, "fontdir", strlen("fontdir"))) { addGlobalFontDir(value); + } else if(!strcmp(name, "addspacechars")) { + config_addspace = atoi(value); + gfxparams_store(i->parameters, "detectspaces", "0"); + } else if(!strcmp(name, "detectspaces")) { + config_addspace = atoi(value); + } else if(!strcmp(name, "unique_unicode")) { + config_unique_unicode = atoi(value); + } else if(!strcmp(name, "poly2bitmap")) { + config_poly2bitmap_pass1 = atoi(value); + } else if(!strcmp(name, "marker_glyph")) { + config_marker_glyph = atoi(value); + } else if(!strcmp(name, "normalize_fonts")) { + config_normalize_fonts = atoi(value); + } else if(!strcmp(name, "skewedtobitmap")) { + config_skewedtobitmap_pass1 = atoi(value); + } else if(!strcmp(name, "remove_font_transforms")) { + config_remove_font_transforms = atoi(value); + } else if(!strcmp(name, "breakonwarning")) { + config_break_on_warning = atoi(value); + } else if(!strcmp(name, "remove_invisible_outlines")) { + config_remove_invisible_outlines = atoi(value); + } else if(!strcmp(name, "fontquality")) { + config_fontquality = atoi(value); + } else if(!strcmp(name, "bigchar")) { + config_bigchar = atoi(value); } else if(!strcmp(name, "pages")) { global_page_range = strdup(value); } else if(!strncmp(name, "font", strlen("font")) && name[4]!='q') { addGlobalFont(value); } else if(!strncmp(name, "languagedir", strlen("languagedir"))) { addGlobalLanguageDir(value); + } else if(!strcmp(name, "threadsafe")) { + threadsafe = atoi(value); + } else if(!strcmp(name, "zoomtowidth")) { + zoomtowidth = atoi(value); } else if(!strcmp(name, "zoom")) { char buf[80]; zoom = atof(value); - sprintf(buf, "%f", (double)jpeg_dpi/(double)zoom); - storeDeviceParameter(p, "jpegsubpixels", buf); - sprintf(buf, "%f", (double)ppm_dpi/(double)zoom); - storeDeviceParameter(p, "ppmsubpixels", buf); - } else if(!strcmp(name, "jpegdpi")) { - char buf[80]; - jpeg_dpi = atoi(value); - sprintf(buf, "%f", (double)jpeg_dpi/(double)zoom); - storeDeviceParameter(p, "jpegsubpixels", buf); - } else if(!strcmp(name, "ppmdpi")) { - char buf[80]; - ppm_dpi = atoi(value); - sprintf(buf, "%f", (double)ppm_dpi/(double)zoom); - storeDeviceParameter(p, "ppmsubpixels", buf); + } else if(!strcmp(name, "jpegdpi") || !strcmp(name, "ppmdpi")) { + msg(" %s not supported anymore. Please use jpegsubpixels/ppmsubpixels"); } else if(!strcmp(name, "multiply")) { - multiply = atoi(value); + multiply = atof(value); } else if(!strcmp(name, "help")) { printf("\nPDF device global parameters:\n"); printf("fontdir= a directory with additional fonts\n"); @@ -452,32 +484,28 @@ pdf_doc_internal_t*i= (pdf_doc_internal_t*)malloc(sizeof(pdf_doc_internal_t)); memset(i, 0, sizeof(pdf_doc_internal_t)); i->parent = src; + i->parameters = gfxparams_new(); pdf_doc->internal = i; char*userPassword=0; i->filename = strdup(filename); char*x = 0; - if((x = strchr(filename, '|'))) { + if((x = strchr((char*)filename, '|'))) { *x = 0; userPassword = x+1; } - GString *fileName = new GString(filename); - GString *userPW; + i->fileName = new GString(filename); // open PDF file if (userPassword && userPassword[0]) { - userPW = new GString(userPassword); + i->userPW = new GString(userPassword); } else { - userPW = NULL; - } - i->doc = new PDFDoc(fileName, userPW); - if (userPW) { - delete userPW; + i->userPW = NULL; } + i->doc = new PDFDoc(i->fileName, i->userPW); if (!i->doc->isOk()) { - printf("xpdf reports document as broken.\n"); return 0; } @@ -496,6 +524,14 @@ if(!i->doc->okToChange() || !i->doc->okToAddNotes()) i->protect = 1; } + + if(zoomtowidth && i->doc->getNumPages()) { + Page*page = i->doc->getCatalog()->getPage(1); + PDFRectangle *r = page->getCropBox(); + double width_before = r->x2 - r->x1; + zoom = 72.0 * zoomtowidth / width_before; + msg(" Rendering at %f DPI. (Page width at 72 DPI: %f, target width: %d)", zoom, width_before, zoomtowidth); + } i->info = new InfoOutputDev(i->doc->getXRef()); int t; @@ -520,13 +556,18 @@ pdf_doc->get = 0; pdf_doc->destroy = pdf_doc_destroy; - pdf_doc->set_parameter = pdf_doc_set_parameter; + pdf_doc->setparameter = pdf_doc_setparameter; pdf_doc->getinfo = pdf_doc_getinfo; pdf_doc->getpage = pdf_doc_getpage; pdf_doc->prepare = pdf_doc_prepare; - - return pdf_doc; + /* pass global parameters to PDF driver*/ + gfxparam_t*p = isrc->parameters->params; + while(p) { + pdf_doc->setparameter(pdf_doc, p->key, p->value); + p = p->next; + } + return pdf_doc; } void pdf_destroy(gfxsource_t*src) @@ -534,16 +575,9 @@ if(!src->internal) return; gfxsource_internal_t*i = (gfxsource_internal_t*)src->internal; - - parameter_t*p = i->parameters.device_config; - while(p) { - parameter_t*next = p->next; - if(p->name) free((void*)p->name);p->name = 0; - if(p->value) free((void*)p->value);p->value =0; - p->next = 0;delete p; - p = next; - } - i->parameters.device_config=i->parameters.device_config_next=0; + + gfxparams_free(i->parameters); + i->parameters=0; free(src->internal);src->internal=0; @@ -555,11 +589,12 @@ { gfxsource_t*src = (gfxsource_t*)malloc(sizeof(gfxsource_t)); memset(src, 0, sizeof(gfxsource_t)); - src->set_parameter = pdf_set_parameter; + src->setparameter = pdf_setparameter; src->open = pdf_open; src->destroy = pdf_destroy; - src->internal = malloc(sizeof(gfxsource_internal_t)); - memset(src->internal, 0, sizeof(gfxsource_internal_t)); + gfxsource_internal_t*i = (gfxsource_internal_t*)rfx_calloc(sizeof(gfxsource_internal_t)); + src->internal = (void*)i; + i->parameters = gfxparams_new(); if(!globalParams) { globalParams = new GFXGlobalParams(); diff -Nru swftools-0.9.0/lib/pdf/popplercompat.cc swftools-0.9.2/lib/pdf/popplercompat.cc --- swftools-0.9.0/lib/pdf/popplercompat.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/popplercompat.cc 2010-11-12 18:57:44.000000000 +0000 @@ -0,0 +1,52 @@ +#include +#include +#include +#include "popplercompat.h" + +#ifdef HAVE_POPPLER +static char* getTempDir() +{ +#ifdef WIN32 + char*dir = getenv("TMP"); + if(!dir) dir = getenv("TEMP"); + if(!dir) dir = getenv("tmp"); + if(!dir) dir = getenv("temp"); + if(!dir) dir = "C:\\"; +#else + char* dir = "/tmp/"; +#endif + return dir; +} + +char* mktmpname(char*ptr) { + static char tmpbuf[128]; + char*dir = getTempDir(); + int l = strlen(dir); + char*sep = ""; + if(!ptr) + ptr = tmpbuf; + if(l && dir[l-1]!='/' && dir[l-1]!='\\') { +#ifdef WIN32 + sep = "\\"; +#else + sep = "/"; +#endif + } + + // used to be mktemp. This does remove the warnings, but + // It's not exactly an improvement. +#ifdef HAVE_LRAND48 + sprintf(ptr, "%s%s%08x%08x",dir,sep,(unsigned int)lrand48(),(unsigned int)lrand48()); +#else +# ifdef HAVE_RAND + sprintf(ptr, "%s%s%08x%08x",dir,sep,rand(),rand()); +# else + static int count = 1; + sprintf(ptr, "%s%s%08x%04x%04x",dir,sep,time(0),(unsigned int)tmpbuf^((unsigned int)tmpbuf)>>16,count); + count ++; +# endif +#endif + return ptr; +} + +#endif diff -Nru swftools-0.9.0/lib/pdf/popplercompat.h swftools-0.9.2/lib/pdf/popplercompat.h --- swftools-0.9.0/lib/pdf/popplercompat.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/popplercompat.h 2010-11-12 18:58:11.000000000 +0000 @@ -0,0 +1,69 @@ +#ifndef __popplercompat_h__ +#define __popplercompat_h__ + +#include "../../config.h" + +#ifdef HAVE_POPPLER + #define POPPLER_INTERPOLATE GBool interpolate, + #define POPPLER_INTERPOLATE_ARG interpolate, + #define POPPLER_MASK_INTERPOLATE , GBool maskInterpolate + #define POPPLER_MASK_INTERPOLATE_ARG , maskInterpolate +#else + #define POPPLER_INTERPOLATE + #define POPPLER_INTERPOLATE_ARG + #define POPPLER_MASK_INTERPOLATE + #define POPPLER_MASK_INTERPOLATE_ARG +#endif + +#ifdef HAVE_POPPLER + #define POPPLER_TILING_PATERN_RETURN GBool + #define POPPLER_TILING_PATERN_GFX + #define POPPLER_TILING_PATERN_GFX_ARG +#else + #define POPPLER_TILING_PATERN_RETURN void + #if (xpdfMajorVersion*10000 + xpdfMinorVersion*100 + xpdfUpdateVersion) < 30207 + #define POPPLER_TILING_PATERN_GFX + #define POPPLER_TILING_PATERN_GFX_ARG + #else + #define POPPLER_TILING_PATERN_GFX Gfx *gfx, + #define POPPLER_TILING_PATERN_GFX_ARG gfx, + #endif +#endif + +#ifdef HAVE_POPPLER +char* mktmpname(char*ptr); +#endif + +#ifdef HAVE_POPPLER + #define POPPLER_RAXIAL_MIN_MAX , double min, double max + #define POPPLER_RAXIAL_MIN_MAX_ARG , min, max +#else + #define POPPLER_RAXIAL_MIN_MAX + #define POPPLER_RAXIAL_MIN_MAX_ARG +#endif + +#ifdef HAVE_POPPLER + #include + #include +#else + #include "xpdf/config.h" + #include "gfile.h" + #include "GString.h" +#endif +#include "Object.h" +#include "Stream.h" +#include "Array.h" +#include "Dict.h" +#include "XRef.h" +#include "Catalog.h" +#include "Page.h" +#include "PDFDoc.h" +#include "Error.h" +#include "Link.h" +#include "OutputDev.h" +#include "GfxFont.h" +#include "GfxState.h" +//#include "NameToUnicodeTable.h" +#include "GlobalParams.h" + +#endif diff -Nru swftools-0.9.0/lib/pdf/VectorGraphicOutputDev.cc swftools-0.9.2/lib/pdf/VectorGraphicOutputDev.cc --- swftools-0.9.0/lib/pdf/VectorGraphicOutputDev.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/VectorGraphicOutputDev.cc 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,1739 @@ +/* VectorGraphicOutputDev.cc + implements a pdf output device (OutputDev). + + This file is part of swftools. + + Swftools 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. + + Swftools 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. + + You should have received a copy of the GNU General Public License + along with swftools; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include + +#include "../../config.h" + +//xpdf header files +#include "popplercompat.h" +#include "VectorGraphicOutputDev.h" + +// swftools header files +#include "../os.h" +#include "../log.h" +#include "../mem.h" +#include "../utf8.h" +#include "../gfxdevice.h" +#include "../gfxtools.h" +#include "../gfxfont.h" +#include "../gfxpoly.h" +#include "../devices/record.h" +#include "../devices/ops.h" +#include "../devices/polyops.h" +#include "../devices/render.h" + +#include "../png.h" + +/* config */ +static int verbose = 0; +static int dbgindent = 1; +static void dbg(const char*format, ...) +{ + char buf[1024]; + int l; + va_list arglist; + if(!verbose) + return; + va_start(arglist, format); + vsnprintf(buf, sizeof(buf)-1, format, arglist); + va_end(arglist); + l = strlen(buf); + while(l && buf[l-1]=='\n') { + buf[l-1] = 0; + l--; + } + printf("(pdf) "); + int indent = dbgindent; + while(indent) { + printf(" "); + indent--; + } + printf("%s\n", buf); + fflush(stdout); +} + +GFXOutputState::GFXOutputState() { + this->clipping = 0; + this->createsoftmask = 0; + this->transparencygroup = 0; + this->softmask = 0; + this->grouprecording = 0; + this->isolated = 0; +} + +VectorGraphicOutputDev::VectorGraphicOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2) +:CommonOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2) +{ + this->type3active = 0; + this->statepos = 0; + this->xref = 0; + this->current_gfxfont = 0; + this->current_fontinfo = 0; + this->current_text_stroke = 0; + this->current_text_clip = 0; + this->outer_clip_box = 0; + this->config_convertgradients=1; + this->config_transparent=0; + this->config_disable_polygon_conversion = 0; + this->config_multiply = 1; + this->config_textonly = 0; + + /* for processing drawChar events */ + this->charDev = new CharOutputDev(info, doc, page2page, num_pages, x, y, x1, y1, x2, y2); + memset(&this->char_output_dev, 0, sizeof(gfxdevice_t)); + this->char_output_dev.internal = this; + this->char_output_dev.drawchar = drawchar_callback; + this->char_output_dev.addfont = addfont_callback; + + memset(states, 0, sizeof(states)); +}; + +void VectorGraphicOutputDev::setParameter(const char*key, const char*value) +{ + if(!strcmp(key,"transparent")) { + this->config_transparent = atoi(value); + } else if(!strcmp(key,"convertgradients")) { + this->config_convertgradients = atoi(value); + } else if(!strcmp(key,"textonly")) { + this->config_textonly = atoi(value); + } else if(!strcmp(key,"multiply")) { + this->config_multiply = atoi(value); + if(this->config_multiply<1) + this->config_multiply=1; + } else if(!strcmp(key,"disable_polygon_conversion")) { + this->config_disable_polygon_conversion = atoi(value); + } else if(!strcmp(key,"disable_tiling_pattern_fills")) { + this->config_disable_tiling_pattern_fills = atoi(value); + } + this->charDev->setParameter(key, value); +} + +void VectorGraphicOutputDev::setDevice(gfxdevice_t*dev) +{ + this->device = dev; + charDev->setDevice(dev); +} + +//void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) {printf("void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool inlineImg) \n");} +//void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) {printf("void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) \n");} + +void dump_outline(gfxline_t*line) +{ + /*gfxbbox_t*r = gfxline_isrectangle(line); + if(!r) + printf("is not a rectangle\n"); + else + printf("is a rectangle: (%f,%f)-(%f-%f)\n", r->xmin, r->ymin, r->xmax, r->ymax); + */ + + while(line) { + if(line->type == gfx_moveTo) { + msg(" | moveTo %.2f %.2f", line->x,line->y); + } else if(line->type == gfx_lineTo) { + msg(" | lineTo %.2f %.2f", line->x,line->y); + } else if(line->type == gfx_splineTo) { + msg(" | splineTo (%.2f %.2f) %.2f %.2f", line->sx,line->sy, line->x, line->y); + } + line = line->next; + } +} + +void gfxPath_dump(GfxPath*path) +{ + int num = path->getNumSubpaths(); + int t; + int cpos=0; + for(t = 0; t < num; t++) { + GfxSubpath *subpath = path->getSubpath(t); + int subnum = subpath->getNumPoints(); + int s; + for(s=0;sgetX(s); + double y=subpath->getY(s); + if(s==0 && !subpath->getCurve(s)) { + printf("M %f %f\n", x, y); + } else if(s==0 && subpath->getCurve(s)) { + printf("E %f %f\n", x, y); + } else if(subpath->getCurve(s)) { + printf("C %f %f\n", x, y); + } else { + printf("T %f %f\n", x, y); + } + } + } +} + +gfxline_t* VectorGraphicOutputDev::gfxPath_to_gfxline(GfxState*state, GfxPath*path, int closed) +{ + int num = path->getNumSubpaths(); + int s,t; + int cpos = 0; + double lastx=0,lasty=0,posx=0,posy=0; + int needsfix=0; + if(!num) { + msg(" empty path"); + return 0; + } + gfxdrawer_t draw; + gfxdrawer_target_gfxline(&draw); + + for(t = 0; t < num; t++) { + GfxSubpath *subpath = path->getSubpath(t); + int subnum = subpath->getNumPoints(); + double bx=0,by=0,cx=0,cy=0; + + for(s=0;stransformXY(state, subpath->getX(s),subpath->getY(s),&x,&y); + + if(s==0) { + if(closed && needsfix && (fabs(posx-lastx)+fabs(posy-lasty))>0.001) { + draw.lineTo(&draw, lastx, lasty); + } + draw.moveTo(&draw, x,y); + posx = lastx = x; + posy = lasty = y; + cpos = 0; + needsfix = 0; + } else if(subpath->getCurve(s) && cpos==0) { + bx = x; + by = y; + cpos = 1; + } else if(subpath->getCurve(s) && cpos==1) { + cx = x; + cy = y; + cpos = 2; + } else { + posx = x; + posy = y; + if(cpos==0) { + draw.lineTo(&draw, x,y); + } else { + gfxdraw_cubicTo(&draw, bx,by, cx,cy, x,y, 0.05); + } + needsfix = 1; + cpos = 0; + } + } + } + /* fix non-closed lines */ + if(closed && needsfix && (fabs(posx-lastx)+fabs(posy-lasty))>0.001) { + draw.lineTo(&draw, lastx, lasty); + } + gfxline_t*result = (gfxline_t*)draw.result(&draw); + + gfxline_optimize(result); + + return result; +} + +GBool VectorGraphicOutputDev::useTilingPatternFill() +{ + infofeature("tiled patterns"); +// if(config_convertgradients) +// return gTrue; + if(config_disable_tiling_pattern_fills) + return gTrue; + return gFalse; +} +GBool VectorGraphicOutputDev::useShadedFills() +{ + infofeature("shaded fills"); + if(config_convertgradients) + return gTrue; + return gFalse; +} + +POPPLER_TILING_PATERN_RETURN VectorGraphicOutputDev::tilingPatternFill(GfxState *state, + POPPLER_TILING_PATERN_GFX + Object *str, + int paintType, Dict *resDict, + double *mat, double *bbox, + int x0, int y0, int x1, int y1, + double xStep, double yStep) +{ + msg(" tilingPatternFill"); + infofeature("tiling pattern fills"); +#ifdef HAVE_POPPLER + // since we don't implement this method yet, + // reduce it to a series of other drawing operations. + return gFalse; +#endif +} + +GBool VectorGraphicOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *shading) +{ + msg(" functionShadedFill not supported yet"); + infofeature("function shaded fills"); + return gFalse; +} +static gfxcolor_t col2col(GfxColorSpace*colspace, GfxColor* col) +{ + gfxcolor_t c; + GfxRGB rgb; + colspace->getRGB(col, &rgb); + c.r = colToByte(rgb.r); + c.g = colToByte(rgb.g); + c.b = colToByte(rgb.b); + c.a = 255; + return c; +} + +GBool VectorGraphicOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading) +{ + if(config_textonly) {return gTrue;} + + double x0,y0,r0,x1,y1,x2,y2,x9,y9,r1; + shading->getCoords(&x0,&y0,&r0,&x9,&y9,&r1); + x1=x0+r1;y1=y0; + x2=x0; y2=y0+r1; + this->transformXY(state, x0,y0, &x0,&y0); + this->transformXY(state, x1,y1, &x1,&y1); + this->transformXY(state, x2,y2, &x2,&y2); + + GfxColor color0; + GfxColor color1; + GfxColor color2; + shading->getColor(0.0, &color0); + shading->getColor(0.5, &color1); + shading->getColor(1.0, &color2); + + GfxColorSpace* colspace = shading->getColorSpace(); + + msg(" radialShadedFill %f %f %f %f %f %f %02x%02x%02x->%02x%02x%02x", x0, y0, x1, y1, x2, y2, + colToByte(color0.c[0]), colToByte(color0.c[1]), colToByte(color0.c[2]), + colToByte(color1.c[0]), colToByte(color1.c[1]), colToByte(color1.c[2]), + colToByte(color2.c[0]), colToByte(color2.c[1]), colToByte(color2.c[2])); + infofeature("radial shaded fills"); + + gfxgradient_t gr[3]; + gfxgradient_t*g = &gr[0]; + g[0].next = &g[1]; + g[1].next = &g[2]; + g[2].next = 0; + g[0].color = col2col(colspace, &color0); + g[1].color = col2col(colspace, &color1); + g[2].color = col2col(colspace, &color2); + g[0].pos = 0.0; + g[1].pos = 0.5; + g[2].pos = 1.0; + + gfxbbox_t b = states[statepos].clipbbox; + gfxline_t p1,p2,p3,p4,p5; + p1.type=gfx_moveTo;p1.x=b.xmin; p1.y=b.ymin; p1.next=&p2; + p2.type=gfx_lineTo;p2.x=b.xmin; p2.y=b.ymax; p2.next=&p3; + p3.type=gfx_lineTo;p3.x=b.xmax; p3.y=b.ymax; p3.next=&p4; + p4.type=gfx_lineTo;p4.x=b.xmax; p4.y=b.ymin; p4.next=&p5; + p5.type=gfx_lineTo;p5.x=b.xmin; p5.y=b.ymin; p5.next=0; + + gfxmatrix_t m; + //m.m00 = (x3-x0); m.m10 = (x1-x0); + //m.m01 = (y3-y0); m.m11 = (y1-y0); + //x3/y3 specifies another (the ending) circle, not the second radius of an ellipse + m.m00 = (x1-x0); m.m10 = (x2-x0); + m.m01 = (y1-y0); m.m11 = (y2-y0); + m.tx = x0 - 0.5; + m.ty = y0 - 0.5; + + device->fillgradient(device, &p1, g, gfxgradient_radial, &m); + return gTrue; +} + +GBool VectorGraphicOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading) +{ + if(config_textonly) {return gTrue;} + + double x0,y0,x1,y1; + shading->getCoords(&x0,&y0,&x1,&y1); + this->transformXY(state, x0,y0,&x0,&y0); + this->transformXY(state, x1,y1,&x1,&y1); + + GfxColor color0; + GfxColor color1; + GfxColor color2; + shading->getColor(0.0, &color0); + shading->getColor(0.5, &color1); + shading->getColor(1.0, &color2); + + GfxColorSpace* colspace = shading->getColorSpace(); + + msg(" axialShadedFill %f %f %f %f %02x%02x%02x->%02x%02x%02x->%02x%02x%02x", x0, y0, x1, y1, + colToByte(color0.c[0]), colToByte(color0.c[1]), colToByte(color0.c[2]), + colToByte(color1.c[0]), colToByte(color1.c[1]), colToByte(color1.c[2]), + colToByte(color2.c[0]), colToByte(color2.c[1]), colToByte(color2.c[2]) + ); + infofeature("axial shaded fills"); + + gfxgradient_t*g = (gfxgradient_t*)malloc(sizeof(gfxgradient_t)*3); + g[0].next = &g[1]; + g[1].next = &g[2]; + g[2].next = 0; + g[0].color = col2col(colspace, &color0); + g[1].color = col2col(colspace, &color1); + g[2].color = col2col(colspace, &color2); + g[0].pos = 0.0; + g[1].pos = 0.5; + g[2].pos = 1.0; + + double xMin,yMin,xMax,yMax; + state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax); + this->transformXY(state, xMin, yMin, &xMin, &yMin); + msg(" userClipBox %f %f %f %f", xMin, yMin, xMax, yMax); + + xMin = 0; yMin = 0; + xMin = 1024; yMin = 1024; + + gfxbbox_t b = states[statepos].clipbbox; + gfxline_t p1,p2,p3,p4,p5; + p1.type=gfx_moveTo;p1.x=b.xmin; p1.y=b.ymin; p1.next=&p2; + p2.type=gfx_lineTo;p2.x=b.xmin; p2.y=b.ymax; p2.next=&p3; + p3.type=gfx_lineTo;p3.x=b.xmax; p3.y=b.ymax; p3.next=&p4; + p4.type=gfx_lineTo;p4.x=b.xmax; p4.y=b.ymin; p4.next=&p5; + p5.type=gfx_lineTo;p5.x=b.xmin; p5.y=b.ymin; p5.next=0; + + /* the gradient starts at (-1.0,0.0), so move (0,0) to + the middle of the two control points */ + gfxmatrix_t m; + m.m00 = (x1-x0)/2; m.m10 = -(y1-y0)/2; + m.m01 = (y1-y0)/2; m.m11 = (x1-x0)/2; + m.tx = (x0 + x1)/2 - 0.5; + m.ty = (y0 + y1)/2 - 0.5; + + device->fillgradient(device, &p1, g, gfxgradient_linear, &m); + + free(g); + return gTrue; +} + +GBool VectorGraphicOutputDev::useDrawForm() +{ + infofeature("forms"); + return gFalse; +} +void VectorGraphicOutputDev::drawForm(Ref id) +{ + msg(" drawForm not implemented"); +} +GBool VectorGraphicOutputDev::needNonText() +{ + return gTrue; +} +void VectorGraphicOutputDev::endPage() +{ + msg(" endPage (VectorGraphicOutputDev)"); + charDev->endPage(); // link postprocessing + if(outer_clip_box) { + device->endclip(device); + outer_clip_box = 0; + } +} +void VectorGraphicOutputDev::setDefaultCTM(double *ctm) +{ + charDev->setDefaultCTM(ctm); + OutputDev::setDefaultCTM(ctm); +} + +static inline double sqr(double x) {return x*x;} + +#define STROKE_FILL 1 +#define STROKE_CLIP 2 +void VectorGraphicOutputDev::strokeGfxline(GfxState *state, gfxline_t*line, int flags) +{ + int lineCap = state->getLineCap(); // 0=butt, 1=round 2=square + int lineJoin = state->getLineJoin(); // 0=miter, 1=round 2=bevel + double miterLimit = state->getMiterLimit(); + double width = state->getTransformedLineWidth(); + + GfxRGB rgb; + double opaq = state->getStrokeOpacity(); + if(type3active) + state->getFillRGB(&rgb); + else + state->getStrokeRGB(&rgb); + gfxcolor_t col; + col.r = colToByte(rgb.r); + col.g = colToByte(rgb.g); + col.b = colToByte(rgb.b); + col.a = (unsigned char)(opaq*255); + + gfx_capType capType = gfx_capRound; + if(lineCap == 0) capType = gfx_capButt; + else if(lineCap == 1) capType = gfx_capRound; + else if(lineCap == 2) capType = gfx_capSquare; + else msg(" Invalid line cap type"); + + gfx_joinType joinType = gfx_joinRound; + if(lineJoin == 0) joinType = gfx_joinMiter; + else if(lineJoin == 1) joinType = gfx_joinRound; + else if(lineJoin == 2) joinType = gfx_joinBevel; + else msg(" Invalid line join type"); + + gfxline_t*line2 = 0; + + int dashLength = states[statepos].dashLength; + double*dashPattern = states[statepos].dashPattern; + double dashStart = states[statepos].dashStart; + if(dashLength && dashPattern) { + float * dash = (float*)malloc(sizeof(float)*(dashLength+1)); + int t; + + /* try to find out how much the transformation matrix would + stretch the dashes, and factor that into the dash lengths. + This is not the entirely correct approach- it would be + better to first convert the path to an unscaled version, + then apply dashing, and then transform the path using + the current transformation matrix. However there are few + PDFs which actually stretch a dashed path in a non-orthonormal + way */ + double tx1, ty1, tx2, ty2, tx3, ty3; + this->transformXY(state, 0, 0, &tx1, &ty1); + this->transformXY(state, 0, 1, &tx2, &ty2); + this->transformXY(state, 1, 0, &tx3, &ty3); + double d1 = sqrt(sqr(tx2-tx1)+sqr(ty2-ty1)); + double d2 = sqrt(sqr(tx3-tx1)+sqr(ty3-ty1)); + if(fabs(d1-d2)>0.5) + warnfeature("non-ortogonally dashed strokes", 0); + double f = (d1+d2)/2; + + if(!dashStart && dashLength==1 && !dashPattern[0]) { + // zero phase and zero dashlength make the line invisible + return; + } + + msg(" %d dashes", dashLength); + msg(" | phase: %f", dashStart); + for(t=0;t | d%-3d: %f", t, dashPattern[t]); + } + dash[dashLength] = -1; + if(getLogLevel() >= LOGLEVEL_TRACE) { + dump_outline(line); + } + + line2 = gfxtool_dash_line(line, dash, (float)(dashStart*f)); + line = line2; + + free(dash); + msg(" After dashing:"); + } + + if(getLogLevel() >= LOGLEVEL_TRACE) { + msg(" stroke width=%f join=%s cap=%s dashes=%d color=%02x%02x%02x%02x", + width, + lineJoin==0?"miter": (lineJoin==1?"round":"bevel"), + lineCap==0?"butt": (lineCap==1?"round":"square"), + dashLength, + col.r,col.g,col.b,col.a + ); + dump_outline(line); + } + + if(flags&STROKE_FILL) { + gfxpoly_t* poly = gfxpoly_from_stroke(line, width, capType, joinType, miterLimit, DEFAULT_GRID); + gfxline_t*gfxline = gfxline_from_gfxpoly(poly); + if(getLogLevel() >= LOGLEVEL_TRACE) { + dump_outline(gfxline); + } + if(!gfxline) { + msg(" Empty polygon (resulting from stroked line)"); + } + if(flags&STROKE_CLIP) { + device->startclip(device, gfxline); + states[statepos].clipping++; + } else { + device->fill(device, gfxline, &col); + } + gfxline_free(gfxline); + gfxpoly_destroy(poly); + } else { + if(flags&STROKE_CLIP) + msg(" Stroke&clip not supported at the same time"); + device->stroke(device, line, width, &col, capType, joinType, miterLimit); + } + + if(line2) + gfxline_free(line2); +} + +void VectorGraphicOutputDev::fillGfxLine(GfxState *state, gfxline_t*line, char evenodd) +{ + gfxcolor_t col = gfxstate_getfillcolor(state); + + if(getLogLevel() >= LOGLEVEL_TRACE) { + msg(" %sfill %02x%02x%02x%02x", evenodd?"eo":"", col.r, col.g, col.b, col.a); + dump_outline(line); + } + device->fill(device, line, &col); +} + +void VectorGraphicOutputDev::clipToGfxLine(GfxState *state, gfxline_t*line, char evenodd) +{ + if(getLogLevel() >= LOGLEVEL_TRACE) { + msg(" %sclip", evenodd?"eo":""); + dump_outline(line); + } + gfxbbox_t bbox = gfxline_getbbox(line); + gfxbbox_intersect(&states[statepos].clipbbox, &bbox); + + device->startclip(device, line); + states[statepos].clipping++; +} + +void VectorGraphicOutputDev::clip(GfxState *state) +{ + GfxPath * path = state->getPath(); + msg(" clip"); + gfxline_t*line = gfxPath_to_gfxline(state, path, 1); + if(!config_disable_polygon_conversion) { + gfxline_t*line2 = gfxpoly_circular_to_evenodd(line, DEFAULT_GRID); + gfxline_free(line); + line = line2; + } + clipToGfxLine(state, line, 0); + gfxline_free(line); +} + +void VectorGraphicOutputDev::eoClip(GfxState *state) +{ + GfxPath * path = state->getPath(); + gfxline_t*line = gfxPath_to_gfxline(state, path, 1); + clipToGfxLine(state, line, 1); + gfxline_free(line); +} +void VectorGraphicOutputDev::clipToStrokePath(GfxState *state) +{ + GfxPath * path = state->getPath(); + gfxline_t*line= gfxPath_to_gfxline(state, path, 0); + + if(getLogLevel() >= LOGLEVEL_TRACE) { + double width = state->getTransformedLineWidth(); + msg(" cliptostrokepath width=%f", width); + dump_outline(line); + } + + strokeGfxline(state, line, STROKE_FILL|STROKE_CLIP); + gfxline_free(line); +} + +void VectorGraphicOutputDev::finish() +{ + if(outer_clip_box) { + if(device) { + device->endclip(device); + } + outer_clip_box = 0; + } +} + +VectorGraphicOutputDev::~VectorGraphicOutputDev() +{ + finish(); + delete charDev;charDev=0; +}; +GBool VectorGraphicOutputDev::upsideDown() +{ + return gTrue; +}; +GBool VectorGraphicOutputDev::useDrawChar() +{ + return gTrue; +} + +void VectorGraphicOutputDev::updateFontMatrix(GfxState*state) +{ + this->current_font_matrix = gfxmatrix_from_state(state); + charDev->updateTextMat(state); +} + +void VectorGraphicOutputDev::updateFont(GfxState*state) +{ + charDev->updateFont(state); +} + +void VectorGraphicOutputDev::processLink(Link *link, Catalog *catalog) +{ + charDev->processLink(link, catalog); +} + +void VectorGraphicOutputDev::beginString(GfxState *state, GString *s) +{ + int render = state->getRender(); + if(current_text_stroke) { + msg(" Error: Incompatible change of text rendering to %d while inside cliptext", render); + } + charDev->beginString(state, s); +} + +static gfxline_t* mkEmptyGfxShape(double x, double y) +{ + gfxline_t*line = (gfxline_t*)malloc(sizeof(gfxline_t)); + line->x = x;line->y = y;line->type = gfx_moveTo;line->next = 0; + return line; +} + +void addfont_callback(gfxdevice_t*dev, gfxfont_t*font) +{ + VectorGraphicOutputDev*self = (VectorGraphicOutputDev*)dev->internal; + self->device->addfont(self->device, font); +} +void drawchar_callback(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix) +{ + VectorGraphicOutputDev*self = (VectorGraphicOutputDev*)dev->internal; + self->gfxfont_from_callback = font; + self->glyphnr_from_callback = glyph; + memcpy(&self->textcolor_from_callback, color, sizeof(gfxcolor_t)); + memcpy(&self->textmatrix_from_callback, matrix, sizeof(gfxmatrix_t)); +} + +void VectorGraphicOutputDev::drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode charid, int nBytes, Unicode *_u, int uLen) +{ + int render = state->getRender(); + if(((render == RENDER_FILL) || + (render == RENDER_FILLSTROKE && state->getTransformedLineWidth()<1.0) || + (render == RENDER_INVISIBLE))) { + charDev->drawChar(state, x, y, dx, dy, originX, originY, charid, nBytes, _u, uLen); + return; + } + + msg(" Drawing glyph %d as shape", charid); + infofeature("text rendered as shape"); + + charDev->setDevice(&char_output_dev); + this->gfxfont_from_callback = 0; + this->glyphnr_from_callback = 0; + charDev->drawChar(state, x, y, dx, dy, originX, originY, charid, nBytes, _u, uLen); + charDev->setDevice(device); + + if(!gfxfont_from_callback) { + // some chars are ignored by CharOutputDev + return; + } + gfxline_t*glyph = gfxfont_from_callback->glyphs[glyphnr_from_callback].line; + + gfxline_t*tglyph = gfxline_clone(glyph); + gfxline_transform(tglyph, &textmatrix_from_callback); + if((render&3) != RENDER_INVISIBLE) { + gfxline_t*add = gfxline_clone(tglyph); + current_text_stroke = gfxline_append(current_text_stroke, add); + } + if(render&RENDER_CLIP) { + gfxline_t*add = gfxline_clone(tglyph); + current_text_clip = gfxline_append(current_text_clip, add); + if(!current_text_clip) { + current_text_clip = mkEmptyGfxShape(textmatrix_from_callback.tx, textmatrix_from_callback.ty); + } + } + gfxline_free(tglyph); +} + +void VectorGraphicOutputDev::endString(GfxState *state) +{ + int render = state->getRender(); + msg(" endString() render=%d textstroke=%p", render, current_text_stroke); + + if(current_text_stroke) { + /* fillstroke and stroke text rendering objects we can process right + now (as there may be texts of other rendering modes in this + text object)- clipping objects have to wait until endTextObject, + however */ + device->setparameter(device, "mark","TXT"); + if((render&3) == RENDER_FILL) { + fillGfxLine(state, current_text_stroke, 0); + gfxline_free(current_text_stroke); + current_text_stroke = 0; + } else if((render&3) == RENDER_FILLSTROKE) { + fillGfxLine(state, current_text_stroke, 0); + strokeGfxline(state, current_text_stroke,0); + gfxline_free(current_text_stroke); + current_text_stroke = 0; + } else if((render&3) == RENDER_STROKE) { + strokeGfxline(state, current_text_stroke,0); + gfxline_free(current_text_stroke); + current_text_stroke = 0; + } + device->setparameter(device, "mark",""); + } +} + +void VectorGraphicOutputDev::endTextObject(GfxState *state) +{ + int render = state->getRender(); + msg(" endTextObject() render=%d textstroke=%p clipstroke=%p", render, current_text_stroke, current_text_clip); + + if(current_text_clip) { + device->setparameter(device, "mark","TXT"); + clipToGfxLine(state, current_text_clip, 0); + device->setparameter(device, "mark",""); + gfxline_free(current_text_clip); + current_text_clip = 0; + } +} + +/* the logic seems to be as following: + first, beginType3Char is called, with the charcode and the coordinates. + if this function returns true, it already knew about the char and has now drawn it. + if the function returns false, it's a new char, and type3D0 and/or type3D1 might be + called with some parameters. + Afterwards, all draw operations until endType3Char are part of the char (which in this moment is + at the position first passed to beginType3Char). the char ends with endType3Char. + + The drawing operations between beginType3Char and endType3Char are somewhat different to + the normal ones. For example, the fillcolor equals the stroke color. (Because the stroke + color determines the color of a font) +*/ + +GBool VectorGraphicOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode charid, Unicode *u, int uLen) +{ + return charDev->beginType3Char(state, x, y, dx, dy, charid, u, uLen); +} + +void VectorGraphicOutputDev::type3D0(GfxState *state, double wx, double wy) +{ + charDev->type3D0(state, wx, wy); +} +void VectorGraphicOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury) +{ + charDev->type3D1(state, wx, wy, llx, lly, urx, ury); +} + +void VectorGraphicOutputDev::endType3Char(GfxState *state) +{ + charDev->endType3Char(state); +} + +GBool VectorGraphicOutputDev::checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data), + void *abortCheckCbkData) +{ + this->setPage(page); + charDev->setPage(page); + return gTrue; +} + + +void VectorGraphicOutputDev::beginPage(GfxState *state, int pageNum) +{ + this->currentpage = pageNum; + int rot = doc->getPageRotate(1); + gfxcolor_t white = {255,255,255,255}; + gfxcolor_t black = {255,0,0,0}; + laststate = state; + gfxline_t clippath[5]; + + msg(" processing PDF page %d (%dx%d:%d:%d)", pageNum, this->width, this->height, -this->movex, -this->movey); + if(rot!=0) + msg(" page is rotated %d degrees", rot); + + clippath[0].type = gfx_moveTo;clippath[0].x = 0; clippath[0].y = 0; clippath[0].next = &clippath[1]; + clippath[1].type = gfx_lineTo;clippath[1].x = width; clippath[1].y = 0; clippath[1].next = &clippath[2]; + clippath[2].type = gfx_lineTo;clippath[2].x = width; clippath[2].y = height; clippath[2].next = &clippath[3]; + clippath[3].type = gfx_lineTo;clippath[3].x = 0; clippath[3].y = height; clippath[3].next = &clippath[4]; + clippath[4].type = gfx_lineTo;clippath[4].x = 0; clippath[4].y = 0; clippath[4].next = 0; + + device->startclip(device, clippath); outer_clip_box = 1; + if(!config_transparent) { + device->fill(device, clippath, &white); + } + states[statepos].clipbbox.xmin = 0; + states[statepos].clipbbox.ymin = 0; + states[statepos].clipbbox.xmax = this->width; + states[statepos].clipbbox.ymax = this->height; + + states[statepos].dashPattern = 0; + states[statepos].dashLength = 0; + states[statepos].dashStart = 0; + + charDev->startPage(pageNum, state); +} + +void VectorGraphicOutputDev::saveState(GfxState *state) { + dbg("saveState %p", state); dbgindent+=2; + + msg(" saveState %p", state); + updateAll(state); + if(statepos>=64) { + msg(" Too many nested states in pdf."); + exit(1); + } + statepos ++; + states[statepos].state = state; + states[statepos].createsoftmask = states[statepos-1].createsoftmask; + states[statepos].transparencygroup = states[statepos-1].transparencygroup; + states[statepos].clipping = 0; + states[statepos].olddevice = 0; + states[statepos].clipbbox = states[statepos-1].clipbbox; + + states[statepos].dashPattern = states[statepos-1].dashPattern; + states[statepos].dashStart = states[statepos-1].dashStart; + states[statepos].dashLength = states[statepos-1].dashLength; +}; + +void VectorGraphicOutputDev::restoreState(GfxState *state) { + dbgindent-=2; dbg("restoreState %p", state); + + if(statepos==0) { + msg(" Invalid restoreState"); + exit(1); + } + msg(" restoreState %p%s%s", state, + states[statepos].softmask?" (end softmask)":"", + states[statepos].clipping?" (end clipping)":""); + if(states[statepos].softmask) { + clearSoftMask(state); + } + + if(states[statepos].dashPattern) { + if(!statepos || states[statepos-1].dashPattern != states[statepos].dashPattern) { + free(states[statepos].dashPattern); + states[statepos].dashPattern = 0; + } + } + + updateAll(state); + + while(states[statepos].clipping) { + device->endclip(device); + states[statepos].clipping--; + } + if(states[statepos].state!=state) { + msg(" bad state nesting"); + if(verbose) { + int t; + for(t=0;t<=statepos;t++) { + printf("%p ", states[t].state); + } + printf("\n"); + } + exit(1); + } + states[statepos].state=0; + statepos--; +} + +void VectorGraphicOutputDev::updateLineDash(GfxState *state) +{ + if(states[statepos].dashPattern && + (!statepos || states[statepos-1].dashPattern != states[statepos].dashPattern)) { + free(states[statepos].dashPattern); + states[statepos].dashPattern = 0; + } + double *pattern = 0; + int dashLength; + double dashStart; + state->getLineDash(&pattern, &dashLength, &dashStart); + msg(" updateLineDash, %d dashes", dashLength); + if(!dashLength) { + states[statepos].dashPattern = 0; + states[statepos].dashLength = 0; + } else { + double*p = (double*)malloc(dashLength*sizeof(states[statepos].dashPattern[0])); + memcpy(p, pattern, dashLength*sizeof(states[statepos].dashPattern[0])); + states[statepos].dashPattern = p; + states[statepos].dashLength = dashLength; + states[statepos].dashStart = dashStart; + } +} + +#define SQR(x) ((x)*(x)) +unsigned char* antialize(unsigned char*data, int width, int height, int newwidth, int newheight, int palettesize) +{ + if((newwidth<1 || newheight<1) || + (width<=newwidth || height<=newheight)) + return 0; + unsigned char*newdata; + int x,y; + newdata= (unsigned char*)malloc(newwidth*newheight); + double fx = ((double)width)/newwidth; + double fy = ((double)height)/newheight; + double px = 0; + int blocksize = (int)(8192/(fx*fy)); + int r = 8192*256/palettesize; + for(x=0;x=width) + tox = width-1; + if(toy>=height) + toy = height-1; + for(xx=fromx;xx<=tox;xx++) + for(yy=fromy;yy<=toy;yy++) { + int b = 1-data[width*yy+xx]; + int weight=256; + if(xx==fromx) weight = (weight*xweight1)/256; + if(xx==tox) weight = (weight*xweight2)/256; + if(yy==fromy) weight = (weight*yweight1)/256; + if(yy==toy) weight = (weight*yweight2)/256; + a+=b*weight; + } + //if(a) a=(palettesize-1)*r/blocksize; + newdata[y*newwidth+x] = (a*blocksize)/r; + py = ey; + } + px = ex; + } + return newdata; +} + +#define IMAGE_TYPE_JPEG 0 +#define IMAGE_TYPE_LOSSLESS 1 + +static void drawimage(gfxdevice_t*dev, gfxcolor_t* data, int sizex,int sizey, + double x1,double y1, + double x2,double y2, + double x3,double y3, + double x4,double y4, int type, int multiply) +{ + gfxcolor_t*newpic=0; + + double l1 = sqrt((x4-x1)*(x4-x1) + (y4-y1)*(y4-y1)); + double l2 = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)); + + gfxline_t p1,p2,p3,p4,p5; + p1.type=gfx_moveTo;p1.x=x1; p1.y=y1;p1.next=&p2; + p2.type=gfx_lineTo;p2.x=x2; p2.y=y2;p2.next=&p3; + p3.type=gfx_lineTo;p3.x=x3; p3.y=y3;p3.next=&p4; + p4.type=gfx_lineTo;p4.x=x4; p4.y=y4;p4.next=&p5; + p5.type=gfx_lineTo;p5.x=x1; p5.y=y1;p5.next=0; + + {p1.x = (int)(p1.x*20)/20.0; + p1.y = (int)(p1.y*20)/20.0; + p2.x = (int)(p2.x*20)/20.0; + p2.y = (int)(p2.y*20)/20.0; + p3.x = (int)(p3.x*20)/20.0; + p3.y = (int)(p3.y*20)/20.0; + p4.x = (int)(p4.x*20)/20.0; + p4.y = (int)(p4.y*20)/20.0; + p5.x = (int)(p5.x*20)/20.0; + p5.y = (int)(p5.y*20)/20.0; + } + + gfxmatrix_t m; + m.m00 = (p4.x-p1.x)/sizex; m.m10 = (p2.x-p1.x)/sizey; + m.m01 = (p4.y-p1.y)/sizex; m.m11 = (p2.y-p1.y)/sizey; + + m.tx = p1.x - 0.5*multiply; + m.ty = p1.y - 0.5*multiply; + + gfximage_t img; + img.data = (gfxcolor_t*)data; + img.width = sizex; + img.height = sizey; + + if(type == IMAGE_TYPE_JPEG) + /* TODO: pass image_dpi to device instead */ + dev->setparameter(dev, "next_bitmap_is_jpeg", "1"); + + dump_outline(&p1); + dev->fillbitmap(dev, &p1, &img, &m, 0); +} + +void drawimagejpeg(gfxdevice_t*dev, gfxcolor_t*mem, int sizex,int sizey, + double x1,double y1, double x2,double y2, double x3,double y3, double x4,double y4, int multiply) +{ + drawimage(dev,mem,sizex,sizey,x1,y1,x2,y2,x3,y3,x4,y4, IMAGE_TYPE_JPEG, multiply); +} + +void drawimagelossless(gfxdevice_t*dev, gfxcolor_t*mem, int sizex,int sizey, + double x1,double y1, double x2,double y2, double x3,double y3, double x4,double y4, int multiply) +{ + drawimage(dev,mem,sizex,sizey,x1,y1,x2,y2,x3,y3,x4,y4, IMAGE_TYPE_LOSSLESS, multiply); +} + + +void VectorGraphicOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap*colorMap, GBool invert, + GBool inlineImg, int mask, int*maskColors, + Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GfxImageColorMap*maskColorMap) +{ + /* the code in this function is *old*. It's not pretty, but it works. */ + + double x1,y1,x2,y2,x3,y3,x4,y4; + ImageStream *imgStr; + Guchar pixBuf[4]; + GfxRGB rgb; + int ncomps = 1; + int bits = 1; + unsigned char* maskbitmap = 0; + + if(colorMap) { + ncomps = colorMap->getNumPixelComps(); + bits = colorMap->getBits(); + } + + if(maskStr) { + int x,y; + unsigned char buf[8]; + maskbitmap = (unsigned char*)malloc(maskHeight*maskWidth); + if(maskColorMap) { + ImageStream*imgMaskStr = new ImageStream(maskStr, maskWidth, maskColorMap->getNumPixelComps(), maskColorMap->getBits()); + imgMaskStr->reset(); + unsigned char pal[256]; + int n = 1 << colorMap->getBits(); + int t; + for(t=0;tgetGray(pixBuf, &gray); + pal[t] = colToByte(gray); + } + for (y = 0; y < maskHeight; y++) { + for (x = 0; x < maskWidth; x++) { + imgMaskStr->getPixel(buf); + maskbitmap[y*maskWidth+x] = pal[buf[0]]; + } + } + delete imgMaskStr; + } else { + ImageStream*imgMaskStr = new ImageStream(maskStr, maskWidth, 1, 1); + imgMaskStr->reset(); + for (y = 0; y < maskHeight; y++) { + for (x = 0; x < maskWidth; x++) { + imgMaskStr->getPixel(buf); + buf[0]^=maskInvert; + maskbitmap[y*maskWidth+x] = (buf[0]^1)*255; + } + } + delete imgMaskStr; + } + maskStr->close(); + } + + imgStr = new ImageStream(str, width, ncomps,bits); + imgStr->reset(); + + if(!width || !height || ((height+width)<=1 && (maskWidth+maskHeight)<=1)) + { + msg(" Ignoring %d by %d image", width, height); + unsigned char buf[8]; + int x,y; + for (y = 0; y < height; ++y) + for (x = 0; x < width; ++x) { + imgStr->getPixel(buf); + } + delete imgStr; + if(maskbitmap) + free(maskbitmap); + return; + } + + this->transformXY(state, 0, 1, &x1, &y1); + this->transformXY(state, 0, 0, &x2, &y2); + this->transformXY(state, 1, 0, &x3, &y3); + this->transformXY(state, 1, 1, &x4, &y4); + + if(type3active) { + /* as type 3 bitmaps are antialized, we need to place them + at integer coordinates, otherwise flash player's antializing + will kick in and make everything blurry */ + x1 = (int)(x1);y1 = (int)(y1); + x2 = (int)(x2);y2 = (int)(y2); + x3 = (int)(x3);y3 = (int)(y3); + x4 = (int)(x4);y4 = (int)(y4); + } + + if(!(str->getKind()==strDCT)) { + if(!type3active) { + if(mask) infofeature("masked pbm pictures"); + else infofeature("pbm pictures"); + } + if(mask) + msg(" drawing %d by %d masked picture", width, height); + } + if(str->getKind()==strDCT) { + infofeature("jpeg pictures"); + } + + if(mask) { + unsigned char buf[8]; + int x,y; + unsigned char*pic = new unsigned char[width*height]; + gfxcolor_t pal[256]; + GfxRGB rgb; + state->getFillRGB(&rgb); + + memset(pal,255,sizeof(pal)); + pal[0].r = (int)(colToByte(rgb.r)); pal[1].r = 0; + pal[0].g = (int)(colToByte(rgb.g)); pal[1].g = 0; + pal[0].b = (int)(colToByte(rgb.b)); pal[1].b = 0; + pal[0].a = 255; pal[1].a = 0; + + int numpalette = 2; + int realwidth = (int)sqrt(SQR(x2-x3) + SQR(y2-y3)); + int realheight = (int)sqrt(SQR(x1-x2) + SQR(y1-y2)); + for (y = 0; y < height; ++y) + for (x = 0; x < width; ++x) + { + imgStr->getPixel(buf); + if(invert) + buf[0]=1-buf[0]; + pic[width*y+x] = buf[0]; + } + + if(type3active) { + unsigned char*pic2 = 0; + numpalette = 16; + + pic2 = antialize(pic,width,height,realwidth,realheight,numpalette); + + if(!pic2) { + delete[] pic; + delete imgStr; + return; + } + + width = realwidth; + height = realheight; + delete[] pic; + pic = pic2; + + /* make a black/white palette */ + + float r = 255./(float)(numpalette-1); + int t; + for(t=0;tgetNumPixelComps()!=1 || str->getKind()==strDCT) { + gfxcolor_t*pic=new gfxcolor_t[width*height]; + for (y = 0; y < height; ++y) { + for (x = 0; x < width; ++x) { + imgStr->getPixel(pixBuf); + colorMap->getRGB(pixBuf, &rgb); + pic[width*y+x].r = (unsigned char)(colToByte(rgb.r)); + pic[width*y+x].g = (unsigned char)(colToByte(rgb.g)); + pic[width*y+x].b = (unsigned char)(colToByte(rgb.b)); + pic[width*y+x].a = 255;//(U8)(rgb.a * 255 + 0.5); + if(maskbitmap) { + int x1 = x*maskWidth/width; + int y1 = y*maskHeight/height; + int x2 = (x+1)*maskWidth/width; + int y2 = (y+1)*maskHeight/height; + int xx,yy; + unsigned int alpha=0; + unsigned int count=0; + for(xx=x1;xxgetKind()==strDCT) + drawimagejpeg(device, pic, width, height, x1,y1,x2,y2,x3,y3,x4,y4, config_multiply); + else + drawimagelossless(device, pic, width, height, x1,y1,x2,y2,x3,y3,x4,y4, config_multiply); + delete[] pic; + delete imgStr; + if(maskbitmap) free(maskbitmap); + return; + } else { + gfxcolor_t*pic=new gfxcolor_t[width*height]; + gfxcolor_t pal[256]; + int n = 1 << colorMap->getBits(); + int t; + for(t=0;t<256;t++) { + pixBuf[0] = t; + colorMap->getRGB(pixBuf, &rgb); + pal[t].r = (unsigned char)(colToByte(rgb.r)); + pal[t].g = (unsigned char)(colToByte(rgb.g)); + pal[t].b = (unsigned char)(colToByte(rgb.b)); + pal[t].a = 255;//(U8)(rgb.b * 255 + 0.5); + } + for (y = 0; y < height; ++y) { + for (x = 0; x < width; ++x) { + imgStr->getPixel(pixBuf); + pic[width*y+x] = pal[pixBuf[0]]; + if(maskColors && *maskColors==pixBuf[0]) { + pic[width*y+x].a = 0; + } + } + } + if(maskbitmap) { + if(maskWidth < width && maskHeight < height) { + for(y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + pic[width*y+x].a = maskbitmap[(y*maskHeight/height)*maskWidth+(x*maskWidth/width)]; + } + } + } else { + msg(" resampling %dx%d to mask size (%dx%d)", width, height, maskWidth, maskHeight); + gfxcolor_t*newpic=new gfxcolor_t[maskWidth*maskHeight]; + double dx = width / (double)maskWidth; + double dy = height / (double)maskHeight; + double yy = 0; + for(y = 0; y < maskHeight; y++) { + double xx = 0; + for (x = 0; x < maskWidth; x++) { + newpic[maskWidth*y+x] = pic[int(yy)*width+int(xx)]; + newpic[maskWidth*y+x].a = maskbitmap[maskWidth*y+x]; + xx += dx; + } + yy += dy; + } + delete[] pic; + pic = newpic; + width = maskWidth; + height = maskHeight; + } + } + drawimagelossless(device, pic, width, height, x1,y1,x2,y2,x3,y3,x4,y4, config_multiply); + + delete[] pic; + delete imgStr; + if(maskbitmap) free(maskbitmap); + return; + } +} + +void VectorGraphicOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, + int width, int height, GBool invert, + GBool inlineImg) +{ + if(config_textonly) { + OutputDev::drawImageMask(state,ref,str,width,height,invert,inlineImg); + return; + } + dbg("drawImageMask %dx%d, invert=%d inline=%d", width, height, invert, inlineImg); + msg(" drawImageMask %dx%d, invert=%d inline=%d", width, height, invert, inlineImg); + drawGeneralImage(state,ref,str,width,height,0,invert,inlineImg,1, 0, 0,0,0,0, 0); +} + +void VectorGraphicOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, + int *maskColors, GBool inlineImg) +{ + if(config_textonly) { + OutputDev::drawImage(state,ref,str,width,height,colorMap,maskColors,inlineImg); + return; + } + dbg("drawImage %dx%d, %s, %s, inline=%d", width, height, + colorMap?"colorMap":"no colorMap", + maskColors?"maskColors":"no maskColors", + inlineImg); + msg(" drawImage %dx%d, %s, %s, inline=%d", width, height, + colorMap?"colorMap":"no colorMap", + maskColors?"maskColors":"no maskColors", + inlineImg); + if(colorMap) + msg(" colorMap pixcomps:%d bits:%d mode:%d", colorMap->getNumPixelComps(), + colorMap->getBits(),colorMap->getColorSpace()->getMode()); + drawGeneralImage(state,ref,str,width,height,colorMap,0,inlineImg,0,maskColors, 0,0,0,0, 0); +} + +void VectorGraphicOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, + Stream *maskStr, int maskWidth, int maskHeight, + GBool maskInvert) +{ + if(config_textonly) { + OutputDev::drawMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskInvert); + return; + } + dbg("drawMaskedImage %dx%d, %s, %dx%d mask", width, height, + colorMap?"colorMap":"no colorMap", + maskWidth, maskHeight); + msg(" drawMaskedImage %dx%d, %s, %dx%d mask", width, height, + colorMap?"colorMap":"no colorMap", + maskWidth, maskHeight); + if(colorMap) + msg(" colorMap pixcomps:%d bits:%d mode:%d", colorMap->getNumPixelComps(), + colorMap->getBits(),colorMap->getColorSpace()->getMode()); + drawGeneralImage(state,ref,str,width,height,colorMap,0,0,0,0, maskStr, maskWidth, maskHeight, maskInvert, 0); +} + +void VectorGraphicOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, + Stream *maskStr, + int maskWidth, int maskHeight, + GfxImageColorMap *maskColorMap) +{ + if(config_textonly) { + OutputDev::drawSoftMaskedImage(state,ref,str,width,height,colorMap,maskStr,maskWidth,maskHeight,maskColorMap); + return; + } + dbg("drawSoftMaskedImage %dx%d, %s, %dx%d mask", width, height, + colorMap?"colorMap":"no colorMap", + maskWidth, maskHeight); + msg(" drawSoftMaskedImage %dx%d, %s, %dx%d mask", width, height, + colorMap?"colorMap":"no colorMap", + maskWidth, maskHeight); + if(colorMap) + msg(" colorMap pixcomps:%d bits:%d mode:%d", colorMap->getNumPixelComps(), + colorMap->getBits(),colorMap->getColorSpace()->getMode()); + drawGeneralImage(state,ref,str,width,height,colorMap,0,0,0,0, maskStr, maskWidth, maskHeight, 0, maskColorMap); +} + + +void VectorGraphicOutputDev::stroke(GfxState *state) +{ + if(config_textonly) {return;} + + dbg("stroke"); + + GfxPath * path = state->getPath(); + gfxline_t*line= gfxPath_to_gfxline(state, path, 0); + strokeGfxline(state, line, 0); + gfxline_free(line); +} + +void VectorGraphicOutputDev::fill(GfxState *state) +{ + if(config_textonly) {return;} + + gfxcolor_t col = gfxstate_getfillcolor(state); + dbg("fill %02x%02x%02x%02x",col.r,col.g,col.b,col.a); + + GfxPath * path = state->getPath(); + gfxline_t*line= gfxPath_to_gfxline(state, path, 1); + if(!config_disable_polygon_conversion) { + gfxline_t*line2 = gfxpoly_circular_to_evenodd(line, DEFAULT_GRID); + gfxline_free(line); + line = line2; + } + fillGfxLine(state, line, 0); + gfxline_free(line); +} + +void VectorGraphicOutputDev::eoFill(GfxState *state) +{ + if(config_textonly) {return;} + + gfxcolor_t col = gfxstate_getfillcolor(state); + dbg("eofill %02x%02x%02x%02x",col.r,col.g,col.b,col.a); + + GfxPath * path = state->getPath(); + gfxline_t*line= gfxPath_to_gfxline(state, path, 1); + fillGfxLine(state, line, 1); + gfxline_free(line); +} + + +void VectorGraphicOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, + GfxColorSpace *blendingColorSpace, + GBool isolated, GBool knockout, + GBool forSoftMask) +{ + const char*colormodename = ""; + + if(blendingColorSpace) { + colormodename = GfxColorSpace::getColorSpaceModeName(blendingColorSpace->getMode()); + } + dbg("beginTransparencyGroup device=%p %.1f/%.1f/%.1f/%.1f %s isolated=%d knockout=%d forsoftmask=%d", device, bbox[0],bbox[1],bbox[2],bbox[3], colormodename, isolated, knockout, forSoftMask); + msg(" beginTransparencyGroup %.1f/%.1f/%.1f/%.1f %s isolated=%d knockout=%d forsoftmask=%d", bbox[0],bbox[1],bbox[2],bbox[3], colormodename, isolated, knockout, forSoftMask); + + //states[statepos].createsoftmask |= forSoftMask; + states[statepos].createsoftmask = forSoftMask; + states[statepos].transparencygroup = !forSoftMask; + states[statepos].isolated = isolated; + + states[statepos].olddevice = this->device; + this->device = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); + dbg("this->device now %p (old: %p)", this->device, states[statepos].olddevice); + + gfxdevice_record_init(this->device, 0); + + /*if(!forSoftMask) { ////??? + state->setFillOpacity(0.0); + }*/ + dbgindent+=2; +} + +void VectorGraphicOutputDev::endTransparencyGroup(GfxState *state) +{ + dbgindent-=2; + gfxdevice_t*r = this->device; + + dbg("endTransparencyGroup this->device now back to %p (destroying %p)", states[statepos].olddevice, this->device); + + this->device = states[statepos].olddevice; + if(!this->device) { + msg(" Invalid state nesting"); + } + states[statepos].olddevice = 0; + + gfxresult_t*recording = r->finish(r); + + dbg(" forsoftmask=%d recording=%p/%p", states[statepos].createsoftmask, r, recording); + msg(" endTransparencyGroup forsoftmask=%d recording=%p/%p", states[statepos].createsoftmask, r, recording); + + if(states[statepos].createsoftmask) { + states[statepos-1].softmaskrecording = recording; + } else { + states[statepos-1].grouprecording = recording; + } + + states[statepos].createsoftmask = 0; + states[statepos].transparencygroup = 0; + free(r); +} + +void VectorGraphicOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) +{ + const char*blendmodes[] = {"normal","multiply","screen","overlay","darken", "lighten", + "colordodge","colorburn","hardlight","softlight","difference", + "exclusion","hue","saturation","color","luminosity"}; + + dbg("paintTransparencyGroup blend=%s softmaskon=%d recording=%p", blendmodes[state->getBlendMode()], states[statepos].softmask, states[statepos].grouprecording); + msg(" paintTransparencyGroup blend=%s softmaskon=%d", blendmodes[state->getBlendMode()], states[statepos].softmask); + + if(state->getBlendMode() == gfxBlendNormal) + infofeature("transparency groups"); + else { + char buffer[80]; + sprintf(buffer, "%s blended transparency groups", blendmodes[state->getBlendMode()]); + warnfeature(buffer, 0); + } + + gfxresult_t*grouprecording = states[statepos].grouprecording; + + int blendmode = state->getBlendMode(); + if(blendmode == gfxBlendNormal || blendmode == gfxBlendMultiply) { + int alpha = (int)(state->getFillOpacity()*255); + if(blendmode == gfxBlendMultiply && alpha>200) + alpha = 128; + gfxdevice_t ops; + dbg("this->device=%p, this->device->name=%s\n", this->device, this->device->name); + gfxdevice_ops_init(&ops, this->device, alpha); + gfxresult_record_replay(grouprecording, &ops, 0); + ops.finish(&ops); + } + grouprecording->destroy(grouprecording); + + states[statepos].grouprecording = 0; +} + +void VectorGraphicOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *rgb) +{ + if(states[statepos].softmask) { + /* shouldn't happen, but *does* happen */ + clearSoftMask(state); + } + + /* alpha = 1: retrieve mask values from alpha layer + alpha = 0: retrieve mask values from luminance */ + + dbg("setSoftMask %.1f/%.1f/%.1f/%.1f alpha=%d backdrop=%02x%02x%02x", + bbox[0], bbox[1], bbox[2], bbox[3], alpha, colToByte(rgb->c[0]), colToByte(rgb->c[1]), colToByte(rgb->c[2])); + msg(" setSoftMask %.1f/%.1f/%.1f/%.1f alpha=%d backdrop=%02x%02x%02x", + bbox[0], bbox[1], bbox[2], bbox[3], alpha, colToByte(rgb->c[0]), colToByte(rgb->c[1]), colToByte(rgb->c[2])); + if(!alpha) + infofeature("soft masks"); + else + warnfeature("soft masks from alpha channel",0); + + if(states[statepos].olddevice) { + msg(" Internal error: badly balanced softmasks/transparency groups"); + exit(1); + } + states[statepos].olddevice = this->device; + this->device = (gfxdevice_t*)rfx_calloc(sizeof(gfxdevice_t)); + gfxdevice_record_init(this->device, 0); + + dbg("softmaskrecording is %p (dev=%p) at statepos %d\n", states[statepos].softmaskrecording, this->device, statepos); + + states[statepos].softmask = 1; + states[statepos].softmask_alpha = alpha; +} + +static inline Guchar div255(int x) { + return (Guchar)((x + (x >> 8) + 0x80) >> 8); +} + +static unsigned char clampU8(unsigned char c, unsigned char min, unsigned char max) +{ + if(c < min) c = min; + if(c > max) c = max; + return c; +} + +void VectorGraphicOutputDev::clearSoftMask(GfxState *state) +{ + if(!states[statepos].softmask) + return; + states[statepos].softmask = 0; + dbg("clearSoftMask statepos=%d", statepos); + msg(" clearSoftMask statepos=%d", statepos); + + if(!states[statepos].softmaskrecording || strcmp(this->device->name, "record")) { + msg(" Error in softmask/tgroup ordering"); + return; + } + + gfxresult_t*mask = states[statepos].softmaskrecording; + gfxresult_t*below = this->device->finish(this->device);free(this->device); + this->device = states[statepos].olddevice; + + /* get outline of all objects below the soft mask */ + gfxdevice_t uniondev; + gfxdevice_union_init(&uniondev, 0); + gfxresult_record_replay(below, &uniondev, 0); + gfxline_t*belowoutline = gfxdevice_union_getunion(&uniondev); + uniondev.finish(&uniondev); + gfxbbox_t bbox = gfxline_getbbox(belowoutline); + gfxline_free(belowoutline);belowoutline=0; +#if 0 + this->device->startclip(this->device, belowoutline); + gfxresult_record_replay(below, this->device, 0); + gfxresult_record_replay(mask, this->device, 0); + this->device->endclip(this->device); +#endif + + int width = (int)bbox.xmax,height = (int)bbox.ymax; + if(width<=0 || height<=0) + return; + + gfxdevice_t belowrender; + gfxdevice_render_init(&belowrender); + if(states[statepos+1].isolated) { + belowrender.setparameter(&belowrender, "fillwhite", "1"); + } + belowrender.setparameter(&belowrender, "antialize", "2"); + belowrender.startpage(&belowrender, width, height); + gfxresult_record_replay(below, &belowrender, 0); + belowrender.endpage(&belowrender); + gfxresult_t* belowresult = belowrender.finish(&belowrender); + gfximage_t* belowimg = (gfximage_t*)belowresult->get(belowresult,"page0"); + //png_write("below.png", (unsigned char*)belowimg->data, belowimg->width, belowimg->height); + + gfxdevice_t maskrender; + gfxdevice_render_init(&maskrender); + maskrender.startpage(&maskrender, width, height); + gfxresult_record_replay(mask, &maskrender, 0); + maskrender.endpage(&maskrender); + gfxresult_t* maskresult = maskrender.finish(&maskrender); + gfximage_t* maskimg = (gfximage_t*)maskresult->get(maskresult,"page0"); + + if(belowimg->width != maskimg->width || belowimg->height != maskimg->height) { + msg(" Internal error in mask drawing"); + return; + } + + int y,x; + for(y=0;ydata[maskimg->width*y]; + gfxcolor_t* l2 = &belowimg->data[belowimg->width*y]; + for(x=0;xa; + } else { + alpha = (77*l1->r + 151*l1->g + 28*l1->b) >> 8; + } + + l2->a = div255(alpha*l2->a); + + /* DON'T premultiply alpha- this is done by fillbitmap, + depending on the output device */ + //l2->r = div255(alpha*l2->r); + //l2->g = div255(alpha*l2->g); + //l2->b = div255(alpha*l2->b); + + l1++; + l2++; + } + } + gfxline_t*line = gfxline_makerectangle(0,0,width,height); + + gfxmatrix_t matrix; + matrix.m00 = 1.0; matrix.m10 = 0.0; matrix.tx = 0.0; + matrix.m01 = 0.0; matrix.m11 = 1.0; matrix.ty = 0.0; + + if(!config_textonly) { + this->device->fillbitmap(this->device, line, belowimg, &matrix, 0); + } + + mask->destroy(mask); + below->destroy(below); + maskresult->destroy(maskresult); + belowresult->destroy(belowresult); + states[statepos].softmaskrecording = 0; +} + +//class MemCheck +//{ +// public: ~MemCheck() +// { +// delete globalParams;globalParams=0; +// Object::memCheck(stderr); +// gMemReport(stderr); +// } +//} myMemCheck; + diff -Nru swftools-0.9.0/lib/pdf/VectorGraphicOutputDev.h swftools-0.9.2/lib/pdf/VectorGraphicOutputDev.h --- swftools-0.9.0/lib/pdf/VectorGraphicOutputDev.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/VectorGraphicOutputDev.h 2011-10-07 03:20:17.000000000 +0000 @@ -0,0 +1,220 @@ +#ifndef __vectorgraphicsoutputdev_h__ +#define __vectorgraphicsoutputdev_h__ + +#include "../gfxdevice.h" +#include "../gfxsource.h" +#include "../gfxtools.h" +#include "../kdtree.h" + +#include "CommonOutputDev.h" +#include "InfoOutputDev.h" +#include "CharOutputDev.h" +#include "PDFDoc.h" +#include "GlobalParams.h" + +class GFXOutputState { + public: + int clipping; + int textRender; + char createsoftmask; + char transparencygroup; + char softmask; + char softmask_alpha; + char isolated; + + gfxbbox_t clipbbox; + + GFXOutputState(); + + gfxresult_t* grouprecording; // for transparency groups + gfxresult_t* softmaskrecording; // for soft masks + + gfxdevice_t* olddevice; + + double *dashPattern; + int dashLength; + double dashStart; + + GfxState*state; +}; + +void addGlobalFont(const char*filename); +void addGlobalLanguageDir(const char*dir); +void addGlobalFontDir(const char*dirname); + +class GFXLink; + +void drawchar_callback(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix); +void addfont_callback(gfxdevice_t*dev, gfxfont_t*font); + +class VectorGraphicOutputDev: public CommonOutputDev { +public: + gfxdevice_t* device; + + VectorGraphicOutputDev(InfoOutputDev*info, PDFDoc*doc, int*page2page, int num_pages, int x, int y, int x1, int y1, int x2, int y2); + virtual ~VectorGraphicOutputDev() ; + + virtual void setDevice(gfxdevice_t*dev); + virtual void setParameter(const char*key, const char*value); + + // Start a page. + virtual void beginPage(GfxState *state, int pageNum); + virtual void endPage(); + + virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI, + int rotate, GBool useMediaBox, GBool crop, + int sliceX, int sliceY, int sliceW, int sliceH, + GBool printing, Catalog *catalog, + GBool (*abortCheckCbk)(void *data) = NULL, + void *abortCheckCbkData = NULL); + //----- get info about output device + + // Does this device use upside-down coordinates? + // (Upside-down means (0,0) is the top left corner of the page.) + virtual GBool upsideDown(); + + // Does this device use drawChar() or drawString()? + virtual GBool useDrawChar(); + + //virtual GBool useShadedFills() { return gTrue; } + + //----- link borders + virtual void processLink(Link *link, Catalog *catalog); + virtual void setDefaultCTM(double *ctm); + + //----- save/restore graphics state + virtual void saveState(GfxState *state) ; + virtual void restoreState(GfxState *state) ; + + //----- update graphics state + virtual void updateLineDash(GfxState *state); + virtual void updateFont(GfxState *state); + virtual void updateFontMatrix(GfxState *state); + + //----- path painting + virtual void stroke(GfxState *state) ; + virtual void fill(GfxState *state) ; + virtual void eoFill(GfxState *state) ; + + //----- path clipping + virtual void clip(GfxState *state) ; + virtual void eoClip(GfxState *state) ; + virtual void clipToStrokePath(GfxState *state); + + //----- shaded fills + virtual GBool useTilingPatternFill(); + virtual GBool useShadedFills(); + +virtual POPPLER_TILING_PATERN_RETURN tilingPatternFill(GfxState *state, + POPPLER_TILING_PATERN_GFX + Object *str, + int paintType, Dict *resDict, + double *mat, double *bbox, + int x0, int y0, int x1, int y1, + double xStep, double yStep); + virtual GBool functionShadedFill(GfxState *state, + GfxFunctionShading *shading); + virtual GBool axialShadedFill(GfxState *state, GfxAxialShading *shading); + virtual GBool radialShadedFill(GfxState *state, GfxRadialShading *shading); + + //----- text drawing + virtual void beginString(GfxState *state, GString *s) ; + virtual void endString(GfxState *state) ; + virtual void endTextObject(GfxState *state); + virtual void drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode code, int nBytes, Unicode *u, int uLen); + + //----- image drawing + virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, + int width, int height, GBool invert, + GBool inlineImg); + virtual void drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, + int *maskColors, GBool inlineImg); + virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, + Stream *maskStr, int maskWidth, int maskHeight, + GBool maskInvert); + virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, + int width, int height, + GfxImageColorMap *colorMap, + Stream *maskStr, + int maskWidth, int maskHeight, + GfxImageColorMap *maskColorMap); + + //----- transparency groups and soft masks (xpdf >= ~ 3.01.16) + virtual void beginTransparencyGroup(GfxState *state, double *bbox, + GfxColorSpace *blendingColorSpace, + GBool isolated, GBool knockout, + GBool forSoftMask); + virtual void endTransparencyGroup(GfxState *state); + virtual void paintTransparencyGroup(GfxState *state, double *bbox); + virtual void setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor); + virtual void clearSoftMask(GfxState *state); + + //----- type 3 chars + virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen); + virtual void endType3Char(GfxState *state); + + virtual void type3D0(GfxState *state, double wx, double wy); + virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury); + + char* searchForSuitableFont(GfxFont*gfxFont); + + void finish(); + + virtual GBool useDrawForm(); + virtual void drawForm(Ref id); + virtual GBool needNonText(); + + private: + gfxline_t* gfxPath_to_gfxline(GfxState*state, GfxPath*path, int closed); + + void drawGeneralImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap*colorMap, GBool invert, + GBool inlineImg, int mask, int *maskColors, + Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GfxImageColorMap*maskColorMap); + + void strokeGfxline(GfxState *state, gfxline_t*line, int flags); + void clipToGfxLine(GfxState *state, gfxline_t*line, char evenodd); + void fillGfxLine(GfxState *state, gfxline_t*line, char evenodd); + + int currentpage; + char outer_clip_box; //whether the page clip box is still on + GFXOutputState states[64]; + int statepos; + + int type3active; // are we between beginType3()/endType3()? + GfxState *laststate; + + gfxline_t* current_text_stroke; + gfxline_t* current_text_clip; + gfxfont_t* current_gfxfont; + FontInfo*current_fontinfo; + gfxmatrix_t current_font_matrix; + + /* config */ + int config_break_on_warning; + int config_remapunicode; + int config_transparent; + int config_convertgradients; + int config_disable_polygon_conversion; + int config_multiply; + int config_drawonlyshapes; + int config_textonly; + int config_disable_tiling_pattern_fills; + + gfxdevice_t char_output_dev; + CharOutputDev*charDev; + friend void drawchar_callback(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix); + friend void addfont_callback(gfxdevice_t*dev, gfxfont_t*font); + gfxfont_t*gfxfont_from_callback; + int glyphnr_from_callback; + gfxcolor_t textcolor_from_callback; + gfxmatrix_t textmatrix_from_callback; +}; + +#endif //__vectorgraphicsoutputdev_h__ diff -Nru swftools-0.9.0/lib/pdf/XMLOutputDev.cc swftools-0.9.2/lib/pdf/XMLOutputDev.cc --- swftools-0.9.0/lib/pdf/XMLOutputDev.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/XMLOutputDev.cc 2010-11-12 18:58:14.000000000 +0000 @@ -0,0 +1,160 @@ +/* XMLOutputDev.cc + + This file is part of swftools. + + Swftools 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. + + Swftools 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. + + You should have received a copy of the GNU General Public License + along with swftools; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "../../config.h" +#include +#include +#include "XMLOutputDev.h" +#include "GfxState.h" +#include "popplercompat.h" +#ifndef HAVE_POPPLER + #include "gfile.h" +#endif + +XMLOutputDev::XMLOutputDev(char*filename) +:TextOutputDev(mktmpname(0), false, false, false) +{ + out = fopen(filename, "wb"); + if(!out) { + perror(filename); + exit(-1); + } + fprintf(out, "\n"); + fprintf(out, "\n"); +} + +XMLOutputDev::~XMLOutputDev() +{ + fprintf(out, "\n"); + fclose(out); +} + +void XMLOutputDev::startPage(int pageNum, GfxState *state) +{ + TextOutputDev::startPage(pageNum, state); + fprintf(out, "\n", pageNum, + state->getPageWidth(), state->getPageHeight()); +} + +void XMLOutputDev::endPage() +{ + TextOutputDev::endPage(); + TextWordList* list = makeWordList(); + int len = list->getLength(); + int i; + + char textTag = 0; + GString*fontname = new GString(); + double fontsize = -99999; + double base = -9999; + double color_r = -1; + double color_g = -1; + double color_b = -1; + for(i=0;iget(i); + GString*newfont = word->getFontName(); + double newsize = word->getFontSize(); +#ifdef HAVE_POPPLER + double newbase = word->getBaseline(); +#else + double newbase = word->base; +#endif + double newcolor_r; + double newcolor_g; + double newcolor_b; + word->getColor(&newcolor_r, &newcolor_g, &newcolor_b); + + if((newfont && newfont->cmp(fontname)) || + newsize != fontsize || + newbase != base || + newcolor_r != color_r || + newcolor_g != color_g || + newcolor_b != color_b + ) + { + TextFontInfo*info = word->getFontInfo(); + if(textTag) + fprintf(out, "\n"); + textTag = 1; + GBool italic = gFalse; + GBool bold = gFalse; + GBool serif = gFalse; + + if(info->isItalic()) italic = gTrue; + if(info->isBold()) bold = gTrue; + if(info->isSerif()) serif = gTrue; + char*name = (char*)""; + if(newfont) { + name = newfont->lowerCase()->getCString(); + if(strlen(name)>7 && name[6]=='+') + name += 7; + if(strstr(name, "ital")) italic = gTrue; + if(strstr(name, "slan")) italic = gTrue; + if(strstr(name, "obli")) italic = gTrue; + if(strstr(name, "bold")) bold = gTrue; + if(strstr(name, "heav")) bold = gTrue; + if(strstr(name, "medi")) bold = gTrue; + if(strstr(name, "serif")) serif = gTrue; + } + + double xMin,yMin,xMax,yMax; + word->getBBox(&xMin, &yMin, &xMax, &yMax); + + int rot = word->getRotation(); + + fprintf(out, "", + name, + newbase, + (rot&1)?yMin:xMin, + (rot&1)?yMin:xMin, + (rot&1)?xMin:yMin, + (rot&1)?yMax:xMax, + (rot&1)?xMax:yMax, + info->isFixedWidth()?"fixed;":"", + serif?"serif;":"", + italic?"italic;":"", + bold?"bold;":"", + newsize, + ((int)(newcolor_r*255))&0xff, + ((int)(newcolor_g*255))&0xff, + ((int)(newcolor_b*255))&0xff + ); + fontname = newfont->copy(); + fontsize = newsize; + base = newbase; + color_r = newcolor_r; + color_g = newcolor_g; + color_b = newcolor_b; + } + char*s = word->getText()->getCString(); + while(*s) { + switch(*s) { + case '<': fprintf(out, "<");break; + case '>': fprintf(out, ">");break; + case '&': fprintf(out, "&");break; + default: fwrite(s, 1, 1, out); + } + s++; + } + if(word->getSpaceAfter()) + fprintf(out, " "); + } + if(textTag) fprintf(out, "\n"); + fprintf(out, "\n"); +} + diff -Nru swftools-0.9.0/lib/pdf/XMLOutputDev.h swftools-0.9.2/lib/pdf/XMLOutputDev.h --- swftools-0.9.0/lib/pdf/XMLOutputDev.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/XMLOutputDev.h 2010-11-12 18:58:17.000000000 +0000 @@ -0,0 +1,35 @@ +/* XMLOutputDev.h + + This file is part of swftools. + + Swftools 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. + + Swftools 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. + + You should have received a copy of the GNU General Public License + along with swftools; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __xmloutputdev_h__ +#define __xmloutputdev_h__ + +#include "OutputDev.h" +#include "TextOutputDev.h" + +class XMLOutputDev: public TextOutputDev +{ + public: + XMLOutputDev(char*filename); + virtual void startPage(int pageNum, GfxState *state); + virtual void endPage(); + virtual ~XMLOutputDev(); + private: + FILE*out; +}; +#endif //__xmloutputdev_h__ diff -Nru swftools-0.9.0/lib/pdf/xpdf/Catalog.cc swftools-0.9.2/lib/pdf/xpdf/Catalog.cc --- swftools-0.9.0/lib/pdf/xpdf/Catalog.cc 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/Catalog.cc 2012-04-08 17:26:34.000000000 +0000 @@ -193,7 +193,7 @@ if (!kids.isArray()) { error(-1, "Kids object (page %d) is wrong type (%s)", start+1, kids.getTypeName()); - goto err1; + return start; } for (i = 0; i < kids.arrayGetLength(); ++i) { kids.arrayGetNF(i, &kidRef); diff -Nru swftools-0.9.0/lib/pdf/xpdf/CharCodeToUnicode.cc swftools-0.9.2/lib/pdf/xpdf/CharCodeToUnicode.cc --- swftools-0.9.0/lib/pdf/xpdf/CharCodeToUnicode.cc 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/CharCodeToUnicode.cc 2012-04-08 17:26:34.000000000 +0000 @@ -208,13 +208,13 @@ int nBits) { PSTokenizer *pst; char tok1[256], tok2[256], tok3[256]; - int nDigits, n1, n2, n3; + int maxCode, n1, n2, n3; CharCode i; CharCode code1, code2; GString *name; FILE *f; - nDigits = nBits / 4; + maxCode = (nBits == 8) ? 0xff : (nBits == 16) ? 0xffff : 0xffffffff; pst = new PSTokenizer(getCharFunc, data); pst->getToken(tok1, sizeof(tok1), &n1); while (pst->getToken(tok2, sizeof(tok2), &n2)) { @@ -241,9 +241,9 @@ error(-1, "Illegal entry in bfchar block in ToUnicode CMap"); break; } - if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && + if (!(tok1[0] == '<' && tok1[n1 - 1] == '>' && tok2[0] == '<' && tok2[n2 - 1] == '>')) { - error(-1, "Illegal entry in bfchar block in ToUnicode CMap"); + error(-1, "Illegal entry in bfchar block in ToUnicode CMap."); continue; } tok1[n1 - 1] = tok2[n2 - 1] = '\0'; @@ -251,6 +251,9 @@ error(-1, "Illegal entry in bfchar block in ToUnicode CMap"); continue; } + if (code1 > maxCode) { + error(-1, "Invalid entry in bfchar block in ToUnicode CMap"); + } addMapping(code1, tok2 + 1, n2 - 2, 0); } pst->getToken(tok1, sizeof(tok1), &n1); @@ -266,8 +269,8 @@ error(-1, "Illegal entry in bfrange block in ToUnicode CMap"); break; } - if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && - n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) { + if (!(tok1[0] == '<' && tok1[n1 - 1] == '>' && + tok2[0] == '<' && tok2[n2 - 1] == '>')) { error(-1, "Illegal entry in bfrange block in ToUnicode CMap"); continue; } @@ -277,6 +280,10 @@ error(-1, "Illegal entry in bfrange block in ToUnicode CMap"); continue; } + if (code1 > maxCode || code2 > maxCode) { + error(-1, "Invalid entry in bfrange block in ToUnicode CMap"); + } + if (!strcmp(tok3, "[")) { i = 0; while (pst->getToken(tok1, sizeof(tok1), &n1) && @@ -320,7 +327,13 @@ if (code >= mapLen) { oldLen = mapLen; mapLen = (code + 256) & ~255; + Unicode *oldmap; map = (Unicode *)greallocn(map, mapLen, sizeof(Unicode)); + if(!map) { + /* we sometimes get overflows for files trying to use 0xffffffff as charcode */ + map = oldmap; + return; + } for (i = oldLen; i < mapLen; ++i) { map[i] = 0; } diff -Nru swftools-0.9.0/lib/pdf/xpdf/config.h swftools-0.9.2/lib/pdf/xpdf/config.h --- swftools-0.9.0/lib/pdf/xpdf/config.h 2009-04-17 15:57:11.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/config.h 2012-04-08 17:26:34.000000000 +0000 @@ -53,9 +53,9 @@ // user config file name, relative to the user's home directory #if defined(VMS) || (defined(WIN32) && !defined(__CYGWIN32__)) -#define xpdfUserConfigFile "pdf2swf.conf" +#define xpdfUserConfigFile "xpdfrc" #else -#define xpdfUserConfigFile ".pdf2swf.conf" +#define xpdfUserConfigFile ".xpdfrc" #endif // system config file name (set via the configure script) @@ -64,7 +64,7 @@ #else // under Windows, we get the directory with the executable and then // append this file name -#define xpdfSysConfigFile "pdf2swf.conf" +#define xpdfSysConfigFile "xpdfrc" #endif //------------------------------------------------------------------------ diff -Nru swftools-0.9.0/lib/pdf/xpdf/Decrypt.cc swftools-0.9.2/lib/pdf/xpdf/Decrypt.cc --- swftools-0.9.0/lib/pdf/xpdf/Decrypt.cc 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/Decrypt.cc 2012-04-08 17:26:34.000000000 +0000 @@ -596,6 +596,7 @@ s->bufIdx = 0; if (last) { n = s->buf[15]; + if(!n || n>16) n=16; for (i = 15; i >= n; --i) { s->buf[i] = s->buf[i-n]; } diff -Nru swftools-0.9.0/lib/pdf/xpdf/FoFiTrueType.cc swftools-0.9.2/lib/pdf/xpdf/FoFiTrueType.cc --- swftools-0.9.0/lib/pdf/xpdf/FoFiTrueType.cc 2007-02-27 22:05:51.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/FoFiTrueType.cc 2012-04-08 17:26:34.000000000 +0000 @@ -1917,7 +1917,11 @@ } else { pos = getU16BE(tables[i].offset + j*2, &parsedOk); } - if (pos < 0 || pos > len) { + if(pos > len) { + nGlyphs = j; + break; + } + if (pos < 0) { parsedOk = gFalse; } } diff -Nru swftools-0.9.0/lib/pdf/xpdf/Function.cc swftools-0.9.2/lib/pdf/xpdf/Function.cc --- swftools-0.9.0/lib/pdf/xpdf/Function.cc 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/Function.cc 2012-04-08 17:26:34.000000000 +0000 @@ -401,7 +401,7 @@ for (k = 0, t = j; k < m; ++k, t >>= 1) { idx += idxMul[k] * (e[k][t & 1]); } - sBuf[j] = samples[idx]; + sBuf[j] = (idx>=0&&idxappend('\\'); } else { @@ -554,7 +555,7 @@ if (ext) { #if HAVE_MKSTEMPS - if ((s = getenv("TMPDIR"))) { + if ((s = getenv("SWFTOOLS_TMP"))) { *name = new GString(s); } else { *name = new GString("/tmp"); @@ -571,7 +572,7 @@ #endif } else { #if HAVE_MKSTEMP - if ((s = getenv("TMPDIR"))) { + if ((s = getenv("SWFTOOLS_TMP"))) { *name = new GString(s); } else { *name = new GString("/tmp"); diff -Nru swftools-0.9.0/lib/pdf/xpdf/Gfx.cc swftools-0.9.2/lib/pdf/xpdf/Gfx.cc --- swftools-0.9.0/lib/pdf/xpdf/Gfx.cc 2009-04-17 15:57:12.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/Gfx.cc 2012-04-08 17:26:34.000000000 +0000 @@ -444,6 +444,7 @@ xref = xrefA; subPage = gFalse; printCommands = globalParams->getPrintCommands(); + parser = NULL; // start the resource stack res = new GfxResources(xref, resDict, NULL); @@ -454,11 +455,7 @@ fontChanged = gFalse; clip = clipNone; ignoreUndef = 0; - if(cropBox) { - out->startPage(pageNum, state, cropBox->x1,cropBox->y1,cropBox->x2,cropBox->y2); - } else { - out->startPage(pageNum, state, 0,0,0,0); - } + out->startPage(pageNum, state); out->setDefaultCTM(state->getCTM()); out->updateAll(state); for (i = 0; i < 6; ++i) { @@ -3485,11 +3482,13 @@ } } if (!obj1.isNull()) { - colorSpace = GfxColorSpace::parse(&obj1); + colorSpace = GfxColorSpace::parse(&obj1, csMode); } else if (csMode == streamCSDeviceGray) { colorSpace = new GfxDeviceGrayColorSpace(); } else if (csMode == streamCSDeviceRGB) { colorSpace = new GfxDeviceRGBColorSpace(); + } else if (csMode == streamCSDeviceRGBX) { + colorSpace = new GfxDeviceRGBXColorSpace(); } else if (csMode == streamCSDeviceCMYK) { colorSpace = new GfxDeviceCMYKColorSpace(); } else { @@ -3833,6 +3832,7 @@ out->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, softMask); } + GfxState*old_state = state; // set new base matrix for (i = 0; i < 6; ++i) { @@ -3844,6 +3844,9 @@ display(str, gFalse); if (softMask || transpGroup) { + // restore graphics state + while(state != old_state) + restoreState(); out->endTransparencyGroup(state); } @@ -3930,6 +3933,10 @@ obj.free(); // make stream + if(!parser->getStream()) { + error(getPos(), "Couldn't get stream"); + return NULL; + } str = new EmbedStream(parser->getStream(), &dict, gFalse, 0); str = str->addFilters(&dict); diff -Nru swftools-0.9.0/lib/pdf/xpdf/GfxFont.cc swftools-0.9.2/lib/pdf/xpdf/GfxFont.cc --- swftools-0.9.0/lib/pdf/xpdf/GfxFont.cc 2009-04-17 15:57:12.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/GfxFont.cc 2012-04-08 17:26:34.000000000 +0000 @@ -194,7 +194,7 @@ embFontID = obj2.getRef(); if (type != fontType1) { error(-1, "Mismatch between font type and embedded font file"); - type = fontType1; + type = isCIDFont() ? fontCIDType0 : fontType1; } } obj2.free(); diff -Nru swftools-0.9.0/lib/pdf/xpdf/GfxState.cc swftools-0.9.2/lib/pdf/xpdf/GfxState.cc --- swftools-0.9.0/lib/pdf/xpdf/GfxState.cc 2009-04-17 15:57:11.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/GfxState.cc 2012-04-08 17:26:34.000000000 +0000 @@ -93,7 +93,7 @@ GfxColorSpace::~GfxColorSpace() { } -GfxColorSpace *GfxColorSpace::parse(Object *csObj) { +GfxColorSpace *GfxColorSpace::parse(Object *csObj, StreamColorSpaceMode csMode) { GfxColorSpace *cs; Object obj1; @@ -102,7 +102,10 @@ if (csObj->isName("DeviceGray") || csObj->isName("G")) { cs = new GfxDeviceGrayColorSpace(); } else if (csObj->isName("DeviceRGB") || csObj->isName("RGB")) { - cs = new GfxDeviceRGBColorSpace(); + if(csMode == streamCSDeviceRGBX) + cs = new GfxDeviceRGBXColorSpace(); + else + cs = new GfxDeviceRGBColorSpace(); } else if (csObj->isName("DeviceCMYK") || csObj->isName("CMYK")) { cs = new GfxDeviceCMYKColorSpace(); } else if (csObj->isName("Pattern")) { @@ -115,7 +118,10 @@ if (obj1.isName("DeviceGray") || obj1.isName("G")) { cs = new GfxDeviceGrayColorSpace(); } else if (obj1.isName("DeviceRGB") || obj1.isName("RGB")) { - cs = new GfxDeviceRGBColorSpace(); + if(csMode == streamCSDeviceRGBX) + cs = new GfxDeviceRGBColorSpace(); + else + cs = new GfxDeviceRGBColorSpace(); } else if (obj1.isName("DeviceCMYK") || obj1.isName("CMYK")) { cs = new GfxDeviceCMYKColorSpace(); } else if (obj1.isName("CalGray")) { @@ -334,6 +340,17 @@ } //------------------------------------------------------------------------ +// GfxDeviceRGBXColorSpace +//------------------------------------------------------------------------ + +GfxDeviceRGBXColorSpace::GfxDeviceRGBXColorSpace() { +} + +GfxColorSpace *GfxDeviceRGBXColorSpace::copy() { + return new GfxDeviceRGBXColorSpace(); +} + +//------------------------------------------------------------------------ // GfxCalRGBColorSpace //------------------------------------------------------------------------ diff -Nru swftools-0.9.0/lib/pdf/xpdf/GfxState.h swftools-0.9.2/lib/pdf/xpdf/GfxState.h --- swftools-0.9.0/lib/pdf/xpdf/GfxState.h 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/GfxState.h 2012-04-08 17:26:34.000000000 +0000 @@ -138,7 +138,7 @@ virtual GfxColorSpaceMode getMode() = 0; // Construct a color space. Returns NULL if unsuccessful. - static GfxColorSpace *parse(Object *csObj); + static GfxColorSpace *parse(Object *csObj, StreamColorSpaceMode csMode = streamCSNone); // Convert to gray, RGB, or CMYK. virtual void getGray(GfxColor *color, GfxGray *gray) = 0; @@ -252,6 +252,19 @@ }; //------------------------------------------------------------------------ +// GfxDeviceRGBXColorSpace +//------------------------------------------------------------------------ + +class GfxDeviceRGBXColorSpace: public GfxDeviceRGBColorSpace { +public: + + GfxDeviceRGBXColorSpace(); + virtual GfxColorSpace *copy(); + virtual int getNComps() { return 4; } +private: +}; + +//------------------------------------------------------------------------ // GfxCalRGBColorSpace //------------------------------------------------------------------------ diff -Nru swftools-0.9.0/lib/pdf/xpdf/gmem.cc swftools-0.9.2/lib/pdf/xpdf/gmem.cc --- swftools-0.9.0/lib/pdf/xpdf/gmem.cc 2009-04-17 15:57:08.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/gmem.cc 2012-04-08 17:26:34.000000000 +0000 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include "gmem.h" @@ -47,7 +48,7 @@ #endif /* DEBUG_MEM */ -void *gmalloc(int size) GMEM_EXCEP { +void *gmalloc(int size, bool exit_on_error) GMEM_EXCEP { #ifdef DEBUG_MEM int size1; char *mem; @@ -60,7 +61,10 @@ throw GMemException(); #else fprintf(stderr, "Invalid memory allocation size\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } if (size == 0) { @@ -72,7 +76,10 @@ throw GMemException(); #else fprintf(stderr, "Out of memory\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } hdr = (GMemHdr *)mem; @@ -104,7 +111,10 @@ throw GMemException(); #else fprintf(stderr, "Invalid memory allocation size\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } if (size == 0) { @@ -115,14 +125,23 @@ throw GMemException(); #else fprintf(stderr, "Out of memory\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } return p; #endif } +void *gmalloc(int size) GMEM_EXCEP { + return gmalloc(size, true); +} +void *gmalloc_noexit(int size) GMEM_EXCEP { + return gmalloc(size, false); +} -void *grealloc(void *p, int size) GMEM_EXCEP { +void *grealloc(void *p, int size, bool exit_on_error) GMEM_EXCEP { #ifdef DEBUG_MEM GMemHdr *hdr; void *q; @@ -133,7 +152,10 @@ throw GMemException(); #else fprintf(stderr, "Invalid memory allocation size\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } if (size == 0) { @@ -160,7 +182,10 @@ throw GMemException(); #else fprintf(stderr, "Invalid memory allocation size\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } if (size == 0) { @@ -179,14 +204,23 @@ throw GMemException(); #else fprintf(stderr, "Out of memory\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } return q; #endif } +void *grealloc(void *p, int size) GMEM_EXCEP { + return grealloc(p, size, true); +} +void *grealloc_noexit(void *p, int size) GMEM_EXCEP { + return grealloc(p, size, false); +} -void *gmallocn(int nObjs, int objSize) GMEM_EXCEP { +void *gmallocn(int nObjs, int objSize, bool exit_on_error) GMEM_EXCEP { int n; if (nObjs == 0) { @@ -198,13 +232,22 @@ throw GMemException(); #else fprintf(stderr, "Bogus memory allocation size\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } return gmalloc(n); } +void *gmallocn(int nObjs, int objSize) GMEM_EXCEP { + return gmallocn(nObjs, objSize, true); +} +void *gmallocn_noexit(int nObjs, int objSize) GMEM_EXCEP { + return gmallocn(nObjs, objSize, false); +} -void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP { +void *greallocn(void *p, int nObjs, int objSize, bool exit_on_error) GMEM_EXCEP { int n; if (nObjs == 0) { @@ -219,11 +262,20 @@ throw GMemException(); #else fprintf(stderr, "Bogus memory allocation size\n"); - exit(1); + if(exit_on_error) + exit(1); + else + return NULL; #endif } return grealloc(p, n); } +void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP { + return greallocn(p, nObjs, objSize, true); +} +void *greallocn_noexit(void *p, int nObjs, int objSize) GMEM_EXCEP { + return greallocn(p, nObjs, objSize, false); +} void gfree(void *p) { #ifdef DEBUG_MEM diff -Nru swftools-0.9.0/lib/pdf/xpdf/gmem.h swftools-0.9.2/lib/pdf/xpdf/gmem.h --- swftools-0.9.0/lib/pdf/xpdf/gmem.h 2007-02-27 22:05:51.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/gmem.h 2012-04-08 17:26:34.000000000 +0000 @@ -37,12 +37,14 @@ * returns NULL. */ extern void *gmalloc(int size) GMEM_EXCEP; +extern void *gmalloc_noexit(int size) GMEM_EXCEP; /* * Same as realloc, but prints error message and exits if realloc() * returns NULL. If

is NULL, calls malloc instead of realloc(). */ extern void *grealloc(void *p, int size) GMEM_EXCEP; +extern void *grealloc_noexit(void *p, int size) GMEM_EXCEP; /* * These are similar to gmalloc and grealloc, but take an object count @@ -52,6 +54,8 @@ */ extern void *gmallocn(int nObjs, int objSize) GMEM_EXCEP; extern void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP; +extern void *gmallocn_noexit(int nObjs, int objSize) GMEM_EXCEP; +extern void *greallocn_noexit(void *p, int nObjs, int objSize) GMEM_EXCEP; /* * Same as free, but checks for and ignores NULL pointers. diff -Nru swftools-0.9.0/lib/pdf/xpdf/JBIG2Stream.cc swftools-0.9.2/lib/pdf/xpdf/JBIG2Stream.cc --- swftools-0.9.0/lib/pdf/xpdf/JBIG2Stream.cc 2009-04-17 15:57:08.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/JBIG2Stream.cc 2012-04-08 17:26:34.000000000 +0000 @@ -6,7 +6,24 @@ // //======================================================================== -#include +//======================================================================== +// +// Modified under the Poppler project - http://poppler.freedesktop.org +// +// All changes made under the Poppler project to this file are licensed +// under GPL version 2 or later +// +// Copyright (C) 2006 Raj Kumar +// Copyright (C) 2006 Paul Walmsley +// Copyright (C) 2006-2009 Albert Astals Cid +// Copyright (C) 2009 David Benjamin +// +// To see a description of the changes please see the Changelog file that +// came with your tarball or type make ChangeLog if you are building from git +// +//======================================================================== + +#include #ifdef USE_GCC_PRAGMAS #pragma implementation @@ -24,8 +41,8 @@ //------------------------------------------------------------------------ -static int contextSize[4] = { 16, 13, 10, 10 }; -static int refContextSize[2] = { 13, 10 }; +static const int contextSize[4] = { 16, 13, 10, 10 }; +static const int refContextSize[2] = { 13, 10 }; //------------------------------------------------------------------------ // JBIG2HuffmanTable @@ -42,7 +59,7 @@ Guint prefix; }; -JBIG2HuffmanTable huffTableA[] = { +static JBIG2HuffmanTable huffTableA[] = { { 0, 1, 4, 0x000 }, { 16, 2, 8, 0x002 }, { 272, 3, 16, 0x006 }, @@ -50,7 +67,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableB[] = { +static JBIG2HuffmanTable huffTableB[] = { { 0, 1, 0, 0x000 }, { 1, 2, 0, 0x002 }, { 2, 3, 0, 0x006 }, @@ -61,7 +78,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableC[] = { +static JBIG2HuffmanTable huffTableC[] = { { 0, 1, 0, 0x000 }, { 1, 2, 0, 0x002 }, { 2, 3, 0, 0x006 }, @@ -74,7 +91,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableD[] = { +static JBIG2HuffmanTable huffTableD[] = { { 1, 1, 0, 0x000 }, { 2, 2, 0, 0x002 }, { 3, 3, 0, 0x006 }, @@ -84,7 +101,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableE[] = { +static JBIG2HuffmanTable huffTableE[] = { { 1, 1, 0, 0x000 }, { 2, 2, 0, 0x002 }, { 3, 3, 0, 0x006 }, @@ -96,7 +113,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableF[] = { +static JBIG2HuffmanTable huffTableF[] = { { 0, 2, 7, 0x000 }, { 128, 3, 7, 0x002 }, { 256, 3, 8, 0x003 }, @@ -114,7 +131,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableG[] = { +static JBIG2HuffmanTable huffTableG[] = { { -512, 3, 8, 0x000 }, { 256, 3, 8, 0x001 }, { 512, 3, 9, 0x002 }, @@ -133,7 +150,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableH[] = { +static JBIG2HuffmanTable huffTableH[] = { { 0, 2, 1, 0x000 }, { 0, 2, jbig2HuffmanOOB, 0x001 }, { 4, 3, 4, 0x004 }, @@ -158,7 +175,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableI[] = { +static JBIG2HuffmanTable huffTableI[] = { { 0, 2, jbig2HuffmanOOB, 0x000 }, { -1, 3, 1, 0x002 }, { 1, 3, 1, 0x003 }, @@ -184,7 +201,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableJ[] = { +static JBIG2HuffmanTable huffTableJ[] = { { -2, 2, 2, 0x000 }, { 6, 2, 6, 0x001 }, { 0, 2, jbig2HuffmanOOB, 0x002 }, @@ -209,7 +226,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableK[] = { +static JBIG2HuffmanTable huffTableK[] = { { 1, 1, 0, 0x000 }, { 2, 2, 1, 0x002 }, { 4, 4, 0, 0x00c }, @@ -226,7 +243,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableL[] = { +static JBIG2HuffmanTable huffTableL[] = { { 1, 1, 0, 0x000 }, { 2, 2, 0, 0x002 }, { 3, 3, 1, 0x006 }, @@ -243,7 +260,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableM[] = { +static JBIG2HuffmanTable huffTableM[] = { { 1, 1, 0, 0x000 }, { 2, 3, 0, 0x004 }, { 7, 3, 3, 0x005 }, @@ -260,7 +277,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableN[] = { +static JBIG2HuffmanTable huffTableN[] = { { 0, 1, 0, 0x000 }, { -2, 3, 0, 0x004 }, { -1, 3, 0, 0x005 }, @@ -269,7 +286,7 @@ { 0, 0, jbig2HuffmanEOT, 0 } }; -JBIG2HuffmanTable huffTableO[] = { +static JBIG2HuffmanTable huffTableO[] = { { 0, 1, 0, 0x000 }, { -1, 3, 0, 0x004 }, { 1, 3, 0, 0x005 }, @@ -473,7 +490,7 @@ } int JBIG2MMRDecoder::get2DCode() { - CCITTCode *p; + const CCITTCode *p; if (bufLen == 0) { buf = str->getChar() & 0xff; @@ -500,7 +517,7 @@ } int JBIG2MMRDecoder::getWhiteCode() { - CCITTCode *p; + const CCITTCode *p; Guint code; if (bufLen == 0) { @@ -543,7 +560,7 @@ } int JBIG2MMRDecoder::getBlackCode() { - CCITTCode *p; + const CCITTCode *p; Guint code; if (bufLen == 0) { @@ -670,6 +687,7 @@ void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp); Guchar *getDataPtr() { return data; } int getDataSize() { return h * line; } + GBool isOk() { return data != NULL; } private: @@ -685,10 +703,11 @@ w = wA; h = hA; line = (wA + 7) >> 3; + if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) { - // force a call to gmalloc(-1), which will throw an exception - h = -1; - line = 2; + error(-1, "invalid width/height"); + data = NULL; + return; } // need to allocate one extra guard byte for use in combine() data = (Guchar *)gmalloc(h * line + 1); @@ -701,10 +720,11 @@ w = bitmap->w; h = bitmap->h; line = bitmap->line; + if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) { - // force a call to gmalloc(-1), which will throw an exception - h = -1; - line = 2; + error(-1, "invalid width/height"); + data = NULL; + return; } // need to allocate one extra guard byte for use in combine() data = (Guchar *)gmalloc(h * line + 1); @@ -735,6 +755,9 @@ void JBIG2Bitmap::expand(int newH, Guint pixel) { if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) { + error(-1, "invalid width/height"); + gfree(data); + data = NULL; return; } // need to allocate one extra guard byte for use in combine() @@ -1002,6 +1025,7 @@ Guint getSize() { return size; } void setBitmap(Guint idx, JBIG2Bitmap *bitmap) { bitmaps[idx] = bitmap; } JBIG2Bitmap *getBitmap(Guint idx) { return bitmaps[idx]; } + GBool isOk() { return bitmaps != NULL; } void setGenericRegionStats(JArithmeticDecoderStats *stats) { genericRegionStats = stats; } void setRefinementRegionStats(JArithmeticDecoderStats *stats) @@ -1022,13 +1046,9 @@ JBIG2SymbolDict::JBIG2SymbolDict(Guint segNumA, Guint sizeA): JBIG2Segment(segNumA) { - Guint i; - size = sizeA; bitmaps = (JBIG2Bitmap **)gmallocn(size, sizeof(JBIG2Bitmap *)); - for (i = 0; i < size; ++i) { - bitmaps[i] = NULL; - } + if (!bitmaps) size = 0; genericRegionStats = NULL; refinementRegionStats = NULL; } @@ -1037,9 +1057,7 @@ Guint i; for (i = 0; i < size; ++i) { - if (bitmaps[i]) { - delete bitmaps[i]; - } + delete bitmaps[i]; } gfree(bitmaps); if (genericRegionStats) { @@ -1247,6 +1265,7 @@ Guint segNum, segFlags, segType, page, segLength; Guint refFlags, nRefSegs; Guint *refSegs; + int segDataPos; int c1, c2, c3; Guint i; @@ -1314,6 +1333,9 @@ goto eofError2; } + // keep track of the start of the segment data + segDataPos = getPos(); + // check for missing page information segment if (!pageBitmap && ((segType >= 4 && segType <= 7) || (segType >= 20 && segType <= 43))) { @@ -1398,6 +1420,45 @@ break; } + // Make sure the segment handler read all of the bytes in the + // segment data, unless this segment is marked as having an + // unknown length (section 7.2.7 of the JBIG2 Final Committee Draft) + + if (segLength != 0xffffffff) { + + int segExtraBytes = segDataPos + segLength - getPos(); + if (segExtraBytes > 0) { + + // If we didn't read all of the bytes in the segment data, + // indicate an error, and throw away the rest of the data. + + // v.3.1.01.13 of the LuraTech PDF Compressor Server will + // sometimes generate an extraneous NULL byte at the end of + // arithmetic-coded symbol dictionary segments when numNewSyms + // == 0. Segments like this often occur for blank pages. + + error(getPos(), "%d extraneous byte%s after segment", + segExtraBytes, (segExtraBytes > 1) ? "s" : ""); + + // Burn through the remaining bytes -- inefficient, but + // hopefully we're not doing this much + + int trash; + for (int i = segExtraBytes; i > 0; i--) { + readByte(&trash); + } + + } else if (segExtraBytes < 0) { + + // If we read more bytes than we should have, according to the + // segment length field, note an error. + + error(getPos(), "Previous segment handler read too many bytes"); + + } + + } + gfree(refSegs); } @@ -1493,6 +1554,9 @@ codeTables = new GList(); numInputSyms = 0; for (i = 0; i < nRefSegs; ++i) { + // This is need by bug 12014, returning gFalse makes it not crash + // but we end up with a empty page while acroread is able to render + // part of it if ((seg = findSegment(refSegs[i]))) { if (seg->getType() == jbig2SegSymbolDict) { j = ((JBIG2SymbolDict *)seg)->getSize(); @@ -1503,8 +1567,11 @@ } numInputSyms += j; } else if (seg->getType() == jbig2SegCodeTable) { - codeTables->append(seg); + codeTables->append(seg); } + } else { + delete codeTables; + return gFalse; } } if (numInputSyms > UINT_MAX - numNewSyms) { @@ -1514,11 +1581,14 @@ } // compute symbol code length - symCodeLen = 1; - i = (numInputSyms + numNewSyms) >> 1; - while (i) { - ++symCodeLen; - i >>= 1; + symCodeLen = 0; + i = 1; + while (i < numInputSyms + numNewSyms) { + ++symCodeLen; + i <<= 1; + } + if (huff && symCodeLen == 0) { + symCodeLen = 1; } // get the input symbol bitmaps @@ -1530,12 +1600,11 @@ k = 0; inputSymbolDict = NULL; for (i = 0; i < nRefSegs; ++i) { - if ((seg = findSegment(refSegs[i]))) { - if (seg->getType() == jbig2SegSymbolDict) { - inputSymbolDict = (JBIG2SymbolDict *)seg; - for (j = 0; j < inputSymbolDict->getSize(); ++j) { - bitmaps[k++] = inputSymbolDict->getBitmap(j); - } + seg = findSegment(refSegs[i]); + if (seg != NULL && seg->getType() == jbig2SegSymbolDict) { + inputSymbolDict = (JBIG2SymbolDict *)seg; + for (j = 0; j < inputSymbolDict->getSize(); ++j) { + bitmaps[k++] = inputSymbolDict->getBitmap(j); } } } @@ -1753,6 +1822,10 @@ // create the symbol dict object symbolDict = new JBIG2SymbolDict(segNum, numExSyms); + if (!symbolDict->isOk()) { + delete symbolDict; + goto syntaxError; + } // exported symbol list i = j = 0; @@ -1766,6 +1839,7 @@ if (i + run > numInputSyms + numNewSyms || (ex && j + run > numExSyms)) { error(getPos(), "Too many exported symbols in JBIG2 symbol dictionary"); + for ( ; j < numExSyms; ++j) symbolDict->setBitmap(j, NULL); delete symbolDict; goto syntaxError; } @@ -1780,6 +1854,7 @@ } if (j != numExSyms) { error(getPos(), "Too few symbols in JBIG2 symbol dictionary"); + for ( ; j < numExSyms; ++j) symbolDict->setBitmap(j, NULL); delete symbolDict; goto syntaxError; } @@ -1921,6 +1996,9 @@ ++symCodeLen; i <<= 1; } + if (huff && symCodeLen == 0) { + symCodeLen = 1; + } // get the symbol bitmaps syms = (JBIG2Bitmap **)gmallocn(numSyms, sizeof(JBIG2Bitmap *)); @@ -2095,18 +2173,20 @@ gfree(syms); - // combine the region bitmap into the page bitmap - if (imm) { - if (pageH == 0xffffffff && y + h > curPageH) { - pageBitmap->expand(y + h, pageDefPixel); - } - pageBitmap->combine(bitmap, x, y, extCombOp); - delete bitmap; + if (bitmap) { + // combine the region bitmap into the page bitmap + if (imm) { + if (pageH == 0xffffffff && y + h > curPageH) { + pageBitmap->expand(y + h, pageDefPixel); + } + pageBitmap->combine(bitmap, x, y, extCombOp); + delete bitmap; - // store the region bitmap - } else { - bitmap->setSegNum(segNum); - segments->append(bitmap); + // store the region bitmap + } else { + bitmap->setSegNum(segNum); + segments->append(bitmap); + } } // clean up the Huffman decoder @@ -2159,6 +2239,10 @@ // allocate the bitmap bitmap = new JBIG2Bitmap(0, w, h); + if (!bitmap->isOk()) { + delete bitmap; + return NULL; + } if (defPixel) { bitmap->clearToOne(); } else { @@ -2235,73 +2319,84 @@ ri = 0; } if (ri) { + GBool decodeSuccess; if (huff) { - huffDecoder->decodeInt(&rdw, huffRDWTable); - huffDecoder->decodeInt(&rdh, huffRDHTable); - huffDecoder->decodeInt(&rdx, huffRDXTable); - huffDecoder->decodeInt(&rdy, huffRDYTable); - huffDecoder->decodeInt(&bmSize, huffRSizeTable); + decodeSuccess = huffDecoder->decodeInt(&rdw, huffRDWTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdh, huffRDHTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdx, huffRDXTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdy, huffRDYTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&bmSize, huffRSizeTable); huffDecoder->reset(); arithDecoder->start(); } else { - arithDecoder->decodeInt(&rdw, iardwStats); - arithDecoder->decodeInt(&rdh, iardhStats); - arithDecoder->decodeInt(&rdx, iardxStats); - arithDecoder->decodeInt(&rdy, iardyStats); + decodeSuccess = arithDecoder->decodeInt(&rdw, iardwStats); + decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdh, iardhStats); + decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdx, iardxStats); + decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdy, iardyStats); + } + + if (decodeSuccess && syms[symID]) + { + refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx; + refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy; + + symbolBitmap = + readGenericRefinementRegion(rdw + syms[symID]->getWidth(), + rdh + syms[symID]->getHeight(), + templ, gFalse, syms[symID], + refDX, refDY, atx, aty); } - refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx; - refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy; - - symbolBitmap = - readGenericRefinementRegion(rdw + syms[symID]->getWidth(), - rdh + syms[symID]->getHeight(), - templ, gFalse, syms[symID], - refDX, refDY, atx, aty); //~ do we need to use the bmSize value here (in Huffman mode)? } else { symbolBitmap = syms[symID]; } - // combine the symbol bitmap into the region bitmap - //~ something is wrong here - refCorner shouldn't degenerate into - //~ two cases - bw = symbolBitmap->getWidth() - 1; - bh = symbolBitmap->getHeight() - 1; - if (transposed) { - switch (refCorner) { - case 0: // bottom left - bitmap->combine(symbolBitmap, tt, s, combOp); - break; - case 1: // top left - bitmap->combine(symbolBitmap, tt, s, combOp); - break; - case 2: // bottom right - bitmap->combine(symbolBitmap, tt - bw, s, combOp); - break; - case 3: // top right - bitmap->combine(symbolBitmap, tt - bw, s, combOp); - break; + if (symbolBitmap) { + // combine the symbol bitmap into the region bitmap + //~ something is wrong here - refCorner shouldn't degenerate into + //~ two cases + bw = symbolBitmap->getWidth() - 1; + bh = symbolBitmap->getHeight() - 1; + if (transposed) { + switch (refCorner) { + case 0: // bottom left + bitmap->combine(symbolBitmap, tt, s, combOp); + break; + case 1: // top left + bitmap->combine(symbolBitmap, tt, s, combOp); + break; + case 2: // bottom right + bitmap->combine(symbolBitmap, tt - bw, s, combOp); + break; + case 3: // top right + bitmap->combine(symbolBitmap, tt - bw, s, combOp); + break; + } + s += bh; + } else { + switch (refCorner) { + case 0: // bottom left + bitmap->combine(symbolBitmap, s, tt - bh, combOp); + break; + case 1: // top left + bitmap->combine(symbolBitmap, s, tt, combOp); + break; + case 2: // bottom right + bitmap->combine(symbolBitmap, s, tt - bh, combOp); + break; + case 3: // top right + bitmap->combine(symbolBitmap, s, tt, combOp); + break; + } + s += bw; } - s += bh; - } else { - switch (refCorner) { - case 0: // bottom left - bitmap->combine(symbolBitmap, s, tt - bh, combOp); - break; - case 1: // top left - bitmap->combine(symbolBitmap, s, tt, combOp); - break; - case 2: // bottom right - bitmap->combine(symbolBitmap, s, tt - bh, combOp); - break; - case 3: // top right - bitmap->combine(symbolBitmap, s, tt, combOp); - break; + if (ri) { + delete symbolBitmap; } - s += bw; - } - if (ri) { - delete symbolBitmap; + } else { + // NULL symbolBitmap only happens on error + delete bitmap; + return NULL; } } @@ -2431,11 +2526,12 @@ error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment"); return; } - if (!(seg = findSegment(refSegs[0])) || - seg->getType() != jbig2SegPatternDict) { + seg = findSegment(refSegs[0]); + if (seg == NULL || seg->getType() != jbig2SegPatternDict) { error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment"); return; } + patternDict = (JBIG2PatternDict *)seg; bpp = 0; i = 1; @@ -2591,6 +2687,8 @@ // read the bitmap bitmap = readGenericBitmap(mmr, w, h, templ, tpgdOn, gFalse, NULL, atx, aty, mmr ? length - 18 : 0); + if (!bitmap) + return; // combine the region bitmap into the page bitmap if (imm) { @@ -2616,7 +2714,7 @@ int *codingLine, int *a0i, int w) { if (a1 > codingLine[*a0i]) { if (a1 > w) { - error(getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1); + error(getPos(), "JBIG2 MMR row is wrong length (%d)", a1); a1 = w; } if ((*a0i & 1) ^ blackPixels) { @@ -2630,7 +2728,7 @@ int *codingLine, int *a0i, int w) { if (a1 > codingLine[*a0i]) { if (a1 > w) { - error(getPos(), "JBIG2 MMR row is wrong length ({0:d})", a1); + error(getPos(), "JBIG2 MMR row is wrong length (%d)", a1); a1 = w; } if ((*a0i & 1) ^ blackPixels) { @@ -2657,13 +2755,17 @@ JBIG2Bitmap *bitmap; GBool ltp; Guint ltpCX, cx, cx0, cx1, cx2; - JBIG2BitmapPtr cxPtr0, cxPtr1; - JBIG2BitmapPtr atPtr0, atPtr1, atPtr2, atPtr3; + JBIG2BitmapPtr cxPtr0 = {0}, cxPtr1 = {0}; + JBIG2BitmapPtr atPtr0 = {0}, atPtr1 = {0}, atPtr2 = {0}, atPtr3 = {0}; int *refLine, *codingLine; int code1, code2, code3; int x, y, a0i, b1i, blackPixels, pix, i; bitmap = new JBIG2Bitmap(0, w, h); + if (!bitmap->isOk()) { + delete bitmap; + return NULL; + } bitmap->clearToZero(); //----- MMR decode @@ -2682,7 +2784,7 @@ // ---> max refLine size = w + 2 codingLine = (int *)gmallocn(w + 1, sizeof(int)); refLine = (int *)gmallocn(w + 2, sizeof(int)); - codingLine[0] = w; + for (i = 0; i < w + 1; ++i) codingLine[i] = w; for (y = 0; y < h; ++y) { @@ -3093,8 +3195,8 @@ return; } if (nRefSegs == 1) { - if (!(seg = findSegment(refSegs[0])) || - seg->getType() != jbig2SegBitmap) { + seg = findSegment(refSegs[0]); + if (seg == NULL || seg->getType() != jbig2SegBitmap) { error(getPos(), "Bad bitmap reference in JBIG2 generic refinement segment"); return; } @@ -3143,11 +3245,24 @@ JBIG2Bitmap *bitmap; GBool ltp; Guint ltpCX, cx, cx0, cx2, cx3, cx4, tpgrCX0, tpgrCX1, tpgrCX2; - JBIG2BitmapPtr cxPtr0, cxPtr1, cxPtr2, cxPtr3, cxPtr4, cxPtr5, cxPtr6; - JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2; + JBIG2BitmapPtr cxPtr0 = {0}; + JBIG2BitmapPtr cxPtr1 = {0}; + JBIG2BitmapPtr cxPtr2 = {0}; + JBIG2BitmapPtr cxPtr3 = {0}; + JBIG2BitmapPtr cxPtr4 = {0}; + JBIG2BitmapPtr cxPtr5 = {0}; + JBIG2BitmapPtr cxPtr6 = {0}; + JBIG2BitmapPtr tpgrCXPtr0 = {0}; + JBIG2BitmapPtr tpgrCXPtr1 = {0}; + JBIG2BitmapPtr tpgrCXPtr2 = {0}; int x, y, pix; bitmap = new JBIG2Bitmap(0, w, h); + if (!bitmap->isOk()) + { + delete bitmap; + return NULL; + } bitmap->clearToZero(); // set up the typical row context @@ -3332,6 +3447,12 @@ } pageBitmap = new JBIG2Bitmap(0, pageW, curPageH); + if (!pageBitmap->isOk()) { + delete pageBitmap; + pageBitmap = NULL; + return; + } + // default pixel value if (pageDefPixel) { pageBitmap->clearToOne(); diff -Nru swftools-0.9.0/lib/pdf/xpdf/JPXStream.cc swftools-0.9.2/lib/pdf/xpdf/JPXStream.cc --- swftools-0.9.0/lib/pdf/xpdf/JPXStream.cc 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/JPXStream.cc 2012-04-08 17:26:34.000000000 +0000 @@ -241,6 +241,12 @@ haveCompMap = gFalse; haveChannelDefn = gFalse; + img.xSize = 0; + img.ySize = 0; + img.xOffset = 0; + img.yOffset = 0; + curX = 0; + curY = 0; img.tiles = NULL; bitBuf = 0; bitBufLen = 0; @@ -450,6 +456,7 @@ GBool haveBPC, haveCSMode; csPrec = 0; // make gcc happy + Guint num_components = 0; haveBPC = haveCSMode = gFalse; str->reset(); if (str->lookChar() == 0xff) { @@ -463,7 +470,7 @@ cover(1); if (readULong(&dummy) && readULong(&dummy) && - readUWord(&dummy) && + readUWord(&num_components) && readUByte(&bpc1) && readUByte(&dummy) && readUByte(&dummy) && @@ -519,6 +526,9 @@ } } } + if(*csMode == streamCSDeviceRGB && num_components == 4) { + *csMode = streamCSDeviceRGBX; + } str->close(); } diff -Nru swftools-0.9.0/lib/pdf/xpdf/OutputDev.h swftools-0.9.2/lib/pdf/xpdf/OutputDev.h --- swftools-0.9.0/lib/pdf/xpdf/OutputDev.h 2009-04-17 15:57:12.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/OutputDev.h 2012-04-08 17:26:34.000000000 +0000 @@ -95,7 +95,7 @@ { return gTrue; } // Start a page. - virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {} + virtual void startPage(int pageNum, GfxState *state) {} // End a page. virtual void endPage() {} diff -Nru swftools-0.9.0/lib/pdf/xpdf/SplashFont.cc swftools-0.9.2/lib/pdf/xpdf/SplashFont.cc --- swftools-0.9.0/lib/pdf/xpdf/SplashFont.cc 2009-04-17 15:57:12.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/SplashFont.cc 2012-04-08 17:26:34.000000000 +0000 @@ -78,11 +78,15 @@ } else { cacheSets = 1; } - cache = (Guchar *)gmallocn(cacheSets * cacheAssoc, glyphSize); - cacheTags = (SplashFontCacheTag *)gmallocn(cacheSets * cacheAssoc, - sizeof(SplashFontCacheTag)); - for (i = 0; i < cacheSets * cacheAssoc; ++i) { - cacheTags[i].mru = i & (cacheAssoc - 1); + cache = (Guchar *)gmallocn_noexit(cacheSets * cacheAssoc, glyphSize); + if(cache) { + cacheTags = (SplashFontCacheTag *)gmallocn(cacheSets * cacheAssoc, + sizeof(SplashFontCacheTag)); + for (i = 0; i < cacheSets * cacheAssoc; ++i) { + cacheTags[i].mru = i & (cacheAssoc - 1); + } + } else { + cacheAssoc = 0; } } diff -Nru swftools-0.9.0/lib/pdf/xpdf/SplashFTFont.cc swftools-0.9.2/lib/pdf/xpdf/SplashFTFont.cc --- swftools-0.9.0/lib/pdf/xpdf/SplashFTFont.cc 2009-04-17 15:57:12.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/SplashFTFont.cc 2012-04-08 17:26:34.000000000 +0000 @@ -276,9 +276,11 @@ return NULL; } int error = 0; - if ((error=FT_Load_Glyph(ff->face, gid, FT_LOAD_NO_BITMAP|FT_LOAD_NO_HINTING))) { + if ((error=FT_Load_Glyph(ff->face, gid, FT_LOAD_NO_BITMAP))) { + if ((error=FT_Load_Glyph(ff->face, gid, FT_LOAD_NO_BITMAP|FT_LOAD_NO_HINTING))) { fprintf(stderr, "Truetype wasn't able to load glyph %d, error %d\n", gid, error); - return NULL; + return NULL; + } } if (FT_Get_Glyph(slot, &glyph)) { return NULL; diff -Nru swftools-0.9.0/lib/pdf/xpdf/SplashOutputDev.cc swftools-0.9.2/lib/pdf/xpdf/SplashOutputDev.cc --- swftools-0.9.0/lib/pdf/xpdf/SplashOutputDev.cc 2009-04-17 15:57:11.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/SplashOutputDev.cc 2012-04-08 17:26:34.000000000 +0000 @@ -703,7 +703,7 @@ nT3Fonts = 0; } -void SplashOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) { +void SplashOutputDev::startPage(int pageNum, GfxState *state) { int w, h; double *ctm; SplashCoord mat[6]; @@ -2647,9 +2647,9 @@ softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse); - memset(softMask->getDataPtr(), 0, - softMask->getRowSize() * softMask->getHeight()); + memset(softMask->getDataPtr(), 0x00, softMask->getRowSize()*softMask->getHeight()); p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx; + if (txgetWidth() && tygetHeight()) for (y = 0; y < tBitmap->getHeight(); ++y) { for (x = 0; x < tBitmap->getWidth(); ++x) { tBitmap->getPixel(x, y, color); diff -Nru swftools-0.9.0/lib/pdf/xpdf/SplashOutputDev.h swftools-0.9.2/lib/pdf/xpdf/SplashOutputDev.h --- swftools-0.9.0/lib/pdf/xpdf/SplashOutputDev.h 2009-04-17 15:57:12.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/SplashOutputDev.h 2012-04-08 17:26:34.000000000 +0000 @@ -70,7 +70,7 @@ //----- initialization and control // Start a page. - virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2); + virtual void startPage(int pageNum, GfxState *state); // End a page. virtual void endPage(); @@ -197,6 +197,7 @@ #endif void doUpdateFont(GfxState *state); + GBool needFontUpdate; // set when the font needs to be updated SplashPath *convertPath(GfxState *state, GfxPath *path); private: @@ -238,7 +239,6 @@ T3GlyphStack *t3GlyphStack; // Type 3 glyph context stack SplashFont *font; // current font - GBool needFontUpdate; // set when the font needs to be updated SplashPath *textClipPath; // clipping path built with text object SplashTransparencyGroup * // transparency group stack diff -Nru swftools-0.9.0/lib/pdf/xpdf/SplashXPathScanner.cc swftools-0.9.2/lib/pdf/xpdf/SplashXPathScanner.cc --- swftools-0.9.0/lib/pdf/xpdf/SplashXPathScanner.cc 2007-02-27 22:05:52.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/SplashXPathScanner.cc 2012-04-08 17:26:34.000000000 +0000 @@ -394,10 +394,10 @@ *p++ &= mask; xx = (xx & ~7) + 8; } - for (; xx + 7 <= xx0; xx += 8) { + for (; xx + 7 < xx0; xx += 8) { *p++ = 0x00; } - if (xx <= xx0) { + if (xx < xx0) { *p &= 0xff >> (xx0 & 7); } } @@ -417,10 +417,10 @@ *p++ &= mask; xx = (xx & ~7) + 8; } - for (; xx + 7 <= xx0; xx += 8) { + for (; xx + 7 < xx0; xx += 8) { *p++ = 0x00; } - if (xx <= xx0) { + if (xx < xx0) { *p &= 0xff >> (xx0 & 7); } } diff -Nru swftools-0.9.0/lib/pdf/xpdf/Stream.cc swftools-0.9.2/lib/pdf/xpdf/Stream.cc --- swftools-0.9.0/lib/pdf/xpdf/Stream.cc 2009-04-17 15:57:11.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/Stream.cc 2012-04-19 11:31:50.000000000 +0000 @@ -19,7 +19,7 @@ #ifndef WIN32 #include #else -extern "C" int unlink(char *filename); +//extern "C" int unlink(char *filename); #endif #include #include @@ -2458,6 +2458,9 @@ // check for an EOB run if (eobRun > 0) { while (i <= scanInfo.lastCoeff) { + if(i>=64) { + return gFalse; + } j = dctZigZag[i++]; if (data[j] != 0) { if ((bit = readBit()) == EOF) { @@ -2482,6 +2485,9 @@ if (c == 0xf0) { k = 0; while (k < 16) { + if(i>=64) { + return gFalse; + } j = dctZigZag[i++]; if (data[j] == 0) { ++k; @@ -2507,6 +2513,9 @@ } eobRun += 1 << j; while (i <= scanInfo.lastCoeff) { + if(i>=64) { + return gFalse; + } j = dctZigZag[i++]; if (data[j] != 0) { if ((bit = readBit()) == EOF) { @@ -2529,6 +2538,9 @@ } k = 0; do { + if(i>=64) { + return gFalse; + } j = dctZigZag[i++]; while (data[j] != 0) { if ((bit = readBit()) == EOF) { @@ -2537,6 +2549,9 @@ if (bit) { data[j] += 1 << scanInfo.al; } + if(i>=64) { + return gFalse; + } j = dctZigZag[i++]; } ++k; diff -Nru swftools-0.9.0/lib/pdf/xpdf/Stream.h swftools-0.9.2/lib/pdf/xpdf/Stream.h --- swftools-0.9.0/lib/pdf/xpdf/Stream.h 2009-04-17 15:57:08.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/Stream.h 2012-04-08 17:26:34.000000000 +0000 @@ -41,7 +41,8 @@ streamCSNone, streamCSDeviceGray, streamCSDeviceRGB, - streamCSDeviceCMYK + streamCSDeviceCMYK, + streamCSDeviceRGBX }; //------------------------------------------------------------------------ diff -Nru swftools-0.9.0/lib/pdf/xpdf/TextOutputDev.cc swftools-0.9.2/lib/pdf/xpdf/TextOutputDev.cc --- swftools-0.9.0/lib/pdf/xpdf/TextOutputDev.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/TextOutputDev.cc 2012-04-08 17:26:34.000000000 +0000 @@ -0,0 +1,4090 @@ +//======================================================================== +// +// TextOutputDev.cc +// +// Copyright 1997-2003 Glyph & Cog, LLC +// +//======================================================================== + +#include + +#ifdef USE_GCC_PRAGMAS +#pragma implementation +#endif + +#include +#include +#include +#include +#include +#ifdef WIN32 +#include // for O_BINARY +#include // for setmode +#endif +#include "gmem.h" +#include "GString.h" +#include "GList.h" +#include "config.h" +#include "Error.h" +#include "GlobalParams.h" +#include "UnicodeMap.h" +#include "UnicodeTypeTable.h" +#include "GfxState.h" +#include "Link.h" +#include "TextOutputDev.h" + +#ifdef MACOS +// needed for setting type/creator of MacOS files +#include "ICSupport.h" +#endif + +//------------------------------------------------------------------------ +// parameters +//------------------------------------------------------------------------ + +// Each bucket in a text pool includes baselines within a range of +// this many points. +#define textPoolStep 4 + +// Inter-character space width which will cause addChar to start a new +// word. +#define minWordBreakSpace 0.1 + +// Negative inter-character space width, i.e., overlap, which will +// cause addChar to start a new word. +#define minDupBreakOverlap 0.2 + +// Max distance between baselines of two lines within a block, as a +// fraction of the font size. +#define maxLineSpacingDelta 1.5 + +// Max difference in primary font sizes on two lines in the same +// block. Delta1 is used when examining new lines above and below the +// current block; delta2 is used when examining text that overlaps the +// current block; delta3 is used when examining text to the left and +// right of the current block. +#define maxBlockFontSizeDelta1 0.05 +#define maxBlockFontSizeDelta2 0.6 +#define maxBlockFontSizeDelta3 0.2 + +// Max difference in font sizes inside a word. +#define maxWordFontSizeDelta 0.05 + +// Maximum distance between baselines of two words on the same line, +// e.g., distance between subscript or superscript and the primary +// baseline, as a fraction of the font size. +#define maxIntraLineDelta 0.5 + +// Minimum inter-word spacing, as a fraction of the font size. (Only +// used for raw ordering.) +#define minWordSpacing 0.15 + +// Maximum inter-word spacing, as a fraction of the font size. +#define maxWordSpacing 1.5 + +// Maximum horizontal spacing which will allow a word to be pulled +// into a block. +#define minColSpacing1 0.3 + +// Minimum spacing between columns, as a fraction of the font size. +#define minColSpacing2 1.0 + +// Maximum vertical spacing between blocks within a flow, as a +// multiple of the font size. +#define maxBlockSpacing 2.5 + +// Minimum spacing between characters within a word, as a fraction of +// the font size. +#define minCharSpacing -0.2 + +// Maximum spacing between characters within a word, as a fraction of +// the font size, when there is no obvious extra-wide character +// spacing. +#define maxCharSpacing 0.03 + +// When extra-wide character spacing is detected, the inter-character +// space threshold is set to the minimum inter-character space +// multiplied by this constant. +#define maxWideCharSpacingMul 1.3 + +// Upper limit on spacing between characters in a word. +#define maxWideCharSpacing 0.4 + +// Max difference in primary,secondary coordinates (as a fraction of +// the font size) allowed for duplicated text (fake boldface, drop +// shadows) which is to be discarded. +#define dupMaxPriDelta 0.1 +#define dupMaxSecDelta 0.2 + +// Max width of underlines (in points). +#define maxUnderlineWidth 3 + +// Min distance between baseline and underline (in points). +//~ this should be font-size-dependent +#define minUnderlineGap -2 + +// Max distance between baseline and underline (in points). +//~ this should be font-size-dependent +#define maxUnderlineGap 4 + +// Max horizontal distance between edge of word and start of underline +// (in points). +//~ this should be font-size-dependent +#define underlineSlack 1 + +// Max distance between edge of text and edge of link border +#define hyperlinkSlack 2 + +//------------------------------------------------------------------------ +// TextUnderline +//------------------------------------------------------------------------ + +class TextUnderline { +public: + + TextUnderline(double x0A, double y0A, double x1A, double y1A) + { x0 = x0A; y0 = y0A; x1 = x1A; y1 = y1A; horiz = y0 == y1; } + ~TextUnderline() {} + + double x0, y0, x1, y1; + GBool horiz; +}; + +//------------------------------------------------------------------------ +// TextLink +//------------------------------------------------------------------------ + +class TextLink { +public: + + TextLink(int xMinA, int yMinA, int xMaxA, int yMaxA, Link *linkA) + { xMin = xMinA; yMin = yMinA; xMax = xMaxA; yMax = yMaxA; link = linkA; } + ~TextLink() {} + + int xMin, yMin, xMax, yMax; + Link *link; +}; + +//------------------------------------------------------------------------ +// TextFontInfo +//------------------------------------------------------------------------ + +TextFontInfo::TextFontInfo(GfxState *state) { + gfxFont = state->getFont(); +#if TEXTOUT_WORD_LIST + fontName = (gfxFont && gfxFont->getOrigName()) + ? gfxFont->getOrigName()->copy() + : (GString *)NULL; + flags = gfxFont ? gfxFont->getFlags() : 0; +#endif +} + +TextFontInfo::~TextFontInfo() { +#if TEXTOUT_WORD_LIST + if (fontName) { + delete fontName; + } +#endif +} + +GBool TextFontInfo::matches(GfxState *state) { + return state->getFont() == gfxFont; +} + +//------------------------------------------------------------------------ +// TextWord +//------------------------------------------------------------------------ + +TextWord::TextWord(GfxState *state, int rotA, double x0, double y0, + int charPosA, TextFontInfo *fontA, double fontSizeA) { + GfxFont *gfxFont; + double x, y, ascent, descent; + + rot = rotA; + charPos = charPosA; + charLen = 0; + font = fontA; + fontSize = fontSizeA; + state->transform(x0, y0, &x, &y); + if ((gfxFont = font->gfxFont)) { + ascent = gfxFont->getAscent() * fontSize; + descent = gfxFont->getDescent() * fontSize; + } else { + // this means that the PDF file draws text without a current font, + // which should never happen + ascent = 0.95 * fontSize; + descent = -0.35 * fontSize; + } + switch (rot) { + case 0: + yMin = y - ascent; + yMax = y - descent; + if (yMin == yMax) { + // this is a sanity check for a case that shouldn't happen -- but + // if it does happen, we want to avoid dividing by zero later + yMin = y; + yMax = y + 1; + } + base = y; + break; + case 1: + xMin = x + descent; + xMax = x + ascent; + if (xMin == xMax) { + // this is a sanity check for a case that shouldn't happen -- but + // if it does happen, we want to avoid dividing by zero later + xMin = x; + xMax = x + 1; + } + base = x; + break; + case 2: + yMin = y + descent; + yMax = y + ascent; + if (yMin == yMax) { + // this is a sanity check for a case that shouldn't happen -- but + // if it does happen, we want to avoid dividing by zero later + yMin = y; + yMax = y + 1; + } + base = y; + break; + case 3: + xMin = x - ascent; + xMax = x - descent; + if (xMin == xMax) { + // this is a sanity check for a case that shouldn't happen -- but + // if it does happen, we want to avoid dividing by zero later + xMin = x; + xMax = x + 1; + } + base = x; + break; + } + text = NULL; + edge = NULL; + len = size = 0; + spaceAfter = gFalse; + next = NULL; + +#if TEXTOUT_WORD_LIST + GfxRGB rgb; + + if ((state->getRender() & 3) == 1) { + state->getStrokeRGB(&rgb); + } else { + state->getFillRGB(&rgb); + } + colorR = colToDbl(rgb.r); + colorG = colToDbl(rgb.g); + colorB = colToDbl(rgb.b); +#endif + + underlined = gFalse; + link = NULL; +} + +TextWord::~TextWord() { + gfree(text); + gfree(edge); +} + +void TextWord::addChar(GfxState *state, double x, double y, + double dx, double dy, Unicode u) { + if (len == size) { + size += 16; + text = (Unicode *)greallocn(text, size, sizeof(Unicode)); + edge = (double *)greallocn(edge, size + 1, sizeof(double)); + } + text[len] = u; + switch (rot) { + case 0: + if (len == 0) { + xMin = x; + } + edge[len] = x; + xMax = edge[len+1] = x + dx; + break; + case 1: + if (len == 0) { + yMin = y; + } + edge[len] = y; + yMax = edge[len+1] = y + dy; + break; + case 2: + if (len == 0) { + xMax = x; + } + edge[len] = x; + xMin = edge[len+1] = x + dx; + break; + case 3: + if (len == 0) { + yMax = y; + } + edge[len] = y; + yMin = edge[len+1] = y + dy; + break; + } + ++len; +} + +void TextWord::merge(TextWord *word) { + int i; + + if (word->xMin < xMin) { + xMin = word->xMin; + } + if (word->yMin < yMin) { + yMin = word->yMin; + } + if (word->xMax > xMax) { + xMax = word->xMax; + } + if (word->yMax > yMax) { + yMax = word->yMax; + } + if (len + word->len > size) { + size = len + word->len; + text = (Unicode *)greallocn(text, size, sizeof(Unicode)); + edge = (double *)greallocn(edge, size + 1, sizeof(double)); + } + for (i = 0; i < word->len; ++i) { + text[len + i] = word->text[i]; + edge[len + i] = word->edge[i]; + } + edge[len + word->len] = word->edge[word->len]; + len += word->len; + charLen += word->charLen; +} + +inline int TextWord::primaryCmp(TextWord *word) { + double cmp; + + cmp = 0; // make gcc happy + switch (rot) { + case 0: + cmp = xMin - word->xMin; + break; + case 1: + cmp = yMin - word->yMin; + break; + case 2: + cmp = word->xMax - xMax; + break; + case 3: + cmp = word->yMax - yMax; + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +double TextWord::primaryDelta(TextWord *word) { + double delta; + + delta = 0; // make gcc happy + switch (rot) { + case 0: + delta = word->xMin - xMax; + break; + case 1: + delta = word->yMin - yMax; + break; + case 2: + delta = xMin - word->xMax; + break; + case 3: + delta = yMin - word->yMax; + break; + } + return delta; +} + +int TextWord::cmpYX(const void *p1, const void *p2) { + TextWord *word1 = *(TextWord **)p1; + TextWord *word2 = *(TextWord **)p2; + double cmp; + + cmp = word1->yMin - word2->yMin; + if (cmp == 0) { + cmp = word1->xMin - word2->xMin; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +#if TEXTOUT_WORD_LIST + +GString *TextWord::getText() { + GString *s; + UnicodeMap *uMap; + char buf[8]; + int n, i; + + s = new GString(); + if (!(uMap = globalParams->getTextEncoding())) { + return s; + } + for (i = 0; i < len; ++i) { + n = uMap->mapUnicode(text[i], buf, sizeof(buf)); + s->append(buf, n); + } + uMap->decRefCnt(); + return s; +} + +void TextWord::getCharBBox(int charIdx, double *xMinA, double *yMinA, + double *xMaxA, double *yMaxA) { + if (charIdx < 0 || charIdx >= len) { + return; + } + switch (rot) { + case 0: + *xMinA = edge[charIdx]; + *xMaxA = edge[charIdx + 1]; + *yMinA = yMin; + *yMaxA = yMax; + break; + case 1: + *xMinA = xMin; + *xMaxA = xMax; + *yMinA = edge[charIdx]; + *yMaxA = edge[charIdx + 1]; + break; + case 2: + *xMinA = edge[charIdx + 1]; + *xMaxA = edge[charIdx]; + *yMinA = yMin; + *yMaxA = yMax; + break; + case 3: + *xMinA = xMin; + *xMaxA = xMax; + *yMinA = edge[charIdx + 1]; + *yMaxA = edge[charIdx]; + break; + } +} + +#endif // TEXTOUT_WORD_LIST + +//------------------------------------------------------------------------ +// TextPool +//------------------------------------------------------------------------ + +TextPool::TextPool() { + minBaseIdx = 0; + maxBaseIdx = -1; + pool = NULL; + cursor = NULL; + cursorBaseIdx = -1; +} + +TextPool::~TextPool() { + int baseIdx; + TextWord *word, *word2; + + for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) { + for (word = pool[baseIdx - minBaseIdx]; word; word = word2) { + word2 = word->next; + delete word; + } + } + gfree(pool); +} + +int TextPool::getBaseIdx(double base) { + int baseIdx; + + baseIdx = (int)(base / textPoolStep); + if (baseIdx < minBaseIdx) { + return minBaseIdx; + } + if (baseIdx > maxBaseIdx) { + return maxBaseIdx; + } + return baseIdx; +} + +void TextPool::addWord(TextWord *word) { + TextWord **newPool; + int wordBaseIdx, newMinBaseIdx, newMaxBaseIdx, baseIdx; + TextWord *w0, *w1; + + // expand the array if needed + wordBaseIdx = (int)(word->base / textPoolStep); + if (minBaseIdx > maxBaseIdx) { + minBaseIdx = wordBaseIdx - 128; + maxBaseIdx = wordBaseIdx + 128; + pool = (TextWord **)gmallocn(maxBaseIdx - minBaseIdx + 1, + sizeof(TextWord *)); + for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) { + pool[baseIdx - minBaseIdx] = NULL; + } + } else if (wordBaseIdx < minBaseIdx) { + newMinBaseIdx = wordBaseIdx - 128; + newPool = (TextWord **)gmallocn(maxBaseIdx - newMinBaseIdx + 1, + sizeof(TextWord *)); + for (baseIdx = newMinBaseIdx; baseIdx < minBaseIdx; ++baseIdx) { + newPool[baseIdx - newMinBaseIdx] = NULL; + } + memcpy(&newPool[minBaseIdx - newMinBaseIdx], pool, + (maxBaseIdx - minBaseIdx + 1) * sizeof(TextWord *)); + gfree(pool); + pool = newPool; + minBaseIdx = newMinBaseIdx; + } else if (wordBaseIdx > maxBaseIdx) { + newMaxBaseIdx = wordBaseIdx + 128; + pool = (TextWord **)greallocn(pool, newMaxBaseIdx - minBaseIdx + 1, + sizeof(TextWord *)); + for (baseIdx = maxBaseIdx + 1; baseIdx <= newMaxBaseIdx; ++baseIdx) { + pool[baseIdx - minBaseIdx] = NULL; + } + maxBaseIdx = newMaxBaseIdx; + } + + // insert the new word + if (cursor && wordBaseIdx == cursorBaseIdx && + word->primaryCmp(cursor) > 0) { + w0 = cursor; + w1 = cursor->next; + } else { + w0 = NULL; + w1 = pool[wordBaseIdx - minBaseIdx]; + } + for (; w1 && word->primaryCmp(w1) > 0; w0 = w1, w1 = w1->next) ; + word->next = w1; + if (w0) { + w0->next = word; + } else { + pool[wordBaseIdx - minBaseIdx] = word; + } + cursor = word; + cursorBaseIdx = wordBaseIdx; +} + +//------------------------------------------------------------------------ +// TextLine +//------------------------------------------------------------------------ + +TextLine::TextLine(TextBlock *blkA, int rotA, double baseA) { + blk = blkA; + rot = rotA; + xMin = yMin = 0; + xMax = yMax = -1; + base = baseA; + words = lastWord = NULL; + text = NULL; + edge = NULL; + col = NULL; + len = 0; + convertedLen = 0; + hyphenated = gFalse; + next = NULL; +} + +TextLine::~TextLine() { + TextWord *word; + + while (words) { + word = words; + words = words->next; + delete word; + } + gfree(text); + gfree(edge); + gfree(col); +} + +void TextLine::addWord(TextWord *word) { + if (lastWord) { + lastWord->next = word; + } else { + words = word; + } + lastWord = word; + + if (xMin > xMax) { + xMin = word->xMin; + xMax = word->xMax; + yMin = word->yMin; + yMax = word->yMax; + } else { + if (word->xMin < xMin) { + xMin = word->xMin; + } + if (word->xMax > xMax) { + xMax = word->xMax; + } + if (word->yMin < yMin) { + yMin = word->yMin; + } + if (word->yMax > yMax) { + yMax = word->yMax; + } + } +} + +double TextLine::primaryDelta(TextLine *line) { + double delta; + + delta = 0; // make gcc happy + switch (rot) { + case 0: + delta = line->xMin - xMax; + break; + case 1: + delta = line->yMin - yMax; + break; + case 2: + delta = xMin - line->xMax; + break; + case 3: + delta = yMin - line->yMax; + break; + } + return delta; +} + +int TextLine::primaryCmp(TextLine *line) { + double cmp; + + cmp = 0; // make gcc happy + switch (rot) { + case 0: + cmp = xMin - line->xMin; + break; + case 1: + cmp = yMin - line->yMin; + break; + case 2: + cmp = line->xMax - xMax; + break; + case 3: + cmp = line->yMax - yMax; + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextLine::secondaryCmp(TextLine *line) { + double cmp; + + cmp = (rot == 0 || rot == 3) ? base - line->base : line->base - base; + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextLine::cmpYX(TextLine *line) { + int cmp; + + if ((cmp = secondaryCmp(line))) { + return cmp; + } + return primaryCmp(line); +} + +int TextLine::cmpXY(const void *p1, const void *p2) { + TextLine *line1 = *(TextLine **)p1; + TextLine *line2 = *(TextLine **)p2; + int cmp; + + if ((cmp = line1->primaryCmp(line2))) { + return cmp; + } + return line1->secondaryCmp(line2); +} + +void TextLine::coalesce(UnicodeMap *uMap) { + TextWord *word0, *word1; + double space, delta, minSpace; + GBool isUnicode; + char buf[8]; + int i, j; + + if (words->next) { + + // compute the inter-word space threshold + if (words->len > 1 || words->next->len > 1) { + minSpace = 0; + } else { + minSpace = words->primaryDelta(words->next); + for (word0 = words->next, word1 = word0->next; + word1 && minSpace > 0; + word0 = word1, word1 = word0->next) { + if (word1->len > 1) { + minSpace = 0; + } + delta = word0->primaryDelta(word1); + if (delta < minSpace) { + minSpace = delta; + } + } + } + if (minSpace <= 0) { + space = maxCharSpacing * words->fontSize; + } else { + space = maxWideCharSpacingMul * minSpace; + if (space > maxWideCharSpacing * words->fontSize) { + space = maxWideCharSpacing * words->fontSize; + } + } + + // merge words + word0 = words; + word1 = words->next; + while (word1) { + if (word0->primaryDelta(word1) >= space) { + word0->spaceAfter = gTrue; + word0 = word1; + word1 = word1->next; + } else if (word0->font == word1->font && + word0->underlined == word1->underlined && + fabs(word0->fontSize - word1->fontSize) < + maxWordFontSizeDelta * words->fontSize && + word1->charPos == word0->charPos + word0->charLen) { + word0->merge(word1); + word0->next = word1->next; + delete word1; + word1 = word0->next; + } else { + word0 = word1; + word1 = word1->next; + } + } + } + + // build the line text + isUnicode = uMap ? uMap->isUnicode() : gFalse; + len = 0; + for (word1 = words; word1; word1 = word1->next) { + len += word1->len; + if (word1->spaceAfter) { + ++len; + } + } + text = (Unicode *)gmallocn(len, sizeof(Unicode)); + edge = (double *)gmallocn(len + 1, sizeof(double)); + i = 0; + for (word1 = words; word1; word1 = word1->next) { + for (j = 0; j < word1->len; ++j) { + text[i] = word1->text[j]; + edge[i] = word1->edge[j]; + ++i; + } + edge[i] = word1->edge[word1->len]; + if (word1->spaceAfter) { + text[i] = (Unicode)0x0020; + ++i; + } + } + + // compute convertedLen and set up the col array + col = (int *)gmallocn(len + 1, sizeof(int)); + convertedLen = 0; + for (i = 0; i < len; ++i) { + col[i] = convertedLen; + if (isUnicode) { + ++convertedLen; + } else if (uMap) { + convertedLen += uMap->mapUnicode(text[i], buf, sizeof(buf)); + } + } + col[len] = convertedLen; + + // check for hyphen at end of line + //~ need to check for other chars used as hyphens + hyphenated = text[len - 1] == (Unicode)'-'; +} + +//------------------------------------------------------------------------ +// TextLineFrag +//------------------------------------------------------------------------ + +class TextLineFrag { +public: + + TextLine *line; // the line object + int start, len; // offset and length of this fragment + // (in Unicode chars) + double xMin, xMax; // bounding box coordinates + double yMin, yMax; + double base; // baseline virtual coordinate + int col; // first column + + void init(TextLine *lineA, int startA, int lenA); + void computeCoords(GBool oneRot); + + static int cmpYXPrimaryRot(const void *p1, const void *p2); + static int cmpYXLineRot(const void *p1, const void *p2); + static int cmpXYLineRot(const void *p1, const void *p2); + static int cmpXYColumnPrimaryRot(const void *p1, const void *p2); + static int cmpXYColumnLineRot(const void *p1, const void *p2); +}; + +void TextLineFrag::init(TextLine *lineA, int startA, int lenA) { + line = lineA; + start = startA; + len = lenA; + col = line->col[start]; +} + +void TextLineFrag::computeCoords(GBool oneRot) { + TextBlock *blk; + double d0, d1, d2, d3, d4; + + if (oneRot) { + + switch (line->rot) { + case 0: + xMin = line->edge[start]; + xMax = line->edge[start + len]; + yMin = line->yMin; + yMax = line->yMax; + break; + case 1: + xMin = line->xMin; + xMax = line->xMax; + yMin = line->edge[start]; + yMax = line->edge[start + len]; + break; + case 2: + xMin = line->edge[start + len]; + xMax = line->edge[start]; + yMin = line->yMin; + yMax = line->yMax; + break; + case 3: + xMin = line->xMin; + xMax = line->xMax; + yMin = line->edge[start + len]; + yMax = line->edge[start]; + break; + } + base = line->base; + + } else { + + if (line->rot == 0 && line->blk->page->primaryRot == 0) { + + xMin = line->edge[start]; + xMax = line->edge[start + len]; + yMin = line->yMin; + yMax = line->yMax; + base = line->base; + + } else { + + blk = line->blk; + d0 = line->edge[start]; + d1 = line->edge[start + len]; + d2 = d3 = d4 = 0; // make gcc happy + + switch (line->rot) { + case 0: + d2 = line->yMin; + d3 = line->yMax; + d4 = line->base; + d0 = (d0 - blk->xMin) / (blk->xMax - blk->xMin); + d1 = (d1 - blk->xMin) / (blk->xMax - blk->xMin); + d2 = (d2 - blk->yMin) / (blk->yMax - blk->yMin); + d3 = (d3 - blk->yMin) / (blk->yMax - blk->yMin); + d4 = (d4 - blk->yMin) / (blk->yMax - blk->yMin); + break; + case 1: + d2 = line->xMax; + d3 = line->xMin; + d4 = line->base; + d0 = (d0 - blk->yMin) / (blk->yMax - blk->yMin); + d1 = (d1 - blk->yMin) / (blk->yMax - blk->yMin); + d2 = (blk->xMax - d2) / (blk->xMax - blk->xMin); + d3 = (blk->xMax - d3) / (blk->xMax - blk->xMin); + d4 = (blk->xMax - d4) / (blk->xMax - blk->xMin); + break; + case 2: + d2 = line->yMax; + d3 = line->yMin; + d4 = line->base; + d0 = (blk->xMax - d0) / (blk->xMax - blk->xMin); + d1 = (blk->xMax - d1) / (blk->xMax - blk->xMin); + d2 = (blk->yMax - d2) / (blk->yMax - blk->yMin); + d3 = (blk->yMax - d3) / (blk->yMax - blk->yMin); + d4 = (blk->yMax - d4) / (blk->yMax - blk->yMin); + break; + case 3: + d2 = line->xMin; + d3 = line->xMax; + d4 = line->base; + d0 = (blk->yMax - d0) / (blk->yMax - blk->yMin); + d1 = (blk->yMax - d1) / (blk->yMax - blk->yMin); + d2 = (d2 - blk->xMin) / (blk->xMax - blk->xMin); + d3 = (d3 - blk->xMin) / (blk->xMax - blk->xMin); + d4 = (d4 - blk->xMin) / (blk->xMax - blk->xMin); + break; + } + + switch (line->blk->page->primaryRot) { + case 0: + xMin = blk->xMin + d0 * (blk->xMax - blk->xMin); + xMax = blk->xMin + d1 * (blk->xMax - blk->xMin); + yMin = blk->yMin + d2 * (blk->yMax - blk->yMin); + yMax = blk->yMin + d3 * (blk->yMax - blk->yMin); + base = blk->yMin + base * (blk->yMax - blk->yMin); + break; + case 1: + xMin = blk->xMax - d3 * (blk->xMax - blk->xMin); + xMax = blk->xMax - d2 * (blk->xMax - blk->xMin); + yMin = blk->yMin + d0 * (blk->yMax - blk->yMin); + yMax = blk->yMin + d1 * (blk->yMax - blk->yMin); + base = blk->xMax - d4 * (blk->xMax - blk->xMin); + break; + case 2: + xMin = blk->xMax - d1 * (blk->xMax - blk->xMin); + xMax = blk->xMax - d0 * (blk->xMax - blk->xMin); + yMin = blk->yMax - d3 * (blk->yMax - blk->yMin); + yMax = blk->yMax - d2 * (blk->yMax - blk->yMin); + base = blk->yMax - d4 * (blk->yMax - blk->yMin); + break; + case 3: + xMin = blk->xMin + d2 * (blk->xMax - blk->xMin); + xMax = blk->xMin + d3 * (blk->xMax - blk->xMin); + yMin = blk->yMax - d1 * (blk->yMax - blk->yMin); + yMax = blk->yMax - d0 * (blk->yMax - blk->yMin); + base = blk->xMin + d4 * (blk->xMax - blk->xMin); + break; + } + + } + } +} + +int TextLineFrag::cmpYXPrimaryRot(const void *p1, const void *p2) { + TextLineFrag *frag1 = (TextLineFrag *)p1; + TextLineFrag *frag2 = (TextLineFrag *)p2; + double cmp; + + cmp = 0; // make gcc happy + switch (frag1->line->blk->page->primaryRot) { + case 0: + if (fabs(cmp = frag1->yMin - frag2->yMin) < 0.01) { + cmp = frag1->xMin - frag2->xMin; + } + break; + case 1: + if (fabs(cmp = frag2->xMax - frag1->xMax) < 0.01) { + cmp = frag1->yMin - frag2->yMin; + } + break; + case 2: + if (fabs(cmp = frag2->yMin - frag1->yMin) < 0.01) { + cmp = frag2->xMax - frag1->xMax; + } + break; + case 3: + if (fabs(cmp = frag1->xMax - frag2->xMax) < 0.01) { + cmp = frag2->yMax - frag1->yMax; + } + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextLineFrag::cmpYXLineRot(const void *p1, const void *p2) { + TextLineFrag *frag1 = (TextLineFrag *)p1; + TextLineFrag *frag2 = (TextLineFrag *)p2; + double cmp; + + cmp = 0; // make gcc happy + switch (frag1->line->rot) { + case 0: + if ((cmp = frag1->yMin - frag2->yMin) == 0) { + cmp = frag1->xMin - frag2->xMin; + } + break; + case 1: + if ((cmp = frag2->xMax - frag1->xMax) == 0) { + cmp = frag1->yMin - frag2->yMin; + } + break; + case 2: + if ((cmp = frag2->yMin - frag1->yMin) == 0) { + cmp = frag2->xMax - frag1->xMax; + } + break; + case 3: + if ((cmp = frag1->xMax - frag2->xMax) == 0) { + cmp = frag2->yMax - frag1->yMax; + } + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextLineFrag::cmpXYLineRot(const void *p1, const void *p2) { + TextLineFrag *frag1 = (TextLineFrag *)p1; + TextLineFrag *frag2 = (TextLineFrag *)p2; + double cmp; + + cmp = 0; // make gcc happy + switch (frag1->line->rot) { + case 0: + if ((cmp = frag1->xMin - frag2->xMin) == 0) { + cmp = frag1->yMin - frag2->yMin; + } + break; + case 1: + if ((cmp = frag1->yMin - frag2->yMin) == 0) { + cmp = frag2->xMax - frag1->xMax; + } + break; + case 2: + if ((cmp = frag2->xMax - frag1->xMax) == 0) { + cmp = frag2->yMin - frag1->yMin; + } + break; + case 3: + if ((cmp = frag2->yMax - frag1->yMax) == 0) { + cmp = frag1->xMax - frag2->xMax; + } + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextLineFrag::cmpXYColumnPrimaryRot(const void *p1, const void *p2) { + TextLineFrag *frag1 = (TextLineFrag *)p1; + TextLineFrag *frag2 = (TextLineFrag *)p2; + double cmp; + + // if columns overlap, compare y values + if (frag1->col < frag2->col + (frag2->line->col[frag2->start + frag2->len] - + frag2->line->col[frag2->start]) && + frag2->col < frag1->col + (frag1->line->col[frag1->start + frag1->len] - + frag1->line->col[frag1->start])) { + cmp = 0; // make gcc happy + switch (frag1->line->blk->page->primaryRot) { + case 0: cmp = frag1->yMin - frag2->yMin; break; + case 1: cmp = frag2->xMax - frag1->xMax; break; + case 2: cmp = frag2->yMin - frag1->yMin; break; + case 3: cmp = frag1->xMax - frag2->xMax; break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; + } + + // otherwise, compare starting column + return frag1->col - frag2->col; +} + +int TextLineFrag::cmpXYColumnLineRot(const void *p1, const void *p2) { + TextLineFrag *frag1 = (TextLineFrag *)p1; + TextLineFrag *frag2 = (TextLineFrag *)p2; + double cmp; + + // if columns overlap, compare y values + if (frag1->col < frag2->col + (frag2->line->col[frag2->start + frag2->len] - + frag2->line->col[frag2->start]) && + frag2->col < frag1->col + (frag1->line->col[frag1->start + frag1->len] - + frag1->line->col[frag1->start])) { + cmp = 0; // make gcc happy + switch (frag1->line->rot) { + case 0: cmp = frag1->yMin - frag2->yMin; break; + case 1: cmp = frag2->xMax - frag1->xMax; break; + case 2: cmp = frag2->yMin - frag1->yMin; break; + case 3: cmp = frag1->xMax - frag2->xMax; break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; + } + + // otherwise, compare starting column + return frag1->col - frag2->col; +} + +//------------------------------------------------------------------------ +// TextBlock +//------------------------------------------------------------------------ + +TextBlock::TextBlock(TextPage *pageA, int rotA) { + page = pageA; + rot = rotA; + xMin = yMin = 0; + xMax = yMax = -1; + priMin = 0; + priMax = page->pageWidth; + pool = new TextPool(); + lines = NULL; + curLine = NULL; + next = NULL; + stackNext = NULL; +} + +TextBlock::~TextBlock() { + TextLine *line; + + delete pool; + while (lines) { + line = lines; + lines = lines->next; + delete line; + } +} + +void TextBlock::addWord(TextWord *word) { + pool->addWord(word); + if (xMin > xMax) { + xMin = word->xMin; + xMax = word->xMax; + yMin = word->yMin; + yMax = word->yMax; + } else { + if (word->xMin < xMin) { + xMin = word->xMin; + } + if (word->xMax > xMax) { + xMax = word->xMax; + } + if (word->yMin < yMin) { + yMin = word->yMin; + } + if (word->yMax > yMax) { + yMax = word->yMax; + } + } +} + +void TextBlock::coalesce(UnicodeMap *uMap) { + TextWord *word0, *word1, *word2, *bestWord0, *bestWord1, *lastWord; + TextLine *line, *line0, *line1; + int poolMinBaseIdx, startBaseIdx, minBaseIdx, maxBaseIdx; + int baseIdx, bestWordBaseIdx, idx0, idx1; + double minBase, maxBase; + double fontSize, delta, priDelta, secDelta; + TextLine **lineArray; + GBool found; + int col1, col2; + int i, j, k; + + // discard duplicated text (fake boldface, drop shadows) + for (idx0 = pool->minBaseIdx; idx0 <= pool->maxBaseIdx; ++idx0) { + word0 = pool->getPool(idx0); + while (word0) { + priDelta = dupMaxPriDelta * word0->fontSize; + secDelta = dupMaxSecDelta * word0->fontSize; + if (rot == 0 || rot == 3) { + maxBaseIdx = pool->getBaseIdx(word0->base + secDelta); + } else { + maxBaseIdx = pool->getBaseIdx(word0->base - secDelta); + } + found = gFalse; + word1 = word2 = NULL; // make gcc happy + for (idx1 = idx0; idx1 <= maxBaseIdx; ++idx1) { + if (idx1 == idx0) { + word1 = word0; + word2 = word0->next; + } else { + word1 = NULL; + word2 = pool->getPool(idx1); + } + for (; word2; word1 = word2, word2 = word2->next) { + if (word2->len == word0->len && + !memcmp(word2->text, word0->text, + word0->len * sizeof(Unicode))) { + switch (rot) { + case 0: + case 2: + found = fabs(word0->xMin - word2->xMin) < priDelta && + fabs(word0->xMax - word2->xMax) < priDelta && + fabs(word0->yMin - word2->yMin) < secDelta && + fabs(word0->yMax - word2->yMax) < secDelta; + break; + case 1: + case 3: + found = fabs(word0->xMin - word2->xMin) < secDelta && + fabs(word0->xMax - word2->xMax) < secDelta && + fabs(word0->yMin - word2->yMin) < priDelta && + fabs(word0->yMax - word2->yMax) < priDelta; + break; + } + } + if (found) { + break; + } + } + if (found) { + break; + } + } + if (found) { + if (word1) { + word1->next = word2->next; + } else { + pool->setPool(idx1, word2->next); + } + delete word2; + } else { + word0 = word0->next; + } + } + } + + // build the lines + curLine = NULL; + poolMinBaseIdx = pool->minBaseIdx; + charCount = 0; + nLines = 0; + while (1) { + + // find the first non-empty line in the pool + for (; + poolMinBaseIdx <= pool->maxBaseIdx && !pool->getPool(poolMinBaseIdx); + ++poolMinBaseIdx) ; + if (poolMinBaseIdx > pool->maxBaseIdx) { + break; + } + + // look for the left-most word in the first four lines of the + // pool -- this avoids starting with a superscript word + startBaseIdx = poolMinBaseIdx; + for (baseIdx = poolMinBaseIdx + 1; + baseIdx < poolMinBaseIdx + 4 && baseIdx <= pool->maxBaseIdx; + ++baseIdx) { + if (!pool->getPool(baseIdx)) { + continue; + } + if (pool->getPool(baseIdx)->primaryCmp(pool->getPool(startBaseIdx)) + < 0) { + startBaseIdx = baseIdx; + } + } + + // create a new line + word0 = pool->getPool(startBaseIdx); + pool->setPool(startBaseIdx, word0->next); + word0->next = NULL; + line = new TextLine(this, word0->rot, word0->base); + line->addWord(word0); + lastWord = word0; + + // compute the search range + fontSize = word0->fontSize; + minBase = word0->base - maxIntraLineDelta * fontSize; + maxBase = word0->base + maxIntraLineDelta * fontSize; + minBaseIdx = pool->getBaseIdx(minBase); + maxBaseIdx = pool->getBaseIdx(maxBase); + + // find the rest of the words in this line + while (1) { + + // find the left-most word whose baseline is in the range for + // this line + bestWordBaseIdx = 0; + bestWord0 = bestWord1 = NULL; + for (baseIdx = minBaseIdx; baseIdx <= maxBaseIdx; ++baseIdx) { + for (word0 = NULL, word1 = pool->getPool(baseIdx); + word1; + word0 = word1, word1 = word1->next) { + if (word1->base >= minBase && + word1->base <= maxBase && + (delta = lastWord->primaryDelta(word1)) >= + minCharSpacing * fontSize) { + if (delta < maxWordSpacing * fontSize && + (!bestWord1 || word1->primaryCmp(bestWord1) < 0)) { + bestWordBaseIdx = baseIdx; + bestWord0 = word0; + bestWord1 = word1; + } + break; + } + } + } + if (!bestWord1) { + break; + } + + // remove it from the pool, and add it to the line + if (bestWord0) { + bestWord0->next = bestWord1->next; + } else { + pool->setPool(bestWordBaseIdx, bestWord1->next); + } + bestWord1->next = NULL; + line->addWord(bestWord1); + lastWord = bestWord1; + } + + // add the line + if (curLine && line->cmpYX(curLine) > 0) { + line0 = curLine; + line1 = curLine->next; + } else { + line0 = NULL; + line1 = lines; + } + for (; + line1 && line->cmpYX(line1) > 0; + line0 = line1, line1 = line1->next) ; + if (line0) { + line0->next = line; + } else { + lines = line; + } + line->next = line1; + curLine = line; + line->coalesce(uMap); + charCount += line->len; + ++nLines; + } + + // sort lines into xy order for column assignment + lineArray = (TextLine **)gmallocn(nLines, sizeof(TextLine *)); + for (line = lines, i = 0; line; line = line->next, ++i) { + lineArray[i] = line; + } + qsort(lineArray, nLines, sizeof(TextLine *), &TextLine::cmpXY); + + // column assignment + nColumns = 0; + for (i = 0; i < nLines; ++i) { + line0 = lineArray[i]; + col1 = 0; + for (j = 0; j < i; ++j) { + line1 = lineArray[j]; + if (line1->primaryDelta(line0) >= 0) { + col2 = line1->col[line1->len] + 1; + } else { + k = 0; // make gcc happy + switch (rot) { + case 0: + for (k = 0; + k < line1->len && + line0->xMin >= 0.5 * (line1->edge[k] + line1->edge[k+1]); + ++k) ; + break; + case 1: + for (k = 0; + k < line1->len && + line0->yMin >= 0.5 * (line1->edge[k] + line1->edge[k+1]); + ++k) ; + break; + case 2: + for (k = 0; + k < line1->len && + line0->xMax <= 0.5 * (line1->edge[k] + line1->edge[k+1]); + ++k) ; + break; + case 3: + for (k = 0; + k < line1->len && + line0->yMax <= 0.5 * (line1->edge[k] + line1->edge[k+1]); + ++k) ; + break; + } + col2 = line1->col[k]; + } + if (col2 > col1) { + col1 = col2; + } + } + for (k = 0; k <= line0->len; ++k) { + line0->col[k] += col1; + } + if (line0->col[line0->len] > nColumns) { + nColumns = line0->col[line0->len]; + } + } + gfree(lineArray); +} + +void TextBlock::updatePriMinMax(TextBlock *blk) { + double newPriMin, newPriMax; + GBool gotPriMin, gotPriMax; + + gotPriMin = gotPriMax = gFalse; + newPriMin = newPriMax = 0; // make gcc happy + switch (page->primaryRot) { + case 0: + case 2: + if (blk->yMin < yMax && blk->yMax > yMin) { + if (blk->xMin < xMin) { + newPriMin = blk->xMax; + gotPriMin = gTrue; + } + if (blk->xMax > xMax) { + newPriMax = blk->xMin; + gotPriMax = gTrue; + } + } + break; + case 1: + case 3: + if (blk->xMin < xMax && blk->xMax > xMin) { + if (blk->yMin < yMin) { + newPriMin = blk->yMax; + gotPriMin = gTrue; + } + if (blk->yMax > yMax) { + newPriMax = blk->yMin; + gotPriMax = gTrue; + } + } + break; + } + if (gotPriMin) { + if (newPriMin > xMin) { + newPriMin = xMin; + } + if (newPriMin > priMin) { + priMin = newPriMin; + } + } + if (gotPriMax) { + if (newPriMax < xMax) { + newPriMax = xMax; + } + if (newPriMax < priMax) { + priMax = newPriMax; + } + } +} + +int TextBlock::cmpXYPrimaryRot(const void *p1, const void *p2) { + TextBlock *blk1 = *(TextBlock **)p1; + TextBlock *blk2 = *(TextBlock **)p2; + double cmp; + + cmp = 0; // make gcc happy + switch (blk1->page->primaryRot) { + case 0: + if ((cmp = blk1->xMin - blk2->xMin) == 0) { + cmp = blk1->yMin - blk2->yMin; + } + break; + case 1: + if ((cmp = blk1->yMin - blk2->yMin) == 0) { + cmp = blk2->xMax - blk1->xMax; + } + break; + case 2: + if ((cmp = blk2->xMax - blk1->xMax) == 0) { + cmp = blk2->yMin - blk1->yMin; + } + break; + case 3: + if ((cmp = blk2->yMax - blk1->yMax) == 0) { + cmp = blk1->xMax - blk2->xMax; + } + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextBlock::cmpYXPrimaryRot(const void *p1, const void *p2) { + TextBlock *blk1 = *(TextBlock **)p1; + TextBlock *blk2 = *(TextBlock **)p2; + double cmp; + + cmp = 0; // make gcc happy + switch (blk1->page->primaryRot) { + case 0: + if ((cmp = blk1->yMin - blk2->yMin) == 0) { + cmp = blk1->xMin - blk2->xMin; + } + break; + case 1: + if ((cmp = blk2->xMax - blk1->xMax) == 0) { + cmp = blk1->yMin - blk2->yMin; + } + break; + case 2: + if ((cmp = blk2->yMin - blk1->yMin) == 0) { + cmp = blk2->xMax - blk1->xMax; + } + break; + case 3: + if ((cmp = blk1->xMax - blk2->xMax) == 0) { + cmp = blk2->yMax - blk1->yMax; + } + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +int TextBlock::primaryCmp(TextBlock *blk) { + double cmp; + + cmp = 0; // make gcc happy + switch (rot) { + case 0: + cmp = xMin - blk->xMin; + break; + case 1: + cmp = yMin - blk->yMin; + break; + case 2: + cmp = blk->xMax - xMax; + break; + case 3: + cmp = blk->yMax - yMax; + break; + } + return cmp < 0 ? -1 : cmp > 0 ? 1 : 0; +} + +double TextBlock::secondaryDelta(TextBlock *blk) { + double delta; + + delta = 0; // make gcc happy + switch (rot) { + case 0: + delta = blk->yMin - yMax; + break; + case 1: + delta = xMin - blk->xMax; + break; + case 2: + delta = yMin - blk->yMax; + break; + case 3: + delta = blk->xMin - xMax; + break; + } + return delta; +} + +GBool TextBlock::isBelow(TextBlock *blk) { + GBool below; + + below = gFalse; // make gcc happy + switch (page->primaryRot) { + case 0: + below = xMin >= blk->priMin && xMax <= blk->priMax && + yMin > blk->yMin; + break; + case 1: + below = yMin >= blk->priMin && yMax <= blk->priMax && + xMax < blk->xMax; + break; + case 2: + below = xMin >= blk->priMin && xMax <= blk->priMax && + yMax < blk->yMax; + break; + case 3: + below = yMin >= blk->priMin && yMax <= blk->priMax && + xMin > blk->xMin; + break; + } + + return below; +} + +//------------------------------------------------------------------------ +// TextFlow +//------------------------------------------------------------------------ + +TextFlow::TextFlow(TextPage *pageA, TextBlock *blk) { + page = pageA; + xMin = blk->xMin; + xMax = blk->xMax; + yMin = blk->yMin; + yMax = blk->yMax; + priMin = blk->priMin; + priMax = blk->priMax; + blocks = lastBlk = blk; + next = NULL; +} + +TextFlow::~TextFlow() { + TextBlock *blk; + + while (blocks) { + blk = blocks; + blocks = blocks->next; + delete blk; + } +} + +void TextFlow::addBlock(TextBlock *blk) { + if (lastBlk) { + lastBlk->next = blk; + } else { + blocks = blk; + } + lastBlk = blk; + if (blk->xMin < xMin) { + xMin = blk->xMin; + } + if (blk->xMax > xMax) { + xMax = blk->xMax; + } + if (blk->yMin < yMin) { + yMin = blk->yMin; + } + if (blk->yMax > yMax) { + yMax = blk->yMax; + } +} + +GBool TextFlow::blockFits(TextBlock *blk, TextBlock *prevBlk) { + GBool fits; + + // lower blocks must use smaller fonts + if (blk->lines->words->fontSize > lastBlk->lines->words->fontSize) { + return gFalse; + } + + fits = gFalse; // make gcc happy + switch (page->primaryRot) { + case 0: + fits = blk->xMin >= priMin && blk->xMax <= priMax; + break; + case 1: + fits = blk->yMin >= priMin && blk->yMax <= priMax; + break; + case 2: + fits = blk->xMin >= priMin && blk->xMax <= priMax; + break; + case 3: + fits = blk->yMin >= priMin && blk->yMax <= priMax; + break; + } + return fits; +} + +#if TEXTOUT_WORD_LIST + +//------------------------------------------------------------------------ +// TextWordList +//------------------------------------------------------------------------ + +TextWordList::TextWordList(TextPage *text, GBool physLayout) { + TextFlow *flow; + TextBlock *blk; + TextLine *line; + TextWord *word; + TextWord **wordArray; + int nWords, i; + + words = new GList(); + + if (text->rawOrder) { + for (word = text->rawWords; word; word = word->next) { + words->append(word); + } + + } else if (physLayout) { + // this is inefficient, but it's also the least useful of these + // three cases + nWords = 0; + for (flow = text->flows; flow; flow = flow->next) { + for (blk = flow->blocks; blk; blk = blk->next) { + for (line = blk->lines; line; line = line->next) { + for (word = line->words; word; word = word->next) { + ++nWords; + } + } + } + } + wordArray = (TextWord **)gmallocn(nWords, sizeof(TextWord *)); + i = 0; + for (flow = text->flows; flow; flow = flow->next) { + for (blk = flow->blocks; blk; blk = blk->next) { + for (line = blk->lines; line; line = line->next) { + for (word = line->words; word; word = word->next) { + wordArray[i++] = word; + } + } + } + } + qsort(wordArray, nWords, sizeof(TextWord *), &TextWord::cmpYX); + for (i = 0; i < nWords; ++i) { + words->append(wordArray[i]); + } + gfree(wordArray); + + } else { + for (flow = text->flows; flow; flow = flow->next) { + for (blk = flow->blocks; blk; blk = blk->next) { + for (line = blk->lines; line; line = line->next) { + for (word = line->words; word; word = word->next) { + words->append(word); + } + } + } + } + } +} + +TextWordList::~TextWordList() { + delete words; +} + +int TextWordList::getLength() { + return words->getLength(); +} + +TextWord *TextWordList::get(int idx) { + if (idx < 0 || idx >= words->getLength()) { + return NULL; + } + return (TextWord *)words->get(idx); +} + +#endif // TEXTOUT_WORD_LIST + +//------------------------------------------------------------------------ +// TextPage +//------------------------------------------------------------------------ + +TextPage::TextPage(GBool rawOrderA) { + int rot; + + rawOrder = rawOrderA; + curWord = NULL; + charPos = 0; + curFont = NULL; + curFontSize = 0; + nest = 0; + nTinyChars = 0; + lastCharOverlap = gFalse; + if (!rawOrder) { + for (rot = 0; rot < 4; ++rot) { + pools[rot] = new TextPool(); + } + } + flows = NULL; + blocks = NULL; + rawWords = NULL; + rawLastWord = NULL; + fonts = new GList(); + lastFindXMin = lastFindYMin = 0; + haveLastFind = gFalse; + underlines = new GList(); + links = new GList(); +} + +TextPage::~TextPage() { + int rot; + + clear(); + if (!rawOrder) { + for (rot = 0; rot < 4; ++rot) { + delete pools[rot]; + } + } + delete fonts; + deleteGList(underlines, TextUnderline); + deleteGList(links, TextLink); +} + +void TextPage::startPage(GfxState *state) { + clear(); + if (state) { + pageWidth = state->getPageWidth(); + pageHeight = state->getPageHeight(); + } else { + pageWidth = pageHeight = 0; + } +} + +void TextPage::endPage() { + if (curWord) { + endWord(); + } +} + +void TextPage::clear() { + int rot; + TextFlow *flow; + TextWord *word; + + if (curWord) { + delete curWord; + curWord = NULL; + } + if (rawOrder) { + while (rawWords) { + word = rawWords; + rawWords = rawWords->next; + delete word; + } + } else { + for (rot = 0; rot < 4; ++rot) { + delete pools[rot]; + } + while (flows) { + flow = flows; + flows = flows->next; + delete flow; + } + gfree(blocks); + } + deleteGList(fonts, TextFontInfo); + + curWord = NULL; + charPos = 0; + curFont = NULL; + curFontSize = 0; + nest = 0; + nTinyChars = 0; + if (!rawOrder) { + for (rot = 0; rot < 4; ++rot) { + pools[rot] = new TextPool(); + } + } + flows = NULL; + blocks = NULL; + rawWords = NULL; + rawLastWord = NULL; + fonts = new GList(); +} + +void TextPage::updateFont(GfxState *state) { + GfxFont *gfxFont; + double *fm; + char *name; + int code, mCode, letterCode, anyCode; + double w; + int i; + + // get the font info object + curFont = NULL; + for (i = 0; i < fonts->getLength(); ++i) { + curFont = (TextFontInfo *)fonts->get(i); + if (curFont->matches(state)) { + break; + } + curFont = NULL; + } + if (!curFont) { + curFont = new TextFontInfo(state); + fonts->append(curFont); + } + + // adjust the font size + gfxFont = state->getFont(); + curFontSize = state->getTransformedFontSize(); + if (gfxFont && gfxFont->getType() == fontType3) { + // This is a hack which makes it possible to deal with some Type 3 + // fonts. The problem is that it's impossible to know what the + // base coordinate system used in the font is without actually + // rendering the font. This code tries to guess by looking at the + // width of the character 'm' (which breaks if the font is a + // subset that doesn't contain 'm'). + mCode = letterCode = anyCode = -1; + for (code = 0; code < 256; ++code) { + name = ((Gfx8BitFont *)gfxFont)->getCharName(code); + if (name && name[0] == 'm' && name[1] == '\0') { + mCode = code; + } + if (letterCode < 0 && name && name[1] == '\0' && + ((name[0] >= 'A' && name[0] <= 'Z') || + (name[0] >= 'a' && name[0] <= 'z'))) { + letterCode = code; + } + if (anyCode < 0 && name && + ((Gfx8BitFont *)gfxFont)->getWidth(code) > 0) { + anyCode = code; + } + } + if (mCode >= 0 && + (w = ((Gfx8BitFont *)gfxFont)->getWidth(mCode)) > 0) { + // 0.6 is a generic average 'm' width -- yes, this is a hack + curFontSize *= w / 0.6; + } else if (letterCode >= 0 && + (w = ((Gfx8BitFont *)gfxFont)->getWidth(letterCode)) > 0) { + // even more of a hack: 0.5 is a generic letter width + curFontSize *= w / 0.5; + } else if (anyCode >= 0 && + (w = ((Gfx8BitFont *)gfxFont)->getWidth(anyCode)) > 0) { + // better than nothing: 0.5 is a generic character width + curFontSize *= w / 0.5; + } + fm = gfxFont->getFontMatrix(); + if (fm[0] != 0) { + curFontSize *= fabs(fm[3] / fm[0]); + } + } +} + +void TextPage::beginWord(GfxState *state, double x0, double y0) { + double *fontm; + double m[4], m2[4]; + int rot; + + // This check is needed because Type 3 characters can contain + // text-drawing operations (when TextPage is being used via + // {X,Win}SplashOutputDev rather than TextOutputDev). + if (curWord) { + ++nest; + return; + } + + // compute the rotation + state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]); + if (state->getFont()->getType() == fontType3) { + fontm = state->getFont()->getFontMatrix(); + m2[0] = fontm[0] * m[0] + fontm[1] * m[2]; + m2[1] = fontm[0] * m[1] + fontm[1] * m[3]; + m2[2] = fontm[2] * m[0] + fontm[3] * m[2]; + m2[3] = fontm[2] * m[1] + fontm[3] * m[3]; + m[0] = m2[0]; + m[1] = m2[1]; + m[2] = m2[2]; + m[3] = m2[3]; + } + if (fabs(m[0] * m[3]) > fabs(m[1] * m[2])) { + rot = (m[3] < 0) ? 0 : 2; + } else { + rot = (m[2] > 0) ? 1 : 3; + } + + curWord = new TextWord(state, rot, x0, y0, charPos, curFont, curFontSize); +} + +void TextPage::addChar(GfxState *state, double x, double y, + double dx, double dy, + CharCode c, int nBytes, Unicode *u, int uLen) { + double x1, y1, w1, h1, dx2, dy2, base, sp, delta; + GBool overlap; + int i; + + // subtract char and word spacing from the dx,dy values + sp = state->getCharSpace(); + if (c == (CharCode)0x20) { + sp += state->getWordSpace(); + } + state->textTransformDelta(sp * state->getHorizScaling(), 0, &dx2, &dy2); + dx -= dx2; + dy -= dy2; + state->transformDelta(dx, dy, &w1, &h1); + + // throw away chars that aren't inside the page bounds + // (and also do a sanity check on the character size) + state->transform(x, y, &x1, &y1); + if (x1 + w1 < 0 || x1 > pageWidth || + y1 + h1 < 0 || y1 > pageHeight || + w1 > pageWidth || h1 > pageHeight) { + charPos += nBytes; + return; + } + + // check the tiny chars limit + if (!globalParams->getTextKeepTinyChars() && + fabs(w1) < 3 && fabs(h1) < 3) { + if (++nTinyChars > 50000) { + charPos += nBytes; + return; + } + } + + // break words at space character + if (uLen == 1 && u[0] == (Unicode)0x20) { + if (curWord) { + ++curWord->charLen; + } + charPos += nBytes; + endWord(); + return; + } + + // start a new word if: + // (1) this character doesn't fall in the right place relative to + // the end of the previous word (this places upper and lower + // constraints on the position deltas along both the primary + // and secondary axes), or + // (2) this character overlaps the previous one (duplicated text), or + // (3) the previous character was an overlap (we want each duplicated + // character to be in a word by itself at this stage), + // (4) the font size has changed + if (curWord && curWord->len > 0) { + base = sp = delta = 0; // make gcc happy + switch (curWord->rot) { + case 0: + base = y1; + sp = x1 - curWord->xMax; + delta = x1 - curWord->edge[curWord->len - 1]; + break; + case 1: + base = x1; + sp = y1 - curWord->yMax; + delta = y1 - curWord->edge[curWord->len - 1]; + break; + case 2: + base = y1; + sp = curWord->xMin - x1; + delta = curWord->edge[curWord->len - 1] - x1; + break; + case 3: + base = x1; + sp = curWord->yMin - y1; + delta = curWord->edge[curWord->len - 1] - y1; + break; + } + overlap = fabs(delta) < dupMaxPriDelta * curWord->fontSize && + fabs(base - curWord->base) < dupMaxSecDelta * curWord->fontSize; + if (overlap || lastCharOverlap || + sp < -minDupBreakOverlap * curWord->fontSize || + sp > minWordBreakSpace * curWord->fontSize || + fabs(base - curWord->base) > 0.5 || + curFontSize != curWord->fontSize) { + endWord(); + } + lastCharOverlap = overlap; + } else { + lastCharOverlap = gFalse; + } + + if (uLen != 0) { + // start a new word if needed + if (!curWord) { + beginWord(state, x, y); + } + + // page rotation and/or transform matrices can cause text to be + // drawn in reverse order -- in this case, swap the begin/end + // coordinates and break text into individual chars + if ((curWord->rot == 0 && w1 < 0) || + (curWord->rot == 1 && h1 < 0) || + (curWord->rot == 2 && w1 > 0) || + (curWord->rot == 3 && h1 > 0)) { + endWord(); + beginWord(state, x + dx, y + dy); + x1 += w1; + y1 += h1; + w1 = -w1; + h1 = -h1; + } + + // add the characters to the current word + w1 /= uLen; + h1 /= uLen; + for (i = 0; i < uLen; ++i) { + curWord->addChar(state, x1 + i*w1, y1 + i*h1, w1, h1, u[i]); + } + } + if (curWord) { + curWord->charLen += nBytes; + } + charPos += nBytes; +} + +void TextPage::endWord() { + // This check is needed because Type 3 characters can contain + // text-drawing operations (when TextPage is being used via + // {X,Win}SplashOutputDev rather than TextOutputDev). + if (nest > 0) { + --nest; + return; + } + + if (curWord) { + addWord(curWord); + curWord = NULL; + } +} + +void TextPage::addWord(TextWord *word) { + // throw away zero-length words -- they don't have valid xMin/xMax + // values, and they're useless anyway + if (word->len == 0) { + delete word; + return; + } + + if (rawOrder) { + if (rawLastWord) { + rawLastWord->next = word; + } else { + rawWords = word; + } + rawLastWord = word; + } else { + pools[word->rot]->addWord(word); + } +} + +void TextPage::addUnderline(double x0, double y0, double x1, double y1) { + underlines->append(new TextUnderline(x0, y0, x1, y1)); +} + +void TextPage::addLink(int xMin, int yMin, int xMax, int yMax, Link *link) { + links->append(new TextLink(xMin, yMin, xMax, yMax, link)); +} + +void TextPage::coalesce(GBool physLayout, GBool doHTML) { + UnicodeMap *uMap; + TextPool *pool; + TextWord *word0, *word1, *word2; + TextLine *line; + TextBlock *blkList, *blkStack, *blk, *lastBlk, *blk0, *blk1; + TextBlock **blkArray; + TextFlow *flow, *lastFlow; + TextUnderline *underline; + TextLink *link; + int rot, poolMinBaseIdx, baseIdx, startBaseIdx, endBaseIdx; + double minBase, maxBase, newMinBase, newMaxBase; + double fontSize, colSpace1, colSpace2, lineSpace, intraLineSpace, blkSpace; + GBool found; + int count[4]; + int lrCount; + int firstBlkIdx, nBlocksLeft; + int col1, col2; + int i, j, n; + + if (rawOrder) { + primaryRot = 0; + primaryLR = gTrue; + return; + } + + uMap = globalParams->getTextEncoding(); + blkList = NULL; + lastBlk = NULL; + nBlocks = 0; + primaryRot = -1; + +#if 0 // for debugging + printf("*** initial words ***\n"); + for (rot = 0; rot < 4; ++rot) { + pool = pools[rot]; + for (baseIdx = pool->minBaseIdx; baseIdx <= pool->maxBaseIdx; ++baseIdx) { + for (word0 = pool->getPool(baseIdx); word0; word0 = word0->next) { + printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f rot=%d link=%p '", + word0->xMin, word0->xMax, word0->yMin, word0->yMax, + word0->base, word0->fontSize, rot*90, word0->link); + for (i = 0; i < word0->len; ++i) { + fputc(word0->text[i] & 0xff, stdout); + } + printf("'\n"); + } + } + } + printf("\n"); +#endif + +#if 0 //~ for debugging + for (i = 0; i < underlines->getLength(); ++i) { + underline = (TextUnderline *)underlines->get(i); + printf("underline: x=%g..%g y=%g..%g horiz=%d\n", + underline->x0, underline->x1, underline->y0, underline->y1, + underline->horiz); + } +#endif + + if (doHTML) { + + //----- handle underlining + for (i = 0; i < underlines->getLength(); ++i) { + underline = (TextUnderline *)underlines->get(i); + if (underline->horiz) { + // rot = 0 + if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) { + startBaseIdx = pools[0]->getBaseIdx(underline->y0 + minUnderlineGap); + endBaseIdx = pools[0]->getBaseIdx(underline->y0 + maxUnderlineGap); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[0]->getPool(j); word0; word0 = word0->next) { + //~ need to check the y value against the word baseline + if (underline->x0 < word0->xMin + underlineSlack && + word0->xMax - underlineSlack < underline->x1) { + word0->underlined = gTrue; + } + } + } + } + + // rot = 2 + if (pools[2]->minBaseIdx <= pools[2]->maxBaseIdx) { + startBaseIdx = pools[2]->getBaseIdx(underline->y0 - maxUnderlineGap); + endBaseIdx = pools[2]->getBaseIdx(underline->y0 - minUnderlineGap); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[2]->getPool(j); word0; word0 = word0->next) { + if (underline->x0 < word0->xMin + underlineSlack && + word0->xMax - underlineSlack < underline->x1) { + word0->underlined = gTrue; + } + } + } + } + } else { + // rot = 1 + if (pools[1]->minBaseIdx <= pools[1]->maxBaseIdx) { + startBaseIdx = pools[1]->getBaseIdx(underline->x0 - maxUnderlineGap); + endBaseIdx = pools[1]->getBaseIdx(underline->x0 - minUnderlineGap); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[1]->getPool(j); word0; word0 = word0->next) { + if (underline->y0 < word0->yMin + underlineSlack && + word0->yMax - underlineSlack < underline->y1) { + word0->underlined = gTrue; + } + } + } + } + + // rot = 3 + if (pools[3]->minBaseIdx <= pools[3]->maxBaseIdx) { + startBaseIdx = pools[3]->getBaseIdx(underline->x0 + minUnderlineGap); + endBaseIdx = pools[3]->getBaseIdx(underline->x0 + maxUnderlineGap); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[3]->getPool(j); word0; word0 = word0->next) { + if (underline->y0 < word0->yMin + underlineSlack && + word0->yMax - underlineSlack < underline->y1) { + word0->underlined = gTrue; + } + } + } + } + } + } + + //----- handle links + for (i = 0; i < links->getLength(); ++i) { + link = (TextLink *)links->get(i); + + // rot = 0 + if (pools[0]->minBaseIdx <= pools[0]->maxBaseIdx) { + startBaseIdx = pools[0]->getBaseIdx(link->yMin); + endBaseIdx = pools[0]->getBaseIdx(link->yMax); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[0]->getPool(j); word0; word0 = word0->next) { + if (link->xMin < word0->xMin + hyperlinkSlack && + word0->xMax - hyperlinkSlack < link->xMax && + link->yMin < word0->yMin + hyperlinkSlack && + word0->yMax - hyperlinkSlack < link->yMax) { + word0->link = link->link; + } + } + } + } + + // rot = 2 + if (pools[2]->minBaseIdx <= pools[2]->maxBaseIdx) { + startBaseIdx = pools[2]->getBaseIdx(link->yMin); + endBaseIdx = pools[2]->getBaseIdx(link->yMax); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[2]->getPool(j); word0; word0 = word0->next) { + if (link->xMin < word0->xMin + hyperlinkSlack && + word0->xMax - hyperlinkSlack < link->xMax && + link->yMin < word0->yMin + hyperlinkSlack && + word0->yMax - hyperlinkSlack < link->yMax) { + word0->link = link->link; + } + } + } + } + + // rot = 1 + if (pools[1]->minBaseIdx <= pools[1]->maxBaseIdx) { + startBaseIdx = pools[1]->getBaseIdx(link->xMin); + endBaseIdx = pools[1]->getBaseIdx(link->xMax); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[1]->getPool(j); word0; word0 = word0->next) { + if (link->yMin < word0->yMin + hyperlinkSlack && + word0->yMax - hyperlinkSlack < link->yMax && + link->xMin < word0->xMin + hyperlinkSlack && + word0->xMax - hyperlinkSlack < link->xMax) { + word0->link = link->link; + } + } + } + } + + // rot = 3 + if (pools[3]->minBaseIdx <= pools[3]->maxBaseIdx) { + startBaseIdx = pools[3]->getBaseIdx(link->xMin); + endBaseIdx = pools[3]->getBaseIdx(link->xMax); + for (j = startBaseIdx; j <= endBaseIdx; ++j) { + for (word0 = pools[3]->getPool(j); word0; word0 = word0->next) { + if (link->yMin < word0->yMin + hyperlinkSlack && + word0->yMax - hyperlinkSlack < link->yMax && + link->xMin < word0->xMin + hyperlinkSlack && + word0->xMax - hyperlinkSlack < link->xMax) { + word0->link = link->link; + } + } + } + } + } + } + + //----- assemble the blocks + + //~ add an outer loop for writing mode (vertical text) + + // build blocks for each rotation value + for (rot = 0; rot < 4; ++rot) { + pool = pools[rot]; + poolMinBaseIdx = pool->minBaseIdx; + count[rot] = 0; + + // add blocks until no more words are left + while (1) { + + // find the first non-empty line in the pool + for (; + poolMinBaseIdx <= pool->maxBaseIdx && + !pool->getPool(poolMinBaseIdx); + ++poolMinBaseIdx) ; + if (poolMinBaseIdx > pool->maxBaseIdx) { + break; + } + + // look for the left-most word in the first four lines of the + // pool -- this avoids starting with a superscript word + startBaseIdx = poolMinBaseIdx; + for (baseIdx = poolMinBaseIdx + 1; + baseIdx < poolMinBaseIdx + 4 && baseIdx <= pool->maxBaseIdx; + ++baseIdx) { + if (!pool->getPool(baseIdx)) { + continue; + } + if (pool->getPool(baseIdx)->primaryCmp(pool->getPool(startBaseIdx)) + < 0) { + startBaseIdx = baseIdx; + } + } + + // create a new block + word0 = pool->getPool(startBaseIdx); + pool->setPool(startBaseIdx, word0->next); + word0->next = NULL; + blk = new TextBlock(this, rot); + blk->addWord(word0); + + fontSize = word0->fontSize; + minBase = maxBase = word0->base; + colSpace1 = minColSpacing1 * fontSize; + colSpace2 = minColSpacing2 * fontSize; + lineSpace = maxLineSpacingDelta * fontSize; + intraLineSpace = maxIntraLineDelta * fontSize; + + // add words to the block + do { + found = gFalse; + + // look for words on the line above the current top edge of + // the block + newMinBase = minBase; + for (baseIdx = pool->getBaseIdx(minBase); + baseIdx >= pool->getBaseIdx(minBase - lineSpace); + --baseIdx) { + word0 = NULL; + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base < minBase && + word1->base >= minBase - lineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMin < blk->xMax && word1->xMax > blk->xMin) + : (word1->yMin < blk->yMax && word1->yMax > blk->yMin)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta1 * fontSize) { + word2 = word1; + if (word0) { + word0->next = word1->next; + } else { + pool->setPool(baseIdx, word1->next); + } + word1 = word1->next; + word2->next = NULL; + blk->addWord(word2); + found = gTrue; + newMinBase = word2->base; + } else { + word0 = word1; + word1 = word1->next; + } + } + } + minBase = newMinBase; + + // look for words on the line below the current bottom edge of + // the block + newMaxBase = maxBase; + for (baseIdx = pool->getBaseIdx(maxBase); + baseIdx <= pool->getBaseIdx(maxBase + lineSpace); + ++baseIdx) { + word0 = NULL; + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base > maxBase && + word1->base <= maxBase + lineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMin < blk->xMax && word1->xMax > blk->xMin) + : (word1->yMin < blk->yMax && word1->yMax > blk->yMin)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta1 * fontSize) { + word2 = word1; + if (word0) { + word0->next = word1->next; + } else { + pool->setPool(baseIdx, word1->next); + } + word1 = word1->next; + word2->next = NULL; + blk->addWord(word2); + found = gTrue; + newMaxBase = word2->base; + } else { + word0 = word1; + word1 = word1->next; + } + } + } + maxBase = newMaxBase; + + // look for words that are on lines already in the block, and + // that overlap the block horizontally + for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace); + baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace); + ++baseIdx) { + word0 = NULL; + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base >= minBase - intraLineSpace && + word1->base <= maxBase + intraLineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMin < blk->xMax + colSpace1 && + word1->xMax > blk->xMin - colSpace1) + : (word1->yMin < blk->yMax + colSpace1 && + word1->yMax > blk->yMin - colSpace1)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta2 * fontSize) { + word2 = word1; + if (word0) { + word0->next = word1->next; + } else { + pool->setPool(baseIdx, word1->next); + } + word1 = word1->next; + word2->next = NULL; + blk->addWord(word2); + found = gTrue; + } else { + word0 = word1; + word1 = word1->next; + } + } + } + + // only check for outlying words (the next two chunks of code) + // if we didn't find anything else + if (found) { + continue; + } + + // scan down the left side of the block, looking for words + // that are near (but not overlapping) the block; if there are + // three or fewer, add them to the block + n = 0; + for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace); + baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace); + ++baseIdx) { + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base >= minBase - intraLineSpace && + word1->base <= maxBase + intraLineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMax <= blk->xMin && + word1->xMax > blk->xMin - colSpace2) + : (word1->yMax <= blk->yMin && + word1->yMax > blk->yMin - colSpace2)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta3 * fontSize) { + ++n; + break; + } + word1 = word1->next; + } + } + if (n > 0 && n <= 3) { + for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace); + baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace); + ++baseIdx) { + word0 = NULL; + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base >= minBase - intraLineSpace && + word1->base <= maxBase + intraLineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMax <= blk->xMin && + word1->xMax > blk->xMin - colSpace2) + : (word1->yMax <= blk->yMin && + word1->yMax > blk->yMin - colSpace2)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta3 * fontSize) { + word2 = word1; + if (word0) { + word0->next = word1->next; + } else { + pool->setPool(baseIdx, word1->next); + } + word1 = word1->next; + word2->next = NULL; + blk->addWord(word2); + if (word2->base < minBase) { + minBase = word2->base; + } else if (word2->base > maxBase) { + maxBase = word2->base; + } + found = gTrue; + break; + } else { + word0 = word1; + word1 = word1->next; + } + } + } + } + + // scan down the right side of the block, looking for words + // that are near (but not overlapping) the block; if there are + // three or fewer, add them to the block + n = 0; + for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace); + baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace); + ++baseIdx) { + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base >= minBase - intraLineSpace && + word1->base <= maxBase + intraLineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMin >= blk->xMax && + word1->xMin < blk->xMax + colSpace2) + : (word1->yMin >= blk->yMax && + word1->yMin < blk->yMax + colSpace2)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta3 * fontSize) { + ++n; + break; + } + word1 = word1->next; + } + } + if (n > 0 && n <= 3) { + for (baseIdx = pool->getBaseIdx(minBase - intraLineSpace); + baseIdx <= pool->getBaseIdx(maxBase + intraLineSpace); + ++baseIdx) { + word0 = NULL; + word1 = pool->getPool(baseIdx); + while (word1) { + if (word1->base >= minBase - intraLineSpace && + word1->base <= maxBase + intraLineSpace && + ((rot == 0 || rot == 2) + ? (word1->xMin >= blk->xMax && + word1->xMin < blk->xMax + colSpace2) + : (word1->yMin >= blk->yMax && + word1->yMin < blk->yMax + colSpace2)) && + fabs(word1->fontSize - fontSize) < + maxBlockFontSizeDelta3 * fontSize) { + word2 = word1; + if (word0) { + word0->next = word1->next; + } else { + pool->setPool(baseIdx, word1->next); + } + word1 = word1->next; + word2->next = NULL; + blk->addWord(word2); + if (word2->base < minBase) { + minBase = word2->base; + } else if (word2->base > maxBase) { + maxBase = word2->base; + } + found = gTrue; + break; + } else { + word0 = word1; + word1 = word1->next; + } + } + } + } + + } while (found); + + //~ need to compute the primary writing mode (horiz/vert) in + //~ addition to primary rotation + + // coalesce the block, and add it to the list + blk->coalesce(uMap); + if (lastBlk) { + lastBlk->next = blk; + } else { + blkList = blk; + } + lastBlk = blk; + count[rot] += blk->charCount; + if (primaryRot < 0 || count[rot] > count[primaryRot]) { + primaryRot = rot; + } + ++nBlocks; + } + } + +#if 0 // for debugging + printf("*** rotation ***\n"); + for (rot = 0; rot < 4; ++rot) { + printf(" %d: %6d\n", rot, count[rot]); + } + printf(" primary rot = %d\n", primaryRot); + printf("\n"); +#endif + +#if 0 // for debugging + printf("*** blocks ***\n"); + for (blk = blkList; blk; blk = blk->next) { + printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f\n", + blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax); + for (line = blk->lines; line; line = line->next) { + printf(" line: x=%.2f..%.2f y=%.2f..%.2f base=%.2f\n", + line->xMin, line->xMax, line->yMin, line->yMax, line->base); + for (word0 = line->words; word0; word0 = word0->next) { + printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '", + word0->xMin, word0->xMax, word0->yMin, word0->yMax, + word0->base, word0->fontSize, word0->spaceAfter); + for (i = 0; i < word0->len; ++i) { + fputc(word0->text[i] & 0xff, stdout); + } + printf("'\n"); + } + } + } + printf("\n"); +#endif + + // determine the primary direction + lrCount = 0; + for (blk = blkList; blk; blk = blk->next) { + for (line = blk->lines; line; line = line->next) { + for (word0 = line->words; word0; word0 = word0->next) { + for (i = 0; i < word0->len; ++i) { + if (unicodeTypeL(word0->text[i])) { + ++lrCount; + } else if (unicodeTypeR(word0->text[i])) { + --lrCount; + } + } + } + } + } + primaryLR = lrCount >= 0; + +#if 0 // for debugging + printf("*** direction ***\n"); + printf("lrCount = %d\n", lrCount); + printf("primaryLR = %d\n", primaryLR); +#endif + + //----- column assignment + + // sort blocks into xy order for column assignment + blocks = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *)); + for (blk = blkList, i = 0; blk; blk = blk->next, ++i) { + blocks[i] = blk; + } + qsort(blocks, nBlocks, sizeof(TextBlock *), &TextBlock::cmpXYPrimaryRot); + + // column assignment + for (i = 0; i < nBlocks; ++i) { + blk0 = blocks[i]; + col1 = 0; + for (j = 0; j < i; ++j) { + blk1 = blocks[j]; + col2 = 0; // make gcc happy + switch (primaryRot) { + case 0: + if (blk0->xMin > blk1->xMax) { + col2 = blk1->col + blk1->nColumns + 3; + } else if (blk1->xMax == blk1->xMin) { + col2 = blk1->col; + } else { + col2 = blk1->col + (int)(((blk0->xMin - blk1->xMin) / + (blk1->xMax - blk1->xMin)) * + blk1->nColumns); + } + break; + case 1: + if (blk0->yMin > blk1->yMax) { + col2 = blk1->col + blk1->nColumns + 3; + } else if (blk1->yMax == blk1->yMin) { + col2 = blk1->col; + } else { + col2 = blk1->col + (int)(((blk0->yMin - blk1->yMin) / + (blk1->yMax - blk1->yMin)) * + blk1->nColumns); + } + break; + case 2: + if (blk0->xMax < blk1->xMin) { + col2 = blk1->col + blk1->nColumns + 3; + } else if (blk1->xMin == blk1->xMax) { + col2 = blk1->col; + } else { + col2 = blk1->col + (int)(((blk0->xMax - blk1->xMax) / + (blk1->xMin - blk1->xMax)) * + blk1->nColumns); + } + break; + case 3: + if (blk0->yMax < blk1->yMin) { + col2 = blk1->col + blk1->nColumns + 3; + } else if (blk1->yMin == blk1->yMax) { + col2 = blk1->col; + } else { + col2 = blk1->col + (int)(((blk0->yMax - blk1->yMax) / + (blk1->yMin - blk1->yMax)) * + blk1->nColumns); + } + break; + } + if (col2 > col1) { + col1 = col2; + } + } + blk0->col = col1; + for (line = blk0->lines; line; line = line->next) { + for (j = 0; j <= line->len; ++j) { + line->col[j] += col1; + } + } + } + +#if 0 // for debugging + printf("*** blocks, after column assignment ***\n"); + for (blk = blkList; blk; blk = blk->next) { + printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f col=%d nCols=%d\n", + blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax, blk->col, + blk->nColumns); + for (line = blk->lines; line; line = line->next) { + printf(" line:\n"); + for (word0 = line->words; word0; word0 = word0->next) { + printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '", + word0->xMin, word0->xMax, word0->yMin, word0->yMax, + word0->base, word0->fontSize, word0->spaceAfter); + for (i = 0; i < word0->len; ++i) { + fputc(word0->text[i] & 0xff, stdout); + } + printf("'\n"); + } + } + } + printf("\n"); +#endif + + //----- reading order sort + + // sort blocks into yx order (in preparation for reading order sort) + qsort(blocks, nBlocks, sizeof(TextBlock *), &TextBlock::cmpYXPrimaryRot); + + // compute space on left and right sides of each block + for (i = 0; i < nBlocks; ++i) { + blk0 = blocks[i]; + for (j = 0; j < nBlocks; ++j) { + blk1 = blocks[j]; + if (blk1 != blk0) { + blk0->updatePriMinMax(blk1); + } + } + } + +#if 0 // for debugging + printf("*** blocks, after yx sort ***\n"); + for (i = 0; i < nBlocks; ++i) { + blk = blocks[i]; + printf("block: rot=%d x=%.2f..%.2f y=%.2f..%.2f space=%.2f..%.2f\n", + blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax, + blk->priMin, blk->priMax); + for (line = blk->lines; line; line = line->next) { + printf(" line:\n"); + for (word0 = line->words; word0; word0 = word0->next) { + printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '", + word0->xMin, word0->xMax, word0->yMin, word0->yMax, + word0->base, word0->fontSize, word0->spaceAfter); + for (j = 0; j < word0->len; ++j) { + fputc(word0->text[j] & 0xff, stdout); + } + printf("'\n"); + } + } + } + printf("\n"); +#endif + + // build the flows + //~ this needs to be adjusted for writing mode (vertical text) + //~ this also needs to account for right-to-left column ordering + blkArray = (TextBlock **)gmallocn(nBlocks, sizeof(TextBlock *)); + memcpy(blkArray, blocks, nBlocks * sizeof(TextBlock *)); + flows = lastFlow = NULL; + firstBlkIdx = 0; + nBlocksLeft = nBlocks; + while (nBlocksLeft > 0) { + + // find the upper-left-most block + for (; !blkArray[firstBlkIdx]; ++firstBlkIdx) ; + i = firstBlkIdx; + blk = blkArray[i]; + for (j = firstBlkIdx + 1; j < nBlocks; ++j) { + blk1 = blkArray[j]; + if (blk1) { + if (blk && blk->secondaryDelta(blk1) > 0) { + break; + } + if (blk1->primaryCmp(blk) < 0) { + i = j; + blk = blk1; + } + } + } + blkArray[i] = NULL; + --nBlocksLeft; + blk->next = NULL; + + // create a new flow, starting with the upper-left-most block + flow = new TextFlow(this, blk); + if (lastFlow) { + lastFlow->next = flow; + } else { + flows = flow; + } + lastFlow = flow; + fontSize = blk->lines->words->fontSize; + + // push the upper-left-most block on the stack + blk->stackNext = NULL; + blkStack = blk; + + // find the other blocks in this flow + while (blkStack) { + + // find the upper-left-most block under (but within + // maxBlockSpacing of) the top block on the stack + blkSpace = maxBlockSpacing * blkStack->lines->words->fontSize; + blk = NULL; + i = -1; + for (j = firstBlkIdx; j < nBlocks; ++j) { + blk1 = blkArray[j]; + if (blk1) { + if (blkStack->secondaryDelta(blk1) > blkSpace) { + break; + } + if (blk && blk->secondaryDelta(blk1) > 0) { + break; + } + if (blk1->isBelow(blkStack) && + (!blk || blk1->primaryCmp(blk) < 0)) { + i = j; + blk = blk1; + } + } + } + + // if a suitable block was found, add it to the flow and push it + // onto the stack + if (blk && flow->blockFits(blk, blkStack)) { + blkArray[i] = NULL; + --nBlocksLeft; + blk->next = NULL; + flow->addBlock(blk); + fontSize = blk->lines->words->fontSize; + blk->stackNext = blkStack; + blkStack = blk; + + // otherwise (if there is no block under the top block or the + // block is not suitable), pop the stack + } else { + blkStack = blkStack->stackNext; + } + } + } + gfree(blkArray); + +#if 0 // for debugging + printf("*** flows ***\n"); + for (flow = flows; flow; flow = flow->next) { + printf("flow: x=%.2f..%.2f y=%.2f..%.2f pri:%.2f..%.2f\n", + flow->xMin, flow->xMax, flow->yMin, flow->yMax, + flow->priMin, flow->priMax); + for (blk = flow->blocks; blk; blk = blk->next) { + printf(" block: rot=%d x=%.2f..%.2f y=%.2f..%.2f pri=%.2f..%.2f\n", + blk->rot, blk->xMin, blk->xMax, blk->yMin, blk->yMax, + blk->priMin, blk->priMax); + for (line = blk->lines; line; line = line->next) { + printf(" line:\n"); + for (word0 = line->words; word0; word0 = word0->next) { + printf(" word: x=%.2f..%.2f y=%.2f..%.2f base=%.2f fontSize=%.2f space=%d: '", + word0->xMin, word0->xMax, word0->yMin, word0->yMax, + word0->base, word0->fontSize, word0->spaceAfter); + for (i = 0; i < word0->len; ++i) { + fputc(word0->text[i] & 0xff, stdout); + } + printf("'\n"); + } + } + } + } + printf("\n"); +#endif + + if (uMap) { + uMap->decRefCnt(); + } +} + +GBool TextPage::findText(Unicode *s, int len, + GBool startAtTop, GBool stopAtBottom, + GBool startAtLast, GBool stopAtLast, + GBool caseSensitive, GBool backward, + double *xMin, double *yMin, + double *xMax, double *yMax) { + TextBlock *blk; + TextLine *line; + Unicode *s2, *txt; + Unicode *p; + int txtSize, m, i, j, k; + double xStart, yStart, xStop, yStop; + double xMin0, yMin0, xMax0, yMax0; + double xMin1, yMin1, xMax1, yMax1; + GBool found; + + //~ needs to handle right-to-left text + + if (rawOrder) { + return gFalse; + } + + // convert the search string to uppercase + if (!caseSensitive) { + s2 = (Unicode *)gmallocn(len, sizeof(Unicode)); + for (i = 0; i < len; ++i) { + s2[i] = unicodeToUpper(s[i]); + } + } else { + s2 = s; + } + + txt = NULL; + txtSize = 0; + + xStart = yStart = xStop = yStop = 0; + if (startAtLast && haveLastFind) { + xStart = lastFindXMin; + yStart = lastFindYMin; + } else if (!startAtTop) { + xStart = *xMin; + yStart = *yMin; + } + if (stopAtLast && haveLastFind) { + xStop = lastFindXMin; + yStop = lastFindYMin; + } else if (!stopAtBottom) { + xStop = *xMax; + yStop = *yMax; + } + + found = gFalse; + xMin0 = xMax0 = yMin0 = yMax0 = 0; // make gcc happy + xMin1 = xMax1 = yMin1 = yMax1 = 0; // make gcc happy + + for (i = backward ? nBlocks - 1 : 0; + backward ? i >= 0 : i < nBlocks; + i += backward ? -1 : 1) { + blk = blocks[i]; + + // check: is the block above the top limit? + if (!startAtTop && (backward ? blk->yMin > yStart : blk->yMax < yStart)) { + continue; + } + + // check: is the block below the bottom limit? + if (!stopAtBottom && (backward ? blk->yMax < yStop : blk->yMin > yStop)) { + break; + } + + for (line = blk->lines; line; line = line->next) { + + // check: is the line above the top limit? + if (!startAtTop && + (backward ? line->yMin > yStart : line->yMin < yStart)) { + continue; + } + + // check: is the line below the bottom limit? + if (!stopAtBottom && + (backward ? line->yMin < yStop : line->yMin > yStop)) { + continue; + } + + // convert the line to uppercase + m = line->len; + if (!caseSensitive) { + if (m > txtSize) { + txt = (Unicode *)greallocn(txt, m, sizeof(Unicode)); + txtSize = m; + } + for (k = 0; k < m; ++k) { + txt[k] = unicodeToUpper(line->text[k]); + } + } else { + txt = line->text; + } + + // search each position in this line + j = backward ? m - len : 0; + p = txt + j; + while (backward ? j >= 0 : j <= m - len) { + + // compare the strings + for (k = 0; k < len; ++k) { + if (p[k] != s2[k]) { + break; + } + } + + // found it + if (k == len) { + switch (line->rot) { + case 0: + xMin1 = line->edge[j]; + xMax1 = line->edge[j + len]; + yMin1 = line->yMin; + yMax1 = line->yMax; + break; + case 1: + xMin1 = line->xMin; + xMax1 = line->xMax; + yMin1 = line->edge[j]; + yMax1 = line->edge[j + len]; + break; + case 2: + xMin1 = line->edge[j + len]; + xMax1 = line->edge[j]; + yMin1 = line->yMin; + yMax1 = line->yMax; + break; + case 3: + xMin1 = line->xMin; + xMax1 = line->xMax; + yMin1 = line->edge[j + len]; + yMax1 = line->edge[j]; + break; + } + if (backward) { + if ((startAtTop || + yMin1 < yStart || (yMin1 == yStart && xMin1 < xStart)) && + (stopAtBottom || + yMin1 > yStop || (yMin1 == yStop && xMin1 > xStop))) { + if (!found || + yMin1 > yMin0 || (yMin1 == yMin0 && xMin1 > xMin0)) { + xMin0 = xMin1; + xMax0 = xMax1; + yMin0 = yMin1; + yMax0 = yMax1; + found = gTrue; + } + } + } else { + if ((startAtTop || + yMin1 > yStart || (yMin1 == yStart && xMin1 > xStart)) && + (stopAtBottom || + yMin1 < yStop || (yMin1 == yStop && xMin1 < xStop))) { + if (!found || + yMin1 < yMin0 || (yMin1 == yMin0 && xMin1 < xMin0)) { + xMin0 = xMin1; + xMax0 = xMax1; + yMin0 = yMin1; + yMax0 = yMax1; + found = gTrue; + } + } + } + } + if (backward) { + --j; + --p; + } else { + ++j; + ++p; + } + } + } + } + + if (!caseSensitive) { + gfree(s2); + gfree(txt); + } + + if (found) { + *xMin = xMin0; + *xMax = xMax0; + *yMin = yMin0; + *yMax = yMax0; + lastFindXMin = xMin0; + lastFindYMin = yMin0; + haveLastFind = gTrue; + return gTrue; + } + + return gFalse; +} + +GString *TextPage::getText(double xMin, double yMin, + double xMax, double yMax) { + GString *s; + UnicodeMap *uMap; + GBool isUnicode; + TextBlock *blk; + TextLine *line; + TextLineFrag *frags; + int nFrags, fragsSize; + TextLineFrag *frag; + char space[8], eol[16]; + int spaceLen, eolLen; + int lastRot; + double x, y, delta; + int col, idx0, idx1, i, j; + GBool multiLine, oneRot; + + s = new GString(); + + if (rawOrder) { + return s; + } + + // get the output encoding + if (!(uMap = globalParams->getTextEncoding())) { + return s; + } + isUnicode = uMap->isUnicode(); + spaceLen = uMap->mapUnicode(0x20, space, sizeof(space)); + eolLen = 0; // make gcc happy + switch (globalParams->getTextEOL()) { + case eolUnix: + eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol)); + break; + case eolDOS: + eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol)); + eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen); + break; + case eolMac: + eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol)); + break; + } + + //~ writing mode (horiz/vert) + + // collect the line fragments that are in the rectangle + fragsSize = 256; + frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag)); + nFrags = 0; + lastRot = -1; + oneRot = gTrue; + for (i = 0; i < nBlocks; ++i) { + blk = blocks[i]; + if (xMin < blk->xMax && blk->xMin < xMax && + yMin < blk->yMax && blk->yMin < yMax) { + for (line = blk->lines; line; line = line->next) { + if (xMin < line->xMax && line->xMin < xMax && + yMin < line->yMax && line->yMin < yMax) { + idx0 = idx1 = -1; + switch (line->rot) { + case 0: + y = 0.5 * (line->yMin + line->yMax); + if (yMin < y && y < yMax) { + j = 0; + while (j < line->len) { + if (0.5 * (line->edge[j] + line->edge[j+1]) > xMin) { + idx0 = j; + break; + } + ++j; + } + j = line->len - 1; + while (j >= 0) { + if (0.5 * (line->edge[j] + line->edge[j+1]) < xMax) { + idx1 = j; + break; + } + --j; + } + } + break; + case 1: + x = 0.5 * (line->xMin + line->xMax); + if (xMin < x && x < xMax) { + j = 0; + while (j < line->len) { + if (0.5 * (line->edge[j] + line->edge[j+1]) > yMin) { + idx0 = j; + break; + } + ++j; + } + j = line->len - 1; + while (j >= 0) { + if (0.5 * (line->edge[j] + line->edge[j+1]) < yMax) { + idx1 = j; + break; + } + --j; + } + } + break; + case 2: + y = 0.5 * (line->yMin + line->yMax); + if (yMin < y && y < yMax) { + j = 0; + while (j < line->len) { + if (0.5 * (line->edge[j] + line->edge[j+1]) < xMax) { + idx0 = j; + break; + } + ++j; + } + j = line->len - 1; + while (j >= 0) { + if (0.5 * (line->edge[j] + line->edge[j+1]) > xMin) { + idx1 = j; + break; + } + --j; + } + } + break; + case 3: + x = 0.5 * (line->xMin + line->xMax); + if (xMin < x && x < xMax) { + j = 0; + while (j < line->len) { + if (0.5 * (line->edge[j] + line->edge[j+1]) < yMax) { + idx0 = j; + break; + } + ++j; + } + j = line->len - 1; + while (j >= 0) { + if (0.5 * (line->edge[j] + line->edge[j+1]) > yMin) { + idx1 = j; + break; + } + --j; + } + } + break; + } + if (idx0 >= 0 && idx1 >= 0) { + if (nFrags == fragsSize) { + fragsSize *= 2; + frags = (TextLineFrag *) + greallocn(frags, fragsSize, sizeof(TextLineFrag)); + } + frags[nFrags].init(line, idx0, idx1 - idx0 + 1); + ++nFrags; + if (lastRot >= 0 && line->rot != lastRot) { + oneRot = gFalse; + } + lastRot = line->rot; + } + } + } + } + } + + // sort the fragments and generate the string + if (nFrags > 0) { + + for (i = 0; i < nFrags; ++i) { + frags[i].computeCoords(oneRot); + } + assignColumns(frags, nFrags, oneRot); + + // if all lines in the region have the same rotation, use it; + // otherwise, use the page's primary rotation + if (oneRot) { + qsort(frags, nFrags, sizeof(TextLineFrag), + &TextLineFrag::cmpYXLineRot); + } else { + qsort(frags, nFrags, sizeof(TextLineFrag), + &TextLineFrag::cmpYXPrimaryRot); + } + i = 0; + while (i < nFrags) { + delta = maxIntraLineDelta * frags[i].line->words->fontSize; + for (j = i+1; + j < nFrags && fabs(frags[j].base - frags[i].base) < delta; + ++j) ; + qsort(frags + i, j - i, sizeof(TextLineFrag), + oneRot ? &TextLineFrag::cmpXYColumnLineRot + : &TextLineFrag::cmpXYColumnPrimaryRot); + i = j; + } + + col = 0; + multiLine = gFalse; + for (i = 0; i < nFrags; ++i) { + frag = &frags[i]; + + // insert a return + if (frag->col < col || + (i > 0 && fabs(frag->base - frags[i-1].base) > + maxIntraLineDelta * frags[i-1].line->words->fontSize)) { + s->append(eol, eolLen); + col = 0; + multiLine = gTrue; + } + + // column alignment + for (; col < frag->col; ++col) { + s->append(space, spaceLen); + } + + // get the fragment text + col += dumpFragment(frag->line->text + frag->start, frag->len, uMap, s); + } + + if (multiLine) { + s->append(eol, eolLen); + } + } + + gfree(frags); + uMap->decRefCnt(); + + return s; +} + +GBool TextPage::findCharRange(int pos, int length, + double *xMin, double *yMin, + double *xMax, double *yMax) { + TextBlock *blk; + TextLine *line; + TextWord *word; + double xMin0, xMax0, yMin0, yMax0; + double xMin1, xMax1, yMin1, yMax1; + GBool first; + int i, j0, j1; + + if (rawOrder) { + return gFalse; + } + + //~ this doesn't correctly handle: + //~ - ranges split across multiple lines (the highlighted region + //~ is the bounding box of all the parts of the range) + //~ - cases where characters don't convert one-to-one into Unicode + first = gTrue; + xMin0 = xMax0 = yMin0 = yMax0 = 0; // make gcc happy + xMin1 = xMax1 = yMin1 = yMax1 = 0; // make gcc happy + for (i = 0; i < nBlocks; ++i) { + blk = blocks[i]; + for (line = blk->lines; line; line = line->next) { + for (word = line->words; word; word = word->next) { + if (pos < word->charPos + word->charLen && + word->charPos < pos + length) { + j0 = pos - word->charPos; + if (j0 < 0) { + j0 = 0; + } + j1 = pos + length - 1 - word->charPos; + if (j1 >= word->len) { + j1 = word->len - 1; + } + switch (line->rot) { + case 0: + xMin1 = word->edge[j0]; + xMax1 = word->edge[j1 + 1]; + yMin1 = word->yMin; + yMax1 = word->yMax; + break; + case 1: + xMin1 = word->xMin; + xMax1 = word->xMax; + yMin1 = word->edge[j0]; + yMax1 = word->edge[j1 + 1]; + break; + case 2: + xMin1 = word->edge[j1 + 1]; + xMax1 = word->edge[j0]; + yMin1 = word->yMin; + yMax1 = word->yMax; + break; + case 3: + xMin1 = word->xMin; + xMax1 = word->xMax; + yMin1 = word->edge[j1 + 1]; + yMax1 = word->edge[j0]; + break; + } + if (first || xMin1 < xMin0) { + xMin0 = xMin1; + } + if (first || xMax1 > xMax0) { + xMax0 = xMax1; + } + if (first || yMin1 < yMin0) { + yMin0 = yMin1; + } + if (first || yMax1 > yMax0) { + yMax0 = yMax1; + } + first = gFalse; + } + } + } + } + if (!first) { + *xMin = xMin0; + *xMax = xMax0; + *yMin = yMin0; + *yMax = yMax0; + return gTrue; + } + return gFalse; +} + +void TextPage::dump(void *outputStream, TextOutputFunc outputFunc, + GBool physLayout) { + UnicodeMap *uMap; + TextFlow *flow; + TextBlock *blk; + TextLine *line; + TextLineFrag *frags; + TextWord *word; + int nFrags, fragsSize; + TextLineFrag *frag; + char space[8], eol[16], eop[8]; + int spaceLen, eolLen, eopLen; + GBool pageBreaks; + GString *s; + double delta; + int col, i, j, d, n; + + // get the output encoding + if (!(uMap = globalParams->getTextEncoding())) { + return; + } + spaceLen = uMap->mapUnicode(0x20, space, sizeof(space)); + eolLen = 0; // make gcc happy + switch (globalParams->getTextEOL()) { + case eolUnix: + eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol)); + break; + case eolDOS: + eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol)); + eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen); + break; + case eolMac: + eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol)); + break; + } + eopLen = uMap->mapUnicode(0x0c, eop, sizeof(eop)); + pageBreaks = globalParams->getTextPageBreaks(); + + //~ writing mode (horiz/vert) + + // output the page in raw (content stream) order + if (rawOrder) { + + for (word = rawWords; word; word = word->next) { + s = new GString(); + dumpFragment(word->text, word->len, uMap, s); + (*outputFunc)(outputStream, s->getCString(), s->getLength()); + delete s; + if (word->next && + fabs(word->next->base - word->base) < + maxIntraLineDelta * word->fontSize) { + if (word->next->xMin > word->xMax + minWordSpacing * word->fontSize) { + (*outputFunc)(outputStream, space, spaceLen); + } + } else { + (*outputFunc)(outputStream, eol, eolLen); + } + } + + // output the page, maintaining the original physical layout + } else if (physLayout) { + + // collect the line fragments for the page and sort them + fragsSize = 256; + frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag)); + nFrags = 0; + for (i = 0; i < nBlocks; ++i) { + blk = blocks[i]; + for (line = blk->lines; line; line = line->next) { + if (nFrags == fragsSize) { + fragsSize *= 2; + frags = (TextLineFrag *)greallocn(frags, + fragsSize, sizeof(TextLineFrag)); + } + frags[nFrags].init(line, 0, line->len); + frags[nFrags].computeCoords(gTrue); + ++nFrags; + } + } + qsort(frags, nFrags, sizeof(TextLineFrag), &TextLineFrag::cmpYXPrimaryRot); + i = 0; + while (i < nFrags) { + delta = maxIntraLineDelta * frags[i].line->words->fontSize; + for (j = i+1; + j < nFrags && fabs(frags[j].base - frags[i].base) < delta; + ++j) ; + qsort(frags + i, j - i, sizeof(TextLineFrag), + &TextLineFrag::cmpXYColumnPrimaryRot); + i = j; + } + +#if 0 // for debugging + printf("*** line fragments ***\n"); + for (i = 0; i < nFrags; ++i) { + frag = &frags[i]; + printf("frag: x=%.2f..%.2f y=%.2f..%.2f base=%.2f '", + frag->xMin, frag->xMax, frag->yMin, frag->yMax, frag->base); + for (n = 0; n < frag->len; ++n) { + fputc(frag->line->text[frag->start + n] & 0xff, stdout); + } + printf("'\n"); + } + printf("\n"); +#endif + + // generate output + col = 0; + for (i = 0; i < nFrags; ++i) { + frag = &frags[i]; + + // column alignment + for (; col < frag->col; ++col) { + (*outputFunc)(outputStream, space, spaceLen); + } + + // print the line + s = new GString(); + col += dumpFragment(frag->line->text + frag->start, frag->len, uMap, s); + (*outputFunc)(outputStream, s->getCString(), s->getLength()); + delete s; + + // print one or more returns if necessary + if (i == nFrags - 1 || + frags[i+1].col < col || + fabs(frags[i+1].base - frag->base) > + maxIntraLineDelta * frag->line->words->fontSize) { + if (i < nFrags - 1) { + d = (int)((frags[i+1].base - frag->base) / + frag->line->words->fontSize); + if (d < 1) { + d = 1; + } else if (d > 5) { + d = 5; + } + } else { + d = 1; + } + for (; d > 0; --d) { + (*outputFunc)(outputStream, eol, eolLen); + } + col = 0; + } + } + + gfree(frags); + + // output the page, "undoing" the layout + } else { + for (flow = flows; flow; flow = flow->next) { + for (blk = flow->blocks; blk; blk = blk->next) { + for (line = blk->lines; line; line = line->next) { + n = line->len; + if (line->hyphenated && (line->next || blk->next)) { + --n; + } + s = new GString(); + dumpFragment(line->text, n, uMap, s); + (*outputFunc)(outputStream, s->getCString(), s->getLength()); + delete s; + if (!line->hyphenated) { + if (line->next) { + (*outputFunc)(outputStream, space, spaceLen); + } else if (blk->next) { + //~ this is a bit of a kludge - we should really do a more + //~ intelligent determination of paragraphs + if (blk->next->lines->words->fontSize == + blk->lines->words->fontSize) { + (*outputFunc)(outputStream, space, spaceLen); + } else { + (*outputFunc)(outputStream, eol, eolLen); + } + } + } + } + } + (*outputFunc)(outputStream, eol, eolLen); + (*outputFunc)(outputStream, eol, eolLen); + } + } + + // end of page + if (pageBreaks) { + (*outputFunc)(outputStream, eop, eopLen); + } + + uMap->decRefCnt(); +} + +void TextPage::assignColumns(TextLineFrag *frags, int nFrags, GBool oneRot) { + TextLineFrag *frag0, *frag1; + int rot, col1, col2, i, j, k; + + // all text in the region has the same rotation -- recompute the + // column numbers based only on the text in the region + if (oneRot) { + qsort(frags, nFrags, sizeof(TextLineFrag), &TextLineFrag::cmpXYLineRot); + rot = frags[0].line->rot; + for (i = 0; i < nFrags; ++i) { + frag0 = &frags[i]; + col1 = 0; + for (j = 0; j < i; ++j) { + frag1 = &frags[j]; + col2 = 0; // make gcc happy + switch (rot) { + case 0: + if (frag0->xMin >= frag1->xMax) { + col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] - + frag1->line->col[frag1->start]) + 1; + } else { + for (k = frag1->start; + k < frag1->start + frag1->len && + frag0->xMin >= 0.5 * (frag1->line->edge[k] + + frag1->line->edge[k+1]); + ++k) ; + col2 = frag1->col + + frag1->line->col[k] - frag1->line->col[frag1->start]; + } + break; + case 1: + if (frag0->yMin >= frag1->yMax) { + col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] - + frag1->line->col[frag1->start]) + 1; + } else { + for (k = frag1->start; + k < frag1->start + frag1->len && + frag0->yMin >= 0.5 * (frag1->line->edge[k] + + frag1->line->edge[k+1]); + ++k) ; + col2 = frag1->col + + frag1->line->col[k] - frag1->line->col[frag1->start]; + } + break; + case 2: + if (frag0->xMax <= frag1->xMin) { + col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] - + frag1->line->col[frag1->start]) + 1; + } else { + for (k = frag1->start; + k < frag1->start + frag1->len && + frag0->xMax <= 0.5 * (frag1->line->edge[k] + + frag1->line->edge[k+1]); + ++k) ; + col2 = frag1->col + + frag1->line->col[k] - frag1->line->col[frag1->start]; + } + break; + case 3: + if (frag0->yMax <= frag1->yMin) { + col2 = frag1->col + (frag1->line->col[frag1->start + frag1->len] - + frag1->line->col[frag1->start]) + 1; + } else { + for (k = frag1->start; + k < frag1->start + frag1->len && + frag0->yMax <= 0.5 * (frag1->line->edge[k] + + frag1->line->edge[k+1]); + ++k) ; + col2 = frag1->col + + frag1->line->col[k] - frag1->line->col[frag1->start]; + } + break; + } + if (col2 > col1) { + col1 = col2; + } + } + frag0->col = col1; + } + + // the region includes text at different rotations -- use the + // globally assigned column numbers, offset by the minimum column + // number (i.e., shift everything over to column 0) + } else { + col1 = frags[0].col; + for (i = 1; i < nFrags; ++i) { + if (frags[i].col < col1) { + col1 = frags[i].col; + } + } + for (i = 0; i < nFrags; ++i) { + frags[i].col -= col1; + } + } +} + +int TextPage::dumpFragment(Unicode *text, int len, UnicodeMap *uMap, + GString *s) { + char lre[8], rle[8], popdf[8], buf[8]; + int lreLen, rleLen, popdfLen, n; + int nCols, i, j, k; + + nCols = 0; + + if (uMap->isUnicode()) { + + lreLen = uMap->mapUnicode(0x202a, lre, sizeof(lre)); + rleLen = uMap->mapUnicode(0x202b, rle, sizeof(rle)); + popdfLen = uMap->mapUnicode(0x202c, popdf, sizeof(popdf)); + + if (primaryLR) { + + i = 0; + while (i < len) { + // output a left-to-right section + for (j = i; j < len && !unicodeTypeR(text[j]); ++j) ; + for (k = i; k < j; ++k) { + n = uMap->mapUnicode(text[k], buf, sizeof(buf)); + s->append(buf, n); + ++nCols; + } + i = j; + // output a right-to-left section + for (j = i; j < len && !unicodeTypeL(text[j]); ++j) ; + if (j > i) { + s->append(rle, rleLen); + for (k = j - 1; k >= i; --k) { + n = uMap->mapUnicode(text[k], buf, sizeof(buf)); + s->append(buf, n); + ++nCols; + } + s->append(popdf, popdfLen); + i = j; + } + } + + } else { + + s->append(rle, rleLen); + i = len - 1; + while (i >= 0) { + // output a right-to-left section + for (j = i; j >= 0 && !unicodeTypeL(text[j]); --j) ; + for (k = i; k > j; --k) { + n = uMap->mapUnicode(text[k], buf, sizeof(buf)); + s->append(buf, n); + ++nCols; + } + i = j; + // output a left-to-right section + for (j = i; j >= 0 && !unicodeTypeR(text[j]); --j) ; + if (j < i) { + s->append(lre, lreLen); + for (k = j + 1; k <= i; ++k) { + n = uMap->mapUnicode(text[k], buf, sizeof(buf)); + s->append(buf, n); + ++nCols; + } + s->append(popdf, popdfLen); + i = j; + } + } + s->append(popdf, popdfLen); + + } + + } else { + for (i = 0; i < len; ++i) { + n = uMap->mapUnicode(text[i], buf, sizeof(buf)); + s->append(buf, n); + nCols += n; + } + } + + return nCols; +} + +#if TEXTOUT_WORD_LIST +TextWordList *TextPage::makeWordList(GBool physLayout) { + return new TextWordList(this, physLayout); +} +#endif + +//------------------------------------------------------------------------ +// TextOutputDev +//------------------------------------------------------------------------ + +static void outputToFile(void *stream, char *text, int len) { + fwrite(text, 1, len, (FILE *)stream); +} + +TextOutputDev::TextOutputDev(char *fileName, GBool physLayoutA, + GBool rawOrderA, GBool append) { + text = NULL; + physLayout = physLayoutA; + rawOrder = rawOrderA; + doHTML = gFalse; + ok = gTrue; + + // open file + needClose = gFalse; + if (fileName) { + if (!strcmp(fileName, "-")) { + outputStream = stdout; +#ifdef WIN32 + // keep DOS from munging the end-of-line characters + setmode(fileno(stdout), O_BINARY); +#endif + } else if ((outputStream = fopen(fileName, append ? "ab" : "wb"))) { + needClose = gTrue; + } else { + error(-1, "Couldn't open text file '%s'", fileName); + ok = gFalse; + return; + } + outputFunc = &outputToFile; + } else { + outputStream = NULL; + } + + // set up text object + text = new TextPage(rawOrderA); +} + +TextOutputDev::TextOutputDev(TextOutputFunc func, void *stream, + GBool physLayoutA, GBool rawOrderA) { + outputFunc = func; + outputStream = stream; + needClose = gFalse; + physLayout = physLayoutA; + rawOrder = rawOrderA; + doHTML = gFalse; + text = new TextPage(rawOrderA); + ok = gTrue; +} + +TextOutputDev::~TextOutputDev() { + if (needClose) { +#ifdef MACOS + ICS_MapRefNumAndAssign((short)((FILE *)outputStream)->handle); +#endif + fclose((FILE *)outputStream); + } + if (text) { + delete text; + } +} + +void TextOutputDev::startPage(int pageNum, GfxState *state) { + text->startPage(state); +} + +void TextOutputDev::endPage() { + text->endPage(); + text->coalesce(physLayout, doHTML); + if (outputStream) { + text->dump(outputStream, outputFunc, physLayout); + } +} + +void TextOutputDev::updateFont(GfxState *state) { + text->updateFont(state); +} + +void TextOutputDev::beginString(GfxState *state, GString *s) { +} + +void TextOutputDev::endString(GfxState *state) { +} + +void TextOutputDev::drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode c, int nBytes, Unicode *u, int uLen) { + text->addChar(state, x, y, dx, dy, c, nBytes, u, uLen); +} + +void TextOutputDev::stroke(GfxState *state) { + GfxPath *path; + GfxSubpath *subpath; + double x[2], y[2]; + + if (!doHTML) { + return; + } + path = state->getPath(); + if (path->getNumSubpaths() != 1) { + return; + } + subpath = path->getSubpath(0); + if (subpath->getNumPoints() != 2) { + return; + } + state->transform(subpath->getX(0), subpath->getY(0), &x[0], &y[0]); + state->transform(subpath->getX(1), subpath->getY(1), &x[1], &y[1]); + + // look for a vertical or horizontal line + if (x[0] == x[1] || y[0] == y[1]) { + text->addUnderline(x[0], y[0], x[1], y[1]); + } +} + +void TextOutputDev::fill(GfxState *state) { + GfxPath *path; + GfxSubpath *subpath; + double x[5], y[5]; + double rx0, ry0, rx1, ry1, t; + int i; + + if (!doHTML) { + return; + } + path = state->getPath(); + if (path->getNumSubpaths() != 1) { + return; + } + subpath = path->getSubpath(0); + if (subpath->getNumPoints() != 5) { + return; + } + for (i = 0; i < 5; ++i) { + if (subpath->getCurve(i)) { + return; + } + state->transform(subpath->getX(i), subpath->getY(i), &x[i], &y[i]); + } + + // look for a rectangle + if (x[0] == x[1] && y[1] == y[2] && x[2] == x[3] && y[3] == y[4] && + x[0] == x[4] && y[0] == y[4]) { + rx0 = x[0]; + ry0 = y[0]; + rx1 = x[2]; + ry1 = y[1]; + } else if (y[0] == y[1] && x[1] == x[2] && y[2] == y[3] && x[3] == x[4] && + x[0] == x[4] && y[0] == y[4]) { + rx0 = x[0]; + ry0 = y[0]; + rx1 = x[1]; + ry1 = y[2]; + } else { + return; + } + if (rx1 < rx0) { + t = rx0; + rx0 = rx1; + rx1 = t; + } + if (ry1 < ry0) { + t = ry0; + ry0 = ry1; + ry1 = t; + } + + // skinny horizontal rectangle + if (ry1 - ry0 < rx1 - rx0) { + if (ry1 - ry0 < maxUnderlineWidth) { + ry0 = 0.5 * (ry0 + ry1); + text->addUnderline(rx0, ry0, rx1, ry0); + } + + // skinny vertical rectangle + } else { + if (rx1 - rx0 < maxUnderlineWidth) { + rx0 = 0.5 * (rx0 + rx1); + text->addUnderline(rx0, ry0, rx0, ry1); + } + } +} + +void TextOutputDev::eoFill(GfxState *state) { + if (!doHTML) { + return; + } + fill(state); +} + +void TextOutputDev::processLink(Link *link, Catalog *catalog) { + double x1, y1, x2, y2; + int xMin, yMin, xMax, yMax, x, y; + + if (!doHTML) { + return; + } + link->getRect(&x1, &y1, &x2, &y2); + cvtUserToDev(x1, y1, &x, &y); + xMin = xMax = x; + yMin = yMax = y; + cvtUserToDev(x1, y2, &x, &y); + if (x < xMin) { + xMin = x; + } else if (x > xMax) { + xMax = x; + } + if (y < yMin) { + yMin = y; + } else if (y > yMax) { + yMax = y; + } + cvtUserToDev(x2, y1, &x, &y); + if (x < xMin) { + xMin = x; + } else if (x > xMax) { + xMax = x; + } + if (y < yMin) { + yMin = y; + } else if (y > yMax) { + yMax = y; + } + cvtUserToDev(x2, y2, &x, &y); + if (x < xMin) { + xMin = x; + } else if (x > xMax) { + xMax = x; + } + if (y < yMin) { + yMin = y; + } else if (y > yMax) { + yMax = y; + } + text->addLink(xMin, yMin, xMax, yMax, link); +} + +GBool TextOutputDev::findText(Unicode *s, int len, + GBool startAtTop, GBool stopAtBottom, + GBool startAtLast, GBool stopAtLast, + GBool caseSensitive, GBool backward, + double *xMin, double *yMin, + double *xMax, double *yMax) { + return text->findText(s, len, startAtTop, stopAtBottom, + startAtLast, stopAtLast, caseSensitive, backward, + xMin, yMin, xMax, yMax); +} + +GString *TextOutputDev::getText(double xMin, double yMin, + double xMax, double yMax) { + return text->getText(xMin, yMin, xMax, yMax); +} + +GBool TextOutputDev::findCharRange(int pos, int length, + double *xMin, double *yMin, + double *xMax, double *yMax) { + return text->findCharRange(pos, length, xMin, yMin, xMax, yMax); +} + +#if TEXTOUT_WORD_LIST +TextWordList *TextOutputDev::makeWordList() { + return text->makeWordList(physLayout); +} +#endif + +TextPage *TextOutputDev::takeText() { + TextPage *ret; + + ret = text; + text = new TextPage(rawOrder); + return ret; +} diff -Nru swftools-0.9.0/lib/pdf/xpdf/TextOutputDev.h swftools-0.9.2/lib/pdf/xpdf/TextOutputDev.h --- swftools-0.9.0/lib/pdf/xpdf/TextOutputDev.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/TextOutputDev.h 2012-04-08 17:26:34.000000000 +0000 @@ -0,0 +1,662 @@ +//======================================================================== +// +// TextOutputDev.h +// +// Copyright 1997-2003 Glyph & Cog, LLC +// +//======================================================================== + +#ifndef TEXTOUTPUTDEV_H +#define TEXTOUTPUTDEV_H + +#include + +#ifdef USE_GCC_PRAGMAS +#pragma interface +#endif + +#include +#include "gtypes.h" +#include "GfxFont.h" +#include "OutputDev.h" + +class GString; +class GList; +class GfxFont; +class GfxState; +class UnicodeMap; +class Link; + +class TextWord; +class TextPool; +class TextLine; +class TextLineFrag; +class TextBlock; +class TextFlow; +class TextWordList; +class TextPage; + +//------------------------------------------------------------------------ + +typedef void (*TextOutputFunc)(void *stream, char *text, int len); + +//------------------------------------------------------------------------ +// TextFontInfo +//------------------------------------------------------------------------ + +class TextFontInfo { +public: + + TextFontInfo(GfxState *state); + ~TextFontInfo(); + + GBool matches(GfxState *state); + +#if TEXTOUT_WORD_LIST + // Get the font name (which may be NULL). + GString *getFontName() { return fontName; } + + // Get font descriptor flags. + GBool isFixedWidth() { return flags & fontFixedWidth; } + GBool isSerif() { return flags & fontSerif; } + GBool isSymbolic() { return flags & fontSymbolic; } + GBool isItalic() { return flags & fontItalic; } + GBool isBold() { return flags & fontBold; } +#endif + +private: + + GfxFont *gfxFont; +#if TEXTOUT_WORD_LIST + GString *fontName; + int flags; +#endif + + friend class TextWord; + friend class TextPage; +}; + +//------------------------------------------------------------------------ +// TextWord +//------------------------------------------------------------------------ + +class TextWord { +public: + + // Constructor. + TextWord(GfxState *state, int rotA, double x0, double y0, + int charPosA, TextFontInfo *fontA, double fontSize); + + // Destructor. + ~TextWord(); + + // Add a character to the word. + void addChar(GfxState *state, double x, double y, + double dx, double dy, Unicode u); + + // Merge onto the end of . + void merge(TextWord *word); + + // Compares to , returning -1 (<), 0 (=), or +1 (>), + // based on a primary-axis comparison, e.g., x ordering if rot=0. + int primaryCmp(TextWord *word); + + // Return the distance along the primary axis between and + // . + double primaryDelta(TextWord *word); + + static int cmpYX(const void *p1, const void *p2); + + // Get the TextFontInfo object associated with this word. + TextFontInfo *getFontInfo() { return font; } + + // Get the next TextWord on the linked list. + TextWord *getNext() { return next; } + +#if TEXTOUT_WORD_LIST + int getLength() { return len; } + Unicode getChar(int idx) { return text[idx]; } + GString *getText(); + GString *getFontName() { return font->fontName; } + void getColor(double *r, double *g, double *b) + { *r = colorR; *g = colorG; *b = colorB; } + void getBBox(double *xMinA, double *yMinA, double *xMaxA, double *yMaxA) + { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; } + void getCharBBox(int charIdx, double *xMinA, double *yMinA, + double *xMaxA, double *yMaxA); + double getFontSize() { return fontSize; } + int getRotation() { return rot; } + int getCharPos() { return charPos; } + int getCharLen() { return charLen; } + GBool getSpaceAfter() { return spaceAfter; } +#endif + + GBool isUnderlined() { return underlined; } + Link *getLink() { return link; } + +private: + + int rot; // rotation, multiple of 90 degrees + // (0, 1, 2, or 3) + double xMin, xMax; // bounding box x coordinates + double yMin, yMax; // bounding box y coordinates + double base; // baseline x or y coordinate + Unicode *text; // the text + double *edge; // "near" edge x or y coord of each char + // (plus one extra entry for the last char) + int len; // length of text and edge arrays + int size; // size of text and edge arrays + int charPos; // character position (within content stream) + int charLen; // number of content stream characters in + // this word + TextFontInfo *font; // font information + double fontSize; // font size + GBool spaceAfter; // set if there is a space between this + // word and the next word on the line + TextWord *next; // next word in line + +#if TEXTOUT_WORD_LIST + double colorR, // word color + colorG, + colorB; +#endif + + GBool underlined; + Link *link; + + friend class TextPool; + friend class TextLine; + friend class TextBlock; + friend class TextFlow; + friend class TextWordList; + friend class TextPage; + friend class XMLOutputDev; +}; + +//------------------------------------------------------------------------ +// TextPool +//------------------------------------------------------------------------ + +class TextPool { +public: + + TextPool(); + ~TextPool(); + + TextWord *getPool(int baseIdx) { return pool[baseIdx - minBaseIdx]; } + void setPool(int baseIdx, TextWord *p) { pool[baseIdx - minBaseIdx] = p; } + + int getBaseIdx(double base); + + void addWord(TextWord *word); + +private: + + int minBaseIdx; // min baseline bucket index + int maxBaseIdx; // max baseline bucket index + TextWord **pool; // array of linked lists, one for each + // baseline value (multiple of 4 pts) + TextWord *cursor; // pointer to last-accessed word + int cursorBaseIdx; // baseline bucket index of last-accessed word + + friend class TextBlock; + friend class TextPage; +}; + +//------------------------------------------------------------------------ +// TextLine +//------------------------------------------------------------------------ + +class TextLine { +public: + + TextLine(TextBlock *blkA, int rotA, double baseA); + ~TextLine(); + + void addWord(TextWord *word); + + // Return the distance along the primary axis between and + // . + double primaryDelta(TextLine *line); + + // Compares to , returning -1 (<), 0 (=), or +1 (>), + // based on a primary-axis comparison, e.g., x ordering if rot=0. + int primaryCmp(TextLine *line); + + // Compares to , returning -1 (<), 0 (=), or +1 (>), + // based on a secondary-axis comparison of the baselines, e.g., y + // ordering if rot=0. + int secondaryCmp(TextLine *line); + + int cmpYX(TextLine *line); + + static int cmpXY(const void *p1, const void *p2); + + void coalesce(UnicodeMap *uMap); + + // Get the head of the linked list of TextWords. + TextWord *getWords() { return words; } + + // Get the next TextLine on the linked list. + TextLine *getNext() { return next; } + + // Returns true if the last char of the line is a hyphen. + GBool isHyphenated() { return hyphenated; } + +private: + + TextBlock *blk; // parent block + int rot; // text rotation + double xMin, xMax; // bounding box x coordinates + double yMin, yMax; // bounding box y coordinates + double base; // baseline x or y coordinate + TextWord *words; // words in this line + TextWord *lastWord; // last word in this line + Unicode *text; // Unicode text of the line, including + // spaces between words + double *edge; // "near" edge x or y coord of each char + // (plus one extra entry for the last char) + int *col; // starting column number of each Unicode char + int len; // number of Unicode chars + int convertedLen; // total number of converted characters + GBool hyphenated; // set if last char is a hyphen + TextLine *next; // next line in block + + friend class TextLineFrag; + friend class TextBlock; + friend class TextFlow; + friend class TextWordList; + friend class TextPage; +}; + +//------------------------------------------------------------------------ +// TextBlock +//------------------------------------------------------------------------ + +class TextBlock { +public: + + TextBlock(TextPage *pageA, int rotA); + ~TextBlock(); + + void addWord(TextWord *word); + + void coalesce(UnicodeMap *uMap); + + // Update this block's priMin and priMax values, looking at . + void updatePriMinMax(TextBlock *blk); + + static int cmpXYPrimaryRot(const void *p1, const void *p2); + + static int cmpYXPrimaryRot(const void *p1, const void *p2); + + int primaryCmp(TextBlock *blk); + + double secondaryDelta(TextBlock *blk); + + // Returns true if is below , relative to the page's + // primary rotation. + GBool isBelow(TextBlock *blk); + + // Get the head of the linked list of TextLines. + TextLine *getLines() { return lines; } + + // Get the next TextBlock on the linked list. + TextBlock *getNext() { return next; } + +private: + + TextPage *page; // the parent page + int rot; // text rotation + double xMin, xMax; // bounding box x coordinates + double yMin, yMax; // bounding box y coordinates + double priMin, priMax; // whitespace bounding box along primary axis + + TextPool *pool; // pool of words (used only until lines + // are built) + TextLine *lines; // linked list of lines + TextLine *curLine; // most recently added line + int nLines; // number of lines + int charCount; // number of characters in the block + int col; // starting column + int nColumns; // number of columns in the block + + TextBlock *next; + TextBlock *stackNext; + + friend class TextLine; + friend class TextLineFrag; + friend class TextFlow; + friend class TextWordList; + friend class TextPage; +}; + +//------------------------------------------------------------------------ +// TextFlow +//------------------------------------------------------------------------ + +class TextFlow { +public: + + TextFlow(TextPage *pageA, TextBlock *blk); + ~TextFlow(); + + // Add a block to the end of this flow. + void addBlock(TextBlock *blk); + + // Returns true if fits below in the flow, i.e., (1) + // it uses a font no larger than the last block added to the flow, + // and (2) it fits within the flow's [priMin, priMax] along the + // primary axis. + GBool blockFits(TextBlock *blk, TextBlock *prevBlk); + + // Get the head of the linked list of TextBlocks. + TextBlock *getBlocks() { return blocks; } + + // Get the next TextFlow on the linked list. + TextFlow *getNext() { return next; } + +private: + + TextPage *page; // the parent page + double xMin, xMax; // bounding box x coordinates + double yMin, yMax; // bounding box y coordinates + double priMin, priMax; // whitespace bounding box along primary axis + TextBlock *blocks; // blocks in flow + TextBlock *lastBlk; // last block in this flow + TextFlow *next; + + friend class TextWordList; + friend class TextPage; +}; + +#if TEXTOUT_WORD_LIST + +//------------------------------------------------------------------------ +// TextWordList +//------------------------------------------------------------------------ + +class TextWordList { +public: + + // Build a flat word list, in content stream order (if + // text->rawOrder is true), physical layout order (if + // is true and text->rawOrder is false), or reading order (if both + // flags are false). + TextWordList(TextPage *text, GBool physLayout); + + ~TextWordList(); + + // Return the number of words on the list. + int getLength(); + + // Return the th word from the list. + TextWord *get(int idx); + +private: + + GList *words; // [TextWord] +}; + +#endif // TEXTOUT_WORD_LIST + +//------------------------------------------------------------------------ +// TextPage +//------------------------------------------------------------------------ + +class TextPage { +public: + + // Constructor. + TextPage(GBool rawOrderA); + + // Destructor. + ~TextPage(); + + // Start a new page. + void startPage(GfxState *state); + + // End the current page. + void endPage(); + + // Update the current font. + void updateFont(GfxState *state); + + // Begin a new word. + void beginWord(GfxState *state, double x0, double y0); + + // Add a character to the current word. + void addChar(GfxState *state, double x, double y, + double dx, double dy, + CharCode c, int nBytes, Unicode *u, int uLen); + + // End the current word, sorting it into the list of words. + void endWord(); + + // Add a word, sorting it into the list of words. + void addWord(TextWord *word); + + // Add a (potential) underline. + void addUnderline(double x0, double y0, double x1, double y1); + + // Add a hyperlink. + void addLink(int xMin, int yMin, int xMax, int yMax, Link *link); + + // Coalesce strings that look like parts of the same line. + void coalesce(GBool physLayout, GBool doHTML); + + // Find a string. If is true, starts looking at the + // top of the page; else if is true, starts looking + // immediately after the last find result; else starts looking at + // ,. If is true, stops looking at the + // bottom of the page; else if is true, stops looking + // just before the last find result; else stops looking at + // ,. + GBool findText(Unicode *s, int len, + GBool startAtTop, GBool stopAtBottom, + GBool startAtLast, GBool stopAtLast, + GBool caseSensitive, GBool backward, + double *xMin, double *yMin, + double *xMax, double *yMax); + + // Get the text which is inside the specified rectangle. + GString *getText(double xMin, double yMin, + double xMax, double yMax); + + // Find a string by character position and length. If found, sets + // the text bounding rectangle and returns true; otherwise returns + // false. + GBool findCharRange(int pos, int length, + double *xMin, double *yMin, + double *xMax, double *yMax); + + // Dump contents of page to a file. + void dump(void *outputStream, TextOutputFunc outputFunc, + GBool physLayout); + + // Get the head of the linked list of TextFlows. + TextFlow *getFlows() { return flows; } + +#if TEXTOUT_WORD_LIST + // Build a flat word list, in content stream order (if + // this->rawOrder is true), physical layout order (if + // is true and this->rawOrder is false), or reading order (if both + // flags are false). + TextWordList *makeWordList(GBool physLayout); +#endif + +private: + + void clear(); + void assignColumns(TextLineFrag *frags, int nFrags, int rot); + int dumpFragment(Unicode *text, int len, UnicodeMap *uMap, GString *s); + + GBool rawOrder; // keep text in content stream order + + double pageWidth, pageHeight; // width and height of current page + TextWord *curWord; // currently active string + int charPos; // next character position (within content + // stream) + TextFontInfo *curFont; // current font + double curFontSize; // current font size + int nest; // current nesting level (for Type 3 fonts) + int nTinyChars; // number of "tiny" chars seen so far + GBool lastCharOverlap; // set if the last added char overlapped the + // previous char + + TextPool *pools[4]; // a "pool" of TextWords for each rotation + TextFlow *flows; // linked list of flows + TextBlock **blocks; // array of blocks, in yx order + int nBlocks; // number of blocks + int primaryRot; // primary rotation + GBool primaryLR; // primary direction (true means L-to-R, + // false means R-to-L) + TextWord *rawWords; // list of words, in raw order (only if + // rawOrder is set) + TextWord *rawLastWord; // last word on rawWords list + + GList *fonts; // all font info objects used on this + // page [TextFontInfo] + + double lastFindXMin, // coordinates of the last "find" result + lastFindYMin; + GBool haveLastFind; + + GList *underlines; // [TextUnderline] + GList *links; // [TextLink] + + friend class TextLine; + friend class TextLineFrag; + friend class TextBlock; + friend class TextFlow; + friend class TextWordList; +}; + +//------------------------------------------------------------------------ +// TextOutputDev +//------------------------------------------------------------------------ + +class TextOutputDev: public OutputDev { +public: + + // Open a text output file. If is NULL, no file is + // written (this is useful, e.g., for searching text). If + // is true, the original physical layout of the text + // is maintained. If is true, the text is kept in + // content stream order. + TextOutputDev(char *fileName, GBool physLayoutA, + GBool rawOrderA, GBool append); + + // Create a TextOutputDev which will write to a generic stream. If + // is true, the original physical layout of the text + // is maintained. If is true, the text is kept in + // content stream order. + TextOutputDev(TextOutputFunc func, void *stream, + GBool physLayoutA, GBool rawOrderA); + + // Destructor. + virtual ~TextOutputDev(); + + // Check if file was successfully created. + virtual GBool isOk() { return ok; } + + //---- get info about output device + + // Does this device use upside-down coordinates? + // (Upside-down means (0,0) is the top left corner of the page.) + virtual GBool upsideDown() { return gTrue; } + + // Does this device use drawChar() or drawString()? + virtual GBool useDrawChar() { return gTrue; } + + // Does this device use beginType3Char/endType3Char? Otherwise, + // text in Type 3 fonts will be drawn with drawChar/drawString. + virtual GBool interpretType3Chars() { return gFalse; } + + // Does this device need non-text content? + virtual GBool needNonText() { return gFalse; } + + //----- initialization and control + + // Start a page. + virtual void startPage(int pageNum, GfxState *state); + + // End a page. + virtual void endPage(); + + //----- update text state + virtual void updateFont(GfxState *state); + + //----- text drawing + virtual void beginString(GfxState *state, GString *s); + virtual void endString(GfxState *state); + virtual void drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode c, int nBytes, Unicode *u, int uLen); + + //----- path painting + virtual void stroke(GfxState *state); + virtual void fill(GfxState *state); + virtual void eoFill(GfxState *state); + + //----- link borders + virtual void processLink(Link *link, Catalog *catalog); + + //----- special access + + // Find a string. If is true, starts looking at the + // top of the page; else if is true, starts looking + // immediately after the last find result; else starts looking at + // ,. If is true, stops looking at the + // bottom of the page; else if is true, stops looking + // just before the last find result; else stops looking at + // ,. + GBool findText(Unicode *s, int len, + GBool startAtTop, GBool stopAtBottom, + GBool startAtLast, GBool stopAtLast, + GBool caseSensitive, GBool backward, + double *xMin, double *yMin, + double *xMax, double *yMax); + + // Get the text which is inside the specified rectangle. + GString *getText(double xMin, double yMin, + double xMax, double yMax); + + // Find a string by character position and length. If found, sets + // the text bounding rectangle and returns true; otherwise returns + // false. + GBool findCharRange(int pos, int length, + double *xMin, double *yMin, + double *xMax, double *yMax); + +#if TEXTOUT_WORD_LIST + // Build a flat word list, in content stream order (if + // this->rawOrder is true), physical layout order (if + // this->physLayout is true and this->rawOrder is false), or reading + // order (if both flags are false). + TextWordList *makeWordList(); +#endif + + // Returns the TextPage object for the last rasterized page, + // transferring ownership to the caller. + TextPage *takeText(); + + // Turn extra processing for HTML conversion on or off. + void enableHTMLExtras(GBool doHTMLA) { doHTML = doHTMLA; } + +private: + + TextOutputFunc outputFunc; // output function + void *outputStream; // output stream + GBool needClose; // need to close the output file? + // (only if outputStream is a FILE*) + TextPage *text; // text for the current page + GBool physLayout; // maintain original physical layout when + // dumping text + GBool rawOrder; // keep text in content stream order + GBool doHTML; // extra processing for HTML conversion + GBool ok; // set up ok? +}; + +#endif diff -Nru swftools-0.9.0/lib/pdf/xpdf/UnicodeTypeTable.cc swftools-0.9.2/lib/pdf/xpdf/UnicodeTypeTable.cc --- swftools-0.9.0/lib/pdf/xpdf/UnicodeTypeTable.cc 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/UnicodeTypeTable.cc 2012-04-08 17:26:34.000000000 +0000 @@ -0,0 +1,949 @@ +//======================================================================== +// +// UnicodeTypeTable.cc +// +// Copyright 2004 Glyph & Cog, LLC +// +//======================================================================== + +#include +#include "CharTypes.h" +#include "UnicodeTypeTable.h" + +struct UnicodeMapTableEntry { + char *vector; + char type; +}; + +struct UnicodeCaseTableVector { + Unicode codes[256]; +}; + +static UnicodeMapTableEntry typeTable[256] = { + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNLNNNNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL", 'X' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLNNNNNNNNNNNNNNLLNNNNNNNNNNNNNNLLLLLNNNNNNNNNLNNNNNNNNNNNNNNNNN", 'X' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLNNNNNNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRNRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' }, + { "RRRRNNNNNNNNNRNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNRNNNNNNNRRNNNNNNNRRNNNNNNNNNNRRRRRR", 'X' }, + { "RRRRRRRRRRRRRRNNRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNNNNNNNNNNRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { NULL, 'N' }, + { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLNNNNLLLLLLLLLLLLLNNLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNLLLLLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLNNLLLLLLLNNNNN", 'X' }, + { "NNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLNNNNNNNNLLLLNLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLNNNNNNNNNNNNNNNN", 'X' }, + { "NNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLNLNNNLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNNNNLLLLLLLNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLNNNNNNNNNLLLLLLLLLLNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNLNNNNNLNNLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLNNNNNNLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNLLLLLLLLNLLNNNNNNNNNNNLLLLLLLNLNLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "NNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLNNNNNLLLLLLNLLLLLLNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLNNNLLLLLLLLLLLNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLNNNLLLLLLLLLLLLLNNN", 'X' }, + { "NNNNNNNNNNNNNNLRNNNNNNNNNNNNNNNNNNNNNNNNNNLRNLRNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "NNLNNNNLNNLLLLLLLLLLNLNNNLLLLLNNNNNNLNLNLNLLLLNLLLNLLLLLLLNNLLLLNNNNNLLLLLNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { NULL, 'N' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'L' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'N' }, + { NULL, 'N' }, + { "NNNNNLLLNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLNNNNNNNLLLLLNNLLLLLNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLL", 'X' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN", 'X' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN", 'X' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", 'X' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { NULL, 'L' }, + { "LLLLLLLLLLLLLLLLLLLLLLLLRRRRRRNRRRRRRRRRRNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR", 'X' }, + { NULL, 'R' }, + { "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRNNN", 'X' }, + { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLL", 'X' } +}; + +static UnicodeCaseTableVector caseTable00 = {{ + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, + 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, + 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, + 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff +}}; +static UnicodeCaseTableVector caseTable01 = {{ + 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107, + 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, 0x010f, + 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117, + 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, 0x011f, + 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127, + 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, 0x012f, + 0x0130, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137, + 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140, + 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148, + 0x0148, 0x0149, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f, + 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157, + 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f, + 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167, + 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f, + 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177, + 0x00ff, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, 0x017e, 0x0073, + 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, + 0x0188, 0x0256, 0x0257, 0x018c, 0x018c, 0x018d, 0x01dd, 0x0259, + 0x025b, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, + 0x0199, 0x0199, 0x019a, 0x019b, 0x026f, 0x0272, 0x019e, 0x0275, + 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x0280, 0x01a8, + 0x01a8, 0x0283, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x0288, 0x01b0, + 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x0292, + 0x01b9, 0x01b9, 0x01ba, 0x01bb, 0x01bd, 0x01bd, 0x01be, 0x01bf, + 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c6, 0x01c6, 0x01c6, 0x01c9, + 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0, + 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8, + 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dc, 0x01dd, 0x01df, 0x01df, + 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7, + 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01ef, + 0x01f0, 0x01f3, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x0195, 0x01bf, + 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff +}}; +static UnicodeCaseTableVector caseTable02 = {{ + 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207, + 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f, + 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217, + 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f, + 0x019e, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227, + 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f, + 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237, + 0x0238, 0x0239, 0x023a, 0x023b, 0x023c, 0x023d, 0x023e, 0x023f, + 0x0240, 0x0241, 0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247, + 0x0248, 0x0249, 0x024a, 0x024b, 0x024c, 0x024d, 0x024e, 0x024f, + 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257, + 0x0258, 0x0259, 0x025a, 0x025b, 0x025c, 0x025d, 0x025e, 0x025f, + 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267, + 0x0268, 0x0269, 0x026a, 0x026b, 0x026c, 0x026d, 0x026e, 0x026f, + 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277, + 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x027d, 0x027e, 0x027f, + 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287, + 0x0288, 0x0289, 0x028a, 0x028b, 0x028c, 0x028d, 0x028e, 0x028f, + 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297, + 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f, + 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7, + 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af, + 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7, + 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf, + 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7, + 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf, + 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7, + 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df, + 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7, + 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef, + 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7, + 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff +}}; +static UnicodeCaseTableVector caseTable03 = {{ + 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, + 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f, + 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, + 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f, + 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327, + 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f, + 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337, + 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f, + 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x03b9, 0x0346, 0x0347, + 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f, + 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357, + 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f, + 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367, + 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f, + 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377, + 0x0378, 0x0379, 0x037a, 0x037b, 0x037c, 0x037d, 0x037e, 0x037f, + 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x03ac, 0x0387, + 0x03ad, 0x03ae, 0x03af, 0x038b, 0x03cc, 0x038d, 0x03cd, 0x03ce, + 0x0390, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03a2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03ac, 0x03ad, 0x03ae, 0x03af, + 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03c3, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x03cf, + 0x03b2, 0x03b8, 0x03d2, 0x03d3, 0x03d4, 0x03c6, 0x03c0, 0x03d7, + 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df, + 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7, + 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03ef, + 0x03ba, 0x03c1, 0x03f2, 0x03f3, 0x03b8, 0x03b5, 0x03f6, 0x03f8, + 0x03f8, 0x03f2, 0x03fb, 0x03fb, 0x03fc, 0x03fd, 0x03fe, 0x03ff +}}; +static UnicodeCaseTableVector caseTable04 = {{ + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f, + 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, + 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f, + 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477, + 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f, + 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, + 0x0488, 0x0489, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f, + 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, + 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f, + 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7, + 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af, + 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7, + 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf, + 0x04c0, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8, + 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04cf, + 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7, + 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df, + 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7, + 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef, + 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f6, 0x04f7, + 0x04f9, 0x04f9, 0x04fa, 0x04fb, 0x04fc, 0x04fd, 0x04fe, 0x04ff +}}; +static UnicodeCaseTableVector caseTable05 = {{ + 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507, + 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, 0x050f, + 0x0510, 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517, + 0x0518, 0x0519, 0x051a, 0x051b, 0x051c, 0x051d, 0x051e, 0x051f, + 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527, + 0x0528, 0x0529, 0x052a, 0x052b, 0x052c, 0x052d, 0x052e, 0x052f, + 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f, + 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f, + 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557, + 0x0558, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f, + 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f, + 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f, + 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587, + 0x0588, 0x0589, 0x058a, 0x058b, 0x058c, 0x058d, 0x058e, 0x058f, + 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597, + 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f, + 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7, + 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af, + 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, + 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, + 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7, + 0x05c8, 0x05c9, 0x05ca, 0x05cb, 0x05cc, 0x05cd, 0x05ce, 0x05cf, + 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, + 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, + 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, + 0x05e8, 0x05e9, 0x05ea, 0x05eb, 0x05ec, 0x05ed, 0x05ee, 0x05ef, + 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x05f5, 0x05f6, 0x05f7, + 0x05f8, 0x05f9, 0x05fa, 0x05fb, 0x05fc, 0x05fd, 0x05fe, 0x05ff +}}; +static UnicodeCaseTableVector caseTable1e = {{ + 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07, + 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f, + 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17, + 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f, + 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27, + 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f, + 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37, + 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f, + 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47, + 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f, + 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57, + 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f, + 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67, + 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f, + 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77, + 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f, + 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87, + 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f, + 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e95, 0x1e96, 0x1e97, + 0x1e98, 0x1e99, 0x1e9a, 0x1e61, 0x1e9c, 0x1e9d, 0x1e9e, 0x1e9f, + 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7, + 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf, + 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7, + 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf, + 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7, + 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf, + 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7, + 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf, + 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7, + 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef, + 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7, + 0x1ef9, 0x1ef9, 0x1efa, 0x1efb, 0x1efc, 0x1efd, 0x1efe, 0x1eff +}}; +static UnicodeCaseTableVector caseTable1f = {{ + 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, + 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, + 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f16, 0x1f17, + 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f1e, 0x1f1f, + 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27, + 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27, + 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37, + 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37, + 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f46, 0x1f47, + 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f4e, 0x1f4f, + 0x1f50, 0x1f51, 0x1f52, 0x1f53, 0x1f54, 0x1f55, 0x1f56, 0x1f57, + 0x1f58, 0x1f51, 0x1f5a, 0x1f53, 0x1f5c, 0x1f55, 0x1f5e, 0x1f57, + 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, + 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, + 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1f76, 0x1f77, + 0x1f78, 0x1f79, 0x1f7a, 0x1f7b, 0x1f7c, 0x1f7d, 0x1f7e, 0x1f7f, + 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87, + 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87, + 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97, + 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97, + 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7, + 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7, + 0x1fb0, 0x1fb1, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb5, 0x1fb6, 0x1fb7, + 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0x1fbd, 0x03b9, 0x1fbf, + 0x1fc0, 0x1fc1, 0x1fc2, 0x1fc3, 0x1fc4, 0x1fc5, 0x1fc6, 0x1fc7, + 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0x1fcd, 0x1fce, 0x1fcf, + 0x1fd0, 0x1fd1, 0x1fd2, 0x1fd3, 0x1fd4, 0x1fd5, 0x1fd6, 0x1fd7, + 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x1fdc, 0x1fdd, 0x1fde, 0x1fdf, + 0x1fe0, 0x1fe1, 0x1fe2, 0x1fe3, 0x1fe4, 0x1fe5, 0x1fe6, 0x1fe7, + 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef, + 0x1ff0, 0x1ff1, 0x1ff2, 0x1ff3, 0x1ff4, 0x1ff5, 0x1ff6, 0x1ff7, + 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0x1ffd, 0x1ffe, 0x1fff +}}; +static UnicodeCaseTableVector caseTable21 = {{ + 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, + 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f, + 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, + 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f, + 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03c9, 0x2127, + 0x2128, 0x2129, 0x006b, 0x00e5, 0x212c, 0x212d, 0x212e, 0x212f, + 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137, + 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f, + 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147, + 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x214e, 0x214f, + 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, + 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f, + 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f, + 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f, + 0x2180, 0x2181, 0x2182, 0x2183, 0x2184, 0x2185, 0x2186, 0x2187, + 0x2188, 0x2189, 0x218a, 0x218b, 0x218c, 0x218d, 0x218e, 0x218f, + 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197, + 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f, + 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7, + 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af, + 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7, + 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf, + 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7, + 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf, + 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7, + 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df, + 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7, + 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef, + 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7, + 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff +}}; +static UnicodeCaseTableVector caseTable24 = {{ + 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407, + 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f, + 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417, + 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f, + 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427, + 0x2428, 0x2429, 0x242a, 0x242b, 0x242c, 0x242d, 0x242e, 0x242f, + 0x2430, 0x2431, 0x2432, 0x2433, 0x2434, 0x2435, 0x2436, 0x2437, + 0x2438, 0x2439, 0x243a, 0x243b, 0x243c, 0x243d, 0x243e, 0x243f, + 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447, + 0x2448, 0x2449, 0x244a, 0x244b, 0x244c, 0x244d, 0x244e, 0x244f, + 0x2450, 0x2451, 0x2452, 0x2453, 0x2454, 0x2455, 0x2456, 0x2457, + 0x2458, 0x2459, 0x245a, 0x245b, 0x245c, 0x245d, 0x245e, 0x245f, + 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, + 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, + 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477, + 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, + 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, + 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, + 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, + 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f, + 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7, + 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af, + 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24d0, 0x24d1, + 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9, + 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1, + 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9, + 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, + 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, + 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, + 0x24e8, 0x24e9, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef, + 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7, + 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff +}}; +static UnicodeCaseTableVector caseTableff = {{ + 0xff00, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07, + 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, + 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, + 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f, + 0xff20, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, + 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, + 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, + 0xff58, 0xff59, 0xff5a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f, + 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, + 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, + 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, + 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xff5e, 0xff5f, + 0xff60, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67, + 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f, + 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77, + 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f, + 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87, + 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f, + 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97, + 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f, + 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7, + 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf, + 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7, + 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0xffbf, + 0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7, + 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf, + 0xffd0, 0xffd1, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7, + 0xffd8, 0xffd9, 0xffda, 0xffdb, 0xffdc, 0xffdd, 0xffde, 0xffdf, + 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0xffe7, + 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0xffef, + 0xfff0, 0xfff1, 0xfff2, 0xfff3, 0xfff4, 0xfff5, 0xfff6, 0xfff7, + 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0xfffe, 0xffff +}}; +static UnicodeCaseTableVector *caseTable[256] = { + &caseTable00, + &caseTable01, + &caseTable02, + &caseTable03, + &caseTable04, + &caseTable05, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + &caseTable1e, + &caseTable1f, + NULL, + &caseTable21, + NULL, + NULL, + &caseTable24, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + &caseTableff +}; + +static inline char getType(Unicode c) { + int i; + char type; + + if (c > 0xffff) { + type = 'X'; + } else { + i = (c >> 8) & 0xff; + if ((type = typeTable[i].type) == 'X') { + type = typeTable[i].vector[c & 0xff]; + } + } + return type; +} + +GBool unicodeTypeL(Unicode c) { + return getType(c) == 'L'; +} + +GBool unicodeTypeR(Unicode c) { + return getType(c) == 'R'; +} + +Unicode unicodeToUpper(Unicode c) { + int i; + + if (c > 0xffff) { + return c; + } + i = (c >> 8) & 0xff; + if (caseTable[i]) { + return caseTable[i]->codes[c & 0xff]; + } + return c; +} + diff -Nru swftools-0.9.0/lib/pdf/xpdf/UnicodeTypeTable.h swftools-0.9.2/lib/pdf/xpdf/UnicodeTypeTable.h --- swftools-0.9.0/lib/pdf/xpdf/UnicodeTypeTable.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/pdf/xpdf/UnicodeTypeTable.h 2012-04-08 17:26:34.000000000 +0000 @@ -0,0 +1,20 @@ +//======================================================================== +// +// UnicodeTypeTable.h +// +// Copyright 2003 Glyph & Cog, LLC +// +//======================================================================== + +#ifndef UNICODETYPETABLE_H +#define UNICODETYPETABLE_H + +#include "gtypes.h" + +extern GBool unicodeTypeL(Unicode c); + +extern GBool unicodeTypeR(Unicode c); + +extern Unicode unicodeToUpper(Unicode c); + +#endif diff -Nru swftools-0.9.0/lib/png.c swftools-0.9.2/lib/png.c --- swftools-0.9.0/lib/png.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/png.c 2010-11-12 18:56:15.000000000 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef EXPORT #undef EXPORT @@ -84,8 +85,8 @@ struct png_header { - int width; - int height; + unsigned width; + unsigned height; int bpp; int mode; }; @@ -122,7 +123,7 @@ return 0; } if(a!=8 && (b==2 || b==6)) { - printf("Bpp %d in mode %d not supported!\n", a); + printf("Bpp %d in mode %d not supported!\n", b, a); return 0; } if(c!=0) { @@ -166,7 +167,7 @@ else return c; } -static void applyfilter1(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, int width) +static void applyfilter1(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, unsigned width) { int x; unsigned char last=0; @@ -217,7 +218,7 @@ } -static void applyfilter2(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, int width) +static void applyfilter2(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, unsigned width) { int x; unsigned char lasta=0; @@ -280,7 +281,7 @@ /* also performs 24 bit conversion! */ -static void applyfilter3(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, int width) +static void applyfilter3(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, unsigned width) { int x; unsigned char lastr=0; @@ -357,7 +358,7 @@ } } -static void inline applyfilter4(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, int width) +void png_inverse_filter_32(int mode, unsigned char*src, unsigned char*old, unsigned char*dest, unsigned width) { int x; unsigned char lastr=0; @@ -440,8 +441,7 @@ } } - -EXPORT int getPNGdimensions(const char*sname, int*destwidth, int*destheight) +EXPORT int png_getdimensions(const char*sname, unsigned*destwidth, unsigned*destheight) { FILE*fi; struct png_header header; @@ -455,17 +455,17 @@ *destwidth = header.width; *destheight = header.height; + fclose(fi); return 1; } -EXPORT int getPNG(const char*sname, int*destwidth, int*destheight, unsigned char**destdata) +EXPORT int png_load(const char*sname, unsigned*destwidth, unsigned*destheight, unsigned char**destdata) { char tagid[4]; int len; unsigned char*data; unsigned char*imagedata; unsigned char*zimagedata=0; - unsigned long int imagedatalen; unsigned long int zimagedatalen=0; unsigned char*palette = 0; int palettelen = 0; @@ -486,6 +486,7 @@ } if(!png_read_header(fi, &header)) { + fclose(fi); return 0; } @@ -498,7 +499,10 @@ return 0; } - imagedatalen = bypp * header.width * header.height + 65536; + unsigned long long imagedatalen_64 = ((unsigned long long)header.width + 1) * header.height * bypp; + if(imagedatalen_64 > 0xffffffff) + return 0; + unsigned long imagedatalen = (unsigned long)imagedatalen_64; imagedata = (unsigned char*)malloc(imagedatalen); fseek(fi,8,SEEK_SET); @@ -560,6 +564,7 @@ } } + fclose(fi); if(!zimagedata || uncompress(imagedata, &imagedatalen, zimagedata, zimagedatalen) != Z_OK) { printf("Couldn't uncompress %s!\n", sname); if(zimagedata) @@ -567,7 +572,6 @@ return 0; } free(zimagedata); - fclose(fi); *destwidth = header.width; *destheight = header.height; @@ -647,7 +651,7 @@ old = &data2[(y-1)*header.width*4]; } if(header.mode == 6) { - applyfilter4(mode, src, old, dest, header.width); + png_inverse_filter_32(mode, src, old, dest, header.width); } else { // header.mode = 2 applyfilter3(mode, src, old, dest, header.width); /* replace alpha color */ @@ -829,11 +833,10 @@ return colors; } -static COL* getOptimalPalette(COL*image, int size, int palettesize) +static void getOptimalPalette(COL*image, int size, int palettesize, COL*palette) { int num; - COL* ret = malloc(sizeof(COL)*palettesize); - memset(ret, 0, sizeof(COL)*palettesize); + memset(palette, 0, sizeof(COL)*256); colornum_t*colors = getColors(image, size, &num); assert(palettesize<=256); @@ -845,12 +848,12 @@ the image anyway, we are done */ int t; for(t=0;t>8; - ret[t].b = colors[t].color>>16; - ret[t].a = 255; + palette[t].r = colors[t].color; + palette[t].g = colors[t].color>>8; + palette[t].b = colors[t].color>>16; + palette[t].a = 255; } - return ret; + return; } if(num>2048) { @@ -927,22 +930,20 @@ free(belongsto); free(colors); for(t=0;t>8; - ret[t].b = centers[t].color>>16; - ret[t].a = 255; + palette[t].r = centers[t].color; + palette[t].g = centers[t].color>>8; + palette[t].b = centers[t].color>>16; + palette[t].a = 255; } free(centers); - return ret; } static int sqr(const int x) {return x*x;} -static void quantizeImage(unsigned char*_image, int size, int numcolors, unsigned char**newimage, COL**palette) +static void png_quantize_image(unsigned char*_image, int size, int numcolors, unsigned char**newimage, COL*palette) { COL*image = (COL*)_image; - COL*pal= getOptimalPalette(image, size, numcolors); - *palette = pal; + getOptimalPalette(image, size, numcolors, palette); *newimage = (unsigned char*)malloc(size); int t; for(t=0;t> 17) ^ col32; + hash ^= ((hash>>8) + 1) ^ hash; + return hash; +} + +static int png_get_number_of_palette_entries(COL*img, unsigned width, unsigned height, COL*palette, char*has_alpha) +{ + int len = width*height; + int t; + int palsize = 0; + int size[256]; + int palette_overflow = 0; + u32 lastcol32 = 0; + + memset(size, 0, sizeof(size)); + + u32*pal = (u32*)malloc(65536*sizeof(u32)); + int*count = (int*)malloc(65536*sizeof(int)); + + assert(sizeof(COL)==sizeof(u32)); + assert(width && height); + + lastcol32 = (*(u32*)&img[0])^0xffffffff; // don't match + + for(t=0;t0?5:2; //don't apply y-direction filter in first line + + int bytes_per_pixel = bpp>>3; + int w = width*bytes_per_pixel; + int back_x = bytes_per_pixel; + int back_y = y?width*bytes_per_pixel:0; + + unsigned char*pairs[5]; + pairs[0] = calloc(1, 8192); + pairs[1] = calloc(1, 8192); + pairs[2] = calloc(1, 8192); + pairs[3] = calloc(1, 8192); + pairs[4] = calloc(1, 8192); + + unsigned char old[5]; + int l = bytes_per_pixel - 1; + old[0] = src[l]; + old[1] = src[l]; + old[2] = src[l] - src[l-back_y]; + old[3] = src[l] - src[l-back_y]; + old[4] = src[l] - PaethPredictor(0, src[l-back_y], 0); + + int different_pairs[5] = {0,0,0,0,0}; + + int x; + for(x=bytes_per_pixel;x>3; + int b = 1<<(v&7); + if(!pairs[i][p]&b) { + pairs[i][p]|=b; + different_pairs[i]++; + } + } + memcpy(old, dest, sizeof(old)); + } + int f; + int best_nr = 0; + int best_energy = INT_MAX; + for(f=0;f0?5:2; //don't apply y-direction filter in first line + int f; + int best_energy = INT_MAX; + int w = width*(bpp/8); + unsigned char* pairs = malloc(8192); + assert(bpp==8 || bpp==32); + for(f=0;f>3; + int b = 1<<(v&7); + if(!pairs[p]&b) { + pairs[p]|=b; + different_pairs ++; + } + } + int energy = different_pairs; + if(energy256) { + bpp = 32; + cols = 0; + format = 5; + } else if(!numcolors) { + int num = png_get_number_of_palette_entries((COL*)data, width, height, palette, &has_alpha); + if(num<=255) { + //printf("image has %d different colors (alpha=%d)\n", num, has_alpha); + data2 = malloc(width*height); + png_map_to_palette((COL*)data, data2, width*height, palette, num); + data = data2; + bpp = 8; + cols = num; + format = 3; + } else { + bpp = 32; + cols = 0; + format = 5; + } } else { bpp = 8; cols = numcolors; format = 3; - quantizeImage(data, width*height, numcolors, &data, &palette); + png_quantize_image(data, width*height, numcolors, &data, palette); } - datalen = (width*height*bpp/8+cols*8); - fi = fopen(filename, "wb"); if(!fi) { perror("open"); @@ -1316,14 +1596,23 @@ png_end_chunk(fi); if(format == 3) { - png_start_chunk(fi, "PLTE", 768); - for(t=0;t=2) continue; // don't do y direction filters in the first row line[0]=filtermode; //filter type if(bpp==8) - filter_line8(filtermode, line+1, &data[y*srcwidth], width); + png_apply_specific_filter_8(filtermode, line+1, &data[y*srcwidth], width); else - filter_line32(filtermode, line+1, &data[y*srcwidth], width); + png_apply_specific_filter_32(filtermode, line+1, &data[y*srcwidth], width); int size = test_line(&zs, line, linelen); if(size < bestsize) { @@ -1376,7 +1667,18 @@ } idatsize += compress_line(&zs, bestline, linelen, fi); } - free(line);free(bestline); + free(bestline); +#else + for(y=0;y #include +#include #undef HAVE_STAT #include "../../config.h" #include "../gfxtools.h" @@ -37,15 +38,42 @@ #include "../readers/swf.h" #include "../readers/image.h" #include "../log.h" +#include "../kdtree.h" #include "../utf8.h" +#include "../gfxdevice.h" +#include "../gfximage.h" -static gfxsource_t*pdfdriver = 0; -static gfxsource_t*swfdriver = 0; -static gfxsource_t*imagedriver = 0; - -staticforward PyTypeObject OutputClass; -staticforward PyTypeObject PageClass; -staticforward PyTypeObject DocClass; +#define PYTHON_GFX_VERSION VERSION + +#if PY_MAJOR_VERSION >= 3 +#define PYTHON3 +#define M_FLAGS (METH_VARARGS|METH_KEYWORDS) +#else +#define M_FLAGS (METH_KEYWORDS) +#endif + +typedef struct _state { + gfxsource_t*pdfdriver; + gfxsource_t*swfdriver; + gfxsource_t*imagedriver; +} state_t; + +#ifdef PYTHON3 +#define STATE(m) ((state_t*)PyModule_GetState(m)) +#else +static state_t global_state = {0,0,0}; +#define STATE(m) &global_state; +#endif + + +static PyTypeObject OutputClass; +static PyTypeObject PageClass; +static PyTypeObject DocClass; +static PyTypeObject FontClass; +static PyTypeObject GlyphClass; +static PyTypeObject CharClass; +static PyTypeObject KDTreeClass; +static PyTypeObject BitmapClass; typedef struct { PyObject_HEAD @@ -64,8 +92,39 @@ PyObject_HEAD gfxdocument_t*doc; char*filename; + int page_pos; } DocObject; +typedef struct { + PyObject_HEAD + gfxfont_t*gfxfont; +} FontObject; + +typedef struct { + PyObject_HEAD + FontObject*font; + int nr; +} GlyphObject; + +typedef struct { + PyObject_HEAD + FontObject*font; + int nr; + gfxmatrix_t matrix; + int size; + gfxcolor_t color; +} CharObject; + +typedef struct { + PyObject_HEAD + kdtree_t*kdtree; +} KDTreeObject; + +typedef struct { + PyObject_HEAD + gfximage_t*image; +} BitmapObject; + static char* strf(char*format, ...) { char buf[1024]; @@ -76,7 +135,47 @@ va_end(arglist); return strdup(buf); } -#define PY_ERROR(s,args...) (PyErr_SetString(PyExc_Exception, strf(s, ## args)),(PyObject*)NULL) +static inline PyObject*pystring_fromstring(const char*s) +{ +#ifdef PYTHON3 + return PyUnicode_FromString(s); +#else + return PyString_FromString(s); +#endif +} +static inline int pystring_check(PyObject*o) +{ +#ifdef PYTHON3 + return PyUnicode_Check(o); +#else + return PyString_Check(o); +#endif +} +static inline PyObject*pyint_fromlong(long l) +{ +#ifdef PYTHON3 + return PyLong_FromLong(l); +#else + return PyInt_FromLong(l); +#endif +} +static inline const char*pystring_asstring(PyObject*s) +{ +#ifdef PYTHON3 + return PyUnicode_AS_DATA(s); +#else + return PyString_AsString(s); +#endif +} +PyObject*forward_getattr(PyObject*self, char *a) +{ + PyObject*o = pystring_fromstring(a); + PyObject*ret = PyObject_GenericGetAttr(self, o); + Py_DECREF(o); + return ret; +} + +#define PY_ERROR(s,args...) (PyErr_SetString(PyExc_Exception, strf(s, ## args)),(void*)NULL) #define PY_NONE Py_BuildValue("s", 0) //--------------------------------------------------------------------- @@ -94,15 +193,19 @@ OutputObject* self = (OutputObject*)_self; char*filename = 0; static char *kwlist[] = {"filename", NULL}; + int ret; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s", kwlist, &filename)) return NULL; + Py_BEGIN_ALLOW_THREADS gfxresult_t*result = self->output_device->finish(self->output_device); self->output_device = 0; - if(result->save(result, filename) < 0) { + ret = result->save(result, filename); + result->destroy(result); + Py_END_ALLOW_THREADS + if(ret < 0) { return PY_ERROR("Couldn't write to %s", filename); } - result->destroy(result); return PY_NONE; } @@ -127,7 +230,9 @@ int width=0, height=0; if (!PyArg_ParseTuple(args, "ii", &width, &height)) return NULL; + Py_BEGIN_ALLOW_THREADS self->output_device->startpage(self->output_device, width, height); + Py_END_ALLOW_THREADS return PY_NONE; } @@ -158,12 +263,13 @@ gfxline_t*last=&first; for(t=0;toutput_device->endpage(self->output_device); + Py_END_ALLOW_THREADS return PY_NONE; } PyDoc_STRVAR(output_setparameter_doc, \ @@ -341,7 +449,7 @@ "and bitmap parameters), the resulting SWF might use vector operations\n" "and Flash Texts to display the document, or just a single bitmap.\n" ); -static PyObject* f_createSWF(PyObject* parent, PyObject* args, PyObject* kwargs) +static PyObject* f_createSWF(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {NULL}; if (args && !PyArg_ParseTupleAndKeywords(args, kwargs, "", kwlist)) @@ -361,7 +469,7 @@ "which have broken fonts, and where hence the \"PlainText\"\n" "device doesn't work.\n" ); -static PyObject* f_createOCR(PyObject* parent, PyObject* args, PyObject* kwargs) +static PyObject* f_createOCR(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {NULL}; if (args && !PyArg_ParseTupleAndKeywords(args, kwargs, "", kwlist)) @@ -381,7 +489,7 @@ "Using save(), you can save the images to a number\n" "of files\n" ); -static PyObject* f_createImageList(PyObject* parent, PyObject* args, PyObject* kwargs) +static PyObject* f_createImageList(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "", kwlist)) @@ -399,7 +507,7 @@ "by passing it as parameter to page.render().\n" "The extracted text can be saved by plaintext.save(filename).\n" ); -static PyObject* f_createPlainText(PyObject* parent, PyObject* args, PyObject* kwargs) +static PyObject* f_createPlainText(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "", kwlist)) @@ -418,7 +526,7 @@ "Can be used for desktop display and debugging.\n" "This device is not available on all systems.\n" ); -static PyObject* f_createOpenGL(PyObject* parent, PyObject* args, PyObject* kwargs) +static PyObject* f_createOpenGL(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "", kwlist)) @@ -431,6 +539,77 @@ } #endif +static jmp_buf backjump; +static int has_backjump = 0; + +static PyObject* convert_gfxline(gfxline_t*line) +{ + gfxline_t*l; + int len = 0, i = 0; + l = line; + while(l) {l=l->next;len++;} + PyObject*list = PyList_New(len); + l = line; + while(l) { + PyObject*point=0; + if(l->type == gfx_moveTo) { + point = PyTuple_New(3); + PyTuple_SetItem(point, 0, pystring_fromstring("m")); + PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); + PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); + } else if(l->type == gfx_lineTo) { + point = PyTuple_New(3); + PyTuple_SetItem(point, 0, pystring_fromstring("l")); + PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); + PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); + } else if(l->type == gfx_splineTo) { + point = PyTuple_New(5); + PyTuple_SetItem(point, 0, pystring_fromstring("s")); + PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); + PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); + PyTuple_SetItem(point, 3, PyFloat_FromDouble(l->sx)); + PyTuple_SetItem(point, 4, PyFloat_FromDouble(l->sy)); + } else { + point = PY_NONE; + } + PyList_SetItem(list, i, point); + l = l->next; + i++; + } + return list; +} +static PyObject* convert_matrix(gfxmatrix_t*m) +{ + PyObject*columns = PyTuple_New(3); + PyObject*column0 = PyTuple_New(2); + PyTuple_SetItem(column0, 0, PyFloat_FromDouble(m->m00)); + PyTuple_SetItem(column0, 1, PyFloat_FromDouble(m->m10)); + PyTuple_SetItem(columns, 0, column0); + PyObject*column1 = PyTuple_New(2); + PyTuple_SetItem(column1, 0, PyFloat_FromDouble(m->m01)); + PyTuple_SetItem(column1, 1, PyFloat_FromDouble(m->m11)); + PyTuple_SetItem(columns, 1, column1); + PyObject*column2 = PyTuple_New(2); + PyTuple_SetItem(column2, 0, PyFloat_FromDouble(m->tx)); + PyTuple_SetItem(column2, 1, PyFloat_FromDouble(m->ty)); + PyTuple_SetItem(columns, 2, column2); + return columns; +} +static PyObject* convert_color(gfxcolor_t*col) +{ + PyObject*obj = PyTuple_New(4); + PyTuple_SetItem(obj, 0, pyint_fromlong(col->a)); + PyTuple_SetItem(obj, 1, pyint_fromlong(col->r)); + PyTuple_SetItem(obj, 2, pyint_fromlong(col->g)); + PyTuple_SetItem(obj, 3, pyint_fromlong(col->b)); + return obj; +} + +static PyObject* lookup_font(gfxfont_t*font); +static PyObject* char_new(gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix); +static PyObject* create_bitmap(gfximage_t*img); + +static gfxfontlist_t* global_fonts; static char callback_python(char*function, gfxdevice_t*dev, const char*format, ...) { OutputObject*self = (OutputObject*)dev->internal; @@ -445,63 +624,61 @@ int pos = 0; while(format[pos]) { char p = format[pos]; - if(p=='s') { - char*s = va_arg(ap, char*); - PyTuple_SetItem(tuple, pos, PyString_FromString(s)); - } else if(p=='i') { - int i = va_arg(ap, int); - PyTuple_SetItem(tuple, pos, PyInt_FromLong(i)); - } else if(p=='d') { - int i = va_arg(ap, double); - PyTuple_SetItem(tuple, pos, PyFloat_FromDouble(i)); - } else if(p=='c') { - void* ptr = va_arg(ap, void*); - gfxcolor_t*col = (gfxcolor_t*)ptr; - PyObject*colobj = PyTuple_New(4); - PyTuple_SetItem(colobj, 0, PyInt_FromLong(col->a)); - PyTuple_SetItem(colobj, 1, PyInt_FromLong(col->r)); - PyTuple_SetItem(colobj, 2, PyInt_FromLong(col->g)); - PyTuple_SetItem(colobj, 3, PyInt_FromLong(col->b)); - PyTuple_SetItem(tuple, pos, colobj); - } else if(p=='l') { - void* ptr = va_arg(ap, void*); - gfxline_t*line = (gfxline_t*)ptr; - gfxline_t*l; - int len = 0, i = 0; - l = line; - while(l) {l=l->next;len++;} - PyObject*list = PyList_New(len); - l = line; - while(l) { - PyObject*point=0; - if(l->type == gfx_moveTo) { - point = PyTuple_New(3); - PyTuple_SetItem(point, 0, PyString_FromString("m")); - PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); - PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); - } else if(l->type == gfx_lineTo) { - point = PyTuple_New(3); - PyTuple_SetItem(point, 0, PyString_FromString("l")); - PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); - PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); - } else if(l->type == gfx_splineTo) { - point = PyTuple_New(5); - PyTuple_SetItem(point, 0, PyString_FromString("s")); - PyTuple_SetItem(point, 1, PyFloat_FromDouble(l->x)); - PyTuple_SetItem(point, 2, PyFloat_FromDouble(l->y)); - PyTuple_SetItem(point, 3, PyFloat_FromDouble(l->sx)); - PyTuple_SetItem(point, 4, PyFloat_FromDouble(l->sy)); - } else { - point = PY_NONE; - } - PyList_SetItem(list, i, point); - l = l->next; - i++; - } - PyTuple_SetItem(tuple, pos, list); - } else { - PyTuple_SetItem(tuple, pos, PY_NONE); - } + PyObject*obj = 0; + switch(p) { + case 's': { + char*s = va_arg(ap, char*); + obj = pystring_fromstring(s); + break; + } + case 'i': { + int i = va_arg(ap, int); + obj = pyint_fromlong(i); + break; + } + case 'd': { + int i = va_arg(ap, double); + obj = PyFloat_FromDouble(i); + break; + } + case 'c': { + void* ptr = va_arg(ap, void*); + gfxcolor_t*col = (gfxcolor_t*)ptr; + obj = convert_color(col); + break; + } + case 'f': { + void* ptr = va_arg(ap, void*); + obj = lookup_font((gfxfont_t*)ptr); + break; + } + case 'l': { + void* ptr = va_arg(ap, void*); + gfxline_t*line = (gfxline_t*)ptr; + obj = convert_gfxline(line); + break; + } + case 'I': { + void* ptr = va_arg(ap, void*); + obj = create_bitmap((gfximage_t*)ptr); + break; + } + case 'O': { + void* ptr = va_arg(ap, void*); + obj = (PyObject*)ptr; + break; + } + case 'm': { + void* ptr = va_arg(ap, void*); + obj = convert_matrix((gfxmatrix_t*)ptr); + break; + } + default: { + obj = PY_NONE; + break; + } + } + PyTuple_SetItem(tuple, pos, obj); pos++; } va_end(ap); @@ -510,11 +687,16 @@ return 0; PyErr_Clear(); PyObject* result = PyObject_CallObject(f, tuple); + Py_DECREF(tuple); if(!result) { - PyErr_Print(); - PyErr_Clear(); - return 1; + if(!has_backjump) { + PyErr_Print(); + PyErr_Clear(); + return 1; + } else { + longjmp(backjump, 1); + } } else { Py_DECREF(result); return 1; @@ -574,25 +756,35 @@ } static void my_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) { - if(!callback_python("drawchar", dev, "ficm", font, glyphnr, color, matrix)) - { - if(!font) - return; - gfxglyph_t*glyph = &font->glyphs[glyphnr]; - gfxline_t*line2 = gfxline_clone(glyph->line); - gfxline_transform(line2, matrix); - my_fill(dev, line2, color); - gfxline_free(line2); - return; + PyMethodObject*obj = (PyMethodObject*)PyObject_GetAttrString(((OutputObject*)(dev->internal))->pyobj, "drawchar"); + if(!obj) { + /* if the device doesn't support chars, try drawing a polygon instead */ + if(!font) + return; + gfxglyph_t*glyph = &font->glyphs[glyphnr]; + gfxline_t*line2 = gfxline_clone(glyph->line); + gfxline_transform(line2, matrix); + my_fill(dev, line2, color); + gfxline_free(line2); + return; + } + PyFunctionObject*f = (PyFunctionObject*)obj->im_func; + PyCodeObject*c = (PyCodeObject*)f->func_code; + if(c->co_argcount == 2) { + /* new style drawchar method */ + CharObject*chr = (CharObject*)char_new(font, glyphnr, color, matrix); + callback_python("drawchar", dev, "O", chr); + } else { + callback_python("drawchar", dev, "ficm", font, glyphnr, color, matrix); } } -static void my_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action) +static void my_drawlink(gfxdevice_t*dev, gfxline_t*line, const char*action, const char*text) { - callback_python("drawlink", dev, "ls", line, action); + callback_python("drawlink", dev, "lss", line, action, text); } static void my_endpage(gfxdevice_t*dev) { - callback_python("drawlink", dev, ""); + callback_python("endpage", dev, ""); } static gfxresult_t* my_finish(gfxdevice_t*dev) { @@ -600,33 +792,9 @@ return 0; } - -PyDoc_STRVAR(f_createPassThrough_doc, \ -"PassThrough(device)\n\n" -"Creates a PassThrough device, which can be used as parameter in calls\n" -"to page.render().\n" -"device needs to be a class implementing at least the following functions:\n\n" -"setparameter(key,value)\n" -"startclip(outline)\n" -"endclip()\n" -"stroke(outline, width, color, capstyle, jointstyle, miterLimit)\n" -"fill(outline, color)\n" -"fillbitmap(outline, image, matrix, colortransform)\n" -"fillgradient(outline, gradient, gradienttype, matrix)\n" -"addfont(font)\n" -"drawchar(font, glyph, color, matrix)\n" -"drawlink(outline, url)\n" -"If any of these functions are not defined, a error message will be printed,\n" -"however the rendering process will *not* be aborted.\n" -); -static PyObject* f_createPassThrough(PyObject* parent, PyObject* args, PyObject* kwargs) +PyObject* passthrough_create(PyObject*obj) { - static char *kwlist[] = {"device", NULL}; - PyObject*obj; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &obj)) - return NULL; OutputObject*self = PyObject_New(OutputObject, &OutputClass); - self->pyobj = obj; Py_INCREF(obj); self->output_device = (gfxdevice_t*)malloc(sizeof(gfxdevice_t)); @@ -651,16 +819,43 @@ return (PyObject*)self; } +PyDoc_STRVAR(f_createPassThrough_doc, \ +"PassThrough(device)\n\n" +"Creates a PassThrough device, which can be used as parameter in calls\n" +"to page.render().\n" +"device needs to be a class implementing at least the following functions:\n\n" +"setparameter(key,value)\n" +"startclip(outline)\n" +"endclip()\n" +"stroke(outline, width, color, capstyle, jointstyle, miterLimit)\n" +"fill(outline, color)\n" +"fillbitmap(outline, image, matrix, colortransform)\n" +"fillgradient(outline, gradient, gradienttype, matrix)\n" +"addfont(font)\n" +"drawchar(font, glyph, color, matrix)\n" +"drawlink(outline, url)\n" +"If any of these functions are not defined, a error message will be printed,\n" +"however the rendering process will *not* be aborted.\n" +); +static PyObject* f_createPassThrough(PyObject* module, PyObject* args, PyObject* kwargs) +{ + static char *kwlist[] = {"device", NULL}; + PyObject*obj; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &obj)) + return NULL; + return passthrough_create(obj); +} + static PyMethodDef output_methods[] = { /* Output functions */ - {"save", (PyCFunction)output_save, METH_KEYWORDS, output_save_doc}, - {"startpage", (PyCFunction)output_startpage, METH_KEYWORDS, output_startpage_doc}, - {"fill", (PyCFunction)output_fill, METH_KEYWORDS, output_fill_doc}, - {"fillbitmap", (PyCFunction)output_fillbitmap, METH_KEYWORDS, output_fillbitmap_doc}, - {"stroke", (PyCFunction)output_stroke, METH_KEYWORDS, output_stroke_doc}, - {"endpage", (PyCFunction)output_endpage, METH_KEYWORDS, output_endpage_doc}, - {"setparameter", (PyCFunction)output_setparameter, METH_KEYWORDS, output_setparameter_doc}, + {"save", (PyCFunction)output_save, M_FLAGS, output_save_doc}, + {"startpage", (PyCFunction)output_startpage, M_FLAGS, output_startpage_doc}, + {"fill", (PyCFunction)output_fill, M_FLAGS, output_fill_doc}, + {"fillbitmap", (PyCFunction)output_fillbitmap, M_FLAGS, output_fillbitmap_doc}, + {"stroke", (PyCFunction)output_stroke, M_FLAGS, output_stroke_doc}, + {"endpage", (PyCFunction)output_endpage, M_FLAGS, output_endpage_doc}, + {"setparameter", (PyCFunction)output_setparameter, M_FLAGS, output_setparameter_doc}, {0,0,0,0} }; @@ -682,36 +877,225 @@ OutputObject*self = (OutputObject*)_self; /* if(!strcmp(a, "x1")) { - return PyInt_FromLong(self->output_device->x1); + return pyint_fromlong(self->output_device->x1); } else if(!strcmp(a, "y1")) { - return PyInt_FromLong(self->output_device->y1); + return pyint_fromlong(self->output_device->y1); } else if(!strcmp(a, "x2")) { - return PyInt_FromLong(self->output_device->x2); + return pyint_fromlong(self->output_device->x2); } else if(!strcmp(a, "y2")) { - return PyInt_FromLong(self->output_device->y2); + return pyint_fromlong(self->output_device->y2); }*/ - return Py_FindMethod(output_methods, _self, a); + return forward_getattr(_self, a); } static int output_setattr(PyObject * _self, char* a, PyObject * o) { OutputObject*self = (OutputObject*)_self; - if(!PyString_Check(o)) + if(!pystring_check(o)) return -1; - char*value = PyString_AsString(o); + const char*value = pystring_asstring(o); self->output_device->setparameter(self->output_device, a, value); return -1; } static int output_print(PyObject * _self, FILE *fi, int flags) { OutputObject*self = (OutputObject*)_self; - fprintf(fi, "%08x(%d)", (int)_self, _self?_self->ob_refcnt:0); + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); return 0; } //--------------------------------------------------------------------- -staticforward PyObject* page_render(PyObject* _self, PyObject* args, PyObject* kwargs); -staticforward PyObject* page_asImage(PyObject* _self, PyObject* args, PyObject* kwargs); +static PyMethodDef glyph_methods[]; + +static void glyph_dealloc(PyObject* _self) { + GlyphObject* self = (GlyphObject*)_self; + Py_DECREF(self->font); + PyObject_Del(self); +} +static PyObject* glyph_getattr(PyObject * _self, char* a) +{ + GlyphObject*self = (GlyphObject*)_self; + FontObject*font = self->font; + if(!strcmp(a, "unicode")) { + return pyint_fromlong(font->gfxfont->glyphs[self->nr].unicode); + } else if(!strcmp(a, "advance")) { + return PyFloat_FromDouble(font->gfxfont->glyphs[self->nr].advance); + } else if(!strcmp(a, "polygon")) { + return convert_gfxline(font->gfxfont->glyphs[self->nr].line); + } + return forward_getattr(_self, a); +} +static int glyph_setattr(PyObject * self, char* a, PyObject * o) { + return -1; +} +static PyObject* glyph_new(FontObject*font, int nr) { + GlyphObject*glyph = PyObject_New(GlyphObject, &GlyphClass); + glyph->font = font; + Py_INCREF(glyph->font); + glyph->nr = nr; + return (PyObject*)glyph; +} +static int glyph_print(PyObject * _self, FILE *fi, int flags) +{ + GlyphObject*self = (GlyphObject*)_self; + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); + return 0; +} +static PyMethodDef glyph_methods[] = +{ + /* Glyph functions */ + {0,0,0,0} +}; + +//--------------------------------------------------------------------- +static PyMethodDef font_methods[]; + +static void font_dealloc(PyObject* _self) { + FontObject* self = (FontObject*)_self; + PyObject_Del(self); +} +static PyObject* font_new(gfxfont_t*gfxfont) +{ + FontObject*font = PyObject_New(FontObject, &FontClass); + font->gfxfont = gfxfont; + return (PyObject*)font; +} +static gfxfontlist_t* global_fonts = 0; + +static PyObject* lookup_font(gfxfont_t*font) +{ + PyObject*fontobj = gfxfontlist_getuserdata(global_fonts, font->id); + if(!fontobj) { + fontobj = font_new(font); + global_fonts = gfxfontlist_addfont2(global_fonts, font, fontobj); + } + Py_INCREF(fontobj); + return fontobj; +} +static PyObject* font_getattr(PyObject * _self, char* a) +{ + FontObject*self = (FontObject*)_self; + if(!strcmp(a, "num_glyphs")) { + return pyint_fromlong(self->gfxfont->num_glyphs); + } else if(!strcmp(a, "name")) { + return pystring_fromstring(self->gfxfont->id); + } + return forward_getattr(_self, a); +} +static int font_setattr(PyObject * self, char* a, PyObject * o) { + return -1; +} +static PyObject* font_glyph(PyObject * _self, PyObject* args, PyObject* kwargs) { + FontObject*self = (FontObject*)_self; + static char *kwlist[] = {"nr", NULL}; + static long nr = 0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &nr)) + return NULL; + return glyph_new(self, nr); +} +static int font_print(PyObject * _self, FILE *fi, int flags) +{ + FontObject*self = (FontObject*)_self; + fprintf(fi, "", self->gfxfont->id, _self, _self?_self->ob_refcnt:0); + return 0; +} +static PyMethodDef font_methods[] = +{ + /* Font functions */ + {"get_glyph", (PyCFunction)font_glyph, M_FLAGS, "get a glyph from this font"}, + {0,0,0,0} +}; + +//--------------------------------------------------------------------- +static PyMethodDef char_methods[]; + +static void char_dealloc(PyObject* _self) { + CharObject* self = (CharObject*)_self; + Py_DECREF(self->font); + PyObject_Del(self); +} +static PyObject* char_getattr(PyObject * _self, char* a) +{ + CharObject*self = (CharObject*)_self; + FontObject*font = self->font; + gfxglyph_t*glyph = &font->gfxfont->glyphs[self->nr]; + if(!strcmp(a, "unicode")) { + return pyint_fromlong(glyph->unicode); + } else if(!strcmp(a, "advance")) { + return PyFloat_FromDouble((self->matrix.m00 * glyph->advance)); + } else if(!strcmp(a, "matrix")) { + return convert_matrix(&self->matrix); + } else if(!strcmp(a, "color")) { + return convert_color(&self->color); + } else if(!strcmp(a, "size")) { + return pyint_fromlong(self->size); + } else if(!strcmp(a, "glyph")) { + return glyph_new(font, self->nr); + } else if(!strcmp(a, "font")) { + Py_INCREF(font); + return (PyObject*)font; + } else if(!strcmp(a, "x")) { + int x = self->matrix.tx; + return pyint_fromlong(x); + } else if(!strcmp(a, "y")) { + int y = self->matrix.ty; + return pyint_fromlong(y); + } + + int lsb = 0; //left side bearing + int x1 = self->matrix.tx - (self->matrix.m00) * lsb; + int y1 = self->matrix.ty - (-self->matrix.m11) * font->gfxfont->ascent; + int x2 = self->matrix.tx + (self->matrix.m00) * font->gfxfont->glyphs[self->nr].advance; + int y2 = self->matrix.ty + (-self->matrix.m11) * font->gfxfont->descent; + if(!strcmp(a, "bbox")) { + PyObject*bbox = PyTuple_New(4); + PyTuple_SetItem(bbox, 0, pyint_fromlong(x1)); + PyTuple_SetItem(bbox, 1, pyint_fromlong(y1)); + PyTuple_SetItem(bbox, 2, pyint_fromlong(x2)); + PyTuple_SetItem(bbox, 3, pyint_fromlong(y2)); + return bbox; + } else if(!strcmp(a, "x1")) { + return pyint_fromlong(x1); + } else if(!strcmp(a, "y1")) { + return pyint_fromlong(y1); + } else if(!strcmp(a, "x2")) { + return pyint_fromlong(x2); + } else if(!strcmp(a, "y2")) { + return pyint_fromlong(y2); + } + return forward_getattr(_self, a); +} +static int char_setattr(PyObject * self, char* a, PyObject * o) { + return -1; +} +static PyObject* char_new(gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix) +{ + FontObject*fontobj = (FontObject*)lookup_font(font); + CharObject*chr = PyObject_New(CharObject, &CharClass); + chr->font = fontobj; + Py_INCREF(fontobj); + chr->nr = glyphnr; + chr->matrix = *matrix; + chr->size = ceil(1024*fabs(matrix->m00 + matrix->m10)); //horizontal size + chr->color = *color; + return (PyObject*)chr; + return 0; +} +static int char_print(PyObject * _self, FILE *fi, int flags) +{ + CharObject*self = (CharObject*)_self; + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); + return 0; +} +static PyMethodDef char_methods[] = +{ + /* char functions */ + {0,0,0,0} +}; + +//--------------------------------------------------------------------- +static PyObject* page_render(PyObject* _self, PyObject* args, PyObject* kwargs); +static PyObject* page_asImage(PyObject* _self, PyObject* args, PyObject* kwargs); PyDoc_STRVAR(page_render_doc, \ "render(output, move=(0,0), clip=None)\n\n" @@ -721,6 +1105,8 @@ "The page may be shifted to a given position using the move parameter,\n" "and may also be clipped to a specific size using the clip parameter.\n" "The clipping operation is applied after the move operation.\n" +"If you don't need to specify custom page sizes or clippings, use\n" +"page.draw instead.\n" ); static PyObject* page_render(PyObject* _self, PyObject* args, PyObject* kwargs) { @@ -747,10 +1133,53 @@ return NULL; } + Py_BEGIN_ALLOW_THREADS if(x|y|cx1|cx2|cy1|cy2) self->page->rendersection(self->page, output->output_device,x,y,cx1,cy1,cx2,cy2); else self->page->render(self->page, output->output_device); + Py_END_ALLOW_THREADS + return PY_NONE; +} + +PyDoc_STRVAR(page_draw_doc, \ +"draw(output)\n\n" +"Renders a page to the rendering backend specified by the output\n" +"parameter, with the default for page width and height.\n" +); +static PyObject* page_draw(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + PageObject* self = (PageObject*)_self; + static char *kwlist[] = {"dev", NULL}; + PyObject*output = 0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &output)) + return NULL; + + PyObject*passthrough = 0; + if(output->ob_type != &OutputClass) { + passthrough = passthrough_create(output); + output = passthrough; + } + gfxdevice_t*device = ((OutputObject*)passthrough)->output_device; + + if(setjmp(backjump)) { + /* exception in the code below*/ + has_backjump = 0; + //FIXME: this clear the exception, for some reason + //if(passthrough) { + // Py_DECREF(passthrough); + //} + return 0; + } + has_backjump = 1; + device->startpage(device, self->page->width, self->page->height); + self->page->render(self->page, device); + device->endpage(device); + has_backjump = 0; + + if(passthrough) { + Py_DECREF(passthrough); + } return PY_NONE; } @@ -765,18 +1194,24 @@ { PageObject* self = (PageObject*)_self; - static char *kwlist[] = {"width", "height", NULL}; + static char *kwlist[] = {"width", "height", "allow_threads", NULL}; int width=0,height=0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii", kwlist, &width, &height)) + int allow_threads=0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|i", kwlist, &width, &height, &allow_threads)) return NULL; if(!width || !height) { return PY_ERROR("invalid dimensions: %dx%d", width,height); } + PyThreadState *_save=0; + if (allow_threads) { + Py_UNBLOCK_THREADS + } gfxdevice_t dev1,dev2; gfxdevice_render_init(&dev1); dev1.setparameter(&dev1, "antialise", "2"); + dev1.setparameter(&dev1, "fillwhite", "1"); gfxdevice_rescale_init(&dev2, &dev1, width, height, 0); dev2.startpage(&dev2, self->page->width, self->page->height); self->page->render(self->page, &dev2); @@ -784,22 +1219,37 @@ gfxresult_t*result = dev2.finish(&dev2); gfximage_t*img = (gfximage_t*)result->get(result,"page0"); int l = img->width*img->height; - unsigned char*data = (unsigned char*)malloc(img->width*img->height*3); + int ll = l*3; + unsigned char*data = (unsigned char*)malloc(ll); int s,t; for(t=0,s=0;tdata[t].r; data[s+1] = img->data[t].g; data[s+2] = img->data[t].b; } - result->destroy(result); - return PyString_FromStringAndSize((char*)data,img->width*img->height*3); + result->destroy(result); result=0; + free(img->data); free(img); + + PyObject *ret; +#ifdef PYTHON3 + ret = PyByteArray_FromStringAndSize((char*)data,ll); +#else + ret = PyString_FromStringAndSize((char*)data,ll); +#endif + free(data); + + if (allow_threads) { + Py_BLOCK_THREADS + } + return ret; } static PyMethodDef page_methods[] = { /* Page functions */ - {"render", (PyCFunction)page_render, METH_KEYWORDS, page_render_doc}, - {"asImage", (PyCFunction)page_asImage, METH_KEYWORDS, page_asImage_doc}, + {"render", (PyCFunction)page_render, M_FLAGS, page_render_doc}, + {"draw", (PyCFunction)page_draw, M_FLAGS, page_draw_doc}, + {"asImage", (PyCFunction)page_asImage, M_FLAGS, page_asImage_doc}, {0,0,0,0} }; static void page_dealloc(PyObject* _self) { @@ -826,13 +1276,13 @@ Py_INCREF(self->parent); return self->parent; } if(!strcmp(a, "nr")) { - return PyInt_FromLong(self->nr); + return pyint_fromlong(self->nr); } else if(!strcmp(a, "width")) { - return PyInt_FromLong(self->page->width); + return pyint_fromlong(self->page->width); } else if(!strcmp(a, "height")) { - return PyInt_FromLong(self->page->height); + return pyint_fromlong(self->page->height); } - return Py_FindMethod(page_methods, _self, a); + return forward_getattr(_self, a); } static int page_setattr(PyObject * self, char* a, PyObject * o) { @@ -841,7 +1291,7 @@ static int page_print(PyObject * _self, FILE *fi, int flags) { PageObject*self = (PageObject*)_self; - fprintf(fi, "%08x(%d)", (int)_self, _self?_self->ob_refcnt:0); + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); return 0; } @@ -857,19 +1307,12 @@ "You can find out how many pages a document contains by querying\n" "its pages field (doc.pages)\n" ); -static PyObject* doc_getPage(PyObject* _self, PyObject* args, PyObject* kwargs) +static PyObject*page_new(DocObject*doc, int pagenr) { - DocObject* self = (DocObject*)_self; - - static char *kwlist[] = {"nr", NULL}; - int pagenr = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &pagenr)) - return NULL; - PageObject*page = PyObject_New(PageObject, &PageClass); - page->page = self->doc->getpage(self->doc, pagenr); + page->page = doc->doc->getpage(doc->doc, pagenr); page->nr = pagenr; - page->parent = _self; + page->parent = (PyObject*)doc; Py_INCREF(page->parent); if(!page->page) { PyObject_Del(page); @@ -878,6 +1321,33 @@ return (PyObject*)page; } +static PyObject* doc_getPage(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + DocObject* self = (DocObject*)_self; + + static char *kwlist[] = {"nr", NULL}; + int pagenr = 0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &pagenr)) + return NULL; + return page_new(self, pagenr); +} +static PyObject* doc_getiter(PyObject* _self) +{ + DocObject* self = (DocObject*)_self; + self->page_pos = 1; + Py_INCREF(self); + return (PyObject*)self; +} +static PyObject* doc_iternext(PyObject* _self) +{ + DocObject* self = (DocObject*)_self; + if(self->page_pos > self->doc->num_pages) { + return NULL; + } + return page_new(self, self->page_pos++); +} + + PyDoc_STRVAR(doc_getInfo_doc, "getInfo(key)\n\n" "Retrieve some information about a document. For PDF files, key\n" @@ -899,7 +1369,7 @@ return NULL; char*s = self->doc->getinfo(self->doc, key); - return PyString_FromString(s); + return pystring_fromstring(s); } PyDoc_STRVAR(doc_setparameter_doc, @@ -918,7 +1388,7 @@ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ss", kwlist, &key,&value)) return NULL; - self->doc->set_parameter(self->doc, key, value); + self->doc->setparameter(self->doc, key, value); return PY_NONE; } @@ -941,7 +1411,7 @@ "Notice that for image files, the only supported file formats right now\n" "are jpeg and png.\n" ); -static PyObject* f_open(PyObject* parent, PyObject* args, PyObject* kwargs) +static PyObject* f_open(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {"type", "filename", NULL}; char*filename=0; @@ -975,12 +1445,22 @@ } } - if(!strcmp(type,"pdf")) - self->doc = pdfdriver->open(pdfdriver,filename); - else if(!strcmp(type, "image") || !strcmp(type, "img")) - self->doc = imagedriver->open(imagedriver, filename); - else if(!strcmp(type, "swf") || !strcmp(type, "SWF")) - self->doc = swfdriver->open(imagedriver, filename); + state_t*state = STATE(module); + if(!strcmp(type,"pdf")) { + Py_BEGIN_ALLOW_THREADS + self->doc = state->pdfdriver->open(state->pdfdriver,filename); + Py_END_ALLOW_THREADS + } + else if(!strcmp(type, "image") || !strcmp(type, "img")) { + Py_BEGIN_ALLOW_THREADS + self->doc = state->imagedriver->open(state->imagedriver, filename); + Py_END_ALLOW_THREADS + } + else if(!strcmp(type, "swf") || !strcmp(type, "SWF")) { + Py_BEGIN_ALLOW_THREADS + self->doc = state->swfdriver->open(state->imagedriver, filename); + Py_END_ALLOW_THREADS + } else return PY_ERROR("Unknown type %s", type); @@ -1016,12 +1496,12 @@ { DocObject*self = (DocObject*)_self; if(!strcmp(a, "pages")) { - return PyInt_FromLong(self->doc->num_pages); + return pyint_fromlong(self->doc->num_pages); } if(!strcmp(a, "filename")) { - return PyString_FromString(self->filename); + return pystring_fromstring(self->filename); } - return Py_FindMethod(doc_methods, _self, a); + return forward_getattr(_self, a); } static int doc_setattr(PyObject * self, char* a, PyObject * o) { return -1; @@ -1029,12 +1509,180 @@ static int doc_print(PyObject * _self, FILE *fi, int flags) { DocObject*self = (DocObject*)_self; - fprintf(fi, "%08x(%d)", (int)_self, _self?_self->ob_refcnt:0); + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); + return 0; +} + +//--------------------------------------------------------------------- +PyDoc_STRVAR(f_createKDTree_doc, \ +"KDTree()\n\n" +"Creates a KDTree, which can be used to store bounding boxes\n" +); +static PyObject* f_createKDTree(PyObject* module, PyObject* args, PyObject* kwargs) +{ + static char *kwlist[] = {NULL}; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "", kwlist)) + return NULL; + KDTreeObject*self = PyObject_New(KDTreeObject, &KDTreeClass); + self->kdtree = kdtree_new(); + return (PyObject*)self; +} +static void gfx_kdtree_dealloc(PyObject* _self) { + KDTreeObject* self = (KDTreeObject*)_self; + /* FIXME: we still need to Py_DECREF all PyObjects in the tree */ + kdtree_destroy(self->kdtree); + PyObject_Del(self); +} +static PyObject* gfx_kdtree_getattr(PyObject * _self, char* a) +{ + KDTreeObject*self = (KDTreeObject*)_self; + return forward_getattr(_self, a); +} +static int gfx_kdtree_setattr(PyObject * self, char* a, PyObject * o) { + return -1; +} +static int gfx_kdtree_print(PyObject * _self, FILE *fi, int flags) +{ + KDTreeObject*self = (KDTreeObject*)_self; + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); + return 0; +} +PyDoc_STRVAR(gfx_kdtree_add_box_doc, +"put(bbox, data)\n\n" +"Add a rectangular area to the tree. All queries within that area\n" +"will subsequently return 'data'\n" +); +static PyObject* gfx_kdtree_add_box(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + KDTreeObject* self = (KDTreeObject*)_self; + + static char *kwlist[] = {"bbox", "data", NULL}; + int x1=0,y1=0,x2=0,y2=0; + PyObject*value=0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "(iiii)O", kwlist, &x1, &y1, &x2, &y2, &value)) + return NULL; + + kdtree_add_box(self->kdtree, x1,y1,x2,y2, value); + Py_INCREF(value); + + return PY_NONE; +} + +PyDoc_STRVAR(gfx_kdtree_find_doc, +"find(x,y)\n\n" +"Look for a coordinate in the kdtree. It will return last inserted object covering that position, or None.\n" +); +static PyObject* gfx_kdtree_find(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + KDTreeObject* self = (KDTreeObject*)_self; + + static char *kwlist[] = {"x", "y", NULL}; + int x=0,y=0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii", kwlist, &x, &y)) + return NULL; + PyObject*value = (PyObject*)kdtree_find(self->kdtree, x,y); + if(!value) { + return PY_NONE; + } else { + Py_INCREF(value); + return value; + } +} + +static PyMethodDef gfx_kdtree_methods[] = +{ + {"add_box", (PyCFunction)gfx_kdtree_add_box, METH_KEYWORDS, gfx_kdtree_add_box_doc}, + {"find", (PyCFunction)gfx_kdtree_find, METH_KEYWORDS, gfx_kdtree_find_doc}, + {0,0,0,0} +}; + +//--------------------------------------------------------------------- +PyDoc_STRVAR(f_createBitmap_doc, \ +"Bitmap()\n\n" +"Creates a Bitmap, which can be used to store bounding boxes\n" +); +static PyObject* create_bitmap(gfximage_t*img) +{ + BitmapObject*self = PyObject_New(BitmapObject, &BitmapClass); + self->image = malloc(sizeof(gfximage_t)); + self->image->data = malloc(sizeof(gfxcolor_t)*img->width*img->height); + memcpy(self->image->data, img->data, sizeof(gfxcolor_t)*img->width*img->height); + self->image->width = img->width; + self->image->height = img->height; + return (PyObject*)self; +} +static void gfx_bitmap_dealloc(PyObject* _self) { + BitmapObject* self = (BitmapObject*)_self; + free(self->image->data); + free(self->image); + PyObject_Del(self); +} +static PyObject* gfx_bitmap_getattr(PyObject * _self, char* a) +{ + BitmapObject*self = (BitmapObject*)_self; + if(!strcmp(a, "width")) { + return pyint_fromlong(self->image->width); + } else if(!strcmp(a, "height")) { + return pyint_fromlong(self->image->height); + } + return forward_getattr(_self, a); +} +static int gfx_bitmap_setattr(PyObject * self, char* a, PyObject * o) { + return -1; +} +PyDoc_STRVAR(gfx_bitmap_save_png_doc, +"save_jpeg(filename, quality)\n\n" +"Save bitmap to a png file.\n" +); +static PyObject* gfx_bitmap_save_png(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + ImageObject* self = (ImageObject*)_self; + static char *kwlist[] = {"filename", NULL}; + char*filename=0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s", kwlist, &filename)) + return NULL; + gfximage_save_png_quick(self->image, filename); + return PY_NONE; +} +PyDoc_STRVAR(gfx_bitmap_save_jpeg_doc, +"save_jpeg(filename, quality)\n\n" +"Save bitmap to a jpeg file. The quality parameter is optional.\n" +); +static PyObject* gfx_bitmap_save_jpeg(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + ImageObject* self = (ImageObject*)_self; + static char *kwlist[] = {"filename", "quality", NULL}; + char*filename=0; + int quality=95; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|i", kwlist, &filename, &quality)) + return NULL; + gfximage_save_jpeg(self->image, filename, quality); + return PY_NONE; +} +static int gfx_bitmap_print(PyObject * _self, FILE *fi, int flags) +{ + BitmapObject*self = (BitmapObject*)_self; + fprintf(fi, "", _self, _self?_self->ob_refcnt:0); return 0; } +static PyMethodDef gfx_bitmap_methods[] = +{ + {"save_png", (PyCFunction)gfx_bitmap_save_png, METH_KEYWORDS, gfx_bitmap_save_png_doc}, + {"save_jpeg", (PyCFunction)gfx_bitmap_save_jpeg, METH_KEYWORDS, gfx_bitmap_save_jpeg_doc}, + {0,0,0,0} +}; //--------------------------------------------------------------------- +#ifndef PYTHON3 +#define PYTHON23_HEAD_INIT \ + PyObject_HEAD_INIT(NULL) \ + 0, +#else +#define PYTHON23_HEAD_INIT \ + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#endif + PyDoc_STRVAR(output_doc, "An Output object can be used as parameter to the render()\n" "call of a page. It's not possible to create this type of\n" @@ -1045,8 +1693,7 @@ ); static PyTypeObject OutputClass = { - PyObject_HEAD_INIT(NULL) - 0, + PYTHON23_HEAD_INIT tp_name: "gfx.Output", tp_basicsize: sizeof(OutputObject), tp_itemsize: 0, @@ -1065,8 +1712,7 @@ ); static PyTypeObject PageClass = { - PyObject_HEAD_INIT(NULL) - 0, + PYTHON23_HEAD_INIT tp_name: "gfx.Page", tp_basicsize: sizeof(PageObject), tp_itemsize: 0, @@ -1086,19 +1732,110 @@ ); static PyTypeObject DocClass = { - PyObject_HEAD_INIT(NULL) - 0, + PYTHON23_HEAD_INIT tp_name: "gfx.Doc", tp_basicsize: sizeof(DocObject), tp_itemsize: 0, tp_dealloc: doc_dealloc, + tp_print: doc_print, tp_getattr: doc_getattr, tp_setattr: doc_setattr, tp_doc: doc_doc, tp_methods: doc_methods, + + tp_iter: doc_getiter, + tp_iternext: doc_iternext, + +#ifndef PYTHON3 + tp_flags: Py_TPFLAGS_HAVE_ITER, +#endif +}; +PyDoc_STRVAR(font_doc, +"A font is a list of glyphs\n" +); +static PyTypeObject FontClass = +{ + PYTHON23_HEAD_INIT + tp_name: "gfx.Font", + tp_basicsize: sizeof(FontObject), + tp_itemsize: 0, + tp_dealloc: font_dealloc, + tp_print: font_print, + tp_getattr: font_getattr, + tp_setattr: font_setattr, + tp_doc: font_doc, + tp_methods: font_methods, +}; +PyDoc_STRVAR(glyph_doc, +"A glyph is a polygon and a unicode index\n" +); +static PyTypeObject GlyphClass = +{ + PYTHON23_HEAD_INIT + tp_name: "gfx.Glyph", + tp_basicsize: sizeof(GlyphObject), + tp_itemsize: 0, + tp_dealloc: glyph_dealloc, + tp_print: glyph_print, + tp_getattr: glyph_getattr, + tp_setattr: glyph_setattr, + tp_doc: glyph_doc, + tp_methods: glyph_methods, +}; +PyDoc_STRVAR(char_doc, +"A char is a glyph at a given position (in a given color)\n" +); +static PyTypeObject CharClass = +{ + PYTHON23_HEAD_INIT + tp_name: "gfx.Char", + tp_basicsize: sizeof(CharObject), + tp_itemsize: 0, + tp_dealloc: char_dealloc, + tp_print: char_print, + tp_getattr: char_getattr, + tp_setattr: char_setattr, + tp_doc: char_doc, + tp_methods: char_methods, }; +PyDoc_STRVAR(gfx_bitmap_doc, +"A bitmap.\n" +); +static PyTypeObject BitmapClass = +{ + PYTHON23_HEAD_INIT + tp_name: "gfx.Bitmap", + tp_basicsize: sizeof(BitmapObject), + tp_itemsize: 0, + tp_dealloc: gfx_bitmap_dealloc, + tp_print: gfx_bitmap_print, + tp_getattr: gfx_bitmap_getattr, + tp_setattr: gfx_bitmap_setattr, + tp_doc: gfx_bitmap_doc, + tp_methods: gfx_bitmap_methods, +}; + + +PyDoc_STRVAR(gfx_kdtree_doc, +"A kdtree is a two dimensional tree for storing bounding box data\n" +); +static PyTypeObject KDTreeClass = +{ + PYTHON23_HEAD_INIT + tp_name: "gfx.KDTree", + tp_basicsize: sizeof(KDTreeObject), + tp_itemsize: 0, + tp_dealloc: gfx_kdtree_dealloc, + tp_print: gfx_kdtree_print, + tp_getattr: gfx_kdtree_getattr, + tp_setattr: gfx_kdtree_setattr, + tp_doc: gfx_kdtree_doc, + tp_methods: gfx_kdtree_methods, +}; + + //===================================================================== PyDoc_STRVAR(f_setparameter_doc, \ @@ -1112,13 +1849,14 @@ " pdf2swf somefile.pdf -s help\n" ".\n" ); -static PyObject* f_setparameter(PyObject* self, PyObject* args, PyObject* kwargs) +static PyObject* f_setparameter(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {"key", "value", NULL}; char*key=0,*value=0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ss", kwlist, &key, &value)) return NULL; - pdfdriver->set_parameter(pdfdriver,key,value); + state_t*state = STATE(module); + state->pdfdriver->setparameter(state->pdfdriver,key,value); return PY_NONE; } @@ -1152,13 +1890,14 @@ "then the files added by addfont() will be searched.\n" ); -static PyObject* f_addfont(PyObject* self, PyObject* args, PyObject* kwargs) +static PyObject* f_addfont(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {"filename", NULL}; char*filename=0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s", kwlist, &filename)) return NULL; - pdfdriver->set_parameter(pdfdriver,"font", filename); + state_t*state = STATE(module); + state->pdfdriver->setparameter(state->pdfdriver,"font", filename); return PY_NONE; } @@ -1168,34 +1907,36 @@ "font file within this directory might be used to resolve external fonts\n" "in PDF files\n" ); -static PyObject* f_addfontdir(PyObject* self, PyObject* args, PyObject* kwargs) +static PyObject* f_addfontdir(PyObject* module, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {"filename", NULL}; char*filename=0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s", kwlist, &filename)) return NULL; - pdfdriver->set_parameter(pdfdriver,"fontdir", filename); + state_t*state = STATE(module); + state->pdfdriver->setparameter(state->pdfdriver,"fontdir", filename); return PY_NONE; } -static PyMethodDef pdf2swf_methods[] = +static PyMethodDef gfx_methods[] = { /* sources */ - {"open", (PyCFunction)f_open, METH_KEYWORDS, f_open_doc}, - {"addfont", (PyCFunction)f_addfont, METH_KEYWORDS, f_addfont_doc}, - {"addfontdir", (PyCFunction)f_addfontdir, METH_KEYWORDS, f_addfontdir_doc}, - {"setparameter", (PyCFunction)f_setparameter, METH_KEYWORDS, f_setparameter_doc}, - {"verbose", (PyCFunction)f_verbose, METH_KEYWORDS, f_verbose_doc}, + {"open", (PyCFunction)f_open, M_FLAGS, f_open_doc}, + {"addfont", (PyCFunction)f_addfont, M_FLAGS, f_addfont_doc}, + {"addfontdir", (PyCFunction)f_addfontdir, M_FLAGS, f_addfontdir_doc}, + {"setparameter", (PyCFunction)f_setparameter, M_FLAGS, f_setparameter_doc}, + {"verbose", (PyCFunction)f_verbose, M_FLAGS, f_verbose_doc}, /* devices */ - {"SWF", (PyCFunction)f_createSWF, METH_KEYWORDS, f_createSWF_doc}, - {"OCR", (PyCFunction)f_createOCR, METH_KEYWORDS, f_createOCR_doc}, - {"ImageList", (PyCFunction)f_createImageList, METH_KEYWORDS, f_createImageList_doc}, - {"PlainText", (PyCFunction)f_createPlainText, METH_KEYWORDS, f_createPlainText_doc}, - {"PassThrough", (PyCFunction)f_createPassThrough, METH_KEYWORDS, f_createPassThrough_doc}, + {"SWF", (PyCFunction)f_createSWF, M_FLAGS, f_createSWF_doc}, + {"OCR", (PyCFunction)f_createOCR, M_FLAGS, f_createOCR_doc}, + {"ImageList", (PyCFunction)f_createImageList, M_FLAGS, f_createImageList_doc}, + {"PlainText", (PyCFunction)f_createPlainText, M_FLAGS, f_createPlainText_doc}, + {"PassThrough", (PyCFunction)f_createPassThrough, M_FLAGS, f_createPassThrough_doc}, #ifdef USE_OPENGL - {"OpenGL", (PyCFunction)f_createOpenGL, METH_KEYWORDS, f_createOpenGL_doc}, + {"OpenGL", (PyCFunction)f_createOpenGL, M_FLAGS, f_createOpenGL_doc}, #endif + {"KDTree", (PyCFunction)f_createKDTree, M_FLAGS, f_createKDTree_doc}, /* sentinel */ {0, 0, 0, 0} @@ -1211,21 +1952,68 @@ "or mix pages from different PDF files.\n" ); -void initgfx(void) +void gfx_free(void*module) +{ + state_t*state = STATE(module); + if(state->pdfdriver && state->pdfdriver->destroy) + state->pdfdriver->destroy(state->pdfdriver); + if(state->swfdriver && state->swfdriver->destroy) + state->swfdriver->destroy(state->swfdriver); + if(state->imagedriver && state->imagedriver->destroy) + state->imagedriver->destroy(state->imagedriver); + memset(state, 0, sizeof(state_t)); +} + +#ifdef PYTHON3 +static struct PyModuleDef gfx_moduledef = { + PyModuleDef_HEAD_INIT, + "gfx", + gfx_doc, + sizeof(state_t), + gfx_methods, + /*reload*/NULL, + /*traverse*/NULL, + /*clear*/NULL, + gfx_free, +}; +#endif + +PyObject * PyInit_gfx(void) { initLog(0,0,0,0,0,2); +#ifdef PYTHON3 + PyObject*module = PyModule_Create(&gfx_moduledef); +#else + PyObject*module = Py_InitModule3("gfx", gfx_methods, gfx_doc); OutputClass.ob_type = &PyType_Type; PageClass.ob_type = &PyType_Type; DocClass.ob_type = &PyType_Type; - - pdfdriver = gfxsource_pdf_create(); - swfdriver = gfxsource_swf_create(); - imagedriver = gfxsource_image_create(); + FontClass.ob_type = &PyType_Type; + CharClass.ob_type = &PyType_Type; + KDTreeClass.ob_type = &PyType_Type; + BitmapClass.ob_type = &PyType_Type; +#endif - PyObject*module = Py_InitModule3("gfx", pdf2swf_methods, gfx_doc); - PyObject*module_dict = PyModule_GetDict(module); + state_t* state = STATE(module); + memset(state, 0, sizeof(state_t)); + state->pdfdriver = gfxsource_pdf_create(); + state->swfdriver = gfxsource_swf_create(); + state->imagedriver = gfxsource_image_create(); + PyObject*module_dict = PyModule_GetDict(module); PyDict_SetItemString(module_dict, "Doc", (PyObject*)&DocClass); PyDict_SetItemString(module_dict, "Page", (PyObject*)&PageClass); PyDict_SetItemString(module_dict, "Output", (PyObject*)&OutputClass); + PyDict_SetItemString(module_dict, "Char", (PyObject*)&CharClass); + PyDict_SetItemString(module_dict, "Font", (PyObject*)&FontClass); + PyDict_SetItemString(module_dict, "KDTree", (PyObject*)&KDTreeClass); + PyDict_SetItemString(module_dict, "Bitmap", (PyObject*)&BitmapClass); + PyDict_SetItemString(module_dict, "VERSION", (PyObject*)pystring_fromstring(PYTHON_GFX_VERSION)); + + return module; +} +#ifndef PYTHON3 +void initgfx(void) { + PyInit_gfx(); } +#endif diff -Nru swftools-0.9.0/lib/python/Makefile.in swftools-0.9.2/lib/python/Makefile.in --- swftools-0.9.0/lib/python/Makefile.in 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/python/Makefile.in 2010-11-12 18:51:59.000000000 +0000 @@ -3,7 +3,7 @@ top_srcdir = @top_srcdir@ include ../../Makefile.common -all: SWF.$(SLEXT) gfx.$(SLEXT) +all: gfx.$(SLEXT) static: SWF$(A) gfx$(A) exe: mypython$(E) swfpython$(E) testmem$(E) @@ -37,7 +37,7 @@ $(AR) cru SWF$(A) $(SWF_OBJS) $(SWF_DEPS) $(RANLIB) SWF$(A) -GFX_DEPS=../libpdf$(A) ../libgfxswf$(A) ../librfxswf$(A) ../libgfx$(A) ../libocr$(A) ../libbase$(A) +GFX_DEPS=../libgfxpdf$(A) ../libgfxswf$(A) ../librfxswf$(A) ../libgfx$(A) ../libocr$(A) ../libbase$(A) gfx.$(SLEXT): gfx.$(O) $(GFX_DEPS) Makefile $(L) -g $(SHARED) gfx.$(O) -o gfx.$(SLEXT) $(GFX_DEPS) $(PYTHON_LIB) $(LIBS) $(CXXLIBS) gfx$(A): gfx.$(O) $(GFX_DEPS) Makefile diff -Nru swftools-0.9.0/lib/python/tags.c swftools-0.9.2/lib/python/tags.c --- swftools-0.9.0/lib/python/tags.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/python/tags.c 2010-11-12 18:52:02.000000000 +0000 @@ -49,7 +49,7 @@ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &filename)) return NULL; - font = swf_LoadFont(filename); + font = swf_LoadFont(filename, 0); if(!font) { PyErr_SetString(PyExc_Exception, setError("Could not load %s", filename)); return NULL; @@ -186,7 +186,7 @@ po->depth = depth; po->clipdepth = clipdepth; po->ratio = ratio; - po->name = (unsigned char*)name; + po->name = name; po->move = move; if(clipdepth) po->clipdepth = clipdepth; if(matrix) po->matrix = matrix_getMatrix(matrix); @@ -637,7 +637,7 @@ if(!PyArg_ParseTuple(args, "s", &filename)) return NULL; - writePNG(filename, (unsigned char*)fi->rgba ,fi->width, fi->height); + png_write(filename, (unsigned char*)fi->rgba ,fi->width, fi->height); return PY_NONE; } diff -Nru swftools-0.9.0/lib/q.c swftools-0.9.2/lib/q.c --- swftools-0.9.0/lib/q.c 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/lib/q.c 2011-10-07 03:20:17.000000000 +0000 @@ -113,6 +113,36 @@ return length; } +// ------------------------------- median ------------------------------------- + +float medianf(float*a, int n) +{ + int i,j,l,m; + float x; + int k=n&1?n/2:n/2-1; + l=0; + m=n-1; + while(lmax_size = n; h->size = 0; h->elem_size = elem_size; h->compare = compare; - h->elements = (void**)rfx_calloc(n*sizeof(void*)); - h->data = (char*)rfx_calloc(h->max_size*h->elem_size); + h->elements = 0; + h->max_size = 0; +} +heap_t* heap_new(int elem_size, int(*compare)(const void *, const void *)) +{ + heap_t*h = malloc(sizeof(heap_t)); + heap_init(h, elem_size, compare); + return h; +} +heap_t* heap_clone(heap_t*o) +{ + heap_t*h = malloc(sizeof(heap_t)); + memcpy(h, o, sizeof(heap_t)); + h->elements = rfx_alloc(sizeof(void*)*h->size); + int t; + for(t=0;tsize;t++) { + h->elements[t] = rfx_alloc(h->elem_size); + memcpy(h->elements[t], o->elements[t], h->elem_size); + } + return h; } void heap_clear(heap_t*h) { + int t; + for(t=0;tsize;t++) { + rfx_free(h->elements[t]); + h->elements[t]=0; + } rfx_free(h->elements); - rfx_free(h->data); +} +void heap_destroy(heap_t*h) +{ + heap_clear(h); + free(h); } -#define HEAP_NODE_SMALLER(h,node1,node2) ((h)->compare((node1),(node2))>0) +#define HEAP_NODE_LARGER(h,node1,node2) ((h)->compare((node1),(node2))>0) +#define HEAP_NODE_SMALLER(h,node1,node2) ((h)->compare((node1),(node2))<0) static void up(heap_t*h, int node) { void*node_p = h->elements[node]; int parent = node; + int tmp = node; do { node = parent; if(!node) break; parent = (node-1)/2; h->elements[node] = h->elements[parent]; - } while(HEAP_NODE_SMALLER(h,h->elements[parent], node_p)); - + } while(HEAP_NODE_SMALLER(h, h->elements[parent], node_p)); h->elements[node] = node_p; } static void down(heap_t*h, int node) @@ -250,22 +307,33 @@ void heap_put(heap_t*h, void*e) { int pos = h->size++; - memcpy(&h->data[pos*h->elem_size],e,h->elem_size); - h->elements[pos] = &h->data[pos]; + void*data = rfx_alloc(h->elem_size); + memcpy(data,e,h->elem_size); + + if(pos>=h->max_size) { + h->max_size = h->max_size<15?15:(h->max_size+1)*2-1; + h->elements = (void**)rfx_realloc(h->elements, h->max_size*sizeof(void*)); + assert(posmax_size); + } + + h->elements[pos] = data; up(h, pos); } int heap_size(heap_t*h) { return h->size; } -void* heap_max(heap_t*h) +void* heap_peek(heap_t*h) { + if(!h || !h->size) + return 0; return h->elements[0]; } void* heap_chopmax(heap_t*h) { + if(!h->size) + return 0; void*p = h->elements[0]; - assert(h->size); h->elements[0] = h->elements[--h->size]; down(h,0); return p; @@ -283,7 +351,7 @@ } void** heap_flatten(heap_t*h) { - void**nodes = (void**)rfx_alloc(h->size*sizeof(void*)); + void**nodes = (void**)rfx_alloc((h->size+1)*sizeof(void*)); void**p = nodes; while(h->size) { @@ -292,6 +360,7 @@ printf("\n");*/ *p++ = heap_chopmax(h); } + *p++ = 0; return nodes; } @@ -305,7 +374,7 @@ { if(!*t) { (*t) = rfx_calloc(sizeof(trielayer_t)); - (*t)->rest = (unsigned char*)strdup(id); + (*t)->rest = (unsigned char*)strdup((char*)id); (*t)->data = data; return 0; } @@ -320,7 +389,7 @@ char overwrite = 0; if((*t)->rest) overwrite = 1; - (*t)->rest = strdup(""); + (*t)->rest = (unsigned char*)strdup(""); (*t)->data = data; return overwrite; } @@ -328,7 +397,7 @@ static char _trie_remove(trielayer_t*t, unsigned const char*id) { while(t) { - if(t->rest && !strcmp(t->rest, id)) { + if(t->rest && !strcmp((char*)t->rest, (char*)id)) { free(t->rest); t->rest = 0; return 1; @@ -374,7 +443,7 @@ { trielayer_t*t = trie->start; while(t) { - if(t->rest && !strcmp(t->rest, id)) + if(t->rest && !strcmp((char*)t->rest, (char*)id)) return 1; if(!*id) return 0; @@ -386,7 +455,7 @@ { trielayer_t*t = trie->start; while(t) { - if(t->rest && !strcmp(t->rest, id)) + if(t->rest && !strcmp((char*)t->rest, (char*)id)) return t->data; if(!*id) return 0; @@ -439,7 +508,7 @@ } if(t->rest) { buffer[pos]=0; - printf("%s%s %08x\n", buffer, t->rest, t->data); + printf("%s%s %08x\n", buffer, t->rest, (int)t->data); } } @@ -485,13 +554,14 @@ // ------------------------------- crc32 -------------------------------------- -static unsigned int*crc32 = 0; +static unsigned int crc32[256]; +static char crc32_initialized=0; static void crc32_init(void) { int t; - if(crc32) + if(crc32_initialized) return; - crc32= (unsigned int*)rfx_alloc(sizeof(unsigned int)*256); + crc32_initialized = 1; for(t=0; t<256; t++) { unsigned int c = t; int s; @@ -501,6 +571,23 @@ crc32[t] = c; } } +static uint64_t crc64[256]; +static char crc64_initialized=0; +static void crc64_init(void) +{ + int t; + if(crc64_initialized) + return; + crc64_initialized = 1; + for(t=0; t<256; t++) { + unsigned int c = t; + int s; + for (s = 0; s < 8; s++) { + c = ((c&1)?0xC96C5795D7870F42ll:0) ^ (c >> 1); + } + crc64[t] = c; + } +} // ------------------------------- string_t ----------------------------------- void string_set2(string_t*str, const char*text, int len) @@ -604,14 +691,12 @@ unsigned int crc32_add_byte(unsigned int checksum, unsigned char b) { - if(!crc32) - crc32_init(); + crc32_init(); return checksum>>8 ^ crc32[(b^checksum)&0xff]; } unsigned int crc32_add_string(unsigned int checksum, const char*s) { - if(!crc32) - crc32_init(); + crc32_init(); if(!s) return checksum; while(*s) { @@ -620,13 +705,24 @@ } return checksum; } +unsigned int crc32_add_bytes(unsigned int checksum, const void*_s, int len) +{ + unsigned char*s = (unsigned char*)_s; + crc32_init(); + if(!s || !len) + return checksum; + do { + checksum = checksum>>8 ^ crc32[(*s^checksum)&0xff]; + s++; + } while(--len); + return checksum; +} unsigned int string_hash(const string_t*str) { int t; unsigned int checksum = 0; - if(!crc32) - crc32_init(); + crc32_init(); for(t=0;tlen;t++) { checksum = checksum>>8 ^ crc32[(str->str[t]^checksum)&0xff]; } @@ -636,14 +732,24 @@ { unsigned int checksum = 0; const char*p = str; - if(!crc32) - crc32_init(); + crc32_init(); while(*p) { checksum = checksum>>8 ^ crc32[(*p^checksum)&0xff]; p++; } return checksum; } +uint64_t string_hash64(const char*str) +{ + uint64_t checksum = 0; + const char*p = str; + crc64_init(); + while(*p) { + checksum = checksum>>8 ^ crc64[(*p^checksum)&0xff]; + p++; + } + return checksum; +} unsigned int string_hash3(const char*str, int len) { string_t s; @@ -675,6 +781,30 @@ return 0; } +char* concat2(const char* t1, const char* t2) +{ + int l1 = strlen(t1); + int l2 = strlen(t2); + char*text = malloc(l1+l2+1); + memcpy(text , t1, l1); + memcpy(text+l1, t2, l2); + text[l1+l2] = 0; + return text; +} + +char* concat3(const char* t1, const char* t2, const char* t3) +{ + int l1 = strlen(t1); + int l2 = strlen(t2); + int l3 = strlen(t3); + char*text = malloc(l1+l2+l3+1); + memcpy(text , t1, l1); + memcpy(text+l1, t2, l2); + memcpy(text+l1+l2, t3, l3); + text[l1+l2+l3] = 0; + return text; +} + // ------------------------------- stringarray_t ------------------------------ typedef struct _stringlist { @@ -821,6 +951,23 @@ return; } +char int_equals(const void*o1, const void*o2) +{ + return o1==o2; +} +unsigned int int_hash(const void*o) +{ + return string_hash3((const char*)&o, sizeof(o)); +} +void* int_dup(const void*o) +{ + return (void*)o; +} +void int_free(void*o) +{ + return; +} + char charptr_equals(const void*o1, const void*o2) { if(!o1 || !o2) @@ -886,6 +1033,13 @@ string_free(o); } +type_t int_type = { + equals: int_equals, + hash: int_hash, + dup: int_dup, + free: int_free, +}; + type_t ptr_type = { equals: ptr_equals, hash: ptr_hash, @@ -991,6 +1145,10 @@ { unsigned int hash = h->key_type->hash(key); dictentry_t*e = (dictentry_t*)rfx_alloc(sizeof(dictentry_t)); + + if(!h->hashsize) + dict_expand(h, 1); + unsigned int hash2 = hash % h->hashsize; e->key = h->key_type->dup(key); @@ -1013,9 +1171,9 @@ dictentry_t*e = h->slots[t]; while(e) { if(h->key_type!=&charptr_type) { - fprintf(fi, "%s%08x=%08x\n", prefix, e->key, e->data); + fprintf(fi, "%s%08x=%08x\n", prefix, (int)e->key, (int)e->data); } else { - fprintf(fi, "%s%s=%08x\n", prefix, e->key, e->data); + fprintf(fi, "%s%s=%08x\n", prefix, (char*)e->key, (int)e->data); } e = e->next; } @@ -1101,7 +1259,35 @@ while(e) { if(h->key_type->equals(e->key, key)) { dictentry_t*next = e->next; - rfx_free((void*)e->key); + h->key_type->free(e->key); + memset(e, 0, sizeof(dictentry_t)); + rfx_free(e); + if(e == head) { + h->slots[hash] = next; + } else { + assert(prev); + prev->next = next; + } + h->num--; + return 1; + } + prev = e; + e = e->next; + } + return 0; +} + +char dict_del2(dict_t*h, const void*key, void*data) +{ + if(!h->num) + return 0; + unsigned int hash = h->key_type->hash(key) % h->hashsize; + dictentry_t*head = h->slots[hash]; + dictentry_t*e = head, *prev=0; + while(e) { + if(h->key_type->equals(e->key, key) && e->data == data) { + dictentry_t*next = e->next; + h->key_type->free(e->key); memset(e, 0, sizeof(dictentry_t)); rfx_free(e); if(e == head) { @@ -1198,10 +1384,57 @@ void dict_destroy(dict_t*dict) { + if(!dict) + return; dict_clear(dict); rfx_free(dict); } +// ------------------------------- mtf_t -------------------------------------- +mtf_t* mtf_new(type_t*type) +{ + NEW(mtf_t, mtf); + mtf->type = type; + return mtf; +} +void mtf_increase(mtf_t*m, const void*key) +{ + mtf_item_t*item = m->first; + mtf_item_t*last = 0; + while(item) { + if(m->type->equals(item->key, key)) { + item->num++; + if(item->num>m->first->num) { + if(last) last->next = item->next; + else m->first = item->next; + item->next = m->first; + m->first = item; + } + return; + } + last = item; + item = item->next; + } + NEW(mtf_item_t,n); + if(last) last->next = n; + else m->first = n; + n->key = key; + n->num = 1; +} +void mtf_destroy(mtf_t*m) +{ + if(!m) return; + mtf_item_t*item = m->first; + m->first = 0; + while(item) { + mtf_item_t*next = item->next; + item->next = 0; + free(item); + item = next; + } + free(m); +} + // ------------------------------- map_t -------------------------------------- typedef struct _map_internal_t @@ -1237,7 +1470,7 @@ static void dumpmapentry(void*data, const void*key, void*value) { FILE*fi = (FILE*)data; - fprintf(fi, "%s=%s\n", key, (char*)value); + fprintf(fi, "%s=%s\n", (char*)key, (char*)value); } void map_dump(map_t*map, FILE*fi, const char*prefix) { @@ -1259,7 +1492,7 @@ // ------------------------------- array_t -------------------------------------- -array_t* array_new() { +array_t* array_new1() { array_t*d = malloc(sizeof(array_t)); memset(d, 0, sizeof(array_t)); d->entry2pos = dict_new(); @@ -1272,15 +1505,15 @@ return d; } void*array_getkey(array_t*array, int nr) { - if(nr > array->num || nr<0) { - printf("error: reference to element %d in array[%d]\n", nr, array->num); + if(nr >= array->num || nr<0) { + fprintf(stderr, "error: reference to element %d in array[%d]\n", nr, array->num); return 0; } return array->d[nr].name; } void*array_getvalue(array_t*array, int nr) { - if(nr > array->num || nr<0) { - printf("error: reference to element %d in array[%d]\n", nr, array->num); + if(nr >= array->num || nr<0) { + fprintf(stderr, "error: reference to element %d in array[%d]\n", nr, array->num); return 0; } return array->d[nr].data; diff -Nru swftools-0.9.0/lib/q.h swftools-0.9.2/lib/q.h --- swftools-0.9.0/lib/q.h 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/lib/q.h 2011-10-07 03:20:17.000000000 +0000 @@ -23,12 +23,16 @@ #define __q_h__ #include +#include +#include "mem.h" #ifdef __cplusplus extern "C" { #endif #define NEW(t,y) t*y = (t*)rfx_calloc(sizeof(t)); +#define PTR_AS_INT(p) (((char*)(p))-((char*)NULL)) +#define INT_AS_PTR(i) (((char*)NULL)+(int)(i)) /* dynamically growing mem section */ typedef struct _mem_t { @@ -72,6 +76,7 @@ extern type_t charptr_type; extern type_t stringstruct_type; extern type_t ptr_type; +extern type_t int_type; typedef struct _dictentry { void*key; @@ -131,11 +136,26 @@ void*rollback; } trie_t; +/* move to front list structure */ +typedef struct _mtf_item { + const void*key; + int num; + struct _mtf_item*next; +} mtf_item_t; + +typedef struct _mtf { + mtf_item_t*first; + type_t*type; +} mtf_t; + char* strdup_n(const char*str, int size); char* allocprintf(const char*str, ...); +float medianf(float*values, int n); + unsigned int crc32_add_byte(unsigned int crc32, unsigned char b); unsigned int crc32_add_string(unsigned int crc32, const char*s); +unsigned int crc32_add_bytes(unsigned int checksum, const void*s, int len); void mem_init(mem_t*mem); int mem_put(mem_t*m, void*data, int length); @@ -163,11 +183,15 @@ unsigned int string_hash(const string_t*str); unsigned int string_hash2(const char*str); unsigned int string_hash3(const char*str, int len); +uint64_t string_hash64(const char*str); void string_set(string_t*str, const char*text); void string_set2(string_t*str, const char*text, int len); string_t*string_dup3(string_t*s); int string_equals(string_t*str, const char*text); +char* concat2(const char* t1, const char* t2); +char* concat3(const char* t1, const char* t2, const char* t3); + void stringarray_init(stringarray_t*sa, int hashsize); void stringarray_put(stringarray_t*sa, string_t str); @@ -189,6 +213,7 @@ char dict_contains(dict_t*h, const void*s); void* dict_lookup(dict_t*h, const void*s); char dict_del(dict_t*h, const void*s); +char dict_del2(dict_t*h, const void*key, void*data); dict_t*dict_clone(dict_t*); void dict_foreach_keyvalue(dict_t*h, void (*runFunction)(void*data, const void*key, void*val), void*data); @@ -197,9 +222,18 @@ void dict_clear(dict_t*h); void dict_destroy_shallow(dict_t*dict); void dict_destroy(dict_t*dict); -#define DICT_ITERATE_DATA(d,t,v) int v##_i;dictentry_t*v##_e;t v;for(v##_i=0;v##_i<(d)->hashsize;v##_i++) for(v##_e=(d)->slots[v##_i]; v##_e && ((v=(t)v##_e->data)||1); v##_e=v##_e->next) -#define DICT_ITERATE_KEY(d,t,v) int v##_i;dictentry_t*v##_e;t v;for(v##_i=0;v##_i<(d)->hashsize;v##_i++) for(v##_e=(d)->slots[v##_i];v##_e && ((v=(t)v##_e->key)||1);v##_e=v##_e->next) -#define DICT_ITERATE_ITEMS(d,t1,v1,t2,v2) int v1##_i;dictentry_t*v1##_e;t1 v1;t2 v2;for(v1##_i=0;v1##_i<(d)->hashsize;v1##_i++) for(v1##_e=(d)->slots[v1##_i]; v1##_e && (((v1=(t1)v1##_e->key)&&(v2=(t2)v1##_e->data))||1); v1##_e=v1##_e->next) +#define DICT_ITERATE_DATA(d,t,v) \ + int v##_i;dictentry_t*v##_e;t v;\ + for(v##_i=0;v##_i<(d)->hashsize;v##_i++) \ + for(v##_e=(d)->slots[v##_i]; v##_e && ((v=(t)v##_e->data)||1); v##_e=v##_e->next) +#define DICT_ITERATE_KEY(d,t,v) \ + int v##_i;dictentry_t*v##_e;t v;\ + for(v##_i=0;v##_i<(d)->hashsize;v##_i++) \ + for(v##_e=(d)->slots[v##_i];v##_e && ((v=(t)v##_e->key)||1);v##_e=v##_e->next) +#define DICT_ITERATE_ITEMS(d,t1,v1,t2,v2) \ + int v1##_i;dictentry_t*v1##_e;t1 v1;t2 v2; \ + for(v1##_i=0;v1##_i<(d)->hashsize;v1##_i++) \ + for(v1##_e=(d)->slots[v1##_i]; v1##_e && (((v1=(t1)v1##_e->key)||1)&&((v2=(t2)v1##_e->data)||1)); v1##_e=v1##_e->next) void map_init(map_t*map); void map_put(map_t*map, string_t t1, string_t t2); @@ -208,11 +242,14 @@ void map_clear(map_t*map); void map_destroy(map_t*map); -void heap_init(heap_t*h,int n,int elem_size, int(*compare)(const void *, const void *)); +void heap_init(heap_t*h,int elem_size, int(*compare)(const void *, const void *)); +heap_t* heap_new(int elem_size, int(*compare)(const void *, const void *)); +heap_t* heap_clone(heap_t*o); void heap_clear(heap_t*h); +void heap_destroy(heap_t*h); void heap_put(heap_t*h, void*e); int heap_size(heap_t*h); -void* heap_max(heap_t*h); +void* heap_peek(heap_t*h); void* heap_chopmax(heap_t*h); void heap_dump(heap_t*h, FILE*fi); void** heap_flatten(heap_t*h); @@ -226,7 +263,11 @@ void trie_rollback(trie_t*t); void trie_dump(trie_t*t); -array_t* array_new(); +mtf_t* mtf_new(type_t*type); +void mtf_increase(mtf_t*m, const void*key); +void mtf_destroy(mtf_t*m); + +array_t* array_new1(); array_t* array_new2(type_t*type); void array_free(array_t*array); void*array_getkey(array_t*array, int nr); diff -Nru swftools-0.9.0/lib/readers/image.c swftools-0.9.2/lib/readers/image.c --- swftools-0.9.0/lib/readers/image.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/readers/image.c 2010-11-12 18:53:20.000000000 +0000 @@ -87,7 +87,7 @@ free(gfx);gfx=0; } -void image_doc_set_parameter(gfxdocument_t*gfx, const char*name, const char*value) +void image_doc_setparameter(gfxdocument_t*gfx, const char*name, const char*value) { image_doc_internal_t*i= (image_doc_internal_t*)gfx->internal; } @@ -113,7 +113,7 @@ return image_page; } -static void image_set_parameter(gfxsource_t*src, const char*name, const char*value) +static void image_setparameter(gfxsource_t*src, const char*name, const char*value) { msg(" (gfxsource_image) setting parameter %s to \"%s\"", name, value); } @@ -126,10 +126,10 @@ memset(i, 0, sizeof(image_doc_internal_t)); gfxcolor_t*data = 0; - int width = 0; - int height = 0; + unsigned width = 0; + unsigned height = 0; - if(!getPNG(filename, &width, &height, (unsigned char**)&data)) { + if(!png_load(filename, &width, &height, (unsigned char**)&data)) { if(!jpeg_load(filename, (unsigned char**)&data, &width, &height)) { msg(" Couldn't load image %s", filename); return 0; @@ -143,7 +143,7 @@ image_doc->internal = i; image_doc->get = 0; image_doc->destroy = image_doc_destroy; - image_doc->set_parameter = image_doc_set_parameter; + image_doc->setparameter = image_doc_setparameter; image_doc->getpage = image_doc_getpage; return image_doc; @@ -153,7 +153,7 @@ { gfxsource_t*src = (gfxsource_t*)malloc(sizeof(gfxsource_t)); memset(src, 0, sizeof(gfxsource_t)); - src->set_parameter = image_set_parameter; + src->setparameter = image_setparameter; src->open = image_open; return src; } diff -Nru swftools-0.9.0/lib/readers/swf.c swftools-0.9.2/lib/readers/swf.c --- swftools-0.9.0/lib/readers/swf.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/readers/swf.c 2010-11-12 18:53:17.000000000 +0000 @@ -1,3 +1,4 @@ +#include #include #include "../gfxdevice.h" #include "../gfxsource.h" @@ -52,22 +53,17 @@ int frameCount; } sprite_t; -struct _render +typedef struct _render { map16_t*id2char; gfxdevice_t*device; MATRIX m; int clips; int*clips_waiting; -}; -typedef struct _render render_t; + placement_t*current_placement; +} render_t; -static void placement_free(placement_t*p) -{ - swf_PlaceObjectFree(&p->po); - free(p); -} //---- object/depth handling ---- @@ -91,7 +87,7 @@ void map16_add_id(map16_t*map, int nr, void*id) { if(map->ids[nr]) - fprintf(stderr, "Warning: ID %d defined more than once\n"); + fprintf(stderr, "Warning: ID %d defined more than once\n", nr); map->ids[nr] = id; } void map16_remove_id(map16_t*map, int nr) @@ -107,6 +103,29 @@ } } } +//---- placements ---- + +placement_t* placement_unit() +{ + placement_t*placement = rfx_calloc(sizeof(placement_t)); + swf_GetPlaceObject(0, &placement->po); + return placement; +} + +placement_t* placement_join(placement_t*p1, placement_t*p2) +{ + placement_t*placement = rfx_alloc(sizeof(placement_t)); + *placement = *p1; + swf_MatrixJoin(&placement->po.matrix, &p1->po.matrix, &p2->po.matrix); + return placement; +} + +static void placement_free(placement_t*p) +{ + swf_PlaceObjectFree(&p->po); + free(p); +} + //---- conversion stuff ---- static void convertMatrix(MATRIX*from, gfxmatrix_t*to) @@ -148,21 +167,27 @@ gfxline_t* swfline_to_gfxline(SHAPELINE*line, int linestyle, int fillstyle0) { gfxdrawer_t d; - SCOORD x=0,y=0; + SCOORD x=0,y=0,xx=0,yy=0; gfxline_t*l; gfxdrawer_target_gfxline(&d); if(line && line->type != moveTo) { fprintf(stderr, "Warning: Shape doesn't start with a moveTo\n"); } + xx = line?line->x+1:0; while(line) { - if(line->fillstyle0 == fillstyle0 || line->fillstyle1 == fillstyle0 || + if(line->fillstyle0 == fillstyle0 || + line->fillstyle1 == fillstyle0 || line->linestyle == linestyle) { if(line->type == lineTo) { - d.moveTo(&d, x/20.0,y/20.0); + if(xx!=x || yy!=y) d.moveTo(&d, x/20.0,y/20.0); d.lineTo(&d, line->x/20.0,line->y/20.0); + xx = line->x; + yy = line->y; } else if(line->type == splineTo) { - d.moveTo(&d, x/20.0,y/20.0); + if(xx!=x || yy!=y) d.moveTo(&d, x/20.0,y/20.0); d.splineTo(&d, line->sx/20.0, line->sy/20.0, line->x/20.0,line->y/20.0); + xx = line->x; + yy = line->y; } } x = line->x; @@ -176,7 +201,7 @@ //---- bitmap handling ---- -gfximage_t* gfximage_new(RGBA*data, int width, int height) +static gfximage_t* gfximage_new(RGBA*data, int width, int height) { gfximage_t* b = (gfximage_t*)rfx_calloc(sizeof(gfximage_t)); b->data = (gfxcolor_t*)data; @@ -185,13 +210,6 @@ return b; } -void gfximage_free(gfximage_t*b) -{ - free(b->data); //! - b->data = 0; - free(b); -} - static gfximage_t* findimage(render_t*r, U16 id) { character_t*c = (character_t*)map16_get_id(r->id2char, id); @@ -200,7 +218,7 @@ /*char filename[80]; sprintf(filename, "bitmap%d.png", id); - writePNG(filename, (unsigned char*)img->data, img->width, img->height); + png_write(filename, (unsigned char*)img->data, img->width, img->height); printf("saving bitmap %d to %s\n", id, filename);*/ return c->data; @@ -227,7 +245,15 @@ } else if(f->type == FILL_LINEAR || f->type == FILL_RADIAL) { gfxmatrix_t m; gfxgradient_t* g; - convertMatrix(&f->m, &m); + MATRIX* m2 = &f->m; + //swf_MatrixJoin(&m2, po_m, &f->m); + + double z = f->type==FILL_RADIAL?4:4; + m.m00 = m2->sx/z/20.0; m.m10 = m2->r1/z/20.0; + m.m01 = m2->r0/z/20.0; m.m11 = m2->sy/z/20.0; + m.tx = m2->tx/20.0; + m.ty = m2->ty/20.0; + g = convertGradient(&f->gradient); r->device->fillgradient(r->device, line, g, f->type == FILL_LINEAR ? gfxgradient_linear : gfxgradient_radial, &m); free(g); @@ -332,7 +358,8 @@ map16_add_id(map, id, c); } else if(tag->id == ST_DEFINEFONT || - tag->id == ST_DEFINEFONT2) { + tag->id == ST_DEFINEFONT2 || + tag->id == ST_DEFINEFONT3) { character_t*c = rfx_calloc(sizeof(character_t)); SWFFONT*swffont = 0; font_t*font = (font_t*)rfx_calloc(sizeof(font_t)); @@ -347,6 +374,10 @@ } SHAPE2*s2 = swf_ShapeToShape2(swffont->glyph[t].shape); font->glyphs[t] = swfline_to_gfxline(s2->lines, 0, 1); + if(tag->id==ST_DEFINEFONT3) { + gfxmatrix_t m = {1/20.0,0,0, 0,1/20.0,0}; + gfxline_transform(font->glyphs[t], &m); + } swf_Shape2Free(s2); } swf_FontFree(swffont); @@ -409,9 +440,6 @@ int frame = 1; int insprite = 0; - SWF*swf = rfx_calloc(sizeof(SWF)); - swf->firstTag = startTag; - for(;tag;tag = tag->next) { if(tag->id == ST_DEFINESPRITE) { while(tag->id != ST_END) @@ -426,12 +454,16 @@ swf_GetPlaceObject(tag, &p->po); if(p->po.move) { placement_t*old = (placement_t*)map16_get_id(depthmap, p->po.depth); - p->po.id = old->po.id; - map16_remove_id(depthmap, p->po.depth); - placement_free(p); - } else { - map16_add_id(depthmap, p->po.depth, p); + + if(!(p->po.flags&PF_CHAR)) p->po.id = old->po.id; + if(!(p->po.flags&PF_MATRIX)) p->po.matrix = old->po.matrix; + if(!(p->po.flags&PF_CXFORM)) p->po.cxform = old->po.cxform; + if(!(p->po.flags&PF_RATIO)) p->po.ratio = old->po.ratio; + + map16_remove_id(depthmap, old->po.depth); + placement_free(old); } + map16_add_id(depthmap, p->po.depth, p); } if(tag->id == ST_REMOVEOBJECT || tag->id == ST_REMOVEOBJECT2) { @@ -481,9 +513,15 @@ SHAPELINE*line = shape->lines; while(line) { SPOINT p; + p.x = line->x; p.y = line->y; p = swf_TurnPoint(p, m); line->x = p.x; line->y = p.y; + + p.x = line->sx; p.y = line->sy; + p = swf_TurnPoint(p, m); + line->sx = p.x; line->sy = p.y; + line = line->next; } } @@ -493,11 +531,22 @@ if(c->type == TYPE_SHAPE) { SHAPE2 shape; swf_ParseDefineShape(c->tag, &shape); - MATRIX m; - swf_MatrixJoin(&m, &r->m, &p->po.matrix); + + MATRIX m,m2; + swf_MatrixJoin(&m2, &r->m, &r->current_placement->po.matrix); + swf_MatrixJoin(&m, &m2, &p->po.matrix); + swf_ApplyMatrixToShape(&shape, &m); + SHAPELINE*line = shape.lines; int t; + + for(t=1;t<=shape.numlinestyles;t++) { + gfxline_t*line = swfline_to_gfxline(shape.lines, t, -1); + if(line) renderOutline(r, line, &shape.linestyles[t-1], &p->po.cxform); + gfxline_free(line); + } + for(t=1;t<=shape.numfillstyles;t++) { gfxline_t*line; line = swfline_to_gfxline(shape.lines, -1, t); @@ -514,11 +563,7 @@ if(line) renderFilled(r, line, &shape.fillstyles[t-1], &p->po.cxform); gfxline_free(line);*/ } - for(t=1;t<=shape.numlinestyles;t++) { - gfxline_t*line = swfline_to_gfxline(shape.lines, t, -1); - if(line) renderOutline(r, line, &shape.linestyles[t-1], &p->po.cxform); - gfxline_free(line); - } + } else if(c->type == TYPE_TEXT) { TAG* tag = c->tag; textcallbackblock_t info; @@ -542,17 +587,23 @@ render_t*r = (render_t*)self; placement_t*p = (placement_t*)data; character_t*c = map16_get_id(r->id2char, p->po.id); + if(!c) { fprintf(stderr, "Error: ID %d unknown\n", p->po.id); return; } + if(c->type == TYPE_SPRITE) { + placement_t*oldp = r->current_placement; + r->current_placement = placement_join(oldp, p); + int*old_clips_waiting = r->clips_waiting; r->clips_waiting = rfx_calloc(sizeof(r->clips_waiting[0])*65536); sprite_t* s = (sprite_t*)c->data; - map16_t* depths = extractFrame(c->tag->next, p->age % s->frameCount); + TAG*spritetags = c->tag->next; + map16_t* depths = extractFrame(spritetags, s->frameCount>0? p->age % s->frameCount : 0); map16_enumerate(depths, placeObject, r); int t; @@ -564,9 +615,12 @@ } free(r->clips_waiting); r->clips_waiting = old_clips_waiting; - return; + + placement_free(r->current_placement); + r->current_placement = oldp; + } else { + renderCharacter(r, p, c); } - renderCharacter(r, p, c); } void swfpage_destroy(gfxpage_t*swf_page) @@ -587,19 +641,18 @@ r.device = output; r.m = pi->m; r.clips_waiting = malloc(sizeof(r.clips_waiting[0])*65536); + r.current_placement = placement_unit(); memset(r.clips_waiting, 0, sizeof(r.clips_waiting[0])*65536); int t; for(t=0;t<65536;t++) { + if(depths->ids[t]) { + placeObject(&r, t, depths->ids[t]); + } int i; - for(i=0; iendclip(output); } - - if(depths->ids[t]) { - placeObject(&r, t, depths->ids[t]); - } } free(r.clips_waiting); } @@ -619,7 +672,7 @@ free(gfx);gfx=0; } -void swf_doc_set_parameter(gfxdocument_t*gfx, const char*name, const char*value) +void swf_doc_setparameter(gfxdocument_t*gfx, const char*name, const char*value) { swf_doc_internal_t*i= (swf_doc_internal_t*)gfx->internal; } @@ -647,7 +700,7 @@ return swf_page; } -void swf_set_parameter(gfxsource_t*src, const char*name, const char*value) +void swf_setparameter(gfxsource_t*src, const char*name, const char*value) { msg(" setting parameter %s to \"%s\"", name, value); } @@ -692,18 +745,26 @@ swf_doc->internal = i; swf_doc->get = 0; swf_doc->destroy = swf_doc_destroy; - swf_doc->set_parameter = swf_doc_set_parameter; + swf_doc->setparameter = swf_doc_setparameter; swf_doc->getpage = swf_doc_getpage; return swf_doc; } +static void swf_destroy(gfxsource_t*src) +{ + memset(src, 0, sizeof(*src)); + free(src); +} + + gfxsource_t*gfxsource_swf_create() { gfxsource_t*src = (gfxsource_t*)malloc(sizeof(gfxsource_t)); memset(src, 0, sizeof(gfxsource_t)); - src->set_parameter = swf_set_parameter; + src->setparameter = swf_setparameter; src->open = swf_open; + src->destroy = swf_destroy; return src; } diff -Nru swftools-0.9.0/lib/rfxswf.c swftools-0.9.2/lib/rfxswf.c --- swftools-0.9.0/lib/rfxswf.c 2009-03-29 19:17:45.000000000 +0000 +++ swftools-0.9.2/lib/rfxswf.c 2010-11-12 18:53:58.000000000 +0000 @@ -45,7 +45,6 @@ #endif #include "./bitio.h" -#include "./MD5.h" #include "./os.h" // internal constants @@ -93,8 +92,9 @@ U8 swf_GetU8(TAG * t) { swf_ResetReadBits(t); #ifdef DEBUG_RFXSWF - if (t->pos>=t->len) + if ((int)t->pos>=(int)t->len) { fprintf(stderr,"GetU8() out of bounds: TagID = %i\n",t->id); + *(int*)0=0; return 0; } #endif @@ -105,7 +105,7 @@ { U16 res; swf_ResetReadBits(t); #ifdef DEBUG_RFXSWF - if (t->pos>(t->len-2)) + if ((int)t->pos>((int)t->len-2)) { fprintf(stderr,"GetU16() out of bounds: TagID = %i\n",t->id); return 0; } @@ -119,7 +119,7 @@ { U32 res; swf_ResetReadBits(t); #ifdef DEBUG_RFXSWF - if (t->pos>(t->len-4)) + if ((int)t->pos>((int)t->len-4)) { fprintf(stderr,"GetU32() out of bounds: TagID = %i\n",t->id); return 0; } @@ -177,7 +177,9 @@ void swf_SetS16(TAG * t,int v) { if(v>32767 || v<-32768) { + #ifdef DEBUG_RFXSWF fprintf(stderr, "Warning: S16 overflow: %d\n", v); + #endif } swf_SetU16(t, (S16)v); } @@ -406,6 +408,93 @@ swf_SetBlock(tag, (void*)str, l); return len; } + +float swf_GetF16(TAG * t) +{ + U16 f1 = swf_GetU16(t); + if(!(f1&0x3ff)) return 0.0; + + // IEEE 16 is 1-5-10 + // IEEE 32 is 1-8-23 + /* gcc 4.1.2 seems to require a union here. *(float*)u doesn't work */ + union { + U32 u; + float f; + } f2; + + U16 e = (f1>>10)&0x1f; + U16 m = f1&0x3ff; + /* find highest bit in mantissa */ + int h=0; + while(!(m&0x400)) { + m<<=1; + h++; + } + m&=0x3ff; + e -= h; + e += 0x6f; + + f2.u = (f1&0x8000)<<16; //sign + f2.u |= e<<23; //exponent + f2.u |= m<<13; //mantissa + return *(float*)&f2; +} + +void swf_SetF16(TAG * t, float f) +{ + union { + U32 u; + float f; + } v; + v.f = f; + + U16 result = (v.u>>16)&0x8000; //sign + int exp = ((v.u>>23)&0xff)-0x7f+0x10; + U16 m = (v.u>>13)&0x3ff; + //fprintf(stderr, "%f: %04x sign, %d exp, %04x mantissa\n", f, result, exp, m); + if(exp<-10) { + // underflow (clamp to 0.0) + exp = 0; + m = 0; + } else if(exp<0) { + // partial underflow- strip some bits + m = (m|0x400)>>-exp; + exp = 0; + } else if(exp>=32) { + exp = 31; + m = 0x3ff; + fprintf(stderr, "Exponent overflow in FLOAT16 encoding\n"); + } else { + exp++; + m = (m>>1)|0x200; + } + result |= exp<<10; + result |= m; + swf_SetU16(t, result); +} + +float F16toFloat(U16 x) +{ + TAG t; + t.data = (void*)&x; + t.readBit = 0; + t.pos = 0; + t.len = 2; + return swf_GetF16(&t); +} + +float floatToF16(float f) +{ + U16 u = 0; + TAG t; + t.data = (void*)&u; + t.len = 0; + t.memsize = 2; + t.writeBit = 0; + swf_SetF16(&t, f); + return u; +} + double swf_GetD64(TAG*tag) { /* FIXME: this is not big-endian compatible */ @@ -629,7 +718,9 @@ nbits = swf_CountBits(r->ymin,nbits); nbits = swf_CountBits(r->ymax,nbits); if(nbits>=32) { + #ifdef DEBUG_RFXSWF fprintf(stderr, "rfxswf: Warning: num_bits overflow in swf_SetRect\n"); + #endif nbits=31; } @@ -795,7 +886,9 @@ nbits = swf_CountBits(m->sy,nbits); if(nbits>=32) { /* TODO: happens on AMD64 systems for normal values? */ + #ifdef DEBUG_RFXSWF fprintf(stderr,"rfxswf: Error: matrix values too large\n"); + #endif nbits = 31; } swf_SetBits(t,nbits,5); @@ -809,7 +902,9 @@ nbits = swf_CountBits(m->r0,0); nbits = swf_CountBits(m->r1,nbits); if(nbits>=32) { + #ifdef DEBUG_RFXSWF fprintf(stderr,"rfxswf: Error: matrix values too large\n"); + #endif nbits = 31; } swf_SetBits(t,nbits,5); @@ -820,7 +915,9 @@ nbits = swf_CountBits(m->tx,0); nbits = swf_CountBits(m->ty,nbits); if(nbits>=32) { + #ifdef DEBUG_RFXSWF fprintf(stderr,"rfxswf: Error: matrix values too large\n"); + #endif nbits = 31; } swf_SetBits(t,nbits,5); @@ -930,6 +1027,7 @@ void swf_SetPassword(TAG * t, const char * password) { +#ifdef HAVE_MD5 /* WARNING: crypt_md5 is not reentrant */ char salt[3]; char* md5string; @@ -949,7 +1047,10 @@ md5string = crypt_md5(password, salt); swf_SetU16(t,0); - swf_SetString(t, (U8*)md5string); + swf_SetString(t, md5string); +#else + fprintf(stderr, "Error: No MD5 compiled in"); +#endif } void swf_SetString(TAG*t, const char* s) @@ -957,12 +1058,13 @@ if(!s) { swf_SetU8(t, 0); } else { - swf_SetBlock(t,s,strlen(s)+1); + swf_SetBlock(t,(U8*)s,strlen(s)+1); } } int swf_VerifyPassword(TAG * t, const char * password) { +#ifdef HAVE_MD5 char*md5string1, *md5string2; char*x; char*salt; @@ -997,6 +1099,10 @@ if(strcmp(md5string1, md5string2) != 0) return 0; return 1; +#else + fprintf(stderr, "Error: No MD5 compiled in"); + return 1; +#endif } // Tag List Manipulating Functions @@ -1081,15 +1187,14 @@ int id; if (reader->read(reader, &raw, 2) !=2 ) return NULL; - raw = SWAP16(raw); + raw = LE_16_TO_NATIVE(raw); len = raw&0x3f; id = raw>>6; if (len==0x3f) { - if (reader->read(reader, &len, 4) != 4) return NULL; - len = SWAP32(len); + len = reader_readU32(reader); } if (id==ST_DEFINESPRITE) len = 2*sizeof(U16); @@ -1104,7 +1209,9 @@ { t->data = (U8*)rfx_alloc(t->len); t->memsize = t->len; if (reader->read(reader, t->data, t->len) != t->len) { + #ifdef DEBUG_RFXSWF fprintf(stderr, "rfxswf: Warning: Short read (tagid %d). File truncated?\n", t->id); + #endif free(t->data);t->data=0; free(t); return NULL; @@ -1144,7 +1251,7 @@ #endif if (short_tag) - { raw[0] = SWAP16(len|((t->id&0x3ff)<<6)); + { raw[0] = LE_16_TO_NATIVE(len|((t->id&0x3ff)<<6)); if (writer->write(writer,raw,2)!=2) { #ifdef DEBUG_RFXSWF @@ -1155,7 +1262,7 @@ } else { - raw[0] = SWAP16((t->id<<6)|0x3f); + raw[0] = LE_16_TO_NATIVE((t->id<<6)|0x3f); if (writer->write(writer,raw,2)!=2) { #ifdef DEBUG_RFXSWF @@ -1164,14 +1271,7 @@ return -1; } - len = SWAP32(len); - if (writer->write(writer,&len,4)!=4) - { - #ifdef DEBUG_RFXSWF - fprintf(stderr,"WriteTag() failed: Long Header (2).\n"); - #endif - return -1; - } + writer_writeU32(writer, len); } if (t->data) @@ -1283,7 +1383,9 @@ if(t->id!=ST_DEFINESPRITE) return; if(!t->len) { + #ifdef DEBUG_RFXSWF fprintf(stderr, "Error: Sprite has no ID!"); + #endif return; } if(t->len>4) { @@ -1465,11 +1567,12 @@ reader_GetRect(reader, &swf->movieSize); reader->read(reader, &swf->frameRate, 2); - swf->frameRate = SWAP16(swf->frameRate); + swf->frameRate = LE_16_TO_NATIVE(swf->frameRate); reader->read(reader, &swf->frameCount, 2); - swf->frameCount = SWAP16(swf->frameCount); + swf->frameCount = LE_16_TO_NATIVE(swf->frameCount); /* read tags and connect to list */ + t1.next = 0; t = &t1; while (t) { t = swf_ReadTag(reader,t); @@ -1479,7 +1582,8 @@ } } swf->firstTag = t1.next; - t1.next->prev = NULL; + if(t1.next) + t1.next->prev = NULL; } return reader->pos; @@ -1559,13 +1663,24 @@ } swf_DeleteTag(0, fileattrib); } else { - if(swf_WriteTag2(writer, has_fileattributes)<0) - return -1; + if(swf->fileAttributes) { + /* if we're writing a file out again where we might have possible + modified the fileattributes in the header, adjust the tag data */ + TAG*tt = swf_CopyTag(0,has_fileattributes); + U32 flags = swf_GetU32(tt) | swf->fileAttributes; + swf_ResetTag(tt, tt->id); + swf_SetU32(tt, flags); + if(swf_WriteTag2(writer, has_fileattributes)<0) return -1; + swf_DeleteTag(0, tt); + } else { + if(swf_WriteTag2(writer, has_fileattributes)<0) + return -1; + } } if(0 && !has_scenedescription) { TAG*scene = swf_InsertTag(0, ST_SCENEDESCRIPTION); swf_SetU16(scene, 1); - swf_SetString(scene, (U8*)"Scene 1"); + swf_SetString(scene, "Scene 1"); swf_SetU8(scene, 0); if(writer) { if(swf_WriteTag2(writer, scene)<0) @@ -1709,6 +1824,21 @@ } } +int swf_SaveSWF(SWF * swf, char*filename) +{ + int fi = open(filename, O_BINARY|O_RDWR|O_TRUNC|O_CREAT, 0777); + if(fi<0) { + perror(filename); + return 0; + } + if(swf_WriteSWF(fi, swf)<0) { + fprintf(stderr, "Unable to write output file: %s\n", filename); + return 0; + } + close(fi); + return 1; +} + int swf_WriteSWF(int handle, SWF * swf) // Writes SWF to file, returns length or <0 if fails { writer_t writer; @@ -1751,7 +1881,7 @@ sprintf(s,"Content-type: application/x-shockwave-flash\n" "Accept-Ranges: bytes\n" - "Content-Length: %lu\n" + "Content-Length: %d\n" "Expires: Thu, 13 Apr 2000 23:59:59 GMT\n" "\n",len); diff -Nru swftools-0.9.0/lib/rfxswf.h swftools-0.9.2/lib/rfxswf.h --- swftools-0.9.0/lib/rfxswf.h 2009-03-08 17:42:15.000000000 +0000 +++ swftools-0.9.2/lib/rfxswf.h 2010-11-12 18:53:49.000000000 +0000 @@ -151,6 +151,9 @@ #define FILEATTRIBUTE_USENETWORK 1 #define FILEATTRIBUTE_AS3 8 #define FILEATTRIBUTE_SYMBOLCLASS 16 +#define FILEATTRIBUTE_USEACCELERATEDBLIT 32 +#define FILEATTRIBUTE_USEHARDWAREGPU 64 + typedef struct _SWF { U8 fileVersion; U8 compressed; // SWF or SWC? @@ -169,6 +172,7 @@ int swf_ReadSWF(int handle,SWF * swf); // Reads SWF to memory (malloc'ed), returns length or <0 if fails int swf_WriteSWF2(writer_t*writer, SWF * swf); // Writes SWF via callback, returns length or <0 if fails int swf_WriteSWF(int handle,SWF * swf); // Writes SWF to file, returns length or <0 if fails +int swf_SaveSWF(SWF * swf, char*filename); int swf_WriteCGI(SWF * swf); // Outputs SWF with valid CGI header to stdout void swf_FreeTags(SWF * swf); // Frees all malloc'ed memory for swf SWF* swf_CopySWF(SWF*swf); @@ -227,6 +231,7 @@ U16 swf_GetU16(TAG * t); #define swf_GetS16(tag) ((S16)swf_GetU16(tag)) U32 swf_GetU32(TAG * t); +float swf_GetF16(TAG * t); void swf_GetRGB(TAG * t, RGBA * col); void swf_GetRGBA(TAG * t, RGBA * col); void swf_GetGradient(TAG * t, GRADIENT * gradient, char alpha); @@ -237,8 +242,12 @@ int swf_SetU16(TAG * t,U16 v); void swf_SetS16(TAG * t,int v); int swf_SetU32(TAG * t,U32 v); +void swf_SetF16(TAG * t,float f); void swf_SetString(TAG*t,const char*s); +float floatToF16(float f); +float F16toFloat(U16 x); + /* abc datatypes */ U32 swf_GetU30(TAG*tag); int swf_SetU30(TAG*tag, U32 u); @@ -440,6 +449,7 @@ int swf_ShapeNew(SHAPE ** s); void swf_ShapeFree(SHAPE * s); +char swf_ShapeIsEmpty(SHAPE*s); int swf_GetSimpleShape(TAG * t,SHAPE ** s); // without Linestyle/Fillstyle Record int swf_SetSimpleShape(TAG * t,SHAPE * s); // without Linestyle/Fillstyle Record @@ -469,6 +479,8 @@ int swf_SetLineStyle(TAG * t,LINESTYLE * l); +void swf_ShapeSetRectangle(TAG*tag, U16 shapeid, int width, int height, RGBA*rgba); +void swf_ShapeSetRectangleWithBorder(TAG*tag, U16 shapeid, int width, int height, RGBA*rgba, int linewidth, RGBA*linecolor); void swf_ShapeSetBitmapRect(TAG * t, U16 gfxid, int width, int height); //SHAPELINE* swf_ParseShapeData(U8*data, int bits, int fillbits, int linebits); @@ -506,9 +518,9 @@ } SWFKERNING; typedef struct _SWFLAYOUT -{ S16 ascent; - S16 descent; - S16 leading; +{ U16 ascent; + U16 descent; + U16 leading; SRECT * bounds; U16 kerningcount; SWFKERNING * kerning; @@ -519,11 +531,25 @@ SHAPE * shape; } SWFGLYPH; +typedef struct _SWFGLYPHPAIR +{ + U16 char1; + U16 char2; + int num; +} SWFGLYPHPAIR; + typedef struct _FONTUSAGE { int* chars; char is_reduced; int used_glyphs; int glyphs_specified; + U16 smallest_size; + + SWFGLYPHPAIR* neighbors; + int num_neighbors; + int neighbors_size; + int* neighbors_hash; + int neighbors_hash_size; } FONTUSAGE; #define FONT_STYLE_BOLD 1 @@ -532,9 +558,19 @@ #define FONT_ENCODING_ANSI 2 #define FONT_ENCODING_SHIFTJIS 4 +#define FONTALIGN_THIN 0 +#define FONTALIGN_MEDIUM 1 +#define FONTALIGN_THICK 2 + +typedef struct _ALIGNZONE +{ + U16 x,y; + U16 dx,dy; +} ALIGNZONE; + typedef struct _SWFFONT { int id; // -1 = not set - U8 version; // 0 = not set, 1 = definefont, 2 = definefont2 + U8 version; // 0 = not set, 1 = definefont, 2 = definefont2, 3 = definefont3 U8 * name; SWFLAYOUT * layout; int numchars; @@ -545,7 +581,10 @@ U16 * glyph2ascii; int * ascii2glyph; + int * glyph2glyph; // only if the font is resorted SWFGLYPH * glyph; + ALIGNZONE * alignzones; + U8 alignzone_flags; U8 language; char ** glyphnames; @@ -595,6 +634,8 @@ int swf_FontExtract_DefineFontInfo(int id, SWFFONT * f, TAG * t); int swf_FontExtract_DefineFont(int id, SWFFONT * f, TAG * t); int swf_FontExtract_GlyphNames(int id, SWFFONT * f, TAG * tag); +int swf_FontExtract_DefineFontAlignZones(int id, SWFFONT * font, TAG * tag); + int swf_FontIsItalic(SWFFONT * f); int swf_FontIsBold(SWFFONT * f); @@ -604,17 +645,23 @@ int swf_FontReduce_swfc(SWFFONT * f); int swf_FontInitUsage(SWFFONT * f); -int swf_FontUseGlyph(SWFFONT * f, int glyph); +int swf_FontUseGlyph(SWFFONT * f, int glyph, U16 size); +void swf_FontUsePair(SWFFONT * f, int char1, int char2); +int swf_FontUseGetPair(SWFFONT * f, int char1, int char2); int swf_FontUseAll(SWFFONT* f); -int swf_FontUseUTF8(SWFFONT * f, U8 * s); +int swf_FontUseUTF8(SWFFONT * f, const U8 * s, U16 size); int swf_FontUse(SWFFONT* f,U8 * s); +void swf_FontSort(SWFFONT * font); int swf_FontSetDefine(TAG * t,SWFFONT * f); int swf_FontSetDefine2(TAG * t,SWFFONT * f); int swf_FontSetInfo(TAG * t,SWFFONT * f); +void swf_FontSetAlignZones(TAG*t, SWFFONT *f); void swf_FontCreateLayout(SWFFONT*f); +void swf_FontCreateAlignZones(SWFFONT * f); void swf_FontAddLayout(SWFFONT * f, int ascent, int descent, int leading); +void swf_FontPostprocess(SWF*swf); int swf_ParseDefineText(TAG * t, void(*callback)(void*self, int*chars, int*xpos, int nr, int fontid, int fontsize, int xstart, int ystart, RGBA* color), void*self); @@ -645,9 +692,9 @@ // swffont.c -SWFFONT* swf_LoadTrueTypeFont(const char*filename); +SWFFONT* swf_LoadTrueTypeFont(const char*filename, char flashtype); SWFFONT* swf_LoadT1Font(const char*filename); -SWFFONT* swf_LoadFont(const char*filename); +SWFFONT* swf_LoadFont(const char*filename, char flashtype); void swf_SetLoadFontParameters(int scale, int skip_unused, int full_unicode); @@ -696,7 +743,6 @@ RGBA* swf_DefineLosslessBitsTagToImage(TAG*tag, int*width, int*height); RGBA* swf_ExtractImage(TAG*tag, int*dwidth, int*dheight); -RGBA* swf_ImageScale(RGBA*data, int width, int height, int newwidth, int newheight); TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quality); // swfsound.c @@ -892,9 +938,9 @@ extern char*blendModeNames[]; -int swf_ObjectPlace(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name); -int swf_ObjectPlaceClip(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name, U16 clipaction); -int swf_ObjectPlaceBlend(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const U8 * name, U8 blendmode); +int swf_ObjectPlace(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char* name); +int swf_ObjectPlaceClip(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char* name, U16 clipaction); +int swf_ObjectPlaceBlend(TAG * t,U16 id,U16 depth,MATRIX * m,CXFORM * cx,const char* name, U8 blendmode); int swf_ObjectMove(TAG * t,U16 depth,MATRIX * m,CXFORM * cx); #define PF_MOVE 0x01 @@ -911,14 +957,31 @@ #define PF2_ASBITMAP 0x04 //... +#define BLENDMODE_NORMAL 0 +#define BLENDMODE_NORMAL2 1 +#define BLENDMODE_LAYER 2 +#define BLENDMODE_MULTIPLY 3 +#define BLENDMODE_SCREEN 4 +#define BLENDMODE_LIGHTEN 5 +#define BLENDMODE_DARKEN 6 +#define BLENDMODE_ADD 7 +#define BLENDMODE_SUBSTRACT 8 +#define BLENDMODE_DIFFERENCE 9 +#define BLENDMODE_INVERT 10 +#define BLENDMODE_ALPHA 11 +#define BLENDMODE_ERASE 12 +#define BLENDMODE_OVERLAY 13 +#define BLENDMODE_HARDLIGHT 14 + typedef struct _SWFPLACEOBJECT { + U8 flags; U16 depth; U16 id; // may be 0 char move; //true: move/replace character, false: set character MATRIX matrix; CXFORM cxform; U16 ratio; - U8*name; + char*name; U16 clipdepth; ActionTAG* actions; U8 blendmode; diff -Nru swftools-0.9.0/lib/ttf.c swftools-0.9.2/lib/ttf.c --- swftools-0.9.0/lib/ttf.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/ttf.c 2010-11-12 18:56:58.000000000 +0000 @@ -0,0 +1,2470 @@ +/* ttf.c + Parser and writer for truetype font files. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include "log.h" +#include "os.h" +#include "q.h" +#include "mem.h" +#include "ttf.h" + +#define TTCFTAG 0x74746366 + +#define OPENTYPE 0x4f54544f +#define TRUETYPE_MACOS 0x74727565 +#define VERSION_1_0 0x00010000 + +#define TAG_OS2 0x4f532f32 +#define TAG_CMAP 0x636d6170 +#define TAG_GLYF 0x676c7966 //required for non opentype +#define TAG_HEAD 0x68656164 //required +#define TAG_HHEA 0x68686561 //required +#define TAG_HMTX 0x686d7478 //required +#define TAG_VHEA 0x86686561 +#define TAG_VMTX 0x866d7478 +#define TAG_KERN 0x6b65726e +#define TAG_LOCA 0x6c6f6361 //required for non opentype +#define TAG_MAXP 0x6d617870 //required +#define TAG_NAME 0x6e616d65 +#define TAG_POST 0x706f7374 +#define TAG_CFF 0x43464620 //required for opentype +#define TAG_CVT 0x63767420 +#define TAG_FPGM 0x6670676d +#define TAG_GASP 0x67617370 +#define TAG_PREP 0x70726570 + + +static U32 checksum_block(U8*_data, int len) +{ + U32 sum = 0; + U8*data = (U8*)_data; + + int pos; + int len_minus_4 = len-4; + for(pos=0;pos<=len_minus_4;pos+=4) { + sum += data[pos]<<24|data[pos+1]<<16|data[pos+2]<<8|data[pos+3]; + } + int left = len-pos; + if(left == 1) sum+= data[pos+0]<<24; + if(left == 2) sum+= data[pos+0]<<24|data[pos+1]<<16; + if(left == 3) sum+= data[pos+0]<<24|data[pos+1]<<16|data[pos+2]<<8; + return sum; +} + +typedef struct _memreader { + U8*mem; + int pos; + int size; +} memreader_t; + +static U8 readU8(memreader_t*r) +{ + return r->mem[r->pos++]; +} +static inline U16 readU16(memreader_t*r) +{ + if(r->pos+2>r->size) return 0; + U16 val = r->mem[r->pos]<<8| + r->mem[r->pos+1]; + r->pos += 2; + return val; +} +static S16 readS16(memreader_t*r) +{ + return (S16)readU16(r); +} +static U32 readU32(memreader_t*r) +{ + if(r->pos+4>r->size) return 0; + U32 val = r->mem[r->pos]<<24| + r->mem[r->pos+1]<<16| + r->mem[r->pos+2]<<8| + r->mem[r->pos+3]; + r->pos += 4; + return val; +} +static void readBlock(memreader_t*r, void*dest, int len) +{ + int remaining = r->size-r->pos; + if(len > remaining) { + memcpy(dest, r->mem+r->pos, remaining); + memset(dest+remaining, 0, len - remaining); + r->pos += remaining; + } else { + memcpy(dest, r->mem+r->pos, len); + r->pos += len; + } +} +static void reader_reset(memreader_t*r) +{ + r->pos; +} +#define INIT_READ(r,data,length,pos) memreader_t r = {(data),(pos),(length)}; + +static void expand(ttf_table_t*w, int newsize) +{ + int v1 = (newsize+63)&~63; + int v2 = w->len + w->len / 2; + w->memsize = v1>v2?v1:v2; + w->data = rfx_realloc(w->data, w->memsize); +} +static inline void writeU8(ttf_table_t*w, unsigned char b) +{ + if(w->memsizelen+1) + expand(w, w->len+1); + w->data[w->len++] = b; +} +static inline void writeU16(ttf_table_t*w, unsigned short v) +{ + if(w->memsizelen+2) + expand(w, w->len+2); + w->data[w->len++] = v>>8; + w->data[w->len++] = v; +} +static inline void writeU16_LE(ttf_table_t*w, unsigned short v) +{ + if(w->memsizelen+2) + expand(w, w->len+2); + w->data[w->len++] = v; + w->data[w->len++] = v>>8; +} +#define writeS16 writeU16 +static inline void writeU32(ttf_table_t*w, unsigned long v) +{ + if(w->memsizelen+4) + expand(w, w->len+4); + w->data[w->len++] = v>>24; + w->data[w->len++] = v>>16; + w->data[w->len++] = v>>8; + w->data[w->len++] = v; +} +static inline void writeU32_LE(ttf_table_t*w, unsigned long v) +{ + if(w->memsizelen+4) + expand(w, w->len+4); + w->data[w->len++] = v; + w->data[w->len++] = v>>8; + w->data[w->len++] = v>>16; + w->data[w->len++] = v>>24; +} +static inline void writeBlock(ttf_table_t*w, void*data, int len) +{ + if(w->memsizelen+len) + expand(w, w->len+len); + memcpy(w->data+w->len, data, len); + w->len += len; +} + +ttf_table_t*ttf_table_new(U32 id) +{ + ttf_table_t*t = rfx_calloc(sizeof(ttf_table_t)); + t->id = id; + return t; +} + +ttf_table_t*ttf_addtable(ttf_t*ttf, U32 id) +{ + ttf_table_t*t = ttf_table_new(id); + + ttf_table_t*before,*after=0; + for(before=ttf->tables; before&&before->idnext) { + after=before; + } + if(before && before->id == id) { + msg(" Error: duplicate table %08x", id); + free(before->data); + before->data = 0; + before->len = 0; + return before; + } + + if(!after) { + t->next = ttf->tables; + ttf->tables = t; + } else { + t->prev = after; + t->next = after->next; + after->next = t; + } + if(t->next) + t->next->prev = t; + return t; +} +ttf_table_t*ttf_find_table(ttf_t*ttf, U32 id) +{ + ttf_table_t*table = ttf->tables; + while(table) { + if(table->id == id) + return table; + table = table->next; + } + return 0; +} +void ttf_table_delete(ttf_t*ttf, ttf_table_t*table) +{ + if(ttf && ttf->tables == table) { + ttf->tables = table->next; + } + if(table->prev) + table->prev->next = table->next; + if(table->next) + table->next->prev = table->prev; + free(table->data); + free(table); +} +U32 ttf_table_checksum(ttf_table_t*t) +{ + U32 checksum = checksum_block(t->data, t->len); + if(t->id==TAG_HEAD && t->len>=12) { + /* the checksum for the HEAD table is calculated by masking out + the checksumadjust field */ + U32 adjust = t->data[8]<<24|t->data[9]<<16|t->data[10]<<8|t->data[11]; + checksum -= adjust; + } + return checksum; +} +static U8 printable(U8 a) +{ + if(a<32 || a==127) return '.'; + else return a; +} +static void hexdump(U8*data, int len, const char*prefix) +{ + int t; + char ascii[32]; + printf("%s -=> ",prefix); + for(t=0;t ",ascii,prefix); + } + } +} +static void ttf_table_dump(ttf_table_t*t, const char*prefix) +{ + if(!t) return; + hexdump(t->data, t->len, prefix); +} + +static table_head_t*head_new(ttf_t*ttf) +{ + table_head_t*head = rfx_calloc(sizeof(table_head_t)); + head->units_per_em = 1024; + int t; + if(ttf->num_glyphs) { + head->xmin = ttf->glyphs[0].xmin; + head->ymin = ttf->glyphs[0].ymin; + head->xmax = ttf->glyphs[0].xmax; + head->ymax = ttf->glyphs[0].ymax; + for(t=1;tnum_glyphs;t++) { + if(ttf->glyphs[t].xmin < head->xmin) head->xmin = ttf->glyphs[t].xmin; + if(ttf->glyphs[t].ymin < head->ymin) head->ymin = ttf->glyphs[t].ymin; + if(ttf->glyphs[t].xmax > head->xmax) head->xmax = ttf->glyphs[t].xmax; + if(ttf->glyphs[t].ymax > head->ymax) head->ymax = ttf->glyphs[t].ymax; + } + } + head->macStyle = 0; + head->lowest_readable_size = 8; // not sure what font renderers actually do with this + head->dir_hint = 0; + return head; +} +static int head_parse(ttf_t*ttf, memreader_t*r) +{ + ttf->head = rfx_calloc(sizeof(table_head_t)); + U32 version = readU32(r); + if(version!=VERSION_1_0) + msg(" Font HEAD has unknown version %08x", version); + U32 revision = readU32(r); + U32 checksum2 = readU32(r); + U32 magic = readU32(r); + if(magic!=0x5f0f3cf5) + msg(" Font HEAD has unknown magic number %08x", magic); + ttf->head->flags = readU16(r); + ttf->head->units_per_em = readU16(r); + readU32(r);readU32(r); //created + readU32(r);readU32(r); //modified + ttf->head->xmin = readU16(r); + ttf->head->ymin = readU16(r); + ttf->head->xmax = readU16(r); + ttf->head->ymax = readU16(r); + ttf->head->macStyle = readU16(r); + ttf->head->lowest_readable_size = readU16(r); //in pixels + ttf->head->dir_hint = readS16(r); + int loc_index = readS16(r); //used in 'loca' table + if(loc_index>1) + msg(" loca index format %d unknown", loc_index); + U16 glyph_data_format = readS16(r); + if(glyph_data_format!=0) + msg(" Font glyph data format unknown: %04x", glyph_data_format); + if(r->pos < r->size) { + msg(" Leftover bytes (%d) in HEAD tag", r->size - r->pos); + } + return loc_index; +} +static void head_write(ttf_t*ttf, ttf_table_t*w, int loca_size) +{ + writeU32(w, 0x10000); + writeU32(w, 0x10000); + writeU32(w, 0); //checksum + writeU32(w, 0x5f0f3cf5); //magic + writeU16(w, ttf->head->flags); + writeU16(w, ttf->head->units_per_em); + writeU32(w, 0);writeU32(w, 0); //created + writeU32(w, 0);writeU32(w, 0); //modified + writeU16(w, ttf->head->xmin); + writeU16(w, ttf->head->ymin); + writeU16(w, ttf->head->xmax); + writeU16(w, ttf->head->ymax); + writeU16(w, ttf->head->macStyle); + writeU16(w, ttf->head->lowest_readable_size); + writeS16(w, ttf->head->dir_hint); + writeS16(w, loca_size); //loca index size (32 bit) + writeS16(w, 0); //glyph data format +} +static void head_dump(ttf_t*ttf) +{ + printf("head->flags: %d\n", ttf->head->flags); + printf("head->units_per_em: %d\n", ttf->head->units_per_em); + printf("head->xmin: %d\n", ttf->head->xmin); + printf("head->ymin: %d\n", ttf->head->ymin); + printf("head->xmax: %d\n", ttf->head->xmax); + printf("head->ymax: %d\n", ttf->head->ymax); + printf("head->macStyle: %d\n", ttf->head->macStyle); + printf("head->lowest_readable_size: %d\n", ttf->head->lowest_readable_size); + printf("head->dir_hint: %d\n", ttf->head->dir_hint); +} +static void head_delete(ttf_t*ttf) +{ + if(ttf->head) { + free(ttf->head); + ttf->head=0; + } +} + +static table_os2_t*os2_new(ttf_t*ttf) +{ + table_os2_t*os2 = rfx_calloc(sizeof(table_os2_t)); + if(ttf->num_glyphs) { + int average_width=0; + int t; + for(t=0;tnum_glyphs;t++) { + average_width += (ttf->glyphs[t].advance + ttf->glyphs[t].bearing); + } + os2->xAvgCharWidth = average_width / ttf->num_glyphs; + } + + /* that's what everybody seems to fill in */ + os2->usWeightClass = 400; + os2->usWidthClass = 5; + + if(ttf->head) { + int advance = (ttf->head->xmax - ttf->head->xmin)/2; + int height = (ttf->head->xmax - ttf->head->xmin); + int ymid = height/2; + /* I do believe a sane font rendering engine will actually use + the font advance here- the subscript/superscript position will + not be the same for each glyph */ + os2->ySuperscriptXSize = os2->ySubscriptXSize = (ttf->head->xmax - ttf->head->xmin)/2; + os2->ySuperscriptYSize = os2->ySubscriptYSize = (ttf->head->ymax - ttf->head->ymin)/2; + os2->ySubscriptXOffset = advance; + os2->ySubscriptYOffset = 0; + os2->ySuperscriptXOffset = advance; + os2->ySuperscriptYOffset = (ttf->head->ymax - ttf->head->ymin)/2; + os2->yStrikeoutSize = ttf->head->units_per_em / 10; + os2->yStrikeoutPosition = ymid; + os2->usWinAscent = ttf->ascent; + os2->usWinDescent = ttf->descent>0?0:-ttf->descent; + os2->sxHeight = ymid; + os2->sCapHeight = height*2/3; + } + os2->panose_Weight = 4; + + /* strictly speaking we'd have to set 92/64 bits in these tables, depending on + what parts of the unicode table is filled. (e.g. bit 90 = tibetan). */ + os2->ulCharRange[0] = 1; + os2->ulCharRange[1] = 0; + os2->ulCharRange[2] = 0; + os2->ulCharRange[3] = 0; + os2->ulCodePageRange1 = 1; + os2->ulCodePageRange2 = 0; + + if(ttf->unicode_size) { + int min,max; + for(min=0;minunicode_size;min++) + if(ttf->unicode[min]) break; + for(max=ttf->unicode_size-1;max>=0;max--) + if(ttf->unicode[max]) break; + if(min<=max) { + os2->fsFirstCharIndex = min; + os2->fsLastCharIndex = max; + } + } + os2->sTypoAscender = ttf->ascent; + os2->sTypoDescender = ttf->descent; + os2->sTypoLineGap = ttf->lineGap; + + os2->usDefaultChar = 0; + os2->usBreakChar = (ttf->unicode_size>0x20 && ttf->unicode[0x20])?0x20:0; + os2->usMaxContext = 0; // we don't use ligatures yet + return os2; +} +static table_os2_t*os2_parse(memreader_t*r) +{ + table_os2_t*os2 = rfx_calloc(sizeof(table_os2_t)); + U16 version = readU16(r); + /* 0 = TrueType 1.5 + 1 = TrueType 1.66 + 2 = OpenType 1.2 + 3 = OpenType 1.4 */ + if(version!=0 && version!=1 && version!=2 && version!=3) + msg(" Unknown OS2 version: %04x", version); + os2->xAvgCharWidth = readS16(r); + os2->usWeightClass = readU16(r); + os2->usWidthClass = readU16(r); + readU16(r); //fstype + os2->ySubscriptXSize = readU16(r); + os2->ySubscriptYSize = readU16(r); + os2->ySubscriptXOffset = readU16(r); + os2->ySubscriptYOffset = readU16(r); + os2->ySuperscriptXSize = readU16(r); + os2->ySuperscriptYSize = readU16(r); + os2->ySuperscriptXOffset = readU16(r); + os2->ySuperscriptYOffset = readU16(r); + os2->yStrikeoutSize = readU16(r); + os2->yStrikeoutPosition = readU16(r); + os2->sFamilyClass = readU16(r); + os2->panose_FamilyType = readU8(r); + os2->panose_SerifStyle = readU8(r); + os2->panose_Weight = readU8(r); + os2->panose_Proportion = readU8(r); + os2->panose_Contrast = readU8(r); + os2->panose_StrokeVariation = readU8(r); + os2->panose_ArmStyle = readU8(r); + os2->panose_Letterform = readU8(r); + os2->panose_Midline = readU8(r); + os2->panose_XHeight = readU8(r); + os2->ulCharRange[0] = readU32(r); + os2->ulCharRange[1] = readU32(r); + os2->ulCharRange[2] = readU32(r); + os2->ulCharRange[3] = readU32(r); + readU32(r); //vendor + os2->fsSelection = readU16(r); + os2->fsFirstCharIndex = readU16(r); + os2->fsLastCharIndex = readU16(r); + os2->sTypoAscender = readS16(r); + os2->sTypoDescender = readS16(r); + os2->sTypoLineGap = readS16(r); + os2->usWinAscent = readU16(r); + os2->usWinDescent = readU16(r); + if(version<1) return os2; + os2->ulCodePageRange1 = readU32(r); + os2->ulCodePageRange2 = readU32(r); + if(version<2) return os2; + os2->sxHeight = readS16(r); + os2->sCapHeight = readS16(r); + os2->usDefaultChar = readU16(r); + os2->usBreakChar = readU16(r); + os2->usMaxContext = readU16(r); + + if(r->pos < r->size) { + msg(" Leftover bytes (%d) in OS2 tag", r->size - r->pos); + } + return os2; +} +static void os2_write(ttf_t*ttf, ttf_table_t*w) +{ + table_os2_t*os2 = ttf->os2; + U16 version=1; + if(os2->sxHeight|os2->sCapHeight|os2->usDefaultChar|os2->usBreakChar|os2->usMaxContext) { + version=2; + } + writeU16(w, version); + writeS16(w, os2->xAvgCharWidth); + writeU16(w, os2->usWeightClass); + writeU16(w, os2->usWidthClass); + writeU16(w, 0); //fstype + writeU16(w, os2->ySubscriptXSize); + writeU16(w, os2->ySubscriptYSize); + writeU16(w, os2->ySubscriptXOffset); + writeU16(w, os2->ySubscriptYOffset); + writeU16(w, os2->ySuperscriptXSize); + writeU16(w, os2->ySuperscriptYSize); + writeU16(w, os2->ySuperscriptXOffset); + writeU16(w, os2->ySuperscriptYOffset); + writeU16(w, os2->yStrikeoutSize); + writeU16(w, os2->yStrikeoutPosition); + writeU16(w, os2->sFamilyClass); + writeU8(w, os2->panose_FamilyType); + writeU8(w, os2->panose_SerifStyle); + writeU8(w, os2->panose_Weight); + writeU8(w, os2->panose_Proportion); + writeU8(w, os2->panose_Contrast); + writeU8(w, os2->panose_StrokeVariation); + writeU8(w, os2->panose_ArmStyle); + writeU8(w, os2->panose_Letterform); + writeU8(w, os2->panose_Midline); + writeU8(w, os2->panose_XHeight); + writeU32(w, os2->ulCharRange[0]); + writeU32(w, os2->ulCharRange[1]); + writeU32(w, os2->ulCharRange[2]); + writeU32(w, os2->ulCharRange[3]); + writeU32(w, 0x53434244); //vendor + writeU16(w, os2->fsSelection); + writeU16(w, os2->fsFirstCharIndex); + writeU16(w, os2->fsLastCharIndex); + writeS16(w, os2->sTypoAscender); + writeS16(w, os2->sTypoDescender); + writeS16(w, os2->sTypoLineGap); + writeU16(w, os2->usWinAscent); + writeU16(w, os2->usWinDescent); + if(version<1) return; + writeU32(w, os2->ulCodePageRange1); + writeU32(w, os2->ulCodePageRange2); + if(version<2) return; + writeS16(w, os2->sxHeight); + writeS16(w, os2->sCapHeight); + writeU16(w, os2->usDefaultChar); + writeU16(w, os2->usBreakChar); + writeU16(w, os2->usMaxContext); +} +static void os2_dump(ttf_t*ttf) +{ + table_os2_t*os2 = ttf->os2; + if(!os2) return; + printf("os2->xAvgCharWidth: %d\n", os2->xAvgCharWidth); + printf("os2->usWeightClass: %d\n", os2->usWeightClass); + printf("os2->usWidthClass: %d\n", os2->usWidthClass); + printf("os2->ySubscriptXSize: %d\n", os2->ySubscriptXSize); + printf("os2->ySubscriptYSize: %d\n", os2->ySubscriptYSize); + printf("os2->ySubscriptXOffset: %d\n", os2->ySubscriptXOffset); + printf("os2->ySubscriptYOffset: %d\n", os2->ySubscriptYOffset); + printf("os2->ySuperscriptXSize: %d\n", os2->ySuperscriptXSize); + printf("os2->ySuperscriptYSize: %d\n", os2->ySuperscriptYSize); + printf("os2->ySuperscriptXOffset: %d\n", os2->ySuperscriptXOffset); + printf("os2->ySuperscriptYOffset: %d\n", os2->ySuperscriptYOffset); + printf("os2->yStrikeoutSize: %d\n", os2->yStrikeoutSize); + printf("os2->yStrikeoutPosition: %d\n", os2->yStrikeoutPosition); + printf("os2->sFamilyClass: %d\n", os2->sFamilyClass); + printf("os2->panose_FamilyType: %d\n", os2->panose_FamilyType); + printf("os2->panose_SerifStyle: %d\n", os2->panose_SerifStyle); + printf("os2->panose_Weight: %d\n", os2->panose_Weight); + printf("os2->panose_Proportion: %d\n", os2->panose_Proportion); + printf("os2->panose_Contrast: %d\n", os2->panose_Contrast); + printf("os2->panose_StrokeVariation: %d\n", os2->panose_StrokeVariation); + printf("os2->panose_ArmStyle: %d\n", os2->panose_ArmStyle); + printf("os2->panose_Letterform: %d\n", os2->panose_Letterform); + printf("os2->panose_Midline: %d\n", os2->panose_Midline); + printf("os2->panose_XHeight: %d\n", os2->panose_XHeight); + printf("os2->ulCharRange[0]: %d\n", os2->ulCharRange[0]); + printf("os2->ulCharRange[1]: %d\n", os2->ulCharRange[1]); + printf("os2->ulCharRange[2]: %d\n", os2->ulCharRange[2]); + printf("os2->ulCharRange[3]: %d\n", os2->ulCharRange[3]); + printf("os2->fsSelection: %d\n", os2->fsSelection); + printf("os2->fsFirstCharIndex: %d\n", os2->fsFirstCharIndex); + printf("os2->fsLastCharIndex: %d\n", os2->fsLastCharIndex); + printf("os2->sTypoAscender: %d\n", os2->sTypoAscender); + printf("os2->sTypoDescender: %d\n", os2->sTypoDescender); + printf("os2->sTypoLineGap: %d\n", os2->sTypoLineGap); + printf("os2->usWinAscent: %d\n", os2->usWinAscent); + printf("os2->usWinDescent: %d\n", os2->usWinDescent); + printf("os2->ulCodePageRange1: %d\n", os2->ulCodePageRange1); + printf("os2->ulCodePageRange2: %d\n", os2->ulCodePageRange2); + printf("os2->sxHeight: %d\n", os2->sxHeight); + printf("os2->sCapHeight: %d\n", os2->sCapHeight); + printf("os2->usDefaultChar: %d\n", os2->usDefaultChar); + printf("os2->usBreakChar: %d\n", os2->usBreakChar); + printf("os2->usMaxContext: %d\n", os2->usMaxContext); +} +static void os2_delete(ttf_t*ttf) +{ + if(ttf->os2) + free(ttf->os2); + ttf->os2=0; +} + +static table_maxp_t*maxp_new(ttf_t*ttf) +{ + table_maxp_t*maxp = rfx_calloc(sizeof(table_maxp_t)); + int t; + maxp->maxContours=1; + if(ttf->num_glyphs) { + int max = 1; + for(t=0;tnum_glyphs;t++) { + if(ttf->glyphs[t].num_points>max) + max = ttf->glyphs[t].num_points; + int contours = 0; + int s; + for(s=0;sglyphs[t].num_points;s++) { + if(ttf->glyphs[t].points[s].flags&GLYPH_CONTOUR_END) + contours++; + } + if(maxp->maxContours < contours) + maxp->maxContours = contours; + } + maxp->maxPoints = max; + + /* we don't generate composite glyphs yet */ + maxp->maxComponentPoints = 0; + maxp->maxComponentContours = 0; + } + maxp->maxZones = 2; // we don't use the Z0 zone + return maxp; +} +static table_maxp_t* maxp_parse(ttf_t*ttf, memreader_t*r) +{ + U32 version = readU32(r); + ttf->num_glyphs = readU16(r); + /* according to freetype, older fonts (version<0x10000) + apparently only contain the number of glyphs. this is + rather rare, though. */ + if(version<0x10000 && r->size==6) return 0; + + if(r->size<32) + msg(" Truncated maxp table (version %d)", version); + + table_maxp_t*maxp = rfx_calloc(sizeof(table_maxp_t)); + maxp->maxPoints = readU16(r); + maxp->maxContours = readU16(r); + maxp->maxComponentPoints = readU16(r); + maxp->maxComponentContours = readU16(r); + maxp->maxZones = readU16(r); + maxp->maxTwilightPoints = readU16(r); + maxp->maxStorage = readU16(r); + maxp->maxFunctionDefs = readU16(r); + maxp->maxInstructionDefs = readU16(r); + maxp->maxStackElements = readU16(r); + maxp->maxSizeOfInstructions = readU16(r); + maxp->maxComponentElements = readU16(r); + maxp->maxComponentDepth = readU16(r); + return maxp; +} +static void maxp_write(ttf_t*ttf, ttf_table_t*w) +{ + table_maxp_t*maxp = ttf->maxp; + if(!maxp) { + /* version 0.5 simplified maxp table */ + writeU32(w, 0x00005000); + writeU16(w, ttf->num_glyphs); + return; + } + writeU32(w, 0x10000); //version + writeU16(w, ttf->num_glyphs); + writeU16(w, maxp->maxPoints); + writeU16(w, maxp->maxContours); + writeU16(w, maxp->maxComponentPoints); + writeU16(w, maxp->maxComponentContours); + writeU16(w, maxp->maxZones); + writeU16(w, maxp->maxTwilightPoints); + writeU16(w, maxp->maxStorage); + writeU16(w, maxp->maxFunctionDefs); + writeU16(w, maxp->maxInstructionDefs); + writeU16(w, maxp->maxStackElements); + writeU16(w, maxp->maxSizeOfInstructions); + writeU16(w, maxp->maxComponentElements); + writeU16(w, maxp->maxComponentDepth); +} +static void maxp_dump(ttf_t*ttf) +{ + table_maxp_t*maxp = ttf->maxp; + if(!maxp) return; + printf("maxp->maxPoints: %d\n", maxp->maxPoints); + printf("maxp->maxContours: %d\n", maxp->maxContours); + printf("maxp->maxComponentPoints: %d\n", maxp->maxComponentPoints); + printf("maxp->maxComponentContours: %d\n", maxp->maxComponentContours); + printf("maxp->maxZones: %d\n", maxp->maxZones); + printf("maxp->maxTwilightPoints: %d\n", maxp->maxTwilightPoints); + printf("maxp->maxStorage: %d\n", maxp->maxStorage); + printf("maxp->maxFunctionDefs: %d\n", maxp->maxFunctionDefs); + printf("maxp->maxInstructionDefs: %d\n", maxp->maxInstructionDefs); + printf("maxp->maxStackElements: %d\n", maxp->maxStackElements); + printf("maxp->maxSizeOfInstructions: %d\n", maxp->maxSizeOfInstructions); + printf("maxp->maxComponentElements: %d\n", maxp->maxComponentElements); + printf("maxp->maxComponentDepth: %d\n", maxp->maxComponentDepth); +} +static void maxp_delete(ttf_t*ttf) +{ + if(ttf->maxp) + free(ttf->maxp); + ttf->maxp=0; +} + +static table_hea_t*hea_new(ttf_t*ttf) +{ + table_hea_t*hea = rfx_calloc(sizeof(table_hea_t)); + if(ttf->num_glyphs) { + int t; + for(t=0;tnum_glyphs;t++) { + if(ttf->glyphs[t].advance > hea->advanceWidthMax) + hea->advanceWidthMax = ttf->glyphs[t].advance; + if(ttf->glyphs[t].bearing < hea->minLeftSideBearing) + hea->minLeftSideBearing = ttf->glyphs[t].bearing; + if(ttf->glyphs[t].xmax < hea->minRightSideBearing) + hea->minRightSideBearing = ttf->glyphs[t].xmax; + int width = ttf->glyphs[t].xmax - ttf->glyphs[t].xmin; + if(width > hea->xMaxExtent) + hea->xMaxExtent = width; + } + hea->caretSlopeRise = 1; + } + return hea; +} +static int hea_parse(memreader_t*r, ttf_t*ttf) +{ + table_hea_t*hea = ttf->hea = rfx_calloc(sizeof(table_hea_t)); + U32 version = readU32(r); + ttf->ascent = readS16(r); + ttf->descent = readS16(r); + ttf->lineGap = readS16(r); + hea->advanceWidthMax = readU16(r); + hea->minLeftSideBearing = readS16(r); + hea->minRightSideBearing = readS16(r); + hea->xMaxExtent = readS16(r); + hea->caretSlopeRise = readS16(r); + hea->caretSlopeRun = readS16(r); + hea->caretOffset = readS16(r); + readS16(r); //reserved[0] + readS16(r); //reserved[1] + readS16(r); //reserved[2] + readS16(r); //reserved[3] + S16 metricDataFormat = readS16(r); //should be 0 + if(metricDataFormat!=0) { + msg(" Unknown metric format %d", metricDataFormat); + } + int num_advances = readU16(r); + if(num_advances > ttf->num_glyphs) { + msg(" bad number of horizontal metrics: %d", num_advances); + num_advances = ttf->num_glyphs; + } + return num_advances; +} +static table_hea_t*hea_write(ttf_t*ttf, ttf_table_t*w, int num_advances) +{ + table_hea_t*hea = ttf->hea; + writeU32(w, 0x00010000); + writeS16(w, ttf->ascent); + writeS16(w, ttf->descent); + writeS16(w, ttf->lineGap); + writeU16(w, hea->advanceWidthMax); + writeS16(w, hea->minLeftSideBearing); + writeS16(w, hea->minRightSideBearing); + writeS16(w, hea->xMaxExtent); + writeS16(w, hea->caretSlopeRise); + writeS16(w, hea->caretSlopeRun); + writeS16(w, hea->caretOffset); + writeS16(w, 0); //reserved + writeS16(w, 0); //reserved + writeS16(w, 0); //reserved + writeS16(w, 0); //reserved + writeS16(w, 0); //metricDataFormat + writeU16(w, num_advances); + return hea; +} +static void hea_dump(ttf_t*ttf) +{ + table_hea_t*hea = ttf->hea; + if(!hea) return; + const char*dir = ttf->is_vertical?"v":"h"; + printf("%shea->ascent: %d\n", dir, ttf->ascent); + printf("%shea->descent: %d\n", dir, ttf->descent); + printf("%shea->lineGap: %d\n", dir, ttf->lineGap); + printf("%shea->advanceWidthMax: %d\n", dir, hea->advanceWidthMax); + printf("%shea->minLeftSideBearing: %d\n", dir, hea->minLeftSideBearing); + printf("%shea->minRightSideBearing: %d\n", dir, hea->minRightSideBearing); + printf("%shea->xMaxExtent: %d\n", dir, hea->xMaxExtent); + printf("%shea->caretSlopeRise: %d\n", dir, hea->caretSlopeRise); + printf("%shea->caretSlopeRun: %d\n", dir, hea->caretSlopeRun); + printf("%shea->caretOffset: %d\n", dir, hea->caretOffset); +} +static void hea_delete(ttf_t*ttf) +{ + if(ttf->hea) { + free(ttf->hea); + ttf->hea=0; + } +} + +static void mtx_parse(memreader_t*r, ttf_t*ttf, int num_advances) +{ + U16 old_advance = 0; + int t; + if(num_advances > r->size/4) + num_advances = r->size/4; + for(t=0;tglyphs[t].advance = readU16(r); + ttf->glyphs[t].bearing = readS16(r); + } + int rest = (r->size - num_advances*4)/2; + if(ttf->num_glyphs < num_advances+rest) { + rest = ttf->num_glyphs-num_advances; + } + for(t=0;tglyphs[t].advance = old_advance; + ttf->glyphs[t].bearing = readS16(r); + } +} +static int mtx_write(ttf_t*ttf, ttf_table_t*w) +{ + int num_advances = ttf->num_glyphs; + if(ttf->num_glyphs>=2) { + int t; + for(t=ttf->num_glyphs-1;t>0;t--) { + if(ttf->glyphs[t-1].advance != + ttf->glyphs[t].advance) break; + } + /* we need to store all individual advances as well + as one entry for the constant */ + num_advances = t+1; + } + + int t; + for(t=0;tglyphs[t].advance); + writeS16(w, ttf->glyphs[t].bearing); + } + for(;tnum_glyphs;t++) { + writeS16(w, ttf->glyphs[t].bearing); + } + return num_advances; +} + +static U32*loca_parse(memreader_t*r, ttf_t*ttf, int size) +{ + int t; + int num = ttf->num_glyphs+1; + U32*locations = rfx_calloc(num*sizeof(U32)); + U32 lastloc = 0; + U32 loc = 0; + char warn_unsorted = 1; + if(size) { + if(num*4 > r->size) { + msg(" Short 'loca' table (32 bit): %d/%d", r->size/4, num); + num=r->size/4; + } + if(num*4 < r->size) { + msg(" Extraneous data (%d bytes) in 'loca' table (32 bit)", r->size-num*4); + } + for(t=0;t loc && warn_unsorted) { + msg(" Unsorted 'loca' table (32 bit)"); + warn_unsorted=0; + } + lastloc = loc; + } + } else { + if(num*2 > r->size) { + msg(" Short 'loca' table (16 bit)"); + num=r->size/2; + } + if(num*2 < r->size) { + msg(" Extraneous data (%d bytes) in 'loca' table (16 bit)", r->size-num*2); + } + for(t=0;t loc && warn_unsorted) { + msg(" Unsorted 'loca' table"); + warn_unsorted=0; + } + lastloc = loc; + } + } + return locations; +} +static int loca_write(ttf_t*ttf, ttf_table_t*w, U32*locations) +{ + int t; + char use_32bit = 0; + for(t=0;t<=ttf->num_glyphs;t++) { + if(locations[t]>=0x20000 || (locations[t]&1)) { + use_32bit = 1; + break; + } + } + + if(use_32bit) { + for(t=0;t<=ttf->num_glyphs;t++) { + writeU32(w, locations[t]); + } + return 1; + } else { + for(t=0;t<=ttf->num_glyphs;t++) { + writeU16(w, locations[t]/2); + } + return 0; + } +} + +static int parse_simple_glyph(ttf_t*ttf, memreader_t*r, int num_contours, int glyphnr) +{ + ttfglyph_t*glyph = &ttf->glyphs[glyphnr]; + + U16*endpoints = 0; + if(num_contours>0) { + endpoints = malloc(sizeof(U16)*num_contours); + int s; + int lastpos = -1; + for(s=0;s Unsorted endpoints array (len:%d) last=%d now=%d", s, pos, lastpos); + } + lastpos = pos; + } + } + U16 code_len = readU16(r); + if(code_len) { + glyph->code = malloc(sizeof(U16)*code_len); + readBlock(r, glyph->code, code_len); + glyph->code_size = code_len; + } + + if(!endpoints) + return 1; + + /*msg(" TTF Glyph %d) code_size=%d num_contours=%d glyph->num_points=%d %d/%d/%d/%d", + glyphnr, code_len, num_contours, glyph->num_points, + xmin, ymin, xmax, ymax);*/ + INIT_READ(fx, r->mem, r->size, r->pos); + INIT_READ(fy, r->mem, r->size, r->pos); + + glyph->num_points = endpoints[num_contours-1] + 1; + glyph->points = rfx_calloc(sizeof(ttfpoint_t)*glyph->num_points); + + /* parse flag array (1st pass- to determine start of coordinates) */ + int num=0; + while(numnum_points) { + U8 flag = readU8(r); + if(flag&0xc0) { + msg(" Bad flags in glyph outline: %02x (at pos %d)", flag, num); + free(glyph->points); + glyph->points = 0; + glyph->num_points = 0; + return 0; + } + int count = 1; + if(flag & 0x08) + count += readU8(r); + if(count+num>glyph->num_points) { + msg(" Bad count (%d) in glyph (%d) (at pos %d)", count, glyphnr, num); + count = glyph->num_points-num; + } + num+=count; + } + + /* parse flag array (2nd pass) and x coordinates */ + num=0; + int x = 0; + char is_start=1; + int contour_pos=0; + int bytepos = r->pos; + while(numnum_points) { + U8 flag = readU8(&fx); + int count = flag&8?readU8(&fx)+1:1; + count=count>glyph->num_points-num?glyph->num_points-num:(count?count:1); + do { + char is_end=0; + if(contour_pospoints[num].x = x; + U8 f = flag&GLYPH_ON_CURVE; + if(is_start) f|=GLYPH_CONTOUR_START; + if(is_end) f|=GLYPH_CONTOUR_END; + glyph->points[num].flags = f; + num++; + is_start = is_end; + } while(--count); + } + + /* parse flag array (3rd pass) and y coordinates */ + num=0; + int y = 0; + while(numnum_points) { + U8 flag = readU8(&fy); + int count = flag&8?readU8(&fy)+1:1; + count=count>glyph->num_points-num?glyph->num_points-num:(count?count:1); + do { + if((flag&0x24) == 0x24) y += readU8(r); + else if((flag&0x24) == 0x04) y -= readU8(r); + else if((flag&0x24) == 0x00) y += readS16(r); + glyph->points[num].y = y; + num++; + } while(--count); + } + free(endpoints); + return 1; +} +static void glyf_parse(memreader_t*rr, ttf_t*ttf, U32*loca) +{ + int t; + char warn_about_compound_glyphs=0; + for(t=0;tnum_glyphs;t++) { + INIT_READ(r, rr->mem, rr->size, loca[t]); + if(loca[t]==loca[t+1] || loca[t]==r.size) + continue; //empty glyph + if(r.pos+10>r.size) { + msg(" Truncated glyph entry %d/%d (or bad loca entry %d/%d, next loca: %d)", + t, ttf->num_glyphs, loca[t], r.size, loca[t+1]); + break; + } + S16 num_contours = readS16(&r); + ttf->glyphs[t].xmin = readS16(&r); + ttf->glyphs[t].ymin = readS16(&r); + ttf->glyphs[t].xmax = readS16(&r); + ttf->glyphs[t].ymax = readS16(&r); + + if(num_contours<0) { + if(warn_about_compound_glyphs) + msg(" Compound glyphs not supported yet"); + warn_about_compound_glyphs=0; + } else { + if(!parse_simple_glyph(ttf, &r, num_contours, t)) + return; + } + } + +} +void write_simple_glyph(ttf_table_t*w, ttfglyph_t*g) +{ + /* endpoints array */ + int s; + for(s=0;snum_points;s++) { + if(g->points[s].flags&GLYPH_CONTOUR_END) + writeU16(w, s); + } + + /* bytecode */ + writeU16(w, g->code_size); + if(g->code_size) + writeBlock(w, g->code, g->code_size); + + /* flags */ + int lastx=0; + int lasty=0; + int lastflag=-1; + int flagcount=0; + for(s=0;snum_points;s++) { + ttfpoint_t*p = &g->points[s]; + int dx = p->x - lastx; + int dy = p->y - lasty; + U8 flags = p->flags&GLYPH_ON_CURVE; + if(!dx) { + flags|=0x10; + } else if(dx<0 && dx>=-255) { + flags|=0x02; + } else if(dx>0 && dx<=255) { + flags|=0x12; + } + if(!dy) { + flags|=0x20; + } else if(dy<0 && dy>=-255) { + flags|=0x04; + } else if(dy>0 && dy<=255) { + flags|=0x24; + } + if(flags == lastflag && flagcount<255) { + flagcount++; + } else { + if(lastflag>=0) { + if(flagcount) { + writeU8(w, lastflag|8); + writeU8(w, flagcount); + } else { + writeU8(w, lastflag); + } + } + lastflag = flags; + flagcount = 0; + } + lastx = p->x; + lasty = p->y; + } + if(lastflag>=0) { + if(flagcount) { + writeU8(w, lastflag|8); + writeU8(w, flagcount); + } else { + writeU8(w, lastflag); + } + } + /* coordinates */ + lastx=0; + int bytepos = w->len; + for(s=0;snum_points;s++) { + ttfpoint_t*p = &g->points[s]; + int dx = p->x - lastx; + if(dx>32767 || dx<-32768) { + msg(" Coordinate overflow in glyph"); + } + lastx = p->x; + if(dx>0 && dx<=255) writeU8(w, dx); + else if(dx<0 && dx>=-255) writeU8(w, -dx); + else if(dx) writeS16(w, dx); + } + + lasty=0; + for(s=0;snum_points;s++) { + ttfpoint_t*p = &g->points[s]; + int dy = p->y - lasty; + if(dy>32767 || dy<-32768) { + msg(" Coordinate overflow in glyph"); + } + lasty = p->y; + if(dy>0 && dy<=255) writeU8(w, dy); + else if(dy<0 && dy>=-255) writeU8(w, -dy); + else if(dy) writeS16(w, dy); + } +} +U32* glyf_write(ttf_t* ttf, ttf_table_t*w) +{ + U32*locations = malloc(sizeof(U32)*(ttf->num_glyphs+1)); + int t; + for(t=0;tnum_glyphs;t++) { + locations[t] = w->len; + ttfglyph_t*g = &ttf->glyphs[t]; + int s; + int num_contours = 0; + for(s=0;snum_points;s++) { + if(g->points[s].flags&GLYPH_CONTOUR_END) + num_contours++; + } + writeS16(w, num_contours?num_contours:1); + writeS16(w, g->xmin); + writeS16(w, g->ymin); + writeS16(w, g->xmax); + writeS16(w, g->ymax); + + if(!num_contours) { + /* some ttf parsers can't deal with zero contours, so in the case + of an empty glyph, write a single point (0,0) */ + writeU16(w, 0); //endpoint of 1st contour + writeU16(w, g->code_size); + if(g->code_size) + writeBlock(w, g->code, g->code_size); + writeU8(w, 0x31); //flag (xy=(0,0),on curve) + } else { + write_simple_glyph(w, g); + } + } + locations[t] = w->len; + return locations; +} +void glyf_dump(ttf_t* ttf) +{ + if(!ttf->glyphs) return; + int t; + for(t=0;tnum_glyphs;t++) { + ttfglyph_t*g = &ttf->glyphs[t]; + printf("glyph %d)\n", t); + printf(" advance=%d\n", g->advance); + printf(" bearing=%d\n", g->bearing); + printf(" bbox=(%d/%d/%d/%d)\n", g->xmin, g->ymin, g->xmax, g->ymax); + printf(" points=("); + int s; + for(s=0;snum_points;s++) { + if(s) printf(","); + printf("%d/%d/0x%02x", g->points[s].x, g->points[s].y, g->points[s].flags); + } + printf(")\n"); + if(g->code_size) + hexdump(g->code, g->code_size, " "); + } +} +void glyf_delete(ttf_t* ttf) +{ + if(!ttf->glyphs) + return; + int t; + for(t=0;tnum_glyphs;t++) { + if(ttf->glyphs[t].code) { + free(ttf->glyphs[t].code); + ttf->glyphs[t].code = 0; + } + if(ttf->glyphs[t].points) { + free(ttf->glyphs[t].points); + ttf->glyphs[t].points = 0; + } + } + free(ttf->glyphs);ttf->glyphs=0; +} + +static void grow_unicode(ttf_t*ttf, int index) +{ + int size = index+1; + if(!ttf->unicode) { + ttf->unicode = rfx_calloc(sizeof(ttf->unicode[0])*size); + } else if(ttf->unicode_sizeunicode = rfx_realloc(ttf->unicode, sizeof(ttf->unicode[0])*size); + memset(ttf->unicode+ttf->unicode_size, 0, sizeof(ttf->unicode[0])*(size - ttf->unicode_size)); + } + ttf->unicode_size = size; +} +void cmap_parse(memreader_t*r, ttf_t*ttf) +{ + readU16(r); // version (0) + int num_subtables = readU16(r); + int t; + char warn=1; + if(r->pos+num_subtables*8 > r->size) { + msg(" CMap overflow"); + num_subtables = (r->size-r->pos)/8; + } + unicode_t*data = 0; + for(t=0;tr->size) { + msg(" CMAP table %d %d is out of bounds (%d)", platform, encoding, offset); + continue; + } + + int is_unicode = platform==0 || + platform==3 && encoding == 1 || + platform==3 && encoding == 10; + + if(!is_unicode) + continue; + + INIT_READ(t, r->mem, r->size, offset); + U16 format = readU16(&t); + int length = readU16(&t); + U16 language = readU16(&t); + + if(language) + msg(" Language code %02x in unicode mapping", language); + + int num = 0; + if(format == 0) { + num = length-6; + if(t.pos+length > t.size) { + msg(" overflow in format 0 cmap table"); + num = t.size-t.pos; + } + data = malloc(num*sizeof(unicode_t)); + int s; + grow_unicode(ttf, num); + for(s=0;sunicode[s] = readU8(&t); + } + } else if(format == 4) { + U16 segment_count = readU16(&t); + if(segment_count&1) { + msg(" Bad segmentx2 count %d", segment_count); + continue; + } + segment_count>>=1; + readU16(&t); //searchrange + readU16(&t); //entry selector + readU16(&t); //range shift + INIT_READ(r_end, t.mem, t.size, t.pos); + INIT_READ(r_start, t.mem, t.size, t.pos+2+segment_count*2); + INIT_READ(r_delta, t.mem, t.size, t.pos+2+segment_count*4); + INIT_READ(r_range, t.mem, t.size, t.pos+2+segment_count*6); + int glyphmap_start = t.pos+2+segment_count*8; + int glyphmap_size = t.size - glyphmap_start; + int s; + for(s=0;sunicode[u] = (u + delta) & 0xffff; + } + } else { + int pos = r_range.pos-2+range; + if(warn && pos+end-start+1 > t.size) { + msg(" glyphmap index out of bounds (%d-%d/%d)", pos, pos+end-start, t.size); + warn=0; + } + INIT_READ(g, t.mem, t.size, pos); + for(u=start;u<=end;u++) { + ttf->unicode[u] = readU16(&g); + } + } + } + } + } +} +static int segment_size(unicode_t*unicode, int pos, int size) +{ + int s; + int count=0; + for(s=pos;s4) { + /* a segment costs us 8 bytes, so for more than 4 consecutive + zero entries (16 bit each) in the glyph index array, + it pays off to start a new segment */ + break; + } + } + s -= count; // go to the last filled in entry + if(s==size) + return size-1; + return s; +} +void cmap_write(ttf_t* ttf, ttf_table_t*w) +{ + writeU16(w, 0); //version + writeU16(w, 2); //two tables + + writeU16(w, 0); //platform (unicode) + writeU16(w, 3); //encoding (unicode 2.0) + writeU32(w, 20); //offset + + writeU16(w, 3); //platform (windows) + writeU16(w, 1); //encoding (unicode basic multilingual plane UCS-2) + writeU32(w, 20); //offset + + writeU16(w, 4); // format=4 + int length_pos = w->len; + writeU16(w, 0); // length: we don't know yet + writeU16(w, 0); // language (n/a for unicode) + int num_segments_pos = w->len; + writeU16(w, 0); //number of segments: we don't know yet either + writeU16(w, 0); //searchrange + writeU16(w, 0); //entry selector + writeU16(w, 0); //range shift + + int pos=0; + int num_segments=0; + while(pos < ttf->unicode_size) { + if(!ttf->unicode[pos]) { + pos++; + continue; + } + int s = segment_size(ttf->unicode, pos, ttf->unicode_size); + pos = s+1; + num_segments++; + } + + num_segments++; // account for 0xffff mapping + + int glyphmap_start = w->len+2+num_segments*8; + + int t; + int end_pos = w->len; + for(t=0;tlen; + for(t=0;tlen; + for(t=0;tlen; + for(t=0;tdata[num_segments_pos++]=(num_segments*2)>>8; + w->data[num_segments_pos++]=(num_segments*2); + /* backpatch search range */ + int tmp = num_segments; + int search_range = 0; + while(tmp) { + search_range = tmp; + tmp = tmp&(tmp-1); + } + w->data[num_segments_pos++]=(search_range*2)>>8; + w->data[num_segments_pos++]=(search_range*2); + /* backpatch entry selector */ + int entry_selector = 0; + tmp = search_range; + while(tmp>1) {tmp>>=1;entry_selector++;} + w->data[num_segments_pos++]=entry_selector>>8; + w->data[num_segments_pos++]=entry_selector; + /* backpatch range shift */ + int range_shift = num_segments*2 - search_range*2; + w->data[num_segments_pos++]=range_shift>>8; + w->data[num_segments_pos++]=range_shift; + + pos=0; + num_segments = 0; + while(pos < ttf->unicode_size) { + if(!ttf->unicode[pos]) { + pos++; + continue; + } + U16 end = segment_size(ttf->unicode, pos, ttf->unicode_size); + w->data[end_pos++]=end>>8; + w->data[end_pos++]=end; + w->data[start_pos++]=pos>>8; + w->data[start_pos++]=pos; + int s; + U16 delta = ttf->unicode[pos]-pos; + char do_delta=1; + for(s=pos+1;s<=end;s++) { + U16 delta2 = ttf->unicode[s]-s; + if(delta2!=delta) { + do_delta=0; + break; + } + } + U16 range; + if(do_delta) { + range = 0; + } else { + delta = 0; + range = w->len - range_pos; + for(s=pos;s<=end;s++) { + writeU16(w, ttf->unicode[s]); + } + } + w->data[delta_pos++]=delta>>8; + w->data[delta_pos++]=delta; + w->data[range_pos++]=range>>8; + w->data[range_pos++]=range; + num_segments++; + pos = end+1; + } + + /* write out a mapping from 0xffff to 0- seems to be required + by some libraries (e.g. fonttools) */ + w->data[end_pos++]=0xff; + w->data[end_pos++]=0xff; + w->data[start_pos++]=0xff; + w->data[start_pos++]=0xff; + w->data[delta_pos++]=0; + w->data[delta_pos++]=1; + w->data[range_pos++]=0; + w->data[range_pos++]=0; + + w->data[length_pos]=(w->len-20)>>8; + w->data[length_pos+1]=w->len-20; +} +void cmap_delete(ttf_t*ttf) +{ + if(ttf->unicode) { + free(ttf->unicode); + ttf->unicode=0; + } + ttf->unicode_size=0; +} +static char*readString(memreader_t*r, int len) +{ + char*s = malloc(len+1); + readBlock(r, s, len); + s[len] = 0; + return s; +} +void name_parse(memreader_t*r, ttf_t*ttf) +{ + U16 format = readU16(r); + U16 count = readU16(r); + U16 offset = readU16(r); + + int t; + for(t=0;tmem, r->size, offset+offset_2); + if(!(platform==0 || (platform==1 && encoding==0))) + continue; + + INIT_READ(s, r->mem, r->size, offset+offset_2); + + switch (name_id) { + case 1: read_name = &ttf->family_name; break; + case 2: read_name = &ttf->subfamily_name; break; + case 3: read_name = &ttf->font_uid; break; + case 4: read_name = &ttf->full_name; break; + case 5: read_name = &ttf->version_string; break; + case 6: read_name = &ttf->postscript_name; break; + default: read_name = 0; + } + + if (read_name) { + if (*read_name) free(*read_name); + *read_name = readString(&s, len); + } + } +} +void name_write(ttf_t*ttf, ttf_table_t*table) +{ + char*strings[6] = {ttf->family_name, ttf->subfamily_name, ttf->font_uid, ttf->full_name, ttf->version_string, ttf->postscript_name}; + int codes[6] = {1,2,3,4,5,6}; + + writeU16(table, 0); //format + int count = 0; + int t; + int nr = sizeof(strings)/sizeof(strings[0]); + + for(t=0;tlen; + writeU16(table, 0); //offset (will be filled in later) + + /* Windows expects the name table to be sorted by platform/encoding/language/name_id */ + int offset = 0; + for(t=0;tdata[offset_pos] = table->len>>8; + table->data[offset_pos+1] = table->len; + + for(t=0;tfull_name) { + free(ttf->full_name); + ttf->full_name=0; + } + if(ttf->family_name) { + free(ttf->family_name); + ttf->family_name=0; + } + if(ttf->subfamily_name) { + free(ttf->subfamily_name); + ttf->subfamily_name=0; + } + if(ttf->version_string) { + free(ttf->version_string); + ttf->version_string=0; + } + if(ttf->font_uid) { + free(ttf->font_uid); + ttf->font_uid=0; + } + if(ttf->postscript_name) { + free(ttf->postscript_name); + ttf->postscript_name=0; + } +} + +static table_post_t*post_new(ttf_t*ttf) +{ + table_post_t*post = rfx_calloc(sizeof(table_post_t)); + return post; +} +void post_parse(memreader_t*r, ttf_t*ttf) +{ + table_post_t*post = ttf->post = rfx_calloc(sizeof(table_post_t)); + U32 format = readU32(r); + post->italic_angle = readU32(r); + post->underline_position = readU16(r); + post->underline_thickness = readU16(r); + U16 is_monospaced = readU32(r); + readU32(r); // min mem 42 + readU32(r); + readU32(r); // min mem 1 + readU32(r); +} +void post_write(ttf_t*ttf, ttf_table_t*table) +{ + table_post_t*post = ttf->post; + writeU32(table, 0x00030000); + writeU32(table, post->italic_angle); + writeU16(table, post->underline_position); + writeU16(table, post->underline_thickness); + writeU32(table, 0); //is monospaced TODO + writeU32(table, 0); //min mem 42 + writeU32(table, 0); + writeU32(table, 0); //min mem 1 + writeU32(table, 0); +} +void post_delete(ttf_t*ttf) +{ + if(ttf->post) { + free(ttf->post); + ttf->post = 0; + } +} + +void cvt_parse(memreader_t*r, ttf_t*ttf) +{ + table_cvt_t*cvt = ttf->cvt = rfx_calloc(sizeof(table_cvt_t)); + cvt->num = r->size/2; + cvt->values = malloc(cvt->num*sizeof(S16)); + int t; + for(t=0;tnum;t++) { + cvt->values[t] = readS16(r); + } +} +void cvt_write(ttf_t*ttf, ttf_table_t*table) +{ + table_cvt_t*cvt = ttf->cvt; + int t; + for(t=0;tnum;t++) { + writeS16(table, cvt->values[t]); + } +} +void cvt_delete(ttf_t*ttf) +{ + if(ttf->cvt) { + if(ttf->cvt->values) + free(ttf->cvt->values); + free(ttf->cvt); + ttf->cvt = 0; + } +} + +static table_gasp_t*gasp_new(ttf_t*ttf) +{ + table_gasp_t*gasp = rfx_calloc(sizeof(table_gasp_t)); + gasp->num = 1; + gasp->records = rfx_calloc(sizeof(gasp->records[0])*gasp->num); + + gasp->records[0].size = 65535; + gasp->records[0].behaviour = 15; //gridfit+grayscale rendering + return gasp; +} +void gasp_parse(memreader_t*r, ttf_t*ttf) +{ + table_gasp_t*gasp = ttf->gasp = rfx_calloc(sizeof(table_gasp_t)); + readU16(r); //version + int num = readU16(r); + int t; + if(!num) return; + gasp->records = malloc(sizeof(gasp->records[0])*num); + for(t=0;trecords[t].size = readU16(r); + gasp->records[t].behaviour = readU16(r); + } +} + +#define GASP_SYMMETRIC_GRIDFIT 0x0008 +#define GASP_SYMMETRIC_SMOOTHING 0x0004 +#define GASP_DOGRAY 0x0002 +#define GASP_GRIDFIT 0x0001 + +void gasp_write(ttf_t*ttf, ttf_table_t*table) +{ + table_gasp_t*gasp = ttf->gasp; + int version = 0; + int t; + for(t=0;tnum;t++) { + if(gasp->records[t].behaviour & ~(GASP_GRIDFIT | GASP_DOGRAY)) { + version = 1; + } + } + writeU16(table, version); + writeU16(table, gasp->num); + for(t=0;tnum;t++) { + writeU16(table, gasp->records[t].size); + writeU16(table, gasp->records[t].behaviour); + } +} +void gasp_delete(ttf_t*ttf) +{ + if(ttf->gasp) { + if(ttf->gasp->records) + free(ttf->gasp->records); + free(ttf->gasp); + ttf->gasp = 0; + } +} + +table_code_t*prep_new(ttf_t*ttf) +{ + table_code_t*prep = ttf->prep = rfx_calloc(sizeof(table_code_t)); + ttf_table_t*t = ttf_table_new(0); + writeU8(t,0xb8);writeU16(t,0x1ff); // pushword(0x1ff) + writeU8(t,0x85); //scanctrl (always do dropout, for all sizes) + writeU8(t,0xb0);writeU8(t,1); // pushbyte(1) + writeU8(t,0x8d); //scantype (simple dropout control w/o stubs) + writeU8(t,0xb0);writeU8(t,5); // pushbyte(5) + writeU8(t,0x8d); //scantype (for windows) smart dropout control w/o stubs + prep->code = t->data; + prep->size = t->len; + free(t); + return prep; + +} +void fpgm_parse(memreader_t*r, ttf_t*ttf) +{ + table_code_t*fpgm = ttf->fpgm = rfx_calloc(sizeof(table_code_t)); + if(!r->size) return; + fpgm->size = r->size; + fpgm->code = malloc(r->size); + readBlock(r, fpgm->code, r->size); +} +void fpgm_write(ttf_t*ttf, ttf_table_t*table) +{ + table_code_t*code = ttf->fpgm; + writeBlock(table, code->code, code->size); +} +void fpgm_delete(ttf_t*ttf) +{ + if(ttf->fpgm) { + if(ttf->fpgm->code) + free(ttf->fpgm->code); + free(ttf->fpgm); + ttf->fpgm = 0; + } +} + +void prep_parse(memreader_t*r, ttf_t*ttf) +{ + table_code_t*prep = ttf->prep = rfx_calloc(sizeof(table_code_t)); + if(!r->size) return; + prep->size = r->size; + prep->code = malloc(r->size); + readBlock(r, prep->code, r->size); +} +void prep_write(ttf_t*ttf, ttf_table_t*table) +{ + table_code_t*code = ttf->prep; + writeBlock(table, code->code, code->size); +} +void prep_delete(ttf_t*ttf) +{ + if(ttf->prep) { + if(ttf->prep->code) + free(ttf->prep->code); + free(ttf->prep); + ttf->prep = 0; + } +} + +static int ttf_parse_tables(ttf_t*ttf) +{ + ttf_table_t*table; + + table = ttf_find_table(ttf, TAG_HEAD); + if(!table) { + msg(" Font has no head table"); + return 0; + } + INIT_READ(m, table->data, table->len, 0); + int loc_index = head_parse(ttf, &m); + ttf_table_delete(ttf, table); + + table = ttf_find_table(ttf, TAG_MAXP); + if(!table) { + msg(" Font has no maxp table"); + return 0; + } + INIT_READ(m2, table->data, table->len, 0); + ttf->maxp = maxp_parse(ttf, &m2); + ttf_table_delete(ttf, table); + + if(!ttf->num_glyphs) { + msg(" Invalid number of characters"); + return 0; + } + ttf->glyphs = rfx_calloc(sizeof(ttfglyph_t)*ttf->num_glyphs); + + table = ttf_find_table(ttf, TAG_OS2); + if(table) { + INIT_READ(m, table->data, table->len, 0); + ttf->os2 = os2_parse(&m); + ttf_table_delete(ttf, table); + } + + + table = ttf_find_table(ttf, TAG_HHEA); + if(table) { + INIT_READ(m, table->data, table->len, 0); + int num_advances = hea_parse(&m, ttf); + ttf_table_delete(ttf, table); + + table = ttf_find_table(ttf, TAG_HMTX); + if(table) { + INIT_READ(m, table->data, table->len, 0); + mtx_parse(&m, ttf, num_advances); + ttf_table_delete(ttf, table); + } + } else { + table = ttf_find_table(ttf, TAG_VHEA); + if(table) { + ttf->is_vertical=1; + INIT_READ(m, table->data, table->len, 0); + int num_advances = hea_parse(&m, ttf); + ttf_table_delete(ttf, table); + + table = ttf_find_table(ttf, TAG_VMTX); + if(table) { + INIT_READ(m, table->data, table->len, 0); + mtx_parse(&m, ttf, num_advances); + ttf_table_delete(ttf, table); + } + } else { + msg(" Font contains neither HHEA nor VHEA"); + } + } + table = ttf_find_table(ttf, TAG_LOCA); + if(table) { + INIT_READ(m, table->data, table->len, 0); + U32*loca = loca_parse(&m, ttf, loc_index); + ttf_table_delete(ttf, table); + table = ttf_find_table(ttf, TAG_GLYF); + if(table) { + INIT_READ(m, table->data, table->len, 0); + glyf_parse(&m, ttf, loca); + ttf_table_delete(ttf, table); + } + free(loca); + } + + table = ttf_find_table(ttf, TAG_CMAP); + if(table) { + INIT_READ(m, table->data, table->len, 0); + cmap_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + table = ttf_find_table(ttf, TAG_POST); + if(table) { + INIT_READ(m, table->data, table->len, 0); + post_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + table = ttf_find_table(ttf, TAG_NAME); + if(table) { + INIT_READ(m, table->data, table->len, 0); + name_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + table = ttf_find_table(ttf, TAG_CVT); + if(table) { + INIT_READ(m, table->data, table->len, 0); + cvt_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + table = ttf_find_table(ttf, TAG_GASP); + if(table) { + INIT_READ(m, table->data, table->len, 0); + gasp_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + table = ttf_find_table(ttf, TAG_PREP); + if(table) { + INIT_READ(m, table->data, table->len, 0); + prep_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + table = ttf_find_table(ttf, TAG_FPGM); + if(table) { + INIT_READ(m, table->data, table->len, 0); + fpgm_parse(&m, ttf); + ttf_table_delete(ttf, table); + } + + return 1; +} +static void ttf_collapse_tables(ttf_t*ttf) +{ + ttf_table_t*table; + + ttf_table_t*head = ttf_find_table(ttf, TAG_HEAD); + if(head) + return; //already collapsed + + if(ttf->maxp) { + table = ttf_addtable(ttf, TAG_MAXP); + maxp_write(ttf, table); + maxp_delete(ttf); + } + + if(ttf->os2) { + table = ttf_addtable(ttf, TAG_OS2); + os2_write(ttf, table); + os2_delete(ttf); + } + + if(ttf->hea) { + if(!ttf->is_vertical) { + table = ttf_addtable(ttf, TAG_HMTX); + int num_advances = mtx_write(ttf, table); + table = ttf_addtable(ttf, TAG_HHEA); + hea_write(ttf, table, num_advances); + hea_delete(ttf); + } else { + table = ttf_addtable(ttf, TAG_VMTX); + int num_advances = mtx_write(ttf, table); + table = ttf_addtable(ttf, TAG_VHEA); + hea_write(ttf, table, num_advances); + hea_delete(ttf); + } + } + + int loca_size=0; + if(ttf->num_glyphs) { + if(ttf->unicode) { + table = ttf_addtable(ttf, TAG_CMAP); + cmap_write(ttf, table); + cmap_delete(ttf); + } + + if(ttf->glyphs) { + table = ttf_addtable(ttf, TAG_GLYF); + U32*locations = glyf_write(ttf, table); + table = ttf_addtable(ttf, TAG_LOCA); + loca_size = loca_write(ttf, table, locations); + free(locations); + glyf_delete(ttf); + } + } + + if(ttf->full_name || ttf->family_name || ttf->subfamily_name || ttf->font_uid || ttf->postscript_name) { + table = ttf_addtable(ttf, TAG_NAME); + name_write(ttf, table); + name_delete(ttf); + } + if(ttf->post) { + table = ttf_addtable(ttf, TAG_POST); + post_write(ttf, table); + post_delete(ttf); + } + if(ttf->cvt) { + table = ttf_addtable(ttf, TAG_CVT); + cvt_write(ttf, table); + cvt_delete(ttf); + } + if(ttf->gasp) { + table = ttf_addtable(ttf, TAG_GASP); + gasp_write(ttf, table); + gasp_delete(ttf); + } + if(ttf->fpgm) { + table = ttf_addtable(ttf, TAG_FPGM); + fpgm_write(ttf, table); + fpgm_delete(ttf); + } + if(ttf->prep) { + table = ttf_addtable(ttf, TAG_PREP); + prep_write(ttf, table); + prep_delete(ttf); + } + + table = ttf_addtable(ttf, TAG_HEAD); + head_write(ttf, table, loca_size); + head_delete(ttf); +} + +ttf_t*ttf_new() +{ + ttf_t*ttf = rfx_calloc(sizeof(ttf_t)); + ttf->version = VERSION_1_0; + return ttf; +} +ttf_t* ttf_load(void*data, int length) +{ + INIT_READ(r,data,length, 0); + + if(length<12) { + msg(" Truncated Truetype file (%d bytes)", length); + return 0; + } + + ttf_t*ttf = rfx_calloc(sizeof(ttf_t)); + ttf->version = readU32(&r); + if(ttf->version == SWAP32(length)) { + U32 fontDataSize = readU32(&r); + U32 version = readU32(&r); + U32 flags = readU32(&r); + U8 panose[10]; + readBlock(&r, panose, 10); + readU8(&r); //charset + readU8(&r); //italoc + readU32(&r); //weight + readU16(&r); //fstype + U16 magic = readU16(&r); //magicNumber + /* we're being paranoid: it's entirely possible for the font + size to be exactly 0x10000. Only treat this font as eot if + it has the right magic number */ + if(magic == 0x4c50) { + readU32(&r); //unicoderange[0] + readU32(&r); //unicoderange[1] + readU32(&r); //unicoderange[2] + readU32(&r); //unicoderange[3] + readU32(&r); //codepagerange[0] + readU32(&r); //codepagerange[1] + readU32(&r); //checksumadjustment + readU32(&r); //reserved[0] + readU32(&r); //reserved[1] + readU32(&r); //reserved[2] + readU32(&r); //reserved[3] + readU16(&r); //padding + + int nr=0; + for(nr=0;nr<4;nr++) { + int t, len; + /* All of ttf is big-endian. All of ttf? No. One small eot table + of indomitable little-endian... */ + len = readU8(&r); + len |= readU8(&r)<<8; + len /= 2; + for(t=0;t>8; + } + readU16(&r); // zero terminator + } + readU16(&r); // more padding + + /* adjust the offset to the start of the actual truetype + data- the positions in the table header will be relative + to the ttf data after the header, not to the file */ + r.mem += r.pos; + r.size -= r.pos; + r.pos = 0; + ttf->version = readU32(&r); + } else { + reader_reset(&r); + ttf->version = readU32(&r); + } + } + + if(ttf->version == TTCFTAG) { + /* a ttc collection is a number of truetype fonts + packaged together */ + if(length<16) { + msg(" Truncated TTC file (%d bytes)", length); + return 0; + } + U32 ttcf_version = readU32(&r); // 0x00000100: v1.0, 0x00000200: v2.0, includes DSIG table + U32 num_fonts = readU32(&r); // number of fonts + U32 font1_position = readU32(&r); + if(font1_position+12 > length) {\ + msg(" Truncated TTC file (%d bytes, first font at %d)", length, font1_position); + return 0; + } + r.pos = font1_position; + ttf->version = readU32(&r); + } + + int num_tables = readU16(&r); + + readU16(&r); //search range + readU16(&r); //entry selector + readU16(&r); //range shift + + if(num_tables*16 > length) { + msg(" Truncated TTF file (table entries: %d)", num_tables); + if(ttf->version != OPENTYPE && + ttf->version != TRUETYPE_MACOS && + ttf->version != VERSION_1_0) { + // bad table length, weird version. This is probably not a ttf file. + return 0; + } + } + + U32*table_data = malloc(16*num_tables); + int t; + for(t=0;t length) { + msg(" TTF Table %02x%02x%02x%02x outside of stream (pos %d)", (tag>>24)&0xff, (tag>>16)&0xff, (tag>>8)&0xff, (tag)&0xff, pos); + } else { + U8*mem = malloc(len); + r.pos = pos; + readBlock(&r, mem, len); + + ttf_table_t*table = ttf_addtable(ttf, tag); + table->data = mem; + table->len = table->memsize = len; +#if 0 + U32 checksum2 = ttf_table_checksum(table); + if(checksum2!=checksum) { + msg(" Checksum mismatch in tag %02x%02x%02x%02x %c%c%c%c (%d bytes) %08x!=%08x", + (tag>>24)&0xff, (tag>>16)&0xff, (tag>>8)&0xff, (tag)&0xff, + (tag>>24)&0xff, (tag>>16)&0xff, (tag>>8)&0xff, (tag)&0xff, + len, checksum2, checksum); + } +#endif + } + } + free(table_data); + + if(!ttf_parse_tables(ttf)) + return 0; + + return ttf; +} +void ttf_create_truetype_tables(ttf_t*ttf) +{ + if(!ttf->head) + ttf->head = head_new(ttf); + if(!ttf->maxp) + ttf->maxp = maxp_new(ttf); + if(!ttf->hea) + ttf->hea = hea_new(ttf); + if(!ttf->os2) + ttf->os2 = os2_new(ttf); + if(!ttf->post) + ttf->post = post_new(ttf); + if(!ttf->gasp) + ttf->gasp = gasp_new(ttf); + if(!ttf->prep) + ttf->prep = prep_new(ttf); +} + +ttf_table_t* ttf_write(ttf_t*ttf, U32*checksum_adjust) +{ + ttf_collapse_tables(ttf); + + ttf_table_t*file = ttf_table_new(0); + writeU32(file, VERSION_1_0); + + /* write number of tables */ + int num_tables=0; + ttf_table_t*t = ttf->tables; + while(t) { + num_tables++; + t = t->next; + } + writeU16(file, num_tables); + + /* write search range */ + int tmp = num_tables; + int search_range = 0; + while(tmp) { + search_range = tmp; + tmp = tmp&(tmp-1); + } + tmp = search_range; + search_range*=16; + writeU16(file, search_range); + + /* write entry selector */ + int entry_selector = 0; + while(tmp>1) { + tmp>>=1; + entry_selector++; + } + writeU16(file, entry_selector); + + /* write range shift */ + int range_shift = num_tables*16 - search_range; + writeU16(file, range_shift); + + /* write table dictionary */ + int table_dictionary_pos = file->len; + int data_pos = file->len + num_tables*16; + for(t=ttf->tables;t;t=t->next) { + writeU32(file, t->id); + writeU32(file, ttf_table_checksum(t)); + writeU32(file, data_pos); + writeU32(file, t->len); + data_pos += t->len; + data_pos += (-t->len)&3; //pad + } + + /* write tables */ + int head_pos = 0; + U8 zero[4]={0,0,0,0}; + for(t=ttf->tables;t;t=t->next) { + if(t->id == TAG_HEAD) + head_pos = file->len; + writeBlock(file, t->data, t->len); + writeBlock(file, zero, (-t->len)&3); //pad + } + U32 checksum = 0xb1b0afba - ttf_table_checksum(file); + if(checksum_adjust) + *checksum_adjust = checksum; + U8*checksum2 = file->data + head_pos + 8; + checksum2[0] = checksum>>24; + checksum2[1] = checksum>>16; + checksum2[2] = checksum>>8; + checksum2[3] = checksum>>0; + return file; +} + +ttf_table_t* ttf_eot_head(ttf_t*ttf) +{ + ttf_table_t*file = ttf_table_new(0); + writeU32(file, 0); //file size (filled in later) + writeU32(file, 0); //fontdatasize (filled in later) + writeU32(file, 0x01000200); + writeU32(file, 0); //flags + writeU8(file, ttf->os2->panose_FamilyType); + writeU8(file, ttf->os2->panose_SerifStyle); + writeU8(file, ttf->os2->panose_Weight); + writeU8(file, ttf->os2->panose_Proportion); + writeU8(file, ttf->os2->panose_Contrast); + writeU8(file, ttf->os2->panose_StrokeVariation); + writeU8(file, ttf->os2->panose_ArmStyle); + writeU8(file, ttf->os2->panose_Letterform); + writeU8(file, ttf->os2->panose_Midline); + writeU8(file, ttf->os2->panose_XHeight); + writeU8(file, 1); //charset (default) + writeU8(file, ttf->os2->fsSelection&1); //italic + writeU32_LE(file, ttf->os2->usWeightClass); + writeU16(file, 0); //fstype + writeU16(file, 0x4c50); //magic + writeU32_LE(file, ttf->os2->ulCharRange[0]); + writeU32_LE(file, ttf->os2->ulCharRange[1]); + writeU32_LE(file, ttf->os2->ulCharRange[2]); + writeU32_LE(file, ttf->os2->ulCharRange[3]); + writeU32_LE(file, ttf->os2->ulCodePageRange1); + writeU32_LE(file, ttf->os2->ulCodePageRange2); + writeU32(file, 0); //checksum adjust (filled in later) + writeU32(file, 0); //reserved[0] + writeU32(file, 0); //reserved[1] + writeU32(file, 0); //reserved[2] + writeU32(file, 0); //reserved[3] + writeU16(file, 0); //padding(1) + + int i,t,len; + + char* strings[] = {ttf->family_name, ttf->subfamily_name, ttf->version_string, ttf->full_name}; + int nr = sizeof(strings)/sizeof(strings[0]); + + for(i=0;idata; + U32 full_len = eot->len + t->len; + len_data[0] = full_len>>0; + len_data[1] = full_len>>8; + len_data[2] = full_len>>16; + len_data[3] = full_len>>24; + + U8*len_data2 = eot->data+4; + len_data2[0] = t->len>>0; + len_data2[1] = t->len>>8; + len_data2[2] = t->len>>16; + len_data2[3] = t->len>>24; + + U8*checksum_data = eot->data + 60; + checksum_data[0] = checksum_adjust>>0; + checksum_data[1] = checksum_adjust>>8; + checksum_data[2] = checksum_adjust>>16; + checksum_data[3] = checksum_adjust>>24; + + FILE*fi = fopen(filename, "wb"); + if(!fi) { + perror(filename); + return; + } + + fwrite(eot->data, eot->len, 1, fi); + fwrite(t->data, t->len, 1, fi); + fclose(fi); + ttf_table_delete(0, t); + ttf_table_delete(0, eot); +} + +void ttf_save(ttf_t*ttf, const char*filename) +{ + ttf_table_t* t = ttf_write(ttf, 0); + FILE*fi = fopen(filename, "wb"); + if(!fi) { + perror(filename); + return; + } + fwrite(t->data, t->len, 1, fi); + fclose(fi); + ttf_table_delete(0, t); +} + +void ttf_dump(ttf_t*ttf) +{ + msg(" Truetype file version %08x%s", ttf->version, ttf->version == OPENTYPE?" (opentype)":""); + ttf_table_t*table = ttf->tables; + while(table) { + U32 tag = table->id; + msg(" Tag %02x%02x%02x%02x [%c%c%c%c] (length: %d)", + (tag>>24)&0xff, (tag>>16)&0xff, (tag>>8)&0xff, (tag)&0xff, + (tag>>24)&0xff, (tag>>16)&0xff, (tag>>8)&0xff, (tag)&0xff, table->len); + table = table->next; + } + //ttf_table_dump(ttf_find_table(ttf, TAG_MAXP)); + + head_dump(ttf); + hea_dump(ttf); + os2_dump(ttf); + maxp_dump(ttf); + glyf_dump(ttf); +} +void ttf_destroy_tables(ttf_t*ttf) +{ + ttf_table_t*table = ttf->tables; + while(table) { + ttf_table_t*next = table->next; + free(table->data); + free(table); + table = next; + } + ttf->tables = 0; +} +void ttf_reduce(ttf_t*ttf) +{ + ttf_destroy_tables(ttf); +} +void ttf_destroy(ttf_t*ttf) +{ + ttf_destroy_tables(ttf); + maxp_delete(ttf); + os2_delete(ttf); + head_delete(ttf); + hea_delete(ttf); + glyf_delete(ttf); + post_delete(ttf); + cvt_delete(ttf); + name_delete(ttf); + free(ttf); +} + +ttf_t* ttf_open(const char*filename) +{ + memfile_t*m = memfile_open(filename); + ttf_t*ttf = ttf_load(m->data, m->len); + memfile_close(m); + return ttf; +} + +#ifdef MAIN +int main(int argn, const char*argv[]) +{ + setConsoleLogging(7); + const char*filename = "comic.ttf"; + if(argn>1) + filename = argv[1]; + //msg(" Loading %s", filename); + memfile_t*m = memfile_open(filename); + ttf_t*ttf = ttf_load(m->data, m->len); + + if(!ttf) { + msg(" Couldn't load %s", filename); + return 1; + } + ttf_reduce(ttf); + + ttf_create_truetype_tables(ttf); + + if(!ttf) return 1; + memfile_close(m); + //ttf_dump(ttf); + //printf("os2 version: %04x (%d), maxp size: %d\n", +// ttf->os2->version, ttf->os2->size, ttf->maxp->size); + ttf_save_eot(ttf, "testfont.eot"); + ttf_save(ttf, "testfont.ttf"); + ttf_destroy(ttf); + return 0; + +} +#endif diff -Nru swftools-0.9.0/lib/ttf.h swftools-0.9.2/lib/ttf.h --- swftools-0.9.0/lib/ttf.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/ttf.h 2010-11-12 18:53:50.000000000 +0000 @@ -0,0 +1,214 @@ +/* ttf.h + Parser and writer for truetype font files. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __ttf_h__ +#define __ttf_h__ + +#include "types.h" + +typedef struct _ttf_table { + U32 id; + struct _ttf_table*prev; + struct _ttf_table*next; + + U8*data; + int len; + int memsize; +} ttf_table_t; + +typedef struct _table_maxp { + U16 maxPoints; + U16 maxContours; + U16 maxComponentPoints; + U16 maxComponentContours; + U16 maxZones; + U16 maxTwilightPoints; + U16 maxStorage; + U16 maxFunctionDefs; + U16 maxInstructionDefs; + U16 maxStackElements; + U16 maxSizeOfInstructions; + U16 maxComponentElements; + U16 maxComponentDepth; +} table_maxp_t; + +typedef struct _table_os2 { + S16 xAvgCharWidth; + U16 usWeightClass; + U16 usWidthClass; + U16 ySubscriptXSize; + U16 ySubscriptYSize; + U16 ySubscriptXOffset; + U16 ySubscriptYOffset; + U16 ySuperscriptXSize; + U16 ySuperscriptYSize; + U16 ySuperscriptXOffset; + U16 ySuperscriptYOffset; + U16 yStrikeoutSize; + U16 yStrikeoutPosition; + U16 sFamilyClass; + U8 panose_FamilyType; + U8 panose_SerifStyle; + U8 panose_Weight; + U8 panose_Proportion; + U8 panose_Contrast; + U8 panose_StrokeVariation; + U8 panose_ArmStyle; + U8 panose_Letterform; + U8 panose_Midline; + U8 panose_XHeight; + U32 ulCharRange[4]; + + U16 fsSelection; + U16 fsFirstCharIndex; + U16 fsLastCharIndex; + + S16 sTypoAscender; + S16 sTypoDescender; + S16 sTypoLineGap; + U16 usWinAscent; + U16 usWinDescent; + + /* for version >= 0x0001 */ + U32 ulCodePageRange1; + U32 ulCodePageRange2; + + /* for version >= 0x0002 */ + S16 sxHeight; + S16 sCapHeight; + U16 usDefaultChar; + U16 usBreakChar; + U16 usMaxContext; +} table_os2_t; + +typedef struct _table_hea +{ + U16 advanceWidthMax; + S16 minLeftSideBearing; + S16 minRightSideBearing; + S16 xMaxExtent; + S16 caretSlopeRise; + S16 caretSlopeRun; + S16 caretOffset; +} table_hea_t; + +#define GLYPH_ON_CURVE 0x01 +#define GLYPH_CONTOUR_START 0x40 +#define GLYPH_CONTOUR_END 0x80 + +typedef U32 unicode_t; + +typedef struct _ttfpoint { + int x,y; + U8 flags; +} ttfpoint_t; +typedef struct _ttfglyph { + U16 advance; + S16 bearing; + S16 xmin,ymin,xmax,ymax; + int code_size; + U8*code; + int num_points; + ttfpoint_t*points; +} ttfglyph_t; + +typedef struct _table_head { + U16 flags; + U16 units_per_em; + S16 xmin,ymin,xmax,ymax; + U16 macStyle; + U16 lowest_readable_size; + S16 dir_hint; +} table_head_t; + +typedef struct _table_post { + U32 italic_angle; + U16 underline_position; + U16 underline_thickness; +} table_post_t; + +typedef struct _table_cvt { + S16*values; + int num; +} table_cvt_t; + +typedef struct _table_gasp { + int num; + struct { + U16 size; + U16 behaviour; + } *records; +} table_gasp_t; + +typedef struct _table_code { + U8*code; + int size; +} table_code_t; + +typedef struct _ttf { + char*family_name; /* nameId 1 */ + char*subfamily_name; /* nameId 2 */ + char*font_uid; /* nameId 3 */ + char*full_name; /* nameId 4 */ + char*version_string; /* nameId 5 */ + char*postscript_name; /* nameId 6 */ + + ttf_table_t*tables; + + table_head_t*head; + table_maxp_t*maxp; + table_os2_t*os2; + table_hea_t*hea; + table_post_t*post; + table_cvt_t*cvt; + table_gasp_t*gasp; + table_code_t*prep; + table_code_t*fpgm; + + U16 flags; + char is_vertical; + + S16 ascent; + S16 descent; // ymin, *not* negative ymin + S16 lineGap; + + int num_glyphs; + ttfglyph_t*glyphs; + + int unicode_size; + unicode_t*unicode; + + U32 version; +} ttf_t; + + +ttf_t*ttf_new(); +ttf_t* ttf_open(const char*filename); +void ttf_reduce(ttf_t*ttf); +ttf_t*ttf_load(void*data, int length); +ttf_table_t*ttf_addtable(ttf_t*ttf, U32 tag); +void ttf_create_truetype_tables(ttf_t*ttf); +void ttf_dump(ttf_t*ttf); +void ttf_destroy(ttf_t*ttf); +void ttf_save(ttf_t*ttf, const char*filename); +void ttf_save_eot(ttf_t*ttf, const char*filename); + +#endif diff -Nru swftools-0.9.0/lib/types.h swftools-0.9.2/lib/types.h --- swftools-0.9.0/lib/types.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/types.h 2010-11-12 18:53:59.000000000 +0000 @@ -18,16 +18,19 @@ #define GET16(ptr) (((U16)(((U8*)(ptr))[0]))+(((U16)(((U8*)(ptr))[1]))<<8)) #define GET32(ptr) (((U16)(((U8*)(ptr))[0]))+(((U16)(((U8*)(ptr))[1]))<<8)+(((U16)(((U8*)(ptr))[2]))<<16)+(((U16)(((U8*)(ptr))[3]))<<24)) -#ifdef WORDS_BIGENDIAN #define SWAP16(s) ((((s)>>8)&0x00ff)|(((s)<<8)&0xff00)) #define SWAP32(s) (SWAP16(((s)>>16)&0x0000ffff)|((SWAP16(s)<<16)&0xffff0000)) -#define REVERSESWAP16(x) (x) -#define REVERSESWAP32(x) (x) + +#ifdef WORDS_BIGENDIAN +#define LE_16_TO_NATIVE(s) SWAP16(s) +#define LE_32_TO_NATIVE(s) SWAP32(s) +#define BE_16_TO_NATIVE(x) (x) +#define BE_32_TO_NATIVE(x) (x) #else -#define SWAP16(x) (x) -#define SWAP32(x) (x) -#define REVERSESWAP16(s) ((((s)>>8)&0x00ff)|(((s)<<8)&0xff00)) -#define REVERSESWAP32(s) (REVERSESWAP16(((s)>>16)&0x0000ffff)|((REVERSESWAP16(s)<<16)&0xffff0000)) +#define LE_16_TO_NATIVE(x) (x) +#define LE_32_TO_NATIVE(x) (x) +#define BE_16_TO_NATIVE(s) SWAP16(s) +#define BE_32_TO_NATIVE(s) SWAP32(s) #endif // SWF Types diff -Nru swftools-0.9.0/lib/utf8.c swftools-0.9.2/lib/utf8.c --- swftools-0.9.0/lib/utf8.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/utf8.c 2010-11-12 18:52:51.000000000 +0000 @@ -5,23 +5,26 @@ static char utf8buf[16]; -void writeUTF8(unsigned int charnum, char*dest) +int writeUTF8(unsigned int charnum, char*dest) { dest[0] = 0; if(charnum < 0x80) { dest[0] = charnum; dest[1] = 0; + return 1; } else if(charnum <0x800) { /* 0000 0080-0000 07FF 110xxxxx 10xxxxxx */ dest[0] = 0xc0 | (charnum >> 6); dest[1] = 0x80 | (charnum & 0x3f); dest[2] = 0; + return 2; } else if(charnum < 0x10000) { /* 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx */ dest[0] = 0xe0 | (charnum >> 12); dest[1] = 0x80 |((charnum >> 6)&0x3f); dest[2] = 0x80 |((charnum )&0x3f); dest[3] = 0; + return 3; } else if(charnum < 0x200000) { /* 0001 0000-001F FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ dest[0] = 0xf0 | (charnum >> 18); @@ -29,6 +32,7 @@ dest[2] = 0x80 |((charnum >> 6 )&0x3f); dest[3] = 0x80 |((charnum )&0x3f); dest[4] = 0; + return 4; } else if(charnum < 0x4000000) { /* 0020 0000-03FF FFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */ dest[0] = 0xf8 | (charnum >> 24); @@ -37,6 +41,7 @@ dest[3] = 0x80 |((charnum >> 6 )&0x3f); dest[4] = 0x80 |((charnum )&0x3f); dest[5] = 0; + return 5; } else if(charnum < 0x80000000) { /* 0400 0000-7FFF FFFF 1111110x 10xxxxxx ... 10xxxxxx */ dest[0] = 0xfc | (charnum >> 30); @@ -46,9 +51,11 @@ dest[4] = 0x80 |((charnum >> 6 )&0x3f); dest[5] = 0x80 |((charnum )&0x3f); dest[6] = 0; + return 6; } else { fprintf(stderr, "Illegal character: 0x%08x\n", charnum); dest[0] = 0; + return 0; } } diff -Nru swftools-0.9.0/lib/utf8.h swftools-0.9.2/lib/utf8.h --- swftools-0.9.0/lib/utf8.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/utf8.h 2010-11-12 18:53:43.000000000 +0000 @@ -1,5 +1,15 @@ #ifndef __utf8_h__ #define __utf8_h__ -void writeUTF8(unsigned int charnum, char*dest); + +#ifdef __cplusplus +extern "C" { +#endif + +int writeUTF8(unsigned int charnum, char*dest); char* getUTF8(unsigned int charnum); + +#ifdef __cplusplus +} +#endif + #endif diff -Nru swftools-0.9.0/lib/wav.c swftools-0.9.2/lib/wav.c --- swftools-0.9.0/lib/wav.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/lib/wav.c 2010-11-12 19:06:47.000000000 +0000 @@ -74,16 +74,14 @@ return 0; } if(block.size + 8 < filesize) - fprintf(stderr, "wav_read: warning - more tags (%d extra bytes)\n", - filesize - block.size - 8); + fprintf(stderr, "wav_read: warning - more tags (%lu extra bytes)\n", filesize - block.size - 8); if(block.size == filesize) /* some buggy software doesn't generate the right tag length */ block.size = filesize - 8; if(block.size + 8 > filesize) - fprintf(stderr, "wav_read: warning - short file (%d bytes missing)\n", - block.size + 8 - filesize); + fprintf(stderr, "wav_read: warning - short file (%lu bytes missing)\n", block.size + 8 - filesize); if(fread(b, 1, 4, fi) < 4) { fclose(fi); @@ -198,7 +196,7 @@ void wav_print(struct WAV*wav) { - printf("tag:%04x channels:%d samples/sec:%d bytes/sec:%d align:%d bits/sample:%d size:%d\n", + printf("tag:%04x channels:%d samples/sec:%lu bytes/sec:%lu align:%d bits/sample:%d size:%d\n", wav->tag, wav->channels, wav->sampsPerSec, wav->bytesPerSec, wav->align, wav->bps, wav->size); } diff -Nru swftools-0.9.0/lib/xml.c swftools-0.9.2/lib/xml.c --- swftools-0.9.0/lib/xml.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/xml.c 2010-11-12 18:52:51.000000000 +0000 @@ -0,0 +1,382 @@ +/* xml.c + Lightweight and fast xml parser. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include "xml.h" + +/* +group: 0=data 1=whitespace 2='"' 3='<' 4='>' 5='&' 6=';' 7='?' 8='/' 9='=' 10='!' 11=EOF +*/ + +static int group[256] = +{ +// 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f +// \t \n \r + 13, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, +// 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f +// ! " # $ % & ' ( ) * + , - . / + 1,10, 2, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 8, +// 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f +// 0 1 2 3 4 5 6 7 8 9 : ; < = > ? + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 9, 4, 7, +// 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +// @ A B C D E F G H I J K L M N O + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f +// P Q R S T U V W X Y Z [ \ ] ^ _ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,11, 0,12, 0, 0, +// 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f +// ` a b c d e f g h i j k l m n o + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f +// p q r s t u v w x y z { | } ~ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +// f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff +// + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const char*errors[]= +{ + 0, +#define E1 -0x41 + /*E1*/"xml file must start with & ; ? / = ! [ ] - EOB*/ + /* 0 */{ E1, 0,E1, 1,E1,E1,E1,E1,E1,E1,E3,E1,E1,-63}, // .< + /* 1 */{ E1,E1,E1,E1,E1,E1,E1, 9,E1,E1,E3,E1,E1,-63}, // <.? + /* 2 */{ -3, 2,E3,E2,E2,E2,E2,E2,12,E2,16,E2,E2,-63}, // <. + /* 3 */{ E3,E3,E3,E3,-1,E3,E3,E3,E3,E1,E3,E3,E3,-63}, // < /.> + /* 4 */{ E3,E3,E3,E3,-2,E3,E3,E3,E3,E1,E1,E3,E3,-63}, // < .> + /* 5 */{ 5, 5, 5,-4, 5, 5, 5, 5, 5, 5, 5,E3,E3,-63}, // da.ta + /* 6 */{ 6,-7,E3,E2,-6,E2,E2,E3,-9,E3,E3,E3,E3,-63}, // %d\n", + buffer[pos], state, new_state[state][group[buffer[pos]]]);*/ + + /* inner loop */ + do { + state = new_state[old=state][group[(unsigned char)buffer[pos++]]]; + } while(state>=0); + + switch(state) { + tag_stack_t*st; + xmlattribute_t*a; + case -63: // end of buffer + if(pos!=num+1) { + // we could backtrace, but the spec says this is indeed illegal + fprintf(stderr, "error: xml contains \\0 chars\n"); + return 0; + } + // undo + pos = num; + state = old; + break; + case -1: // self closing tag + attributes = attributes_reverse(attributes); + out->start_tag(out, tagname.result, attributes); + out->end_tag(out, tagname.result); + stringstate_clear(&tagname); + attributes_free(attributes);attributes = 0; + stringstate_start(&data, buffer, pos); + state = 5; + break; + case -6: // after + stringstate_finish(&tagname, buffer, pos-1); + // fallthrough + case -2: // . + st = malloc(sizeof(tag_stack_t)); + st->name = tagname.result; + st->prev = stack; + stack = st; + attributes = attributes_reverse(attributes); + if(!first) out->start_tag(out, tagname.result, attributes); + attributes_free(attributes);attributes = 0; + stringstate_start(&data, buffer, pos); + state = 5; + break; + case -3: case -13: // after <, start of tag name + first=0; + stringstate_start(&tagname, buffer, pos-1); + state = state==-3?6:13; + break; + case -14: // after , end of tag name + stringstate_finish(&tagname, buffer, pos-1); + // fallthrough + case -15: // after + out->end_tag(out, tagname.result); + stringstate_clear(&tagname); + stringstate_start(&data, buffer, pos); + state = 5; + break; + case -4: // end of data + stringstate_finish(&data, buffer, pos-1); + if(!first) out->data(out, data.result, data.len); + stringstate_clear(&data); + state = 2; + break; + case -7: // after <, at whitespace, end of tag name + stringstate_finish(&tagname, buffer, pos-1); + state = 7; + break; + case -8: // inside tag, start of attribute name + stringstate_start(&attr_name, buffer, pos-1); + state = 8; + break; + case -9: + stringstate_finish(&tagname, buffer, pos-1); + state = 3; + break; + case -12: // end of attribute name, at ws + stringstate_finish(&attr_name, buffer, pos-1); + state = 15; + break; + case -10: // end of attribute name, at = + stringstate_finish(&attr_name, buffer, pos-1); + state = 10; + break; + case -11: // start of attribute value + stringstate_start(&attr_value, buffer, pos); + state = 11; + break; + case -5: // end of attribute value + stringstate_finish(&attr_value, buffer, pos-1); + a = malloc(sizeof(xmlattribute_t)); + a->name = attr_name.result;attr_name.result=0; + a->value = attr_value.result;attr_value.result=0; + a->next = attributes; + attributes = a; + state = 7; + break; + case -20: + state = 5; + break; + default: + if(-state&0x40) { + fprintf(stderr, "%s (state %d, char '%c')\n", errors[(-state)&0x3f], old, buffer[pos-1]); + return 0; + } else { + fprintf(stderr, "internal error: no action %d\n", state); + } + return 0; + break; + } + } + stringstate_save(&tagname, buffer, pos); + stringstate_save(&attr_name, buffer, pos); + stringstate_save(&attr_value, buffer, pos); + stringstate_save(&data, buffer, pos); + } + + /* note: any of these except data *has* to be empty for a well formed xml */ + stringstate_clear(&tagname); + stringstate_clear(&attr_name); + stringstate_clear(&attr_value); + stringstate_clear(&data); + + while(stack) { + tag_stack_t*next = stack->prev; + free((void*)stack->name); + free(stack); + stack = next; + } + return 1; +} + +#ifdef MAIN +void my_start_tag(xmlconsumer_t*c, char*name, xmlattribute_t*attr) +{ + printf("<%s", name); + for(;attr;attr=attr->next) { + printf(" %s=\"%s\"", attr->name, attr->value); + } + printf(">"); +} +void my_data(xmlconsumer_t*c, char*data, int len) +{ + printf("%s", data); +} +void my_end_tag(xmlconsumer_t*c, char*name) +{ + printf("", name); +} +int main() +{ + xmlconsumer_t c = {my_start_tag, my_data, my_end_tag, 0}; + + reader_t r; + reader_init_filereader2(&r, "test.xml"); + xml_parse(&r, &c); + r.dealloc(&r); + printf("\n"); +} +#endif diff -Nru swftools-0.9.0/lib/xml.h swftools-0.9.2/lib/xml.h --- swftools-0.9.0/lib/xml.h 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/lib/xml.h 2010-11-12 18:56:15.000000000 +0000 @@ -0,0 +1,42 @@ +/* xml.h + Lightweight and fast xml parser. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef __xml_h__ +#define __xml_h__ + +#include "bitio.h" + +typedef struct _xmlattribute { + const char*name; + const char*value; + struct _xmlattribute*next; +} xmlattribute_t; + +typedef struct _xmlconsumer { + void (*start_tag)(struct _xmlconsumer*, char*name, xmlattribute_t*attributes); + void (*data)(struct _xmlconsumer*, char*data, int len); + void (*end_tag)(struct _xmlconsumer*, char*name); + void*internal; +} xmlconsumer_t; + +int xml_parse(reader_t*reader, xmlconsumer_t*out); + +#endif diff -Nru swftools-0.9.0/m4/gcc.2.95.m4 swftools-0.9.2/m4/gcc.2.95.m4 --- swftools-0.9.0/m4/gcc.2.95.m4 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/m4/gcc.2.95.m4 2012-04-08 17:25:26.000000000 +0000 @@ -6,7 +6,7 @@ #include #include -int main (int argc, char*argv[]) +int main () { int a,b; b=3; diff -Nru swftools-0.9.0/m4/Makefile swftools-0.9.2/m4/Makefile --- swftools-0.9.0/m4/Makefile 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/m4/Makefile 2012-04-08 17:25:26.000000000 +0000 @@ -1,8 +1,9 @@ # simple pmake detecting Makefile all: clear test.o -clean: all +clean: clear install: +uninstall: CC=@echo "*******************************************************";\ echo "Your make is broken- try to get yourself a working one.";\ diff -Nru swftools-0.9.0/m4/python.m4 swftools-0.9.2/m4/python.m4 --- swftools-0.9.0/m4/python.m4 2009-04-01 10:20:18.000000000 +0000 +++ swftools-0.9.2/m4/python.m4 2011-01-02 03:30:29.000000000 +0000 @@ -1,73 +1,112 @@ AC_DEFUN([RFX_CHECK_PYTHON], [ -AC_MSG_CHECKING([for Python.h]) +AC_MSG_CHECKING([for Python version]) if test "x$PYTHON_LIB" '!=' "x" -a "x$PYTHON_INCLUDES" '!=' "x";then - PY_VERSION=unknown + # you can override the python detection by putting PYTHON_LIB + # and PYTHON_INCLUDES into the environment + case "$PYTHON_INCLUDES" in + *python2.4*) PY_VERSION=2.4 + ;; + *python2.5*) PY_VERSION=2.5 + ;; + *python2.6*) PY_VERSION=2.6 + ;; + *python2.7*) PY_VERSION=2.7 + ;; + *python3.0*) PY_VERSION=3.0 + ;; + *python3.1*) PY_VERSION=3.1 + ;; + *python3.2*) PY_VERSION=3.2 + ;; + *python3.3*) PY_VERSION=3.3 + ;; + *) PY_VERSION=unknown + ;; + esac else if test "x$PYTHON_LIB" '!=' "x" -o "x$PYTHON_INCLUDES" '!=' "x";then echo "Set both PYTHON_LIB and PYTHON_INCLUDES, or none at all" fi - # iterate through version 2.2 to 2.6 - for v in 2 3 4 5 6; do + # iterate through version 2.4 to 3.3 + VERSIONS="2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3" + case "$PYTHON" in + 2*) VERSIONS="2.4 2.5 2.6 2.7 $PYTHON" + ;; + 3*) VERSIONS="3.0 3.1 3.2 3.3 $PYTHON" + ;; + esac + for v in $VERSIONS; do # Linux - if test -f "/usr/include/python2.$v/Python.h";then - PY_VERSION=2.$v + if test -f "/usr/include/python$v/Python.h";then + PY_VERSION=$v PYTHON_LIB="-lpython$PY_VERSION" - if test -f "/usr/lib/python2.$v/site-packages/PIL/_imaging.so";then - PYTHON_LIB2="$PYTHON_LIB /usr/lib/python2.$v/site-packages/PIL/_imaging.so" + if test -f "/usr/lib/python$v/site-packages/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /usr/lib/python$v/site-packages/PIL/_imaging.so" HAVE_PYTHON_IMAGING_LIB=1 else PYTHON_LIB2="$PYTHON_LIB" fi PYTHON_INCLUDES="-I/usr/include/python$PY_VERSION" # Mac OS X - elif test -f "/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/Python.h";then - PY_VERSION=2.$v + elif test -f "/Library/Frameworks/Python.framework/Versions/$v/include/python$v/Python.h";then + PY_VERSION=$v PYTHON_LIB="-framework Python" - if test -f "/Library/Frameworks/Python.framework/Versions/2.$v/site-packages/PIL/_imaging.so";then - PYTHON_LIB2="$PYTHON_LIB /Library/Python/2.$v/PIL/_imaging.so" + if test -f "/Library/Frameworks/Python.framework/Versions/$v/site-packages/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /Library/Python/$v/PIL/_imaging.so" HAVE_PYTHON_IMAGING_LIB=1 else PYTHON_LIB2="$PYTHON_LIB" fi - PYTHON_INCLUDES="-I/Library/Frameworks/Python.framework/Versions/2.$v/include/python2.$v/" + PYTHON_INCLUDES="-I/Library/Frameworks/Python.framework/Versions/$v/include/python$v/" # Mac OS X [Fink]: - elif test "(" -f "/sw/lib/python2.$v/config/libpython2.$v.dylib" \ - -o -f "/sw/lib/python2.$v/config/libpython2.$v.a" \ - -o -f "/sw/lib/python2.$v/config/libpython2.$v.so" \ + elif test "(" -f "/sw/lib/python$v/config/libpython$v.dylib" \ + -o -f "/sw/lib/python$v/config/libpython$v.a" \ + -o -f "/sw/lib/python$v/config/libpython$v.so" \ ")" \ - -a -f "/sw/include/python2.$v/Python.h"; then - PY_VERSION=2.$v - PYTHON_LIB="-L /sw/lib/python2.$v/config/ -lpython$PY_VERSION /sw/lib/python2.$v/site-packages/PIL/_imaging.so" - if test -f "/sw/lib/python2.$v/site-packages/PIL/_imaging.so";then - PYTHON_LIB2="$PYTHON_LIB /sw/lib/python2.$v/site-packages/PIL/_imaging.so" + -a -f "/sw/include/python$v/Python.h"; then + PY_VERSION=$v + PYTHON_LIB="-L /sw/lib/python$v/config/ -lpython$PY_VERSION /sw/lib/python$v/site-packages/PIL/_imaging.so" + if test -f "/sw/lib/python$v/site-packages/PIL/_imaging.so";then + PYTHON_LIB2="$PYTHON_LIB /sw/lib/python$v/site-packages/PIL/_imaging.so" HAVE_PYTHON_IMAGING_LIB=1 else PYTHON_LIB2="$PYTHON_LIB" fi - PYTHON_INCLUDES="-I /sw/include/python2.$v/" + PYTHON_INCLUDES="-I /sw/include/python$v/" fi done fi - +AC_MSG_RESULT($PY_VERSION) + if test "x$PY_VERSION" "!=" "x"; then - AC_MSG_RESULT([$PY_VERSION]) + AC_MSG_CHECKING([for Python executable]) + if python$PY_VERSION -V 2>&5;then + PYTHON_EXECUTABLE=python$PY_VERSION + AC_SUBST(PYTHON_EXECUTABLE) + AC_MSG_RESULT([$PYTHON_EXECUTABLE]) + else + AC_MSG_RESULT([failed]) + fi +fi + +if test "x$PY_VERSION" "!=" "x" -a "x$PYTHON_EXECUTABLE" "!=" "x"; then export PYTHON_INCLUDES PYTHON_LIB AC_SUBST(PYTHON_LIB) AC_SUBST(PYTHON_INCLUDES) - AC_MSG_CHECKING([whether we can compile the python test program]) + AC_MSG_CHECKING([whether we can compile the Python test program]) cat > conftest.c << EOF -#include +# include -int main() -{ - int ret; - ret = Py_Main(0, 0); - int x; // check also for gcc 2.95.x incompatibilities - return ret; -} + int main() + { + int ret; + ret = Py_Main(0, 0); + int x; // check also for gcc 2.95.x incompatibilities + return ret; + } EOF ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS $PYTHON_LIB $LIBS -o conftest${ac_exeext}' @@ -80,23 +119,41 @@ AC_MSG_RESULT(no) fi rm -f conftest* + + AC_MSG_CHECKING([for Python install path]) +cat > _pypath.py << EOF +import distutils +import distutils.sysconfig +import sys +sys.stdout.write(distutils.sysconfig.get_python_lib(plat_specific=0,standard_lib=0)) +EOF + echo $PYTHON_EXECUTABLE _pypath.py 1>&5 + if $PYTHON_EXECUTABLE _pypath.py >_pypath.txt 2>&5;then + PYTHON_INSTALL_PATH=`cat _pypath.txt` + AC_SUBST(PYTHON_INSTALL_PATH) + AC_MSG_RESULT($PYTHON_INSTALL_PATH) + else + AC_MSG_RESULT([failed]) + fi + #rm -f _pypath.txt _pypath.py + if test "x$PYTHON_OK" = "xyes";then AC_MSG_CHECKING([for Python-Imaging]) cat > conftest.c << EOF -#include -#include +# include +# include -int main() -{ - Py_Main(0, 0); - return 0; -} + int main() + { + Py_Main(0, 0); + return 0; + } EOF if test "$HAVE_PYTHON_IMAGING_LIB"; then ac_link='$CC $CPPFLAGS $CFLAGS $PYTHON_INCLUDES conftest.c $LDFLAGS ${PYTHON_LIB2} $LIBS -o conftest${ac_exeext}' if { (eval echo python.m4: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then PYTHON_LIB="${PYTHON_LIB2}" - AC_DEFINE([HAVE_PYTHON_IMAGING], [1], [whether python-imaging was found]) + AC_DEFINE([HAVE_PYTHON_IMAGING], [1], [whether Python-Imaging was found]) HAVE_PYTHON_IMAGING=yes export HAVE_PYTHON_IMAGING AC_SUBST(HAVE_PYTHON_IMAGING) @@ -112,7 +169,5 @@ fi fi rm -f conftest* -else - AC_MSG_RESULT([nope]) fi ]) diff -Nru swftools-0.9.0/Makefile.common.in swftools-0.9.2/Makefile.common.in --- swftools-0.9.0/Makefile.common.in 2009-04-12 23:27:16.000000000 +0000 +++ swftools-0.9.2/Makefile.common.in 2012-04-19 11:31:50.000000000 +0000 @@ -22,9 +22,17 @@ LIBS= @LDFLAGS@ @LIBS@ CXXLIBS=@CXXLIBS@ transform = @program_transform_name@ +CPPFLAGS=@CPPFLAGS@ + PYTHON_LIB=@PYTHON_LIB@ PYTHON_INCLUDES=@PYTHON_INCLUDES@ -CPPFLAGS=@CPPFLAGS@ +PYTHON_INSTALL_PATH=@PYTHON_INSTALL_PATH@ +PYTHON_EXECUTABLE=@PYTHON_EXECUTABLE@ + +RUBY_CPPFLAGS=@RUBY_CPPFLAGS@ +RUBY_LDFLAGS=@RUBY_LDFLAGS@ +RUBY_LIBS=@RUBY_LIBS@ +RUBY_INSTALLDIR=@RUBY_INSTALLDIR@ # libtool stuff OBJEXT=@OBJEXT@ diff -Nru swftools-0.9.0/Makefile.in swftools-0.9.2/Makefile.in --- swftools-0.9.0/Makefile.in 2009-01-27 17:18:36.000000000 +0000 +++ swftools-0.9.2/Makefile.in 2012-04-08 17:25:26.000000000 +0000 @@ -14,7 +14,7 @@ cd lib;$(MAKE) $@ @echo making $@ in lib/python... cd lib/python;$(MAKE) $@ - @echo making $@ in src... + @echo making $@ in lib/ruby... cd src;$(MAKE) $@ @echo making $@ in avi2swf... cd avi2swf;$(MAKE) $@ @@ -25,7 +25,7 @@ distclean: $(MAKE) clean rm -f config.status config.cache config.h Makefile Makefile.common libtool - rm -f lib/lame/Makefile lib/python/Makefile lib/Makefile src/Makefile avi2swf/Makefile pdf2swf/fonts/Makefile + rm -f lib/readers/Makefile lib/lame/Makefile lib/python/Makefile lib/Makefile src/Makefile avi2swf/Makefile pdf2swf/fonts/Makefile clean-local: rm -f config.cache gmon.out @@ -34,6 +34,8 @@ rm -rf $(pkgdatadir) all-local: + @true install-local: + @true .PHONY: all install uninstall clean distclean clean-local uninstall-local all-local install-local diff -Nru swftools-0.9.0/_pypath.py swftools-0.9.2/_pypath.py --- swftools-0.9.0/_pypath.py 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/_pypath.py 2012-04-19 11:15:43.000000000 +0000 @@ -0,0 +1,4 @@ +import distutils +import distutils.sysconfig +import sys +sys.stdout.write(distutils.sysconfig.get_python_lib(plat_specific=0,standard_lib=0)) diff -Nru swftools-0.9.0/_pypath.txt swftools-0.9.2/_pypath.txt --- swftools-0.9.0/_pypath.txt 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/_pypath.txt 2012-04-19 11:15:43.000000000 +0000 @@ -0,0 +1 @@ +/usr/lib/python2.6/dist-packages \ No newline at end of file diff -Nru swftools-0.9.0/setup.py swftools-0.9.2/setup.py --- swftools-0.9.0/setup.py 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/setup.py 2011-12-12 21:29:27.000000000 +0000 @@ -166,6 +166,8 @@ return 1 elif name.startswith("HAVE_LAME"): return None + elif name.startswith("HAVE_FFTW3"): + return None elif name.startswith("O_BINARY"): if sys.platform.startswith("win"): return None @@ -249,23 +251,29 @@ sys.exit(1) base_sources = [ -"lib/q.c", "lib/utf8.c", "lib/png.c", "lib/jpeg.c", "lib/wav.c", "lib/mp3.c", "lib/os.c", "lib/bitio.c", "lib/log.c", "lib/mem.c", +"lib/q.c", "lib/utf8.c", "lib/png.c", "lib/jpeg.c", "lib/wav.c", "lib/mp3.c", "lib/os.c", "lib/bitio.c", "lib/log.c", "lib/mem.c", "lib/ttf.c", "lib/kdtree.c", "lib/xml.c" ] rfxswf_sources = [ "lib/modules/swfaction.c", "lib/modules/swfbits.c", "lib/modules/swfbutton.c", -"lib/modules/swfcgi.c", "lib/modules/swfdraw.c", "lib/modules/swfdump.c", "lib/modules/swffilter.c", +"lib/modules/swfcgi.c", "lib/modules/swfalignzones.c", "lib/modules/swfdraw.c", "lib/modules/swfdump.c", "lib/modules/swffilter.c", "lib/modules/swffont.c", "lib/modules/swfobject.c", "lib/modules/swfrender.c", "lib/modules/swfshape.c", "lib/modules/swfsound.c", "lib/modules/swftext.c", "lib/modules/swftools.c", -"lib/rfxswf.c", "lib/drawer.c", "lib/MD5.c", "lib/h.263/dct.c", "lib/h.263/h263tables.c", +"lib/rfxswf.c", "lib/drawer.c", "lib/h.263/dct.c", "lib/h.263/h263tables.c", "lib/h.263/swfvideo.c", "lib/action/assembler.c", "lib/action/compile.c", "lib/action/lex.swf4.c", "lib/action/lex.swf5.c", "lib/action/libming.c", -"lib/action/swf4compiler.tab.c", -"lib/as3/abc.c", "lib/as3/code.c", "lib/as3/pool.c", "lib/as3/files.c", "lib/as3/opcodes.c", -"lib/action/swf5compiler.tab.c", "lib/action/actioncompiler.c" +"lib/action/swf4compiler.tab.c", "lib/action/swf5compiler.tab.c", "lib/action/actioncompiler.c", +"lib/as3/assets.c", "lib/as3/abc.c", "lib/as3/state.c", "lib/as3/code.c", "lib/as3/pool.c", "lib/as3/files.c", "lib/as3/opcodes.c", +"lib/as3/scripts.c", "lib/as3/common.c", "lib/as3/builtin.c", "lib/as3/compiler.c", "lib/as3/expr.c", "lib/as3/import.c", +"lib/as3/initcode.c", "lib/as3/parser.tab.c", "lib/as3/parser_help.c", "lib/as3/registry.c", "lib/as3/tokenizer.yy.c", ] libpdf_sources = [ -"lib/pdf/GFXOutputDev.cc", "lib/pdf/InfoOutputDev.cc", "lib/pdf/BitmapOutputDev.cc", -"lib/pdf/FullBitmapOutputDev.cc", "lib/pdf/pdf.cc", "lib/pdf/fonts.c", "lib/pdf/xpdf/GHash.cc", +"lib/pdf/VectorGraphicOutputDev.cc", +"lib/pdf/CharOutputDev.cc", +"lib/pdf/InfoOutputDev.cc", "lib/pdf/BitmapOutputDev.cc", +"lib/pdf/FullBitmapOutputDev.cc", +"lib/pdf/CommonOutputDev.cc", +"lib/pdf/bbox.c", +"lib/pdf/pdf.cc", "lib/pdf/fonts.c", "lib/pdf/xpdf/GHash.cc", "lib/pdf/xpdf/GList.cc", "lib/pdf/xpdf/GString.cc", "lib/pdf/xpdf/gmem.cc", "lib/pdf/xpdf/gfile.cc", "lib/pdf/xpdf/FoFiTrueType.cc", "lib/pdf/xpdf/FoFiType1.cc", "lib/pdf/xpdf/FoFiType1C.cc", "lib/pdf/xpdf/FoFiBase.cc", "lib/pdf/xpdf/FoFiEncodings.cc", "lib/pdf/xpdf/OutputDev.cc", "lib/pdf/xpdf/PDFDoc.cc", @@ -284,7 +292,10 @@ "lib/pdf/xpdf/SplashFTFontFile.cc", "lib/pdf/xpdf/SplashFTFont.cc"] libgfx_sources = [ -"lib/gfxtools.c", "lib/gfxfont.c", "lib/gfxpoly.c", +"lib/gfxtools.c", "lib/gfxfont.c", "lib/gfximage.c", +"lib/gfxpoly/active.c", "lib/gfxpoly/convert.c", "lib/gfxpoly/moments.c", +"lib/gfxpoly/poly.c", "lib/gfxpoly/renderpoly.c", "lib/gfxpoly/stroke.c", +"lib/gfxpoly/wind.c", "lib/gfxpoly/xrow.c", "lib/devices/dummy.c", "lib/devices/file.c", "lib/devices/render.c", "lib/devices/text.c", "lib/devices/record.c", "lib/devices/ops.c", "lib/devices/polyops.c", "lib/devices/bbox.c", "lib/devices/rescale.c", "lib/art/art_affine.c", "lib/art/art_alphagamma.c", "lib/art/art_bpath.c", "lib/art/art_gray_svp.c", diff -Nru swftools-0.9.0/src/as3compile.1 swftools-0.9.2/src/as3compile.1 --- swftools-0.9.0/src/as3compile.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/as3compile.1 2012-04-08 17:25:26.000000000 +0000 @@ -1,9 +1,9 @@ -.TH as3compile "1" "April 2009" "as3compile" "swftools" +.TH as3compile "1" "February 2012" "as3compile" "swftools" .SH NAME -as3compile - Compile .as ActionScript 3.0 files to swf. +as3compile \- Compile .as ActionScript 3.0 files to swf. .SH Synopsis -.B as3compile file.as [-o file.swf] +.B as3compile file.as [\-o file.swf] .SH DESCRIPTION Compiles a file written in ActionScript 3.0 to a SWF file. @@ -63,7 +63,7 @@ .SH EXAMPLE The following is a basic as3 file that can be compiled e.g. - with \fBas3compile -X 400 -Y 400 smiley.as\fR + with \fBas3compile \-X 400 \-Y 400 smiley.as\fR // smiley.as package diff -Nru swftools-0.9.0/src/as3compile.c swftools-0.9.2/src/as3compile.c --- swftools-0.9.0/src/as3compile.c 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/as3compile.c 2012-04-08 17:25:26.000000000 +0000 @@ -213,7 +213,6 @@ } else { as3_add_include_dir(currentdir); } - registry_init(); int t; processargs(argc, argv); @@ -253,7 +252,7 @@ tag = swf_InsertTag(tag, ST_SYMBOLCLASS); swf_SetU16(tag, 1); swf_SetU16(tag, 0); - swf_SetString(tag, as3_getglobalclass()); + swf_SetString(tag, mainclass); } else { as3_warning("no global public MovieClip subclass"); } diff -Nru swftools-0.9.0/src/font2swf.1 swftools-0.9.2/src/font2swf.1 --- swftools-0.9.0/src/font2swf.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/font2swf.1 2012-04-17 16:12:03.000000000 +0000 @@ -1,6 +1,6 @@ -.TH font2swf "1" "April 2009" "font2swf" "swftools" +.TH font2swf "1" "February 2012" "font2swf" "swftools" .SH NAME -font2swf - Converts a font to SWF. +font2swf \- Converts a font to SWF. .SH Synopsis .B font2swf diff -Nru swftools-0.9.0/src/font2swf.c swftools-0.9.2/src/font2swf.c --- swftools-0.9.0/src/font2swf.c 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/font2swf.c 2012-04-08 17:25:26.000000000 +0000 @@ -31,6 +31,7 @@ static int all=0; static int verbose=0; static char * fontname = 0; +static char config_flashtype = 0; static struct options_t options[] = { {"h", "help"}, @@ -54,6 +55,10 @@ verbose ++; return 0; } + else if(!strcmp(name, "T")) { + config_flashtype=1; + return 0; + } else if(!strcmp(name, "n")) { fontname = val; return 1; @@ -97,7 +102,8 @@ { SWFFONT * font; - font = swf_LoadFont(infile); + font = swf_LoadFont(infile, config_flashtype); + swf_FontCreateAlignZones(font); if(fontname) font->name = strdup(fontname); diff -Nru swftools-0.9.0/src/gif2swf.1 swftools-0.9.2/src/gif2swf.1 --- swftools-0.9.0/src/gif2swf.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/gif2swf.1 2012-04-08 17:25:26.000000000 +0000 @@ -1,14 +1,14 @@ -.TH gif2swf "1" "April 2009" "gif2swf" "swftools" +.TH gif2swf "1" "February 2012" "gif2swf" "swftools" .SH NAME -gif2swf - Takes a number of gif files and converts them to a swf movie, one +gif2swf \- Takes a number of gif files and converts them to a swf movie, one picture per frame. .SH Synopsis -.B gif2swf [-X width] [-Y height] [-o file.swf] [-r rate] file1.gif [file2.gif ...] +.B gif2swf [\-X width] [\-Y height] [\-o file.swf] [\-r rate] file1.gif [file2.gif ...] .SH DESCRIPTION This tools converts gif image files into an SWF animation. It takes any -number of input pictures, and converts them to SWF one-by-one, where every +number of input pictures, and converts them to SWF one\-by\-one, where every converted picture is a seperate frame in the target SWF. .SH OPTIONS diff -Nru swftools-0.9.0/src/gif2swf.c swftools-0.9.2/src/gif2swf.c --- swftools-0.9.0/src/gif2swf.c 2009-02-16 10:34:51.000000000 +0000 +++ swftools-0.9.2/src/gif2swf.c 2011-01-02 03:30:29.000000000 +0000 @@ -34,7 +34,7 @@ #define AS_FIRSTFRAME "if(!n) n=0;" #define AS_LASTFRAME "if(n<%d){n=n+1;gotoAndPlay(1);}else stop();" -struct { +static struct { float framerate; int max_image_width; int max_image_height; diff -Nru swftools-0.9.0/src/jpeg2swf.1 swftools-0.9.2/src/jpeg2swf.1 --- swftools-0.9.0/src/jpeg2swf.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/jpeg2swf.1 2012-04-17 16:12:03.000000000 +0000 @@ -1,13 +1,13 @@ -.TH jpeg2swf "1" "April 2009" "jpeg2swf" "swftools" +.TH jpeg2swf "1" "February 2012" "jpeg2swf" "swftools" .SH NAME -jpeg2swf - Converts jpeg images to SWF. +jpeg2swf \- Converts jpeg images to SWF. .SH Synopsis -.B jpeg2swf [-options [value]] imagefiles[.jpg]|[.jpeg] [...] +.B jpeg2swf [\-options [value]] imagefiles[.jpg]|[.jpeg] [...] .SH DESCRIPTION -This tools converts jpeg image files into an SWF animation. It takes any -number of input pictures, and converts them to SWF one-by-one, where every +This tool converts jpeg image files into an SWF animation. It takes any +number of input pictures, and converts them to SWF one\-by\-one, where every converted picture is a seperate frame in the target SWF. .SH OPTIONS @@ -57,6 +57,6 @@ Make importable as asset with \fIassetname\fR .SH AUTHORS -Rainer Böhme +Rainer Böhme .TP Matthias Kramm diff -Nru swftools-0.9.0/src/jpeg2swf.c swftools-0.9.2/src/jpeg2swf.c --- swftools-0.9.0/src/jpeg2swf.c 2009-02-16 10:34:51.000000000 +0000 +++ swftools-0.9.2/src/jpeg2swf.c 2011-01-02 03:30:29.000000000 +0000 @@ -31,7 +31,7 @@ #define MAX_INPUT_FILES 1024 #define VERBOSE(x) (global.verbose>=x) -struct { +static struct { int quality; float framerate; int max_image_width; @@ -632,7 +632,7 @@ int i; for (i = 0; i < global.nfiles; i++) { if (VERBOSE(3)) - fprintf(stderr, "[%03i] %s (%i%%, 1/%i)\n", i, + fprintf(stderr, "[%03i] %s (%i%%)\n", i, image[i].filename, image[i].quality); t = MovieAddFrame(&swf, t, image[i].filename, image[i].quality, image[i].width, image[i].height); diff -Nru swftools-0.9.0/src/Makefile.in swftools-0.9.2/src/Makefile.in --- swftools-0.9.0/src/Makefile.in 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/Makefile.in 2011-10-07 03:20:17.000000000 +0000 @@ -3,8 +3,8 @@ top_srcdir = @top_srcdir@ include ../Makefile.common -programs = wav2swf$(E) @PNG2SWF@ swfcombine$(E) swfstrings$(E) swfextract$(E) swfdump$(E) swfc$(E) @JPEG2SWF@ @GIF2SWF@ swfbbox$(E) font2swf$(E) swfrender$(E) as3compile$(E) @PDF2SWF@ -opt_programs = swfbytes$(E) +install_programs = wav2swf$(E) @PNG2SWF@ swfcombine$(E) swfstrings$(E) swfextract$(E) swfdump$(E) swfc$(E) @JPEG2SWF@ @GIF2SWF@ swfbbox$(E) font2swf$(E) swfrender$(E) as3compile$(E) @PDF2SWF@ @PDF2PDF@ +programs = $(install_programs) swfbytes$(E) ttftool$(E) all: $(programs) @@ -14,6 +14,10 @@ $(C) png2swf.c -o $@ pdf2swf.$(O): pdf2swf.c $(C) pdf2swf.c -o $@ +pdf2pdf.$(O): pdf2pdf.c + $(C) pdf2pdf.c -o $@ +gfx2gfx.$(O): gfx2gfx.c + $(C) gfx2gfx.c -o $@ gif2swf.$(O): gif2swf.c $(C) gif2swf.c -o $@ swfcombine.$(O): swfcombine.c @@ -36,6 +40,8 @@ $(C) swfbytes.c -o $@ font2swf.$(O): font2swf.c $(C) font2swf.c -o $@ +ttftool.$(O): ttftool.c + $(C) ttftool.c -o $@ as3compile.$(O): as3compile.c $(C) as3compile.c -o $@ swfc.$(O): swfc.c parser.h ../lib/q.h @@ -49,9 +55,18 @@ parser.$(O): parser.yy.c parser.h ../lib/q.h $(C) parser.yy.c -o $@ -../lib/librfxswf$(A): ../lib/modules/swfrender.c ../lib/modules/swfshape.c ../lib/modules/swfbits.c ../lib/rfxswf.c +../lib/librfxswf$(A): ../lib/modules/swfrender.c ../lib/modules/swfshape.c ../lib/modules/swftext.c ../lib/modules/swffont.c ../lib/modules/swfbits.c ../lib/rfxswf.c ../lib/devices/swf.c ../lib/modules/swfalignzones.c cd ../lib;$(MAKE) librfxswf$(A);cd - +../lib/libgfxpdf$(A): ../lib/pdf/VectorGraphicOutputDev.cc + cd ../lib;$(MAKE) libgfxpdf$(A);cd - + +../lib/libgfx$(A): ../lib/devices/*.c ../lib/gfxdevice.h ../lib/gfxtools.c ../lib/gfxfont.c + cd ../lib;$(MAKE) libgfx$(A);cd - + +../lib/libgfxswf$(A): ../lib/devices/swf.c ../lib/readers/swf.c + cd ../lib;$(MAKE) libgfxswf$(A);cd - + # TODO: include the following rule only if lex is available parser.yy.c: parser.lex flex -B -s -oparser.yy.c parser.lex @@ -89,20 +104,31 @@ font2swf$(E): font2swf.$(O) ../lib/librfxswf$(A) ../lib/libbase$(A) $(L) font2swf.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libbase$(A) $(LIBS) $(STRIP) $@ +ttftool$(E): ttftool.$(O) ../lib/librfxswf$(A) ../lib/libbase$(A) + $(L) ttftool.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libbase$(A) $(LIBS) + $(STRIP) $@ as3compile$(E): as3compile.$(O) ../lib/librfxswf$(A) ../lib/libbase$(A) $(L) as3compile.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libbase$(A) $(LIBS) $(STRIP) $@ jpeg2swf$(E): jpeg2swf.$(O) ../lib/librfxswf$(A) ../lib/libbase$(A) $(L) jpeg2swf.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libbase$(A) $(LIBS) $(STRIP) $@ -swfrender$(E): swfrender.$(O) ../lib/librfxswf$(A) ../lib/libgfx$(A) ../lib/libbase$(A) ../lib/libgfxswf$(A) - $(L) swfrender.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libgfx$(A) ../lib/libgfxswf$(A) ../lib/libbase$(A) $(LIBS) +swfrender$(E): swfrender.$(O) ../lib/libgfxswf$(A) ../lib/librfxswf$(A) ../lib/libgfx$(A) ../lib/libbase$(A) + $(L) swfrender.$(O) -o $@ ../lib/libgfxswf$(A) ../lib/librfxswf$(A) ../lib/libgfx$(A) ../lib/libbase$(A) $(LIBS) $(STRIP) $@ -PDF2SWF_OBJ=../lib/libpdf$(A) ../lib/devices/polyops.$(O) ../lib/devices/swf.$(O) ../lib/librfxswf$(A) ../lib/libgfx$(A) ../lib/libbase$(A) +PDF2SWF_OBJ=../lib/libgfxswf$(A) ../lib/librfxswf$(A) ../lib/libgfxpdf$(A) ../lib/libgfx$(A) ../lib/libbase$(A) +OCR_OBJ=../lib/libocr$(A) + pdf2swf$(E): pdf2swf.$(O) $(PDF2SWF_OBJ) $(LL) pdf2swf.$(O) -o $@ $(PDF2SWF_OBJ) $(LIBS) $(CXXLIBS) $(STRIP) $@ +pdf2pdf$(E): pdf2pdf.$(O) $(PDF2SWF_OBJ) + $(LL) pdf2pdf.$(O) -o $@ $(PDF2SWF_OBJ) $(LIBS) $(CXXLIBS) + $(STRIP) $@ +gfx2gfx$(E): gfx2gfx.$(O) $(OCR_OBJ) $(PDF2SWF_OBJ) + $(LL) gfx2gfx.$(O) -o $@ $(OCR_OBJ) $(PDF2SWF_OBJ) $(LIBS) $(CXXLIBS) + $(STRIP) $@ swfc$(E): parser.$(O) swfc.$(O) swfc-feedback.$(O) swfc-history.$(O) swfc-interpolation.$(O) ../lib/librfxswf$(A) ../lib/libbase$(A) $(L) parser.$(O) swfc.$(O) swfc-feedback.$(O) swfc-history.$(O) swfc-interpolation.$(O) -o $@ ../lib/librfxswf$(A) ../lib/libbase$(A) $(LIBS) $(STRIP) $@ @@ -110,16 +136,16 @@ install: $(mkinstalldirs) $(bindir) $(mkinstalldirs) $(man1dir) - @for file in $(programs) $(opt_programs); do if test -f $$file;then $(INSTALL_BIN);$(INSTALL_MAN1);fi;done + @for file in $(install_programs); do if test -f $$file;then $(INSTALL_BIN);$(INSTALL_MAN1);fi;done uninstall: - @for file in $(programs) $(opt_programs); do $(UNINSTALL_BIN);$(UNINSTALL_MAN1);done + @for file in $(install_programs); do $(UNINSTALL_BIN);$(UNINSTALL_MAN1);done clean: rm -f *.o *.obj *.lo *.la *~ gmon.out - rm -f as3compile gif2swf swfbbox swfbytes swfbytes swfdump pdf2swf wav2swf png2swf swfcombine swfextract swfstrings png2swf jpeg2swf swfc font2swf - @rm -f gif2swf.exe swfbytes.exe swfbytes.exe pdf2swf.exe swfbbox.exe swfdump.exe wav2swf.exe png2swf.exe swfcombine.exe swfextract.exe swfstrings.exe png2swf.exe jpeg2swf.exe swfc.exe font2swf.exe - @rm -f gif2swf$(E) pdf2swf$(E) swfbytes$(E) swfbytes$(E) swfbbox$(E) swfdump$(E) wav2swf$(E) png2swf$(E) swfcombine$(E) swfextract$(E) swfstrings$(E) png2swf$(E) jpeg2swf$(E) swfc$(E) font2swf$(E) + rm -f as3compile gif2swf swfbbox swfbytes swfbytes swfdump pdf2swf wav2swf png2swf swfcombine swfextract swfstrings png2swf jpeg2swf swfc font2swf pdf2pdf gfx2gfx swfrender ttftool + @rm -f as3compile.exe gif2swf.exe swfbytes.exe swfbytes.exe pdf2swf.exe swfbbox.exe swfdump.exe wav2swf.exe png2swf.exe swfcombine.exe swfextract.exe swfstrings.exe png2swf.exe jpeg2swf.exe swfc.exe font2swf.exe pdf2pdf.exe gfx2gfx.exe swfrender.exe ttftool.exe + @rm -f as3compile$(E) gif2swf$(E) pdf2swf$(E) swfbytes$(E) swfbytes$(E) swfbbox$(E) swfdump$(E) wav2swf$(E) png2swf$(E) swfcombine$(E) swfextract$(E) swfstrings$(E) png2swf$(E) jpeg2swf$(E) swfc$(E) font2swf$(E) pdf2pdf$(E) gfx2gfx$(E) swfrender$(E) ttftool$(E) doc: perl ../parsedoc.pl wav2swf.doc @@ -132,6 +158,7 @@ perl ../parsedoc.pl swfdump.doc perl ../parsedoc.pl swfc.doc perl ../parsedoc.pl as3compile.doc - #perl ../parsedoc.pl swfbytes.doc + perl ../parsedoc.pl swfbytes.doc + perl ../parsedoc.pl pdf2pdf.doc .PHONY: clean doc diff -Nru swftools-0.9.0/src/parser.h swftools-0.9.2/src/parser.h --- swftools-0.9.0/src/parser.h 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/parser.h 2011-01-02 03:30:29.000000000 +0000 @@ -34,6 +34,7 @@ struct token_t { enum type_t type; + int text_pos; char* text; int line; int column; diff -Nru swftools-0.9.0/src/parser.lex swftools-0.9.2/src/parser.lex --- swftools-0.9.0/src/parser.lex 2009-03-08 17:42:15.000000000 +0000 +++ swftools-0.9.2/src/parser.lex 2011-01-02 03:30:29.000000000 +0000 @@ -102,16 +102,17 @@ token.column = column; //printf("->%d(%s) %s\n", type, type_names[type], text);fflush(stdout); + token.text_pos = 0; token.text = 0; switch(type) { case END: string_set2(&tmp, "", 0); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case STRING: string_set2(&tmp, text+1, length-2); unescapeString(&tmp); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case TWIP: case NUMBER: @@ -119,20 +120,20 @@ string_set2(&tmp, text, length); if(prefix) { //strcat - token.text = (char*)mem_put(&strings, prefix, strlen(prefix)); + token.text_pos = mem_put(&strings, prefix, strlen(prefix)); mem_putstring(&strings, tmp); } else { - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); } prefix = 0; break; case RAWDATA: string_set2(&tmp, text+1/*:*/, length-5/*.end*/); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case COMMAND: string_set2(&tmp, text+1, length-1); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case ASSIGNMENT: { char*x = &text[length-1]; @@ -141,7 +142,7 @@ do{x--;} while(*x==32 || *x==10 || *x==13 || *x=='\t'); x++; //first space string_set2(&tmp, text, x-text); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); /*char*y,*x = strchr(text, '='); if(!x) exit(1); y=x; @@ -319,8 +320,9 @@ num = tokens.pos/sizeof(struct token_t); for(t=0;t%d(%s) %s\n", type, type_names[type], text);fflush(stdout); + token.text_pos = 0; token.text = 0; switch(type) { case END: string_set2(&tmp, "", 0); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case STRING: string_set2(&tmp, text+1, length-2); unescapeString(&tmp); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case TWIP: case NUMBER: @@ -696,20 +697,20 @@ string_set2(&tmp, text, length); if(prefix) { //strcat - token.text = (char*)mem_put(&strings, prefix, strlen(prefix)); + token.text_pos = mem_put(&strings, prefix, strlen(prefix)); mem_putstring(&strings, tmp); } else { - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); } prefix = 0; break; case RAWDATA: string_set2(&tmp, text+1/*:*/, length-5/*.end*/); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case COMMAND: string_set2(&tmp, text+1, length-1); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); break; case ASSIGNMENT: { char*x = &text[length-1]; @@ -718,7 +719,7 @@ do{x--;} while(*x==32 || *x==10 || *x==13 || *x=='\t'); x++; //first space string_set2(&tmp, text, x-text); - token.text = (char*)mem_putstring(&strings, tmp); + token.text_pos = mem_putstring(&strings, tmp); /*char*y,*x = strchr(text, '='); if(!x) exit(1); y=x; @@ -782,7 +783,7 @@ #define s(type) {store(type, line, column, yytext, yyleng);} -#line 786 "parser.yy.c" +#line 787 "parser.yy.c" #define INITIAL 0 #define R 1 @@ -969,10 +970,10 @@ register char *yy_cp, *yy_bp; register int yy_act; -#line 219 "parser.lex" +#line 220 "parser.lex" -#line 976 "parser.yy.c" +#line 977 "parser.yy.c" if ( !(yy_init) ) { @@ -1054,18 +1055,18 @@ case 1: YY_RULE_SETUP -#line 221 "parser.lex" +#line 222 "parser.lex" {c();BEGIN(0);} YY_BREAK case 2: YY_RULE_SETUP -#line 222 "parser.lex" +#line 223 "parser.lex" {c();} YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 223 "parser.lex" +#line 224 "parser.lex" {c();} YY_BREAK case 4: @@ -1074,7 +1075,7 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 224 "parser.lex" +#line 225 "parser.lex" {s(TWIP);c();BEGIN(0);} YY_BREAK case 5: @@ -1083,24 +1084,24 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 225 "parser.lex" +#line 226 "parser.lex" {s(NUMBER);c();BEGIN(0);} YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 226 "parser.lex" +#line 227 "parser.lex" {c();} YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 227 "parser.lex" +#line 228 "parser.lex" {c();} YY_BREAK case 8: YY_RULE_SETUP -#line 228 "parser.lex" +#line 229 "parser.lex" {s(STRING);c();BEGIN(0);} YY_BREAK case 9: @@ -1108,70 +1109,70 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 229 "parser.lex" +#line 230 "parser.lex" {c();printf("unterminated string in line %d: %s\n", line, yytext);exit(1);yyterminate();} YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 230 "parser.lex" +#line 231 "parser.lex" {s(ASSIGNMENT);prefix="";c();BEGIN(R);} YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 231 "parser.lex" +#line 232 "parser.lex" {s(ASSIGNMENT);prefix="";c();BEGIN(R);} YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP -#line 232 "parser.lex" +#line 233 "parser.lex" {s(ASSIGNMENT);c();BEGIN(R);} YY_BREAK /* values which appear only on the right-hand side of assignments, like: x=50% */ case 13: YY_RULE_SETUP -#line 234 "parser.lex" +#line 235 "parser.lex" {s(IDENTIFIER);c();BEGIN(0);} YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP -#line 236 "parser.lex" +#line 237 "parser.lex" {handleInclude(yytext, yyleng);} YY_BREAK case 15: YY_RULE_SETUP -#line 237 "parser.lex" +#line 238 "parser.lex" {s(COMMAND);c();} YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP -#line 238 "parser.lex" +#line 239 "parser.lex" {s(RAWDATA);c();} YY_BREAK case 17: YY_RULE_SETUP -#line 239 "parser.lex" +#line 240 "parser.lex" {s(IDENTIFIER);c();} YY_BREAK case 18: YY_RULE_SETUP -#line 240 "parser.lex" +#line 241 "parser.lex" {c();BEGIN(BINARY);} YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP -#line 241 "parser.lex" +#line 242 "parser.lex" {c();} YY_BREAK case 20: YY_RULE_SETUP -#line 242 "parser.lex" +#line 243 "parser.lex" {char c,c1=yytext[0]; printf("Syntax error in line %d, %d: %s", line, column, yytext); while(1) { @@ -1190,7 +1191,7 @@ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(R): case YY_STATE_EOF(BINARY): -#line 256 "parser.lex" +#line 257 "parser.lex" {c(); if ( --include_stack_ptr < 0 ) { s(END); @@ -1205,10 +1206,10 @@ YY_BREAK case 21: YY_RULE_SETUP -#line 269 "parser.lex" +#line 270 "parser.lex" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1212 "parser.yy.c" +#line 1213 "parser.yy.c" case YY_END_OF_BUFFER: { @@ -2218,7 +2219,7 @@ #define YYTABLES_NAME "yytables" -#line 269 "parser.lex" +#line 270 "parser.lex" @@ -2273,8 +2274,9 @@ num = tokens.pos/sizeof(struct token_t); for(t=0;t + +.SH DESCRIPTION +Runs a pdf through the pdf2swf conversion engine, and writes it +back to a pdf. + +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR + Print short help message and exit +.TP +\fB\-v\fR, \fB\-\-verbose\fR + Be verbose. Use more than one -v for greater effect. +.TP +\fB\-p\fR, \fB\-\-pages\fR \fIpages\fR + Pages to convert +.TP +\fB\-X\fR, \fB\-\-width\fR \fIwidth\fR + Make sure the output pdf is \fIwidth\fR pixels wide +.TP +\fB\-Y\fR, \fB\-\-height\fR \fIheight\fR + Make sure the output pdf is \fIheight\fR pixels high +.TP +\fB\-s\fR, \fB\-\-set\fR \fIparameter>= +.TP +\fB\-o\fR, \fB\-\-output\fR \fIfilename\fR + Write output to file \fIfilename\fR. (If not given, the output will go + to a file with the extension .print.pdf) +.TP +\fB\-V\fR, \fB\-\-version\fR + Print version info and exit +.SH AUTHOR + +Matthias Kramm diff -Nru swftools-0.9.0/src/pdf2pdf.c swftools-0.9.2/src/pdf2pdf.c --- swftools-0.9.0/src/pdf2pdf.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/src/pdf2pdf.c 2010-11-12 19:07:01.000000000 +0000 @@ -0,0 +1,267 @@ +/* pdf2pdf.c + main routine for pdf2pdf(1) + + Part of the swftools package. + + Copyright (c) 2009 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include "../config.h" +#include "../lib/args.h" +#include "../lib/os.h" +#include "../lib/gfxsource.h" +#include "../lib/gfxdevice.h" +#include "../lib/gfxpoly.h" +#include "../lib/devices/rescale.h" +#include "../lib/devices/polyops.h" +#include "../lib/devices/pdf.h" +#include "../lib/readers/image.h" +#include "../lib/readers/swf.h" +#include "../lib/pdf/pdf.h" +#include "../lib/log.h" + +static gfxsource_t*driver = 0; + +static int maxwidth = 0; +static int maxheight = 0; +static char * outputname = 0; +static int loglevel = 3; +static char * pagerange = 0; +static char * filename = 0; +static const char * format = "ocr"; + +int args_callback_option(char*name,char*val) { + if (!strcmp(name, "o")) + { + outputname = val; + return 1; + } + else if (!strcmp(name, "v")) + { + loglevel ++; + setConsoleLogging(loglevel); + return 0; + } + else if (!strcmp(name, "f")) + { + format = val; + return 1; + } + else if (!strcmp(name, "q")) + { + loglevel --; + setConsoleLogging(loglevel); + return 0; + } + else if (name[0]=='p') + { + do { + name++; + } while(*name == 32 || *name == 13 || *name == 10 || *name == '\t'); + + if(*name) { + pagerange = name; + return 0; + } + pagerange = val; + return 1; + } + else if (!strcmp(name, "s")) + { + if(!driver) { + fprintf(stderr, "Specify input file before -s\n"); + exit(1); + } + char*s = strdup(val); + char*c = strchr(s, '='); + if(c && *c && c[1]) { + *c = 0; + c++; + driver->setparameter(driver, s,c); + } else { + driver->setparameter(driver, s,"1"); + } + free(s); + return 1; + } + else if (!strcmp(name, "X")) + { + maxwidth = atoi(val); + return 1; + } + else if (!strcmp(name, "Y")) + { + maxheight = atoi(val); + return 1; + } + else if (!strcmp(name, "V")) + { + printf("pdf2swf - part of %s %s\n", PACKAGE, VERSION); + exit(0); + } + else + { + fprintf(stderr, "Unknown option: -%s\n", name); + exit(1); + } + return 0; +} + +static struct options_t options[] = { +{"h", "help"}, +{"v", "verbose"}, +{"p", "pages"}, +{"X", "width"}, +{"Y", "height"}, +{"s", "set"}, +{"o", "output"}, +{"V", "version"}, +{0,0} +}; + +int args_callback_longoption(char*name,char*val) { + return args_long2shortoption(options, name, val); +} + +int args_callback_command(char*name, char*val) { + if (!filename) { + + filename = name; + + if(strstr(filename, ".pdf") || strstr(filename, ".PDF")) { + msg(" Treating file as PDF"); + driver = gfxsource_pdf_create(); + } else if(strstr(filename, ".swf") || strstr(filename, ".SWF")) { + msg(" Treating file as SWF"); + driver = gfxsource_swf_create(); + } else if(strstr(filename, ".jpg") || strstr(filename, ".JPG") || + strstr(filename, ".png") || strstr(filename, ".PNG")) { + msg(" Treating file as Image"); + driver = gfxsource_image_create(); + } else { + driver = gfxsource_pdf_create(); + } + } else { + if(outputname) + { + fprintf(stderr, "Error: Do you want the output to go to %s or to %s?", + outputname, name); + exit(1); + } + outputname = name; + } + return 0; +} + +void args_callback_usage(char *name) +{ + printf("\n"); + printf("Usage: %s \n", name); + printf("\n"); + printf("-h , --help Print short help message and exit\n"); + printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n"); + printf("-p , --pages Pages to convert\n"); + printf("-X , --width Make sure the output pdf is pixels wide\n"); + printf("-Y , --height Make sure the output pdf is pixels high\n"); + printf("-s , --set = Set to \n"); + printf("-o , --output Write output to file .\n"); + printf("-V , --version Print version info and exit\n"); + printf("\n"); +} + +int main(int argn, char *argv[]) +{ + processargs(argn, argv); + initLog(0,-1,0,0,-1,loglevel); + + if(!filename) { + fprintf(stderr, "Please specify an input file\n"); + exit(1); + } + + if(!outputname) + { + if(filename) { + outputname = stripFilename(filename, ".print.pdf"); + msg(" Output filename not given. Writing to %s", outputname); + } + } + if(!outputname) + { + fprintf(stderr, "Please use -o to specify an output file\n"); + exit(1); + } + + is_in_range(0x7fffffff, pagerange); + if(pagerange) + driver->setparameter(driver, "pages", pagerange); + + if(!filename) { + args_callback_usage(argv[0]); + exit(0); + } + + gfxdocument_t* doc = driver->open(driver, filename); + //doc->setparameter(doc, "drawonlyshapes", "1"); + doc->setparameter(doc, "disable_polygon_conversion", "1"); + + if(!doc) { + msg(" Couldn't open %s", filename); + exit(1); + } + + gfxdevice_t _out,*out=&_out; + gfxdevice_pdf_init(out); + + /*gfxdevice_t wrap; + gfxdevice_removeclippings_init(&wrap, out); + out = &wrap;*/ + + gfxdevice_t rescale; + if(maxwidth || maxheight) { + gfxdevice_rescale_init(&rescale, out, maxwidth, maxheight, 0); + out = &rescale; + out->setparameter(out, "keepratio", "1"); + } + + int pagenr; + for(pagenr = 1; pagenr <= doc->num_pages; pagenr++) + { + if(is_in_range(pagenr, pagerange)) { + gfxpage_t* page = doc->getpage(doc, pagenr); + out->startpage(out, page->width, page->height); + page->render(page, out); + out->endpage(out); + page->destroy(page); + } + } + gfxresult_t*result = out->finish(out); + if(result) { + if(result->save(result, outputname) < 0) { + exit(1); + } + result->destroy(result); + } + doc->destroy(doc); + driver->destroy(driver); + return 0; +} + diff -Nru swftools-0.9.0/src/pdf2swf.c swftools-0.9.2/src/pdf2swf.c --- swftools-0.9.0/src/pdf2swf.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/src/pdf2swf.c 2012-04-08 17:25:26.000000000 +0000 @@ -43,6 +43,7 @@ #include "../lib/devices/polyops.h" #include "../lib/devices/record.h" #include "../lib/devices/rescale.h" +#include "../lib/gfxfilter.h" #include "../lib/pdf/pdf.h" #include "../lib/log.h" @@ -71,6 +72,8 @@ static int flatten = 0; +static char* filters = 0; + char* fontpaths[256]; int fontpathpos = 0; @@ -257,7 +260,7 @@ } else if (!strcmp(name, "s")) { - char*s = strdup(val); + char*s = val; char*c = strchr(s, '='); if(c && *c && c[1]) { *c = 0; @@ -266,7 +269,7 @@ } else if(!strcmp(s,"help")) { printf("PDF Parameters:\n"); gfxsource_t*pdf = gfxsource_pdf_create(); - pdf->set_parameter(pdf, "help", ""); + pdf->setparameter(pdf, "help", ""); gfxdevice_t swf; gfxdevice_swf_init(&swf); printf("SWF Parameters:\n"); @@ -334,6 +337,20 @@ store_parameter("extrafontdata", "1"); return 0; } + else if (!strcmp(name, "ff")) + { + if(filters) { + // append this to the current filter expression (we allow more than one --filter) + int l = strlen(filters); + int new_len = l + strlen(val) + 2; + filters = (char*)realloc(filters, new_len); + filters[l] = ':'; + strcpy(filters+l+1, val); + } else { + filters = strdup(val); + } + return 1; + } else if (!strcmp(name, "w")) { store_parameter("linksopennewwindow", "0"); @@ -454,6 +471,7 @@ {"t", "stop"}, {"T", "flashversion"}, {"F", "fontdir"}, +{"ff", "filter"}, {"b", "defaultviewer"}, {"l", "defaultloader"}, {"B", "viewer"}, @@ -495,7 +513,7 @@ printf("\n"); printf("-h , --help Print short help message and exit\n"); printf("-V , --version Print version info and exit\n"); - printf("-o , --output file.swf Direct output to file.swf. If file.swf contains '%%' (file%%.swf), then each page goes to a seperate file.\n"); + printf("-o , --output file.swf Direct output to file.swf. If file.swf contains '%%' (file%%.swf), then each page goes to a separate file.\n"); printf("-p , --pages range Convert only pages in range with range e.g. 1-20 or 1,4,6,9-11 or\n"); printf("-P , --password password Use password for deciphering the pdf.\n"); printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n"); @@ -588,6 +606,16 @@ out = &rescale; } + if(filters) { + gfxfilterchain_t*chain = gfxfilterchain_parse(filters); + if(!chain) { + fprintf(stderr, "Unable to parse filters: %s\n", filters); + exit(1); + } + out = gfxfilterchain_apply(chain, out); + gfxfilterchain_destroy(chain); + } + /* pass global parameters to output device */ parameter_t*p = device_config; while(p) { @@ -630,7 +658,7 @@ /* pass global parameters to PDF driver*/ parameter_t*p = device_config; while(p) { - driver->set_parameter(driver, p->name, p->value); + driver->setparameter(driver, p->name, p->value); p = p->next; } @@ -640,45 +668,47 @@ exit(1); } - if(info_only) { - show_info(driver, filename); - return 0; - } - - if(!outputname) - { - if(filename) { - outputname = stripFilename(filename, ".swf"); - msg(" Output filename not given. Writing to %s", outputname); - } - } - - if(!outputname) - { - fprintf(stderr, "Please use -o to specify an output file\n"); - exit(1); + if (!info_only) { + if(!outputname) + { + if(filename) { + outputname = stripFilename(filename, ".swf"); + msg(" Output filename not given. Writing to %s", outputname); + } + } + + if(!outputname) + { + fprintf(stderr, "Please use -o to specify an output file\n"); + exit(1); + } } // test if the page range is o.k. is_in_range(0x7fffffff, pagerange); - if(pagerange) - driver->set_parameter(driver, "pages", pagerange); - if (!filename) { args_callback_usage(argv[0]); exit(0); } + + char fullname[256]; + if(password && *password) { + sprintf(fullname, "%s|%s", filename, password); + filename = fullname; + } + + if(pagerange) + driver->setparameter(driver, "pages", pagerange); /* add fonts */ for(t=0;tset_parameter(driver, "fontdir", fontpaths[t]); + driver->setparameter(driver, "fontdir", fontpaths[t]); } - char fullname[256]; - if(password && *password) { - sprintf(fullname, "%s|%s", filename, password); - filename = fullname; + if(info_only) { + show_info(driver, filename); + return 0; } char*u = 0; @@ -711,7 +741,7 @@ /* pass global parameters document */ p = device_config; while(p) { - pdf->set_parameter(pdf, p->name, p->value); + pdf->setparameter(pdf, p->name, p->value); p = p->next; } @@ -730,7 +760,7 @@ if(is_in_range(pagenr, pagerange)) { char mapping[80]; sprintf(mapping, "%d:%d", pagenr, frame); - pdf->set_parameter(pdf, "pagemap", mapping); + pdf->setparameter(pdf, "pagemap", mapping); pagenum++; } if(pagenum == xnup*ynup || (pagenr == pdf->num_pages && pagenum>1)) { @@ -738,10 +768,16 @@ frame++; } } + if(pagerange && !pagenum && frame==1) { + fprintf(stderr, "No pages in range %s", pagerange); + exit(1); + } pagenum = 0; gfxdevice_t*out = create_output_device();; + pdf->prepare(pdf, out); + for(pagenr = 1; pagenr <= pdf->num_pages; pagenr++) { if(is_in_range(pagenr, pagerange)) { @@ -813,6 +849,7 @@ } result->destroy(result);result=0; out = create_output_device();; + pdf->prepare(pdf, out); msg(" Writing SWF file %s", buf); } } @@ -879,6 +916,9 @@ p->next = 0;free(p); p = next; } + if(filters) { + free(filters); + } return 0; } diff -Nru swftools-0.9.0/src/png2swf.1 swftools-0.9.2/src/png2swf.1 --- swftools-0.9.0/src/png2swf.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/png2swf.1 2012-04-08 17:25:26.000000000 +0000 @@ -1,18 +1,18 @@ -.TH png2swf "1" "April 2009" "png2swf" "swftools" +.TH png2swf "1" "February 2012" "png2swf" "swftools" .SH NAME -png2swf - Takes a number of png files and converts them to a swf movie, one +png2swf \- Takes a number of png files and converts them to a swf movie, one picture per frame. .SH Synopsis -.B png2swf [-X width] [-Y height] [-o file.swf] [-r rate] file1.png [file2.png...] +.B png2swf [\-X width] [\-Y height] [\-o file.swf] [\-r rate] file1.png [file2.png...] .SH DESCRIPTION This tools converts png image files into an SWF animation. It takes any -number of input pictures, and converts them to SWF one-by-one, where every +number of input pictures, and converts them to SWF one\-by\-one, where every converted picture is a seperate frame in the target SWF. .PP The way the -images are encoded in SWF is very similar to PNG (in that a zlib-based, lossless +images are encoded in SWF is very similar to PNG (in that a zlib\-based, lossless compression algorithm is used). .SH OPTIONS diff -Nru swftools-0.9.0/src/png2swf.c swftools-0.9.2/src/png2swf.c --- swftools-0.9.0/src/png2swf.c 2009-04-06 01:50:17.000000000 +0000 +++ swftools-0.9.2/src/png2swf.c 2012-04-08 17:25:26.000000000 +0000 @@ -26,12 +26,13 @@ #include #include "../lib/rfxswf.h" #include "../lib/args.h" +#include "../lib/log.h" #include "../lib/png.h" #define MAX_INPUT_FILES 1024 #define VERBOSE(x) (global.verbose>=x) -struct { +static struct { float framerate; int max_image_width; int max_image_height; @@ -46,7 +47,7 @@ float scale; } global; -struct { +static struct { char *filename; } image[MAX_INPUT_FILES]; @@ -119,7 +120,7 @@ return 0; if(!fread(head, 4, 1, fi)) return 0; - len = REVERSESWAP32(len); + len = BE_32_TO_NATIVE(len); if(destlen) *destlen = len; if(destdata) { if(len) @@ -143,7 +144,7 @@ { unsigned int a; fread(&a,4,1,fi); - return REVERSESWAP32(a); + return BE_32_TO_NATIVE(a); } struct png_header @@ -163,7 +164,7 @@ U8 head2[8]; U8*data; fread(head2,8,1,fi); - if(strncmp(head,head2,4)) + if(strncmp((char*)head,(char*)head2,4)) return 0; while(png_read_chunk(&id, &len, &data, fi)) @@ -173,8 +174,8 @@ if(!strncasecmp(id, "IHDR", 4)) { char a,b,c,f,i; if(len < 8) exit(1); - header->width = REVERSESWAP32(*(U32*)&data[0]); - header->height = REVERSESWAP32(*(U32*)&data[4]); + header->width = BE_32_TO_NATIVE(*(U32*)&data[0]); + header->height = BE_32_TO_NATIVE(*(U32*)&data[4]); a = data[8]; // should be 8 b = data[9]; // should be 3(indexed), 2(rgb), 0(grayscale) or 6(truecolor+alpha) @@ -197,7 +198,7 @@ exit(1); } if(a!=8 && (b==2 || b==6)) { - fprintf(stderr, "Bpp %d in mode %d not supported!\n", a); + fprintf(stderr, "Bpp %d in mode %d not supported!\n", b, a); exit(1); } if(c!=0) { @@ -454,294 +455,6 @@ } -TAG* PNG2Image(TAG*t, U16 id, char*filename, int*width, int*height) -{ - char tagid[4]; - U8*data; - U8*imagedata; - U8*zimagedata=0; - unsigned long int imagedatalen; - unsigned long int zimagedatalen=0; - U8*palette = 0; - int palettelen = 0; - U8*alphapalette = 0; - int alphapalettelen = 0; - struct png_header header; - int bypp; - U8 alphacolor[3]; - int hasalphacolor=0; - int len; - - - FILE *fi; - U8 *scanline; - - if ((fi = fopen(filename, "rb")) == NULL) { - if (VERBOSE(1)) - fprintf(stderr, "Read access failed: %s\n", filename); - return t; - } - - if(!png_read_header(fi, &header)) - return 0; - - *width = header.width; - *height = header.height; - - if(header.mode == 3 || header.mode == 0) bypp = 1; - else - if(header.mode == 2) bypp = 3; - else - if(header.mode == 6) bypp = 4; - else - return 0; - imagedatalen = bypp * header.width * header.height + 65536; - imagedata = malloc(imagedatalen); - - fseek(fi,8,SEEK_SET); - while(!feof(fi)) - { - if(!png_read_chunk(&tagid, &len, &data, fi)) - break; - if(!strncmp(tagid, "IEND", 4)) { - break; - } - if(!strncmp(tagid, "PLTE", 4)) { - palette = data; - palettelen = len/3; - data = 0; //don't free data - if(VERBOSE(2)) - printf("%d colors in palette\n", palettelen); - } - if(!strncmp(tagid, "tRNS", 4)) { - if(header.mode == 3) { - alphapalette = data; - alphapalettelen = len; - data = 0; //don't free data - if(VERBOSE(2)) - printf("found %d alpha colors\n", alphapalettelen); - } else if(header.mode == 0 || header.mode == 2) { - int t; - if(header.mode == 2) { // palette or grayscale? - alphacolor[0] = data[1]; - alphacolor[1] = data[3]; - alphacolor[2] = data[5]; - } else { - alphacolor[0] = alphacolor[1] = alphacolor[2] = data[1]; - } - if(VERBOSE(2)) - printf("found alpha color: %02x%02x%02x\n", alphacolor[0], alphacolor[1], alphacolor[2]); - hasalphacolor = 1; - } else { - if(VERBOSE(2)) - printf("ignoring tRNS %d entry (%d bytes)\n", header.mode, len); - } - } - if(!strncmp(tagid, "IDAT", 4)) { - if(!zimagedata) { - zimagedatalen = len; - zimagedata = malloc(len); - memcpy(zimagedata,data,len); - } else { - zimagedata = realloc(zimagedata, zimagedatalen+len); - memcpy(&zimagedata[zimagedatalen], data, len); - zimagedatalen += len; - } - } - if(data) - free(data); - } - - if(!zimagedata || uncompress(imagedata, &imagedatalen, zimagedata, zimagedatalen) != Z_OK) { - fprintf(stderr, "Couldn't uncompress IDAT chunk (%d bytes) in %s!\n", imagedatalen, filename); - if(zimagedata) - free(zimagedata); - return 0; - } - free(zimagedata); - - if(alphapalette || hasalphacolor) - t = swf_InsertTag(t, ST_DEFINEBITSLOSSLESS2); - else - t = swf_InsertTag(t, ST_DEFINEBITSLOSSLESS); - - swf_SetU16(t, id); // id - if(header.mode == 2 || header.mode == 6) { - U8*data2 = malloc(header.width*header.height*4); - int i,s=0; - int x,y; - int pos=0; - int opaque=0; - int transparent=0; - int semitransparent=0; - /* in case for mode 2, the following also performs 24->32 bit conversion */ - unsigned char* firstline = malloc(header.width*4); - - for(y=0;yid = ST_DEFINEBITSLOSSLESS2; - } - } - swf_SetLosslessBits(t, header.width, header.height, data2, BMF_32BIT); - free(data2); - } else if(header.mode == 0 || header.mode == 3) { - RGBA*rgba; - int swf_width = BYTES_PER_SCANLINE(header.width); - U8*data2 = malloc(swf_width*header.height); - U8*tmpline = malloc(header.width); - int i,x,y; - int pos=0; - if(header.mode == 3) { // palette or grayscale? - rgba = (RGBA*)malloc(palettelen*sizeof(RGBA)); - if(!palette) { - fprintf(stderr, "Error: No palette found!\n"); - exit(1); - } - /* 24->32 bit conversion */ - for(i=0;i>header.bpp); - palettelen = 1<>(16-header.bpp-(s&7)))&v; - s+=header.bpp; - } - src = tmpline; - pos+=(header.width*header.bpp+7)/8; - } - - if(!y) { - memset(data2,0,swf_width); - old = &data2[y*swf_width]; - } else { - old = &data2[(y-1)*swf_width]; - } - applyfilter1(mode, src, old, dest, header.width); - } - swf_SetLosslessBitsIndexed(t, header.width, header.height, data2, rgba, palettelen); - free(tmpline); - free(rgba); - free(data2); - } - fclose(fi); - return t; -} - TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) { SHAPE *s; @@ -749,7 +462,7 @@ MATRIX m; int fs; - int width=0, height=0; + unsigned width=0, height=0; #ifndef HAVE_JPEGLIB if(global.mkjpeg) { @@ -760,7 +473,7 @@ if(global.mkjpeg) { #ifdef HAVE_JPEGLIB RGBA*data = 0; - getPNG(sname, &width, &height, (unsigned char**)&data); + png_load(sname, &width, &height, (unsigned char**)&data); if(!data) exit(1); if(swf_ImageHasAlpha(data, width, height)) { @@ -773,17 +486,14 @@ swf_SetJPEGBits2(t, width,height,data,global.mkjpeg); } #endif - } else if(1) { + } else { RGBA*data = 0; - getPNG(sname, &width, &height, (unsigned char**)&data); + png_load(sname, &width, &height, (unsigned char**)&data); if(!data) exit(1); t = swf_InsertTag(t, ST_DEFINEBITSLOSSLESS); swf_SetU16(t, id); swf_SetLosslessImage(t, data,width,height); - } else { - /* old code: transform PNG encoding 1:1 to SWF */ - t = PNG2Image(t, id, sname, &width, &height); } t = swf_InsertTag(t, ST_DEFINESHAPE3); @@ -792,8 +502,8 @@ swf_GetMatrix(NULL, &m); m.sx = (int)(20 * 0x10000); m.sy = (int)(20 * 0x10000); - m.tx = -10; - m.ty = -10; + m.tx = 0; + m.ty = 0; fs = swf_ShapeAddBitmapFillStyle(s, &m, id, 1); swf_SetU16(t, id + 1); // id @@ -1080,7 +790,7 @@ global.framerate = 1.0; global.verbose = 1; - global.version = 6; + global.version = 8; global.scale = 1.0; processargs(argc, argv); diff -Nru swftools-0.9.0/src/swfbbox.1 swftools-0.9.2/src/swfbbox.1 --- swftools-0.9.0/src/swfbbox.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/swfbbox.1 2012-04-17 16:12:03.000000000 +0000 @@ -1,9 +1,9 @@ -.TH swfbbox "1" "April 2009" "swfbbox" "swftools" +.TH swfbbox "1" "February 2012" "swfbbox" "swftools" .SH NAME -swfbbox - Tool for playing around with SWF bounding boxes. +swfbbox \- Tool for playing around with SWF bounding boxes. .SH Synopsis -.B swfbbox [-OS] file.swf +.B swfbbox [\-OS] file.swf .SH DESCRIPTION This tool can, among others, recalculate some bounding boxes of SWFs diff -Nru swftools-0.9.0/src/swfbytes.1 swftools-0.9.2/src/swfbytes.1 --- swftools-0.9.0/src/swfbytes.1 2009-02-02 19:05:26.000000000 +0000 +++ swftools-0.9.2/src/swfbytes.1 2012-04-08 17:25:26.000000000 +0000 @@ -1,9 +1,9 @@ -.TH swfbytes "1" "February 2009" "swfbytes" "swftools" +.TH swfbytes "1" "February 2012" "swfbytes" "swftools" .SH NAME -swfbytes - Tool for simplifying the hex-editing of SWF files. +swfbytes \- Tool for simplifying the hex-editing of SWF files. .SH Synopsis -.B swfbytes [-v] file.swf > file.hexdump +.B swfbytes [\-v] file.swf > file.hexdump .PP .B swfbytes file.hexdump diff -Nru swftools-0.9.0/src/swfbytes.c swftools-0.9.2/src/swfbytes.c --- swftools-0.9.0/src/swfbytes.c 2009-02-02 19:05:26.000000000 +0000 +++ swftools-0.9.2/src/swfbytes.c 2010-11-12 19:08:26.000000000 +0000 @@ -29,6 +29,7 @@ static char * filename = 0; static int verbose; +static char* output_filename = "output.swf"; static struct options_t options[] = { {"h", "help"}, @@ -45,6 +46,9 @@ } else if(!strcmp(name, "v")) { verbose++; return 0; + } else if(!strcmp(name, "o")) { + output_filename = val; + return 1; } else { printf("Unknown option: -%s\n", name); return 0; @@ -369,7 +373,7 @@ parseFile(fi, &newswf); fclose(fi); int f; - char*sname = "output.swf"; + char*sname = output_filename; f = open(sname,O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644); if FAILED(swf_WriteSWF(f,&newswf)) { fprintf(stderr, "Unable to write output file: %s\n", sname); diff -Nru swftools-0.9.0/src/swfc.1 swftools-0.9.2/src/swfc.1 --- swftools-0.9.0/src/swfc.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/swfc.1 2012-04-08 17:25:26.000000000 +0000 @@ -1,9 +1,9 @@ -.TH swfc "1" "April 2009" "swfc" "swftools" +.TH swfc "1" "February 2012" "swfc" "swftools" .SH NAME -swfc - compile .sc files to swf. +swfc \- compile .sc files to swf. .SH Synopsis -.B swfc [-o file.swf] file.sc +.B swfc [\-o file.swf] file.sc .SH DESCRIPTION Compiles a file written in sc (SWF Script) into a number of SWF files. diff -Nru swftools-0.9.0/src/swfc.c swftools-0.9.2/src/swfc.c --- swftools-0.9.0/src/swfc.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/src/swfc.c 2012-04-08 17:25:26.000000000 +0000 @@ -48,6 +48,7 @@ static int do_cgi = 0; static int change_sets_all = 0; static int do_exports = 0; +static char * mainclass = ""; static struct options_t options[] = { {"h", "help"}, @@ -183,6 +184,7 @@ TAG*tag; U16 id; char*name; + char*as3name; U16 olddepth; int oldframe; dict_t oldinstances; @@ -225,6 +227,7 @@ FILTERLIST* filters; U16 set; // bits indicating wether a parameter was set in the c_placement function U16 flags; // bits to toggle anything you may care to implement as a toggle + int noinstancename; } parameters_t; typedef struct _character { @@ -424,6 +427,7 @@ p->shear = 0; p->blendmode = 0; p->filters = 0; + p->noinstancename = 0; swf_GetCXForm(0, &p->cxform, 1); } @@ -639,7 +643,7 @@ incrementid(); } -void s_sprite(const char*name, SRECT*scalegrid) +void s_sprite(const char*name, SRECT*scalegrid, const char*as3name) { tag = swf_InsertTag(tag, ST_DEFINESPRITE); swf_SetU16(tag, id); //id @@ -654,6 +658,7 @@ stack[stackpos].tag = tag; stack[stackpos].id = id; stack[stackpos].name = strdup(name); + stack[stackpos].as3name = strdup(as3name); if(scalegrid) { stack[stackpos].scalegrid = *scalegrid; } else { @@ -687,7 +692,7 @@ static button_t mybutton; -void s_button(const char*name) +void s_button(const char*name, const char*as3name) { tag = swf_InsertTag(tag, ST_DEFINEBUTTON2); swf_SetU16(tag, id); //id @@ -700,6 +705,7 @@ stack[stackpos].tag = tag; stack[stackpos].id = id; stack[stackpos].name = strdup(name); + stack[stackpos].as3name = strdup(as3name); stack[stackpos].oldrect = currentrect; memset(¤trect, 0, sizeof(currentrect)); @@ -816,6 +822,14 @@ currentrect = stack[stackpos].oldrect; s_addcharacter(stack[stackpos].name, stack[stackpos].id, stack[stackpos].tag, r); + + if(*stack[stackpos].as3name) { + tag = swf_InsertTag(tag, ST_SYMBOLCLASS); + swf_SetU16(tag, 1); + swf_SetU16(tag, stack[stackpos].id); + swf_SetString(tag, stack[stackpos].as3name); + } + free(stack[stackpos].name); } @@ -865,7 +879,7 @@ int i; for (i = 0; i < f_list->num; i++) { - if (f_list->filter[i]->type == FILTERTYPE_GRADIENTGLOW) + if(f_list->filter[i]->type == FILTERTYPE_GRADIENTGLOW) gradient_free(((FILTER_GRADIENTGLOW*)f_list->filter[i])->gradient); free(f_list->filter[i]); } @@ -912,7 +926,7 @@ if(p->blendmode) { po.blendmode = p->blendmode; } - if (p->filters) + if(p->filters) po.filters = p->filters; swf_SetPlaceObject(tag, &po); } @@ -930,7 +944,7 @@ frame++; while (tag && tag->id != ST_SHOWFRAME) tag = tag->next; - if (parametersChange(i->history, frame)) + if(parametersChange(i->history, frame)) { readParameters(i->history, &p, frame); m = s_instancepos(i->character->size, &p); @@ -940,7 +954,7 @@ else tag = swf_InsertTag(tag, ST_PLACEOBJECT2); setPlacement(tag, 0, i->depth, m, 0, &p, 1); - if (p.filters) + if(p.filters) free_filterlist(p.filters); } else if(tag) { tag = tag->next; @@ -1002,6 +1016,15 @@ instances = stack[stackpos].oldinstances; s_addcharacter(stack[stackpos].name, stack[stackpos].id, stack[stackpos].tag, r); + + if(*stack[stackpos].as3name) { + tag = swf_InsertTag(tag, ST_SYMBOLCLASS); + swf_SetU16(tag, 1); + swf_SetU16(tag, stack[stackpos].id); + swf_SetString(tag, stack[stackpos].as3name); + } + + free(stack[stackpos].name); } @@ -1010,6 +1033,7 @@ int fi; SWF* swf; char*filename; + char*mc=""; dict_foreach_value(&instances, writeInstance); @@ -1035,11 +1059,15 @@ tag = swf_InsertTag(tag, ST_DOABC); void*code = as3_getcode(); swf_WriteABC(tag, code); - if(as3_getglobalclass()) { + if(*mainclass) + mc = mainclass; + else if(as3_getglobalclass()) + mc = as3_getglobalclass(); + if(*mc) { tag = swf_InsertTag(tag, ST_SYMBOLCLASS); swf_SetU16(tag, 1); swf_SetU16(tag, 0); - swf_SetString(tag, as3_getglobalclass()); + swf_SetString(tag, mc); } else { warning("no global public MovieClip subclass"); } @@ -1148,7 +1176,7 @@ if(name[0] == '#') { parseColor2(name, &color); return swf_ShapeAddSolidFillStyle(s, &color); - } else if ((texture = dict_lookup(&textures, name))) { + } else if((texture = dict_lookup(&textures, name))) { return swf_ShapeAddFillStyle2(s, &texture->fs); } else if((image = dict_lookup(&images, name))) { MATRIX m; @@ -1158,7 +1186,7 @@ m.tx = r->xmin; m.ty = r->ymin; return swf_ShapeAddBitmapFillStyle(s, &m, image->id, 0); - } else if ((gradient = dict_lookup(&gradients, name))) { + } else if((gradient = dict_lookup(&gradients, name))) { SRECT r2; MATRIX rot,m; double ccos,csin; @@ -1178,7 +1206,7 @@ m.tx = r->xmin + (r->xmax - r->xmin)/2; m.ty = r->ymin + (r->ymax - r->ymin)/2; return swf_ShapeAddGradientFillStyle(s, &m, &gradient->gradient, gradient->radial); - } else if (parseColor2(name, &color)) { + } else if(parseColor2(name, &color)) { return swf_ShapeAddSolidFillStyle(s, &color); } else { syntaxerror("not a color/fillstyle: %s", name); @@ -1381,6 +1409,24 @@ incrementid(); } +void s_video(const char *name, int width, int height) +{ + SRECT r; + + memset(&r, 0, sizeof(r)); + + tag = swf_InsertTag(tag, ST_DEFINEVIDEOSTREAM); + swf_SetU16(tag, id); + swf_SetU16(tag, 0); // numframes + swf_SetU16(tag, width); + swf_SetU16(tag, height); + swf_SetU8(tag, 0); // videoflags + swf_SetU8(tag, 0); // codecid + + s_addcharacter(name, id, tag, r); + incrementid(); +} + void s_edittext(const char*name, const char*fontname, int size, int width, int height, const char*text, RGBA*color, int maxlength, const char*variable, int flags, int align) { SWFFONT*font = 0; @@ -1421,7 +1467,7 @@ /* step 1: the bitmap */ SRECT r; int imageID = id; - int width, height; + unsigned width, height; if(!strcmp(type,"jpeg")) { #ifndef HAVE_JPEGLIB warning("no jpeg support compiled in"); @@ -1449,7 +1495,7 @@ RGBA*data = 0; swf_SetU16(tag, imageID); - getPNG(filename, &width, &height, (unsigned char**)&data); + png_load(filename, &width, &height, (unsigned char**)&data); if(!data) { syntaxerror("Image \"%s\" not found, or contains errors", filename); @@ -1545,24 +1591,49 @@ dict_put(&textures, name, texture); } +void s_createfont(const char*name, const char*filename, const char*glyphs, char flashtype) +{ + if(dict_lookup(&fonts, name)) + syntaxerror("font %s defined twice", name); + + SWFFONT* font = swf_LoadFont(filename, flashtype); + if(font == 0) { + warning("Couldn't open font file \"%s\"", filename); + font = (SWFFONT*)malloc(sizeof(SWFFONT)); + memset(font, 0, sizeof(SWFFONT)); + dict_put(&fonts, name, font); + return; + } + swf_FontPrepareForEditText(font); + + if(!strcmp(glyphs, "all")) { + swf_FontUseAll(font); + font->use->glyphs_specified = 1; + } else { + if(!glyphs[0]) { + swf_FontInitUsage(font); + } else { + swf_FontUseUTF8(font, (const U8*)glyphs, 0xffff); + font->use->glyphs_specified = 1; + } + } + dict_put(&fonts, name, font); +} + void s_font(const char*name, const char*filename) { SWFFONT* font; font = dict_lookup(&fonts, name); - if(0) - { - /* fix the layout. Only needed for old fonts */ - int t; - for(t=0;tnumchars;t++) { - font->glyph[t].advance = 0; - } - font->layout = 0; - swf_FontCreateLayout(font); - } font->id = id; swf_FontReduce_swfc(font); - tag = swf_InsertTag(tag, ST_DEFINEFONT2); + + if(font->version>=3 && stack[0].swf->fileVersion < 8) { + warning("flashtype not supported for flash versions 8 and below"); + } + + tag = swf_InsertTag(tag, font->version==3?ST_DEFINEFONT3:ST_DEFINEFONT2); swf_FontSetDefine2(tag, font); + if(do_exports) { tag = swf_InsertTag(tag, ST_EXPORTASSETS); swf_SetU16(tag, 1); @@ -1668,7 +1739,7 @@ incrementid(); - if (samples) + if(samples) free(samples); } @@ -1741,7 +1812,7 @@ FILTERLIST* parseFilters(char* list) { - if (!strcmp(list, "no_filters")) + if(!strcmp(list, "no_filters")) return 0; FILTER* f; FILTERLIST* f_list = (FILTERLIST*)malloc(sizeof(FILTERLIST)); @@ -1751,22 +1822,22 @@ while (f_start) { f_end = strchr(f_start, ','); - if (f_end) + if(f_end) *f_end = '\0'; f = dict_lookup(&filters, f_start); - if (!f) + if(!f) { free(f_list); syntaxerror("unknown filter %s", f_start); } - if (f_list->num == 8) + if(f_list->num == 8) { warning("too many filters in filterlist, no more than 8 please, rest ignored"); break; } f_list->filter[f_list->num] = f; f_list->num++; - if (f_end) + if(f_end) { *f_end = ','; f_start = f_end + 1; @@ -1989,7 +2060,7 @@ return 1; } -void s_includeswf(const char*name, const char*filename) +void s_includeswf(const char*name, const char*filename, const char*as3name) { int f; SWF swf; @@ -1999,12 +2070,12 @@ int level = 0; U16 cutout[] = {ST_SETBACKGROUNDCOLOR, ST_PROTECT, ST_FREEALL, ST_REFLEX}; f = open(filename,O_RDONLY|O_BINARY); - if (f<0) { + if(f<0) { warning("Couldn't open file \"%s\": %s", filename, strerror(errno)); s_box(name, 0, 0, black, 20, 0); return; } - if (swf_ReadSWF(f,&swf)<0) { + if(swf_ReadSWF(f,&swf)<0) { warning("Only SWF files supported in .shape for now. File \"%s\" wasn't SWF.", filename); s_box(name, 0, 0, black, 20, 0); return; @@ -2059,6 +2130,13 @@ swf_FreeTags(&swf); s_addcharacter(name, id, tag, r); + + if(*as3name) { + tag = swf_InsertTag(tag, ST_SYMBOLCLASS); + swf_SetU16(tag, 1); + swf_SetU16(tag, id); + swf_SetString(tag, as3name); + } incrementid(); } SRECT s_getCharBBox(const char*name) @@ -2081,7 +2159,7 @@ instance_t * i = dict_lookup(&instances, name); if(!i) syntaxerror("instance '%s' unknown(10)", name); - if (change_sets_all) + if(change_sets_all) readParameters(i->history, p, currentframe); else *p = i->parameters; @@ -2173,58 +2251,58 @@ } else tag = swf_InsertTag(tag, ST_PLACEOBJECT2); - setPlacement(tag, c->id, currentdepth, m, instance, &p, 0); + setPlacement(tag, c->id, currentdepth, m, p.noinstancename ? NULL : instance, &p, 0); setStartparameters(i, &p, tag); currentdepth++; } void recordChanges(history_t* history, parameters_t p, int changeFunction, interpolation_t* inter) { - if (p.set & SF_X) + if(p.set & SF_X) history_remember(history, "x", currentframe, changeFunction, p.x, inter); - if (p.set & SF_Y) + if(p.set & SF_Y) history_remember(history, "y", currentframe, changeFunction, p.y, inter); - if (p.set & SF_SCALEX) + if(p.set & SF_SCALEX) history_remember(history, "scalex", currentframe, changeFunction, p.scalex, inter); - if (p.set & SF_SCALEY) + if(p.set & SF_SCALEY) history_remember(history, "scaley", currentframe, changeFunction, p.scaley, inter); - if (p.set & SF_CX_R) + if(p.set & SF_CX_R) { history_remember(history, "cxform.r0", currentframe, changeFunction, p.cxform.r0, inter); history_remember(history, "cxform.r1", currentframe, changeFunction, p.cxform.r1, inter); } - if (p.set & SF_CX_G) + if(p.set & SF_CX_G) { history_remember(history, "cxform.g0", currentframe, changeFunction, p.cxform.g0, inter); history_remember(history, "cxform.g1", currentframe, changeFunction, p.cxform.g1, inter); } - if (p.set & SF_CX_B) + if(p.set & SF_CX_B) { history_remember(history, "cxform.b0", currentframe, changeFunction, p.cxform.b0, inter); history_remember(history, "cxform.b1", currentframe, changeFunction, p.cxform.b1, inter); } - if (p.set & SF_CX_A) + if(p.set & SF_CX_A) { history_remember(history, "cxform.a0", currentframe, changeFunction, p.cxform.a0, inter); history_remember(history, "cxform.a1", currentframe, changeFunction, p.cxform.a1, inter); } - if (p.set & SF_ROTATE) + if(p.set & SF_ROTATE) history_remember(history, "rotate", currentframe, changeFunction, p.rotate, inter); - if (p.set & SF_SHEAR) + if(p.set & SF_SHEAR) history_remember(history, "shear", currentframe, changeFunction, p.shear, inter); - if (p.set & SF_PIVOT) + if(p.set & SF_PIVOT) { history_remember(history, "pivot.x", currentframe, changeFunction, p.pivot.x, inter); history_remember(history, "pivot.y", currentframe, changeFunction, p.pivot.y, inter); } - if (p.set & SF_PIN) + if(p.set & SF_PIN) { history_remember(history, "pin.x", currentframe, changeFunction, p.pin.x, inter); history_remember(history, "pin.y", currentframe, changeFunction, p.pin.y, inter); } - if (p.set & SF_BLEND) + if(p.set & SF_BLEND) history_remember(history, "blendmode", currentframe, changeFunction, p.blendmode, inter); - if (p.set & SF_FILTER) + if(p.set & SF_FILTER) history_rememberFilter(history, currentframe, changeFunction, p.filters, inter); } @@ -2255,7 +2333,7 @@ void s_toggle(const char* instance, U16 flagsOn, U16 flagsOff) { instance_t* i = dict_lookup(&instances, instance); - if (!i) + if(!i) syntaxerror("instance %s not known", instance); U16 flags = (U16)history_value(i->history, currentframe, "flags"); flags |= flagsOn; @@ -2426,7 +2504,7 @@ int l = 0; double v; if(defines_initialized) { - l = (int)dict_lookup(&defines, s); + l = PTR_AS_INT(dict_lookup(&defines, s)); } if(l) { return *(int*)&define_values.buffer[l-1]; @@ -2550,9 +2628,9 @@ int parseArc(const char* str) { - if (!strcmp(str, "short")) + if(!strcmp(str, "short")) return 1; - if (!strcmp(str, "long")) + if(!strcmp(str, "long")) return 0; syntaxerror("invalid value for the arc parameter: %s", str); return 1; @@ -2560,9 +2638,9 @@ int parseDir(const char* str) { - if (!strcmp(str, "clockwise")) + if(!strcmp(str, "clockwise")) return 1; - if (!strcmp(str, "counterclockwise")) + if(!strcmp(str, "counterclockwise")) return 0; syntaxerror("invalid value for the dir parameter: %s", str); return 1; @@ -2622,7 +2700,7 @@ return 1; } int len=strlen(str); - U8 alpha = 255; + int alpha = 255; if(strchr(str, '/')) { len = strchr(str, '/')-str; sscanf(str+len+1,"%02x", &alpha); @@ -2788,6 +2866,7 @@ syntaxerror("value \"%s\" not supported for the change-sets-all argument", change_modestr); do_exports=atoi(exportstr); + mainclass=strdup(lu(args, "mainclass")); s_swf(filename, bbox, version, fps, compress, color); return 0; @@ -2824,20 +2903,20 @@ { int i; const char* name = lu(args, "name"); - if (dict_lookup(&interpolations, name)) + if(dict_lookup(&interpolations, name)) syntaxerror("interpolation %s defined twice", name); interpolation_t* inter = (interpolation_t*)malloc(sizeof(interpolation_t)); const char* functionstr = lu(args, "function"); inter->function = 0; for (i = 0; i < sizeof(interpolationFunctions) / sizeof(interpolationFunctions[0]); i++) - if (!strcmp(functionstr,interpolationFunctions[i])) + if(!strcmp(functionstr,interpolationFunctions[i])) { inter->function = i + 1; break; } - if (!inter->function) - syntaxerror("unkown interpolation function %s", functionstr); + if(!inter->function) + syntaxerror("unknown interpolation function %s", functionstr); inter->speed = parseFloat(lu(args, "speed")); inter->amplitude = parseTwip(lu(args, "amplitude")); inter->growth = parseFloat(lu(args, "growth")); @@ -2858,49 +2937,49 @@ p.y = (r.ymin + r.ymax)/2; return p; } - if (!strcmp(name, "bottom-center")) { + if(!strcmp(name, "bottom-center")) { SPOINT p; p.x = (r.xmin + r.xmax)/2; p.y = r.ymax; return p; } - if (!strcmp(name, "top-center")) { + if(!strcmp(name, "top-center")) { SPOINT p; p.x = (r.xmin + r.xmax)/2; p.y = r.ymin; return p; } - if (!strcmp(name, "top-left")) { + if(!strcmp(name, "top-left")) { SPOINT p; p.x = r.xmin; p.y = r.ymin; return p; } - if (!strcmp(name, "top-right")) { + if(!strcmp(name, "top-right")) { SPOINT p; p.x = r.xmax; p.y = r.ymin; return p; } - if (!strcmp(name, "bottom-right")) { + if(!strcmp(name, "bottom-right")) { SPOINT p; p.x = r.xmax; p.y = r.ymax; return p; } - if (!strcmp(name, "bottom-left")) { + if(!strcmp(name, "bottom-left")) { SPOINT p; p.x = r.xmin; p.y = r.ymax; return p; } - if (!strcmp(name, "left-center")) { + if(!strcmp(name, "left-center")) { SPOINT p; p.x = r.xmin; p.y = (r.ymin + r.ymax)/2; return p; } - if (!strcmp(name, "right-center")) { + if(!strcmp(name, "right-center")) { SPOINT p; p.x = r.xmax; p.y = (r.ymin + r.ymax)/2; @@ -2909,7 +2988,7 @@ if(points_initialized) - l = (int)dict_lookup(&points, name); + l = PTR_AS_INT(dict_lookup(&points, name)); if(l==0) { syntaxerror("Invalid point: \"%s\".", name); } @@ -3013,7 +3092,7 @@ static const char* checkFiltername(map_t* args) { const char* name = lu(args, "name"); - if (strchr(name, ',')) + if(strchr(name, ',')) syntaxerror("the comma (,) is used to separate filters in filterlists. Please do not use in filternames."); return name; } @@ -3140,7 +3219,7 @@ } int val = parseTwip(value); int pos = mem_put(&define_values, &val, sizeof(val)); - dict_put(&defines, name, (void*)(pos+1)); + dict_put(&defines, name, INT_AS_PTR(pos + 1)); return 0; } static int c_point(map_t*args) @@ -3156,7 +3235,7 @@ p.x = parseTwip(lu(args, "x")); p.y = parseTwip(lu(args, "y")); pos = mem_put(&mpoints, &p, sizeof(p)); - dict_put(&points, name, (void*)(pos+1)); + dict_put(&points, name, INT_AS_PTR(pos+1)); return 0; } static int c_play(map_t*args) @@ -3257,7 +3336,7 @@ set = set | SF_Y; } - if (change_sets_all) + if(change_sets_all) set = SF_ALL; p.set = set; @@ -3267,8 +3346,8 @@ { const char* interstr = lu(args, "interpolation"); interpolation_t* inter = (interpolation_t*)dict_lookup(&interpolations, interstr); - if (!inter) - syntaxerror("unkown interpolation %s", interstr); + if(!inter) + syntaxerror("unknown interpolation %s", interstr); s_change(instance, p, inter); } break; @@ -3276,8 +3355,8 @@ { const char* interstr = lu(args, "interpolation"); interpolation_t* inter = (interpolation_t*)dict_lookup(&interpolations, interstr); - if (!inter) - syntaxerror("unkown interpolation %s", interstr); + if(!inter) + syntaxerror("unknown interpolation %s", interstr); s_schange(instance, p, inter); } break; @@ -3285,7 +3364,7 @@ { const char* rstr = lu(args, "r"); int radius = parseTwip(rstr); - if (radius <= 0) + if(radius <= 0) syntaxerror("sweep not possible: radius must be greater than 0."); const char* dirstr = lu(args, "dir"); int clockwise = parseDir(dirstr); @@ -3293,8 +3372,8 @@ int short_arc = parseArc(arcstr); const char* interstr = lu(args, "interpolation"); interpolation_t* inter = (interpolation_t*)dict_lookup(&interpolations, interstr); - if (!inter) - syntaxerror("unkown interpolation %s", interstr); + if(!inter) + syntaxerror("unknown interpolation %s", interstr); s_sweep(instance, p, radius, clockwise, short_arc, inter); } break; @@ -3325,6 +3404,7 @@ const char* as = map_lookup(args, "as"); const char* blendmode = lu(args, "blend"); const char* filterstr = lu(args, "filter"); + const char* noinstancenamestr = ""; U8 blend; MULADD r,g,b,a; float oldwidth; @@ -3334,6 +3414,9 @@ parameters_t p; U16 set = 0x0000; + if(type==PT_PUT) + noinstancenamestr = lu(args, "noinstancename"); + if(type==9) { // (?) .rotate or .arcchange pivotstr = lu(args, "pivot"); @@ -3364,7 +3447,7 @@ // put or startclip character = lu(args, "character"); parameters_clear(&p); - } else if (type == PT_BUTTON) { + } else if(type == PT_BUTTON) { character = lu(args, "name"); parameters_clear(&p); // button's show @@ -3372,6 +3455,9 @@ s_getParameters(instance, &p); } + /* noinstancename */ + p.noinstancename = !strcmp(noinstancenamestr, "noinstancename"); + /* x,y position */ if(xstr[0]) { @@ -3547,13 +3633,13 @@ set = set | SF_FILTER; } - if (type == PT_CHANGE && set & (SF_X | SF_Y)) + if(type == PT_CHANGE && set & (SF_X | SF_Y)) warning("As of version 0.8.2 using the .change command to modify an \ object's position on the stage is considered deprecated. Future \ versions may consider x and y parameters for the .change command \ to be illegal; please use the .move command."); - if (change_sets_all) + if(change_sets_all) set = SF_ALL; p.set = set; @@ -3566,8 +3652,8 @@ { const char* interstr = lu(args, "interpolation"); interpolation_t* inter = (interpolation_t*)dict_lookup(&interpolations, interstr); - if (!inter) - syntaxerror("unkown interpolation %s", interstr); + if(!inter) + syntaxerror("unknown interpolation %s", interstr); s_change(instance, p, inter); } break; @@ -3575,8 +3661,8 @@ { const char* interstr = lu(args, "interpolation"); interpolation_t* inter = (interpolation_t*)dict_lookup(&interpolations, interstr); - if (!inter) - syntaxerror("unkown interpolation %s", interstr); + if(!inter) + syntaxerror("unknown interpolation %s", interstr); s_schange(instance, p, inter); } break; @@ -3603,7 +3689,7 @@ } static int c_change(map_t*args) { - if (currentframe == 0) + if(currentframe == 0) warning("change commands in frame 1 will be ignored, please use the put command to set object parameters"); c_placement(args, PT_CHANGE); return 0; @@ -3653,10 +3739,10 @@ const char*instance = lu(args, "name"); U16 flagsOn = 0x0000, flagsOff = 0xffff; const char* alignstr = lu(args, "fixed_alignment"); - if (!strcmp(alignstr, "on")) + if(!strcmp(alignstr, "on")) flagsOn += IF_FIXED_ALIGNMENT; else - if (!strcmp(alignstr, "off")) + if(!strcmp(alignstr, "off")) flagsOff -= IF_FIXED_ALIGNMENT; else syntaxerror("values for toggle must be \"on\" or \"off\". %s is not legal.", alignstr); @@ -3678,12 +3764,13 @@ { const char* name = lu(args, "name"); const char* scalinggrid = lu(args, "scalinggrid"); + const char* as3name = lu(args, "as3name"); if(scalinggrid && *scalinggrid) { SRECT r = parseBox(scalinggrid); - s_sprite(name, &r); + s_sprite(name, &r, as3name); } else { - s_sprite(name, 0); + s_sprite(name, 0, as3name); } return 0; } @@ -3741,9 +3828,9 @@ if(type==0) { width = parseTwip(lu(args, "width")); height = parseTwip(lu(args, "height")); - } else if (type==1) { + } else if(type==1) { r = parseTwip(lu(args, "r")); - } else if (type==2) { + } else if(type==2) { outline = lu(args, "outline"); } @@ -3776,9 +3863,11 @@ const char*name = lu(args, "name"); const char*filename = lu(args, "filename"); const char*command = lu(args, "commandname"); + const char*as3name = lu(args, "as3name"); + if(!strcmp(command, "shape")) warning("Please use .swf instead of .shape"); - s_includeswf(name, filename); + s_includeswf(name, filename, as3name); return 0; } @@ -3822,6 +3911,15 @@ return 0; } +static int c_video(map_t*args) +{ + const char*name = lu(args, "name"); + int width = parseInt(lu(args, "width")); + int height = parseInt(lu(args, "height")); + s_video(name, width, height); + return 0; +} + static int c_image(map_t*args) { const char*command = lu(args, "commandname"); @@ -3859,7 +3957,8 @@ static int c_egon(map_t*args) {return fakechar(args);} static int c_button(map_t*args) { const char*name = lu(args, "name"); - s_button(name); + const char*as3name = lu(args, "as3name"); + s_button(name, as3name); return 0; } static int current_button_flags = 0; @@ -4035,7 +4134,9 @@ l = ftell(fi); fseek(fi, 0, SEEK_SET); text = rfx_alloc(l+1); - fread(text, l, 1, fi); + int r = fread(text, l, 1, fi); + if(r<1) + syntaxerror("Couldn't read file %s: %s", filename, strerror(errno)); text[l]=0; fclose(fi); return text; @@ -4079,18 +4180,19 @@ command_func_t* func; char*arguments; } arguments[] = -{{"flash", c_flash, "bbox=autocrop background=black version=6 fps=50 name= filename= @compress=default @change-sets-all=no @export=1"}, +{{"flash", c_flash, "bbox=autocrop background=black version=6 fps=50 name= filename= @compress=default @change-sets-all=no @export=1 @mainclass="}, {"frame", c_frame, "n=1 name= @cut=no @anchor=no"}, // "import" type stuff - {"swf", c_swf, "name filename"}, + {"swf", c_swf, "name filename as3name="}, {"shape", c_swf, "name filename"}, {"jpeg", c_image, "name filename quality=80%"}, {"png", c_image, "name filename"}, {"movie", c_movie, "name filename"}, {"sound", c_sound, "name filename"}, - {"font", c_font, "name filename glyphs="}, + {"font", c_font, "name filename glyphs= @flashtype="}, {"soundtrack", c_soundtrack, "filename"}, {"quicktime", c_quicktime, "url"}, + {"video", c_video, "name width= height="}, // generators of primitives @@ -4116,7 +4218,7 @@ {"text", c_text, "name text font size=100% color=white"}, {"edittext", c_edittext, "name font= size=100% width height text="" color=white maxlength=0 variable="" @password=0 @wordwrap=0 @multiline=0 @html=0 @noselect=0 @readonly=0 @border=0 @autosize=0 align="}, {"morphshape", c_morphshape, "name start end"}, - {"button", c_button, "name"}, + {"button", c_button, "name as3name="}, {"show", c_show, "name x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= blend= filter= pivot= pin= shear= rotate= ratio= above= below= as="}, {"on_press", c_on_press, "position=inside"}, {"on_release", c_on_release, "position=anywhere"}, @@ -4131,8 +4233,8 @@ {"previousframe", c_previousframe, "name"}, // object placement tags - {"put", c_put, " x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= blend= filter= pivot= pin= shear= rotate= ratio= above= below="}, - {"startclip", c_startclip, " x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= blend= filter= pivot= pin= shear= rotate= ratio= above= below="}, + {"put", c_put, " x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= blend= filter= pivot= pin= shear= rotate= ratio= above= below= @noinstancename=0"}, + {"startclip", c_startclip, " x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= blend= filter= pivot= pin= shear= rotate= ratio= above= below= @noinstancename=0"}, {"move", c_move, "name x= y= interpolation=linear"}, {"smove", c_smove, "name x= y= interpolation=linear"}, {"sweep", c_sweep, "name x= y= r= dir=counterclockwise arc=short interpolation=linear"}, @@ -4148,7 +4250,7 @@ // commands which start a block //startclip (see above) - {"sprite", c_sprite, "name scalinggrid="}, + {"sprite", c_sprite, "name scalinggrid= as3name="}, {"action", c_action, "filename="}, {"initaction", c_initaction, "name filename="}, @@ -4383,7 +4485,6 @@ { int t; map_t args; - const char* fontfile; int nr = -1; U8* glyphs_to_include; msg(" analyse Command: %s (line %d)", command, line); @@ -4402,57 +4503,26 @@ map_dump(&args, stdout, "\t");fflush(stdout); #endif const char* name = lu(&args, "name"); - if (!strcmp(command, "font")) - { - if(dict_lookup(&fonts, name)) - syntaxerror("font %s defined twice", name); - - SWFFONT* font; - fontfile = lu(&args, "filename"); - font = swf_LoadFont(fontfile); - if(font == 0) { - warning("Couldn't open font file \"%s\"", fontfile); - font = (SWFFONT*)malloc(sizeof(SWFFONT)); - memset(font, 0, sizeof(SWFFONT)); - } - else - { - swf_FontPrepareForEditText(font); - glyphs_to_include = (U8*)lu(&args, "glyphs"); - if (!strcmp(glyphs_to_include, "all")) - { - swf_FontUseAll(font); - font->use->glyphs_specified = 1; - } - else - { - if (strcmp (glyphs_to_include, "")) - { - swf_FontUseUTF8(font, glyphs_to_include); - font->use->glyphs_specified = 1; - } - else - swf_FontInitUsage(font); - } - } - dict_put(&fonts, name, font); - } - else + if(!strcmp(command, "font")) { + const char* fontfile = lu(&args, "filename"); + const char* glyphs = lu(&args, "glyphs"); + const char* flashtype = lu(&args, "flashtype"); + s_createfont(name, fontfile, glyphs, flashtype[0]); + } else { SWFFONT* font = dict_lookup(&fonts, lu(&args, "font")); - if (!font) { + if(!font) { //that's ok... it might be an edittext with a system font //syntaxerror("font %s is not known in line %d", lu(&args, "font"), line); } else - if (font->use && !font->use->glyphs_specified) - { - if (!strcmp(command, "edittext")) + if(font->use && !font->use->glyphs_specified) { + if(!strcmp(command, "edittext")) { swf_FontUseAll(font); font->use->glyphs_specified = 1; } else - swf_FontUseUTF8(font, (U8*)lu(&args, "text")); + swf_FontUseUTF8(font, (U8*)lu(&args, "text"), 0xffff); } } map_clear(&args); @@ -4475,7 +4545,7 @@ readToken(); if(type != COMMAND) syntaxerror("command expected"); - if (strstr(fontRelated, text)) + if(strstr(fontRelated, text)) analyseArgumentsForCommand(text); else if(strcmp(text, "end")) diff -Nru swftools-0.9.0/src/swfc-history.c swftools-0.9.2/src/swfc-history.c --- swftools-0.9.0/src/swfc-history.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/swfc-history.c 2012-04-08 17:25:26.000000000 +0000 @@ -321,8 +321,11 @@ *list1 = '\0'; for (i = 0; i < first->value->num; i++) { - newList = (char*)malloc(strlen(list1) + strlen(filtername[first->value->filter[i]->type]) + 2); - newList = strcat(strcat(list1, "+"), filtername[first->value->filter[i]->type]); + char*filter = filtername[first->value->filter[i]->type]; + newList = (char*)malloc(strlen(list1) + strlen(filter) + 2); + strcpy(newList, list1); + strcat(newList, "+"); + strcat(newList, filtername[first->value->filter[i]->type]); free(list1); list1 = newList; } @@ -330,8 +333,11 @@ *list2 = '\0'; for (i = 0; i < newChange->value->num; i++) { - newList = (char*)malloc(strlen(list1) + strlen(filtername[newChange->value->filter[i]->type]) + 2); - newList = strcat(strcat(list2, "+"), filtername[newChange->value->filter[i]->type]); + char*filter = filtername[newChange->value->filter[i]->type]; + newList = (char*)malloc(strlen(list2) + strlen(filter) + 2); + strcpy(newList, list2); + strcat(newList, "+"); + strcat(newList, filter); free(list2); list2 = newList; } diff -Nru swftools-0.9.0/src/swfcombine.1 swftools-0.9.2/src/swfcombine.1 --- swftools-0.9.0/src/swfcombine.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/swfcombine.1 2012-04-17 16:12:03.000000000 +0000 @@ -1,15 +1,15 @@ -.TH swfcombine "1" "April 2009" "swfcombine" "swftools" +.TH swfcombine "1" "February 2012" "swfcombine" "swftools" .SH NAME -swfcombine - a tool for combining swf (flash) files +swfcombine \- a tool for combining swf (flash) files .SH Synopsis -.B swfcombine [-rXYomlcv] [-f] masterfile [-xysf] [(name1|#id1)=]slavefile1 .. [-xysf] [(nameN|#idN)=]slavefileN +.B swfcombine [\-rXYomlcv] [\-f] masterfile [\-xysf] [(name1|#id1)=]slavefile1 .. [\-xysf] [(nameN|#idN)=]slavefileN .PP -.B swfcombine [-rXYomv] --stack[1] [-xysf] [(name1|#id1)=]slavefile1 .. [-xysf] [(nameN|#idN)=]slavefileN +.B swfcombine [\-rXYomv] \--stack[1] [\-xysf] [(name1|#id1)=]slavefile1 .. [\-xysf] [(nameN|#idN)=]slavefileN .PP -.B swfcombine [-rXYov] --cat [-xysf] [(name1|#id1)=]slavefile1 .. [-xysf] [(nameN|#idN)=]slavefileN +.B swfcombine [\-rXYov] \--cat [\-xysf] [(name1|#id1)=]slavefile1 .. [\-xysf] [(nameN|#idN)=]slavefileN .PP -.B swfcombine [-rXYomlcv] --dummy [-xys] [file] +.B swfcombine [\-rXYomlcv] \--dummy [\-xys] [file] .SH DESCRIPTION Take two or more SWF files, and combine them into a new SWF. SWFs can either @@ -49,6 +49,9 @@ \fB\-v\fR, \fB\-\-verbose\fR Be verbose. Use more than one -v for greater effect .TP +\fB\-F\fR, \fB\-\-flashversion\fR + Set the flash version of the output file. +.TP \fB\-d\fR, \fB\-\-dummy\fR Don't require the presence of slave objects. Usually used together with \fB\-X\fR, \fB\-Y\fR or \fB\-r\fR. .TP @@ -77,6 +80,12 @@ \fB\-N\fR, \fB\-\-local-with-networking\fR Make output file "local-with-networking" .TP +\fB\-G\fR, \fB\-\-hardware-gpu\fR + Set the "use hardware gpu" bit in the output file +.TP +\fB\-B\fR, \fB\-\-accelerated-blit\fR + Set the "use accelerated blit" bit in the output file +.TP \fB\-L\fR, \fB\-\-local-with-filesystem\fR Make output file "local-with-filesystem" .TP diff -Nru swftools-0.9.0/src/swfcombine.c swftools-0.9.2/src/swfcombine.c --- swftools-0.9.0/src/swfcombine.c 2009-02-18 15:27:46.000000000 +0000 +++ swftools-0.9.2/src/swfcombine.c 2012-04-08 17:25:26.000000000 +0000 @@ -42,11 +42,14 @@ char isframe; char local_with_networking; char local_with_filesystem; + char accelerated_blit; + char hardware_gpu; int loglevel; int sizex; char hassizex; int sizey; char hassizey; + int flashversion; int framerate; int movex; int movey; @@ -125,6 +128,11 @@ config.isframe = 1; return 0; } + else if (!strcmp(name, "F")) + { + config.flashversion = atoi(val); + return 1; + } else if (!strcmp(name, "d")) { config.dummy = 1; @@ -183,6 +191,16 @@ config.local_with_filesystem = 1; return 0; } + else if (!strcmp(name, "B")) + { + config.accelerated_blit = 1; + return 0; + } + else if (!strcmp(name, "G")) + { + config.hardware_gpu = 1; + return 0; + } else if (!strcmp(name, "t") || !strcmp(name, "T")) { if(master_filename) { @@ -216,6 +234,7 @@ {"l", "overlay"}, {"c", "clip"}, {"v", "verbose"}, +{"F", "flashversion"}, {"d", "dummy"}, {"f", "frame"}, {"x", "movex"}, @@ -225,6 +244,8 @@ {"X", "width"}, {"Y", "height"}, {"N", "local-with-networking"}, +{"G", "hardware-gpu"}, +{"B", "accelerated-blit"}, {"L", "local-with-filesystem"}, {"z", "zlib"}, {0,0} @@ -295,6 +316,7 @@ printf("-l , --overlay Don't remove any master objects, only overlay new objects\n"); printf("-c , --clip Clip the slave objects by the corresponding master objects\n"); printf("-v , --verbose Be verbose. Use more than one -v for greater effect \n"); + printf("-F , --flashversion Set the flash version of the output file.\n"); printf("-d , --dummy Don't require slave objects (for changing movie attributes)\n"); printf("-f , --frame The following identifier is a frame or framelabel, not an id or objectname\n"); printf("-x , --movex x Adjust position of slave by pixels\n"); @@ -304,6 +326,8 @@ printf("-X , --width Force movie bbox width to (default: use master width (not with -t))\n"); printf("-Y , --height Force movie bbox height to (default: use master height (not with -t))\n"); printf("-N , --local-with-networking Make output file \"local-with-networking\"\n"); + printf("-G , --hardware-gpu Set the \"use hardware gpu\" bit in the output file\n"); + printf("-B , --accelerated-blit Set the \"use accelerated blit\" bit in the output file\n"); printf("-L , --local-with-filesystem Make output file \"local-with-filesystem\"\n"); printf("-z , --zlib Enable Flash 6 (MX) Zlib Compression\n"); printf("\n"); @@ -875,6 +899,8 @@ swf->movieSize.ymax = swf->movieSize.ymin + config.sizey; } + if(config.flashversion) + swf->fileVersion = config.flashversion; } void catcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) @@ -887,6 +913,8 @@ msg(" Can't combine --cat and --frame"); exit(1); } + if(config.flashversion) + master->fileVersion = config.flashversion; tag = master->firstTag; while(tag) @@ -997,6 +1025,29 @@ msg(" Slave file attached to object %d.", defineid); } } + } else if(tag->id == ST_EXPORTASSETS) { + int t; + int num = swf_GetU16(tag); + for(t=0;t Slave file attached to object %d exported as %s.", id, name); + } + } + } else if(tag->id == ST_SYMBOLCLASS) { + /* a symbolclass tag is like a define tag: it defines id 0000 */ + int num = swf_GetU16(tag); + int t; + for(t=0;tid == ST_PLACEOBJECT2) { char * name = swf_GetName(tag); int id = swf_GetPlaceID(tag); @@ -1051,6 +1102,7 @@ } swf_Relocate (slave, masterbitmap); + if(config.merge) swf_RelocateDepth (slave, depthbitmap); jpeg_assert(slave, master); @@ -1280,7 +1332,7 @@ { int ret; fi = open(slave_filename[t], O_RDONLY|O_BINARY); - if(!fi) { + if(fi<0) { msg(" Failed to open %s\n", slave_filename[t]); exit(1); } @@ -1321,6 +1373,10 @@ newswf.fileAttributes &= ~FILEATTRIBUTE_USENETWORK; if(config.local_with_networking) newswf.fileAttributes |= FILEATTRIBUTE_USENETWORK; + if(config.accelerated_blit) + newswf.fileAttributes |= FILEATTRIBUTE_USEACCELERATEDBLIT; + if(config.hardware_gpu) + newswf.fileAttributes |= FILEATTRIBUTE_USEHARDWAREGPU; fi = open(outputname, O_BINARY|O_RDWR|O_TRUNC|O_CREAT, 0777); @@ -1334,6 +1390,7 @@ swf_WriteSWF(fi, &newswf); } close(fi); - return 0; + + return 0; //ok } diff -Nru swftools-0.9.0/src/swfdump.1 swftools-0.9.2/src/swfdump.1 --- swftools-0.9.0/src/swfdump.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/swfdump.1 2012-04-17 16:12:03.000000000 +0000 @@ -1,9 +1,9 @@ -.TH swfdump "1" "April 2009" "swfdump" "swftools" +.TH swfdump "1" "February 2012" "swfdump" "swftools" .SH NAME -swfdump - Display an SWF file's content. +swfdump \- Display an SWF file's content. .SH Synopsis -.B swfdump [-atpdu] file.swf +.B swfdump [\-atpdu] file.swf .SH DESCRIPTION A tool for displaying information about flash files diff -Nru swftools-0.9.0/src/swfdump.c swftools-0.9.2/src/swfdump.c --- swftools-0.9.0/src/swfdump.c 2009-04-12 23:25:32.000000000 +0000 +++ swftools-0.9.2/src/swfdump.c 2012-02-04 15:13:08.000000000 +0000 @@ -39,6 +39,7 @@ #include #include "../lib/rfxswf.h" #include "../lib/args.h" +#include "../lib/utf8.h" static char * filename = 0; @@ -298,7 +299,7 @@ { SWFFONT* font = malloc(sizeof(SWFFONT)); memset(font, 0, sizeof(SWFFONT)); - if(tag->id == ST_DEFINEFONT2) { + if(tag->id == ST_DEFINEFONT2 || tag->id == ST_DEFINEFONT3) { swf_FontExtract_DefineFont2(0, font, tag); } else if(tag->id == ST_DEFINEFONT) { swf_FontExtract_DefineFont(0, font, tag); @@ -323,7 +324,10 @@ int t; for(t=0;tnumchars;t++) { int u = font->glyph2ascii?font->glyph2ascii[t]:-1; - printf("%s== Glyph %d: advance=%d encoding=%d ==\n", prefix, t, font->glyph[t].advance, u); + char ustr[16]; + if(u>=32) sprintf(ustr, " '%c'", u); + else sprintf(ustr, " 0x%02x", u); + printf("%s== Glyph %d: advance=%d encoding=%d%s ==\n", prefix, t, font->glyph[t].advance, u, ustr); SHAPE2* shape = swf_ShapeToShape2(font->glyph[t].shape); SHAPELINE*line = shape->lines; @@ -375,14 +379,16 @@ swf_FontFree(font); } -SWF swf; -int fontnum = 0; -SWFFONT**fonts; +static SWF swf; +static int fontnum = 0; +static SWFFONT**fonts; -void textcallback(void*self, int*glyphs, int*ypos, int nr, int fontid, int fontsize, int startx, int starty, RGBA*color) +void textcallback(void*self, int*glyphs, int*xpos, int nr, int fontid, int fontsize, int startx, int starty, RGBA*color) { int font=-1,t; - printf(" <%2d glyphs in font %2d size %d, color #%02x%02x%02x%02x> ",nr, fontid, fontsize, color->r, color->g, color->b, color->a); + if(nr<1) + return; + printf(" <%2d glyphs in font %04d size %d, color #%02x%02x%02x%02x at %.2f,%.2f> ",nr, fontid, fontsize, color->r, color->g, color->b, color->a, (startx+xpos[0])/20.0, starty/20.0); for(t=0;tid == fontid) { @@ -393,7 +399,7 @@ for(t=0;t=0) { if(glyphs[t] >= fonts[font]->numchars /*glyph is in range*/ || !fonts[font]->glyph2ascii /* font has ascii<->glyph mapping */ @@ -407,18 +413,34 @@ } else { a = glyphs[t]; } - if(a>=32) - printf("%c", a); - else + if(a>=32) { + char* utf8 = getUTF8(a); + printf("%s", utf8); + } else { printf("\\x%x", (int)a); + } } printf("\n"); } -void handleText(TAG*tag) +void handleText(TAG*tag, char*prefix) { printf("\n"); - swf_ParseDefineText(tag,textcallback, 0); + if(placements) { + swf_SetTagPos(tag, 0); + swf_GetU16(tag); + swf_GetRect(tag, 0); + swf_ResetReadBits(tag); + MATRIX m; + swf_GetMatrix(tag, &m); + printf("%s| Matrix\n",prefix); + printf("%s| %5.3f %5.3f %6.2f\n", prefix, m.sx/65536.0, m.r1/65536.0, m.tx/20.0); + printf("%s| %5.3f %5.3f %6.2f\n", prefix, m.r0/65536.0, m.sy/65536.0, m.ty/20.0); + swf_SetTagPos(tag, 0); + } + if(showtext) { + swf_ParseDefineText(tag,textcallback, 0); + } } void handleDefineSound(TAG*tag) @@ -590,7 +612,7 @@ deblock = swf_GetBits(tag, 1); if(deblock) - printf(" deblock ", deblock); + printf(" deblock %d ", deblock); quantizer = swf_GetBits(tag, 5); printf(" quant: %d ", quantizer); } @@ -933,6 +955,28 @@ } } +void handleImportAssets(TAG*tag, char* prefix, int assets2) +{ + int num; + U16 id; + char* url, *name; + int t; + url = swf_GetString(tag); + printf("%sfrom %s\n", prefix, url); + if(assets2) + { + swf_GetU8(tag); // Reserved: Must be 1 + swf_GetU8(tag); // Reserved: Must be 0 + } + num = swf_GetU16(tag); + for(t=0;tpos < tag->len) { + int nr = swf_GetU8(tag); // should be 2 + int t; + if(nr>2) { + printf("*** unsupported multiboxes ***, "); + break; + } + for(t=0;tprev) swf.firstTag = swf.firstTag->prev; + SWFFONT* font = 0; + swf_FontExtract(&swf, id, &font); +#endif + swf_SetTagPos(tag, 3); + while(tag->pos < tag->len) { + printf("%sglyph %d) ", prefix, num); + int nr = swf_GetU8(tag); // should be 2 + int t; + for(t=0;t<2;t++) { + // pos + float v = swf_GetF16(tag); + printf("%f ", v*1024.0); + } + int s; + for(s=0;snumchars) { + SHAPE2* shape = swf_ShapeToShape2(font->glyph[num].shape); + SHAPELINE*line = shape->lines; + while(line) { + if(line->type == moveTo) { + printf("%smoveTo %.2f %.2f\n", prefix, line->x/20.0, line->y/20.0); + } else if(line->type == lineTo) { + printf("%slineTo %.2f %.2f\n", prefix, line->x/20.0, line->y/20.0); + } else if(line->type == splineTo) { + printf("%ssplineTo (%.2f %.2f) %.2f %.2f\n", prefix, + line->sx/20.0, line->sy/20.0, + line->x/20.0, line->y/20.0 + ); + } + line = line->next; + } + swf_Shape2Free(shape); + free(shape); + } + if(num==font->numchars-1) break; +#endif + num++; + } +} + + void dumperror(const char* format, ...) { char buf[1024]; @@ -1106,7 +1242,7 @@ " PLAY=\"true\" ALIGN=\"\" LOOP=\"true\" QUALITY=\"high\"\n" " TYPE=\"application/x-shockwave-flash\"\n" " ALLOWSCRIPTACCESS=\"always\"\n" - " PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">\n" + " PLUGINSPAGE=\"http://get.adobe.com/flashplayer/\">\n" " \n" "\n", xsize, ysize, fileversions[swf.fileVersion], filename, filename, xsize, ysize); @@ -1121,7 +1257,7 @@ else printf("\n"); } - printf("[HEADER] File size: %ld%s\n", swf.fileSize, swf.compressed?" (Depacked)":""); + printf("[HEADER] File size: %d%s\n", swf.fileSize, swf.compressed?" (Depacked)":""); printf("[HEADER] Frame rate: %f\n",swf.frameRate/256.0); printf("[HEADER] Frame count: %d\n",swf.frameCount); printf("[HEADER] Movie width: %.2f",(swf.movieSize.xmax-swf.movieSize.xmin)/20.0); @@ -1158,25 +1294,12 @@ } if(cumulative) { filepos += tag->len; - printf("[%03x] %9ld %9ld %s%s", tag->id, tag->len, filepos, prefix, swf_TagGetName(tag)); + printf("[%03x] %9d %9d %s%s", tag->id, tag->len, filepos, prefix, swf_TagGetName(tag)); } else { - printf("[%03x] %9ld %s%s", tag->id, tag->len, prefix, swf_TagGetName(tag)); + printf("[%03x] %9d %s%s", tag->id, tag->len, prefix, swf_TagGetName(tag)); } - if(swf_isDefiningTag(tag)) { - U16 id = swf_GetDefineID(tag); - printf(" defines id %04d", id); - if(idtab[id]) - dumperror("Id %04d is defined more than once.", id); - idtab[id] = 1; - } - else if(swf_isPseudoDefiningTag(tag)) { - U16 id = swf_GetDefineID(tag); - printf(" adds information to id %04d", id); - if(!idtab[id]) - dumperror("Id %04d is not yet defined.\n", id); - } - else if(tag->id == ST_PLACEOBJECT) { + if(tag->id == ST_PLACEOBJECT) { printf(" places id %04d at depth %04x", swf_GetPlaceID(tag), swf_GetDepth(tag)); if(swf_GetName(tag)) printf(" name \"%s\"",swf_GetName(tag)); @@ -1220,10 +1343,12 @@ else if(tag->id == ST_FILEATTRIBUTES) { swf_SetTagPos(tag, 0); U32 flags = swf_GetU32(tag); - if(flags&1) printf(" usenetwork"); - if(flags&8) printf(" as3"); - if(flags&16) printf(" symbolclass"); - if(flags&~(1|8|16)) + if(flags&FILEATTRIBUTE_USENETWORK) printf(" usenetwork"); + if(flags&FILEATTRIBUTE_AS3) printf(" as3"); + if(flags&FILEATTRIBUTE_SYMBOLCLASS) printf(" symbolclass"); + if(flags&FILEATTRIBUTE_USEHARDWAREGPU) printf(" hardware-gpu"); + if(flags&FILEATTRIBUTE_USEACCELERATEDBLIT) printf(" accelerated-blit"); + if(flags&~(1|8|16|32|64)) printf(" flags=%02x", flags); } else if(tag->id == ST_DOABC) { @@ -1263,7 +1388,7 @@ } } else if(tag->id == ST_FRAMELABEL) { - int l = strlen(tag->data); + int l = strlen((char*)tag->data); printf(" \"%s\"", tag->data); if((l+1) < tag->len) { printf(" has %d extra bytes", tag->len-1-l); @@ -1275,8 +1400,8 @@ dumperror("Frame %d has more than one label", issprite?spriteframe:mainframe); } - if(issprite) spriteframelabel = tag->data; - else framelabel = tag->data; + if(issprite) spriteframelabel = (char*)tag->data; + else framelabel = (char*)tag->data; } else if(tag->id == ST_SHOWFRAME) { char*label = issprite?spriteframelabel:framelabel; @@ -1313,6 +1438,9 @@ printf(" %s", swf_GetString(tag)); } } + else if(tag->id == ST_DEFINEFONTALIGNZONES) { + handleFontAlign1(tag); + } else if(tag->id == ST_CSMTEXTSETTINGS) { U16 id = swf_GetU16(tag); U8 flags = swf_GetU8(tag); @@ -1333,6 +1461,19 @@ printf("s=%.2f,t=%.2f)", thickness, sharpness); swf_GetU8(tag); } + else if(swf_isDefiningTag(tag)) { + U16 id = swf_GetDefineID(tag); + printf(" defines id %04d", id); + if(idtab[id]) + dumperror("Id %04d is defined more than once.", id); + idtab[id] = 1; + } + else if(swf_isPseudoDefiningTag(tag)) { + U16 id = swf_GetDefineID(tag); + printf(" adds information to id %04d", id); + if(!idtab[id]) + dumperror("Id %04d is not yet defined.\n", id); + } if(tag->id == ST_DEFINEBITSLOSSLESS || tag->id == ST_DEFINEBITSLOSSLESS2) { @@ -1361,10 +1502,7 @@ printf(" URL: %s\n", s); } else if(tag->id == ST_DEFINETEXT || tag->id == ST_DEFINETEXT2) { - if(showtext) - handleText(tag); - else - printf("\n"); + handleText(tag, myprefix); } else if(tag->id == ST_DEFINESCALINGGRID) { U16 id = swf_GetU16(tag); @@ -1409,6 +1547,9 @@ if(tag->len) dumperror("End Tag not empty"); } + else if(tag->id == ST_IMPORTASSETS || tag->id == ST_IMPORTASSETS2) { + handleImportAssets(tag, myprefix, tag->id==ST_IMPORTASSETS2?1:0); + } else if(tag->id == ST_EXPORTASSETS || tag->id == ST_SYMBOLCLASS) { handleExportAssets(tag, myprefix); } @@ -1450,6 +1591,9 @@ else if(tag->id == ST_PLACEOBJECT2 || tag->id == ST_PLACEOBJECT3) { handlePlaceObject23(tag, myprefix); } + else if(tag->id == ST_DEFINEFONTALIGNZONES) { + handleFontAlign2(tag, myprefix); + } else if(tag->id == ST_DEFINEFONTNAME) { swf_SetTagPos(tag, 0); swf_GetU16(tag); //id diff -Nru swftools-0.9.0/src/swfextract.c swftools-0.9.2/src/swfextract.c --- swftools-0.9.0/src/swfextract.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/swfextract.c 2010-11-12 19:08:24.000000000 +0000 @@ -25,6 +25,8 @@ #include "../lib/rfxswf.h" #include "../lib/args.h" #include "../lib/log.h" +#include "../lib/jpeg.h" +#include "../lib/png.h" #ifdef HAVE_ZLIB_H #ifdef HAVE_LIBZ #include "zlib.h" @@ -42,6 +44,9 @@ char* extractfontids = 0; char* extractpngids = 0; char* extractsoundids = 0; +char* extractmp3ids = 0; +char* extractbinaryids = 0; +char* extractanyids = 0; char extractmp3 = 0; char* extractname = 0; @@ -51,6 +56,7 @@ char movetozero = 0; int numextracts = 0; +char *outputformat = NULL; struct options_t options[] = { @@ -60,14 +66,18 @@ {"i","id"}, {"j","jpegs"}, {"p","pngs"}, + {"a","any"}, {"P","placeobject"}, {"0","movetozero"}, {"m","mp3"}, + {"M","embeddedmp3"}, {"s","sound"}, {"n","name"}, {"f","frame"}, {"F","font"}, {"V","version"}, + {"b","binary"}, + {"O","outputformat"}, {0,0} }; @@ -109,6 +119,15 @@ numextracts++; return 0; } + else if(!strcmp(name, "M")) { + if(extractsoundids) { + fprintf(stderr, "Only one --embeddedmp3 argument is allowed. (Try to use a range, e.g. -M 1,2,3)\n"); + exit(1); + } + numextracts++; + extractmp3ids = val; + return 1; + } else if(!strcmp(name, "j")) { if(extractjpegids) { fprintf(stderr, "Only one --jpegs argument is allowed. (Try to use a range, e.g. -j 1,2,3)\n"); @@ -137,6 +156,15 @@ extractsoundids = val; return 1; } + else if(!strcmp(name, "b")) { + if(extractbinaryids) { + fprintf(stderr, "Only one --binary argument is allowed. (Try to use a range, e.g. -s 1,2,3)\n"); + exit(1); + } + numextracts++; + extractbinaryids = val; + return 1; + } #ifdef _ZLIB_INCLUDED_ else if(!strcmp(name, "p")) { if(extractpngids) { @@ -148,6 +176,11 @@ return 1; } #endif + else if(!strcmp(name, "a")) { + numextracts++; + extractanyids = val; + return 1; + } else if(!strcmp(name, "f")) { numextracts++; extractframes = val; @@ -165,6 +198,10 @@ hollow = 1; return 0; } + else if (!strcmp(name, "O")) { + outputformat = val; + return 1; + } else { printf("Unknown option: -%s\n", name); exit(1); @@ -200,6 +237,7 @@ printf("\n"); printf("Sound extraction:\n"); printf("\t-m , --mp3\t\t\t Extract main mp3 stream\n"); + printf("\t-M , --embeddedmp3\t\t\t Extract embedded mp3 stream(s)\n"); printf("\t-s , --sound ID\t\t\t Extract Sound(s)\n"); } int args_callback_command(char*name,char*val) @@ -212,6 +250,23 @@ return 0; } +void prepare_name(char *buf, size_t len, const char *prefix, + const char *suffix, int idx) { + if (outputformat!=NULL) { + // override default file name formatting + // make sure single-file behavior is not used + numextracts = -1; + // Other parts of codebase use vsnprintf, so I assume snprintf + // is available on all platforms that swftools currently works on. + // We need to check for buffer overflows now that the user is + // supplying the format string. + snprintf(buf,len,outputformat,idx,suffix); + } else { + // use default file name formatting, unchanged + sprintf(buf,"%s%d.%s",prefix,idx,suffix); + } +} + U8 mainr,maing,mainb; /* 1 = used, not expanded, 3 = used, expanded @@ -483,9 +538,31 @@ if(t == 4 && (tag->id == ST_DEFINESOUND)) { show = 1; } - if(t == 5 && (tag->id == ST_DEFINEFONT || tag->id == ST_DEFINEFONT2)) { + if(t == 5 && (tag->id == ST_DEFINEFONT || tag->id == ST_DEFINEFONT2 || tag->id == ST_DEFINEFONT3)) { show = 1; } + if (t== 6 && (tag->id == ST_DEFINEBINARY)) { + show = 1; + } + if (t== 7 && (tag->id == ST_DEFINESPRITE)) { + int wasFolded = swf_IsFolded(tag); + TAG *toFold = tag; + + if(wasFolded) + swf_UnFoldSprite(tag); + + while(tag->id != ST_END) { + tag = tag->next; + if(tag->id == ST_SOUNDSTREAMHEAD || tag->id == ST_SOUNDSTREAMHEAD2) { + show = 1; + break; + } + } + + if(wasFolded) + swf_FoldSprite(toFold); + } + return show; } @@ -495,8 +572,8 @@ char first; int t; int frame = 0; - char*names[] = {"Shape", "MovieClip", "JPEG", "PNG", "Sound", "Font"}; - char*options[] = {"-i", "-i", "-j", "-p", "-s", "-F"}; + char*names[] = {"Shape", "MovieClip", "JPEG", "PNG", "Sound", "Font", "Binary", "Embedded MP3"}; + char*options[] = {"-i", "-i", "-j", "-p", "-s", "-F","-b","-M"}; int mp3=0; printf("Objects in file %s:\n",filename); swf_FoldAll(swf); @@ -567,7 +644,7 @@ printf(" [-m] 1 MP3 Soundstream\n"); } -void handlefont(SWF*swf, TAG*tag) +int handlefont(SWF*swf, TAG*tag) { SWFFONT* f=0; U16 id; @@ -576,21 +653,22 @@ int t; id = swf_GetDefineID(tag); - sprintf(name, "font%d.swf", id); + prepare_name(name, sizeof(name), "font", "swf", id); if(numextracts==1) { filename = destfilename; } swf_FontExtract(swf, id, &f); if(!f) { - printf("Couldn't extract font %d\n", id); - return; + if (!extractanyids) { + printf("Couldn't extract font %d\n", id); + } + return 0; } - if(!f->layout) - swf_FontCreateLayout(f); swf_WriteFont(f, filename); swf_FontFree(f); + return 1; } static char has_jpegtables=0; @@ -632,18 +710,28 @@ } /* extract jpeg data out of a tag */ -void handlejpeg(TAG*tag) +int handlejpeg(TAG*tag) { char name[80]; char*filename = name; FILE*fi; - - sprintf(name, "pic%d.jpg", GET16(tag->data)); - if(numextracts==1) { - filename = destfilename; - if(!strcmp(filename,"output.swf")) - filename = "output.jpg"; + + if(tag->id != ST_DEFINEBITSJPEG3) { + prepare_name(name, sizeof(name), "pic", "jpg", GET16(tag->data)); + if(numextracts==1) { + filename = destfilename; + if(!strcmp(filename,"output.swf")) + filename = "output.jpg"; + } + } else { + prepare_name(name, sizeof(name), "pic", "png", GET16(tag->data)); + if(numextracts==1) { + filename = destfilename; + if(!strcmp(filename,"output.swf")) + filename = "output.png"; + } } + /* swf jpeg images have two streams, which both start with ff d8 and end with ff d9. The following code handles sorting the middle bytes out, so that one stream remains */ @@ -674,24 +762,44 @@ } else if(tag->id == ST_DEFINEBITSJPEG3 && tag->len>6) { U32 end = GET32(&tag->data[2])+6; - int pos = findjpegboundary(&tag->data[6], tag->len-6); - if(pos<0) { - fi = save_fopen(filename, "wb"); - fwrite(&tag->data[6], end-6, 1, fi); - fclose(fi); - } else { - pos+=6; - fi = save_fopen(filename, "wb"); - fwrite(&tag->data[6], pos-6, 1, fi); - fwrite(&tag->data[pos+4], end-(pos+4), 1, fi); - fclose(fi); - } + int pos = findjpegboundary(&tag->data[6], end); + if(end >= tag->len) { + msg(" zlib data out of bounds in definebitsjpeg3"); + return 0; + } + if(pos) { + /* TODO: do we actually need this? */ + memmove(&tag->data[pos], &tag->data[pos+4], end-(pos+4)); + } + unsigned char*image; + unsigned width=0, height=0; + jpeg_load_from_mem(&tag->data[6], end-6, &image, &width, &height); + + uLongf datalen = width*height; + Bytef *data = malloc(datalen); + + int error = uncompress(data, &datalen, &tag->data[end], (uLong)(tag->len - end)); + if(error != Z_OK) { + fprintf(stderr, "Zlib error %d\n", error); + return 0; + } + int t, size = width*height; + for(t=0;tdata); - fprintf(stderr, "Object %d is not a JPEG picture!\n",id, jpegtables); - exit(1); + if (!extractanyids) { + fprintf(stderr, "Object %d is not a JPEG picture!\n", id); + exit(1); + } + return 0; } + return 1; } #ifdef _ZLIB_INCLUDED_ @@ -722,7 +830,7 @@ static void png_start_chunk(FILE*fi, char*type, int len) { U8 mytype[4]={0,0,0,0}; - U32 mylen = REVERSESWAP32(len); + U32 mylen = BE_32_TO_NATIVE(len); memcpy(mytype,type,strlen(type)); fwrite(&mylen, 4, 1, fi); mycrc32=0xffffffff; @@ -746,7 +854,7 @@ } static void png_end_chunk(FILE*fi) { - U32 tmp = REVERSESWAP32((mycrc32^0xffffffff)); + U32 tmp = BE_32_TO_NATIVE((mycrc32^0xffffffff)); fwrite(&tmp,4,1,fi); } @@ -755,7 +863,7 @@ This routine was originally meant to be a one-pager. I just didn't know png is _that_ much fun. :) -mk */ -void handlelossless(TAG*tag) +int handlelossless(TAG*tag) { char name[80]; char*filename = name; @@ -786,8 +894,11 @@ if(tag->id != ST_DEFINEBITSLOSSLESS && tag->id != ST_DEFINEBITSLOSSLESS2) { int id = GET16(tag->data); - fprintf(stderr, "Object %d is not a PNG picture!\n",id); - exit(1); + if (!extractanyids) { + fprintf(stderr, "Object %d is not a PNG picture!\n",id); + exit(1); + } + return 0; } id =swf_GetU16(tag); @@ -800,7 +911,7 @@ fprintf(stderr, "Can't handle 16-bit palette images yet (image %d)\n",id); else fprintf(stderr, "Unknown image type %d in image %d\n", format, id); - return; + return 0; } width = swf_GetU16(tag); height = swf_GetU16(tag); @@ -827,11 +938,11 @@ } while(error == Z_BUF_ERROR); if(error != Z_OK) { fprintf(stderr, "Zlib error %d (image %d)\n", error, id); - return; + return 0; } msg(" Uncompressed image is %d bytes (%d colormap)", datalen, (3+alpha)*cols); pos = 0; - datalen2 = datalen; + datalen2 = datalen+16; data2 = malloc(datalen2); palette = (RGBA*)malloc(cols*sizeof(RGBA)); @@ -844,7 +955,7 @@ } } - sprintf(name, "pic%d.png", id); + prepare_name(name, sizeof(name), "pic", "png", id); if(numextracts==1) { filename = destfilename; if(!strcmp(filename,"output.swf")) @@ -863,7 +974,7 @@ png_write_byte(fi,2); //rgb else if(format == 5 && alpha==1) png_write_byte(fi,6); //rgba - else return; + else return 0; png_write_byte(fi,0); //compression mode png_write_byte(fi,0); //filter mode @@ -929,7 +1040,7 @@ if(compress (data2, &datalen2, data3, datalen3) != Z_OK) { fprintf(stderr, "zlib error in pic %d\n", id); - return; + return 0; } msg(" Compressed data is %d bytes", datalen2); png_start_chunk(fi, "IDAT", datalen2); @@ -941,6 +1052,7 @@ free(data); free(data2); free(data3); + return 1; } #endif @@ -977,7 +1089,7 @@ } } -void handledefinesound(TAG*tag) +int handledefinesound(TAG*tag) { U8 flags; U32 samples; @@ -1011,8 +1123,10 @@ } else if(format == 1) { // adpcm printf("Sound is ADPCM, format: %s samples/sec, %d bit, %s\n", rates[rate], bits, stereo?"stereo":"mono"); extension = "adpcm"; + } else { + return 0; } - sprintf(buf, "sound%d.%s", id, extension); + prepare_name(buf, sizeof(buf), "sound", extension, id); if(numextracts==1) { filename = destfilename; if(!strcmp(filename,"output.swf")) { @@ -1023,6 +1137,67 @@ fi = save_fopen(filename, "wb"); fwrite(&tag->data[tag->pos], tag->len - tag->pos, 1, fi); fclose(fi); + return 1; +} + +int handlebinary(TAG*tag) { + FILE *fout = NULL; + char buf[100]; + char *filename = buf; + int len = tag->memsize; + int dx = 6; // offset to binary data + if (tag->id!=ST_DEFINEBINARY) { + if (!extractanyids) { + fprintf(stderr, "Object %d is not a binary entity!\n", + GET16(tag->data)); + } + return 0; + } + prepare_name(buf, sizeof(buf), "binary", "bin", GET16(tag->data)); + if(numextracts==1) { + filename = destfilename; + if(!strcmp(filename,"output.swf")) { + sprintf(buf, "output.bin"); + filename = buf; + } + } + fout = fopen(filename, "wb"); + fwrite(tag->data+dx,len-dx,1,fout); + fclose(fout); + return 1; +} + +int handleembeddedmp3(TAG*tag) { + int wasFolded; + TAG *toFold; + + if (tag->id!=ST_DEFINESPRITE) { + if (!extractanyids) { + fprintf(stderr, "Object %d is not a sprite entity!\n", + GET16(tag->data)); + } + return 0; + } + + wasFolded = swf_IsFolded(tag); + toFold = tag; + + if(wasFolded) + swf_UnFoldSprite(tag); + + while(tag->id != ST_END) { + tag = tag->next; + if(tag->id == ST_SOUNDSTREAMHEAD || + tag->id == ST_SOUNDSTREAMHEAD2 || + tag->id == ST_SOUNDSTREAMBLOCK) { + handlesoundstream(tag); + } + } + + if(wasFolded) + swf_FoldSprite(toFold); + + return 1; } int main (int argc,char ** argv) @@ -1038,7 +1213,8 @@ processargs(argc, argv); if(!extractframes && !extractids && ! extractname && !extractjpegids && !extractpngids - && !extractmp3 && !extractsoundids && !extractfontids) + && !extractmp3 && !extractsoundids && !extractfontids && !extractbinaryids + && !extractanyids && !extractmp3ids) listavailable = 1; if(!originalplaceobjects && movetozero) { @@ -1143,11 +1319,37 @@ if(extractsoundids && is_in_range(id, extractsoundids)) { handledefinesound(tag); } + if(extractmp3ids && is_in_range(id, extractmp3ids)) { + handleembeddedmp3(tag); + } + if(extractbinaryids && is_in_range(id, extractbinaryids)) { + handlebinary(tag); + } #ifdef _ZLIB_INCLUDED_ if(extractpngids && is_in_range(id, extractpngids)) { handlelossless(tag); } #endif + if(extractanyids && is_in_range(id, extractanyids)) { + if (handlefont(&swf,tag)) { + // pass + } else if (handlejpeg(tag)) { + // pass + } else if (handlebinary(tag)) { + // pass +#ifdef _ZLIB_INCLUDED_ + } else if (handlelossless(tag)) { + // pass +#endif + } else if (handledefinesound(tag)) { + // Not sure if sound code checks carefully for type. + // pass + } else if (handleembeddedmp3(tag)) { + // pass + } else { + printf("#%d not processed\n", id); + } + } } else if (tag->id == ST_SETBACKGROUNDCOLOR) { mainr = tag->data[0]; diff -Nru swftools-0.9.0/src/swfrender.c swftools-0.9.2/src/swfrender.c --- swftools-0.9.0/src/swfrender.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/swfrender.c 2010-11-12 19:08:55.000000000 +0000 @@ -128,33 +128,34 @@ fi = open(filename, O_RDONLY|O_BINARY); if (fi<=0) { fprintf(stderr,"Couldn't open %s\n", filename); - perror(argv[1]); + perror(filename); exit(1); } if(swf_ReadSWF(fi,&swf)<0) { fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",argv[1]); close(fi); } + assert(swf.movieSize.xmax > swf.movieSize.xmin && swf.movieSize.ymax > swf.movieSize.ymin); RENDERBUF buf; swf_Render_Init(&buf, 0,0, (swf.movieSize.xmax - swf.movieSize.xmin) / 20, (swf.movieSize.ymax - swf.movieSize.ymin) / 20, 2, 1); swf_RenderSWF(&buf, &swf); RGBA* img = swf_Render(&buf); if(quantize) - writePalettePNG(outputname, (unsigned char*)img, buf.width, buf.height); + png_write_palette_based_2(outputname, (unsigned char*)img, buf.width, buf.height); else - writePNG(outputname, (unsigned char*)img, buf.width, buf.height); + png_write(outputname, (unsigned char*)img, buf.width, buf.height); swf_Render_Delete(&buf); } else { parameter_t*p; gfxsource_t*src = gfxsource_swf_create(); for(p=params;p;p=p->next) { - src->set_parameter(src, p->name, p->value); + src->setparameter(src, p->name, p->value); } gfxdocument_t*doc = src->open(src, filename); for(p=params;p;p=p->next) { - doc->set_parameter(doc, p->name, p->value); + doc->setparameter(doc, p->name, p->value); } if(!doc) { fprintf(stderr,"Couldn't open %s\n", filename); diff -Nru swftools-0.9.0/src/swfstrings.1 swftools-0.9.2/src/swfstrings.1 --- swftools-0.9.0/src/swfstrings.1 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/swfstrings.1 2010-11-12 19:08:25.000000000 +0000 @@ -1,24 +1,35 @@ -.TH swfstrings "1" "October 2001" "swfstrings" "swftools" +.TH swfstrings "1" "August 2009" "swfstrings" "swftools" .SH NAME -swfstrings - a tool for extracting text out of swf files. +swfstrings - Extracts strings from SWF files. + .SH Synopsis -.B swfstrings -[\fIoptions\fR] [\fIfile.swf\fR] +.B swfstrings [options] file.swf + .SH DESCRIPTION -swfstrings extracts text out of DEFINETEXT tags of the .swf file. It also -displays the fonts being used. -.PP -SWF files are animation files which can be displayed in Web Browsers using -the Flash Plugin. +This tool extracts strings from SWF files. It parses SWF font records +and text records and prints unicode-encoded characters to stdout. + .SH OPTIONS .TP -\fB\-h\fR, \fB\-\-help\fR -Print short help message and exit -.\".TP -.\" \fB\-\-version\fR -.\" Print version info and exit - -.SH AUTHOR +\fB\-f\fR, \fB\-\-fonts\fR + Print out font information for each text block +.TP +\fB\-x\fR, \fB\-\-xpos\fR \fIx\fR + Set bounding box x coordinate +.TP +\fB\-y\fR, \fB\-\-ypos\fR \fIy\fR + Set bounding box y coordinate +.TP +\fB\-W\fR, \fB\-\-width\fR \fIwidth\fR + Set bounding box width +.TP +\fB\-H\fR, \fB\-\-height\fR \fIheight\fR + Set bounding box height +.TP +\fB\-V\fR, \fB\-\-version\fR + Print version information and exit +.SH AUTHORS Rainer Böhme - +.TP +Matthias Kramm diff -Nru swftools-0.9.0/src/swfstrings.c swftools-0.9.2/src/swfstrings.c --- swftools-0.9.0/src/swfstrings.c 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/src/swfstrings.c 2012-02-04 15:13:08.000000000 +0000 @@ -23,14 +23,20 @@ #include #include "../lib/rfxswf.h" #include "../lib/args.h" +#include "../lib/utf8.h" -char * filename = 0; - -struct options_t options[] = -{ - {"v","verbose"}, - {"V","version"}, - {0,0} +static char * filename = 0; +static char showfonts = 0; +static int x=0,y=0,w=0,h=0; + +static struct options_t options[] = { +{"f", "fonts"}, +{"x", "xpos"}, +{"y", "ypos"}, +{"W", "width"}, +{"H", "height"}, +{"V", "version"}, +{0,0} }; int args_callback_option(char*name,char*val) @@ -38,6 +44,27 @@ if(!strcmp(name, "V")) { printf("swfstrings - part of %s %s\n", PACKAGE, VERSION); exit(0); + } else if(!strcmp(name, "x")) { + x = atoi(val); + return 1; + } else if(!strcmp(name, "y")) { + y = atoi(val); + return 1; + } else if(!strcmp(name, "W")) { + w = atoi(val); + return 1; + } else if(!strcmp(name, "H")) { + h = atoi(val); + return 1; + } else if(!strcmp(name, "f")) { + showfonts = 1; + return 0; + } else if(!strcmp(name, "V")) { + printf("swfstrings - part of %s %s\n", PACKAGE, VERSION); + exit(0); + } else { + fprintf(stderr, "Unknown option: -%s\n", name); + exit(1); } return 0; } @@ -45,10 +72,18 @@ { return args_long2shortoption(options, name, val); } -void args_callback_usage(char*name) -{ - printf("\nreflex SWF Text Scan Utility\n(w) 2000 by Rainer Boehme \n\nUsage: %s filename.swf\n", name); - exit(0); +void args_callback_usage(char *name) +{ + printf("\n"); + printf("Usage: %s [options] file.swf\n", name); + printf("\n"); + printf("-f , --fonts Print out font information for each text block\n"); + printf("-x , --xpos Set bounding box x coordinate\n"); + printf("-y , --ypos Set bounding box y coordinate\n"); + printf("-W , --width Set bounding box width\n"); + printf("-H , --height Set bounding box height\n"); + printf("-V , --version Print version information and exit\n"); + printf("\n"); } int args_callback_command(char*name,char*val) { @@ -60,49 +95,152 @@ return 0; } -SWF swf; - +static SWF swf; +static int fontnum = 0; +static SWFFONT**fonts = 0; + +void fontcallback1(void*self, U16 id,U8 * name) +{ fontnum++; +} + +void fontcallback2(void*self, U16 id,U8 * name) +{ + swf_FontExtract(&swf,id,&fonts[fontnum]); + fontnum++; +} + + +void textcallback(void*self, int*glyphs, int*advance, int nr, int fontid, int fontsize, int startx, int starty, RGBA*color) +{ + SWFFONT*font = 0; + int t; + for(t=0;tid == fontid) { + font = fonts[t]; + break; + } + } + + if(showfonts) { + if(font) + printf("#\n", fontid, font->name, swf_FontIsBold(font)?" bold":"",swf_FontIsItalic(font)?" italic":""); + printf("#\n", color->r, color->g, color->b, color->a); + printf("#\n", fontsize); + } + + for(t=0;t x+w || yy > y+h) { + /* outside of bounding box */ + ///printf("(%d+%d,%d) -> (%d,%d)\n", startx, advance[t]/20, starty, xx, yy); + if(t==nr-1) return; + else continue; + } + } + + unsigned int a; + int advance = 0; + if(font) { + if(glyphs[t]<0 || glyphs[t] >= font->numchars /*glyph is not in range*/ + || !font->glyph2ascii /* font has ascii<->glyph mapping */ + ) a = glyphs[t]; + else { + if(font->glyph2ascii[glyphs[t]]) + a = font->glyph2ascii[glyphs[t]]; + else + a = glyphs[t]; + } + } else { + a = glyphs[t]; + } + + if(a>=32) { + char* utf8 = getUTF8(a); + printf("%s", utf8); + } else { + printf("\\x%x", (int)a); + } + } + printf("\n"); +} + void fontcallback(void*self,U16 id,U8 * name) { SWFFONT* font; TAG* t; swf_FontExtract(&swf,id,&font); - printf("#\n",id, name,swf_FontIsBold(font)?" bold":"",swf_FontIsItalic(font)?" italic":""); t = swf.firstTag; - while (t) - { - if(swf_isTextTag(t)) - swf_TextPrintDefineText(t,font); - t = swf_NextTag(t); - } - swf_FontFree(font); } +TAG**id2tag = 0; + int main (int argc,char ** argv) -{ int f; +{ + int f; + processargs(argc, argv); + if(!filename) + exit(0); + + f = open(filename,O_RDONLY|O_BINARY); + if (f<0 || swf_ReadSWF(f,&swf)<0) { + fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",filename); + if(f>=0) close(f); + exit(-1); + } + close(f); + + if(x|y|w|h) { + if(!w) w = (swf.movieSize.xmax - swf.movieSize.xmin) / 20; + if(!h) h = (swf.movieSize.ymax - swf.movieSize.ymin) / 20; + } - processargs(argc, argv); - if(!filename) - exit(0); - - f = open(filename,O_RDONLY|O_BINARY); - if (f>=0) - { if FAILED(swf_ReadSWF(f,&swf)) - { fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",filename); - close(f); - } - else - { close(f); - swf_FontEnumerate(&swf,&fontcallback,0); - swf_FreeTags(&swf); - } - } else { - fprintf(stderr,"File not found: %s\n",argv[1]); - } + id2tag = rfx_calloc(sizeof(TAG)*65536); + + fontnum = 0; + swf_FontEnumerate(&swf,&fontcallback1, 0); + fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*)); + fontnum = 0; + swf_FontEnumerate(&swf,&fontcallback2, 0); + + TAG*tag = swf.firstTag; + while (tag) + { + if(swf_isTextTag(tag)) { + id2tag[swf_GetDefineID(tag)] = tag; + } else if(swf_isPlaceTag(tag)) { + SWFPLACEOBJECT po; + swf_SetTagPos(tag, 0); + swf_GetPlaceObject(tag, &po); + if(!po.move && id2tag[po.id]) { + TAG*text = id2tag[po.id]; + swf_SetTagPos(text, 0); + swf_GetU16(text); + swf_GetRect(text, NULL); + swf_ResetReadBits(text); + MATRIX m,tm; + swf_GetMatrix(text, &tm); + swf_MatrixJoin(&m, &po.matrix, &tm); + swf_ParseDefineText(text, textcallback, &m); + } + } + tag = tag->next; + } - return 0; + swf_FreeTags(&swf); + return 0; } diff -Nru swftools-0.9.0/src/ttftool.c swftools-0.9.2/src/ttftool.c --- swftools-0.9.0/src/ttftool.c 1970-01-01 00:00:00.000000000 +0000 +++ swftools-0.9.2/src/ttftool.c 2011-10-14 20:46:10.000000000 +0000 @@ -0,0 +1,100 @@ +/* ttftool.c + + Truetype utility. + + Part of the swftools package. + + Copyright (c) 2010 Matthias Kramm + + 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include "../lib/args.h" +#include "../lib/ttf.h" + +static char * filename = 0; +static char * output = 0; +static int showname = 0; +static int verbose = 0; + +static struct options_t options[] = { +{"n", "name"}, +{"o", "output"}, +{0,0} +}; + +int args_callback_option(char*name,char*val) +{ + if(!strcmp(name, "V")) { + printf("ttftool - part of %s %s\n", PACKAGE, VERSION); + exit(0); + } else if(!strcmp(name, "n")) { + showname = 1; + return 0; + } else if(!strcmp(name, "v")) { + verbose ++; + return 0; + } else if(!strcmp(name, "o")) { + output = strdup(val); + return 1; + } else { + printf("Unknown option: -%s\n", name); + exit(1); + } + return 0; +} +int args_callback_longoption(char*name,char*val) +{ + return args_long2shortoption(options, name, val); +} +void args_callback_usage(char *name) +{ + printf("\n"); + printf("Usage: %s \n", name); + printf("\n"); + printf("-h , --help Print short help message and exit\n"); + printf("-v , --verbose Be verbose. Use more than one -v for greater effect.\n"); + printf("-o , --output Write output to file .\n"); + printf("-V , --version Print version info and exit\n"); + printf("\n"); +} +int args_callback_command(char*name,char*val) +{ + if(filename) { + fprintf(stderr, "Please specify only one font\n"); + exit(1); + } + filename = name; + return 0; +} + + +int main(int argc, char ** argv) +{ + processargs(argc, argv); + ttf_t* font = ttf_open(filename); + if(showname && font->full_name) { + printf("%s\n", font->full_name); + } + if(output) { + ttf_save(font, output); + } + return 0; +} + diff -Nru swftools-0.9.0/src/wav2swf.1 swftools-0.9.2/src/wav2swf.1 --- swftools-0.9.0/src/wav2swf.1 2009-04-17 15:39:51.000000000 +0000 +++ swftools-0.9.2/src/wav2swf.1 2012-04-17 16:12:03.000000000 +0000 @@ -1,9 +1,9 @@ -.TH wav2swf "1" "April 2009" "wav2swf" "swftools" +.TH wav2swf "1" "February 2012" "wav2swf" "swftools" .SH NAME -wav2swf - convert a WAV file to an SWF animation. +wav2swf \- convert a WAV file to an SWF animation. .SH Synopsis -.B wav2swf [-o filename] file.wav +.B wav2swf [\-o filename] file.wav .SH DESCRIPTION Takes a wav file and converts it to a swf movie. diff -Nru swftools-0.9.0/src/wav2swf.c swftools-0.9.2/src/wav2swf.c --- swftools-0.9.0/src/wav2swf.c 2009-02-16 10:34:51.000000000 +0000 +++ swftools-0.9.2/src/wav2swf.c 2010-11-12 19:08:13.000000000 +0000 @@ -113,7 +113,7 @@ samplerate = 44100; else { fprintf(stderr, "Invalid samplerate: %d\n", samplerate); - fprintf(stderr, "Allowed values: 11025, 22050, 44100\n", samplerate); + fprintf(stderr, "Allowed values: 11025, 22050, 44100\n"); exit(1); } return 1; diff -Nru swftools-0.9.0/swfs/Makefile.in swftools-0.9.2/swfs/Makefile.in --- swftools-0.9.0/swfs/Makefile.in 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/swfs/Makefile.in 2012-04-19 11:31:50.000000000 +0000 @@ -41,10 +41,10 @@ $(INSTALL_DATA) ./PreLoaderTemplate.swf $(pkgdatadir)/swfs/PreLoaderTemplate.swf $(INSTALL_DATA) ./tessel_loader.swf $(pkgdatadir)/swfs/tessel_loader.swf $(INSTALL_DATA) ./swft_loader.swf $(pkgdatadir)/swfs/swft_loader.swf - test -f $(pkgdatadir)/swfs/default_viewer.swf || \ - $(LN_S) $(pkgdatadir)/swfs/simple_viewer.swf $(pkgdatadir)/swfs/default_viewer.swf; - test -f $(pkgdatadir)/swfs/default_loader.swf || \ - $(LN_S) $(pkgdatadir)/swfs/tessel_loader.swf $(pkgdatadir)/swfs/default_loader.swf; + rm -f $(pkgdatadir)/swfs/default_viewer.swf -o -L $(pkgdatadir)/swfs/default_viewer.swf + $(LN_S) $(pkgdatadir)/swfs/simple_viewer.swf $(pkgdatadir)/swfs/default_viewer.swf + rm -f $(pkgdatadir)/swfs/default_loader.swf -o -L $(pkgdatadir)/swfs/default_loader.swf + $(LN_S) $(pkgdatadir)/swfs/tessel_loader.swf $(pkgdatadir)/swfs/default_loader.swf uninstall: $(UNINSTALL_DATA) $(pkgdatadir)/swfs/simple_viewer.swf diff -Nru swftools-0.9.0/swfs/rfxview.sc swftools-0.9.2/swfs/rfxview.sc --- swftools-0.9.0/swfs/rfxview.sc 2009-01-27 17:18:37.000000000 +0000 +++ swftools-0.9.2/swfs/rfxview.sc 2010-11-12 18:50:16.000000000 +0000 @@ -240,6 +240,33 @@ .frame 1 +.box background_box line=1 color=#00000030 fill=#00000030 width=800 height=600 +.sprite background + .put background_box x=0 y=0 +.end +.put background + +# horizontal scroll outline +.box hscroll_box line=1 color=#000000 width=800-20 height=10 +.sprite hscroll_outline + .put hscroll_box x=0 y=0 +.end +.put hscroll_outline + +# vertical scroll outline +.box vscroll_box line=1 color=#000000 width=10 height=600-20 +.sprite vscroll_outline + .put vscroll_box x=0 y=0 +.end +.put vscroll_outline + +# content outline +.box content_box width=100 height=100 line=1 color=#000000 +.sprite content_outline + .put content_box x=0 y=0 +.end +.put content_outline + .put p1=plusbutton x=width-25-20 y=20 pin=center .put m1=minusbutton x=width-50-20 y=20 pin=center .put o1=oneonebutton x=width-75-20 y=20 pin=center @@ -248,10 +275,6 @@ .put l1=leftbutton x=width/2-100 y=20 pin=center .put r1=rightbutton x=width/2+100 y=20 pin=center -.sprite background -.end -.put background - .sprite vscrollbar .box vscroll2_shadow line=0 fill=#00000033 width=14 height=100 .sprite vshadow @@ -380,6 +403,27 @@ contentwidth = fullwidth - 40; contentheight = fullheight - 70; + background._width = fullwidth-1; + background._height = fullheight-1; + + // resize/position hscroll outline + hscroll_outline._x = 10; + hscroll_outline._y = fullheight-20; + hscroll_outline._width = fullwidth-40; + hscroll_outline._height = 10; + + // resize/position vscroll outline + vscroll_outline._x = fullwidth-20; + vscroll_outline._y = 40; + vscroll_outline._width = 10; + vscroll_outline._height = fullheight-70; + + // resize/position content outline + content_outline._x = 9; + content_outline._y = 39; + content_outline._width = contentwidth+1; + content_outline._height = contentheight+1; + // move all objects to their proper positions vscrollbar._x = fullwidth-22; hscrollbar._y = fullheight-22; @@ -394,37 +438,6 @@ et._x = fullwidth/2 - (et._width+etmiddle._width+et_total_pages._width)/2; etmiddle._x = fullwidth/2 - (et._width+etmiddle._width+et_total_pages._width)/2 + et._width; et_total_pages._x = fullwidth/2 - (et._width+etmiddle._width+et_total_pages._width)/2 + et._width+etmiddle._width; - - //.box f width=width-40 height=height-40-30 line=0 fill=black - //.box vscroll1 width=10 height=height-40-30 line=1 color=#00000060 fill=grad7 - //.box hscroll1 height=10 width=width-40 line=1 color=#00000060 fill=grad72 - //.put vscroll1 x=width-20 y=40 - //.put hscroll1 x=10 y=height-20 - - // horizontal scrollbar - background.lineStyle(1, 0, 0x60); - background.moveTo(10 ,fullheight-20); - background.lineTo(10 ,fullheight-10); - background.lineTo(10+fullwidth-40,fullheight-10); - background.lineTo(10+fullwidth-40,fullheight-20); - background.lineTo(10 ,fullheight-20); - - // vertical scrollbar - background.moveTo(fullwidth-20 ,40); - background.lineTo(fullwidth-20 ,fullheight-30); - background.lineTo(fullwidth-10 ,fullheight-30); - background.lineTo(fullwidth-10 ,40); - background.lineTo(fullwidth-20 ,40); - - // content area - background.lineStyle(1, 0); - background.startFill(0x000000); - background.moveTo(9, 39); - background.lineTo(fullwidth-30+1, 39); - background.lineTo(fullwidth-30+1, fullheight-29); - background.lineTo(9, fullheight-29); - background.lineTo(9, 39); - background.endFill(); areabutton._xscale = contentwidth; areabutton._yscale = contentheight; @@ -440,9 +453,17 @@ //debugtxt.text = Stage.width+ " x " + Stage.height; //debugtxt.text = zoomtype; - setPageNr = function() { + setPageNr = function(setscroll) { current_pagenumber = pagenr; - viewport.gotoAndStop(pagenr); + viewport.gotoAndStop(pagenr); + if(!setscroll) { + viewport._y = top; + swfpos2scrollbars(); + } + else { + viewport._y = setscroll; + swfpos2scrollbars(); + } }; setNoScrollZoomLevel = function() { @@ -627,6 +648,36 @@ } }; dragrefresh = setInterval(refreshDrag, 20); + + var mouseListener = new Object(); + + mouseListener.onMouseWheel = function(delta) { + divideDelta = delta/Math.abs(delta); + viewport._y = viewport._y + 30*zoom*divideDelta; + swfpos2scrollbars(); + if(viewport._y < top-scrollyrange) { + if(pagenr < viewport._totalframes) { + pageNr = pageNr + 1; + setPageNr(); + } + else { + viewport._y = top-scrollyrange; + swfpos2scrollbars(); + } + } + else if(viewport._y > top) { + if(pagenr > 1) { + pageNr = pageNr - 1; + setPageNr(top-scrollyrange); + } + else { + viewport._y = top; + swfpos2scrollbars(); + } + } + }; + + Mouse.addListener(mouseListener); .end .end diff -Nru swftools-0.9.0/wx/images.py swftools-0.9.2/wx/images.py --- swftools-0.9.0/wx/images.py 2009-04-06 01:50:17.000000000 +0000 +++ swftools-0.9.2/wx/images.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,401 +0,0 @@ -#!/usr/bin/env python -# -# images.py -# -# graphical user interface for pdf2swf: image data -# -# Part of the swftools package. -# -# Copyright (c) 2008,2009 Matthias Kramm -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - -raw_width=100 -raw_height=100 -raw_data="""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffQQQ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"""+\ -"""\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"""+\ -"""\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffJJJ]]]\xc5\xc5\xc5\xc1\xc1\xc1\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc4"""+\ -"""\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc2\xc2\xc2\xc1\xc1\xc1\xc1\xc1\xc1\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4"""+\ -"""\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc1\xc1\xc1\xc4\xc4\xc4\x96\x96\x96"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffHHH\x81\x81\x81\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd0\xd0\xd0"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffIIIxxx\xfc\xfc\xfc\xf8\xf8\xf8\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfc"""+\ -"""\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xf9\xf9\xf9\xc2\xc2\xc2\xb2\xb2\xb2\xaf\xaf\xaf\xe9\xe9\xe9\xfb\xfb\xfb\xfb\xfb\xfb\xfd\xfd\xfd\xfc\xfc\xfc\xfe\xfe\xfe\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfd\xfd\xfd\xfc\xfc\xfc\xfa\xfa\xfa\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfa\xfa\xfa\xfd\xfd\xfd\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc"""+\ -"""\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xf9\xf9\xf9\xfc\xfc\xfc\xc2\xc2\xc2"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffIII\x7a\x7a\x7a\xff\xff\xff\xfb\xfb\xfb\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff"""+\ -"""\xff\xff\xfc\xfc\xfc\xff\xff\xff\xdd\xdd\xdd\x22\x22\x22\x83\x83\x83\x7d\x7d\x7d\xdd\xdd\xdd\xff\xff\xff\xfe\xfe\xfe\xfc\xfc\xfc\xff\xff\xff\xf9\xf9\xf9\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff"""+\ -"""\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4"""+\ -"""\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xf9\xf9\xf9\xfe\xfe\xfeIII\x79\x79\x79\xfe\xfe\xfe\xfa\xfa\xfa\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe"""+\ -"""\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xd8\xd8\xd8TTT\xff\xff\xff\xff\xff\xff\xe3\xe3\xe3gggnnn\xb4\xb4\xb4\xa6\xa6\xa6\x5c\x5c\x5ciii\xe1\xe1\xe1\xf0\xf0\xf0\x7b\x7b\x7bqqqZZZ\xb3\xb3\xb3oooooo\xec\xec\xec\xfc\xfc\xfc\x92\x92\x92WWWooo\xed\xed\xed\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe"""+\ -"""\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc4\xc4\xc4"""+\ -"""\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xf9\xf9\xf9\xfe\xfe\xfeIII\x79\x79\x79\xfe\xfe\xfe\xfa\xfa\xfa\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe"""+\ -"""\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xe0\xe0\xe0%%%lll\x86\x86\x86\xc3\xc3\xc3&&&\xdf\xdf\xdf\xff\xff\xff\xeb\xeb\xeb\xe0\xe0\xe0ccc\x79\x79\x79\xfb\xfb\xfb---\xd6\xd6\xd6\xab\xab\xab,,,\xed\xed\xed\x83\x83\x83\xa4\xa4\xa4\xc2\xc2\xc2III\xf3\xf3\xf3sss\x7e\x7e\x7e\xfe\xfe\xfe\xfc\xfc\xfc\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe"""+\ -"""\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffIII\x7a\x7a\x7a\xff\xff\xff\xfb\xfb\xfb\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff"""+\ -"""\xff\xff\xfd\xfd\xfd\xff\xff\xff\xd9\xd9\xd9LLL\xea\xea\xea\xee\xee\xee\xcb\xcb\xcbccc\xff\xff\xff\xf6\xf6\xf6xxx\x8c\x8c\x8c\x7d\x7d\x7dkkk\xee\xee\xeefff\xff\xff\xff\xcb\xcb\xcbppp\xff\xff\xff\xa4\xa4\xa4\x8d\x8d\x8d\xa2\xa2\xa2@@@\x92\x92\x92\x79\x79\x79\xa5\xa5\xa5\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff"""+\ -"""\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4"""+\ -"""\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xf9\xf9\xf9\xfe\xfe\xfeHHH\x79\x79\x79\xfe\xfe\xfe\xfa\xfa\xfa\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe"""+\ -"""\xfe\xfe\xfc\xfc\xfc\xfe\xfe\xfe\xd5\xd5\xd5JJJ\xff\xff\xff\xff\xff\xff\xcc\xcc\xccWWW\xfd\xfd\xfd\xe4\xe4\xe4FFF\xe9\xe9\xe9mmm___\xed\xed\xed[[[\xfa\xfa\xfa\xc4\xc4\xc4ggg\xfe\xfe\xfe\x9b\x9b\x9b\x86\x86\x86\xd4\xd4\xd4GGG\xdc\xdc\xdc\xe7\xe7\xe7\xe6\xe6\xe6\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe"""+\ -"""\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xfa\xfa\xff\xff\xffIII\x7a\x7a\x7a\xff\xff\xff\xfb\xfb\xfb\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff"""+\ -"""\xff\xff\xfd\xfd\xfd\xff\xff\xff\xe7\xe7\xe7\x93\x93\x93\xfd\xfd\xfd\xfd\xfd\xfd\xe0\xe0\xe0\x9c\x9c\x9c\xfe\xfe\xfe\xfe\xfe\xfe\xa7\xa7\xa7nnn\x8d\x8d\x8d\xa9\xa9\xa9\xf3\xf3\xf3\x9f\x9f\x9f\xfd\xfd\xfd\xdd\xdd\xdd\xa5\xa5\xa5\xfe\xfe\xfe\xc6\xc6\xc6\xaf\xaf\xaf\xff\xff\xff\xa7\xa7\xa7cccooo\xcd\xcd\xcd\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff"""+\ -"""\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4"""+\ -"""\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xf9\xf9\xf9\xfe\xfe\xfeHHH\x79\x79\x79\xfe\xfe\xfe\xfa\xfa\xfa\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe"""+\ -"""\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfd\xfd\xfd\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe"""+\ -"""\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xfd\xfd\xff\xff\xffLLL\x7c\x7c\x7c\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf2\xf2\xf2\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xee\xee\xee\xf3\xf3\xf3<<>>\xfe\xfe\xfefff\xba\xba\xba\xff\xff\xffFFF\xe4\xe4\xe4\xe9\xe9\xe9mmm\xcb\xcb\xcb;;;\xa6\xa6\xa6\x94\x94\x94JJJ\xee\xee\xee\xfe\xfe\xfe\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfeUUU\xe1\xe1\xe1\xff\xff\xff\xfa\xfa\xfaccc\xe2\xe2\xe2\xfc\xfc\xfcooo\x9c\x9c\x9c\xcd\xcd\xcd000\xff\xff\xffiii\xcc\xcc\xcc\xfc\xfc\xfceee\xe9\xe9\xe9\xe0\xe0\xe0mmm\xcf\xcf\xcf;;;\xb8\xb8\xb8\xd0\xd0\xd0\xd8\xd8\xd8\xfa\xfa\xfa\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff]]]\xd4\xd4\xd4\xfc\xfc\xfc\xf5\xf5\xf5iii\xe1\xe1\xe1\xff\xff\xff\x94\x94\x94xxx\x83\x83\x83999\xfc\xfc\xfcooo\xcb\xcb\xcb\xfe\xfe\xfehhh\xe9\xe9\xe9\xe4\xe4\xe4kkk\xfe\xfe\xfe\x88\x88\x88sss\x98\x98\x98\xad\xad\xad\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xe1\xe1\xe1\xf8\xf8\xf8\xfe\xfe\xfe\xfd\xfd\xfd\xe4\xe4\xe4\xf9\xf9\xf9\xfe\xfe\xfe\xfd\xfd\xfd\xbe\xbe\xbe\xd2\xd2\xd2\xe9\xe9\xe9\xfd\xfd\xfd\xe5\xe5\xe5\xf6\xf6\xf6\xfe\xfe\xfe\xe4\xe4\xe4\xfb\xfb\xfb\xfa\xfa\xfa\xe5\xe5\xe5\xfd\xfd\xfd\xff\xff\xff\xc4\xc4\xc4\xb0\xb0\xb0\xdc\xdc\xdc\xff\xff\xff\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfc\xfc\xfc\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfc\xfc\xfc\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x90\x90\x90\xae\xae\xae\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\x5c\x5c\x5c\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x90\x90\x90\xae\xae\xae\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\x5c\x5c\x5c\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe[[[\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc3\xc3\xc3\x00\x00\x00\xc4\xc4\xc4\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x90\x90\x90\xae\xae\xae\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\x5c\x5c\x5c\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\x5c\x5c\x5c\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xc4\xc4\xc4\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xff[[[\xef\xef\xef\xfb\xfb\xfb\xfa\xfa\xfa\xfb\xfb\xfb\xfa\xfa\xfa\xfb\xfb\xfb\xfa\xfa\xfa\xfb\xfb\xfb\xfb\xfb\xfb\xf8\xf8\xf8\xfb\xfb\xfb\xc1\xc1\xc1\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff^^^\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd3\xd3\xd3\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xffLLLooo\x7c\x7c\x7c\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x7a\x79\x79\x79\x7e\x7e\x7eYYY\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfc\xfc\xfc\xff\xff\xffDDDDDDJJJHHHIIIHHHIIIHHHIIIIIIIIIIIIJJJ\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xffYYY\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfeVVV\xee\xee\xee\xfa\xfa\xfa\xf9\xf9\xf9\xfa\xfa\xfa\xf9\xf9\xf9\xfa\xfa\xfa\xf9\xf9\xf9\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf9\xf9\xf9\xfa\xfa\xfa\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfeVVV\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xffWWW\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xffWWW\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfeVVV\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xffWWW\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\x90\x90\x90\xae\xae\xae\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xffWWW\xf3\xf3\xf3\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\x8f\x8f\x8f\xad\xad\xad\xfe\xfe\xfe\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfeVVV\xf3\xf3\xf3\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfc\xfc\xfc\xfe\xfe\xfe\x90\x90\x90\xaf\xaf\xaf\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffWWW\xf2\xf2\xf2\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\x8f\x8f\x8f\xab\xab\xab\xff\xff\xff\xfc\xfc\xfc\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfdYYY\xf3\xf3\xf3\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\x8d\x8d\x8d###222......//////...//////......///---\x19\x19\x19\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfa\xfa\xfa\xff\xff\xff\x7e\x7e\x7e000\xb6\xb6\xb6\xb2\xb2\xb2\xb5\xb5\xb5\xb6\xb6\xb6\xb6\xb6\xb6\xb5\xb5\xb5\xb6\xb6\xb6\xb6\xb6\xb6\xb5\xb5\xb5\xb5\xb5\xb5\xb6\xb6\xb6\xb6\xb6\xb6\xc3\xc3\xc3\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xffxxxNNN\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfa\xfa\xfa\xfe\xfe\xfe\x7a\x7a\x7aHHH\xfb\xfb\xfb\xf6\xf6\xf6\xfa\xfa\xfa\xfb\xfb\xfb\xfb\xfb\xfb\xfa\xfa\xfa\xfb\xfb\xfb\xfb\xfb\xfb\xfa\xfa\xfa\xfa\xfa\xfa\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfa\xfa\xfa\xfe\xfe\xfe\x79\x79\x79HHH\xfe\xfe\xfe\xf9\xf9\xf9\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\x7a\x7a\x7aIII\xff\xff\xff\xfa\xfa\xfa\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfa\xfa\xfa\xfe\xfe\xfe\x79\x79\x79HHH\xfe\xfe\xfe\xf9\xf9\xf9\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\x7a\x7a\x7aIII\xff\xff\xff\xfa\xfa\xfa\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc3\xc3\xc3\xfe\xfe\xfe\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfa\xfa\xfa\xfe\xfe\xfe\x79\x79\x79III\xfe\xfe\xfe\xf9\xf9\xf9\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\x7a\x7a\x7aIII\xff\xff\xff\xfa\xfa\xfa\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc4\xc4\xc4\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfb\xfb\xfb\xff\xff\xff\x7a\x7a\x7aIII\xff\xff\xff\xfa\xfa\xfa\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xc2\xc2\xc2\xfc\xfc\xfc\xf9\xf9\xf9\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfc\xfc\xfc\xf8\xf8\xf8\xfc\xfc\xfcxxxIII\xff\xff\xff\xfa\xfa\xfa\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\x00\x00\x00\xd0\xd0\xd0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x81\x81HHH\xfe\xfe\xfe\xf9\xf9\xf9\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\x00\x00\x00\x96\x96\x96\xc4\xc4\xc4\xc1\xc1\xc1\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc4\xc4\xc4\xc1\xc1\xc1\xc5\xc5\xc5]]]JJJ\xff\xff\xff\xfa\xfa\xfa\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff""" - -simpleviewer_width=100 -simpleviewer_height=100 -simpleviewer_data="""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d"""+\ -"""\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d"""+\ -"""\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x0d\x0d\x84\x84\x84\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb5\xb5\xb5\xb6\xb6\xb6\xb5\xb5\xb5\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"""+\ -"""\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"""+\ -"""\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\x84\x84\x84\x0d\x0d\x0d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x0d\x0d\xb7\xb7\xb7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf9\xf9\xf9\x79\x8b\x79ftf\xf7\xf7\xf7&2&\xbd\xc1\xbd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb7\xb7\xb7\x0d\x0d\x0d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x0d\x0d\xb7\xb7\xb7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xaa\xb2\xaa2Z2+\xca+PgP\xf6\xf6\xf6*k**\x8c*JdJ\xe1\xe1\xe1\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb7\xb7\xb7\x0d\x0d\x0d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x0d\x0d\xb7\xb7\xb7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd4\xd6\xd4?\x5c?*\x9d*2\xfe22\xff2OgO\xf4\xf4\xf4-r-2\xff2-\xe8-*j*o\x81o\xf6"""+\ -"""\xf6\xf6\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb7\xb7\xb7\x0d\x0d\x0d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x0d\x0d\xb7\xb7\xb7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xef\xef\xef^s^)s)/\xef/2\xff22\xff22\xff2NgN\xf3\xf3\xf3.t.2\xff22\xff22\xff2)\xc9)."""+\ -"""U.\xa0\xa9\xa0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb7\xb7\xb7\x0d\x0d\x0d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"""+\ -"""\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0d\x0d\x0d\xb7\xb7\xb7\xff\xff\xff\xff\xff\xff\xfd\xfd\xfd\x8c\x98\x8c,[,+\xd6+2\xff22\xff22\xff22\xff22\xff2NgN\xf2\xf2\xf2.u.2\xff22\xff22\xff22\xff22"""+\ -"""\xfe2)\xa2)?\xa2\xa2\xa2\x7c\x7c\x7chhh\xff\xff\xff\xed\xed\xed\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1"""+\ -"""\xf0\xf0\xf0\xf0\xf0\xf0\xef\xef\xef\xf0\xf0\xf0\xef\xef\xef\xf0\xf0\xf0\xee\xee\xee\xe6\xe5\xe5\xf0\xf0\xf0\xdd\xe2\xde\xd6\xdd\xd7\xd6\xdc\xd6\xe4\xea\xe5\xe7\xea\xe7\xd5\xda\xd6\xdb\xe2\xdc\xd5\xdb\xd6\xda\xe0\xdb\xdf\xe4\xe0\xf9\xfd\xfa\xed\xf2\xee\xdd\xe4\xde\xe5\xec\xe6\xe4\xeb\xe5\xdb\xe1\xdb\xe5\xec\xe6\xd9\xe1\xda\xd2\xda\xd3\xe1\xe7\xe2\xe8\xef\xe9\xe1\xe8\xe2\xdd\xe4\xdd\xf8\xfa\xf8\xe6"""+\ -"""\xf7\xe4\xe8\xf7\xe7\xff\xff\xff\xfd\xfe\xfe\xfd\xfe\xfe\xfe\xfe\xff\xfd\xfe\xfe\xf9\xff\xfb\xf5\xfd\xf7\xf9\xff\xfb\xdb\xed\xde\x84Q\x7a\xd9\x82\xca\xef\xff\xf3\xf5\xfb\xf7\xf5\xfd\xf7\xff\xff\xff\xdc\xe0\xdd\xbd\xc4\xbe\xcb\xd2\xcc\xd6\xdc\xd7\xc8\xd8\xca\x7cQs\xccx\xbd\xe8\xf7\xea\xf1\xf6\xf2\xf4\xfa\xf5\xf7\xfe\xf8\xfa\xff\xfb\xfc\xfe\xfe\xfd\xff\xfe\xfe\xff\xff\xfe\xff\xfe\xfe\xfe"""+\ -"""\xfe\xfe\xfe\xfe\xfe\xff\xff\xfe\xff\xff\xfe\xff\xff\xfe\xff\xff\xfe\xfe\xfe\xfe\xff\xff\xfe\xff\xff\xfe\xff\xff\xfe\xfe\xfe\xfd\xfe\xfe\xff\xff\xff\xec\xf0\xed\xd6\xde\xd7\xd6\xdd\xd7\xdb\xe1\xdc\xe9\xee\xea\xc9\xcf\xca\xb3\xb9\xb4\xa2\xa7\xa3\x8d\x92\x8e\x80\x83\x80v\x79wX]Wpro\xf4\xf3\xf3222ttt\xff\xff\xff\xec\xec\xec\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0"""+\ -"""\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xee\xee\xee\xee\xee\xef\xef\xef\xd9\xda\xd8\xe4\xd4\xe1\xc5\xa3\xbe\xbe\x9c\xb7\xb7\x95\xb0\xcb\xaa\xc5\xcc\xae\xc6\xb8\x98\xb1\xc6\xa2\xc0\xc0\x9d\xb9\xbe\x9e\xb8\xc1\x9e\xba\xe9\xc8\xe3\xdf\xbc\xd8\xc1\x9d\xba\xc8\xa4\xc1\xc2\x9e\xbb\xbd\x99\xb6\xc2\x9e\xbb\xc5\xa1\xbe\xbf\x9b\xb8\xbd\x98\xb5\xca\xa6\xc3\xc4\xa0\xbd\xc8\xa2\xc1\xd5\xbb\xcc\xdb"""+\ -"""\xc6\xd1\xfe\xda\xf8\xfd\xda\xf7\xfd\xda\xf7\xfd\xda\xf7\xfe\xdb\xf8\xfd\xd9\xf7\xf9\xd6\xf3\xf5\xd3\xef\xf8\xd4\xf1\xe1\xc8\xdc\xa4X\x95\xdf\x79\xce\xf0\xd8\xec\xf5\xd5\xf0\xf5\xd8\xf0\xff\xe2\xfa\xdc\xc2\xd8\xbc\xa2\xb8\xca\xaf\xc6\xd4\xb7\xd0\xcb\xb6\xc7\x97U\x8b\xd0o\xbf\xe5\xce\xe1\xec\xce\xe7\xef\xd2\xea\xf4\xd5\xef\xf8\xd7\xf2\xf8\xd8\xf3\xfc\xd9\xf6\xfc\xda\xf6\xfc\xd9\xf6\xfb\xda"""+\ -"""\xf5\xfb\xda\xf5\xfb\xda\xf6\xfd\xda\xf7\xfd\xda\xf7\xfb\xda\xf6\xf8\xdb\xf3\xfb\xdb\xf5\xfb\xdb\xf6\xfc\xda\xf7\xfc\xda\xf6\xfc\xd9\xf6\xff\xdf\xfc\xdf\xbc\xd9\xbe\x9c\xb7\xbd\x9b\xb6\xbc\x9c\xb5\xd1\xb0\xcb\xa7\x8c\xa2\x99\x7d\x94\x8as\x86wariXfSGOVRR\xcb\xca\xcb\xc4\xc4\xc4\x00\x00\x00\x7f\x7f\x7f\xff\xff\xff\xeb\xeb\xeb\xee\xee\xee\xef\xef\xef\xef\xef\xef"""+\ -"""\xf0\xf0\xf0\xf0\xf0\xf0\xef\xef\xef\xf0\xf0\xf0\xef\xef\xef\xef\xef\xef\xf2\xef\xf1\xd2\xe0\xd3\xe0\x7f\xcf\xd9$\xba\xd41\xb8\xd14\xb6\xcf1\xb4\xd1-\xb4\xd9/\xbc\xd71\xba\xd32\xb7\xd31\xb7\xca-\xb0\xc5+\xaa\xe5)\xc8\xff*\xe6\xfe)\xe1\xfe)\xe2\xfe+\xe4\xfe*\xe3\xff*\xe3\xff,\xe4\xfe+\xe4\xfe%\xde\xfe$\xdd\xfe%\xde\xfa\x1d\xd5\xfe"""+\ -"""\x1f\xda\xfc\x1d\xd6\xfc\x1d\xd6\xfc\x1d\xd6\xfd\x1e\xd7\xfc\x1d\xd6\xfd\x1f\xd8\xfb\x1f\xd5\xf7 \xd2\xf5\x22\xd1\xf6%\xd3\xf96\xd8\xf03\xd0\xf1,\xcf\xf23\xd1\xf47\xd3\xfdD\xdd\xda9\xbf\xbb\x13\x9e\xc8\x1d\xac\xd2\x1f\xb4\xc8(\xad\xb4D\xa0\xb7@\xa2\xba5\xa3\xc56\xac\xc36\xaa\xc25\xa9\xd12\xb6\xca1\xaf\xcd.\xb1\xc1+\xa7\xc4'\xa9\xc9&"""+\ -"""\xac\xc5&\xa9\xd0$\xb2\xbe%\xa3\xc4%\xa8\xd1#\xb3\xc2$\xa6\xc0$\xa4\xc5#\xa8\xd2\x22\xb4\xc3$\xa7\xd2\x22\xb3\xc5\x22\xa9\xc6(\xaa\xcc,\xb0\xd4,\xb8\xcb-\xaf\xbd&\xa3\xaf&\x97\xa7!\x90\x91\x1d\x7c\x7d\x1alm\x16^O\x0bC\xa2\x90\x9f\xec\xee\xeb\x8a\x89\x89\x00\x00\x00\x87\x87\x87\xff\xff\xff\xec\xec\xec\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0"""+\ -"""\xf0\xf0\xf0\xf0\xf0\xf0\xef\xef\xef\xf0\xf0\xf0\xef\xef\xef\xef\xef\xef\xf2\xf1\xf2\xd2\xd2\xd1\xdf\xd7\xdd\xf0\xdf\xed\xef\xe0\xec\xe4\xd4\xe1\xe1\xd2\xde\xed\xdc\xea\xf2\xe2\xef\xe1\xd3\xde\xe4\xd5\xe1\xe7\xd6\xe4\xf5\xe7\xf3\xe8\xd9\xe5\xe7\xd8\xe4\xe8\xd7\xe5\xe8\xd7\xe5\xeb\xd9\xe7\xe6\xd5\xe3\xe6\xd5\xe3\xe8\xd7\xe4\xe4\xd2\xe0\xe6\xd5\xe2\xf8\xe8\xf5\xfd\xec\xfa\xfc\xeb\xf9\xfd\xed\xfb\xfd"""+\ -"""\xed\xfa\xfe\xee\xfb\xfb\xeb\xf8\xfd\xec\xfa\xf7\xe7\xf4\xfd\xec\xfa\xef\xde\xec\xe9\xd8\xe6\xe6\xd6\xe3\xe3\xd3\xe0\xe2\xd3\xe0\xee\xdd\xeb\xf1\xe0\xee\xf1\xe3\xef\xf5\xe7\xf3\xf5\xe7\xf3\xff\xf1\xfd\xdc\xd0\xda\xbc\xb0\xba\xcb\xbe\xc9\xd2\xc6\xd0\xd7\xc2\xd4\xd8\xab\xd0\xe3\xb0\xda\xeb\xb9\xe3\xf0\xbe\xe8\xf2\xc3\xea\xf7\xc9\xef\xf9\xcd\xf2\xfc\xd1\xf5\xfd\xd4\xf6\xfe\xd7\xf7\xfe\xdb\xfa\xfe\xdc"""+\ -"""\xfa\xfd\xdf\xf9\xfd\xe2\xfa\xfe\xe6\xfb\xfd\xe7\xf9\xfb\xe7\xf7\xfd\xe9\xfa\xfc\xec\xf9\xfb\xec\xf8\xfb\xed\xf8\xfc\xed\xfa\xfc\xed\xf9\xfb\xee\xf9\xf9\xec\xf7\xfa\xeb\xf7\xfb\xeb\xf9\xf9\xe9\xf7\xe6\xd8\xe3\xd1\xc3\xce\xba\xaf\xb8\xa5\x9b\xa3\x91\x88\x8fskq\x92\x8d\x91\xcc\xce\xcc\xe9\xe8\xe8MMM\x00\x00\x00\x89\x89\x89\xff\xff\xff\xec\xec\xec\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0"""+\ -"""\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xee\xee\xef\xef\xef\xed\xed\xed\xe5\xe4\xe4\xef\xf0\xef\xde\xe1\xde\xe2\xe3\xe2\xdd\xe1\xdd\xd8\xdc\xd8\xe4\xe6\xe3\xe5\xe7\xe5\xdd\xe0\xdd\xdb\xde\xdb\xdd\xe1\xdd\xed\xed\xed\xde\xe1\xde\xdc\xdf\xdb\xdc\xe0\xdc\xdb\xdf\xdb\xdd\xe0\xdd\xde\xe2\xde\xdb\xdf\xdb\xda\xde\xda\xd8\xdc\xd8\xd9\xdd\xd9\xf5\xf6\xf5\xff\xff\xff\xfe\xfe\xfe\xfe\xff\xff\xfe"""+\ -"""\xfe\xfe\xff\xff\xff\xee\xee\xee\xfa\xfa\xfa\xcb\xcd\xca\xfc\xfc\xfc\xe3\xe6\xe2\xd6\xd9\xd5\xce\xd2\xce\xce\xd1\xcd\xd6\xd9\xd6\xf4\xf8\xf4\xf2\xf6\xf3\xe9\xed\xe9\xf7\xfb\xf7\xf6\xf9\xf6\xff\xff\xff\xdd\xde\xdd\xbd\xc0\xbd\xcc\xcd\xcc\xd2\xe0\xd4\xd8\xa7\xd0\xd29\xb8\xd8.\xba\xbe,\xa4\xca8\xb0\xdbD\xc0\xc3I\xad\xcfT\xb9\xd5_\xc0\xd0f\xbd\xcal\xb8\xc7s\xb7\xd2\x85"""+\ -"""\xc3\xd3\x91\xc6\xcb\x96\xc1\xc1\x9a\xb9\xda\xb8\xd3\xff\xea\xff\xfe\xf8\xfe\xfe\xff\xfe\xff\xfe\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xfe\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xff\xff\xff\xf9\xfb\xf9\xe3\xe7\xe3\xcd\xd0\xcd\xb7\xba\xb7\xa1\xa4\xa2\x86\x89\x87\x86\x89\x87\xc1\xc2\xc1\xc7\xc6\xc6\xcf\xcf\xcf\x15\x15\x15\x05\x05\x05\x89\x89\x89\xfd\xfd\xfe\xeb\xeb\xeb\xee\xee\xee\xef\xef\xef\xef\xef\xef"""+\ -"""\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xec\xec\xe6\xe5\xe5\xf4\xf4\xf4\xf9\xf8\xf9\xee\xed\xee\xff\xff\xff\xff\xff\xff\xf7\xf6\xf7\xef\xee\xee\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xf0\xef\xef\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfd\xfe\xfd\xfc\xfd\xfe\xfd\xfe\xfe\xfd\xfe\xfd"""+\ -"""\xfc\xfd\xff\xff\xff\xe6\xe5\xe6\xd5\xd4\xd4\xd0\xce\xcf\xde\xe1\xe0\xd2\xd7\xd7\xf2\xf3\xf4\xf9\xf8\xf9\xea\xeb\xec\xc8\xcd\xcc\xdf\xe1\xe1\xd6\xd5\xd5\xe7\xe7\xe7\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xca\xcb\xd1\xd4\xd2\xd8\xcc\xd6\xc2\x95\xba\xba\x8f\xb2\xc4\x9d\xbd\xcb\xa4\xc4\xc6\x9f\xbf\xcc\xaa\xc5\xc7\xa6\xc0\xd3\xb4\xcd\xce\xb1\xc8\xd2\xb8\xcd\xcf\xba\xcb\xcc\xb7"""+\ -"""\xc8\xcd\xba\xc9\xd2\xc3\xce\xce\xc3\xcc\xdb\xd0\xd8\xe1\xd8\xde\xda\xd6\xd9\xdf\xde\xdf\xd5\xd3\xd4\xea\xe9\xe9\xff\xff\xff\xfe\xfd\xfe\xfd\xfd\xfd\xfa\xf9\xfa\xfa\xf9\xfa\xfb\xfa\xfb\xed\xec\xed\xd7\xd6\xd7\xc2\xc1\xc2\xad\xac\xad\x98\x97\x98\x83\x83\x83\xb8\xb8\xb8\xb2\xb1\xb1\xe1\xe2\xe2\x98\x98\x98\x00\x00\x00\x0f\x0f\x0f\x8a\x8a\x8a\xfc\xfc\xfc\xea\xea\xea\xed\xed\xed\xee\xee\xee\xee\xee\xee"""+\ -"""\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xee\xee\xee\xee\xee\xf0\xf0\xf0\xd6\xd4\xd4\xe8\xe8\xe8\xfa\xfa\xfa\xed\xed\xed\xff\xff\xff\xfe\xfe\xfe\xf6\xf6\xf6\xee\xee\xee\xff\xff\xff\xfa\xfa\xfa\xfd\xfd\xfd\xf0\xef\xef\xfc\xfc\xfc\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfc\xfc\xfc\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd"""+\ -"""\xfd\xfd\xff\xff\xff\xe3\xe2\xe2\xcc\xcc\xcc\xcf\xce\xce\x9d\xa6\xa3\x99\xa4\xa2\xcf\xd5\xd5\xed\xed\xed\xc4\xca\xc9\x8c\x99\x96\xaa\xb1\xaf\xbe\xbc\xbc\xe7\xe6\xe6\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd1\xd2\xd6\xd8\xd6\xc9\xd3\xcb\xce\xd7\xcf\xd8\xdf\xd9\xd0\xd7\xd1\xdc\xe3\xdd\xe8\xef\xe9\xec\xf2\xec\xe1\xe7\xe2\xd9\xdf\xda\xe2\xe7\xe3\xe4\xe7\xe4\xe0\xe4"""+\ -"""\xe1\xdf\xe3\xe0\xe6\xe8\xe6\xd9\xdb\xd9\xb5\xb6\xb4\xb2\xb3\xb1\xb4\xb4\xb3\xb5\xb4\xb4\xad\xac\xab\xc7\xc6\xc6\xc3\xc3\xc3\xbc\xbc\xbc\xc8\xc8\xc7\xeb\xeb\xeb\xe7\xe7\xe7\xe5\xe5\xe5\xd6\xd5\xd5\xc0\xc0\xc0\xaa\xa9\xa9\x92\x91\x91ppp\xa6\xa7\xa6\xc4\xc3\xc3\xb8\xb9\xb9\xf6\xf1\xf0MCE\x04\x01\x04\x13\x13\x13\x8d\x8d\x8d\xfd\xfd\xfd\xeb\xeb\xeb\xee\xee\xee\xef\xef\xef\xef\xef\xef"""+\ -"""\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xed\xed\xed\xf0\xf0\xf0\xd2\xd1\xd1\xe6\xe5\xe5\xfc\xfc\xfc\xee\xee\xee\xff\xff\xff\xff\xff\xff\xf7\xf7\xf7\xef\xef\xef\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xf0\xf0\xf0\xfc\xfc\xfc\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfd\xfe\xfe\xfe\xfc"""+\ -"""\xfc\xfc\xff\xff\xff\xe2\xe2\xe2\xcc\xcc\xcb\xd8\xd7\xd7\xed\xee\xee\xe0\xe3\xe2\xf7\xf9\xf8\xf9\xf8\xf8\xf0\xf1\xf0\xd6\xda\xd9\xee\xef\xee\xdb\xda\xda\xea\xea\xea\xf7\xf7\xf7\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd1\xd1\xd1\xde\xdd\xde\xce\xca\xcd\xa5\xa1\xa3\xbe\xb9\xbb\xe6\xe3\xe4\xe4\xe2\xe4\xe3\xe1\xe2\xe3\xe1\xe3\xe3\xe1\xe2\xeb\xea\xeb\xfb\xf9\xfa\xca\xc9\xc9\xdd\xdc"""+\ -"""\xdd\xf8\xf8\xf8\xbb\xba\xba\xe6\xe5\xe5\xe4\xe1\xe2\xaa\xa6\xa7\xef\xec\xed\xd2\xd1\xd1\xb5\xb3\xb3\xf9\xf7\xf8\xc0\xbd\xbe\xc1\xbe\xbf\xf8\xf5\xf6\xbb\xb9\xb9\xdb\xda\xda\xed\xed\xed\xa1\xa1\xa0\xb8\xb8\xb8\xaf\xaf\xae\x88\x87\x87\x9c\x9c\x9c\xcd\xcc\xcc\xc3\xc3\xc3\xdf\xdd\xdd\xd8\xc9\xc8\x15\x15\x14\x13\x13\x13\x16\x15\x16\x8f\x8f\x8f\xfb\xfb\xfb\xea\xea\xea\xed\xed\xed\xee\xee\xee\xee\xee\xee"""+\ -"""\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xee\xee\xee\xee\xee\xf2\xf2\xf2\xce\xcd\xcd\xe2\xe1\xe1\xfa\xfa\xfa\xeb\xec\xec\xff\xff\xff\xff\xff\xff\xf5\xf5\xf5\xe2\xe2\xe1\xe5\xe5\xe5\xd1\xd1\xd0\xe3\xe2\xe2\xe7\xe6\xe6\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe"""+\ -"""\xfe\xfe\xff\xff\xff\xe2\xe1\xe1\xcd\xcc\xcc\xcb\xca\xc9\xe4\xe2\xe2\xe5\xe3\xe3\xdd\xda\xda\xd8\xd8\xd8\xd6\xd5\xd5\xd9\xd9\xd8\xd7\xd6\xd6\xd3\xd3\xd3\xe3\xe3\xe3\xf9\xf9\xf9\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd3\xd3\xd3\xd5\xd5\xc3\xcb\xc8\xb3\xba\xb7\xc3\xcc\xc8\xcf\xd5\xd2\xd2\xd1\xd1\xb2\xb1\xb1\xb6\xb5\xb5\xd6\xd5\xd5\xe4\xe4\xe4\xf2\xf2\xf2\xd0\xd0\xd0\xe0\xe0"""+\ -"""\xe0\xf1\xef\xf0\xcc\xc8\xc9\xe8\xe6\xe6\xe2\xeb\xe7\xcf\xda\xd5\xe6\xf0\xec\xc7\xcb\xc9\xc2\xc9\xc6\xe9\xf3\xee\xd1\xda\xd6\xd0\xdb\xd6\xe5\xf1\xec\xc2\xc9\xc6\xe1\xe0\xe0\xe1\xe1\xe1\xad\xac\xac\xb5\xb5\xb5\x9f\x9e\x9e\x8f\x91\x90\xd2\xd2\xd2\xb7\xb6\xb6\xcb\xcb\xcb\xef\xdd\xdd\x9c\x99\x98\x00\x00\x00 \x1e\x1e\x1e\x92\x92\x92\xfc\xfc\xfc\xeb\xeb\xeb\xee\xee\xee\xef\xef\xef\xef\xef\xef"""+\ -"""\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xe0\xdd\xde\xe9\xef\xea\xec\xd1\xe5\xe1\xc6\xda\xe6\xec\xe7\xdf\xde\xdf\xe4\xe3\xe3\xdb\xdb\xdb\xd1\xd1\xd1\xbe\xbd\xbd\xd4\xd4\xd4\xdc\xdc\xdc\xca\xc9\xc9\xcc\xcb\xcb\xc9\xc8\xc8\xcb\xca\xca\xcd\xcc\xcc\xd2\xd2\xd2\xcb\xcb\xcb\xcc\xcb\xcb\xc8\xc8\xc7\xca\xca\xc9\xd0\xd0\xcf\xd3\xd2\xd2\xd2\xd1\xd1\xd3\xd3\xd3\xcc"""+\ -"""\xcb\xcb\xdb\xd9\xd9\xd5\xdc\xda\xb4\xc2\xbd\xcc\xd1\xcf\xb1\xca\xc2\xb1\xca\xc1\xae\xc4\xbc\xc5\xc5\xc4\xc1\xc0\xc0\xc2\xc1\xc1\xc3\xc2\xc2\xbf\xbe\xbe\xe2\xe2\xe2\xf9\xf9\xf9\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd4\xd3\xd3\xd1\xd6\xd4\xba\xce\xc7\xd0\xe5\xdd\xd3\xea\xe1\xc6\xd6\xcf\xe1\xe0\xe0\xb5\xb4\xb4\xc1\xc0\xc0\xe2\xe2\xe2\xdc\xdc\xdc\xed\xed\xec\xdb\xdb\xda\xe5\xe4"""+\ -"""\xe4\xde\xe8\xe3\xd5\xe3\xdd\xda\xe8\xe2\xcc\xe3\xda\xbd\xce\xc7\xc5\xdb\xd2\xc2\xd6\xce\xc9\xde\xd5\xcd\xe6\xdd\xd0\xe6\xde\xde\xe8\xe4\xde\xe8\xe4\xd4\xda\xd8\xe6\xe5\xe5\xd7\xd7\xd7\xb6\xb6\xb6\xaf\xae\xae\x97\x97\x97\xcb\xcb\xcb\xba\xb9\xb9\xb1\xb1\xb1\xcb\xc8\xc8\xf3\xea\xeaSUU\x01\x01\x01%%%$$$\x94\x94\x94\xfb\xfb\xfb\xea\xea\xea\xed\xed\xed\xee\xee\xee\xee\xee\xee"""+\ -"""\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xee\xee\xee\xec\xec\xec\xe7\xe5\xe6\xf5\xfe\xf7\xf6\xcc\xeb\xee\xc6\xe5\xdb\xe2\xdb\xce\xca\xcb\xf4\xf7\xf7\xb4\xb4\xb4\xb1\xb1\xb1\xc3\xc3\xc3\xda\xda\xda\xdf\xde\xde\x9c\x9a\x9a\xab\xaa\xaa\xab\xaa\xa9\xaa\xa9\xa8\xa5\xa4\xa3\xaf\xae\xad\xaa\xa9\xa8\xaf\xad\xad\xa8\xa6\xa6\xa5\xa4\xa4\xa3\xa2\xa1\xab\xaa\xa9\xab\xaa\xa9\xb3\xb2\xb2\xb6"""+\ -"""\xb4\xb4\xb9\xba\xb8\xd3\xc8\xcf\xb3\xa1\xab\xd7\xd0\xd4\xce\xa8\xc1\xce\xab\xc2\xcb\xab\xc0\xd0\xcf\xcf\xcd\xcd\xcc\xce\xcd\xcd\xcc\xcb\xcb\xd5\xd5\xd5\xe9\xe9\xe9\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd2\xd2\xd3\xd5\xd4\xcc\xd2\xd0\xd1\xd7\xd5\xd7\xdd\xdb\xd9\xdc\xdb\xe6\xe5\xe5\xe0\xdf\xdf\xe4\xe4\xe4\xeb\xeb\xeb\xed\xed\xed\xf1\xf0\xf0\xe6\xe6\xe6\xeb\xeb"""+\ -"""\xeb\xe5\xec\xe9\xe3\xec\xe8\xe3\xeb\xe8\xe3\xe9\xe7\xd6\xd9\xd8\xe0\xe5\xe3\xe8\xf0\xec\xe5\xec\xe9\xe4\xeb\xe8\xe3\xe9\xe7\xec\xea\xeb\xf0\xed\xee\xe9\xe7\xe8\xe6\xe6\xe6\xd3\xd3\xd3\xba\xba\xba\xa4\xa4\xa4\xc2\xc2\xc2\xdb\xda\xda\xb1\xb1\xb1\xc9\xc9\xc9\xdc\xdc\xdc\xd3\xd5\xd5\x18\x18\x18\x11\x11\x11&%%$$$\x97\x97\x97\xfa\xfa\xfa\xeb\xeb\xeb\xed\xed\xed\xee\xee\xee\xee\xee\xee"""+\ -"""\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xed\xed\xed\xef\xee\xee\xd9\xd6\xd8\xe6\xed\xe7\xd2\xad\xcb\xee\xb8\xd4\xf9\x8a\x7c\xf7wp\xff\xef\xef\xc4\xc7\xc7\xc0\xbf\xbf\xe1\xe1\xe1\xf0\xf1\xf1\xe8\xe8\xe8\xb2\xb1\xb0\xb2\xb1\xb1\xb5\xb4\xb4\xb4\xb3\xb3\xaa\xa9\xa9\xaf\xae\xae\xb2\xb1\xb0\xbb\xba\xba\xb8\xb7\xb6\xb3\xb2\xb1\xb2\xb0\xb0\xb2\xb2\xb1\xb2\xb1\xb1\xb7\xb6\xb6\xcb"""+\ -"""\xca\xca\xf4\xf6\xf4\xd5\xcb\xd2\xb2\xa0\xac\xd5\xce\xd3\xc1\xa0\xb9\xc1\xa1\xb9\xbe\xa2\xb7\xce\xcd\xce\xcb\xcc\xcb\xcc\xcc\xcc\xd0\xd0\xd0\xe6\xe5\xe5\xeb\xeb\xeb\xf7\xf7\xf7\xf6\xf6\xf6\xff\xff\xff\xdc\xdc\xdc\xbd\xbd\xbd\xcc\xcc\xcc\xd2\xd2\xd2\xda\xda\xda\xd9\xd8\xd9\xdb\xda\xdb\xe0\xdf\xdf\xeb\xea\xea\xe9\xe9\xe9\xef\xef\xef\xf1\xf1\xf1\xf1\xf1\xf1\xef\xef\xef\xf8\xf8\xf8\xff\xff\xff\xfe\xfe"""+\ -"""\xfe\xfe\xff\xfe\xff\xfe\xff\xff\xfe\xff\xff\xff\xff\xff\xfe\xff\xfe\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xf4\xf4\xf4\xdf\xdf\xdf\xc5\xc6\xc6\xbe\xbf\xbf\xe8\xe7\xe7\xd9\xd8\xd8\xbd\xbd\xbd\xbe\xbe\xbe\xe7\xe7\xe7\x9b\x9b\x9b\x00\x00\x00\x1d\x1d\x1d((('''\x99\x99\x99\xfa\xfa\xfa\xeb\xeb\xeb\xed\xed\xed\xee\xee\xee\xee\xee\xee"""+\ -"""\xed\xed\xed\xed\xed\xed\xec\xec\xec\xed\xed\xed\xec\xec\xec\xec\xec\xec\xf0\xf0\xf0\xd0\xcd\xce\xdd\xe4\xdd\xcc\xa6\xc4\xf0\xbc\xd9\xf6\x90\x83\xf2mf\xf7\xe6\xe4\xde\xe2\xe2\xce\xcd\xcd\xc6\xc5\xc5\xe5\xe5\xe5\xdc\xdc\xdc\x9d\x9c\x9b\xa0\x9e\x9e\xa9\xa8\xa7\xa4\xa3\xa3\xae\xad\xad\xa8\xa7\xa7\xa6\xa5\xa4\xae\xac\xac\xa6\xa5\xa5\xa4\xa3\xa3\xb3\xb2\xb2\xb2\xb1\xb1\xb2\xb1\xb1\xb0\xaf\xaf\xb6"""+\ -"""\xb5\xb4\xfc\xfe\xfd\xe1\xd7\xde\xb8\xa5\xb2\xd3\xce\xd2\xc3\xa5\xbb\xca\xac\xc3\xc9\xab\xc0\xd2\xcd\xcf\xcf\xcb\xcc\xca\xca\xca\xe5\xe5\xe5\xf4\xf4\xf4\xe8\xe8\xe8\xf7\xf7\xf7\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd3\xd3\xd6\xd6\xd6\xbe\xbe\xbe\xc1\xc0\xc0\xc5\xc4\xc4\xc2\xc2\xc2\xc8\xc8\xc8\xcd\xcc\xcc\xcc\xcc\xcb\xca\xca\xc9\xc6\xc5\xc5\xdc\xdc\xdc\xf1\xf1\xf1\xed\xed"""+\ -"""\xed\xeb\xeb\xeb\xf2\xf2\xf2\xe7\xe6\xe6\xd3\xd3\xd3\xd9\xd8\xd8\xd4\xd4\xd4\xd6\xd6\xd6\xd6\xd5\xd5\xdc\xdb\xdb\xdb\xdb\xdb\xd7\xd7\xd7\xda\xda\xda\xf1\xf1\xf1\xdc\xdb\xdb\xc4\xc3\xc3\xb4\xb4\xb4\xdd\xdd\xdd\xd7\xd6\xd6\xd1\xd1\xd1\x96\x95\x95\xa9\xa9\xa9\xe8\xe8\xe8PPP\x02\x02\x02###.---,,\x9b\x9b\x9b\xf8\xf8\xf8\xea\xea\xea\xec\xec\xec\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xed\xed\xed\xf1\xf1\xf1\xcd\xca\xcb\xdc\xe4\xdd\xd0\xa6\xc4\xe6\xc1\xdf\xf2\xfa\xf4\xf2\xf1\xf2\xea\xed\xed\xe4\xe3\xe3\xf0\xf0\xf0\xd9\xd8\xd8\xed\xed\xed\xda\xda\xda\xb7\xb6\xb6\xb7\xb6\xb5\xba\xb9\xb8\xb5\xb4\xb4\xbe\xbd\xbd\xbf\xbe\xbe\xbb\xb9\xb9\xb8\xb7\xb7\xbf\xbe\xbe\xb3\xb2\xb1\xc6\xc5\xc5\xdf\xde\xde\xdf\xdf\xdf\xdd\xdc\xdc\xda\xda\xda\xf2\xf0\xf1\xd4\xd9\xd6\xb6\xc2\xbb\xda\xd9\xd9\xce\xcb\xca\xdb\xda\xd8\xc3\xd4\xca\xc0\xd4\xca\xbe\xd0\xc7\xd0\xd1\xd0\xd9\xd8\xd8\xdc\xdc\xdc\xe6\xe6\xe6\xf8\xf8\xf8\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd2\xd2\xd2\xdc\xdc\xdc\xcf\xd0\xcf\xbe\xbe\xbd\xce\xce\xcd\xe2\xe2\xe1\xef\xef\xef\xf7\xf7\xf7\xfb\xfb\xfb\xed\xed\xec\xe8\xe8\xe8\xf4\xf4\xf4\xd4\xd4\xd4\xde\xde\xde\xee\xee\xee\xcd\xcd\xcc\xde\xdf\xde\xc6\xc6\xc5\xa0\xa0\x9f\xce\xce\xcd\xbb\xbb\xba\xa5\xa6\xa4\xde\xdf\xdd\xb7\xb7\xb6\xb4\xb3\xb2\xdb\xdb\xdb\xca\xc9\xc9\xc7\xc6\xc6\xbb\xbb\xbb\xd3\xd3\xd3\xd1\xd0\xd0\xc5\xc4\xc4\xa8\xa7\xa7\x94\x93\x93\xcf\xce\xce\xdd\xdd\xdd\x1a\x1a\x1a\x10\x10\x10&&&444988\x9d\x9d\x9d\xf9\xf9\xf9\xeb\xeb\xeb\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xed\xed\xed\xec\xec\xec\xed\xed\xed\xec\xec\xec\xed\xed\xed\xed\xed\xed\xdf\xdc\xde\xe9\xf1\xea\xd0\xa7\xc5\xef\xc6\xe3\xfe\xff\xff\xfd\xfc\xfd\xf5\xf4\xf3\xed\xed\xed\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xe1\xe1\xe1\xa7\xa6\xa5\xb9\xb8\xb8\xaf\xae\xae\xb2\xb1\xb1\xba\xb9\xb9\xb9\xb8\xb8\xac\xab\xaa\xb6\xb5\xb5\xb9\xb8\xb8\xb2\xb0\xb0\xa9\xa8\xa8\xb1\xb0\xaf\xc2\xc1\xc0\xdc\xdc\xdc\xd5\xd4\xd4\xee\xee\xed\xdd\xd9\xde\xb2\xac\xb4\xdd\xdd\xdc\xd9\xd9\xd8\xd5\xd4\xd5\xc1\xb5\xc5\xc1\xb4\xc5\xbe\xb2\xc2\xce\xcc\xce\xce\xce\xce\xce\xcd\xcd\xe6\xe6\xe6\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd1\xd1\xd1\xd8\xd7\xd8\xcc\xc8\xcb\xa0\x9c\x9e\xba\xb5\xb8\xdb\xd8\xda\xcf\xce\xce\xb9\xb9\xb9\xb9\xb8\xb8\xd2\xd2\xd1\xe9\xe9\xe9\xf8\xf8\xf8\xc7\xc6\xc6\xdd\xdc\xdc\xf6\xf8\xf5\xb9\xb7\xb8\xe8\xe3\xe7\xf4\xef\xf4\xc4\xbe\xc2\xf7\xf3\xf7\xd9\xd6\xd8\xc8\xc1\xc6\xff\xf8\xff\xcf\xc9\xce\xd1\xd0\xd0\xff\xff\xff\xb3\xb2\xb2\xb8\xb7\xb7\xd4\xd4\xd4\xde\xdd\xdd\xc9\xc8\xc8\xe8\xe7\xe7\xa7\xa6\xa6\xb9\xb8\xb8\xe0\xe0\xe0\x94\x93\x93\x00\x00\x00\x1d\x1d\x1d*)):::???\x9f\x9f\x9f\xf8\xf8\xf8\xea\xea\xea\xec\xec\xec\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xee\xee\xee\xec\xec\xec\xea\xe7\xe8\xf0\xf8\xf2\xcb\xa1\xbf\xf2\xcc\xe9\xd3\xd1\xca\xc2\xb7\xb8\xe7\xea\xeb\xf2\xf1\xf1\xfd\xfd\xfd\xf9\xf9\xf9\xff\xff\xff\xe2\xe2\xe2\xa7\xa6\xa6\xad\xac\xac\xb5\xb4\xb4\xb7\xb6\xb6\xb0\xae\xae\xba\xb9\xb9\xaf\xae\xae\xb5\xb4\xb4\xbc\xbb\xbb\xb5\xb4\xb3\xb1\xb0\xaf\xb3\xb3\xb2\xb7\xb6\xb5\xc2\xc1\xc1\xb5\xb4\xb3\xc0\xc2\xc0\xcd\xbf\xc6\xb7\x9c\xaa\xd7\xd8\xd7\xd2\xd3\xd2\xd3\xcd\xcf\xc7\x9d\xb4\xc7\x9b\xb3\xc3\x9b\xb1\xcb\xc6\xc8\xcb\xcb\xca\xe0\xdf\xdf\xec\xec\xec\xf6\xf6\xf6\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd4\xd3\xd7\xcf\xd6\xc8\xa9\xc6\xe6\xc5\xe4\xed\xc9\xeb\xd7\xbf\xd5\xdf\xe0\xdf\xb5\xb4\xb4\xc0\xbf\xbf\xe2\xe2\xe2\xde\xdd\xdd\xed\xed\xed\xdc\xdc\xdb\xe5\xe5\xe5\xea\xe4\xe9\xe1\xcc\xdf\xe7\xc0\xe5\xde\xbd\xdb\xee\xc8\xeb\xd7\xb7\xd5\xc8\xae\xc5\xe9\xcc\xe7\xea\xce\xe8\xde\xc6\xdc\xe2\xe1\xe1\xea\xea\xea\xcc\xcb\xcb\xc5\xc5\xc5\xe5\xe5\xe5\xe6\xe5\xe5\xf3\xf3\xf3\xe8\xe8\xe8\xd8\xd8\xd8\xcc\xcc\xcc\xe4\xe4\xe4VVV\x00\x00\x00!!!,,,;;;>>>\xa2\xa3\xa3\xf8\xf8\xf8\xeb\xeb\xeb\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xed\xed\xed\xec\xec\xec\xed\xed\xed\xec\xec\xec\xec\xec\xec\xed\xed\xed\xdc\xd9\xda\xe6\xee\xe7\xcb\xa5\xc4\xef\xb6\xd3\xf2wh\xee_X\xfd\xe8\xe7\xc6\xca\xcb\xa1\xa0\xa0\xac\xac\xac\xcf\xcf\xcf\xdf\xde\xde\xb4\xb3\xb3\xb3\xb2\xb2\xbc\xbb\xbb\xb1\xb0\xb0\xb3\xb2\xb1\xaa\xa9\xa9\xbd\xbc\xbb\xb6\xb5\xb4\xb3\xb2\xb2\xb3\xb2\xb2\xb2\xb0\xb0\xb4\xb3\xb3\xb2\xb1\xb1\xb4\xb3\xb2\xb9\xb8\xb8\xf9\xfa\xf9\xdc\xd3\xda\xb2\x9e\xae\xda\xda\xd9\xd5\xd4\xd4\xd3\xcf\xd1\xbd\xa1\xb9\xbd\xa0\xb9\xbb\xa0\xb6\xc9\xc6\xc8\xe2\xe3\xe2\xf2\xf2\xf2\xe6\xe5\xe5\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd3\xd2\xd5\xd0\xd5\xcc\xb6\xca\xd6\xc0\xd5\xde\xc6\xdd\xd6\xc5\xd4\xdd\xde\xdc\xc5\xc4\xc4\xcd\xcd\xcc\xe1\xe1\xe1\xe1\xe0\xe0\xec\xec\xec\xdd\xdd\xdc\xe5\xe4\xe4\xe9\xd2\xe7\xe9\xce\xe8\xe2\xca\xe1\xc7\xb9\xc5\xe0\xc8\xde\xec\xd2\xea\xe7\xcd\xe6\xe3\xdf\xe2\xeb\xed\xec\xdf\xdf\xde\xe2\xe2\xe2\xe8\xe7\xe7\xc4\xc4\xc4\xda\xda\xda\xda\xd9\xd9\xf1\xf0\xf0\xf6\xf6\xf6\xdc\xdc\xdc\xd3\xd5\xd5\xdd\xd6\xd6\xda\xcd\xcd\x1c\x1f\x1f\x10\x10\x0f%%%555????>>\xa5\xa5\xa5\xf7\xf7\xf7\xea\xea\xea\xec\xec\xec\xed\xed\xed\xed\xed\xed\xed\xed\xed\xed\xed\xed\xec\xec\xec\xed\xed\xed\xec\xec\xec\xec\xec\xec\xf0\xf0\xf0\xce\xcb\xcc\xd9\xe1\xda\xcc\xa5\xc2\xef\xc0\xdd\xf7\x9f\x93\xf3\x7cv\xfe\xf0\xef\xc9\xcc\xcc\xbc\xbb\xbb\xe3\xe3\xe3\xe8\xe8\xe8\xe8\xe8\xe8\xaa\xa9\xa9\xba\xb9\xb9\xb6\xb5\xb5\xb7\xb6\xb6\xc4\xc3\xc2\xb4\xb3\xb3\xb4\xb3\xb2\xaf\xae\xae\xad\xac\xab\xb1\xb0\xb0\xb0\xaf\xaf\xb5\xb4\xb3\xac\xab\xaa\xab\xaa\xaa\xaa\xa9\xa9\xbf\xbf\xbe\xda\xd5\xd6\xc1\xb7\xba\xda\xdb\xdb\xd7\xd7\xd6\xd7\xd5\xd6\xd4\xc5\xca\xd3\xc4\xca\xd1\xc2\xc7\xce\xcc\xcc\xde\xde\xde\xe6\xe6\xe6\xe1\xe1\xe1\xf7\xf7\xf7\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd1\xd1\xd1\xd8\xd8\xd8\xe0\xe2\xe0\xe6\xe8\xe6\xea\xec\xeb\xf0\xf2\xf1\xf5\xf5\xf5\xfd\xfd\xfd\xfd\xfd\xfd\xfa\xfa\xfa\xfc\xfc\xfc\xfc\xfc\xfc\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfd\xfc\xfe\xfc\xfd\xfe\xfd\xff\xfe\xff\xfc\xfe\xfc\xfc\xfe\xfc\xfc\xfe\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfe\xfe\xfe\xee\xee\xee\xdf\xdf\xdf\xd6\xd5\xd5\xd4\xd3\xd3\xff\xff\xff\xec\xec\xec\xd9\xd9\xd9\xd1\xd0\xd0\xeb\xd9\xd8\xac\xab\xaa\x00\x00\x00\x1b\x17\x1a)))999DDDEDD\xa7\xa8\xa7\xf6\xf6\xf6\xea\xea\xea\xec\xec\xec\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xed\xed\xed\xf1\xf1\xf1\xcf\xcc\xcd\xdf\xe7\xe1\xe9\xc0\xde\xef\xc7\xe5\xff\xff\xff\xff\xfd\xfe\xfa\xfa\xfa\xe0\xdf\xdf\xc3\xc3\xc3\xd1\xd1\xd1\xeb\xeb\xeb\xe3\xe2\xe2\xaa\xa9\xa8\xb2\xb1\xb1\xad\xab\xab\xaf\xae\xae\xb6\xb5\xb5\xaa\xa9\xa8\xae\xad\xac\xb4\xb3\xb2\xb3\xb2\xb2\xb8\xb7\xb6\xbc\xbb\xbb\xbe\xbd\xbc\xc0\xbf\xbf\xb9\xb8\xb8\xb6\xb5\xb5\xc8\xc7\xc6\xdb\xdc\xdb\xf7\xf9\xf8\xfb\xfb\xfb\xfa\xfa\xfa\xfa\xfa\xfa\xf6\xf8\xf7\xf2\xf5\xf4\xf1\xf3\xf2\xf0\xef\xf0\xef\xee\xee\xea\xea\xea\xe8\xe8\xe8\xf7\xf7\xf7\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd3\xd3\xd8\xd8\xd8\xc2\xc1\xc1\xbf\xbe\xbe\xcd\xcc\xcc\xc7\xc7\xc7\xc8\xc7\xc7\xc9\xc9\xc8\xe7\xe7\xe7\xf5\xf5\xf5\xf7\xf7\xf7\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf8\xf7\xf8\xf9\xf9\xf9\xf8\xf8\xf8\xf8\xf8\xf8\xfb\xfb\xfb\xfa\xf9\xf9\xfa\xf9\xfa\xfa\xfa\xfa\xf9\xf9\xf9\xfa\xfa\xfa\xf9\xf8\xf9\xe4\xe5\xe4\xdd\xdc\xdc\xc3\xc2\xc1\xfa\xfa\xfa\xfd\xfd\xfd\xe4\xe3\xe3\xd6\xd9\xd9\xd1\xbe\xbe\xf5\xef\xeebcd\x00\x00\x00 \x10\x1d.0/?>>LLLRRR\xa9\xa9\xa9\xf7\xf7\xf7\xeb\xeb\xeb\xed\xed\xed\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xed\xed\xed\xee\xee\xee\xed\xed\xed\xed\xee\xee\xee\xee\xee\xdb\xd8\xd9\xea\xf1\xeb\xf4\xcc\xe9\xe6\xbe\xda\xf7\xff\xf8\xf5\xf3\xf4\xef\xed\xed\xe1\xe0\xe0\xe6\xe6\xe5\xc8\xc7\xc7\xe2\xe2\xe2\xe0\xe0\xe0\xe2\xe1\xe1\xdd\xdd\xdd\xe0\xe0\xe0\xe3\xe2\xe2\xdd\xdd\xdd\xdd\xdd\xdc\xdf\xdf\xdf\xda\xd9\xd9\xdf\xde\xde\xf9\xf8\xf9\xf8\xf8\xf8\xf8\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf9\xf9\xf9\xe5\xe5\xe4\xf6\xf7\xf6\xfb\xfa\xfb\xfa\xfa\xfa\xf9\xf9\xf9\xf3\xf4\xf4\xf0\xf4\xf1\xef\xf1\xee\xee\xef\xed\xee\xef\xee\xeb\xeb\xeb\xe7\xe7\xe7\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd2\xd2\xd7\xd7\xd7\xca\xc9\xc9\xcc\xcb\xcb\xd5\xd4\xd4\xd1\xd0\xd0\xe2\xe2\xe2\xea\xea\xe9\xf4\xf4\xf4\xe8\xe8\xe8\xde\xdd\xdd\xe9\xe9\xe8\xe4\xe3\xe3\xe5\xe4\xe4\xe7\xe6\xe6\xe6\xe5\xe5\xdc\xdb\xdb\xb7\xb6\xb5\xaf\xae\xad\xba\xb8\xb8\xb5\xb4\xb4\xad\xab\xab\xcb\xca\xca\xba\xb8\xb8\xb8\xb8\xb7\xe7\xe7\xe7\xd8\xd7\xd7\xce\xcd\xcd\xff\xff\xff\xf4\xf4\xf4\xde\xe1\xe1\xd2\xc5\xc5\xda\xcc\xcb\xe4\xe7\xe8\x22!!\x0c\x0b\x0c\x22!\x22111???PPP[[[\xab\xab\xab\xf7\xf7\xf7\xeb\xeb\xeb\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xed\xed\xed\xec\xec\xec\xed\xed\xed\xed\xed\xed\xed\xed\xed\xeb\xeb\xeb\xe9\xe7\xe8\xee\xf6\xf1\xea\xc5\xdc\xe1\xbc\xd3\xf8\xfe\xf9\xf9\xf5\xf6\xeb\xeb\xeb\xe3\xe3\xe3\xf4\xf4\xf4\xf1\xf0\xf0\xf5\xf4\xf4\xdb\xdb\xdb\xbb\xba\xba\xc1\xc1\xc1\xbe\xbd\xbd\xbd\xbc\xbc\xc6\xc5\xc5\xd1\xd0\xd0\xd9\xd9\xd9\xd6\xd5\xd5\xd1\xd1\xd0\xd0\xcf\xcf\xd0\xcf\xcf\xd2\xd1\xd1\xd1\xd0\xd0\xd2\xd2\xd2\xd7\xd7\xd6\xd4\xd2\xd2\xca\xcf\xce\xb1\xbd\xbb\xda\xd9\xd9\xd6\xd5\xd5\xd3\xd5\xd4\xb6\xcb\xc2\xb4\xc1\xc0\xb3\xc2\xc1\xb4\xc3\xc2\xb3\xcc\xc3\xc4\xca\xc7\xe5\xe3\xe4\xf8\xf8\xf8\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd1\xd1\xd1\xdd\xdd\xdd\xcc\xce\xce\x9d\x9e\x9e\xb8\xb9\xb9\xe4\xe6\xe6\xde\xdd\xdd\xd8\xd8\xd8\xd6\xd5\xd5\xdd\xdc\xdc\xeb\xeb\xeb\xfa\xfb\xfb\xc6\xc5\xc5\xdb\xdb\xda\xf8\xf8\xf8\xb5\xb4\xb4\xe6\xe5\xe5\xe9\xe8\xe8\xae\xae\xad\xf4\xf7\xf6\xd2\xd4\xd4\xb5\xb7\xb6\xfd\xff\xff\xc9\xc9\xc9\xcf\xce\xce\xd8\xd7\xd7\xc6\xc5\xc5\xf9\xf9\xf9\xff\xff\xff\xed\xef\xef\xd8\xd3\xd3\xd0\xb9\xb8\xec\xef\xef\xb0\xaf\xaf\x00\x00\x00\x1c\x1c\x1c)))777GGGSRRXXX\xae\xae\xae\xf5\xf5\xf5\xea\xea\xea\xed\xed\xed\xec\xec\xec\xed\xed\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xec\xec\xec\xed\xed\xed\xee\xee\xee\xee\xee\xee\xdb\xd9\xda\xf0\xf8\xf3\xe7\xc0\xd8\xea\xc2\xda\xe8\xf8\xf3\xda\xdf\xe0\xec\xec\xec\xf1\xf1\xf1\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xe2\xe1\xe1\x9c\x9b\x9b\xa5\xa4\xa3\xab\xaa\xaa\xac\xab\xab\xb3\xb2\xb1\xbf\xbe\xbe\xcd\xcc\xcc\xd5\xd4\xd4\xcb\xca\xca\xc6\xc5\xc5\xcf\xcf\xce\xcf\xce\xce\xc8\xc7\xc7\xc9\xc8\xc8\xc9\xc8\xc8\xdd\xdf\xdd\xd5\xc7\xcf\xb8\x9c\xac\xd9\xdb\xda\xd4\xd3\xd4\xd5\xd5\xd4\xcf\xcd\xcf\xce\xb6\xcd\xca\x9e\xb9\xcb\x9c\xb9\xc8\xae\xb7\xd6\xd2\xd2\xe7\xe8\xe8\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd3\xd3\xd4\xcf\xd0\xcb\xb6\xb9\xc8\xb3\xb6\xd6\xbe\xc1\xd4\xc3\xc6\xd5\xd6\xd5\xb2\xb1\xb1\xb9\xb8\xb8\xd9\xd9\xd9\xe2\xe2\xe1\xf0\xf0\xf0\xd5\xd5\xd4\xe3\xe3\xe2\xed\xed\xec\xd2\xd1\xd1\xe7\xe9\xe8\xe9\xec\xec\xd2\xc3\xc5\xeb\xd0\xd4\xe6\xcc\xcf\xdf\xc5\xc9\xe6\xcc\xcf\xda\xd4\xd4\xdc\xdd\xdd\xbe\xbd\xbd\xed\xed\xec\xff\xff\xff\xfb\xfb\xfb\xe5\xe6\xe6\xd4\xba\xb8\xd2\xcf\xcf\xf6\xf7\xf7ggg\x00\x00\x00! !,*+<<TWTWVV]\x5c\x5c\xb4\xb5\xb5\xf5\xf5\xf5\xec\xec\xec\xf2\xf2\xf2\xed\xed\xed\xee\xee\xee\xee\xee\xee\xed\xed\xed\xf1\xf1\xf1\xe2\xe2\xe2\xed\xed\xed\xee\xee\xee\xf0\xf0\xf0\xd3\xd1\xd1\xd1\xd7\xd2\xa9\x87\x9d\xe9\xb1\xc7\xfase\xf6RI\xf9\xde\xdc\xe0\xe2\xe5\x9b\x7d\x8e\x98\x83\x8f\xc1\xbc\xbe\xde\xdf\xde\xb2\xb0\xb0\xad\xac\xab\xb2\xb1\xb1\xaf\xae\xad\xb6\xb5\xb5\xb2\xb1\xb0\xac\xab\xab\xab\xaa\xaa\xb0\xae\xae\xb8\xb8\xb7\xb1\xb0\xb0\xb2\xb1\xb0\xbb\xbb\xba\xbd\xbc\xbc\xb6\xb5\xb5\xb4\xb5\xb4\xca\xc1\xc6\xb8\xa6\xb1\xd5\xd6\xd5\xd1\xd0\xd0\xd1\xd2\xd1\xcc\xc9\xca\xcb\xae\xbc\xc8\xae\xbc\xc8\xc8\xc9\xe3\xe7\xe6\xf2\xf2\xf2\xe7\xe7\xe7\xf7\xf7\xf7\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd3\xd3\xd6\xd5\xd5\xd6\xd0\xd1\xdb\xd5\xd6\xe0\xda\xdb\xe2\xdd\xde\xe9\xea\xea\xea\xea\xea\xee\xee\xee\xf0\xf0\xf0\xf1\xf1\xf1\xf5\xf5\xf5\xf1\xf1\xf1\xf3\xf2\xf2\xf5\xf5\xf5\xf0\xf0\xf0\xf4\xec\xed\xf2\xe7\xe8\xf2\xea\xeb\xf2\xeb\xec\xeb\xe7\xe8\xe3\xde\xde\xe4\xe3\xe3\xdb\xda\xda\xe8\xe8\xe7\xff\xff\xff\xfc\xfb\xfb\xff\xff\xff\xed\xde\xdd\xd7\xc0\xbf\xd2\xd6\xd7\xea\xea\xea\xb4\xb5\xb5\x01\x00\x01\x18\x14\x17%\x1e$4'2D@CVWVSRRhgg\xb6\xb6\xb6\xf6\xf6\xf6\xeb\xeb\xeb\xe2\xe2\xe2\xf1\xf1\xf1\xed\xed\xed\xed\xed\xed\xed\xed\xed\xf0\xf0\xf0\xc0\xc0\xc0\xe4\xe4\xe4\xef\xef\xef\xef\xef\xef\xd5\xd3\xd4\xc8\xcf\xca\xc1\x9b\xb1\xe6\xc1\xd8\xfb\xc9\xc0\xf4\xa5\xa1\xff\xfb\xfa\xc6\xbd\xc3\xa9\x98\xa1\xe6\xec\xe9\xe6\xe6\xe6\xe8\xe7\xe7\xac\xab\xab\xaa\xa8\xa8\xad\xac\xab\xbb\xba\xba\xb7\xb6\xb6\xb7\xb6\xb6\xb0\xaf\xae\xb1\xb0\xaf\xae\xad\xac\xb4\xb3\xb3\xbc\xbb\xbb\xae\xad\xad\xac\xab\xaa\xb6\xb5\xb5\xb3\xb2\xb2\xe1\xe1\xe0\xe5\xe5\xe4\xda\xda\xd9\xeb\xea\xea\xe8\xe7\xe7\xe8\xe7\xe7\xe4\xe4\xe3\xe1\xe3\xe2\xdf\xe0\xdf\xdf\xde\xde\xe1\xe0\xe0\xe2\xe2\xe2\xe6\xe6\xe6\xf8\xf8\xf8\xf6\xf6\xf6\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd2\xd2\xd2\xda\xda\xda\xd3\xd5\xd4\xd5\xd6\xd6\xdd\xdf\xdf\xe5\xe6\xe6\xe7\xe6\xe6\xea\xe9\xe9\xeb\xeb\xeb\xf0\xef\xef\xf3\xf3\xf3\xf0\xf0\xf0\xef\xef\xef\xf1\xf0\xf0\xee\xed\xed\xef\xef\xef\xee\xf0\xef\xf7\xf9\xf8\xf6\xf7\xf6\xf6\xf7\xf7\xf4\xf5\xf5\xe8\xea\xea\xe3\xe2\xe2\xef\xee\xee\xff\xff\xff\xfd\xfd\xfd\xfe\xff\xff\xfc\xf5\xf5\xe3\xc4\xc2\xd6\xd8\xd8\xd2\xd2\xd1\xf6\xf6\xf6lll\x00\x00\x00!!!,-,;<;IIIYYYYXXtss\xb8\xb8\xb8\xf7\xf7\xf7\xe2\xe2\xe2\xc0\xc0\xc0\xf0\xf0\xf0\xed\xed\xed\xed\xed\xed\xee\xee\xee\xeb\xeb\xeb\xef\xef\xef\xea\xea\xea\xee\xee\xee\xed\xec\xec\xe7\xe4\xe5\xd6\xde\xd9\xe7\xbc\xd6\xeb\xc1\xda\xff\xff\xff\xff\xfd\xfe\xfa\xf9\xfa\xdc\xd8\xdb\xcf\xc9\xcd\xd0\xcd\xcf\xe8\xe5\xe8\xe2\xdf\xe1\xb4\xb1\xb3\xb7\xb3\xb5\xb4\xb1\xb2\xb2\xae\xb0\xb9\xb6\xb8\xb7\xb4\xb6\xb8\xb5\xb7\xb7\xb4\xb5\xb3\xb0\xb2\xb4\xb0\xb2\xbe\xba\xbc\xb9\xb5\xb7\xb2\xae\xb0\xb1\xae\xb0\xb6\xb2\xb4\xe0\xdd\xdf\xe8\xe7\xe8\xfb\xfb\xfb\xff\xff\xff\xfe\xfe\xfe\xff\xfe\xff\xfd\xfb\xfd\xfa\xf7\xfa\xf8\xf5\xf8\xf7\xf5\xf7\xf7\xf4\xf6\xf2\xef\xf1\xe8\xe6\xe8\xf6\xf4\xf6\xf5\xf3\xf5\xff\xfd\xff\xdc\xdb\xdc\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd3\xd3\xd5\xd5\xd5\xbf\xbe\xbe\xc2\xc1\xc1\xca\xc9\xc9\xc3\xc2\xc2\xcb\xca\xca\xcd\xcc\xcc\xce\xcd\xcd\xca\xca\xc9\xcf\xcf\xcf\xcf\xce\xce\xd0\xd0\xd0\xd2\xd1\xd1\xd0\xcf\xcf\xd2\xd2\xd2\xc6\xc5\xc5\xbe\xbd\xbd\xc7\xc6\xc6\xbf\xbd\xbd\xcd\xcd\xcd\xde\xdd\xdc\xe5\xe4\xe4\xfb\xfb\xfb\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xff\xf4\xd2\xd1\xde\xd7\xd7\xd4\xd6\xd6\xda\xda\xda\xe8\xe8\xe8))(\x0b\x0e\x0c%(%374AGBQSQddd\x5c[[kjj\xbc\xbc\xbc\xf5\xf5\xf5\xe9\xe9\xe9\xef\xef\xef\xeb\xeb\xeb\xee\xee\xee\xee\xee\xee\xed\xed\xed\xef\xef\xef\xda\xda\xda\xee\xee\xee\xed\xed\xed\xef\xef\xef\xd7\xd3\xd5\xc1\xce\xc4\xf3\xdd\xe8\xe6\xd1\xdb\xf6\xff\xf8\xf4\xfd\xf2\xed\xf8\xee\xe5\xf0\xe7\xe8\xf5\xeb\xcf\xdc\xd0\xe7\xf4\xe9\xdf\xec\xe1\xc9\xd6\xca\xd0\xdd\xd1\xc9\xd6\xca\xc8\xd5\xc9\xd0\xde\xd2\xd2\xde\xd3\xd0\xde\xd2\xd4\xe1\xd6\xcc\xd8\xce\xc8\xd4\xc9\xc9\xd6\xca\xcb\xd8\xcc\xcf\xdc\xd1\xcb\xd9\xcd\xc4\xd2\xc5\xed\xf6\xef\xe8\xf3\xea\xee\xfa\xf0\xf4\xff\xf6\xf3\xfe\xf5\xf3\xfe\xf5\xee\xfc\xf0\xeb\xf8\xee\xe9\xf6\xeb\xe8\xf5\xeb\xe9\xf5\xeb\xe6\xf1\xe7\xea\xf3\xeb\xf7\xff\xf9\xf6\xfd\xf8\xff\xff\xff\xdc\xdd\xdd\xbc\xbc\xbc\xcb\xcb\xcb\xd0\xd0\xd0\xdc\xdc\xdc\xd1\xd1\xd0\xbb\xbb\xba\xcc\xcc\xcb\xe3\xe3\xe2\xed\xed\xed\xf4\xf4\xf4\xf7\xf7\xf7\xeb\xeb\xeb\xe7\xe7\xe6\xf7\xf7\xf6\xd4\xd3\xd2\xe3\xe3\xe2\xf4\xf4\xf3\xcf\xcf\xce\xe3\xe2\xe1\xca\xca\xc9\xa2\xa1\xa0\xc3\xc3\xc2\xe2\xe1\xe1\xdd\xdc\xdc\xf1\xf1\xf1\xff\xff\xff\xfd\xfc\xfc\xfe\xff\xff\xfd\xe2\xe1\xed\xda\xd9\xda\xdf\xdf\xd1\xd1\xd1\xe9\xe9\xe9\xb8\xac\xab\x03\x00\x01\x18\x07\x15!\x0b\x1d0\x11*G\x0f=TCQgkhmlmrqq\xbe\xbe\xbe\xf5\xf5\xf5\xeb\xeb\xeb\xda\xda\xda\xf0\xf0\xf0\xed\xed\xed\xee\xee\xee\xef\xef\xef\xeb\xeb\xeb\xcc\xcc\xcc\xea\xea\xea\xef\xef\xef\xf1\xf0\xf1\xd0\xd4\xd0\xd6\xaf\xce\xec\x9e\xdf\xe7\xa0\xdb\xe4\xa0\xd8\xe8\x9f\xdb\xe7\x9f\xdb\xe6\xa0\xda\xec\xa1\xdf\xec\xa5\xdf\xeb\xa1\xdf\xe8\xa1\xdc\xec\xa5\xe0\xed\xa4\xe0\xec\xa6\xe0\xf0\xa6\xe3\xef\xa5\xe2\xec\xa6\xe0\xf0\xa5\xe3\xec\xa5\xe0\xeb\xa6\xdf\xec\xa7\xe0\xf0\xa6\xe4\xef\xa6\xe3\xef\xa6\xe2\xf1\xa5\xe4\xf0\xa7\xe3\xe9\xa1\xdc\xe9\xa0\xdc\xe7\xa0\xdb\xe7\xa0\xda\xe6\xa0\xda\xe5\xa0\xd9\xe7\x9c\xda\xe0\x9c\xd4\xe0\x9b\xd4\xdd\x9a\xd1\xdb\x9a\xd0\xda\x9c\xcf\xe5\xa6\xda\xf5\xaa\xe9\xf4\xad\xe8\xfe\xb2\xf1\xdc\xb9\xd6\xbd\xc2\xbe\xcc\xcb\xcc\xd3\xd3\xd2\xd8\xd7\xd8\xc4\xc3\xc5\xa0\x9e\xa1\xb9\xb7\xbb\xd9\xd8\xda\xd1\xd0\xd0\xb9\xb8\xb8\xb9\xb8\xb8\xd4\xd3\xd3\xe7\xe6\xe9\xf3\xf2\xf6\xbc\xba\xbe\xd4\xd2\xd6\xf1\xf0\xf4\xb1\xaf\xb3\xe2\xe1\xe5\xe6\xe5\xe8\xb5\xb4\xb6\xe7\xe7\xe7\xe4\xe3\xe3\xf1\xf0\xf0\xff\xff\xff\xfd\xfd\xfd\xfe\xff\xff\xfd\xef\xee\xfa\xdb\xda\xe7\xeb\xec\xd5\xd5\xd4\xd3\xd4\xd4\xf6\xea\xeaqkj\x00\x00\x00 \x0e\x1c'\x10#6\x170K\x16BXIVlolqppvuu\xc1\xc1\xc1\xf6\xf6\xf6\xe6\xe6\xe6\xcd\xcd\xcd\xed\xed\xed\xef\xef\xef\xed\xed\xed\xee\xee\xee\xee\xed\xed\xec\xec\xec\xea\xeb\xea\xee\xee\xee\xf0\xed\xf0\xd2\xde\xd3\xe2\x8c\xd3\xde3\xc1\xddA\xc3\xdf@\xc4\xe4>\xc8\xe5>\xca\xdf?\xc4\xe8=\xcc\xe0=\xc5\xe7>\xcb\xde?\xc3\xdd>\xc2\xe5>\xca\xdb;\xc0\xe08\xc3\xda9\xbe\xd39\xb8\xde7\xc1\xde7\xc1\xd67\xba\xd37\xb8\xdd6\xc0\xdb6\xbf\xdb6\xbe\xe05\xc2\xd47\xb9\xd87\xbc\xdb7\xbf\xdd7\xc0\xd78\xbc\xd79\xbc\xdb7\xbf\xdc6\xbf\xd66\xba\xd38\xb8\xd7@\xbd\xd7J\xbf\xd3K\xbc\xd7B\xbe\xf4D\xd6\xf3K\xd7\xfdJ\xde\xdb\x8a\xcd\xbd\xc8\xbf\xcb\xc9\xcb\xd5\xd5\xd4\xce\xcd\xd1\xac\xa8\xb6\xc6\xc1\xd1\xc8\xc2\xd3\xc0\xbc\xc8\xde\xdf\xde\xc3\xc2\xc2\xcd\xcc\xcc\xe0\xdf\xe0\xc9\xc4\xd5\xd0\xca\xde\xd3\xce\xe1\xd1\xcc\xdf\xce\xc9\xdc\xd5\xd0\xe3\xce\xc9\xdb\xb6\xb2\xbe\xcf\xce\xd3\xe6\xe5\xe4\xeb\xea\xea\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfa\xf9\xfc\xd8\xd7\xf7\xf6\xf6\xde\xdf\xdf\xda\xd6\xd8\xcd\xcc\xcc\xd9\xd6\xd6//0\x09\x0a\x09#%#/20?C?KSL[][jjjvuu\x81\x80\x80\xc2\xc2\xc2\xf4\xf4\xf4\xe9\xea\xea\xed\xed\xed\xed\xed\xed\xee\xee\xee\xef\xef\xef\xee\xee\xee\xf2\xf1\xf1\xd5\xda\xd9\xd6\xdb\xda\xf2\xf1\xf1\xf0\xed\xf0\xd3\xde\xd4\xe0\x8d\xd1\xf3M\xd8\xe4G\xc9\xd5N\xbd\xeb[\xd3\xdda\xc8\xdcj\xc8\xddt\xcb\xe1\x7e\xd0\xdc\x86\xcc\xdd\x8e\xce\xdf\x98\xd2\xd5\x9b\xca\xee\xb6\xe5\xff\xcf\xfa\xfd\xd9\xfa\xff\xe6\xfd\xfe\xf3\xfe\xfe\xfd\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xfe\xfe\xfe\xff\xff\xfe\xfe\xfe\xfe\xff\xfe\xff\xfe\xff\xfe\xfe\xfe\xfc\xfe\xfd\xfa\xff\xfb\xfb\xfd\xfb\xee\xe2\xea\xd0\xb2\xc7\xd2\xa8\xc4\xf9\xfe\xfa\xf5\xfe\xf6\xf7\xfd\xf7\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd2\xd2\xd2\xd9\xd9\xd9\xe1\xe1\xe1\xe4\xe4\xe4\xeb\xeb\xea\xf1\xf1\xf1\xf3\xf3\xf3\xfa\xfa\xfa\xfd\xfd\xfd\xfa\xfa\xfa\xfb\xfc\xfb\xfc\xfc\xfc\xfb\xfb\xfa\xfb\xfb\xfb\xfc\xfc\xfc\xfa\xfa\xfa\xfe\xfe\xfd\xec\xec\xec\xdf\xdf\xde\xe6\xe5\xe5\xf9\xf9\xf9\xff\xff\xff\xfd\xfc\xfc\xfd\xff\xff\xfb\xdb\xd9\xfe\xf0\xf0\xef\xf1\xf2\xdc\xdb\xda\xc3\xd2\xc9\xc7\xca\xc9\xa6\xa6\xa6\x05\x07\x05\x19\x1a\x19(((767GFGVTVeeeuuu\x81\x80\x81\x91\x90\x90\xc3\xc4\xc3\xf8\xf7\xf7\xd4\xd9\xd8\xda\xdf\xde\xf2\xf1\xf1\xee\xee\xee\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xef\xee\xeb\xed\xe5\xef\xe7\xee\xaa\xe2\xea`\xd2\xdfi\xca\xd8m\xc5\xe0n\xcb\xd8u\xc7\xd5\x7d\xc5\xd8\x85\xc9\xd6\x8a\xc8\xd0\x8d\xc3\xd4\x95\xc8\xdf\xa8\xd5\xe4\xb5\xdb\xf2\xc5\xeb\xff\xd7\xfa\xfc\xdc\xf7\xfc\xe3\xf7\xfc\xec\xfa\xfd\xf7\xfc\xfb\xfb\xfb\xf4\xf1\xf3\xf4\xf0\xf3\xf5\xf5\xf5\xf3\xf3\xf3\xf5\xf4\xf5\xf4\xf3\xf3\xf1\xf1\xf1\xef\xee\xee\xee\xed\xee\xf0\xf0\xf0\xfc\xfc\xfc\xfe\xfe\xfe\xfc\xfd\xfc\xf3\xeb\xf1\xb6\x7b\xa5\xb8t\xa4\xbd\x94\xb1\xdb\xc8\xd5\xf4\xf4\xf4\xf4\xf3\xf4\xf6\xf5\xf6\xff\xfe\xff\xdc\xdc\xdc\xbd\xbd\xbd\xcc\xcc\xcc\xd3\xd3\xd3\xd8\xd8\xd8\xc2\xc1\xc1\xc6\xc5\xc5\xc9\xc8\xc8\xc7\xc6\xc6\xcd\xcd\xcd\xca\xca\xca\xcb\xca\xca\xdb\xdb\xdb\xfa\xfa\xfa\xf8\xf8\xf8\xf9\xf9\xf9\xf9\xf9\xf9\xf8\xf8\xf8\xfa\xfa\xfa\xf2\xf3\xf2\xe3\xe2\xe2\xda\xd8\xd8\xf0\xef\xef\xff\xff\xff\xfd\xfc\xfc\xfe\xff\xff\xfe\xe9\xe8\xfb\xe3\xe2\xfc\xff\xff\xe7\xe8\xe6\xd9\xd1\xdb\x9d\x97\xac\xd4\xe4\xdcuqs\x00\x00\x00 \x1a\x1f-.-<;;LLLZZZjji\x79\x79\x79\x86\x85\x85\x95\x95\x95\xc6\xc6\xc6\xf4\xf4\xf4\xed\xed\xed\xee\xee\xee\xef\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xef\xef\xef\xef\xef\xed\xed\xed\xe6\xe5\xe5\xec\xee\xec\xc1\xd7\xc4\xc1\xd9\xc5\xd1\xdd\xd2\xdb\xed\xde\xdc\xea\xde\xd8\xe0\xd9\xdf\xe7\xe0\xd9\xdf\xda\xda\xdf\xdb\xdd\xe2\xdd\xeb\xef\xeb\xf3\xf7\xf3\xf0\xf3\xf0\xec\xf1\xec\xf8\xfa\xf9\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xf8\xf8\xf8\xc4\xcf\xc5\xbf\xcc\xc0\xca\xca\xc9\xc0\xbf\xbf\xbe\xbd\xbd\xc8\xc7\xc6\xda\xda\xda\xd2\xd1\xd1\xd5\xd4\xd4\xdd\xdc\xdc\xf3\xf2\xf2\xe9\xe9\xe9\xe9\xe9\xe9\xe0\xdc\xdf\xe4\xd7\xe0\xf9\xfa\xf9\xfc\xff\xfd\xf7\xfa\xf8\xf2\xf2\xf2\xf5\xf5\xf5\xf6\xf6\xf6\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd2\xd2\xd7\xd7\xd7\xca\xc9\xca\xcf\xce\xce\xd4\xd3\xd4\xd0\xcf\xcf\xe3\xe3\xe3\xec\xec\xec\xf0\xf0\xf0\xe4\xe4\xe4\xde\xdd\xdd\xe8\xe7\xe7\xe6\xe5\xe6\xe5\xe5\xe5\xe6\xe6\xe6\xe3\xe3\xe3\xde\xde\xde\xe4\xe2\xe3\xef\xee\xee\xff\xff\xff\xfd\xfd\xfd\xff\xff\xff\xef\xf0\xf0\xdc\xd2\xd1\xff\xff\xff\xf6\xf6\xf6\xe0\xe4\xe3\xb8\x94\x95\xc1\x9a\xb4\xdf\xe1\xdf.,.\x0a\x00\x07$\x1a\x22343AAARRR```ppp\x80\x80\x80\x89\x89\x88\x95\x95\x95\xc9\xc9\xc9\xf4\xf4\xf4\xed\xee\xee\xef\xef\xef\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xee\xee\xef\xef\xef\xee\xed\xee\xe1\xe0\xdf\xee\xee\xee\xe3\x87\xd6\xd8l\xc6\xdc\xac\xd6\xe8\x7c\xdb\xf8\xc4\xf2\xff\xff\xff\xff\xff\xff\xed\xec\xed\xde\xdc\xdd\xde\xdd\xde\xdf\xde\xdf\xd5\xd3\xd4\xd8\xd7\xd8\xd5\xd3\xd4\xe2\xe0\xe1\xec\xeb\xeb\xe6\xe5\xe5\xfc\xfb\xfc\xfd\xff\xfe\xec\xa6\xe4\xde\x87\xd0\xe8\xe1\xe7\xe7\xe9\xe7\xe7\xe7\xe7\xea\xe9\xe9\xff\xff\xff\xed\xed\xed\xde\xde\xde\xde\xdd\xdd\xe0\xe0\xe0\xd9\xd9\xd9\xd8\xd7\xd7\xd6\xd6\xd5\xe1\xe3\xe1\xe2\xe1\xe1\xdb\xd9\xda\xf0\xef\xf0\xf3\xf3\xf3\xf4\xf4\xf4\xf6\xf6\xf6\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd0\xd0\xd0\xdc\xdd\xdd\xcc\xce\xcd\x9c\x9e\x9c\xb8\xba\xb8\xe4\xe6\xe5\xde\xdd\xdd\xd8\xd8\xd8\xd8\xd7\xd7\xde\xde\xde\xeb\xed\xec\xfa\xfd\xfc\xc3\xc6\xc4\xde\xdf\xde\xf8\xf8\xf8\xd3\xd3\xd2\xe8\xe7\xe7\xea\xe9\xe9\xfc\xfc\xfc\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xff\xbc\xbb\xbb\x9c\x9c\x9c\xc7\xc6\xc6\xee\xee\xee\xdf\xe0\xe1\xc6\xbb\xb7\xce\xd0\xca\xb7\xb7\xb8\x07\x07\x07\x16\x17\x16$%$333AAAPPP^]]lll\x7b\x7a\x7a\x89\x89\x89\x9a\x99\x99\xcb\xcc\xcb\xf3\xf3\xf3\xed\xed\xed\xee\xee\xee\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xef\xef\xef\xf0\xf0\xf0\xef\xef\xef\xf0\xf0\xf0\xf0\xef\xf0\xdc\xdf\xdc\xe8\xd7\xe5\xeb+\xcd\xedJ\xd4\xef\x81\xe0\xd7\x1a\xbd\xf3\xb1\xeb\xff\xff\xff\xff\xfe\xff\xdd\xdd\xdd\xa9\xa8\xa7\xae\xac\xac\xb1\xb0\xb0\xb5\xb3\xb4\xb9\xba\xb7\xbc\xbe\xb8\xad\xad\xab\xb1\xb0\xb0\xbb\xba\xba\xfa\xfc\xfa\xfe\xf6\xfd\xf3\x22\xd3\xec0\xcc\xff\xfc\xff\xfe\xff\xfe\xff\xfe\xfe\xfd\xfd\xfd\xff\xff\xff\xdd\xdd\xdd\xaa\xa9\xa9\xad\xac\xac\xb3\xb1\xb1\xb2\xb1\xb1\xac\xab\xab\xac\xab\xab\xaa\xa9\xa9\xa7\xa6\xa6\xb7\xb6\xb6\xf0\xf0\xf0\xf3\xf3\xf3\xf4\xf4\xf4\xf6\xf6\xf6\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd2\xd3\xd3\xd5\xcf\xd2\xcd\xb6\xc2\xc9\xb2\xbd\xd6\xbd\xc9\xd4\xc3\xcc\xd5\xd6\xd5\xb7\xb5\xb5\xbc\xbc\xbb\xd8\xd7\xd7\xe3\xcb\xd7\xf2\xd5\xe3\xde\xc3\xd0\xce\xb9\xc3\xd7\xcf\xd3\xdf\xdf\xdf\xd7\xd6\xd6\xf9\xf9\xf9\xff\xff\xff\xfc\xfc\xfc\xff\xff\xff\xd3\xd2\xd2\xae\xad\xad\xcc\xcb\xca\xb6\xb5\xb5\xa2\xa1\xa0\xc9\xc9\xc9\xd9\xdc\xdd\xf2\xf2\xf3uuu\x00\x00\x00\x1e\x1e\x1e-.-<>=OPO[ZZjjjxxx\x87\x87\x86\x96\x96\x96\xa1\xa1\xa0\xb3\xb2\xb2\xd9\xd9\xd9\xf4\xf4\xf4\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf2\xf2\xf2\xf2\xf2\xf2\xf1\xf1\xf1\xf2\xf2\xf2\xf1\xf1\xf1\xf2\xf2\xf2\xf2\xf2\xf2\xdc\xda\xda\xe8\xe9\xe8\xd7\xe3\xd8\xce\xd5\xcf\xda\xe1\xda\xdb\xe6\xdc\xfd\xfd\xfd\xff\xff\xff\xe9\xe8\xe8\xd1\xd0\xd0\xae\xae\xad\xab\xaa\xaa\xbb\xbc\xb7\xea\xee\xe7\xe3\xe9\xde\xcd\xd4\xc5\xad\xad\xac\xa3\xa2\xa2\xc1\xc0\xc0\xdc\xdb\xdb\xf0\xf2\xf0\xd7\xe8\xd9\xd4\xde\xd5\xdf\xdf\xdf\xd8\xd8\xd7\xe2\xe1\xe1\xff\xff\xff\xe3\xe2\xe2\xd3\xd3\xd2\xac\xaa\xaa\xac\xaf\xa7\xdb\xe0\xd6\xec\xed\xed\xd7\xdb\xd3\xa2\xa2\xa0\xa8\xa7\xa7\xa0\x9f\x9f\xba\xb9\xb9\xd1\xd1\xd0\xe8\xe8\xe8\xf7\xf7\xf7\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd1\xd1\xd0\xdc\xdc\xdc\xd1\xd1\xd1\xbf\xbe\xbe\xcf\xce\xce\xe2\xe2\xe2\xf0\xef\xef\xf8\xf8\xf8\xfb\xfb\xfb\xea\xea\xea\xdd\xdd\xdd\xe5\xe5\xe5\xc9\xc7\xc7\xe0\xe0\xe0\xff\xff\xff\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xff\xff\xff\xf1\xf1\xf1\xda\xda\xda\xd4\xd4\xd4\xe8\xe8\xe8\xc4\xc4\xc4\x09\x09\x09\x16\x16\x16 \x1f+++>>>TTTddduuu\x83\x83\x83\x93\x93\x93\xa4\xa3\xa3\xac\xac\xac\xc0\xbf\xbf\xda\xdb\xda\xf5\xf5\xf5\xf1\xf1\xf1\xf1\xf1\xf1\xf2\xf2\xf2\xf2\xf2\xf2\xf2\xf2\xf2\xf2\xf2\xf2\xf1\xf1\xf1\xf2\xf2\xf2\xf1\xf1\xf1\xf2\xf2\xf2\xf0\xef\xf0\xe4\xe3\xe3\xef\xee\xef\xdb\x8d\xd1\xd5s\xc9\xee\xdf\xec\xfa\xfb\xfa\xfe\xfc\xfe\xff\xff\xff\xee\xee\xee\xd7\xd6\xd6\xae\xad\xac\xa7\xa6\xa5\xc3\xc2\xc2\xf3\xf4\xf1\xc9\xd1\xc2\xa4\xa8\xa0\xae\xad\xad\xaa\xa9\xa8\xb9\xb8\xb8\xde\xde\xde\xf4\xf5\xf4\xf1e\xe0\xe9G\xd1\xf1\xe5\xef\xf2\xf5\xf2\xf3\xf2\xf3\xff\xff\xff\xed\xec\xec\xd8\xd8\xd8\xb1\xb0\xaf\xd1\xd8\xca\xdf\xe0\xdd\xe1\xe7\xdb\xd3\xdd\xcb\xa0\xa1\x9e\xac\xaa\xab\xa4\xa3\xa3\xb5\xb4\xb4\xd3\xd3\xd3\xed\xed\xed\xf6\xf6\xf6\xf5\xf5\xf5\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd1\xd1\xd1\xd7\xd7\xd7\xc5\xc5\xc4\x9f\x9e\x9e\xb9\xb8\xb8\xda\xda\xda\xcf\xcf\xcf\xb7\xb6\xb5\xb7\xb6\xb5\xd4\xd4\xd4\xe1\xe1\xe1\xd2\xd1\xd1\xd2\xd1\xd1\xff\xff\xff\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xe9\xe9\xe9\xd7\xd7\xd7\xd1\xd1\xd1\xf3\xf3\xf3\x87\x87\x87\x00\x00\x00 ++*565<\x073H\x07>>\x05\x05\x05###222?>?I.DW5Qieh\x7c\x7b\x7b\x89\x87\x88\x99\x97\x98\xa8\xa6\xa7\xb4\xb3\xb3\xcc\xcb\xcb\xdf\xdf\xdf\xf4\xf4\xf4\xf1\xf1\xf1\xf1\xf1\xf1\xf2\xf2\xf2\xf2\xf2\xf2\xf3\xf3\xf3\xf3\xf3\xf3\xf2\xf2\xf2\xf3\xf3\xf3\xf2\xf2\xf2\xf3\xf3\xf3\xf1\xf1\xf1\xe6\xe5\xe5\xf5\xf3\xf4\xf2\xe4\xef\xea\xdf\xe8\xff\xff\xff\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xff\xff\xff\xdf\xdf\xdf\xac\xac\xab\xb0\xaf\xaf\xae\xac\xac\xab\xab\xa9\xab\xac\xa9\xab\xab\xaa\xb1\xaf\xaf\xad\xac\xac\xb9\xb8\xb8\xf3\xf3\xf3\xff\xff\xff\xf1\xf1\xf0\xe9\xe8\xe8\xff\xff\xff\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xff\xff\xff\xdf\xdf\xdf\xb0\xaf\xaf\xdf\xe0\xdd\xd0\xd6\xc7\xb6\xba\xae\xa5\xa3\xa2\xac\xab\xab\xaa\xaa\xa9\xa5\xa4\xa4\xb5\xb5\xb4\xea\xea\xea\xf4\xf4\xf4\xf4\xf4\xf4\xf6\xf6\xf6\xff\xff\xff\xdc\xdc\xdc\xbc\xbc\xbc\xcb\xcb\xcb\xd1\xd1\xd1\xd8\xd8\xd8\xd3\xd3\xd3\xd6\xd6\xd6\xdb\xdb\xdb\xe2\xe2\xe2\xe4\xe3\xe3\xea\xe9\xe9\xed\xee\xee\xf5\xf5\xf5\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xff\xff\xff\xf2\xf2\xf2\xdb\xdb\xdb\xd2\xd2\xd2\xe4\xe4\xe4\xcd\xcd\xcd\x0d\x0d\x0d\x16\x18\x16%'%+-+:>;IQJXcYv\x7cw\x84\x8a\x85\x94\x9a\x95\xa3\xaa\xa4\xb3\xbb\xb4\xb0\xb1\xaf\xbd\xbb\xbb\xe5\xe5\xe5\xf4\xf4\xf4\xf2\xf2\xf2\xf2\xf2\xf2\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xf2\xf2\xf2\xf3\xf3\xf3\xf2\xf2\xf2\xf3\xf3\xf3\xf3\xf3\xf3\xd8\xd7\xd7\xe9\xe8\xe8\xff\xff\xff\xfd\xfd\xfe\xfd\xfd\xfd\xfe\xfe\xfe\xfd\xfd\xfd\xfd\xfd\xfd\xff\xff\xff\xdd\xdd\xdd\xa8\xa6\xa6\xad\xac\xac\xad\xab\xab\xae\xad\xad\xac\xaa\xab\xad\xac\xac\xad\xac\xab\xaa\xa8\xa8\xb5\xb4\xb4\xee\xed\xed\xff\xff\xff\xfe\xfd\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xff\xff\xff\xdf\xdf\xdf\xa9\xa7\xa8\xae\xb1\xaa\xbe\xc5\xb7\xab\xac\xa7\xa7\xa6\xa6\xa8\xa7\xa6\xa8\xa7\xa6\xa1\xa0\xa0\xb4\xb3\xb2\xe5\xe5\xe5\xf5\xf5\xf5\xf5\xf5\xf5\xf7\xf7\xf7\xff\xff\xff\xdd\xdd\xdd\xbd\xbd\xbd\xcc\xcc\xcc\xd2\xd2\xd2\xd9\xd9\xd9\xcb\xcb\xcb\xcf\xce\xce\xcf\xcf\xcf\xd7\xd7\xd7\xd8\xd7\xd7\xd2\xd1\xd1\xe7\xe8\xe8\xff\xff\xff\xf9\xf9\xf9\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xff\xff\xff\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xe9\xe9\xe9\xd7\xd7\xd7\xd1\xd1\xd1\xf3\xf3\xf3\x8c\x8c\x8c\x00\x00\x00\x1e\x18\x1d(\x1f'5(2F5CR -# -# 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. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - - -import sys -import wx -import os -sys.path+=["../lib/python"] -import gfx -import images -import stat - -basedir = os.getcwd() - -gfx.verbose(3) - -#try: -# gfx.setparameter("wxwindowparams", "1") -#except: -# gfx.setoption("wxwindowparams", "1") - -class StaticData: - def __init__(self): - self.simpleviewer_bitmap = wx.BitmapFromImage(wx.ImageFromData(images.simpleviewer_width,images.simpleviewer_height,images.simpleviewer_data)) - self.raw_bitmap = wx.BitmapFromImage(wx.ImageFromData(images.raw_width,images.raw_height,images.raw_data)) - self.motionpaper_bitmap = wx.BitmapFromImage(wx.ImageFromData(images.motionpaper_width,images.motionpaper_height,images.motionpaper_data)) - self.rfxview_bitmap = wx.BitmapFromImage(wx.ImageFromData(images.rfxview_width,images.rfxview_height,images.rfxview_data)) -staticdata = None - -HTMLTEMPLATE = """ - - - - - - - - - - - - -""" - -def error(msg): - dlg = wx.MessageDialog(None, msg, "Error", style=wx.OK, pos=wx.DefaultPosition) - dlg.ShowModal() - dlg.Destroy() - -def savefilestatus(msg): - dlg = wx.MessageDialog(None, msg, "Save file status", style=wx.OK, pos=wx.DefaultPosition) - dlg.ShowModal() - dlg.Destroy() - -def swfcombine(params): - exe = "swfcombine" - if os.path.sep == '/': - locations = [os.path.join(basedir, "swfcombine"), - "/usr/local/bin/swfcombine", - "/usr/bin/swfcombine" - ] - else: - locations = [os.path.join(basedir, "swfcombine.exe"), - "c:\\swftools\\swfcombine.exe"] - params = ['"'+p+'"' for p in params] - - for e in locations: - if os.path.isfile(e): - exe = e - break - - if hasattr(os,"spawnv"): - print "spawnv",exe,params - ret = -1 - try: - ret = os.spawnv(os.P_WAIT, exe, ["swfcombine"]+params) - except: - ret = -1 - if not ret: - return - - cmd = '"' + exe + '"' + " " + (" ".join(params)) - print "system",cmd - ret = os.system(cmd) - if ret&0xff00: - error("Couldn't execute swfcombine.exe- error code "+str(ret)) - -ICON_SIZE = 64 - -EVENT_PAGE_CHANGE = 1 -EVENT_FILE_CHANGE = 2 -EVENT_STATUS_TEXT = 4 - -class ProgressFrame(wx.Dialog): - def __init__(self, parent, message=""): - wx.Dialog.__init__(self, parent, -1, "Progress", size=(350, 150)) - panel = wx.Panel(self, -1) - self.count = 0 - - self.msg = wx.StaticText(panel, -1, message, (20,25)) - self.gauge = wx.Gauge(panel, -1, 100, (20, 50), (250, 25)) - - self.gauge.SetBezelFace(3) - self.gauge.SetShadowWidth(3) - - self.Bind(wx.EVT_WINDOW_DESTROY, self.close, id=wx.ID_CLOSE) - - def setProgress(self, num): - self.gauge.SetValue(int(num)) - - def close(self, event): - print "close" - - -def swapextension(filename,newext): - basename,ext = os.path.splitext(filename) - return basename + "." + newext - -def has_different_size_pages(doc): - width,height = 0,0 - for i in range(1,doc.pages+1): - page = doc.getPage(i) - if i==1: - width,height = page.width,page.height - else: - if abs(width-page.width)>2 or \ - abs(height-page.height)>2: - return 1 - return 0 - - -options = [] -gfx_options = {} - -class Option: - def __init__(self, parameter, text, options, default, mapping=None): - self.parameter = parameter - self.text = text - self.options = options - self.default = default - self.mapping = mapping - self.control = None - self.enabled = 1 - self.register() - - def generateControl(self, panel): - if type(self.options) == type((0,)): - control = wx.Choice(panel, -1, choices=self.options) - control.SetSelection(self.default) - elif self.options == "slider": - control = wx.Slider(panel, -1, self.default, 0, 100, size=(100, -1), style=wx.SL_HORIZONTAL|wx.SL_LABELS|wx.SL_TOP) - elif self.options == "spinner": - control = wx.SpinCtrl(panel, -1, str(self.default)) - else: - control = wx.Choice(panel, -1, choices=["broken"]) - control.SetSelection(0) - - self.control = control - return self.control - - def getSettings(self): - value = "" - if type(self.options) == type((0,)): - value = self.options[self.control.GetCurrentSelection()] - if self.mapping and value in self.mapping: - value = str(self.mapping[value]) - if value == "yes": - value = "1" - elif value == "no": - value = "0" - return {self.parameter:value} - elif self.options == "slider" or self.options == "spinner": - value = str(self.control.GetValue()) - return {self.parameter:value} - - def register(self): - global options - options += [self] - -class Option2(Option): - - def __init__(self, parameter, text, options, default, mapping=None): - Option.__init__(self, parameter, text, options, default, mapping) - self.enabled = 0 - - def generateControl(self, panel): - p = wx.Panel(panel, -1) - #p.SetOwnBackgroundColour('#ff0000') - h = wx.BoxSizer(wx.HORIZONTAL) - control = wx.Choice(p, -1, choices=self.options) - control.SetSelection(self.default) - text = wx.StaticText(p, -1, self.text) - h.Add(text,1,wx.EXPAND|wx.ALIGN_LEFT|wx.TOP, 5) - h.Add(control,1,wx.EXPAND|wx.ALIGN_RIGHT|wx.ALIGN_TOP) - self.control = control - if self.enabled: - control.Enable() - else: - control.Disable() - p.SetSizer(h) - p.Fit() - return p - - def Disable(self): - self.enabled=0 - if self.control: - self.control.Disable() - - def Enable(self): - self.enabled=1 - if self.control: - self.control.Enable() - - def getSettings(self): - if not self.enabled: - return {} - return Option.getSettings(self) - -class ChooseAndText(Option): - def __init__(self, parameter, text, options, default, editselection, textvalue=""): - Option.__init__(self, parameter, text, options, default) - self.editselection = editselection - self.selection = default - self.textvalue = textvalue - self.enabled = 0 - self.choice = None - - def generateControl(self, panel): - p = wx.Panel(panel, -1) - h = wx.BoxSizer(wx.HORIZONTAL) - control = wx.Choice(p, -1, choices=self.options) - p.Bind(wx.EVT_CHOICE, self.OnChoice, control) - control.SetSelection(self.default) - text = wx.StaticText(p, -1, self.text) - if self.selection == self.editselection: - edittext = wx.TextCtrl(p, -1, self.textvalue) - self.textvalue = "" - else: - edittext = wx.TextCtrl(p, -1, "") - edittext.Disable() - p.Bind(wx.EVT_TEXT, self.OnText, edittext) - h.Add(text,1,wx.EXPAND|wx.ALIGN_LEFT|wx.TOP, 5) - h.Add(control,1,wx.EXPAND|wx.ALIGN_RIGHT) - h.Add(edittext,1,wx.EXPAND|wx.ALIGN_RIGHT) - self.choice = control - self.edittext = edittext - if self.enabled: - control.Enable() - else: - control.Disable() - p.SetSizer(h) - p.Fit() - return p - - def OnText(self, event): - text = self.edittext.GetValue() - text2 = "".join(c for c in text if c.isdigit()) - if text2!=text: - self.edittext.SetValue(text2) - - def OnChoice(self, event): - self.selection = self.choice.GetCurrentSelection() - if self.selection != self.editselection: - if not self.textvalue and self.edittext.GetValue(): - self.textvalue = self.edittext.GetValue() - self.edittext.SetValue("") - self.edittext.Disable() - else: - if self.textvalue and not self.edittext.GetValue(): - self.edittext.SetValue(self.textvalue) - self.textvalue = "" - self.edittext.Enable() - - def Disable(self): - self.enabled=0 - if not self.choice: - return - self.choice.Disable() - self.edittext.Disable() - - def Enable(self): - self.enabled=1 - if not self.choice: - return - self.choice.Enable() - if self.choice.GetCurrentSelection() == self.editselection: - if self.textvalue and not self.edittext.GetValue(): - self.edittext.SetValue(self.textvalue) - self.textvalue = "" - self.edittext.Enable() - else: - self.edittext.Disable() - - def getSettings(self): - if not self.enabled: - return {} - if self.choice.GetCurrentSelection() != self.editselection: - value = self.options[self.choice.GetCurrentSelection()] - else: - value = self.edittext.GetValue().strip() - return {self.parameter:value} - -class TextOption: - def __init__(self, parameter, label, default=""): - self.parameter = parameter - self.label = label - self.default = default - self.register() - - def generateControl(self, panel): - v = wx.BoxSizer(wx.VERTICAL) - self.control = wx.TextCtrl(panel, -1, self.default, size=(250, -1)) - self.control.Fit() - return self.control - - def getSettings(self): - settings = {} - for items in self.control.GetValue().split(" "): - if "=" in items: - l = items.split("=") - if len(l) == 2: - settings[l[0]] = l[1] - return settings - - def register(self): - global options - options += [self] - -class RadioOption(Option): - def __init__(self, text, options): - self.text = text - self.options = options - self.selected = "==nothing==" - self.radios = [] - self.register() - - def generateControl(self, panel): - control = wx.Panel(panel, -1) - vsplit = wx.BoxSizer(wx.VERTICAL) - for i in range(len(self.options)/2): - text = self.options[i*2] - if i == 0: - c = wx.RadioButton(control, -1, text, style=wx.RB_GROUP) - else: - c = wx.RadioButton(control, -1, text) - control.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, c) - self.radios += [c] - vsplit.Add(c) - control.SetSizer(vsplit) - control.Fit() - self.control = control - return control - - def OnRadio(self, event): - self.selected = event.GetEventObject().GetLabel() - - def getSettings(self): - for i in range(len(self.options)/2): - if self.options[i*2] == self.selected: - return self.options[i*2+1] - return self.options[1] - -class BitmapWindow(wx.Window): - def __init__(self, parent, image): - wx.Window.__init__(self, parent, -1) - self.image = image - self.SetMinSize((image.GetWidth()+2, image.GetHeight()+2)) - self.SetMaxSize((image.GetWidth()+2, image.GetHeight()+2)) - self.SetSize((image.GetWidth()+2, image.GetHeight()+2)) - self.Bind(wx.EVT_PAINT, self.OnPaint) - self.Update() - def OnPaint(self, event): - dc = wx.PaintDC(self) - self.Draw(dc) - def Draw(self,dc=None): - if not dc: - dc = wx.ClientDC(self) - dc.DrawRectangleRect((0, 0, self.image.GetWidth()+2, self.image.GetHeight()+2)) - dc.DrawBitmap(self.image, 1, 1, False) - -class ImageRadioOption(Option): - def __init__(self, text, options): - self.text = text - self.options = options - self.selected = "==nothing==" - self.radios = [] - self.register() - self.ids = [] - - def generateControl(self, panel): - control = wx.Panel(panel, -1) - vsplit = wx.BoxSizer(wx.VERTICAL) - first = 1 - for image,text,params,selected,extraoptions in self.options: - hsplit = wx.BoxSizer(wx.HORIZONTAL) - - v = wx.BoxSizer(wx.VERTICAL) - - name,text = text.split("- ") - - c = wx.CheckBox(control, -1, name) - control.Bind(wx.EVT_CHECKBOX, self.OnRadio, c) - - # radio buttons crash windows when clicked on- even without event bindings. - # This is caused by the subpanel which is created for extra options - # (I tried this with a empty Panel(), and even that crashed) - #if first: - # c = wx.RadioButton(control, -1, name, style=wx.RB_GROUP) - #else: - # c = wx.RadioButton(control, -1, name) - #control.Bind(wx.EVT_RADIOBUTTON, self.OnRadio, c) - - self.ids += [c.GetId()] - - first = 0 - - if "disable" in text: - c.Enable(False) - if selected: - self.selected = c.GetId() - c.SetValue(True) - else: - c.SetValue(False) - self.radios += [c] - - bitmap = BitmapWindow(control, image) - t = wx.StaticText(control, -1, text, size=(400,50)) - - v.Add(c, 0, wx.EXPAND) - v.Add(t, 0, wx.EXPAND|wx.LEFT, 20) - - for o in extraoptions: - cx = o.generateControl(control) - if selected: - o.Enable() - else: - o.Disable() - v.Add(cx, 0, wx.EXPAND|wx.LEFT, 20) - - v.SetMinSize((330,170)) - - hsplit.Add(bitmap, 0, wx.LEFT|wx.RIGHT|wx.BOTTOM|wx.ALIGN_TOP, 5) - hsplit.Add(v, 0, wx.EXPAND) - vsplit.Add(hsplit, 0, wx.EXPAND) - - control.SetSizer(vsplit) - control.Fit() - self.control = control - return vsplit - - def OnRadio(self, event): - self.selected = event.GetEventObject().GetId() - for c in self.radios: - if c.GetId() == self.selected: - c.SetValue(1) - else: - c.SetValue(0) - i = 0 - for image,text,params,selected,extraoptions in self.options: - if self.ids[i] == self.selected: - for xo in extraoptions: - xo.Enable() - pass - else: - for xo in extraoptions: - xo.Disable() - pass - i = i + 1 - event.ResumePropagation(0) - - def getSettings(self): - i = 0 - for image,text,params,s,extraoptions in self.options: - id = self.ids[i] - i = i + 1 - if id == self.selected: - return params - return {} - - -class OptionFrame(wx.Dialog): - - def __init__(self, parent): - wx.Dialog.__init__(self, parent, -1, "Options") - - #self.nb = wx.Notebook(self, -1)#, wx.Point(0,0), wx.Size(0,0), wxNB_FIXEDWIDTH) - self.nb = wx.Notebook(self, -1) - - self.needreload = 0 - - options0 = [RadioOption('Rendering mode', - ["Convert polygons to polygons and fonts to fonts", {}, - "Convert fonts to fonts, everything else to bitmaps", {"poly2bitmap":"1"}, - "Convert everthing to bitmaps", {"poly2bitmap":"1", "bitmapfonts":"1"} - ])] - - mp_options = [] - sv_options = [Option2('flashversion', 'Flash version:', ('4','5','6','7','8'), 2), - Option2('transparent', 'Make SWF file transparent:', ('no','yes'), 0), - ] - - raw_options = [Option2('flashversion', 'Flash version:', ('4','5','6','7','8','9'), 2), - Option2('insertstop', 'Insert stop after each frame:', ('no','yes'), 0), - Option2('transparent', 'Make SWF file transparent:', ('no','yes'), 0), - ] - rfxview_options = [ChooseAndText('rfxwidth', 'Width:', ('same as PDF','fullscreen','custom'),1,2,"600"), - ChooseAndText('rfxheight', 'Height:', ('same as PDF','fullscreen','custom'),1,2,"800"), - Option2('rfxzoomtype', 'Initial zoom level:', ('Original resolution','Show all','Maximum width/height'),2), - ] - - options4 = [ImageRadioOption('Select Paging GUI', - [(staticdata.raw_bitmap, "No Viewer- The SWF will be in \"raw\" format, with each page a seperate frame. Use this if you want to add a viewer yourself afterwards.", {}, 0, raw_options), - (staticdata.simpleviewer_bitmap, "SimpleViewer- A tiny viewer, which attaches directly to the SWF, and provides small previous/next buttons in the upper left corner", {"simpleviewer":"1", "insertstop":"1"}, 0, sv_options), - (staticdata.rfxview_bitmap, "rfxView- A more sophisticated viewer with zooming and scrolling.", {"rfxview":"1", "flashversion":"8"}, 1, rfxview_options), - #(staticdata.motionpaper_bitmap, "MotionPaper- A highly sophisticated viewer with page flipping. (disabled in this evaluation version)", {}, 0, mp_options), - #(staticdata.motionpaper_bitmap, "Your advertisement here- Are you are company who developed a viewer for pdf2swf, or who offers commercial PDF hosting service? Place your advertisement or demo viewer here, or allow pdf2swf to upload SWFs directly to your site! contact sales@swftools.org for details.", {}, 0, mp_options), - ])] - - options1 = [Option('zoom', 'Resolution (in dpi):', "spinner", 72), - Option('fontquality', 'Font quality:', "slider", 20), - Option('storeallcharacters', 'Insert full fonts in SWF file:', ('no','yes'), 0), - Option('splinequality', 'Polygon quality:', "slider", 100), - Option('jpegquality', 'JPEG quality:', "slider", 75), - Option('jpegsubpixels', 'JPEG image resolution:', ('same as in PDF', '1x', '2x', '4x'), 0, {"same as in PDF": 0, "1x": 1, "2x": 2, "3x": 3}), - Option('ppmsubpixels', 'non-JPEG image resolution:', ('same as in PDF', '1x', '2x', '4x'), 0, {"same as in PDF": 0, "1x": 1, "2x": 2, "3x": 3}), - ] - - - options3 = [TextOption('_additional_', 'Additional options')] - - panel1 = [('Rendering options', options0,''), - ('Quality',options1,'v')] - panel3 = [('Select paging GUI', options4,'')] - panel4 = [('Additional options', options3,'')] - - panels = [('Quality', panel1), - ('Viewer', panel3), - ('Advanced', panel4)] - - for name,poptions in panels: - panel = wx.Panel(self.nb, -1) - self.nb.AddPage(panel, name) - - vsplit = wx.BoxSizer(wx.VERTICAL) - - for name,options,align in poptions: - optiongroup = wx.StaticBox(panel, -1, name) - optiongroupsizer= wx.StaticBoxSizer(optiongroup, wx.VERTICAL) - optiongroup.SetSizer(optiongroupsizer) - - if align == 'v': - grid = wx.GridSizer(rows=len(options), cols=2, hgap=3, vgap=3) - optiongroupsizer.Add(grid, 1, wx.EXPAND, 0) - else: - grid = wx.GridSizer(rows=len(options), cols=1, hgap=3, vgap=3) - optiongroupsizer.Add(grid, 1, wx.EXPAND, 0) - - for option in options: - if align=='v': - t = wx.StaticText(panel, -1, option.text) - grid.Add(t, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT) - optionbox = option.generateControl(panel) - grid.Add(optionbox, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT) - - vsplit.Add(optiongroupsizer, 0, wx.EXPAND, 0) - - #hs = wx.BoxSizer(wx.HORIZONTAL) - #hs.Add(gobutton, 0, wx.ALIGN_CENTER, 0) - gobutton = wx.Button(panel, -1, "Apply") - self.Bind(wx.EVT_BUTTON, self.Apply, gobutton) - - vsplit.Add(gobutton, 0, wx.ALIGN_CENTER|wx.ALL, 0) - - panel.SetSizer(vsplit) - panel.Fit() - - self.nb.Fit() - - self.Fit() - - - def updateOptions(self): - global options,gfx_options - a = [] - - # FIXME: we clear *our* options- but gfx will still have - # stored the old ones. Critical for options in the "imageradio" section. - gfx_options.clear() - i = 0 - print "----- options ------" - for option in options: - for k,v in option.getSettings().items(): - gfx_options[k] = v - gfx.setparameter(k,v) - print k,v - i = i + 1 - - # TODO: filter out "global" options, and do this only if - # pdf layer is affected - - def Apply(self, event): - self.updateOptions() - self.Hide() - self.needreload = 1 - - -class State: - def __init__(self): - self.pdf = None - self.page = None - self.pagenr = 1 - self.pagebitmap = None - self.bitmap_width = 0 - self.bitmap_height = 0 - self.bitmap_page = 0 - self.filename = None - self.status_text = None - self.lastsavefile = "output.swf" - self.lasthtmlfile = "index.html" - - self.listeners = [] - - def onEvent(self,event_type, function): - self.listeners += [(event_type,function)] - def loadPDF(self,filename): - self.filename = filename - self.lastsavefile = swapextension(filename,"swf") - self.lasthtmlfile = swapextension(filename,"html") - - self.pdf = gfx.open("pdf",filename) - if(has_different_size_pages(self.pdf)): - # just let the user know- for now, we can't handle this properly - dlg = wx.MessageDialog(app.frame, """In this PDF, width or height are not the same for each page. This might cause problems if you export pages of different dimensions into the same SWF file.""", "Notice", style=wx.OK, pos=wx.DefaultPosition) - dlg.ShowModal() - dlg.Destroy() - - self.changePage(1) - - for type,f in self.listeners: - if type&EVENT_PAGE_CHANGE or type&EVENT_FILE_CHANGE: - f() - self.setStatus("File loaded successfully.") - - def saveSWF(self, filename, progress, pages=None, html=0): - if html: - basename,ext = os.path.splitext(filename) - if not ext: - html = basename + ".html" - filename = basename + ".swf" - elif ext.lower() != ".swf": - html = filename - filename = basename + ".swf" - else: - html = basename + ".html" - filename = filename - - steps = 100.0 / (self.pdf.pages*2 + 3) - pos = [0] - - self.lastsavefile = filename - if html: - self.lasthtmlfile = html - - swf = gfx.SWF() - for k,v in gfx_options.items(): - swf.setparameter(k,v) - if pages is None: - pages = range(1,self.pdf.pages+1) - pdfwidth,pdfheight=0,0 - for pagenr in pages: - page = self.pdf.getPage(pagenr) - pdfwidth = page.width - pdfheight = page.height - swf.startpage(page.width, page.height) - page.render(swf) - swf.endpage() - swf.save(filename) - if not os.path.isfile(filename): - error("Couldn't create file "+filename) - - if gfx_options.get("rfxview",None): - rfxview = os.path.join(basedir, "rfxview.swf") - if not os.path.isfile(rfxview): - error("File rfxview.swf not found in working directory") - else: - size1 = os.stat(filename)[stat.ST_SIZE] - swfcombine([rfxview,"viewport="+filename,"-o",filename]) - size2 = os.stat(filename)[stat.ST_SIZE] - if size1 == size2: - error("Couldn't add viewer to file "+filename) - - if html: - version = int(gfx_options.get("flashversion", "8")) - swf = gfx.open("swf", filename) - page1 = swf.getPage(1) - - width,height = str(page1.width),str(page1.height) - - - w = gfx_options.get("rfxwidth","") - if w == "fullscreen": width = "100%" - elif w == "same as PDF": width = pdfwidth+40 - elif w.isdigit(): width = w - else: width = pdfwidth - - h = gfx_options.get("rfxheight","") - if h == "fullscreen": height = "100%" - elif h == "same as PDF": height = pdfheight+70 - elif h.isdigit(): height = h - else: height = pdfwidth - - flashvars = "" - zoomtype = gfx_options.get("rfxzoomtype","") - if zoomtype=="Original resolution": - flashvars = "zoomtype=1" - elif zoomtype=="Show all": - flashvars = "zoomtype=2" - elif zoomtype=="Maximum width/height": - flashvars = "zoomtype=3" - - swffilename = os.path.basename(filename) - fi = open(html, "wb") - fi.write(HTMLTEMPLATE % locals()) - fi.close() - - - def changePage(self,page): - self.pagenr = page - self.page = self.pdf.getPage(self.pagenr) - for type,f in self.listeners: - if type&EVENT_PAGE_CHANGE: - f() - - def getPageIcon(self,pagenr): - page = self.pdf.getPage(pagenr) - return wx.BitmapFromImage(wx.ImageFromData(ICON_SIZE,ICON_SIZE,page.asImage(ICON_SIZE,ICON_SIZE))) - #return wx.BitmapFromImage(wx.ImageFromData(8,8,"0"*(64*3))) - - def getPageImage(self, width, height): - if self.bitmap_width == width and self.bitmap_height == height and self.bitmap_page == self.pagenr: - return self.pagebitmap - else: - self.bitmap_width = width - self.bitmap_height = height - self.bitmap_page = self.pagenr - self.pagebitmap = wx.BitmapFromImage(wx.ImageFromData(width,height,self.page.asImage(width,height))) - #self.pagebitmap = wx.BitmapFromImage(wx.ImageFromData(8,8,"0"*(64*3))) - return self.pagebitmap - - def setStatus(self,text): - self.status_text = text - for type,f in self.listeners: - if type&EVENT_STATUS_TEXT: - f() - -state = State() - -class PageListWidget(wx.ListCtrl): - def __init__(self,parent): - wx.ListCtrl.__init__(self,parent,style=wx.LC_ICON|wx.LC_AUTOARRANGE) - #self.SetMinSize((ICON_SIZE+8,-1)) - #self.SetMaxSize((ICON_SIZE+8,-1)) - #self.SetSize((ICON_SIZE+8,-1)) - self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.SelectItem) - state.onEvent(EVENT_FILE_CHANGE, self.reload) - state.onEvent(EVENT_PAGE_CHANGE, self.switchPage) - self.reload() - self.dontcare = 0 - #self.Bind(wx.EVT_IDLE, self.OnIdle) - #print dir(self) - - def processFiles(self): - if self.filepos >= 0 and self.filepos < state.pdf.pages: - icon = state.getPageIcon(self.filepos+1) - self.imglist.Add(icon) - self.InsertImageStringItem(self.filepos, str(self.filepos+1), self.filepos) - self.filepos = self.filepos + 1 - self.Update() - - def OnIdle(self,event): - self.processFiles() - event.ResumePropagation(0) - - def reload(self): - self.filepos = -1 - self.DeleteAllItems() - self.imglist = wx.ImageList(ICON_SIZE,ICON_SIZE,mask=False) - self.AssignImageList(self.imglist,wx.IMAGE_LIST_NORMAL) - self.filepos = 0 - while state.pdf and self.filepos < state.pdf.pages: - self.processFiles() - - def switchPage(self): - if self.dontcare: - self.dontcare = 0 - return - for i in range(0,self.GetItemCount()): - self.Select(i, False) - self.Select(state.pagenr-1, True) - self.Focus(state.pagenr-1) - self.Update() - - def SelectItem(self,event): - self.dontcare = 1 #ignore next change event - state.changePage(event.GetIndex()+1) - - -helptxt = """ -This is the SWF preview window. -Here, you will see how the SWF file generated from -the PDF file will look like. Changing parameters in -the configuration which affect the appeareance of -the final SWF will affect this preview, too, so you -can always evaluate the final output beforehand. -""" - - -class OnePageWidget(wx.Window): - def __init__(self,parent): - wx.Window.__init__(self, parent) - self.SetSize((160,100)) - self.SetMinSize((160,100)) - self.Fit() - self.Bind(wx.EVT_PAINT, self.OnPaint) - self.Bind(wx.EVT_SIZE, self.OnSize) - self.Bind(wx.EVT_KEY_DOWN, self.key_down) - state.onEvent(EVENT_PAGE_CHANGE, self.OnPageChange) - - def key_down(self, event): - if state.pdf: - if event.GetKeyCode() == 312 and state.pagenr>1: - state.changePage(state.pagenr-1) - elif event.GetKeyCode() == 313 and state.pagenr state.page.height * window_width: - width = window_width - height = window_width * state.page.height / state.page.width - posy = (window_height - height) / 2 - else: - width = window_height * state.page.width / state.page.height - height = window_height - posx = (window_width - width) / 2 - - dc.DrawBitmap(state.getPageImage(width,height), posx,posy, False) - #state.getPageImage( - - def OnPaint(self, event): - dc = wx.PaintDC(self) - self.Draw(dc) - -class Pdf2swfFrame(wx.Frame): - #def __init__(self): - #wx.Window.__init__(self, None, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize) - def __init__(self,application): - wx.Frame.__init__(self, None, -1, style = wx.DEFAULT_FRAME_STYLE) - self.application = application - - self.SetTitle("pdf2swf") - self.createMenu() - self.createToolbar() - self.createStatusBar() - self.createMainFrame() - - self.SetSize((800,600)) - - self.options = OptionFrame(None) - self.options.Show(False) - self.options.updateOptions() - - state.onEvent(EVENT_STATUS_TEXT, self.status_change) - self.html = 0 - - #self.table = wx.AcceleratorTable([(wx.ACCEL_ALT, ord('X'), 333),]) - #self.SetAcceleratorTable(self.table) - - self.Bind(wx.EVT_IDLE, self.OnIdle) - self.Bind(wx.EVT_CLOSE, self.menu_exit) - return - - def menu_open(self,event): - global state - if state.filename: - dlg = wx.FileDialog(self, "Choose PDF File:", style = wx.DD_DEFAULT_STYLE, defaultFile = state.filename, wildcard = "PDF files (*.pdf)|*.pdf|all files (*.*)|*.*") - else: - dlg = wx.FileDialog(self, "Choose PDF File:", style = wx.DD_DEFAULT_STYLE, wildcard = "PDF files (*.pdf)|*.pdf|all files (*.*)|*.*") - - if dlg.ShowModal() == wx.ID_OK: - self.filename = dlg.GetFilename() - state.loadPDF(self.filename) - - def menu_save(self,event,pages=None): - html,self.html = self.html,0 - global state - if not state.pdf: - return - print "html",html - if not html: - defaultFile = state.lastsavefile - else: - defaultFile = state.lasthtmlfile - dlg = wx.FileDialog(self, "Choose Save Filename:", style = wx.SAVE | wx.OVERWRITE_PROMPT, defaultFile = defaultFile, wildcard = "all files (*.*)|*.*|SWF files (*.swf)|*.swf|HTML template (*.html)|*.html") - - if dlg.ShowModal() == wx.ID_OK: - filename = os.path.join(dlg.GetDirectory(),dlg.GetFilename()) - - #progress = ProgressFrame(self, "Saving %s File '%s'..." % (html and "HTML" or "SWF", filename)) - #progress.Show(True) - progress = None - state.saveSWF(filename, progress, pages, html) - #progress.Destroy() - - def menu_save_selected(self,event): - if not state.pdf: - return - p = [] - for i in range(0,self.pagelist.GetItemCount()): - if self.pagelist.IsSelected(i): - p += [i+1] - self.menu_save(event, pages=p) - - def menu_save_html(self,event): - self.html = 1 - return self.menu_save(event) - - def menu_save_selected_html(self,event): - self.html = 1 - return self.menu_save_selected(event) - - def menu_exit(self,event): - self.application.Exit() - - def menu_selectall(self,event): - for i in range(0,self.pagelist.GetItemCount()): - self.pagelist.Select(i, True) - def menu_options(self,event): - self.options.Show(True) - - def status_change(self): - self.statusbar.SetStatusText(state.status_text) - - def OnIdle(self,event): - if self.options.needreload: - self.options.needreload = 0 - if state.pdf: - # reload - state.loadPDF(state.filename) - - def createMenu(self): - menubar = wx.MenuBar() - - menu = wx.Menu();menubar.Append(menu, "&File") - menu.Append(wx.ID_OPEN, "Open PDF\tCTRL-O");self.Bind(wx.EVT_MENU, self.menu_open, id=wx.ID_OPEN) - menu.AppendSeparator() - menu.Append(wx.ID_SAVE, "Save SWF (all pages)\tCTRL-W");self.Bind(wx.EVT_MENU, self.menu_save, id=wx.ID_SAVE) - menu.Append(wx.ID_SAVEAS, "Save SWF (selected pages)\tCTRL-S");self.Bind(wx.EVT_MENU, self.menu_save_selected, id=wx.ID_SAVEAS) - menu.AppendSeparator() - menu.Append(2001, "Save HTML template (all pages)\tCTRL-H");self.Bind(wx.EVT_MENU, self.menu_save_html, id=2001) - menu.Append(2002, "Save HTML template (selected pages)");self.Bind(wx.EVT_MENU, self.menu_save_selected_html, id=2002) - menu.AppendSeparator() - menu.Append(wx.ID_EXIT, "Exit\tCTRL-Q");self.Bind(wx.EVT_MENU, self.menu_exit, id=wx.ID_EXIT) - - menu = wx.Menu();menubar.Append(menu, "&Edit") - menu.Append(wx.ID_SELECTALL, "Select All\tCTRL-A");self.Bind(wx.EVT_MENU, self.menu_selectall, id=wx.ID_SELECTALL) - menu.AppendSeparator() - menu.Append(wx.ID_PREFERENCES, "Options\tCTRL-R");self.Bind(wx.EVT_MENU, self.menu_options, id=wx.ID_PREFERENCES) - - menu = wx.Menu();menubar.Append(menu, "&Help") - - self.SetMenuBar(menubar) - - - def createToolbar(self): - - tsize = (16,16) - self.toolbar = self.CreateToolBar(wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT) - - self.toolbar.AddSimpleTool(wx.ID_OPEN, - wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, tsize), - "Open") - self.toolbar.AddSimpleTool(wx.ID_SAVE, - wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, tsize), - "Save selected pages") - self.toolbar.AddSimpleTool(wx.ID_PREFERENCES, - wx.ArtProvider.GetBitmap(wx.ART_LIST_VIEW, wx.ART_TOOLBAR, tsize), - "Options") - #self.toolbar.AddSeparator() - self.toolbar.Realize() - - def createStatusBar(self): - self.statusbar = self.CreateStatusBar(1) - - def createMainFrame(self): - - if 0: - self.pagelist = PageListWidget(self) - self.onepage = OnePageWidget(self) - hsplit = wx.BoxSizer(wx.HORIZONTAL) - pagelistbox = wx.StaticBox(self, -1, "Pages") - pagelistboxsizer= wx.StaticBoxSizer(pagelistbox, wx.VERTICAL) - pagelistboxsizer.Add(self.pagelist, proportion=1, flag=wx.EXPAND) - onepagebox = wx.StaticBox(self, -1, "Page 1") - onepageboxsizer= wx.StaticBoxSizer(onepagebox, wx.VERTICAL) - onepageboxsizer.Add(self.onepage, proportion=1, flag=wx.EXPAND) - hsplit.Add(pagelistboxsizer, 0, wx.EXPAND, 0) - hsplit.Add(onepageboxsizer, 1, wx.EXPAND, 0) - self.SetAutoLayout(True) - self.SetSizer(hsplit) - hsplit.Fit(self) - hsplit.SetSizeHints(self) - else: - hsplit = wx.SplitterWindow(self, style=wx.SP_3D|wx.SP_LIVE_UPDATE) - #p1 = wx.Panel(hsplit,-1, style=wx.SUNKEN_BORDER) - #p2 = wx.Panel(hsplit,-1, style=wx.SUNKEN_BORDER) - self.pagelist = PageListWidget(hsplit) - self.onepage = OnePageWidget(hsplit) - #hsplit.SplitVertically(p1,p2, sashPosition=64) - hsplit.SplitVertically(self.pagelist, self.onepage, sashPosition=ICON_SIZE*3/2) - hsplit.SetMinimumPaneSize(10) - -class MyApp(wx.App): - def __init__(self): - wx.App.__init__(self, redirect=False, filename=None, useBestVisual=False) - - #state.loadPDF("sitis2007.pdf") - #state.loadPDF("wxPython-Advanced-OSCON2004.pdf") - global staticdata - staticdata = StaticData() - - self.frame = Pdf2swfFrame(self) - self.SetTopWindow(self.frame) - self.frame.Show(True) - - #self.frame = TestFrame(self) - #self.frame.Show(True) - - def OnInit(self): - return True - -app = MyApp() -app.MainLoop() -