diff -Nru gnash-0.8.7/aclocal.m4 gnash-0.8.8~bzr.trunk12341yavdr1/aclocal.m4 --- gnash-0.8.7/aclocal.m4 1970-01-01 01:00:00.000000000 +0100 +++ gnash-0.8.8~bzr.trunk12341yavdr1/aclocal.m4 2010-07-29 19:05:10.000000000 +0100 @@ -0,0 +1,1271 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, +[m4_warning([this file was generated for autoconf 2.64. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------------------------- +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. +# +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. +# +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). +# +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. +AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 2.0 are not + dnl supported. (2.0 was released on October 16, 2000). + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], + [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl +python2.1 python2.0]) + + m4_if([$1],[],[ + dnl No version check is needed. + # Find any Python interpreter. + if test -z "$PYTHON"; then + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) + fi + am_display_PYTHON=python + ], [ + dnl A version check is needed. + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + AC_MSG_CHECKING([whether $PYTHON version >= $1]) + AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(too old)]) + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + AC_CACHE_CHECK([for a Python interpreter with version >= $1], + [am_cv_pathless_PYTHON],[ + for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do + test "$am_cv_pathless_PYTHON" = none && break + AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) + done]) + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + ]) + + if test "$PYTHON" = :; then + dnl Run any user-specified action, or abort. + m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) + else + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. + + AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], + [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) + AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], + [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) + AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [if test "x$prefix" = xNONE + then + am_py_prefix=$ac_default_prefix + else + am_py_prefix=$prefix + fi + am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) + am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + + AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [if test "x$exec_prefix" = xNONE + then + am_py_exec_prefix=$am_py_prefix + else + am_py_exec_prefix=$exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || + echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) + am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages + ;; + esac + ;; + esac + ]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + + AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) + + dnl Run any user-specified action. + $2 + fi + +]) + + +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). +AC_DEFUN([AM_PYTHON_CHECK_VERSION], + [prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] +sys.exit(sys.hexversion < minverhex)" + AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([macros/agg.m4]) +m4_include([macros/alp.m4]) +m4_include([macros/argz.m4]) +m4_include([macros/boost.m4]) +m4_include([macros/classes.m4]) +m4_include([macros/curl.m4]) +m4_include([macros/dbus.m4]) +m4_include([macros/docbook.m4]) +m4_include([macros/ffmpeg.m4]) +m4_include([macros/firefox.m4]) +m4_include([macros/freetype.m4]) +m4_include([macros/gettext.m4]) +m4_include([macros/gles.m4]) +m4_include([macros/glib.m4]) +m4_include([macros/gnashpkgtool.m4]) +m4_include([macros/gtk2.m4]) +m4_include([macros/gtkglext.m4]) +m4_include([macros/haxe.m4]) +m4_include([macros/hildon.m4]) +m4_include([macros/iconv.m4]) +m4_include([macros/kde3.m4]) +m4_include([macros/kde4.m4]) +m4_include([macros/lib-link.m4]) +m4_include([macros/lib-prefix.m4]) +m4_include([macros/libexe.m4]) +m4_include([macros/libtool.m4]) +m4_include([macros/ltdl.m4]) +m4_include([macros/ltoptions.m4]) +m4_include([macros/ltsugar.m4]) +m4_include([macros/ltversion.m4]) +m4_include([macros/lt~obsolete.m4]) +m4_include([macros/ming.m4]) +m4_include([macros/mtasc.m4]) +m4_include([macros/mysql.m4]) +m4_include([macros/nls.m4]) +m4_include([macros/opengl.m4]) +m4_include([macros/pango.m4]) +m4_include([macros/pkg.m4]) +m4_include([macros/po.m4]) +m4_include([macros/progtest.m4]) +m4_include([macros/pthreads.m4]) +m4_include([macros/python.m4]) +m4_include([macros/qt3.m4]) +m4_include([macros/qt4.m4]) +m4_include([macros/sdl.m4]) +m4_include([macros/swfmill.m4]) +m4_include([macros/x11.m4]) +m4_include([cygnal/acinclude.m4]) diff -Nru gnash-0.8.7/backend/Makefile.am gnash-0.8.8~bzr.trunk12341yavdr1/backend/Makefile.am --- gnash-0.8.7/backend/Makefile.am 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,114 +0,0 @@ -# -# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -# -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# - - -## Process this file with automake to generate Makefile.in - -AUTOMAKE_OPTIONS = - -#AM_CPPFLAGS = # -Wall - -# this is where Gnash plugins get installed -pluginsdir = $(libdir)/gnash/plugins - -## WARNING: make sure GLIB_LIBS appears first -## See: http://lists.gnu.org/archive/html/gnash-dev/2006-07/msg00076.html - -AM_CPPFLAGS = -I.. \ - -I$(srcdir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/libamf \ - -I$(top_srcdir)/libnet \ - -I$(top_srcdir)/libcore \ - -I$(top_srcdir)/libcore/parser \ - -I$(top_srcdir)/libcore/swf \ - -I$(top_srcdir)/libbase \ - -I$(top_srcdir)/backend \ - $(PTHREAD_CFLAGS) \ - $(SDL_CFLAGS) \ - $(PANGO_CFLAGS) \ - $(GLIB_CFLAGS) \ - $(ATK_CFLAGS) \ - $(DMALLOC_CFLAGS) \ - $(PNG_CFLAGS) \ - $(JPEG_CFLAGS) \ - $(OGG_CFLAGS) \ - $(BOOST_CFLAGS) \ - $(OPENGL_CFLAGS) \ - $(AGG_CFLAGS) \ - $(CAIRO_CFLAGS) \ - $(NULL) - -noinst_HEADERS = \ - Renderer.h \ - Renderer_agg.h \ - Renderer_agg_bitmap.h \ - Renderer_agg_style.h \ - Renderer_cairo.h \ - Renderer_ogl.h \ - PathParser.h - -# bin_PROGRAMS = gnash - -noinst_LTLIBRARIES = # set later on by conditionals -pkglib_LTLIBRARIES = # set later on by conditionals - -if BUILD_OGL_RENDERER -if HAVE_OPENGL -noinst_LTLIBRARIES += libgnashogl.la -#plugins_LTLIBRARIES += libgnashogl.la -libgnashogl_la_SOURCES = Renderer_ogl.cpp PathParser.cpp -#libgnashogl_la_LDFLAGS = -module -avoid-version -no-undefined -libgnashogl_la_LDFLAGS = -libgnashogl_la_LIBADD = $(OPENGL_LIBS) -endif -endif - -if BUILD_AGG_RENDERER -if HAVE_AGG -#noinst_LTLIBRARIES += libgnashagg.la -pkglib_LTLIBRARIES += libgnashagg.la -libgnashagg_la_SOURCES = Renderer_agg.cpp -#libgnashagg_la_LDFLAGS = -module -avoid-version -no-undefined -libgnashagg_la_LIBADD = $(AGG_LIBS) -endif -endif - -if BUILD_CAIRO_RENDERER -if HAVE_CAIRO -noinst_LTLIBRARIES += libgnashcairo.la -# plugins_LTLIBRARIES += libgnashcairo.la -libgnashcairo_la_SOURCES = Renderer_cairo.cpp PathParser.cpp -#libgnashcairo_la_LDFLAGS = -module -avoid-version -no-undefined -libgnashcairo_la_LIBADD = $(CAIRO_LIBS) -endif -endif - -# Rebuild with GCC 4.x Mudflap support -mudflap: - @echo "Rebuilding with GCC Mudflap support" - $(MAKE) CXXFLAGS="$(CXXFLAGS) -fmudflap" LDFLAGS="$(LDFLAGS) -lmudflap" - -clean-hook: - -rm -f core.* - -# install-pluginsLTLIBRARIES: $(plugins_LTLIBRARIES) -# test -d "$(DESTDIR)$(pluginsdir)" || $(mkinstalldirs) "$(DESTDIR)$(pluginsdir)" -# for i in $(plugins_LTLIBRARIES); do \ -# $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$i "$(DESTDIR)$(pluginsdir)/$$i" ; \ -# done diff -Nru gnash-0.8.7/backend/PathParser.cpp gnash-0.8.8~bzr.trunk12341yavdr1/backend/PathParser.cpp --- gnash-0.8.7/backend/PathParser.cpp 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/PathParser.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,189 +0,0 @@ -// -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software -// Foundation, Inc -// -// 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, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// - -#include -#include "PathParser.h" -#include -#include - -namespace gnash -{ - -const point& -UnivocalPath::startPoint() const -{ - return _fill_type == FILL_LEFT ? _path->ap : _path->m_edges.back().ap; -} - -const point& -UnivocalPath::endPoint() const -{ - return _fill_type == FILL_LEFT ? _path->m_edges.back().ap : _path->ap; -} - -PathParser::PathParser(const std::vector& paths, size_t numstyles) -: _paths(paths), - _num_styles(numstyles), - _shape_origin(0, 0), - _cur_endpoint(0, 0) -{} - -void -PathParser::run(const cxform& cx, const SWFMatrix& mat) -{ - // Since we frequently remove an element from the front or the back, we use - // a double ended queue here. - typedef std::deque UniPathList; - - std::vector unipathvec(_num_styles); - - for (size_t i = 0; i < _paths.size(); ++i) { - - if (_paths[i].empty()) { - continue; - } - - int leftfill = _paths[i].getLeftFill(); - if (leftfill) { - unipathvec[leftfill-1].push_front(UnivocalPath(&_paths[i], UnivocalPath::FILL_LEFT)); - } - - int rightfill = _paths[i].getRightFill(); - if (rightfill) { - unipathvec[rightfill-1].push_front(UnivocalPath(&_paths[i], UnivocalPath::FILL_RIGHT)); - } - } - - for (size_t i = 0; i < _num_styles; ++i) { - - start_shapes(i+1, cx); - UniPathList& path_list = unipathvec[i]; - - while (!path_list.empty()) { - - if (closed_shape()) { - reset_shape(path_list.front()); - path_list.pop_front(); - } - - UniPathList::iterator it = emitConnecting(path_list); - - if (it == path_list.end()) { - if (!closed_shape()) { - std::cout << "error: path not closed!" << std::endl; - _cur_endpoint = _shape_origin; - } - } else { - path_list.erase(it); - } - - } - end_shapes(i+1); - } - -} - -std::deque::iterator -PathParser::emitConnecting(std::deque& paths) -{ - std::deque::iterator it = paths.begin(), - end = paths.end(); - while (it != end) { - - if ((*it).startPoint() == _cur_endpoint) { - break; - } - - ++it; - } - - if (it != end) { - append(*it); - } - return it; -} - -void -PathParser::append(const UnivocalPath& append_path) -{ - const std::vector& edges = append_path._path->m_edges; - - if (append_path._fill_type == UnivocalPath::FILL_LEFT) { - - std::for_each(edges.begin(), edges.end(), boost::bind(&PathParser::line_to, - this, _1)); - } else { - - for (std::vector::const_reverse_iterator prev = edges.rbegin(), - it = boost::next(prev), end = edges.rend(); it != end; ++it, ++prev) { - if ((*prev).straight()) { - lineTo((*it).ap); - } else { - line_to(Edge((*prev).cp, (*it).ap)); - } - } - - line_to(Edge(edges.front().cp, append_path.endPoint())); - } - - _cur_endpoint = append_path.endPoint(); -} - -void -PathParser::line_to(const Edge& curve) -{ - if (curve.straight()) { - lineTo(curve.ap); - } else { - curveTo(curve); - } -} - -void -PathParser::start_shapes(int fill_style, const cxform& cx) -{ - prepareFill(fill_style, cx); -} - -void -PathParser::end_shapes(int fill_style) -{ - terminateFill(fill_style); -} - -void -PathParser::reset_shape(const UnivocalPath& append_path) -{ - fillShape(); - - _shape_origin = append_path.startPoint(); - - moveTo(_shape_origin); - - append(append_path); -} - -bool -PathParser::closed_shape() -{ - return _cur_endpoint == _shape_origin; -} - - -} // namespace gnash diff -Nru gnash-0.8.7/backend/PathParser.h gnash-0.8.8~bzr.trunk12341yavdr1/backend/PathParser.h --- gnash-0.8.7/backend/PathParser.h 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/PathParser.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,127 +0,0 @@ -// -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software -// Foundation, Inc -// -// 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, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#ifndef GNASH_PATH_PARSER_H -#define GNASH_PATH_PARSER_H - - -#include "Geometry.h" -#include -#include -#include "cxform.h" - -namespace gnash -{ - -/// Wraps a path, indicating whether we consider the left or the right of -/// the fill. -struct UnivocalPath -{ - enum fill_type - { - FILL_RIGHT, - FILL_LEFT - }; - - UnivocalPath() : _path(NULL), _fill_type(FILL_LEFT) {} - - UnivocalPath(const Path* path, fill_type filltype) - : _path(path), - _fill_type(filltype) - { - } - - const point& startPoint() const; - const point& endPoint() const; - - const Path* _path; - fill_type _fill_type; -}; - -/// PathParser is a class which aims to efficiently transpose Flash paths into -/// well formed, single-filled shapes. -// -/// A renderer should utilize this class by subclassing PathParser. The methods -/// reimplemented will receive low level path information (e.g., moveTo). -class PathParser : boost::noncopyable -{ -public: - /// @param paths list of Flash paths to be 'parsed'. - /// @param num_styles count of fill styles pointed to by the first argument. - PathParser(const std::vector& paths, size_t num_styles); - - virtual ~PathParser() { } - - /// Runs the path parser, invoking the pure virtual methods where - /// appropriate. - /// @param cx the color transform that will be passed to prepareFill. - /// @param mat the SWFMatrix that will be passed to prepareFill. - void run(const cxform& cx, const SWFMatrix& mat); - - /// Prepare the fill style for subsequent use for filling one or more shapes. - /// @param fill_style fill style number, as indicated by class Path. - virtual void prepareFill(int fill_style, const cxform& cx) = 0; - - /// Terminates the fill style, that is, precludes the fill style from further - /// use, which may be freed or otherwise cleaned up. Most renderers should - /// fill the paths previously parsed. - virtual void terminateFill(int fill_style) = 0; - - /// Fill a single shape. Implementation is optional, because most renderers - /// can handle multiple well-formed, singly-filled shapes and can do the - /// render/fill stage during terminateFill(). However, those that can't may - /// implement this method. - virtual void fillShape() - { - } - - /// Move the path pencil to the given location. Thus a new shape should be - /// started. The parser may invoke this method several times for a single - /// fill style, creating several shapes. - virtual void moveTo(const point& p) = 0; - - /// Draw the given curve using the path pencil. - virtual void curveTo(const Edge& curve) = 0; - - /// Draw a straight line to the given point. - virtual void lineTo(const point& p) = 0; - -private: - std::deque::iterator emitConnecting(std::deque& paths); - - void append(const UnivocalPath& append_path); - - void start_shapes(int fill_style, const cxform& cx); - - void end_shapes(int fill_style); - - void reset_shape(const UnivocalPath& append_path); - - bool closed_shape(); - - void line_to(const Edge& curve); - - const std::vector& _paths; - const size_t _num_styles; - point _shape_origin; - point _cur_endpoint; -}; - -} - -#endif // __PATH_PARSER_H diff -Nru gnash-0.8.7/backend/ProxyRenderer.cpp gnash-0.8.8~bzr.trunk12341yavdr1/backend/ProxyRenderer.cpp --- gnash-0.8.7/backend/ProxyRenderer.cpp 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/ProxyRenderer.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,232 +0,0 @@ -// render.cpp Rendering interface for Gnash -// -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. -// -// 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, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -// Based on original by Willem Kokke 2003 - -#include "GnashImage.h" -#include "BitmapInfo.h" - -// Define this to have all renderer calls print a message (with -vv) -#undef DEBUG_RENDER_CALLS - -#ifdef DEBUG_RENDER_CALLS - #include "log.h" -#endif - -#include -#include - -namespace gnash { -static Renderer* s_Renderer = NULL; - -void set_Renderer(Renderer* r) -{ - s_Renderer = r; -} - -Renderer* get_Renderer() -{ - return s_Renderer; -} - - -namespace render -{ - - /// A fake BitmapInfo created when no renderer - /// is registered. - /// - /// Note that if you register a renderer *after* one of - /// these bogus BitmapInfo has been created and attached - /// as the cache of a movie element, things would likely - /// screw up. - /// - class bogus_bi : public BitmapInfo - { - public: - bogus_bi() {} - }; - - BitmapInfo* createBitmapInfo(std::auto_ptr im) - { - - if (!s_Renderer) - { - return new bogus_bi; - } - - switch (im->type()) - { - default: - log_error ("Attempt to create a bitmap_info " - "from unsupported image type"); - return NULL; - - case GNASH_IMAGE_RGB: - case GNASH_IMAGE_RGBA: - { - return s_Renderer->createBitmapInfo(im); - } - } - - } - - // Draws the video frames - void drawVideoFrame(GnashImage* frame, const SWFMatrix* mat, - const SWFRect* bounds, bool smooth) - { - if (s_Renderer) { - return s_Renderer->drawVideoFrame(frame, mat, bounds, smooth); - } - } - - - // Bracket the displaying of a frame from a movie. - // Fill the background color, and set up default - // transforms, etc. - void begin_display( - const rgba& background_color, - int viewport_x0, int viewport_y0, - int viewport_width, int viewport_height, - float x0, float x1, float y0, float y1) - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) - { - s_Renderer->begin_display( - background_color, viewport_x0, viewport_y0, - viewport_width, viewport_height, - x0, x1, y0, y1); - } -// else -// { -// log_error("begin_display called, but no Renderer was registered by the app!\n"); -// } - } - - - void end_display() - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->end_display(); - } - - - void drawLine(const std::vector& coords, const rgba& color, const SWFMatrix& mat) - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->drawLine(coords, color, mat); -} - - -void draw_poly(const point* corners, int corner_count, const rgba& fill, - const rgba& outline, const SWFMatrix& mat, bool masked) - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->draw_poly(corners, corner_count, - fill, outline, mat, masked); -} - - -void -drawShape(const SWF::ShapeRecord& shape, const cxform& cx, - const SWFMatrix& worldMat) -{ -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->drawShape(shape, cx, worldMat); -} - -void drawGlyph(const SWF::ShapeRecord& rec, const rgba& color, - const SWFMatrix& mat) -{ -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->drawGlyph(rec, color, mat); -} - -bool bounds_in_clipping_area(const SWFRect& bounds) { - return bounds_in_clipping_area(bounds.getRange()); - if (s_Renderer) - return s_Renderer->bounds_in_clipping_area(bounds); - else - return true; -} - -bool bounds_in_clipping_area(const InvalidatedRanges& ranges) { - if (s_Renderer) - return s_Renderer->bounds_in_clipping_area(ranges); - else - return true; - } - -bool bounds_in_clipping_area(const geometry::Range2d& bounds) { - if (s_Renderer) - return s_Renderer->bounds_in_clipping_area(bounds); - else - return true; - } - - - - - void begin_submit_mask() - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->begin_submit_mask(); - } - - void end_submit_mask() - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->end_submit_mask(); - } - - void disable_mask() - { -#ifdef DEBUG_RENDER_CALLS - GNASH_REPORT_FUNCTION; -#endif - if (s_Renderer) s_Renderer->disable_mask(); - } -} - - -} // namespace gnash - - -// Local Variables: -// mode: C++ -// c-basic-offset: 8 -// tab-width: 8 -// indent-tabs-mode: t -// End: diff -Nru gnash-0.8.7/backend/ProxyRenderer.h gnash-0.8.8~bzr.trunk12341yavdr1/backend/ProxyRenderer.h --- gnash-0.8.7/backend/ProxyRenderer.h 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/ProxyRenderer.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,118 +0,0 @@ -// render.h Rendering interface for Gnash -// -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. -// -// 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, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -// Based on original by Willem Kokke 2003 - - -#ifndef GNASH_RENDER_H -#define GNASH_RENDER_H - -#include "gnash.h" -#include "Renderer.h" -#include "dsodefs.h" - -// Forward declarations -namespace gnash { - class rgba; - class GnashImage; - namespace SWF { - class ShapeRecord; - } -} - -namespace gnash { - - /// Return currently registered render handler - Renderer* get_Renderer(); - - /// Rendering operations - // - /// Takes care of calling the currently registered - /// gnash::Renderer or fallback on a default - /// behaviour if no renderer is registered - /// - /// NOTE: A cleaner implementation would be implementing - /// the default behaviour in the Renderer class - /// itself, rather then making it an "abstract" class. - /// Anyway, having proxy calls turned out to be somewhat - /// useful while tracking rendering calls, to have a central - /// place to add traces. We might change this in the future - /// to improve performance (proxy calls are not inlined). - /// - namespace render - { - /// See Renderer::create_bitmap_info_rgb (in backend/Renderer.h) - BitmapInfo* createBitmapInfo(std::auto_ptr im); - - /// See Renderer::drawVideoFrame (in backend/Renderer.h) - void drawVideoFrame(GnashImage* frame, const SWFMatrix* mat, - const SWFRect* bounds, bool smooth); - - /// See Renderer::begin_display (in backend/Renderer.h) - void begin_display( - const rgba& background_color, - int viewport_x0, int viewport_y0, - int viewport_width, int viewport_height, - float x0, float x1, float y0, float y1); - - /// See Renderer::end_display (in backend/Renderer.h) - void end_display(); - - /// See Renderer::draw_line_strip (in backend/Renderer.h) - void drawLine(const std::vector& coords, const rgba& color, - const SWFMatrix& mat); - - /// See Renderer::draw_poly (in backend/Renderer.h) - DSOEXPORT void draw_poly(const point* corners, int corner_count, - const rgba& fill, const rgba& outline, const SWFMatrix& mat, - bool masked); - - void drawShape(const SWF::ShapeRecord& shape, const cxform& cx, - const SWFMatrix& worldMat); - - /// See Renderer::draw_glyph (in backend/Renderer.h) - void drawGlyph(const SWF::ShapeRecord& rec, const rgba& color, - const SWFMatrix& mat); - - /// See Renderer::bounds_in_clipping_area (in backend/Renderer.h) - bool bounds_in_clipping_area(const SWFRect& bounds); - bool bounds_in_clipping_area(const InvalidatedRanges& ranges); - bool bounds_in_clipping_area(const geometry::Range2d& bounds); - - /// See Renderer::begin_submit_mask (in backend/Renderer.h) - void begin_submit_mask(); - - /// See Renderer::end_submit_mask (in backend/Renderer.h) - void end_submit_mask(); - - /// See Renderer::disable_mask (in backend/Renderer.h) - void disable_mask(); - - } // end namespace render - -} // end namespace gnash - - -#endif // GNASH_RENDER_H - -// Local Variables: -// mode: C++ -// c-basic-offset: 8 -// tab-width: 8 -// indent-tabs-mode: t -// End: diff -Nru gnash-0.8.7/backend/Renderer_agg_bitmap.h gnash-0.8.8~bzr.trunk12341yavdr1/backend/Renderer_agg_bitmap.h --- gnash-0.8.7/backend/Renderer_agg_bitmap.h 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/Renderer_agg_bitmap.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,58 +0,0 @@ -// -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software -// Foundation, Inc -// -// 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, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#ifndef BACKEND_RENDER_HANDLER_AGG_BITMAP_H -#define BACKEND_RENDER_HANDLER_AGG_BITMAP_H - -// This include file used only to make Renderer_agg more readable. - -namespace gnash { - -/// The class itself uses a template. Currently this is unnecessary and it may -/// be removed but an older implementation required this method and it may be -/// necessary again when the last missing parts of the renderer will be -/// implemented. And when might that be? I don't think I'll wait. -class agg_bitmap_info : public BitmapInfo -{ -public: - - agg_bitmap_info(std::auto_ptr im) - : - _image(im), - _bpp(_image->type() == GNASH_IMAGE_RGB ? 24 : 32) - { - } - - int get_width() const { return _image->width(); } - int get_height() const { return _image->height(); } - int get_bpp() const { return _bpp; } - int get_rowlen() const { return _image->pitch(); } - boost::uint8_t* get_data() const { return _image->data(); } - -private: - - std::auto_ptr _image; - - int _bpp; - -}; - - -} // namespace gnash - -#endif // BACKEND_RENDER_HANDLER_AGG_BITMAP_H diff -Nru gnash-0.8.7/backend/Renderer_agg.cpp gnash-0.8.8~bzr.trunk12341yavdr1/backend/Renderer_agg.cpp --- gnash-0.8.7/backend/Renderer_agg.cpp 2010-03-08 15:14:10.000000000 +0000 +++ gnash-0.8.8~bzr.trunk12341yavdr1/backend/Renderer_agg.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,2265 +0,0 @@ -// -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software -// Foundation, Inc -// -// 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, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -// Original version by Udo Giacomozzi and Hannes Mayr, -// INDUNET GmbH (www.indunet.it) - - -/// A Renderer that uses the Anti-Grain Geometry Toolkit (antigrain.com) -/// and renders directly to a buffer (for example to the framebuffer). This -/// backend is *completely* independent of any hardware. It can be used for -/// rendering to the Linux FrameBuffer device, or be blitted inside a -/// window (regardless of what operating system). It should also be no problem -/// to render into a file... -/// This file uses *very* heavily templates and is optimized mainly for speed, -/// meaning that the compiler generates very, very, very much specialized -/// code. That's good for speed but bloats up the resulting machine code. - -/* - -Status ------- - - outlines: - solid COMPLETE - patterns don't exist (they're converted at compile time by Flash!) - widths COMPLETE - colors, alpha COMPLETE - cap styles DONE, but end cap style is ignored - join styles COMPLETE - no-close flag COMPLETE - - - fills: - solid fills COMPLETE - linear gradients COMPLETE - radial gradients COMPLETE - focal gradients COMPLETE - ext. spread modes NOT IMPLEMENTED * - linear RGB mode NOT IMPLEMENTED * - bitmaps, tiled COMPLETE - bitmaps, clipped COMPLETE - bitmaps, smooth COMPLETE - bitmaps, hard COMPLETE - color xform COMPLETE - - * special fill styles are not yet supported by Gnash itself AFAIK, but AGG - supports them and it should be easy to add them. - - fonts COMPLETE - - masks COMPLETE - - caching NONE IMPLEMENTED - - video COMPLETE - - Currently the renderer should be able to render everything correctly. - - -What could and should be /optimized/ ------------------------------------- - - - EASY: Do not even start rendering shapes that are abviously out of the - invalidated bounds! - - - The alpha mask buffers (masks) are allocated and freed for each mask which - results in many large-size buffer allocations during a second. Maybe this - should be optimized. - - - Matrix-transformed paths (generated before drawing a shape) should be cached - and re-used to avoid recalculation of the same coordinates. - - - Characters (or sprites) may be cached as bitmaps with alpha channel (RGBA). - The mechanism could be automatically activated when the same character is - being rendered the 3rd or 5th time in a row with the same transformations - (regardless of the instance itself!). It's not a good idea to always - render into a bitmap buffer because this eats up memory and adds an - additional pass in rendering (blitting the bitmap buffer). This may be - tricky to implement anyway. - - - Masks are a very good candidate for bitmap caching as they do not change - that often. With other words, the alpha mask should not be discarded after - rendering and should be reused if possible. - - - there are also a few TODO comments in the code! - - -AGG resources -------------- - http://www.antigrain.com/ - http://haiku-os.org/node/86 - -*/ - -#ifdef HAVE_CONFIG_H -#include "gnashconfig.h" -#endif - -#include -#include - -#include "gnash.h" -#include "RGBA.h" -#include "GnashImage.h" -#include "log.h" -#include "Renderer.h" -#include "Renderer_agg.h" -#include "Range2d.h" -#include "swf/DefineMorphShapeTag.h" -#include "swf/ShapeRecord.h" -#include "DefineShapeTag.h" -#include "DisplayObject.h" -#include "MorphShape.h" -#include "Shape.h" -#include "GnashNumeric.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Renderer_agg_bitmap.h" -#include "Renderer_agg_style.h" - -#include -#include - -#ifndef round - #define round(x) rint(x) -#endif - -// Print a debugging warning when rendering of a whole character -// is skipped -//#define GNASH_WARN_WHOLE_CHARACTER_SKIP - - -#include - -namespace gnash { - -namespace { - -class AlphaMask; - -typedef std::vector AggPaths; -typedef std::vector > ClipBounds; -typedef std::vector AlphaMasks; -typedef std::vector GnashPaths; - -template -inline void applyClipBox(Rasterizer& ras, const geometry::Range2d& bounds) -{ - assert(bounds.isFinite()); - ras.clip_box(static_cast(bounds.getMinX()), - static_cast(bounds.getMinY()), - static_cast(bounds.getMaxX() + 1), - static_cast(bounds.getMaxY() + 1) - ); -} - -/// Analyzes a set of paths to detect real presence of fills and/or outlines -/// TODO: This should be something the character tells us and should be -/// cached. -void -analyzePaths(const GnashPaths &paths, bool& have_shape, - bool& have_outline) -{ - - have_shape = false; - have_outline = false; - - const int pcount = paths.size(); - - for (int pno=0; pno 0) || (the_path.m_fill1 > 0)) { - have_shape = true; - if (have_outline) return; // have both - } - - if (the_path.m_line > 0) { - have_outline = true; - if (have_shape) return; // have both - } - } -} - -class EdgeToPath -{ - -public: - EdgeToPath(AggPaths::value_type& path, double shift = 0) - : - _path(path), - _shift(shift) - {} - - void operator()(const Edge& edge) - { - if (edge.straight()) { - _path.line_to(twipsToPixels(edge.ap.x) + _shift, - twipsToPixels(edge.ap.y) + _shift); - } - else { - _path.curve3(twipsToPixels(edge.cp.x) + _shift, - twipsToPixels(edge.cp.y) + _shift, - twipsToPixels(edge.ap.x) + _shift, - twipsToPixels(edge.ap.y) + _shift); - } - } - -private: - agg::path_storage& _path; - const double _shift; -}; - -/// In-place transformation of Gnash paths to AGG paths. -class GnashToAggPath -{ -public: - - GnashToAggPath(AggPaths& dest, double shift = 0) - : - _dest(dest), - _it(_dest.begin()), - _shift(shift) - { - } - - void operator()(const Path& in) - { - agg::path_storage& p = *_it; - - p.move_to(twipsToPixels(in.ap.x) + _shift, - twipsToPixels(in.ap.y) + _shift); - - std::for_each(in.m_edges.begin(), in.m_edges.end(), - EdgeToPath(p, _shift)); - ++_it; - } - -private: - AggPaths& _dest; - AggPaths::iterator _it; - const double _shift; - -}; - - -/// Transposes Gnash paths to AGG paths, which can be used for both outlines -/// and shapes. Subshapes are ignored (ie. all paths are converted). Converts -/// TWIPS to pixels on the fly. -inline void -buildPaths(AggPaths& dest, const GnashPaths& paths) -{ - dest.resize(paths.size()); - std::for_each(paths.begin(), paths.end(), GnashToAggPath(dest, 0.05)); -} - -// --- ALPHA MASK BUFFER CONTAINER --------------------------------------------- -// How masks are implemented: A mask is basically a full alpha buffer. Each -// pixel in the alpha buffer defines the fraction of color values that are -// copied to the main buffer. The alpha mask buffer has 256 alpha levels per -// pixel, which is good as it allows anti-aliased masks. A full size buffer -// is allocated for each mask even if the invalidated bounds may be much -// smaller. The advantage of this is that the alpha mask adaptor does not need -// to do any clipping which results in better performance. -// Masks can be nested, which means the intersection of all masks should be -// visible (logical AND). To allow this we hold a stack of alpha masks and the -// topmost mask is used itself as a mask to draw any new mask. When rendering -// visible shapes only the topmost mask must be used and when a mask should not -// be used anymore it's simply discarded so that the next mask becomes active -// again. -// To be exact, Flash is a bit restrictive regarding to what can be a mask -// (dynamic text, shapes, ...) but our renderer can build a mask from -// anything we can draw otherwise (except lines, which are excluded -// explicitly). - -class AlphaMask -{ - - typedef agg::renderer_base Renderer; - typedef agg::alpha_mask_gray8 Mask; - -public: - - AlphaMask(int width, int height) - : - _rbuf(0, width, height, width), - _pixf(_rbuf), - _rbase(_pixf), - _amask(_rbuf), - _buffer(new boost::uint8_t[width * height]) - { - _rbuf.attach(_buffer.get(), width, height, width); - - // NOTE: The buffer is *not* cleared. The clear() function must - // be called to clear the buffer (alpha=0). The reason is to avoid - // clearing the whole mask when only a small portion is really used. - } - - void clear(const geometry::Range2d& region) - { - if (region.isNull()) return; - assert(region.isFinite()); - - const agg::gray8 black(0); - - // region can't be world as it should be intersected with - // the visible SWFRect - assert(!region.isWorld()); - - unsigned int left = region.getMinX(); - unsigned int width = region.width() + 1; - - const unsigned int max_y = region.getMaxY(); - for (unsigned int y=region.getMinY(); y <= max_y; ++y) - { - _pixf.copy_hline(left, y, width, black); - } - } - - Renderer& get_rbase() { - return _rbase; - } - - const Mask& getMask() const { - return _amask; - } - -private: - - // agg class to access the buffer - agg::rendering_buffer _rbuf; - - // pixel access - agg::pixfmt_gray8 _pixf; - - // renderer base - Renderer _rbase; - - // alpha mask - Mask _amask; - - // in-memory buffer - boost::scoped_array _buffer; - -}; - -/// Class for rendering lines. -template -class LineRenderer -{ -public: - typedef agg::renderer_base BaseRenderer; - typedef agg::renderer_scanline_aa_solid Renderer; - typedef agg::rasterizer_scanline_aa<> Rasterizer; - typedef agg::conv_stroke Stroke; - - LineRenderer(const ClipBounds& clipbounds, BaseRenderer& baseRenderer) - : - _clipbounds(clipbounds), - _renderer(baseRenderer) - {} - - template - void render(ScanLine& sl, Stroke& stroke, const rgba& color) - { - for (ClipBounds::const_iterator i = _clipbounds.begin(), - e = _clipbounds.end(); i != e; ++i) { - - const ClipBounds::value_type& bounds = *i; - - applyClipBox (_ras, bounds); - - // The vectorial pipeline - _ras.add_path(stroke); - - // Set the color and render the scanlines - _renderer.color(agg::rgba8_pre(color.m_r, color.m_g, - color.m_b, color.m_a)); - - agg::render_scanlines(_ras, sl, _renderer); - - } - } - -private: - - const ClipBounds& _clipbounds; - Rasterizer _ras; - Renderer _renderer; - -}; - -/// Class for rendering video frames. -// -/// Templated functions are used to allow using different types, -/// particularly for high and low quality rendering. -// -/// At present, this is bound to the renderer's ClipBounds. In future it -/// may be useful to pass BlendMode, Cxform, and custom clipbounds as well -/// as a caller-provided rendering buffer. This also applies to the -/// rest of the renderer API. -// -/// @param SourceFormat The format of the video frame to be rendered -/// @param PixelFormat The format to render to. -template -class VideoRenderer -{ - -public: - - /// Fixed types for video frame rendering. - - /// Render the pixels using this renderer - typedef typename agg::renderer_base Renderer; - typedef agg::span_interpolator_linear<> Interpolator; - typedef agg::span_allocator SpanAllocator; - typedef agg::rasterizer_scanline_aa<> Rasterizer; - - // cloning image accessor is used to avoid disturbing pixels at - // the edges for rotated video. - typedef agg::image_accessor_clone Accessor; - - /// Types used for different quality. - // - /// This (affects scaling) is only presently used when smoothing is - /// requested in high quality. - typedef agg::span_image_filter_rgb_nn - LowQualityFilter; - - typedef agg::span_image_filter_rgb_bilinear - HighQualityFilter; - - typedef agg::trans_affine Matrix; - - VideoRenderer(const ClipBounds& clipbounds, GnashImage& frame, - Matrix& mat, Quality quality, bool smooth) - : - _buf(frame.data(), frame.width(), frame.height(), - frame.pitch()), - _pixf(_buf), - _accessor(_pixf), - _interpolator(mat), - _clipbounds(clipbounds), - _quality(quality), - _smoothing(smooth) - {} - - void render(agg::path_storage& path, Renderer& rbase, - const AlphaMasks& masks) - { - switch (_quality) - { - case QUALITY_BEST: - case QUALITY_HIGH: - if (_smoothing) { - renderFrame(path, rbase, masks); - } - else renderFrame(path, rbase, masks); - break; - case QUALITY_MEDIUM: - case QUALITY_LOW: - // FIXME: Should this be still lower quality? - renderFrame(path, rbase, masks); - break; - } - } - -private: - - /// Render a frame with or without alpha masks active. - template - void renderFrame(agg::path_storage& path, Renderer& rbase, - const AlphaMasks& masks) - { - SpanGenerator sg(_accessor, _interpolator); - if (masks.empty()) { - // No mask active - agg::scanline_u8 sl; - renderScanlines(path, rbase, sl, sg); - } - else { - // Untested. - typedef agg::scanline_u8_am Scanline; - Scanline sl(masks.back()->getMask()); - renderScanlines(path, rbase, sl, sg); - } - } - - template - void renderScanlines(agg::path_storage& path, Renderer& rbase, - Scanline& sl, SpanGenerator& sg) - { - Rasterizer _ras; - for (ClipBounds::const_iterator i = _clipbounds.begin(), - e = _clipbounds.end(); i != e; ++i) - { - const ClipBounds::value_type& cb = *i; - applyClipBox (_ras, cb); - - _ras.add_path(path); - - agg::render_scanlines_aa(_ras, sl, rbase, _sa, sg); - } - } - - // rendering buffer is used to access the frame pixels here - agg::rendering_buffer _buf; - - const SourceFormat _pixf; - - Accessor _accessor; - - Interpolator _interpolator; - - SpanAllocator _sa; - - const ClipBounds& _clipbounds; - - /// Quality of renderering - const Quality _quality; - - /// Whether smoothing is required. - bool _smoothing; -}; - -} - - -// --- RENDER HANDLER ---------------------------------------------------------- -// The class is implemented using templates so that it supports any kind of -// pixel format. LUT (look up tables) are not supported, however. - -// Real AGG handler -template -class Renderer_agg : public Renderer_agg_base -{ - -public: - - // Given an image, returns a pointer to a bitmap_info class - // that can later be passed to fill_styleX_bitmap(), to set a - // bitmap fill style. - gnash::BitmapInfo* createBitmapInfo(std::auto_ptr im) - { - return new agg_bitmap_info(im); - } - - virtual void renderToImage(boost::shared_ptr io, - FileType type) const - { - log_debug("New image: %sx%s", xres, yres); - ImageRGBA im(xres, yres); - for (int x = 0; x < xres; ++x) { - for (int y = 0; y < yres; ++y) { - typename PixelFormat::color_type t = m_pixf->pixel(x, y); - im.setPixel(x, y, t.r, t.g, t.b, t.a); - } - } - - ImageOutput::writeImageData(type, io, im, 100); - } - - template - void renderVideo(GnashImage& frame, Matrix& img_mtx, - agg::path_storage path, bool smooth) - { - - // renderer base for the stage buffer (not the frame image!) - renderer_base& rbase = *m_rbase; - - VideoRenderer vr(_clipbounds, frame, - img_mtx, _quality, smooth); - - // If smoothing is requested and _quality is set to HIGH or BEST, - // use high-quality interpolation. - vr.render(path, rbase, _alphaMasks); - } - - void drawVideoFrame(GnashImage* frame, const SWFMatrix* source_mat, - const SWFRect* bounds, bool smooth) - { - - // NOTE: Assuming that the source image is RGB 8:8:8 - // TODO: keep heavy instances alive accross frames for performance! - // TODO: Maybe implement specialization for 1:1 scaled videos - SWFMatrix mat = stage_matrix; - mat.concatenate(*source_mat); - - // compute video scaling relative to video object size - double vscaleX = bounds->width() / - static_cast(frame->width()); - - double vscaleY = bounds->height() / - static_cast(frame->height()); - - // convert Gnash SWFMatrix to AGG SWFMatrix and scale down to - // pixel coordinates while we're at it - agg::trans_affine mtx(mat.sx / 65536.0, mat.shx / 65536.0, - mat.shy / 65536.0, mat.sy / 65536.0, mat.tx, mat.ty); - - // invert SWFMatrix since this is used for the image source - mtx.invert(); - - // Apply video scale - mtx *= agg::trans_affine_scaling(1.0 / vscaleX, 1.0 / vscaleY); - - // make a path for the video outline - point a, b, c, d; - mat.transform(&a, point(bounds->get_x_min(), bounds->get_y_min())); - mat.transform(&b, point(bounds->get_x_max(), bounds->get_y_min())); - mat.transform(&c, point(bounds->get_x_max(), bounds->get_y_max())); - mat.transform(&d, point(bounds->get_x_min(), bounds->get_y_max())); - - agg::path_storage path; - path.move_to(a.x, a.y); - path.line_to(b.x, b.y); - path.line_to(c.x, c.y); - path.line_to(d.x, d.y); - path.line_to(a.x, a.y); - - switch (frame->type()) - { - case GNASH_IMAGE_RGBA: - renderVideo(*frame, mtx, path, smooth); - break; - case GNASH_IMAGE_RGB: - renderVideo(*frame, mtx, path, smooth); - break; - default: - log_error("Can't render this type of frame"); - break; - } - - } - - // Constructor - Renderer_agg(int bits_per_pixel) - : - xres(1), - yres(1), - bpp(bits_per_pixel), - scale_set(false), - m_display_width(0.0), - m_display_height(0.0), - m_drawing_mask(false) - { - // TODO: we really don't want to set the scale here as the core should - // tell us the right values before rendering anything. However this is - // currently difficult to implement. Removing the next call will - // lead to an assertion failure in begin_display() because we check - // whether the scale is known there. - set_scale(1.0f, 1.0f); - } - - /// Initializes the rendering buffer. The memory pointed by "mem" is not - /// owned by the renderer and init_buffer() may be called multiple times - /// when the buffer size changes, for example. However, bits_per_pixel must - /// remain the same. - /// rowstride is the size, in bytes, of one row. - /// This method *must* be called prior to any other method of the class! - void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride) - { - assert(x > 0); - assert(y > 0); - - xres = x; - yres = y; - - m_rbuf.attach(mem, xres, yres, rowstride); - - // allocate pixel format accessor and renderer_base - m_pixf.reset(new PixelFormat(m_rbuf)); - m_rbase.reset(new renderer_base(*m_pixf)); - - // by default allow drawing everywhere - set_invalidated_region_world(); - - log_debug(_("Initialized AGG buffer <%p>, %d bytes, %dx%d, " - "rowsize is %d bytes"), - (void*)mem, size, x, y, rowstride); - } - - - void begin_display( - const gnash::rgba& bg, - int /*viewport_x0*/, int /*viewport_y0*/, - int /*viewport_width*/, int /*viewport_height*/, - float /*x0*/, float /*x1*/, float /*y0*/, float /*y1*/) - { - assert(m_pixf.get()); - - assert(scale_set); - - // clear the stage using the background color - if ( ! _clipbounds.empty() ) - { - const agg::rgba8& col = agg::rgba8_pre(bg.m_r, bg.m_g, bg.m_b, bg.m_a); - for (ClipBounds::const_iterator i = _clipbounds.begin(), - e = _clipbounds.end(); i!= e; ++i) - { - clear_framebuffer(*i, col); - } - } - - // reset status variables - m_drawing_mask = false; - } - - // renderer_base.clear() does no clipping which clears the - // whole framebuffer even if we update just a small portion - // of the screen. The result would be still correct, but slower. - // This function clears only a certain portion of the screen, while /not/ - // being notably slower for a fullscreen clear. - void clear_framebuffer(const geometry::Range2d& region, - const agg::rgba8& color) - { - assert(region.isFinite()); - - // add 1 to width since we have still to draw a pixel when - // getMinX==getMaxX - unsigned int width=region.width()+1; - - // Note: We don't need to check for width/height anymore because - // Range2d will take care that getMinX <= getMaxX and it's okay when - // region.width()==0 because in that case getMinX==getMaxX and we have - // still a pixel to draw. - - const unsigned int left=region.getMinX(); - - for (unsigned int y=region.getMinY(), maxy=region.getMaxY(); - y<=maxy; ++y) { - m_pixf->copy_hline(left, y, width, color); - } - } - - // Clean up after rendering a frame. - void end_display() - { - if (m_drawing_mask) { - log_debug(_("Warning: rendering ended while drawing a mask")); - } - - while (! _alphaMasks.empty()) { - log_debug(_("Warning: rendering ended while masks " - "were still active")); - disable_mask(); - } - } - - - - // Draw the line strip formed by the sequence of points. - void drawLine(const std::vector& coords, const rgba& color, - const SWFMatrix& line_mat) - { - - assert(m_pixf.get()); - - if (_clipbounds.empty()) return; - if (coords.empty()) return; - - SWFMatrix mat = stage_matrix; - mat.concatenate(line_mat); - - LineRenderer lr(_clipbounds, *m_rbase); - - // -- create path -- - agg::path_storage path; - - typename LineRenderer::Stroke stroke(path); - stroke.width(1); - stroke.line_cap(agg::round_cap); - stroke.line_join(agg::round_join); - - typedef std::vector Points; - - // We've asserted that it has at least one element. - Points::const_iterator i = coords.begin(); - - point pnt; - - mat.transform(&pnt, *i); - path.move_to(pnt.x, pnt.y); - - ++i; - - for (const Points::const_iterator e = coords.end(); i != e; ++i) - { - mat.transform(&pnt, *i); - path.line_to(pnt.x, pnt.y); - } - - if (_alphaMasks.empty()) { - // No mask active - agg::scanline_p8 sl; - lr.render(sl, stroke, color); - } - else { - // Mask is active! - typedef agg::scanline_u8_am sl_type; - sl_type sl(_alphaMasks.back()->getMask()); - lr.render(sl, stroke, color); - } - - } - - - void begin_submit_mask() - { - // Set flag so that rendering of shapes is simplified (only solid fill) - m_drawing_mask = true; - - AlphaMask* new_mask = new AlphaMask(xres, yres); - - for (ClipBounds::const_iterator i = _clipbounds.begin(), - e = _clipbounds.end(); i != e; ++i) { - new_mask->clear(*i); - } - - _alphaMasks.push_back(new_mask); - } - - void end_submit_mask() - { - m_drawing_mask = false; - } - - void disable_mask() - { - assert( ! _alphaMasks.empty() ); - delete _alphaMasks.back(); - _alphaMasks.pop_back(); - } - - - void drawGlyph(const SWF::ShapeRecord& shape, const rgba& color, - const SWFMatrix& mat) - { - - // select relevant clipping bounds - if (shape.getBounds().is_null()) { - return; - } - select_clipbounds(shape.getBounds(), mat); - - if (_clipbounds_selected.empty()) return; - - GnashPaths paths; - apply_matrix_to_path(shape.paths(), paths, mat); - - // If it's a mask, we don't need the rest. - if (m_drawing_mask) { - draw_mask_shape(paths, false); - return; - } - - // convert gnash paths to agg paths. - AggPaths agg_paths; - buildPaths(agg_paths, paths); - - // make sure m_single_fill_styles contains the required color - need_single_fill_style(color); - - // prepare style handler - agg_style_handler sh; - build_agg_styles(sh, m_single_fill_styles, mat, cxform()); - - draw_shape(-1, paths, agg_paths, sh, false); - - // NOTE: Do not use even-odd filling rule for glyphs! - - // clear clipping ranges to ease debugging - _clipbounds_selected.clear(); - } - - - /// Fills _clipbounds_selected with pointers to _clipbounds members who - /// intersect with the given character (transformed by mat). This avoids - /// rendering of characters outside a particular clipping range. - /// "_clipbounds_selected" is used by draw_shape() and draw_outline() and - /// *must* be initialized prior to using those function. - void select_clipbounds(const SWFRect& objectBounds, const SWFMatrix& source_mat) - { - - SWFMatrix mat = stage_matrix; - mat.concatenate(source_mat); - - _clipbounds_selected.clear(); - _clipbounds_selected.reserve(_clipbounds.size()); - - if (objectBounds.is_null()) { - log_debug(_("Warning: select_clipbounds encountered a character " - "definition with null bounds")); - return; - } - - SWFRect bounds; - bounds.set_null(); - bounds.expand_to_transformed_rect(mat, objectBounds); - - const geometry::Range2d& range_float = bounds.getRange(); - - assert(range_float.isFinite()); - - geometry::Range2d range_int( - (int) range_float.getMinX(), - (int) range_float.getMinY(), - (int) range_float.getMaxX(), - (int) range_float.getMaxY() - ); - - - const int count = _clipbounds.size(); - for (int cno=0; cno& fill_styles, - const std::vector& line_styles, - const std::vector& objpaths, const SWFMatrix& mat, - const cxform& cx) - { - - bool have_shape, have_outline; - - analyzePaths(objpaths, have_shape, have_outline); - - if (!have_shape && !have_outline) { - // Early return for invisible character. - return; - } - - GnashPaths paths; - apply_matrix_to_path(objpaths, paths, mat); - - // Masks apparently do not use agg_paths, so return - // early - if (m_drawing_mask) { - - // Shape is drawn inside a mask, skip sub-shapes handling and - // outlines - draw_mask_shape(paths, false); - return; - } - - AggPaths agg_paths; - AggPaths agg_paths_rounded; - - // Flash only aligns outlines. Probably this is done at rendering - // level. - if (have_outline) { - buildPaths_rounded(agg_paths_rounded, paths, line_styles); - } - - if (have_shape) { - buildPaths(agg_paths, paths); - } - - - if (_clipbounds_selected.empty()) { -#ifdef GNASH_WARN_WHOLE_CHARACTER_SKIP - log_debug(_("Warning: AGG renderer skipping a whole character")); -#endif - return; - } - - // prepare fill styles - agg_style_handler sh; - if (have_shape) build_agg_styles(sh, fill_styles, mat, cx); - - // We need to separate sub-shapes during rendering. - const unsigned int subshape_count = count_sub_shapes(paths); - - for (unsigned int subshape=0; subshape