diff --git a/contrib/assdraw/Makefile.am b/contrib/assdraw/Makefile.am deleted file mode 100644 index af437a64d..000000000 --- a/contrib/assdraw/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/contrib/assdraw/assdraw_2008.vcproj b/contrib/assdraw/assdraw_2008.vcproj deleted file mode 100644 index 9f5c5083f..000000000 --- a/contrib/assdraw/assdraw_2008.vcproj +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/assdraw/autogen.sh b/contrib/assdraw/autogen.sh deleted file mode 100755 index 5bce9bab3..000000000 --- a/contrib/assdraw/autogen.sh +++ /dev/null @@ -1,1578 +0,0 @@ -#!/bin/sh -# a u t o g e n . s h -# -# Copyright (c) 2005-2009 United States Government as represented by -# the U.S. Army Research Laboratory. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -### -# -# Script for automatically preparing the sources for compilation by -# performing the myriad of necessary steps. The script attempts to -# detect proper version support, and outputs warnings about particular -# systems that have autotool peculiarities. -# -# Basically, if everything is set up and installed correctly, the -# script will validate that minimum versions of the GNU Build System -# tools are installed, account for several common configuration -# issues, and then simply run autoreconf for you. -# -# If autoreconf fails, which can happen for many valid configurations, -# this script proceeds to run manual preparation steps effectively -# providing a POSIX shell script (mostly complete) reimplementation of -# autoreconf. -# -# The AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER -# environment variables and corresponding _OPTIONS variables (e.g. -# AUTORECONF_OPTIONS) may be used to override the default automatic -# detection behaviors. Similarly the _VERSION variables will override -# the minimum required version numbers. -# -# Examples: -# -# To obtain help on usage: -# ./autogen.sh --help -# -# To obtain verbose output: -# ./autogen.sh --verbose -# -# To skip autoreconf and prepare manually: -# AUTORECONF=false ./autogen.sh -# -# To verbosely try running with an older (unsupported) autoconf: -# AUTOCONF_VERSION=2.50 ./autogen.sh --verbose -# -# Author: -# Christopher Sean Morrison -# -# Patches: -# Sebastian Pipping -# -###################################################################### - -# set to minimum acceptable version of autoconf -if [ "x$AUTOCONF_VERSION" = "x" ] ; then - AUTOCONF_VERSION=2.52 -fi -# set to minimum acceptable version of automake -if [ "x$AUTOMAKE_VERSION" = "x" ] ; then - AUTOMAKE_VERSION=1.6.0 -fi -# set to minimum acceptable version of libtool -if [ "x$LIBTOOL_VERSION" = "x" ] ; then - LIBTOOL_VERSION=1.4.2 -fi - - -################## -# ident function # -################## -ident ( ) { - # extract copyright from header - __copyright="`grep Copyright $AUTOGEN_SH | head -${HEAD_N}1 | awk '{print $4}'`" - if [ "x$__copyright" = "x" ] ; then - __copyright="`date +%Y`" - fi - - # extract version from CVS Id string - __id="$Id: autogen.sh 33925 2009-03-01 23:27:06Z brlcad $" - __version="`echo $__id | sed 's/.*\([0-9][0-9][0-9][0-9]\)[-\/]\([0-9][0-9]\)[-\/]\([0-9][0-9]\).*/\1\2\3/'`" - if [ "x$__version" = "x" ] ; then - __version="" - fi - - echo "autogen.sh build preparation script by Christopher Sean Morrison" - echo " + config.guess download patch by Sebastian Pipping (2008-12-03)" - echo "revised 3-clause BSD-style license, copyright (c) $__copyright" - echo "script version $__version, ISO/IEC 9945 POSIX shell script" -} - - -################## -# USAGE FUNCTION # -################## -usage ( ) { - echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [-d|--download] [--version]" - echo " --help Help on $NAME_OF_AUTOGEN usage" - echo " --verbose Verbose progress output" - echo " --quiet Quiet suppressed progress output" - echo " --download Download the latest config.guess from gnulib" - echo " --version Only perform GNU Build System version checks" - echo - echo "Description: This script will validate that minimum versions of the" - echo "GNU Build System tools are installed and then run autoreconf for you." - echo "Should autoreconf fail, manual preparation steps will be run" - echo "potentially accounting for several common preparation issues. The" - - echo "AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER," - echo "PROJECT, & CONFIGURE environment variables and corresponding _OPTIONS" - echo "variables (e.g. AUTORECONF_OPTIONS) may be used to override the" - echo "default automatic detection behavior." - echo - - ident - - return 0 -} - - -########################## -# VERSION_ERROR FUNCTION # -########################## -version_error ( ) { - if [ "x$1" = "x" ] ; then - echo "INTERNAL ERROR: version_error was not provided a version" - exit 1 - fi - if [ "x$2" = "x" ] ; then - echo "INTERNAL ERROR: version_error was not provided an application name" - exit 1 - fi - $ECHO - $ECHO "ERROR: To prepare the ${PROJECT} build system from scratch," - $ECHO " at least version $1 of $2 must be installed." - $ECHO - $ECHO "$NAME_OF_AUTOGEN does not need to be run on the same machine that will" - $ECHO "run configure or make. Either the GNU Autotools will need to be installed" - $ECHO "or upgraded on this system, or $NAME_OF_AUTOGEN must be run on the source" - $ECHO "code on another system and then transferred to here. -- Cheers!" - $ECHO -} - -########################## -# VERSION_CHECK FUNCTION # -########################## -version_check ( ) { - if [ "x$1" = "x" ] ; then - echo "INTERNAL ERROR: version_check was not provided a minimum version" - exit 1 - fi - _min="$1" - if [ "x$2" = "x" ] ; then - echo "INTERNAL ERROR: version check was not provided a comparison version" - exit 1 - fi - _cur="$2" - - # needed to handle versions like 1.10 and 1.4-p6 - _min="`echo ${_min}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`" - _cur="`echo ${_cur}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`" - - _min_major="`echo $_min | cut -d. -f1`" - _min_minor="`echo $_min | cut -d. -f2`" - _min_patch="`echo $_min | cut -d. -f3`" - - _cur_major="`echo $_cur | cut -d. -f1`" - _cur_minor="`echo $_cur | cut -d. -f2`" - _cur_patch="`echo $_cur | cut -d. -f3`" - - if [ "x$_min_major" = "x" ] ; then - _min_major=0 - fi - if [ "x$_min_minor" = "x" ] ; then - _min_minor=0 - fi - if [ "x$_min_patch" = "x" ] ; then - _min_patch=0 - fi - if [ "x$_cur_minor" = "x" ] ; then - _cur_major=0 - fi - if [ "x$_cur_minor" = "x" ] ; then - _cur_minor=0 - fi - if [ "x$_cur_patch" = "x" ] ; then - _cur_patch=0 - fi - - $VERBOSE_ECHO "Checking if ${_cur_major}.${_cur_minor}.${_cur_patch} is greater than ${_min_major}.${_min_minor}.${_min_patch}" - - if [ $_min_major -lt $_cur_major ] ; then - return 0 - elif [ $_min_major -eq $_cur_major ] ; then - if [ $_min_minor -lt $_cur_minor ] ; then - return 0 - elif [ $_min_minor -eq $_cur_minor ] ; then - if [ $_min_patch -lt $_cur_patch ] ; then - return 0 - elif [ $_min_patch -eq $_cur_patch ] ; then - return 0 - fi - fi - fi - return 1 -} - - -###################################### -# LOCATE_CONFIGURE_TEMPLATE FUNCTION # -###################################### -locate_configure_template ( ) { - _pwd="`pwd`" - if test -f "./configure.ac" ; then - echo "./configure.ac" - elif test -f "./configure.in" ; then - echo "./configure.in" - elif test -f "$_pwd/configure.ac" ; then - echo "$_pwd/configure.ac" - elif test -f "$_pwd/configure.in" ; then - echo "$_pwd/configure.in" - elif test -f "$PATH_TO_AUTOGEN/configure.ac" ; then - echo "$PATH_TO_AUTOGEN/configure.ac" - elif test -f "$PATH_TO_AUTOGEN/configure.in" ; then - echo "$PATH_TO_AUTOGEN/configure.in" - fi -} - - -################## -# argument check # -################## -ARGS="$*" -PATH_TO_AUTOGEN="`dirname $0`" -NAME_OF_AUTOGEN="`basename $0`" -AUTOGEN_SH="$PATH_TO_AUTOGEN/$NAME_OF_AUTOGEN" - -LIBTOOL_M4="${PATH_TO_AUTOGEN}/misc/libtool.m4" - -if [ "x$HELP" = "x" ] ; then - HELP=no -fi -if [ "x$QUIET" = "x" ] ; then - QUIET=no -fi -if [ "x$VERBOSE" = "x" ] ; then - VERBOSE=no -fi -if [ "x$VERSION_ONLY" = "x" ] ; then - VERSION_ONLY=no -fi -if [ "x$DOWNLOAD" = "x" ] ; then - DOWNLOAD=no -fi -if [ "x$AUTORECONF_OPTIONS" = "x" ] ; then - AUTORECONF_OPTIONS="-i -f" -fi -if [ "x$AUTOCONF_OPTIONS" = "x" ] ; then - AUTOCONF_OPTIONS="-f" -fi -if [ "x$AUTOMAKE_OPTIONS" = "x" ] ; then - AUTOMAKE_OPTIONS="-a -c -f" -fi -ALT_AUTOMAKE_OPTIONS="-a -c" -if [ "x$LIBTOOLIZE_OPTIONS" = "x" ] ; then - LIBTOOLIZE_OPTIONS="--automake -c -f" -fi -ALT_LIBTOOLIZE_OPTIONS="--automake --copy --force" -if [ "x$ACLOCAL_OPTIONS" = "x" ] ; then - ACLOCAL_OPTIONS="" -fi -if [ "x$AUTOHEADER_OPTIONS" = "x" ] ; then - AUTOHEADER_OPTIONS="" -fi -if [ "x$CONFIG_GUESS_URL" = "x" ] ; then - CONFIG_GUESS_URL="http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.guess;hb=HEAD" -fi -for arg in $ARGS ; do - case "x$arg" in - x--help) HELP=yes ;; - x-[hH]) HELP=yes ;; - x--quiet) QUIET=yes ;; - x-[qQ]) QUIET=yes ;; - x--verbose) VERBOSE=yes ;; - x-[dD]) DOWNLOAD=yes ;; - x--download) DOWNLOAD=yes ;; - x-[vV]) VERBOSE=yes ;; - x--version) VERSION_ONLY=yes ;; - *) - echo "Unknown option: $arg" - echo - usage - exit 1 - ;; - esac -done - - -##################### -# environment check # -##################### - -# sanity check before recursions potentially begin -if [ ! -f "$AUTOGEN_SH" ] ; then - echo "INTERNAL ERROR: $AUTOGEN_SH does not exist" - if [ ! "x$0" = "x$AUTOGEN_SH" ] ; then - echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $AUTOGEN_SH" - fi - exit 1 -fi - -# force locale setting to C so things like date output as expected -LC_ALL=C - -# commands that this script expects -for __cmd in echo head tail pwd ; do - echo "test" | $__cmd > /dev/null 2>&1 - if [ $? != 0 ] ; then - echo "INTERNAL ERROR: '${__cmd}' command is required" - exit 2 - fi -done -echo "test" | grep "test" > /dev/null 2>&1 -if test ! x$? = x0 ; then - echo "INTERNAL ERROR: grep command is required" - exit 1 -fi -echo "test" | sed "s/test/test/" > /dev/null 2>&1 -if test ! x$? = x0 ; then - echo "INTERNAL ERROR: sed command is required" - exit 1 -fi - - -# determine the behavior of echo -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -# determine the behavior of head -case "x`echo 'head' | head -n 1 2>&1`" in - *xhead*) HEAD_N="n " ;; - *) HEAD_N="" ;; -esac - -# determine the behavior of tail -case "x`echo 'tail' | tail -n 1 2>&1`" in - *xtail*) TAIL_N="n " ;; - *) TAIL_N="" ;; -esac - -VERBOSE_ECHO=: -ECHO=: -if [ "x$QUIET" = "xyes" ] ; then - if [ "x$VERBOSE" = "xyes" ] ; then - echo "Verbose output quelled by quiet option. Further output disabled." - fi -else - ECHO=echo - if [ "x$VERBOSE" = "xyes" ] ; then - echo "Verbose output enabled" - VERBOSE_ECHO=echo - fi -fi - - -# allow a recursive run to disable further recursions -if [ "x$RUN_RECURSIVE" = "x" ] ; then - RUN_RECURSIVE=yes -fi - - -################################################ -# check for help arg and bypass version checks # -################################################ -if [ "x`echo $ARGS | sed 's/.*[hH][eE][lL][pP].*/help/'`" = "xhelp" ] ; then - HELP=yes -fi -if [ "x$HELP" = "xyes" ] ; then - usage - $ECHO "---" - $ECHO "Help was requested. No preparation or configuration will be performed." - exit 0 -fi - - -####################### -# set up signal traps # -####################### -untrap_abnormal ( ) { - for sig in 1 2 13 15; do - trap - $sig - done -} - -# do this cleanup whenever we exit. -trap ' - # start from the root - if test -d "$START_PATH" ; then - cd "$START_PATH" - fi - - # restore/delete backup files - if test "x$PFC_INIT" = "x1" ; then - recursive_restore - fi -' 0 - -# trap SIGHUP (1), SIGINT (2), SIGPIPE (13), SIGTERM (15) -for sig in 1 2 13 15; do - trap ' - $ECHO "" - $ECHO "Aborting $NAME_OF_AUTOGEN: caught signal '$sig'" - - # start from the root - if test -d "$START_PATH" ; then - cd "$START_PATH" - fi - - # clean up on abnormal exit - $VERBOSE_ECHO "rm -rf autom4te.cache" - rm -rf autom4te.cache - - if test -f "acinclude.m4.$$.backup" ; then - $VERBOSE_ECHO "cat acinclude.m4.$$.backup > acinclude.m4" - chmod u+w acinclude.m4 - cat acinclude.m4.$$.backup > acinclude.m4 - - $VERBOSE_ECHO "rm -f acinclude.m4.$$.backup" - rm -f acinclude.m4.$$.backup - fi - - { (exit 1); exit 1; } -' $sig -done - - -############################# -# look for a configure file # -############################# -if [ "x$CONFIGURE" = "x" ] ; then - CONFIGURE="`locate_configure_template`" - if [ ! "x$CONFIGURE" = "x" ] ; then - $VERBOSE_ECHO "Found a configure template: $CONFIGURE" - fi -else - $ECHO "Using CONFIGURE environment variable override: $CONFIGURE" -fi -if [ "x$CONFIGURE" = "x" ] ; then - if [ "x$VERSION_ONLY" = "xyes" ] ; then - CONFIGURE=/dev/null - else - $ECHO - $ECHO "A configure.ac or configure.in file could not be located implying" - $ECHO "that the GNU Build System is at least not used in this directory. In" - $ECHO "any case, there is nothing to do here without one of those files." - $ECHO - $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`" - exit 1 - fi -fi - -#################### -# get project name # -#################### -if [ "x$PROJECT" = "x" ] ; then - PROJECT="`grep AC_INIT $CONFIGURE | grep -v '.*#.*AC_INIT' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_INIT(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - if [ "x$PROJECT" = "xAC_INIT" ] ; then - # projects might be using the older/deprecated arg-less AC_INIT .. look for AM_INIT_AUTOMAKE instead - PROJECT="`grep AM_INIT_AUTOMAKE $CONFIGURE | grep -v '.*#.*AM_INIT_AUTOMAKE' | tail -${TAIL_N}1 | sed 's/^[ ]*AM_INIT_AUTOMAKE(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - fi - if [ "x$PROJECT" = "xAM_INIT_AUTOMAKE" ] ; then - PROJECT="project" - fi - if [ "x$PROJECT" = "x" ] ; then - PROJECT="project" - fi -else - $ECHO "Using PROJECT environment variable override: $PROJECT" -fi -$ECHO "Preparing the $PROJECT build system...please wait" -$ECHO - - -######################## -# check for autoreconf # -######################## -HAVE_AUTORECONF=no -if [ "x$AUTORECONF" = "x" ] ; then - for AUTORECONF in autoreconf ; do - $VERBOSE_ECHO "Checking autoreconf version: $AUTORECONF --version" - $AUTORECONF --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - HAVE_AUTORECONF=yes - break - fi - done -else - HAVE_AUTORECONF=yes - $ECHO "Using AUTORECONF environment variable override: $AUTORECONF" -fi - - -########################## -# autoconf version check # -########################## -_acfound=no -if [ "x$AUTOCONF" = "x" ] ; then - for AUTOCONF in autoconf ; do - $VERBOSE_ECHO "Checking autoconf version: $AUTOCONF --version" - $AUTOCONF --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - _acfound=yes - break - fi - done -else - _acfound=yes - $ECHO "Using AUTOCONF environment variable override: $AUTOCONF" -fi - -_report_error=no -if [ ! "x$_acfound" = "xyes" ] ; then - $ECHO "ERROR: Unable to locate GNU Autoconf." - _report_error=yes -else - _version="`$AUTOCONF --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`" - if [ "x$_version" = "x" ] ; then - _version="0.0.0" - fi - $ECHO "Found GNU Autoconf version $_version" - version_check "$AUTOCONF_VERSION" "$_version" - if [ $? -ne 0 ] ; then - _report_error=yes - fi -fi -if [ "x$_report_error" = "xyes" ] ; then - version_error "$AUTOCONF_VERSION" "GNU Autoconf" - exit 1 -fi - - -########################## -# automake version check # -########################## -_amfound=no -if [ "x$AUTOMAKE" = "x" ] ; then - for AUTOMAKE in automake ; do - $VERBOSE_ECHO "Checking automake version: $AUTOMAKE --version" - $AUTOMAKE --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - _amfound=yes - break - fi - done -else - _amfound=yes - $ECHO "Using AUTOMAKE environment variable override: $AUTOMAKE" -fi - - -_report_error=no -if [ ! "x$_amfound" = "xyes" ] ; then - $ECHO - $ECHO "ERROR: Unable to locate GNU Automake." - _report_error=yes -else - _version="`$AUTOMAKE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`" - if [ "x$_version" = "x" ] ; then - _version="0.0.0" - fi - $ECHO "Found GNU Automake version $_version" - version_check "$AUTOMAKE_VERSION" "$_version" - if [ $? -ne 0 ] ; then - _report_error=yes - fi -fi -if [ "x$_report_error" = "xyes" ] ; then - version_error "$AUTOMAKE_VERSION" "GNU Automake" - exit 1 -fi - - -######################## -# check for libtoolize # -######################## -HAVE_LIBTOOLIZE=yes -HAVE_ALT_LIBTOOLIZE=no -_ltfound=no -if [ "x$LIBTOOLIZE" = "x" ] ; then - LIBTOOLIZE=libtoolize - $VERBOSE_ECHO "Checking libtoolize version: $LIBTOOLIZE --version" - $LIBTOOLIZE --version > /dev/null 2>&1 - if [ ! $? = 0 ] ; then - HAVE_LIBTOOLIZE=no - $ECHO - if [ "x$HAVE_AUTORECONF" = "xno" ] ; then - $ECHO "Warning: libtoolize does not appear to be available." - else - $ECHO "Warning: libtoolize does not appear to be available. This means that" - $ECHO "the automatic build preparation via autoreconf will probably not work." - $ECHO "Preparing the build by running each step individually, however, should" - $ECHO "work and will be done automatically for you if autoreconf fails." - fi - - # look for some alternates - for tool in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do - $VERBOSE_ECHO "Checking libtoolize alternate: $tool --version" - _glibtoolize="`$tool --version > /dev/null 2>&1`" - if [ $? = 0 ] ; then - $VERBOSE_ECHO "Found $tool --version" - _glti="`which $tool`" - if [ "x$_glti" = "x" ] ; then - $VERBOSE_ECHO "Cannot find $tool with which" - continue; - fi - if test ! -f "$_glti" ; then - $VERBOSE_ECHO "Cannot use $tool, $_glti is not a file" - continue; - fi - _gltidir="`dirname $_glti`" - if [ "x$_gltidir" = "x" ] ; then - $VERBOSE_ECHO "Cannot find $tool path with dirname of $_glti" - continue; - fi - if test ! -d "$_gltidir" ; then - $VERBOSE_ECHO "Cannot use $tool, $_gltidir is not a directory" - continue; - fi - HAVE_ALT_LIBTOOLIZE=yes - LIBTOOLIZE="$tool" - $ECHO - $ECHO "Fortunately, $tool was found which means that your system may simply" - $ECHO "have a non-standard or incomplete GNU Autotools install. If you have" - $ECHO "sufficient system access, it may be possible to quell this warning by" - $ECHO "running:" - $ECHO - sudo -V > /dev/null 2>&1 - if [ $? = 0 ] ; then - $ECHO " sudo ln -s $_glti $_gltidir/libtoolize" - $ECHO - else - $ECHO " ln -s $_glti $_gltidir/libtoolize" - $ECHO - $ECHO "Run that as root or with proper permissions to the $_gltidir directory" - $ECHO - fi - _ltfound=yes - break - fi - done - else - _ltfound=yes - fi -else - _ltfound=yes - $ECHO "Using LIBTOOLIZE environment variable override: $LIBTOOLIZE" -fi - - -############################ -# libtoolize version check # -############################ -_report_error=no -if [ ! "x$_ltfound" = "xyes" ] ; then - $ECHO - $ECHO "ERROR: Unable to locate GNU Libtool." - _report_error=yes -else - _version="`$LIBTOOLIZE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`" - if [ "x$_version" = "x" ] ; then - _version="0.0.0" - fi - $ECHO "Found GNU Libtool version $_version" - version_check "$LIBTOOL_VERSION" "$_version" - if [ $? -ne 0 ] ; then - _report_error=yes - fi -fi -if [ "x$_report_error" = "xyes" ] ; then - version_error "$LIBTOOL_VERSION" "GNU Libtool" - exit 1 -fi - - -##################### -# check for aclocal # -##################### -if [ "x$ACLOCAL" = "x" ] ; then - for ACLOCAL in aclocal ; do - $VERBOSE_ECHO "Checking aclocal version: $ACLOCAL --version" - $ACLOCAL --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - break - fi - done -else - $ECHO "Using ACLOCAL environment variable override: $ACLOCAL" -fi - - -######################## -# check for autoheader # -######################## -if [ "x$AUTOHEADER" = "x" ] ; then - for AUTOHEADER in autoheader ; do - $VERBOSE_ECHO "Checking autoheader version: $AUTOHEADER --version" - $AUTOHEADER --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - break - fi - done -else - $ECHO "Using AUTOHEADER environment variable override: $AUTOHEADER" -fi - - -######################### -# check if version only # -######################### -$VERBOSE_ECHO "Checking whether to only output version information" -if [ "x$VERSION_ONLY" = "xyes" ] ; then - $ECHO - ident - $ECHO "---" - $ECHO "Version requested. No preparation or configuration will be performed." - exit 0 -fi - - -################################# -# PROTECT_FROM_CLOBBER FUNCTION # -################################# -protect_from_clobber ( ) { - PFC_INIT=1 - - # protect COPYING & INSTALL from overwrite by automake. the - # automake force option will (inappropriately) ignore the existing - # contents of a COPYING and/or INSTALL files (depending on the - # version) instead of just forcing *missing* files like it does - # for AUTHORS, NEWS, and README. this is broken but extremely - # prevalent behavior, so we protect against it by keeping a backup - # of the file that can later be restored. - - for file in COPYING INSTALL ; do - if test -f ${file} ; then - if test -f ${file}.$$.protect_from_automake.backup ; then - $VERBOSE_ECHO "Already backed up ${file} in `pwd`" - else - $VERBOSE_ECHO "Backing up ${file} in `pwd`" - $VERBOSE_ECHO "cp -p ${file} ${file}.$$.protect_from_automake.backup" - cp -p ${file} ${file}.$$.protect_from_automake.backup - fi - fi - done -} - - -############################## -# RECURSIVE_PROTECT FUNCTION # -############################## -recursive_protect ( ) { - - # for projects using recursive configure, run the build - # preparation steps for the subdirectories. this function assumes - # START_PATH was set to pwd before recursion begins so that - # relative paths work. - - # git 'r done, protect COPYING and INSTALL from being clobbered - protect_from_clobber - - if test -d autom4te.cache ; then - $VERBOSE_ECHO "Found an autom4te.cache directory, deleting it" - $VERBOSE_ECHO "rm -rf autom4te.cache" - rm -rf autom4te.cache - fi - - # find configure template - _configure="`locate_configure_template`" - if [ "x$_configure" = "x" ] ; then - return - fi - # $VERBOSE_ECHO "Looking for configure template found `pwd`/$_configure" - - # look for subdirs - # $VERBOSE_ECHO "Looking for subdirs in `pwd`" - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - CHECK_DIRS="" - for dir in $_det_config_subdirs ; do - if test -d "`pwd`/$dir" ; then - CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\"" - fi - done - - # process subdirs - if [ ! "x$CHECK_DIRS" = "x" ] ; then - $VERBOSE_ECHO "Recursively scanning the following directories:" - $VERBOSE_ECHO " $CHECK_DIRS" - for dir in $CHECK_DIRS ; do - $VERBOSE_ECHO "Protecting files from automake in $dir" - cd "$START_PATH" - eval "cd $dir" - - # recursively git 'r done - recursive_protect - done - fi -} # end of recursive_protect - - -############################# -# RESTORE_CLOBBERED FUNCION # -############################# -restore_clobbered ( ) { - - # The automake (and autoreconf by extension) -f/--force-missing - # option may overwrite COPYING and INSTALL even if they do exist. - # Here we restore the files if necessary. - - spacer=no - - for file in COPYING INSTALL ; do - if test -f ${file}.$$.protect_from_automake.backup ; then - if test -f ${file} ; then - # compare entire content, restore if needed - if test "x`cat ${file}`" != "x`cat ${file}.$$.protect_from_automake.backup`" ; then - if test "x$spacer" = "xno" ; then - $VERBOSE_ECHO - spacer=yes - fi - # restore the backup - $VERBOSE_ECHO "Restoring ${file} from backup (automake -f likely clobbered it)" - $VERBOSE_ECHO "rm -f ${file}" - rm -f ${file} - $VERBOSE_ECHO "mv ${file}.$$.protect_from_automake.backup ${file}" - mv ${file}.$$.protect_from_automake.backup ${file} - fi # check contents - elif test -f ${file}.$$.protect_from_automake.backup ; then - $VERBOSE_ECHO "mv ${file}.$$.protect_from_automake.backup ${file}" - mv ${file}.$$.protect_from_automake.backup ${file} - fi # -f ${file} - - # just in case - $VERBOSE_ECHO "rm -f ${file}.$$.protect_from_automake.backup" - rm -f ${file}.$$.protect_from_automake.backup - fi # -f ${file}.$$.protect_from_automake.backup - done - - CONFIGURE="`locate_configure_template`" - if [ "x$CONFIGURE" = "x" ] ; then - return - fi - - _aux_dir="`grep AC_CONFIG_AUX_DIR $CONFIGURE | grep -v '.*#.*AC_CONFIG_AUX_DIR' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_CONFIG_AUX_DIR(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - if test ! -d "$_aux_dir" ; then - _aux_dir=. - fi - - for file in config.guess config.sub ltmain.sh ; do - if test -f "${_aux_dir}/${file}" ; then - $VERBOSE_ECHO "rm -f \"${_aux_dir}/${file}.backup\"" - rm -f "${_aux_dir}/${file}.backup" - fi - done -} # end of restore_clobbered - - -############################## -# RECURSIVE_RESTORE FUNCTION # -############################## -recursive_restore ( ) { - - # restore COPYING and INSTALL from backup if they were clobbered - # for each directory recursively. - - # git 'r undone - restore_clobbered - - # find configure template - _configure="`locate_configure_template`" - if [ "x$_configure" = "x" ] ; then - return - fi - - # look for subdirs - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - CHECK_DIRS="" - for dir in $_det_config_subdirs ; do - if test -d "`pwd`/$dir" ; then - CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\"" - fi - done - - # process subdirs - if [ ! "x$CHECK_DIRS" = "x" ] ; then - $VERBOSE_ECHO "Recursively scanning the following directories:" - $VERBOSE_ECHO " $CHECK_DIRS" - for dir in $CHECK_DIRS ; do - $VERBOSE_ECHO "Checking files for automake damage in $dir" - cd "$START_PATH" - eval "cd $dir" - - # recursively git 'r undone - recursive_restore - done - fi -} # end of recursive_restore - - -####################### -# INITIALIZE FUNCTION # -####################### -initialize ( ) { - - # this routine performs a variety of directory-specific - # initializations. some are sanity checks, some are preventive, - # and some are necessary setup detection. - # - # this function sets: - # CONFIGURE - # SEARCH_DIRS - # CONFIG_SUBDIRS - - ################################## - # check for a configure template # - ################################## - CONFIGURE="`locate_configure_template`" - if [ "x$CONFIGURE" = "x" ] ; then - $ECHO - $ECHO "A configure.ac or configure.in file could not be located implying" - $ECHO "that the GNU Build System is at least not used in this directory. In" - $ECHO "any case, there is nothing to do here without one of those files." - $ECHO - $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`" - exit 1 - fi - - ##################### - # detect an aux dir # - ##################### - _aux_dir="`grep AC_CONFIG_AUX_DIR $CONFIGURE | grep -v '.*#.*AC_CONFIG_AUX_DIR' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_CONFIG_AUX_DIR(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - if test ! -d "$_aux_dir" ; then - _aux_dir=. - else - $VERBOSE_ECHO "Detected auxillary directory: $_aux_dir" - fi - - ################################ - # detect a recursive configure # - ################################ - CONFIG_SUBDIRS="" - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $CONFIGURE | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - for dir in $_det_config_subdirs ; do - if test -d "`pwd`/$dir" ; then - $VERBOSE_ECHO "Detected recursive configure directory: `pwd`/$dir" - CONFIG_SUBDIRS="$CONFIG_SUBDIRS `pwd`/$dir" - fi - done - - ########################################################### - # make sure certain required files exist for GNU projects # - ########################################################### - _marker_found="" - _marker_found_message_intro='Detected non-GNU marker "' - _marker_found_message_mid='" in ' - for marker in foreign cygnus ; do - _marker_found_message=${_marker_found_message_intro}${marker}${_marker_found_message_mid} - _marker_found="`grep 'AM_INIT_AUTOMAKE.*'${marker} $CONFIGURE`" - if [ ! "x$_marker_found" = "x" ] ; then - $VERBOSE_ECHO "${_marker_found_message}`basename \"$CONFIGURE\"`" - break - fi - if test -f "`dirname \"$CONFIGURE\"/Makefile.am`" ; then - _marker_found="`grep 'AUTOMAKE_OPTIONS.*'${marker} Makefile.am`" - if [ ! "x$_marker_found" = "x" ] ; then - $VERBOSE_ECHO "${_marker_found_message}Makefile.am" - break - fi - fi - done - if [ "x${_marker_found}" = "x" ] ; then - _suggest_foreign=no - for file in AUTHORS COPYING ChangeLog INSTALL NEWS README ; do - if [ ! -f $file ] ; then - $VERBOSE_ECHO "Touching ${file} since it does not exist" - _suggest_foreign=yes - touch $file - fi - done - - if [ "x${_suggest_foreign}" = "xyes" ] ; then - $ECHO - $ECHO "Warning: Several files expected of projects that conform to the GNU" - $ECHO "coding standards were not found. The files were automatically added" - $ECHO "for you since you do not have a 'foreign' declaration specified." - $ECHO - $ECHO "Considered adding 'foreign' to AM_INIT_AUTOMAKE in `basename \"$CONFIGURE\"`" - if test -f "`dirname \"$CONFIGURE\"/Makefile.am`" ; then - $ECHO "or to AUTOMAKE_OPTIONS in your top-level Makefile.am file." - fi - $ECHO - fi - fi - - ################################################## - # make sure certain generated files do not exist # - ################################################## - for file in config.guess config.sub ltmain.sh ; do - if test -f "${_aux_dir}/${file}" ; then - $VERBOSE_ECHO "mv -f \"${_aux_dir}/${file}\" \"${_aux_dir}/${file}.backup\"" - mv -f "${_aux_dir}/${file}" "${_aux_dir}/${file}.backup" - fi - done - - ############################ - # search alternate m4 dirs # - ############################ - SEARCH_DIRS="" - for dir in m4 ; do - if [ -d $dir ] ; then - $VERBOSE_ECHO "Found extra aclocal search directory: $dir" - SEARCH_DIRS="$SEARCH_DIRS -I $dir" - fi - done - - ###################################### - # remove any previous build products # - ###################################### - if test -d autom4te.cache ; then - $VERBOSE_ECHO "Found an autom4te.cache directory, deleting it" - $VERBOSE_ECHO "rm -rf autom4te.cache" - rm -rf autom4te.cache - fi -# tcl/tk (and probably others) have a customized aclocal.m4, so can't delete it -# if test -f aclocal.m4 ; then -# $VERBOSE_ECHO "Found an aclocal.m4 file, deleting it" -# $VERBOSE_ECHO "rm -f aclocal.m4" -# rm -f aclocal.m4 -# fi - -} # end of initialize() - - -############## -# initialize # -############## - -# stash path -START_PATH="`pwd`" - -# Before running autoreconf or manual steps, some prep detection work -# is necessary or useful. Only needs to occur once per directory, but -# does need to traverse the entire subconfigure hierarchy to protect -# files from being clobbered even by autoreconf. -recursive_protect - -# start from where we started -cd "$START_PATH" - -# get ready to process -initialize - - -######################################### -# DOWNLOAD_GNULIB_CONFIG_GUESS FUNCTION # -######################################### - -# TODO - should make sure wget/curl exist and/or work before trying to -# use them. - -download_gnulib_config_guess () { - # abuse gitweb to download gnulib's latest config.guess via HTTP - config_guess_temp="config.guess.$$.download" - ret=1 - for __cmd in wget curl fetch ; do - $VERBOSE_ECHO "Checking for command ${__cmd}" - ${__cmd} --version > /dev/null 2>&1 - ret=$? - if [ ! $ret = 0 ] ; then - continue - fi - - __cmd_version=`${__cmd} --version | head -n 1 | sed -e 's/^[^0-9]\+//' -e 's/ .*//'` - $VERBOSE_ECHO "Found ${__cmd} ${__cmd_version}" - - opts="" - case ${__cmd} in - wget) - opts="-O" - ;; - curl) - opts="-o" - ;; - fetch) - opts="-t 5 -f" - ;; - esac - - $VERBOSE_ECHO "Running $__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\"" - eval "$__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\"" > /dev/null 2>&1 - if [ $? = 0 ] ; then - mv -f "${config_guess_temp}" ${_aux_dir}/config.guess - ret=0 - break - fi - done - - if [ ! $ret = 0 ] ; then - $ECHO "Warning: config.guess download failed from: $CONFIG_GUESS_URL" - rm -f "${config_guess_temp}" - fi -} - - -############################## -# LIBTOOLIZE_NEEDED FUNCTION # -############################## -libtoolize_needed () { - ret=1 # means no, don't need libtoolize - for feature in AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT ; do - $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" - found="`grep \"^$feature.*\" $CONFIGURE`" - if [ ! "x$found" = "x" ] ; then - ret=0 # means yes, need to run libtoolize - break - fi - done - return ${ret} -} - - - -############################################ -# prepare build via autoreconf or manually # -############################################ -reconfigure_manually=no -if [ "x$HAVE_AUTORECONF" = "xyes" ] ; then - $ECHO - $ECHO $ECHO_N "Automatically preparing build ... $ECHO_C" - - $VERBOSE_ECHO "$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS" - autoreconf_output="`$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$autoreconf_output" - - if [ ! $ret = 0 ] ; then - if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then - if [ ! "x`echo \"$autoreconf_output\" | grep libtoolize | grep \"No such file or directory\"`" = "x" ] ; then - $ECHO - $ECHO "Warning: autoreconf failed but due to what is usually a common libtool" - $ECHO "misconfiguration issue. This problem is encountered on systems that" - $ECHO "have installed libtoolize under a different name without providing a" - $ECHO "symbolic link or without setting the LIBTOOLIZE environment variable." - $ECHO - $ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE" - - export LIBTOOLIZE - RUN_RECURSIVE=no - export RUN_RECURSIVE - untrap_abnormal - - $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - exit $? - fi - fi - - $ECHO "Warning: $AUTORECONF failed" - - if test -f ltmain.sh ; then - $ECHO "libtoolize being run by autoreconf is not creating ltmain.sh in the auxillary directory like it should" - fi - - $ECHO "Attempting to run the preparation steps individually" - reconfigure_manually=yes - else - if [ "x$DOWNLOAD" = "xyes" ] ; then - if libtoolize_needed ; then - download_gnulib_config_guess - fi - fi - fi -else - reconfigure_manually=yes -fi - - -############################ -# LIBTOOL_FAILURE FUNCTION # -############################ -libtool_failure ( ) { - - # libtool is rather error-prone in comparison to the other - # autotools and this routine attempts to compensate for some - # common failures. the output after a libtoolize failure is - # parsed for an error related to AC_PROG_LIBTOOL and if found, we - # attempt to inject a project-provided libtool.m4 file. - - _autoconf_output="$1" - - if [ "x$RUN_RECURSIVE" = "xno" ] ; then - # we already tried the libtool.m4, don't try again - return 1 - fi - - if test -f "$LIBTOOL_M4" ; then - found_libtool="`$ECHO $_autoconf_output | grep AC_PROG_LIBTOOL`" - if test ! "x$found_libtool" = "x" ; then - if test -f acinclude.m4 ; then - rm -f acinclude.m4.$$.backup - $VERBOSE_ECHO "cat acinclude.m4 > acinclude.m4.$$.backup" - cat acinclude.m4 > acinclude.m4.$$.backup - fi - $VERBOSE_ECHO "cat \"$LIBTOOL_M4\" >> acinclude.m4" - chmod u+w acinclude.m4 - cat "$LIBTOOL_M4" >> acinclude.m4 - - # don't keep doing this - RUN_RECURSIVE=no - export RUN_RECURSIVE - untrap_abnormal - - $ECHO - $ECHO "Restarting the preparation steps with libtool macros in acinclude.m4" - $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - exit $? - fi - fi -} - - -########################### -# MANUAL_AUTOGEN FUNCTION # -########################### -manual_autogen ( ) { - - ################################################## - # Manual preparation steps taken are as follows: # - # aclocal [-I m4] # - # libtoolize --automake -c -f # - # aclocal [-I m4] # - # autoconf -f # - # autoheader # - # automake -a -c -f # - ################################################## - - ########### - # aclocal # - ########### - $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS" - aclocal_output="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$aclocal_output" - if [ ! $ret = 0 ] ; then $ECHO "ERROR: $ACLOCAL failed" && exit 2 ; fi - - ############## - # libtoolize # - ############## - if libtoolize_needed ; then - if [ "x$HAVE_LIBTOOLIZE" = "xyes" ] ; then - $VERBOSE_ECHO "$LIBTOOLIZE $LIBTOOLIZE_OPTIONS" - libtoolize_output="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$libtoolize_output" - - if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi - else - if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then - $VERBOSE_ECHO "$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS" - libtoolize_output="`$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$libtoolize_output" - - if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi - fi - fi - - ########### - # aclocal # - ########### - # re-run again as instructed by libtoolize - $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS" - aclocal_output="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$aclocal_output" - - # libtoolize might put ltmain.sh in the wrong place - if test -f ltmain.sh ; then - if test ! -f "${_aux_dir}/ltmain.sh" ; then - $ECHO - $ECHO "Warning: $LIBTOOLIZE is creating ltmain.sh in the wrong directory" - $ECHO - $ECHO "Fortunately, the problem can be worked around by simply copying the" - $ECHO "file to the appropriate location (${_aux_dir}/). This has been done for you." - $ECHO - $VERBOSE_ECHO "cp -p ltmain.sh \"${_aux_dir}/ltmain.sh\"" - cp -p ltmain.sh "${_aux_dir}/ltmain.sh" - $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C" - fi - fi # ltmain.sh - - if [ "x$DOWNLOAD" = "xyes" ] ; then - download_gnulib_config_guess - fi - fi # libtoolize_needed - - ############ - # autoconf # - ############ - $VERBOSE_ECHO - $VERBOSE_ECHO "$AUTOCONF $AUTOCONF_OPTIONS" - autoconf_output="`$AUTOCONF $AUTOCONF_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$autoconf_output" - - if [ ! $ret = 0 ] ; then - # retry without the -f and check for usage of macros that are too new - ac2_59_macros="AC_C_RESTRICT AC_INCLUDES_DEFAULT AC_LANG_ASSERT AC_LANG_WERROR AS_SET_CATFILE" - ac2_55_macros="AC_COMPILER_IFELSE AC_FUNC_MBRTOWC AC_HEADER_STDBOOL AC_LANG_CONFTEST AC_LANG_SOURCE AC_LANG_PROGRAM AC_LANG_CALL AC_LANG_FUNC_TRY_LINK AC_MSG_FAILURE AC_PREPROC_IFELSE" - ac2_54_macros="AC_C_BACKSLASH_A AC_CONFIG_LIBOBJ_DIR AC_GNU_SOURCE AC_PROG_EGREP AC_PROG_FGREP AC_REPLACE_FNMATCH AC_FUNC_FNMATCH_GNU AC_FUNC_REALLOC AC_TYPE_MBSTATE_T" - - macros_to_search="" - ac_major="`echo ${AUTOCONF_VERSION}. | cut -d. -f1 | sed 's/[^0-9]//g'`" - ac_minor="`echo ${AUTOCONF_VERSION}. | cut -d. -f2 | sed 's/[^0-9]//g'`" - - if [ $ac_major -lt 2 ] ; then - macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros" - else - if [ $ac_minor -lt 54 ] ; then - macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros" - elif [ $ac_minor -lt 55 ] ; then - macros_to_search="$ac2_59_macros $ac2_55_macros" - elif [ $ac_minor -lt 59 ] ; then - macros_to_search="$ac2_59_macros" - fi - fi - - configure_ac_macros=__none__ - for feature in $macros_to_search ; do - $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" - found="`grep \"^$feature.*\" $CONFIGURE`" - if [ ! "x$found" = "x" ] ; then - if [ "x$configure_ac_macros" = "x__none__" ] ; then - configure_ac_macros="$feature" - else - configure_ac_macros="$feature $configure_ac_macros" - fi - fi - done - if [ ! "x$configure_ac_macros" = "x__none__" ] ; then - $ECHO - $ECHO "Warning: Unsupported macros were found in $CONFIGURE" - $ECHO - $ECHO "The `basename \"$CONFIGURE\"` file was scanned in order to determine if any" - $ECHO "unsupported macros are used that exceed the minimum version" - $ECHO "settings specified within this file. As such, the following macros" - $ECHO "should be removed from configure.ac or the version numbers in this" - $ECHO "file should be increased:" - $ECHO - $ECHO "$configure_ac_macros" - $ECHO - $ECHO $ECHO_N "Ignorantly continuing build preparation ... $ECHO_C" - fi - - ################### - # autoconf, retry # - ################### - $VERBOSE_ECHO - $VERBOSE_ECHO "$AUTOCONF" - autoconf_output="`$AUTOCONF 2>&1`" - ret=$? - $VERBOSE_ECHO "$autoconf_output" - - if [ ! $ret = 0 ] ; then - # test if libtool is busted - libtool_failure "$autoconf_output" - - # let the user know what went wrong - cat <= 2.5.0, [with_libagg=yes], [with_libagg=no]) - -if test "$with_libagg" != "yes"; then - AC_MSG_FAILURE([You must have AGG installed: http://vector-agg.sourceforge.net/]) -fi - -AC_OUTPUT([ -Makefile -src/wxAGG/Makefile -src/xpm/Makefile -src/Makefile -]) diff --git a/contrib/assdraw/m4/wxwin.m4 b/contrib/assdraw/m4/wxwin.m4 deleted file mode 100644 index 1c50dcc27..000000000 --- a/contrib/assdraw/m4/wxwin.m4 +++ /dev/null @@ -1,1060 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl Author: wxWidgets development team, -dnl Francesco Montorsi, -dnl Bob McCown (Mac-testing) -dnl Creation date: 24/11/2001 -dnl RCS-ID: $Id$ -dnl --------------------------------------------------------------------------- - -dnl =========================================================================== -dnl Table of Contents of this macro file: -dnl ------------------------------------- -dnl -dnl SECTION A: wxWidgets main macros -dnl - WX_CONFIG_OPTIONS -dnl - WX_CONFIG_CHECK -dnl - WXRC_CHECK -dnl - WX_STANDARD_OPTIONS -dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS -dnl - WX_DETECT_STANDARD_OPTION_VALUES -dnl -dnl SECTION B: wxWidgets-related utilities -dnl - WX_LIKE_LIBNAME -dnl - WX_ARG_ENABLE_YESNOAUTO -dnl - WX_ARG_WITH_YESNOAUTO -dnl -dnl SECTION C: messages to the user -dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG -dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN -dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END -dnl - WX_BOOLOPT_SUMMARY -dnl -dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra -dnl debug output on stdout from these macros. -dnl =========================================================================== - - -dnl --------------------------------------------------------------------------- -dnl Macros for wxWidgets detection. Typically used in configure.in as: -dnl -dnl AC_ARG_ENABLE(...) -dnl AC_ARG_WITH(...) -dnl ... -dnl WX_CONFIG_OPTIONS -dnl ... -dnl ... -dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1]) -dnl if test "$wxWin" != 1; then -dnl AC_MSG_ERROR([ -dnl wxWidgets must be installed on your system -dnl but wx-config script couldn't be found. -dnl -dnl Please check that wx-config is in path, the directory -dnl where wxWidgets libraries are installed (returned by -dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or -dnl equivalent variable and wxWidgets version is 2.3.4 or above. -dnl ]) -dnl fi -dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" -dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" -dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" -dnl -dnl LIBS="$LIBS $WX_LIBS" -dnl -dnl If you want to support standard --enable-debug/unicode/shared options, you -dnl may do the following: -dnl -dnl ... -dnl AC_CANONICAL_SYSTEM -dnl -dnl # define configure options -dnl WX_CONFIG_OPTIONS -dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared]) -dnl -dnl # basic configure checks -dnl ... -dnl -dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE -dnl WX_DEBUG=$DEBUG -dnl WX_UNICODE=$UNICODE -dnl -dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS -dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS]) -dnl WX_DETECT_STANDARD_OPTION_VALUES -dnl -dnl # write the output files -dnl AC_CONFIG_FILES([Makefile ...]) -dnl AC_OUTPUT -dnl -dnl # optional: just to show a message to the user -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG -dnl -dnl --------------------------------------------------------------------------- - - -dnl --------------------------------------------------------------------------- -dnl WX_CONFIG_OPTIONS -dnl -dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and -dnl --wx-config command line options -dnl --------------------------------------------------------------------------- - -AC_DEFUN([WX_CONFIG_OPTIONS], -[ - AC_ARG_WITH(wxdir, - [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH], - [ wx_config_name="$withval/wx-config" - wx_config_args="--inplace"]) - AC_ARG_WITH(wx-config, - [ --with-wx-config=CONFIG wx-config script to use (optional)], - wx_config_name="$withval" ) - AC_ARG_WITH(wx-prefix, - [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)], - wx_config_prefix="$withval", wx_config_prefix="") - AC_ARG_WITH(wx-exec-prefix, - [ --with-wx-exec-prefix=PREFIX - Exec prefix where wxWidgets is installed (optional)], - wx_config_exec_prefix="$withval", wx_config_exec_prefix="") -]) - -dnl Helper macro for checking if wx version is at least $1.$2.$3, set's -dnl wx_ver_ok=yes if it is: -AC_DEFUN([_WX_PRIVATE_CHECK_VERSION], -[ - wx_ver_ok="" - if test "x$WX_VERSION" != x ; then - if test $wx_config_major_version -gt $1; then - wx_ver_ok=yes - else - if test $wx_config_major_version -eq $1; then - if test $wx_config_minor_version -gt $2; then - wx_ver_ok=yes - else - if test $wx_config_minor_version -eq $2; then - if test $wx_config_micro_version -ge $3; then - wx_ver_ok=yes - fi - fi - fi - fi - fi - fi -]) - -dnl --------------------------------------------------------------------------- -dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND -dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]]) -dnl -dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC -dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME -dnl environment variable to override the default name of the wx-config script -dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this -dnl case the macro won't even waste time on tests for its existence. -dnl -dnl Optional WX-LIBS argument contains comma- or space-separated list of -dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS -dnl and WX_LIBS_STATIC will contain flags to link with all of the core -dnl wxWidgets libraries. -dnl -dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config -dnl invocation command in present. It can be used to fine-tune lookup of -dnl best wxWidgets build available. -dnl -dnl Example use: -dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net] -dnl [--unicode --debug]) -dnl --------------------------------------------------------------------------- - -dnl -dnl Get the cflags and libraries from the wx-config script -dnl -AC_DEFUN([WX_CONFIG_CHECK], -[ - dnl do we have wx-config name: it can be wx-config or wxd-config or ... - if test x${WX_CONFIG_NAME+set} != xset ; then - WX_CONFIG_NAME=wx-config - fi - - if test "x$wx_config_name" != x ; then - WX_CONFIG_NAME="$wx_config_name" - fi - - dnl deal with optional prefixes - if test x$wx_config_exec_prefix != x ; then - wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" - WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" - fi - if test x$wx_config_prefix != x ; then - wx_config_args="$wx_config_args --prefix=$wx_config_prefix" - WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" - fi - if test "$cross_compiling" = "yes"; then - wx_config_args="$wx_config_args --host=$host_alias" - fi - - dnl don't search the PATH if WX_CONFIG_NAME is absolute filename - if test -x "$WX_CONFIG_NAME" ; then - AC_MSG_CHECKING(for wx-config) - WX_CONFIG_PATH="$WX_CONFIG_NAME" - AC_MSG_RESULT($WX_CONFIG_PATH) - else - AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH") - fi - - if test "$WX_CONFIG_PATH" != "no" ; then - WX_VERSION="" - - min_wx_version=ifelse([$1], ,2.2.1,$1) - if test -z "$5" ; then - AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version]) - else - AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)]) - fi - - dnl don't add the libraries ($4) to this variable as this would result in - dnl an error when it's used with --version below - WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5" - - WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` - wx_config_major_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - wx_config_minor_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - wx_config_micro_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - wx_requested_major_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - wx_requested_minor_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - wx_requested_micro_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version], - [$wx_requested_minor_version], - [$wx_requested_micro_version]) - - if test -n "$wx_ver_ok"; then - AC_MSG_RESULT(yes (version $WX_VERSION)) - WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4` - - dnl is this even still appropriate? --static is a real option now - dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is - dnl what the user actually wants, making this redundant at best. - dnl For now keep it in case anyone actually used it in the past. - AC_MSG_CHECKING([for wxWidgets static library]) - WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null` - if test "x$WX_LIBS_STATIC" = "x"; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - fi - - dnl starting with version 2.2.6 wx-config has --cppflags argument - wx_has_cppflags="" - if test $wx_config_major_version -gt 2; then - wx_has_cppflags=yes - else - if test $wx_config_major_version -eq 2; then - if test $wx_config_minor_version -gt 2; then - wx_has_cppflags=yes - else - if test $wx_config_minor_version -eq 2; then - if test $wx_config_micro_version -ge 6; then - wx_has_cppflags=yes - fi - fi - fi - fi - fi - - dnl starting with version 2.7.0 wx-config has --rescomp option - wx_has_rescomp="" - if test $wx_config_major_version -gt 2; then - wx_has_rescomp=yes - else - if test $wx_config_major_version -eq 2; then - if test $wx_config_minor_version -ge 7; then - wx_has_rescomp=yes - fi - fi - fi - if test "x$wx_has_rescomp" = x ; then - dnl cannot give any useful info for resource compiler - WX_RESCOMP= - else - WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` - fi - - if test "x$wx_has_cppflags" = x ; then - dnl no choice but to define all flags like CFLAGS - WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` - WX_CPPFLAGS=$WX_CFLAGS - WX_CXXFLAGS=$WX_CFLAGS - - WX_CFLAGS_ONLY=$WX_CFLAGS - WX_CXXFLAGS_ONLY=$WX_CFLAGS - else - dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS - WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4` - WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4` - WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` - - WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` - WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` - fi - - ifelse([$2], , :, [$2]) - - else - - if test "x$WX_VERSION" = x; then - dnl no wx-config at all - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(no (version $WX_VERSION is not new enough)) - fi - - WX_CFLAGS="" - WX_CPPFLAGS="" - WX_CXXFLAGS="" - WX_LIBS="" - WX_LIBS_STATIC="" - WX_RESCOMP="" - - if test ! -z "$5"; then - - wx_error_message=" - The configuration you asked for $PACKAGE_NAME requires a wxWidgets - build with the following settings: - $5 - but such build is not available. - - To see the wxWidgets builds available on this system, please use - 'wx-config --list' command. To use the default build, returned by - 'wx-config --selected-config', use the options with their 'auto' - default values." - - fi - - wx_error_message=" - The requested wxWidgets build couldn't be found. - $wx_error_message - - If you still get this error, then check that 'wx-config' is - in path, the directory where wxWidgets libraries are installed - (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH - or equivalent variable and wxWidgets version is $1 or above." - - ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3]) - - fi - else - - WX_CFLAGS="" - WX_CPPFLAGS="" - WX_CXXFLAGS="" - WX_LIBS="" - WX_LIBS_STATIC="" - WX_RESCOMP="" - - ifelse([$3], , :, [$3]) - - fi - - AC_SUBST(WX_CPPFLAGS) - AC_SUBST(WX_CFLAGS) - AC_SUBST(WX_CXXFLAGS) - AC_SUBST(WX_CFLAGS_ONLY) - AC_SUBST(WX_CXXFLAGS_ONLY) - AC_SUBST(WX_LIBS) - AC_SUBST(WX_LIBS_STATIC) - AC_SUBST(WX_VERSION) - AC_SUBST(WX_RESCOMP) - - dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols - dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness): - WX_VERSION_MAJOR="$wx_config_major_version" - WX_VERSION_MINOR="$wx_config_minor_version" - WX_VERSION_MICRO="$wx_config_micro_version" - AC_SUBST(WX_VERSION_MAJOR) - AC_SUBST(WX_VERSION_MINOR) - AC_SUBST(WX_VERSION_MICRO) -]) - -dnl --------------------------------------------------------------------------- -dnl Get information on the wxrc program for making C++, Python and xrs -dnl resource files. -dnl -dnl AC_ARG_ENABLE(...) -dnl AC_ARG_WITH(...) -dnl ... -dnl WX_CONFIG_OPTIONS -dnl ... -dnl WX_CONFIG_CHECK(2.6.0, wxWin=1) -dnl if test "$wxWin" != 1; then -dnl AC_MSG_ERROR([ -dnl wxWidgets must be installed on your system -dnl but wx-config script couldn't be found. -dnl -dnl Please check that wx-config is in path, the directory -dnl where wxWidgets libraries are installed (returned by -dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or -dnl equivalent variable and wxWidgets version is 2.6.0 or above. -dnl ]) -dnl fi -dnl -dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0]) -dnl if test "x$HAVE_WXRC" != x1; then -dnl AC_MSG_ERROR([ -dnl The wxrc program was not installed or not found. -dnl -dnl Please check the wxWidgets installation. -dnl ]) -dnl fi -dnl -dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" -dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" -dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" -dnl -dnl LDFLAGS="$LDFLAGS $WX_LIBS" -dnl --------------------------------------------------------------------------- - -dnl --------------------------------------------------------------------------- -dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS -dnl resources. The variable WXRC will be set and substituted in the configure -dnl script and Makefiles. -dnl -dnl Example use: -dnl WXRC_CHECK([wxrc=1], [wxrc=0]) -dnl --------------------------------------------------------------------------- - -dnl -dnl wxrc program from the wx-config script -dnl -AC_DEFUN([WXRC_CHECK], -[ - AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler]) - - if test "x$WX_CONFIG_NAME" = x; then - AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.]) - else - - AC_MSG_CHECKING([for wxrc]) - - if test "x$WXRC" = x ; then - dnl wx-config --utility is a new addition to wxWidgets: - _WX_PRIVATE_CHECK_VERSION(2,5,3) - if test -n "$wx_ver_ok"; then - WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc` - fi - fi - - if test "x$WXRC" = x ; then - AC_MSG_RESULT([not found]) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT([$WXRC]) - ifelse([$1], , :, [$1]) - fi - - AC_SUBST(WXRC) - fi -]) - -dnl --------------------------------------------------------------------------- -dnl WX_LIKE_LIBNAME([output-var] [prefix], [name]) -dnl -dnl Sets the "output-var" variable to the name of a library named with same -dnl wxWidgets rule. -dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets -dnl the $lib variable to: -dnl 'mine_gtk2ud_test-2.8' -dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28 -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_LIKE_LIBNAME], - [ - wx_temp="$2""_""$WX_PORT" - - dnl add the [u][d] string - if test "$WX_UNICODE" = "1"; then - wx_temp="$wx_temp""u" - fi - if test "$WX_DEBUG" = "1"; then - wx_temp="$wx_temp""d" - fi - - dnl complete the name of the lib - wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR" - - dnl save it in the user's variable - $1=$wx_temp - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO -dnl -dnl Two little custom macros which define the ENABLE/WITH configure arguments. -dnl Macro arguments: -dnl $1 = the name of the --enable / --with feature -dnl $2 = the name of the variable associated -dnl $3 = the description of that feature -dnl $4 = the default value for that feature -dnl $5 = additional action to do in case option is given with "yes" value -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO], - [AC_ARG_ENABLE($1, - AC_HELP_STRING([--enable-$1], [$3 (default is $4)]), - [], [enableval="$4"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --enable-$1 option]) - if test "$enableval" = "yes" ; then - AC_MSG_RESULT([yes]) - $2=1 - $5 - elif test "$enableval" = "no" ; then - AC_MSG_RESULT([no]) - $2=0 - elif test "$enableval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - $2="auto" - else - AC_MSG_ERROR([ - Unrecognized option value (allowed values: yes, no, auto) - ]) - fi - ]) - -AC_DEFUN([WX_ARG_WITH_YESNOAUTO], - [AC_ARG_WITH($1, - AC_HELP_STRING([--with-$1], [$3 (default is $4)]), - [], [withval="$4"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --with-$1 option]) - if test "$withval" = "yes" ; then - AC_MSG_RESULT([yes]) - $2=1 - $5 - dnl NB: by default we don't allow --with-$1=no option - dnl since it does not make much sense ! - elif test "$6" = "1" -a "$withval" = "no" ; then - AC_MSG_RESULT([no]) - $2=0 - elif test "$withval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - $2="auto" - else - AC_MSG_ERROR([ - Unrecognized option value (allowed values: yes, auto) - ]) - fi - ]) - - -dnl --------------------------------------------------------------------------- -dnl WX_STANDARD_OPTIONS([options-to-add]) -dnl -dnl Adds to the configure script one or more of the following options: -dnl --enable-[debug|unicode|shared|wxshared|wxdebug] -dnl --with-[gtk|msw|motif|x11|mac|dfb] -dnl --with-wxversion -dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED, -dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values. -dnl -dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the -dnl --enable-unicode option (in boolean format) while the second indicates -dnl if wxWidgets was built in Unicode mode (and still is in boolean format). -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_STANDARD_OPTIONS], - [ - - dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if - dnl the $1 argument contains respectively the debug,unicode or shared options. - - dnl be careful here not to set debug flag if only "wxdebug" was specified - ifelse(regexp([$1], [\bdebug]), [-1],, - [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])]) - - ifelse(index([$1], [unicode]), [-1],, - [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])]) - - ifelse(regexp([$1], [\bshared]), [-1],, - [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])]) - - dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option - dnl which must be able to accept the auto|gtk1|gtk2|msw|... values - ifelse(index([$1], [toolkit]), [-1],, - [ - AC_ARG_WITH([toolkit], - AC_HELP_STRING([--with-toolkit], - [Build against a specific wxWidgets toolkit (default is auto)]), - [], [withval="auto"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --with-toolkit option]) - if test "$withval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - TOOLKIT="auto" - else - TOOLKIT="$withval" - - dnl PORT must be one of the allowed values - if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \ - "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \ - "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \ - "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then - AC_MSG_ERROR([ - Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11) - ]) - fi - - AC_MSG_RESULT([$TOOLKIT]) - fi - ]) - - dnl ****** IMPORTANT ******* - dnl Unlike for the UNICODE setting, you can build your program in - dnl shared mode against a static build of wxWidgets. Thus we have the - dnl following option which allows these mixtures. E.g. - dnl - dnl ./configure --disable-shared --with-wxshared - dnl - dnl will build your library in static mode against the first available - dnl shared build of wxWidgets. - dnl - dnl Note that's not possible to do the viceversa: - dnl - dnl ./configure --enable-shared --without-wxshared - dnl - dnl Doing so you would try to build your library in shared mode against a static - dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) ! - dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES - dnl (where we know what 'auto' should be expanded to). - dnl - dnl If you try to build something in ANSI mode against a UNICODE build - dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets, - dnl then at best you'll get ton of linking errors ! - dnl ************************ - - ifelse(index([$1], [wxshared]), [-1],, - [ - WX_ARG_WITH_YESNOAUTO( - [wxshared], [WX_SHARED], - [Force building against a shared build of wxWidgets, even if --disable-shared is given], - [auto], [], [1]) - ]) - - dnl Just like for SHARED and WX_SHARED it may happen that some adventurous - dnl peoples will want to mix a wxWidgets release build with a debug build of - dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables. - ifelse(index([$1], [wxdebug]), [-1],, - [ - WX_ARG_WITH_YESNOAUTO( - [wxdebug], [WX_DEBUG], - [Force building against a debug build of wxWidgets, even if --disable-debug is given], - [auto], [], [1]) - ]) - - dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option - dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values - ifelse(index([$1], [wxversion]), [-1],, - [ - AC_ARG_WITH([wxversion], - AC_HELP_STRING([--with-wxversion], - [Build against a specific version of wxWidgets (default is auto)]), - [], [withval="auto"]) - - dnl Show a message to the user about this option - AC_MSG_CHECKING([for the --with-wxversion option]) - if test "$withval" = "auto" ; then - AC_MSG_RESULT([will be automatically detected]) - WX_RELEASE="auto" - else - - wx_requested_major_version=`echo $withval | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'` - wx_requested_minor_version=`echo $withval | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'` - - dnl both vars above must be exactly 1 digit - if test "${#wx_requested_major_version}" != "1" -o \ - "${#wx_requested_minor_version}" != "1" ; then - AC_MSG_ERROR([ - Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0) - ]) - fi - - WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version" - AC_MSG_RESULT([$WX_RELEASE]) - fi - ]) - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG" - echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE" - echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED" - echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT" - echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE" - fi - ]) - - -dnl --------------------------------------------------------------------------- -dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS -dnl -dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values -dnl which are different from "auto". -dnl Thus this macro needs to be called only once all options have been set. -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS], - [ - if test "$WX_SHARED" = "1" ; then - WXCONFIG_FLAGS="--static=no " - elif test "$WX_SHARED" = "0" ; then - WXCONFIG_FLAGS="--static=yes " - fi - - if test "$WX_DEBUG" = "1" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes " - elif test "$WX_DEBUG" = "0" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no " - fi - - dnl The user should have set WX_UNICODE=UNICODE - if test "$WX_UNICODE" = "1" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes " - elif test "$WX_UNICODE" = "0" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no " - fi - - if test "$TOOLKIT" != "auto" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT " - fi - - if test "$WX_RELEASE" != "auto" ; then - WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE " - fi - - dnl strip out the last space of the string - WXCONFIG_FLAGS=${WXCONFIG_FLAGS% } - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS" - fi - ]) - - -dnl --------------------------------------------------------------------------- -dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG] -dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets -dnl additional CPP flags and put the result of the search in WX_$RESULTVAR -dnl also adding the "yes" or "no" message result to MSG. -dnl --------------------------------------------------------------------------- -AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR], - [ - if test "$$1" = "auto" ; then - - dnl The user does not have particular preferences for this option; - dnl so we will detect the wxWidgets relative build setting and use it - AC_MSG_CHECKING([$3]) - - dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2 - dnl string or to 0 otherwise. - dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it - dnl doesn't work; we use 'expr STRING : REGEXP' instead - WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*") - - if test "$WX_$1" != "0"; then - WX_$1=1 - AC_MSG_RESULT([yes]) - ifelse([$4], , :, [$4]) - else - WX_$1=0 - AC_MSG_RESULT([no]) - ifelse([$5], , :, [$5]) - fi - else - - dnl Use the setting given by the user - WX_$1=$$1 - fi - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_DETECT_STANDARD_OPTION_VALUES -dnl -dnl Detects the values of the following variables: -dnl 1) WX_RELEASE -dnl 2) WX_UNICODE -dnl 3) WX_DEBUG -dnl 4) WX_SHARED (and also WX_STATIC) -dnl 5) WX_PORT -dnl from the previously selected wxWidgets build; this macro in fact must be -dnl called *after* calling the WX_CONFIG_CHECK macro. -dnl -dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set -dnl by WX_CONFIG_CHECK macro -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES], - [ - dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits, - dnl while WX_RELEASE only the major.minor ones. - WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR" - if test $WX_RELEASE -lt 26 ; then - - AC_MSG_ERROR([ - Cannot detect the wxWidgets configuration for the selected wxWidgets build - since its version is $WX_VERSION < 2.6.0; please install a newer - version of wxWidgets. - ]) - fi - - dnl The wx-config we are using understands the "--selected_config" - dnl option which returns an easy-parseable string ! - WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config) - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] Using wx-config --selected-config" - echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG" - fi - - - dnl we could test directly for WX_SHARED with a line like: - dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared], - dnl [if wxWidgets was built in SHARED mode]) - dnl but wx-config --selected-config DOES NOT outputs the 'shared' - dnl word when wx was built in shared mode; it rather outputs the - dnl 'static' word when built in static mode. - if test $WX_SHARED = "1"; then - STATIC=0 - elif test $WX_SHARED = "0"; then - STATIC=1 - elif test $WX_SHARED = "auto"; then - STATIC="auto" - fi - - dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables - _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode], - [if wxWidgets was built with UNICODE enabled]) - _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug], - [if wxWidgets was built in DEBUG mode]) - _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static], - [if wxWidgets was built in STATIC mode]) - - dnl init WX_SHARED from WX_STATIC - if test "$WX_STATIC" != "0"; then - WX_SHARED=0 - else - WX_SHARED=1 - fi - - AC_SUBST(WX_UNICODE) - AC_SUBST(WX_DEBUG) - AC_SUBST(WX_SHARED) - - dnl detect the WX_PORT to use - if test "$TOOLKIT" = "auto" ; then - - dnl The user does not have particular preferences for this option; - dnl so we will detect the wxWidgets relative build setting and use it - AC_MSG_CHECKING([which wxWidgets toolkit was selected]) - - WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*") - WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*") - WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*") - WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*") - WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*") - WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*") - WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*") - WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*") - - WX_PORT="unknown" - if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi - if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi - if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi - if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi - if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi - if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi - if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi - if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi - - dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac - dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above) - WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*") - if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi - - dnl check at least one of the WX_*PORT has been set ! - - if test "$WX_PORT" = "unknown" ; then - AC_MSG_ERROR([ - Cannot detect the currently installed wxWidgets port ! - Please check your 'wx-config --cxxflags'... - ]) - fi - - AC_MSG_RESULT([$WX_PORT]) - else - - dnl Use the setting given by the user - if test -z "$TOOLKIT" ; then - WX_PORT=$TOOLKIT - else - dnl try with PORT - WX_PORT=$PORT - fi - fi - - AC_SUBST(WX_PORT) - - if test "$WX_DEBUG_CONFIGURE" = "1"; then - echo "[[dbg]] Values of all WX_* options after final detection:" - echo "[[dbg]] WX_DEBUG: $WX_DEBUG" - echo "[[dbg]] WX_UNICODE: $WX_UNICODE" - echo "[[dbg]] WX_SHARED: $WX_SHARED" - echo "[[dbg]] WX_RELEASE: $WX_RELEASE" - echo "[[dbg]] WX_PORT: $WX_PORT" - fi - - dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when - dnl the user gives the options: - dnl ./configure --enable-shared --without-wxshared - dnl or just do - dnl ./configure --enable-shared - dnl but there is only a static build of wxWidgets available. - if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then - AC_MSG_ERROR([ - Cannot build shared library against a static build of wxWidgets ! - This error happens because the wxWidgets build which was selected - has been detected as static while you asked to build $PACKAGE_NAME - as shared library and this is not possible. - Use the '--disable-shared' option to build $PACKAGE_NAME - as static library or '--with-wxshared' to use wxWidgets as shared library. - ]) - fi - - dnl now we can finally update the DEBUG,UNICODE,SHARED options - dnl to their final values if they were set to 'auto' - if test "$DEBUG" = "auto"; then - DEBUG=$WX_DEBUG - fi - if test "$UNICODE" = "auto"; then - UNICODE=$WX_UNICODE - fi - if test "$SHARED" = "auto"; then - SHARED=$WX_SHARED - fi - if test "$TOOLKIT" = "auto"; then - TOOLKIT=$WX_PORT - fi - - dnl in case the user needs a BUILD=debug/release var... - if test "$DEBUG" = "1"; then - BUILD="debug" - elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then - BUILD="release" - fi - - dnl respect the DEBUG variable adding the optimize/debug flags - dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we - dnl don't need to set them, too - if test "$DEBUG" = "1"; then - CXXFLAGS="$CXXFLAGS -g -O0" - CFLAGS="$CFLAGS -g -O0" - else - CXXFLAGS="$CXXFLAGS -O2" - CFLAGS="$CFLAGS -O2" - fi - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for], -dnl [what to print when var is 1], -dnl [what to print when var is 0]) -dnl -dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0. -dnl This macro mainly exists just to make configure.ac scripts more readable. -dnl -dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments -dnl if you want that m4 avoid to throw away the spaces prefixed to the -dnl argument value. -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_BOOLOPT_SUMMARY], - [ - if test "x$$1" = "x1" ; then - echo $2 - elif test "x$$1" = "x0" ; then - echo $3 - else - echo "$1 is $$1" - fi - ]) - -dnl --------------------------------------------------------------------------- -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG -dnl -dnl Shows a summary message to the user about the WX_* variable contents. -dnl This macro is used typically at the end of the configure script. -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG], - [ - echo - echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION" - echo " has the following settings:" - WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"]) - WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) - WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"]) - echo " - VERSION: $WX_VERSION" - echo " - PORT: $WX_PORT" - ]) - - -dnl --------------------------------------------------------------------------- -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END -dnl -dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info -dnl about the configuration of the package which used the wxpresets. -dnl -dnl Typical usage: -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN -dnl echo " - Package setting 1: $SETTING1" -dnl echo " - Package setting 2: $SETTING1" -dnl ... -dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END -dnl -dnl --------------------------------------------------------------------------- -AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN], - [ - echo - echo " ----------------------------------------------------------------" - echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed." - echo " Summary of main configuration settings for $PACKAGE_NAME:" - WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"]) - WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) - WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"]) - ]) - -AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END], - [ - WX_STANDARD_OPTIONS_SUMMARY_MSG - echo - echo " Now, just run make." - echo " ----------------------------------------------------------------" - echo - ]) - - -dnl --------------------------------------------------------------------------- -dnl Deprecated macro wrappers -dnl --------------------------------------------------------------------------- - -AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS]) -AC_DEFUN([AM_PATH_WXCONFIG], [ - WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5]) -]) -AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])]) diff --git a/contrib/assdraw/osx-bundle.sh b/contrib/assdraw/osx-bundle.sh deleted file mode 100755 index 0c0570a45..000000000 --- a/contrib/assdraw/osx-bundle.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -set -e - -BUNDLE_ROOT="$(dirname $0)/Assdraw.app/" -SRC_DIR="$(dirname $0)" - -if test -d "${BUNDLE_ROOT}"; then - rm -rf "${BUNDLE_ROOT}" -fi - -mkdir -p "${BUNDLE_ROOT}/Contents/MacOS" - -cp "${SRC_DIR}/src/assdraw" "${BUNDLE_ROOT}/Contents/MacOS/assdraw" - -python ../../aegisub/tools/osx-fix-libs.py "${BUNDLE_ROOT}/Contents/MacOS/assdraw" - -cat << 'EOF' > "${BUNDLE_ROOT}/Info.plist" - - - - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleDevelopmentRegion - English - CFBundleExecutable - assdraw - CFBundleIdentifier - com.aegisub.assdraw - CFBundleName - ASSDraw3 - CFBundleDisplayName - ASSDraw3 - CFBundlePackageType - APPL - LSHasLocalizedDisplayName - - - -EOF diff --git a/contrib/assdraw/src/ASSDraw3.dev b/contrib/assdraw/src/ASSDraw3.dev deleted file mode 100644 index 5afb0aa92..000000000 --- a/contrib/assdraw/src/ASSDraw3.dev +++ /dev/null @@ -1,323 +0,0 @@ -[Project] -FileName=ASSDraw3.dev -Name=ASSDraw -UnitCount=26 -Type=0 -Ver=3 -IsCpp=1 -Folders=AGG -CommandLine= -CompilerSettings=0000000001001000000100 -PchHead=-1 -PchSource=-1 -ProfilesCount=1 -ProfileIndex=0 - -[Unit1] -FileName=assdraw.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=3 -Minor=0 -Release=0 -Build=0 -LanguageID=1033 -CharsetID=1252 -CompanyName=ai-chan -FileVersion=3.0.0.0 -FileDescription=A tool for designing shapes to be used in ASS subtitle -InternalName=ASSDraw3 -LegalCopyright= -LegalTrademarks= -OriginalFilename=ASSDraw3.exe -ProductName=ASSDraw -ProductVersion=3 -AutoIncBuildNrOnRebuild=0 -AutoIncBuildNrOnCompile=0 -UnitCount=20 - -[Unit3] -FileName=cmd.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=engine.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=assdraw.rc -CompileCpp=1 -Folder=Resources -Compile=1 -Link=0 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=engine.cpp -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= -CompileCpp=1 - -[Unit9] -FileName=include_once.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=assdraw.hpp -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= -CompileCpp=1 - -[Unit2] -FileName=cmd.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Profile1] -ProfileName=Default Profile -Type=0 -ObjFiles= -Includes=E:\DEV;E:\DEV\agg-2.5\include;E:\DEV\wxTreeMultiCtrl\include -Libs=E:\DEV\agg-2.5;E:\DEV\wxTreeMultiCtrl -PrivateResource=E:\DEV\_projects\ASSDraw 3\Default Profile\ASSDraw_private.rc -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler=-D__WXMSW__ -DNO_GCC_PRAGMA -fno-rtti -fno-exceptions_@@_ -Wno-deprecated_@@_ -Linker=-lwxmsw28_propgrid_@@_-mwindows_@@_-lwxmsw28_@@_-lwxmsw28_gl_@@_-lwxtiff_@@_-lwxjpeg_@@_-lwxpng_@@_-lwxzlib_@@_-lwxregex_@@_-lwxexpat_@@_-lkernel32_@@_-luser32_@@_-lgdi32_@@_-lcomdlg32_@@_-lwinspool_@@_-lwinmm_@@_-lshell32_@@_-lcomctl32_@@_-lole32_@@_-loleaut32_@@_-luuid_@@_-lrpcrt4_@@_-ladvapi32_@@_-lwsock32_@@_-lodbc32_@@_-lopengl32_@@_-lagg_@@_ -PreprocDefines= -CompilerSettings=0000000001001000000100 -Icon= -ExeOutput=E:\DEV\_projects\ASSDraw 3\Default Profile\ -ObjectOutput=E:\DEV\_projects\ASSDraw 3\Default Profile\ -OverrideOutput=1 -OverrideOutputName=ASSDraw3.exe -HostApplication= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=1 -SupportXPThemes=1 -CompilerSet=0 -compilerType=0 - -[Unit8] -FileName=dlgctrl.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=resource.h -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=agg_bcspline.cpp -CompileCpp=1 -Folder=AGG -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=enums.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=library.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=library.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=wxAGG\AGGWindow.cpp -CompileCpp=1 -Folder=AGG -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=agg_vcgen_bcspline.cpp -CompileCpp=1 -Folder=AGG -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=canvas.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=canvas.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=dlgctrl.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=_common.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=settings.cpp -CompileCpp=1 -Folder=ASSDraw -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=settings.hpp -CompileCpp=1 -Folder=ASSDraw -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=assdraw_settings.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=agghelper.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=canvas_mouse.hpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=canvas_mouse.cpp -CompileCpp=1 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/contrib/assdraw/src/ASSDraw3.layout b/contrib/assdraw/src/ASSDraw3.layout deleted file mode 100644 index 8ed9b9f28..000000000 --- a/contrib/assdraw/src/ASSDraw3.layout +++ /dev/null @@ -1,185 +0,0 @@ -[Editor_10] -CursorCol=32 -CursorRow=553 -TopLine=535 -LeftChar=1 -Open=1 -Top=0 -[Editor_7] -CursorCol=6 -CursorRow=227 -TopLine=197 -LeftChar=1 -Open=1 -Top=1 -[Editor_5] -CursorCol=11 -CursorRow=19 -TopLine=1 -LeftChar=1 -Open=1 -Top=0 -[Editor_18] -CursorCol=11 -CursorRow=14 -TopLine=1 -LeftChar=1 -Open=0 -Top=0 -[Editor_19] -CursorCol=12 -CursorRow=3 -TopLine=3 -LeftChar=1 -Open=0 -Top=0 -[Editor_11] -CursorCol=8 -CursorRow=44 -TopLine=31 -LeftChar=1 -Open=0 -Top=0 -[Editor_3] -CursorCol=1 -CursorRow=268 -TopLine=243 -LeftChar=1 -Open=1 -Top=0 -[Editor_15] -CursorCol=15 -CursorRow=7 -TopLine=1 -LeftChar=1 -Open=1 -Top=0 -[Editor_8] -CursorCol=1 -CursorRow=69 -TopLine=33 -LeftChar=1 -Open=0 -Top=0 -[Editor_16] -CursorCol=2 -CursorRow=25 -TopLine=1 -LeftChar=1 -Open=0 -Top=0 -[Editor_0] -CursorCol=39 -CursorRow=212 -TopLine=184 -LeftChar=1 -Open=1 -Top=0 -[Editors] -Focused=7 -Order=5,0,10,17,3,6,7,22,21,20,15 -[Editor_1] -Open=0 -Top=0 -CursorCol=21 -CursorRow=63 -TopLine=30 -LeftChar=1 -[Editor_2] -Open=0 -Top=0 -CursorCol=7 -CursorRow=83 -TopLine=50 -LeftChar=1 -[Editor_4] -Open=0 -Top=0 -CursorCol=19 -CursorRow=21 -TopLine=21 -LeftChar=1 -[Editor_6] -Open=1 -Top=0 -CursorCol=1 -CursorRow=577 -TopLine=556 -LeftChar=1 -[Editor_9] -Open=0 -Top=0 -CursorCol=1 -CursorRow=1 -TopLine=1 -LeftChar=1 -[Editor_12] -Open=0 -Top=0 -CursorCol=6 -CursorRow=99 -TopLine=91 -LeftChar=1 -[Editor_13] -Open=0 -Top=0 -CursorCol=1 -CursorRow=204 -TopLine=170 -LeftChar=1 -[Editor_14] -Open=0 -Top=0 -CursorCol=1 -CursorRow=290 -TopLine=256 -LeftChar=1 -[Editor_17] -Open=1 -Top=0 -CursorCol=68 -CursorRow=133 -TopLine=112 -LeftChar=1 -[Editor_20] -Open=1 -Top=0 -CursorCol=46 -CursorRow=195 -TopLine=163 -LeftChar=1 -[Editor_21] -Open=1 -Top=0 -CursorCol=2 -CursorRow=58 -TopLine=57 -LeftChar=1 -[Editor_22] -Open=1 -Top=0 -CursorCol=32 -CursorRow=160 -TopLine=129 -LeftChar=1 -[Editor_23] -Open=0 -Top=0 -CursorCol=2 -CursorRow=6 -TopLine=1 -LeftChar=1 -[Editor_24] -CursorCol=1 -CursorRow=56 -TopLine=25 -LeftChar=1 -Open=0 -Top=0 -[Editor_25] -Open=0 -Top=0 -CursorCol=18 -CursorRow=8 -TopLine=1 -LeftChar=1 diff --git a/contrib/assdraw/src/Makefile.am b/contrib/assdraw/src/Makefile.am deleted file mode 100644 index 71667b1b9..000000000 --- a/contrib/assdraw/src/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -SUFFIXES = .cpp - -SUBDIRS = wxAGG xpm - -AM_CXXFLAGS = @WX_CPPFLAGS@ @LIBAGG_CFLAGS@ - -bin_PROGRAMS = assdraw -#assdraw_CPPFLAGS = -assdraw_LDFLAGS = @WX_LIBS@ @LIBAGG_LIBS@ -assdraw_LDADD = wxAGG/libaggwindow.a xpm/libres.a - -assdraw_SOURCES = \ - agg_bcspline.cpp \ - agg_vcgen_bcspline.cpp \ - assdraw.cpp \ - assdraw_settings.cpp \ - canvas.cpp \ - canvas_mouse.cpp \ - cmd.cpp \ - dlgctrl.cpp \ - engine.cpp \ - library.cpp \ - settings.cpp - -assdraw_SOURCES += \ - agg_bcspline.h \ - agg_conv_bcspline.h \ - agg_vcgen_bcspline.h \ - resource.h - -EXTRA_DIST = \ - _common.hpp \ - agghelper.hpp - assdraw.hpp \ - canvas.hpp \ - canvas_mouse.hpp \ - cmd.hpp \ - dlgctrl.hpp \ - engine.hpp \ - enums.hpp \ - include_once.hpp \ - library.hpp \ - settings.hpp diff --git a/contrib/assdraw/src/Makefile.win b/contrib/assdraw/src/Makefile.win deleted file mode 100644 index aa45a440e..000000000 --- a/contrib/assdraw/src/Makefile.win +++ /dev/null @@ -1,69 +0,0 @@ -# Project: ASSDraw -# Compiler: Default GCC compiler -# Compiler Type: MingW 3 -# Makefile created by wxDev-C++ 6.10.2 on 20/01/08 23:46 - -CPP = g++.exe -CC = gcc.exe -WINDRES = windres.exe -OBJ = ../Default\ Profile/assdraw.o ../Default\ Profile/cmd.o ../Default\ Profile/engine.o ../Default\ Profile/dlgctrl.o ../Default\ Profile/canvas.o ../Default\ Profile/AGGWindow.o ../Default\ Profile/agg_vcgen_bcspline.o ../Default\ Profile/agg_bcspline.o ../Default\ Profile/library.o ../Default\ Profile/settings.o ../Default\ Profile/assdraw_settings.o ../Default\ Profile/canvas_mouse.o ../Default\ Profile/ASSDraw3_private.res -LINKOBJ = "../Default Profile/assdraw.o" "../Default Profile/cmd.o" "../Default Profile/engine.o" "../Default Profile/dlgctrl.o" "../Default Profile/canvas.o" "../Default Profile/AGGWindow.o" "../Default Profile/agg_vcgen_bcspline.o" "../Default Profile/agg_bcspline.o" "../Default Profile/library.o" "../Default Profile/settings.o" "../Default Profile/assdraw_settings.o" "../Default Profile/canvas_mouse.o" "../Default Profile/ASSDraw3_private.res" -LIBS = -L"D:/Program Files/Dev-Cpp/Lib" -L"E:/DEV/agg-2.5" -L"E:/DEV/wxTreeMultiCtrl" -lwxmsw28_propgrid -mwindows -lwxmsw28 -lwxmsw28_gl -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -lopengl32 -lagg -s -INCS = -I"include" -I"E:/DEV" -I"E:/DEV/agg-2.5/include" -I"E:/DEV/wxTreeMultiCtrl/include" -CXXINCS = -I"D:/Program Files/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"D:/Program Files/Dev-Cpp/include/c++/3.4.2/backward" -I"D:/Program Files/Dev-Cpp/include/c++/3.4.2/mingw32" -I"D:/Program Files/Dev-Cpp/include/c++/3.4.2" -I"D:/Program Files/Dev-Cpp/include" -I"D:/Program Files/Dev-Cpp/" -I"D:/Program Files/Dev-Cpp/include/common/wx/msw" -I"D:/Program Files/Dev-Cpp/include/common/wx/generic" -I"D:/Program Files/Dev-Cpp/include/common/wx/fl" -I"D:/Program Files/Dev-Cpp/include/common/wx/gizmos" -I"D:/Program Files/Dev-Cpp/include/common/wx/html" -I"D:/Program Files/Dev-Cpp/include/common/wx/mmedia" -I"D:/Program Files/Dev-Cpp/include/common/wx/net" -I"D:/Program Files/Dev-Cpp/include/common/wx/ogl" -I"D:/Program Files/Dev-Cpp/include/common/wx/plot" -I"D:/Program Files/Dev-Cpp/include/common/wx/protocol" -I"D:/Program Files/Dev-Cpp/include/common/wx/stc" -I"D:/Program Files/Dev-Cpp/include/common/wx/svg" -I"D:/Program Files/Dev-Cpp/include/common/wx/xml" -I"D:/Program Files/Dev-Cpp/include/common/wx/xrc" -I"D:/Program Files/Dev-Cpp/include/common/wx" -I"D:/Program Files/Dev-Cpp/include/common" -I"E:/dev/ACE-5.5" -I"E:/DEV" -I"E:/DEV/agg-2.5/include" -I"E:/DEV/wxTreeMultiCtrl/include" -RCINCS = --include-dir "D:/PROGRA~1/Dev-Cpp/include/common" -BIN = ../Default\ Profile/ASSDraw3.exe -DEFINES = -CXXFLAGS = $(CXXINCS) $(DEFINES) -D__WXMSW__ -DNO_GCC_PRAGMA -fno-rtti -fno-exceptions -Wno-deprecated -fexpensive-optimizations -O3 -CFLAGS = $(INCS) $(DEFINES) -fexpensive-optimizations -O3 -GPROF = gprof.exe -RM = rm -f -LINK = g++.exe - -.PHONY: all all-before all-after clean clean-custom -all: all-before $(BIN) all-after - -clean: clean-custom - $(RM) $(OBJ) $(BIN) - -$(BIN): $(OBJ) - $(LINK) $(LINKOBJ) -o "..\Default Profile\ASSDraw3.exe" $(LIBS) - -../Default\ Profile/assdraw.o: $(GLOBALDEPS) assdraw.cpp assdraw.hpp _common.hpp enums.hpp include_once.hpp - $(CPP) -c assdraw.cpp -o "../Default Profile/assdraw.o" $(CXXFLAGS) - -../Default\ Profile/cmd.o: $(GLOBALDEPS) cmd.cpp - $(CPP) -c cmd.cpp -o "../Default Profile/cmd.o" $(CXXFLAGS) - -../Default\ Profile/engine.o: $(GLOBALDEPS) engine.cpp - $(CPP) -c engine.cpp -o "../Default Profile/engine.o" $(CXXFLAGS) - -../Default\ Profile/dlgctrl.o: $(GLOBALDEPS) dlgctrl.cpp assdraw.hpp _common.hpp - $(CPP) -c dlgctrl.cpp -o "../Default Profile/dlgctrl.o" $(CXXFLAGS) - -../Default\ Profile/canvas.o: $(GLOBALDEPS) canvas.cpp assdraw.hpp _common.hpp cmd.hpp agghelper.hpp - $(CPP) -c canvas.cpp -o "../Default Profile/canvas.o" $(CXXFLAGS) - -../Default\ Profile/AGGWindow.o: $(GLOBALDEPS) wxAGG/AGGWindow.cpp wxAGG/AGGWindow.h wxAGG/PixelFormatConvertor.h - $(CPP) -c wxAGG/AGGWindow.cpp -o "../Default Profile/AGGWindow.o" $(CXXFLAGS) - -../Default\ Profile/agg_vcgen_bcspline.o: $(GLOBALDEPS) agg_vcgen_bcspline.cpp agg_vcgen_bcspline.h agg_bcspline.h - $(CPP) -c agg_vcgen_bcspline.cpp -o "../Default Profile/agg_vcgen_bcspline.o" $(CXXFLAGS) - -../Default\ Profile/agg_bcspline.o: $(GLOBALDEPS) agg_bcspline.cpp agg_bcspline.h - $(CPP) -c agg_bcspline.cpp -o "../Default Profile/agg_bcspline.o" $(CXXFLAGS) - -../Default\ Profile/library.o: $(GLOBALDEPS) library.cpp assdraw.hpp _common.hpp library.hpp engine.hpp _common.hpp wxAGG/AGGWindow.h wxAGG/PixelFormatConvertor.h agg_conv_bcspline.h agg_vcgen_bcspline.h agg_bcspline.h - $(CPP) -c library.cpp -o "../Default Profile/library.o" $(CXXFLAGS) - -../Default\ Profile/settings.o: $(GLOBALDEPS) settings.cpp assdraw.hpp _common.hpp settings.hpp _common.hpp - $(CPP) -c settings.cpp -o "../Default Profile/settings.o" $(CXXFLAGS) - -../Default\ Profile/assdraw_settings.o: $(GLOBALDEPS) assdraw_settings.cpp assdraw.hpp _common.hpp - $(CPP) -c assdraw_settings.cpp -o "../Default Profile/assdraw_settings.o" $(CXXFLAGS) - -../Default\ Profile/canvas_mouse.o: $(GLOBALDEPS) canvas_mouse.cpp canvas_mouse.hpp _common.hpp enums.hpp engine.hpp _common.hpp wxAGG/AGGWindow.h wxAGG/PixelFormatConvertor.h agg_conv_bcspline.h agg_vcgen_bcspline.h agg_bcspline.h canvas.hpp engine.hpp enums.hpp - $(CPP) -c canvas_mouse.cpp -o "../Default Profile/canvas_mouse.o" $(CXXFLAGS) - -../Default\ Profile/ASSDraw3_private.res: ../Default\ Profile/ASSDraw3_private.rc assdraw.rc - $(WINDRES) --input-format=rc -o "../Default Profile/ASSDraw3_private.res" $(RCINCS) ../DEFAUL~1/ASSDRA~1.RC -O coff diff --git a/contrib/assdraw/src/_common.hpp b/contrib/assdraw/src/_common.hpp deleted file mode 100644 index 93c17f235..000000000 --- a/contrib/assdraw/src/_common.hpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#define TITLE wxT("ASSDraw3") - -#define __DPDS__ wxDefaultPosition, wxDefaultSize diff --git a/contrib/assdraw/src/agg_bcspline.cpp b/contrib/assdraw/src/agg_bcspline.cpp deleted file mode 100644 index d6973c04a..000000000 --- a/contrib/assdraw/src/agg_bcspline.cpp +++ /dev/null @@ -1,289 +0,0 @@ -//---------------------------------------------------------------------------- -// Anti-Grain Geometry (AGG) - Version 2.5 -// A high quality rendering engine for C++ -// Copyright (C) 2002-2006 Maxim Shemanarev -// Contact: mcseem@antigrain.com -// mcseemagg@yahoo.com -// http://antigrain.com -// -// AGG is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// AGG 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 AGG; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. -//---------------------------------------------------------------------------- - -#include "agg_bcspline.h" - -namespace agg -{ - //------------------------------------------------------------------------ - bcspline::bcspline() : - m_max(0), - m_num(0), - m_x(0), - m_y(0), - m_last_idx(-1) - { - } - - //------------------------------------------------------------------------ - bcspline::bcspline(int num) : - m_max(0), - m_num(0), - m_x(0), - m_y(0), - m_last_idx(-1) - { - init(num); - } - - //------------------------------------------------------------------------ - bcspline::bcspline(int num, const double* x, const double* y) : - m_max(0), - m_num(0), - m_x(0), - m_y(0), - m_last_idx(-1) - { - init(num, x, y); - } - - - //------------------------------------------------------------------------ - void bcspline::init(int max) - { - if(max > 2 && max > m_max) - { - m_am.resize(max * 3); - m_max = max; - m_x = &m_am[m_max]; - m_y = &m_am[m_max * 2]; - } - m_num = 0; - m_last_idx = -1; - } - - - //------------------------------------------------------------------------ - void bcspline::add_point(double x, double y) - { - if(m_num < m_max) - { - m_x[m_num] = x; - m_y[m_num] = y; - ++m_num; - } - } - - - //------------------------------------------------------------------------ - void bcspline::prepare() - { - if(m_num > 2) - { - int i, k, n1; - double* temp; - double* r; - double* s; - double h, p, d, f, e; - - for(k = 0; k < m_num; k++) - { - m_am[k] = 0.0; - } - - n1 = 3 * m_num; - - pod_array al(n1); - temp = &al[0]; - - for(k = 0; k < n1; k++) - { - temp[k] = 0.0; - } - - r = temp + m_num; - s = temp + m_num * 2; - - n1 = m_num - 1; - d = m_x[1] - m_x[0]; - e = (m_y[1] - m_y[0]) / d; - - for(k = 1; k < n1; k++) - { - h = d; - d = m_x[k + 1] - m_x[k]; - f = e; - e = (m_y[k + 1] - m_y[k]) / d; - al[k] = d / (d + h); - r[k] = 1.0 - al[k]; - s[k] = 6.0 * (e - f) / (h + d); - } - - for(k = 1; k < n1; k++) - { - p = 1.0 / (r[k] * al[k - 1] + 2.0); - al[k] *= -p; - s[k] = (s[k] - r[k] * s[k - 1]) * p; - } - - m_am[n1] = 0.0; - al[n1 - 1] = s[n1 - 1]; - m_am[n1 - 1] = al[n1 - 1]; - - for(k = n1 - 2, i = 0; i < m_num - 2; i++, k--) - { - al[k] = al[k] * al[k + 1] + s[k]; - m_am[k] = al[k]; - } - } - m_last_idx = -1; - } - - - - //------------------------------------------------------------------------ - void bcspline::init(int num, const double* x, const double* y) - { - if(num > 2) - { - init(num); - int i; - for(i = 0; i < num; i++) - { - add_point(*x++, *y++); - } - prepare(); - } - m_last_idx = -1; - } - - - //------------------------------------------------------------------------ - void bcspline::bsearch(int n, const double *x, double x0, int *i) - { - int j = n - 1; - int k; - - for(*i = 0; (j - *i) > 1; ) - { - if(x0 < x[k = (*i + j) >> 1]) j = k; - else *i = k; - } - } - - - - //------------------------------------------------------------------------ - double bcspline::interpolation(double x, int i) const - { - int j = i + 1; - double d = m_x[i] - m_x[j]; - double h = x - m_x[j]; - double r = m_x[i] - x; - double p = d * d / 6.0; - return (m_am[j] * r * r * r + m_am[i] * h * h * h) / 6.0 / d + - ((m_y[j] - m_am[j] * p) * r + (m_y[i] - m_am[i] * p) * h) / d; - } - - - //------------------------------------------------------------------------ - double bcspline::extrapolation_left(double x) const - { - double d = m_x[1] - m_x[0]; - return (-d * m_am[1] / 6 + (m_y[1] - m_y[0]) / d) * - (x - m_x[0]) + - m_y[0]; - } - - //------------------------------------------------------------------------ - double bcspline::extrapolation_right(double x) const - { - double d = m_x[m_num - 1] - m_x[m_num - 2]; - return (d * m_am[m_num - 2] / 6 + (m_y[m_num - 1] - m_y[m_num - 2]) / d) * - (x - m_x[m_num - 1]) + - m_y[m_num - 1]; - } - - //------------------------------------------------------------------------ - double bcspline::get(double x) const - { - if(m_num > 2) - { - int i; - - // Extrapolation on the left - if(x < m_x[0]) return extrapolation_left(x); - - // Extrapolation on the right - if(x >= m_x[m_num - 1]) return extrapolation_right(x); - - // Interpolation - bsearch(m_num, m_x, x, &i); - return interpolation(x, i); - } - return 0.0; - } - - - //------------------------------------------------------------------------ - double bcspline::get_stateful(double x) const - { - if(m_num > 2) - { - // Extrapolation on the left - if(x < m_x[0]) return extrapolation_left(x); - - // Extrapolation on the right - if(x >= m_x[m_num - 1]) return extrapolation_right(x); - - if(m_last_idx >= 0) - { - // Check if x is not in current range - if(x < m_x[m_last_idx] || x > m_x[m_last_idx + 1]) - { - // Check if x between next points (most probably) - if(m_last_idx < m_num - 2 && - x >= m_x[m_last_idx + 1] && - x <= m_x[m_last_idx + 2]) - { - ++m_last_idx; - } - else - if(m_last_idx > 0 && - x >= m_x[m_last_idx - 1] && - x <= m_x[m_last_idx]) - { - // x is between pevious points - --m_last_idx; - } - else - { - // Else perform full search - bsearch(m_num, m_x, x, &m_last_idx); - } - } - return interpolation(x, m_last_idx); - } - else - { - // Interpolation - bsearch(m_num, m_x, x, &m_last_idx); - return interpolation(x, m_last_idx); - } - } - return 0.0; - } - -} - diff --git a/contrib/assdraw/src/agg_bcspline.h b/contrib/assdraw/src/agg_bcspline.h deleted file mode 100644 index 05d236497..000000000 --- a/contrib/assdraw/src/agg_bcspline.h +++ /dev/null @@ -1,81 +0,0 @@ -//---------------------------------------------------------------------------- -// Anti-Grain Geometry (AGG) - Version 2.5 -// A high quality rendering engine for C++ -// Copyright (C) 2002-2006 Maxim Shemanarev -// Contact: mcseem@antigrain.com -// mcseemagg@yahoo.com -// http://antigrain.com -// -// AGG is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// AGG 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 AGG; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. -//---------------------------------------------------------------------------- - -#ifndef AGG_bcspline_INCLUDED -#define AGG_bcspline_INCLUDED - -#include "agg_array.h" - -namespace agg -{ - //----------------------------------------------------------------bcspline - // A very simple class of Bi-cubic Spline interpolation. - // First call init(num, x[], y[]) where num - number of source points, - // x, y - arrays of X and Y values respectively. Here Y must be a function - // of X. It means that all the X-coordinates must be arranged in the ascending - // order. - // Then call get(x) that calculates a value Y for the respective X. - // The class supports extrapolation, i.e. you can call get(x) where x is - // outside the given with init() X-range. Extrapolation is a simple linear - // function. - // - // See Implementation agg_bcspline.cpp - //------------------------------------------------------------------------ - class bcspline - { - public: - bcspline(); - bcspline(int num); - bcspline(int num, const double* x, const double* y); - - void init(int num); - void add_point(double x, double y); - void prepare(); - - void init(int num, const double* x, const double* y); - - double get(double x) const; - double get_stateful(double x) const; - - private: - bcspline(const bcspline&); - const bcspline& operator = (const bcspline&); - - static void bsearch(int n, const double *x, double x0, int *i); - double extrapolation_left(double x) const; - double extrapolation_right(double x) const; - double interpolation(double x, int i) const; - - int m_max; - int m_num; - double* m_x; - double* m_y; - pod_array m_am; - mutable int m_last_idx; - }; - - -} - -#endif diff --git a/contrib/assdraw/src/agg_conv_bcspline.h b/contrib/assdraw/src/agg_conv_bcspline.h deleted file mode 100644 index 3d40b9619..000000000 --- a/contrib/assdraw/src/agg_conv_bcspline.h +++ /dev/null @@ -1,58 +0,0 @@ -//---------------------------------------------------------------------------- -// Anti-Grain Geometry (AGG) - Version 2.5 -// A high quality rendering engine for C++ -// Copyright (C) 2002-2006 Maxim Shemanarev -// Contact: mcseem@antigrain.com -// mcseemagg@yahoo.com -// http://antigrain.com -// -// AGG is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// AGG 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 AGG; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. -//---------------------------------------------------------------------------- - -#ifndef AGG_conv_bcspline_INCLUDED -#define AGG_conv_bcspline_INCLUDED - -#include "agg_basics.h" -#include "agg_vcgen_bcspline.h" -#include "agg_conv_adaptor_vcgen.h" - - -namespace agg -{ - - //---------------------------------------------------------conv_bcspline - template - struct conv_bcspline : public conv_adaptor_vcgen - { - typedef conv_adaptor_vcgen base_type; - - conv_bcspline(VertexSource& vs) : - conv_adaptor_vcgen(vs) {} - - void interpolation_step(double v) { base_type::generator().interpolation_step(v); } - double interpolation_step() const { return base_type::generator().interpolation_step(); } - - private: - conv_bcspline(const conv_bcspline&); - const conv_bcspline& - operator = (const conv_bcspline&); - }; - -} - - -#endif - diff --git a/contrib/assdraw/src/agg_vcgen_bcspline.cpp b/contrib/assdraw/src/agg_vcgen_bcspline.cpp deleted file mode 100644 index 5796b1277..000000000 --- a/contrib/assdraw/src/agg_vcgen_bcspline.cpp +++ /dev/null @@ -1,203 +0,0 @@ -//---------------------------------------------------------------------------- -// Anti-Grain Geometry (AGG) - Version 2.5 -// A high quality rendering engine for C++ -// Copyright (C) 2002-2006 Maxim Shemanarev -// Contact: mcseem@antigrain.com -// mcseemagg@yahoo.com -// http://antigrain.com -// -// AGG is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// AGG 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 AGG; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. -//---------------------------------------------------------------------------- - -#include "agg_vcgen_bcspline.h" - -namespace agg -{ - - //------------------------------------------------------------------------ - vcgen_bcspline::vcgen_bcspline() : - m_src_vertices(), - m_spline_x(), - m_spline_y(), - m_interpolation_step(1.0/50.0), - m_closed(0), - m_status(initial), - m_src_vertex(0) - { - } - - - //------------------------------------------------------------------------ - void vcgen_bcspline::remove_all() - { - m_src_vertices.remove_all(); - m_closed = 0; - m_status = initial; - m_src_vertex = 0; - } - - - //------------------------------------------------------------------------ - void vcgen_bcspline::add_vertex(double x, double y, unsigned cmd) - { - m_status = initial; - if(is_move_to(cmd)) - { - m_src_vertices.modify_last(point_d(x, y)); - } - else - { - if(is_vertex(cmd)) - { - m_src_vertices.add(point_d(x, y)); - } - else - { - m_closed = get_close_flag(cmd); - } - } - } - - - //------------------------------------------------------------------------ - void vcgen_bcspline::rewind(unsigned) - { - m_cur_abscissa = 0.0; - m_max_abscissa = 0.0; - m_src_vertex = 0; - if(m_status == initial && m_src_vertices.size() > 2) - { - if(m_closed) - { - m_spline_x.init(m_src_vertices.size() + 8); - m_spline_y.init(m_src_vertices.size() + 8); - m_spline_x.add_point(0.0, m_src_vertices.prev(m_src_vertices.size() - 3).x); - m_spline_y.add_point(0.0, m_src_vertices.prev(m_src_vertices.size() - 3).y); - m_spline_x.add_point(1.0, m_src_vertices[m_src_vertices.size() - 3].x); - m_spline_y.add_point(1.0, m_src_vertices[m_src_vertices.size() - 3].y); - m_spline_x.add_point(2.0, m_src_vertices[m_src_vertices.size() - 2].x); - m_spline_y.add_point(2.0, m_src_vertices[m_src_vertices.size() - 2].y); - m_spline_x.add_point(3.0, m_src_vertices[m_src_vertices.size() - 1].x); - m_spline_y.add_point(3.0, m_src_vertices[m_src_vertices.size() - 1].y); - } - else - { - m_spline_x.init(m_src_vertices.size()); - m_spline_y.init(m_src_vertices.size()); - } - unsigned i; - for(i = 0; i < m_src_vertices.size(); i++) - { - double x = m_closed ? i + 4 : i; - m_spline_x.add_point(x, m_src_vertices[i].x); - m_spline_y.add_point(x, m_src_vertices[i].y); - } - m_cur_abscissa = 0.0; - m_max_abscissa = m_src_vertices.size() - 1; - if(m_closed) - { - m_cur_abscissa = 4.0; - m_max_abscissa += 5.0; - m_spline_x.add_point(m_src_vertices.size() + 4, m_src_vertices[0].x); - m_spline_y.add_point(m_src_vertices.size() + 4, m_src_vertices[0].y); - m_spline_x.add_point(m_src_vertices.size() + 5, m_src_vertices[1].x); - m_spline_y.add_point(m_src_vertices.size() + 5, m_src_vertices[1].y); - m_spline_x.add_point(m_src_vertices.size() + 6, m_src_vertices[2].x); - m_spline_y.add_point(m_src_vertices.size() + 6, m_src_vertices[2].y); - m_spline_x.add_point(m_src_vertices.size() + 7, m_src_vertices.next(2).x); - m_spline_y.add_point(m_src_vertices.size() + 7, m_src_vertices.next(2).y); - } - m_spline_x.prepare(); - m_spline_y.prepare(); - } - m_status = ready; - } - - - - - - - //------------------------------------------------------------------------ - unsigned vcgen_bcspline::vertex(double* x, double* y) - { - unsigned cmd = path_cmd_line_to; - while(!is_stop(cmd)) - { - switch(m_status) - { - case initial: - rewind(0); - - case ready: - if(m_src_vertices.size() < 2) - { - cmd = path_cmd_stop; - break; - } - - if(m_src_vertices.size() == 2) - { - *x = m_src_vertices[m_src_vertex].x; - *y = m_src_vertices[m_src_vertex].y; - m_src_vertex++; - if(m_src_vertex == 1) return path_cmd_move_to; - if(m_src_vertex == 2) return path_cmd_line_to; - cmd = path_cmd_stop; - break; - } - - cmd = path_cmd_move_to; - m_status = polygon; - m_src_vertex = 0; - - case polygon: - if(m_cur_abscissa >= m_max_abscissa) - { - if(m_closed) - { - m_status = end_poly; - break; - } - else - { - *x = m_src_vertices[m_src_vertices.size() - 1].x; - *y = m_src_vertices[m_src_vertices.size() - 1].y; - m_status = end_poly; - return path_cmd_line_to; - } - } - - *x = m_spline_x.get(m_cur_abscissa); - *y = m_spline_y.get(m_cur_abscissa); - m_src_vertex++; - m_cur_abscissa += m_interpolation_step; - return (m_src_vertex == 1) ? path_cmd_move_to : path_cmd_line_to; - - case end_poly: - m_status = stop; - return path_cmd_end_poly | m_closed; - - case stop: - return path_cmd_stop; - } - } - return cmd; - } - - -} - diff --git a/contrib/assdraw/src/agg_vcgen_bcspline.h b/contrib/assdraw/src/agg_vcgen_bcspline.h deleted file mode 100644 index 6f92d9942..000000000 --- a/contrib/assdraw/src/agg_vcgen_bcspline.h +++ /dev/null @@ -1,83 +0,0 @@ -//---------------------------------------------------------------------------- -// Anti-Grain Geometry (AGG) - Version 2.5 -// A high quality rendering engine for C++ -// Copyright (C) 2002-2006 Maxim Shemanarev -// Contact: mcseem@antigrain.com -// mcseemagg@yahoo.com -// http://antigrain.com -// -// AGG is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// AGG 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 AGG; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. -//---------------------------------------------------------------------------- - -#ifndef AGG_vcgen_bcspline_INCLUDED -#define AGG_vcgen_bcspline_INCLUDED - -#include "agg_basics.h" -#include "agg_array.h" -#include "agg_bcspline.h" - - -namespace agg -{ - - //==========================================================vcgen_bcspline - class vcgen_bcspline - { - enum status_e - { - initial, - ready, - polygon, - end_poly, - stop - }; - - public: - typedef pod_bvector vertex_storage; - - vcgen_bcspline(); - - void interpolation_step(double v) { m_interpolation_step = v; } - double interpolation_step() const { return m_interpolation_step; } - - // Vertex Generator Interface - void remove_all(); - void add_vertex(double x, double y, unsigned cmd); - - // Vertex Source Interface - void rewind(unsigned path_id); - unsigned vertex(double* x, double* y); - - private: - vcgen_bcspline(const vcgen_bcspline&); - const vcgen_bcspline& operator = (const vcgen_bcspline&); - - vertex_storage m_src_vertices; - bcspline m_spline_x; - bcspline m_spline_y; - double m_interpolation_step; - unsigned m_closed; - status_e m_status; - unsigned m_src_vertex; - double m_cur_abscissa; - double m_max_abscissa; - }; - -} - - -#endif - diff --git a/contrib/assdraw/src/agghelper.hpp b/contrib/assdraw/src/agghelper.hpp deleted file mode 100644 index de0ce66fc..000000000 --- a/contrib/assdraw/src/agghelper.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "agg_path_storage.h" - -class agghelper -{ -public: - - static agg::path_storage RectanglePath(double left, double right, double top, double bottom) - { - agg::path_storage path; - path.move_to(left,top); - path.line_to(right,top); - path.line_to(right,bottom); - path.line_to(left,bottom); - path.line_to(left,top); - return path; - } - -}; diff --git a/contrib/assdraw/src/assdraw.cpp b/contrib/assdraw/src/assdraw.cpp deleted file mode 100644 index 1c9696083..000000000 --- a/contrib/assdraw/src/assdraw.cpp +++ /dev/null @@ -1,741 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: assdraw.cpp -// Purpose: ASSDraw main source file -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - - -#include "assdraw.hpp" -#include "enums.hpp" -#include "include_once.hpp" -#include -#include -#include -#include -#include - -#if !defined(__WINDOWS__) -#include "xpm/res.h" -#endif - -///////////// -// Libraries -#ifdef __VISUALC__ -#pragma comment(lib, "Vfw32.lib") -#pragma comment(lib, "comctl32.lib") -#pragma comment(lib, "rpcrt4.lib") -#pragma comment(lib, "winmm.lib") -#pragma comment(lib, "advapi32.lib") -#pragma comment(lib, "wsock32.lib") -#ifdef __WXDEBUG__ -#pragma comment(lib, "wxmsw28ud_propgrid.lib") -#else -#pragma comment(lib, "wxmsw28u_propgrid.lib") -#endif -#endif - - -//DEFINE_EVENT_TYPE(wxEVT_SETTINGS_CHANGED) - -// initialize wxWidget to accept our App class -IMPLEMENT_APP(ASSDrawApp) - -BEGIN_EVENT_TABLE(ASSDrawFrame, wxFrame) - EVT_TOOL(TB_CLEAR, ASSDrawFrame::OnSelect_Clear) - EVT_TOOL(TB_PREVIEW, ASSDrawFrame::OnSelect_Preview) - EVT_TOOL(TB_TRANSFORM, ASSDrawFrame::OnSelect_Transform) - EVT_TOOL_RANGE(MODE_ARR, MODE_DEL, ASSDrawFrame::OnChoose_Mode) - EVT_TOOL_RCLICKED(wxID_ANY, ASSDrawFrame::OnToolRClick) - EVT_COMMAND(wxID_ANY, wxEVT_SETTINGS_CHANGED, ASSDrawFrame::OnSettingsChanged) - EVT_MENU_RANGE(MENU_TB_ALL, MENU_TB_BGIMG, ASSDrawFrame::OnChoose_TBarRClickMenu) - EVT_MENU(MENU_CLEAR, ASSDrawFrame::OnSelect_Clear) - EVT_MENU(MENU_PREVIEW, ASSDrawFrame::OnSelect_Preview) - EVT_MENU(MENU_TRANSFORM, ASSDrawFrame::OnSelect_Transform) - EVT_MENU(MENU_LIBRARY, ASSDrawFrame::OnSelect_Library) - EVT_MENU(MENU_SETTINGS, ASSDrawFrame::OnSelect_Settings) - EVT_MENU(MENU_RESETPERSPECTIVE, ASSDrawFrame::OnSelect_ResetPerspective) - EVT_MENU(MENU_HELP, ASSDrawFrame::OnSelect_Help) - EVT_MENU(wxID_ABOUT, ASSDrawFrame::OnSelect_About) - EVT_MENU(MENU_UNDO, ASSDrawFrame::OnSelect_Undo) - EVT_MENU(MENU_REDO, ASSDrawFrame::OnSelect_Redo) - EVT_MENU(MENU_PASTE, ASSDrawFrame::OnSelect_Paste) - EVT_MENU(MENU_BGIMG_REMOVE, ASSDrawFrame::OnSelect_RemoveBG) - EVT_MENU(MENU_BGIMG_ALPHA, ASSDrawFrame::OnSelect_AlphaBG) - EVT_MENU_RANGE(MODE_ARR, MODE_NUT_BILINEAR, ASSDrawFrame::OnChoose_Mode) - EVT_MENU_RANGE(MENU_REPOS_TOPLEFT, MENU_REPOS_BOTRIGHT, ASSDrawFrame::OnChoose_Recenter) - EVT_MENU_RANGE(MENU_REPOS_BGTOPLEFT, MENU_REPOS_BGBOTRIGHT, ASSDrawFrame::OnChoose_RecenterToBG) - EVT_CLOSE(ASSDrawFrame::OnClose) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// the application class: ASSDrawApp -// ---------------------------------------------------------------------------- - -// 'Main program' equivalent: the program execution _T("starts") here -bool ASSDrawApp::OnInit() -{ - SetAppName(TITLE); - // create the main application window - ASSDrawFrame * assdrawframe = new ASSDrawFrame( this, TITLE, wxDefaultPosition, wxSize(640, 480) ); - SetTopWindow(assdrawframe); - return TRUE; -} - - - -// ---------------------------------------------------------------------------- -// main frame: ASSDrawFrame -// ---------------------------------------------------------------------------- - -// constructor - -ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& pos, const wxSize& size, long style) - : wxFrame(NULL, wxID_ANY, title, pos, size, style) -{ - m_app = app; - m_mgr.SetManagedWindow(this); -#ifndef __UNIX__ - m_mgr.SetFlags(m_mgr.GetFlags() | wxAUI_MGR_ALLOW_ACTIVE_PANE); -#else - m_mgr.SetFlags(wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_ALLOW_ACTIVE_PANE | wxAUI_MGR_RECTANGLE_HINT); -#endif - - // set the frame icon - SetIcon(wxICON(appico)); - - // Create status bar for the frame - CreateStatusBar(3); - int statwidths[] = { 64, -1, 64 }; - GetStatusBar()->SetStatusWidths(3, statwidths); - SetStatusBarPane(1); - - InitializeDefaultSettings(); - - // load config - configfile = wxFileName(wxStandardPaths::Get().GetUserDataDir(), _T("ASSDraw3.cfg")).GetFullPath(); - - bool firsttime = !::wxFileExists(configfile); - if (firsttime) { - wxFileName::Mkdir(wxStandardPaths::Get().GetUserDataDir(), wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); - wxFileOutputStream(configfile).Close(); - } - wxFileInputStream cfgf(configfile); - config = new wxFileConfig(cfgf); - - // nullify transformdlg - transformdlg = NULL; - - Maximize(true); - Show(true); // to get the right client size, must call Show() first - - // config - LoadSettings(); - - // THE CANVAS - m_canvas = new ASSDrawCanvas( this , this ); - - // shapes library - shapelib = new ASSDrawShapeLibrary(this, this); - - // source text ctrl - srctxtctrl = new ASSDrawSrcTxtCtrl(this, this); - - // settings - settingsdlg = new ASSDrawSettingsDialog(this, this); - settingsdlg->Init(); - - SetMenus(); - SetToolBars(); - SetPanes(); - - // config - - config->SetPath(_T("info")); - wxString version; - config->Read(_T("version"), &version); - config->SetPath(_T("..")); - - default_perspective = m_mgr.SavePerspective(); // back up default perspective - config->SetPath(_T("perspective")); - wxString perspective; - if (config->Read(_T("perspective"), &perspective) && version == VERSION) m_mgr.LoadPerspective(perspective, false); - config->SetPath(_T("..")); - - config->SetPath(_T("library")); - int n = 0; - config->Read(_T("n"), &n); - for (int i = 0; i < n; i++) - { - wxString libcmds; - config->Read(wxString::Format(_T("%d"),i), &libcmds); - shapelib->AddShapePreview(libcmds); - } - config->SetPath(_T("..")); - - m_mgr.Update(); - m_canvas->SetFocus(); - m_canvas->Show(); - - wxSize clientsize = m_canvas->GetClientSize(); - m_canvas->ChangeZoomLevelTo(DEFAULT_SCALE, wxPoint(clientsize.x / 2, clientsize.y / 2)); - m_canvas->MoveCanvasOriginTo(clientsize.x / 2, clientsize.y / 2); - UpdateASSCommandStringToSrcTxtCtrl(m_canvas->GenerateASS()); - - UpdateFrameUI(); - ApplySettings(); - - if (firsttime) - _About(); - else if (!behaviors.nosplashscreen) - _About(3); - - helpcontroller.SetParentWindow(this); - helpcontroller.Initialize(wxFileName(::wxGetCwd(), _T("ASSDraw3.chm")).GetFullPath()); -} - -void ASSDrawFrame::SetToolBars() -{ - drawtbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_FLAT | wxTB_TEXT | wxTB_NODIVIDER | wxTB_HORIZONTAL); - drawtbar->AddTool(TB_CLEAR, _T("Clear"), wxBITMAP(new_), wxNullBitmap, wxITEM_NORMAL, _T(""), TIPS_CLEAR); - //tbar->AddTool(TB_EDITSRC, _T("Source"), wxBITMAP(src_), wxNullBitmap, wxITEM_NORMAL, _T(""), TIPS_EDITSRC); - drawtbar->AddCheckTool(TB_PREVIEW, _T("Preview"), wxBITMAP(preview_), wxNullBitmap, _T(""), TIPS_PREVIEW); - //drawtbar->AddTool(TB_TRANSFORM, _T("Transform"), wxBITMAP(rot_), wxNullBitmap, wxITEM_NORMAL, _T(""), TIPS_TRANSFORM); - zoomslider = new wxSlider(drawtbar, TB_ZOOMSLIDER, 1000, 100, 5000, __DPDS__ ); - //zoomslider->SetSize(280, zoomslider->GetSize().y); - zoomslider->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this); - zoomslider->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this); - zoomslider->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this); - zoomslider->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this); - zoomslider->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this); - zoomslider->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this); - drawtbar->AddControl(zoomslider); - drawtbar->Realize(); - - m_mgr.AddPane(drawtbar, wxAuiPaneInfo().Name(_T("drawtbar")).Caption(TBNAME_DRAW). - ToolbarPane().Top().Position(0).Dockable(true).LeftDockable(false).RightDockable(false)); - - modetbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_FLAT | wxTB_TEXT | wxTB_NODIVIDER | wxTB_HORIZONTAL); - modetbar->AddRadioTool(MODE_ARR, _T("Drag"), wxBITMAP(arr_), wxNullBitmap, _T(""), TIPS_ARR); - modetbar->AddRadioTool(MODE_M, _T("Move"), wxBITMAP(m_), wxNullBitmap, _T(""), TIPS_M); - //modetbar->AddRadioTool(MODE_N, _T("Move*"), wxBITMAP(n_), wxNullBitmap, _T(""), TIPS_N); - modetbar->AddRadioTool(MODE_L, _T("Line"), wxBITMAP(l_), wxNullBitmap, _T(""), TIPS_L); - modetbar->AddRadioTool(MODE_B, _T("Bezier"), wxBITMAP(b_), wxNullBitmap, _T(""), TIPS_B); - //modetbar->AddRadioTool(MODE_S, _T("Spline"), wxBITMAP(s_), wxNullBitmap, _T(""), TIPS_S); - //modetbar->AddRadioTool(MODE_P, _T("Extend"), wxBITMAP(p_), wxNullBitmap, _T(""), TIPS_P); - //modetbar->AddRadioTool(MODE_C, _T("Close"), wxBITMAP(c_), wxNullBitmap, _T(""), TIPS_C); - modetbar->AddRadioTool(MODE_DEL, _T("Delete"), wxBITMAP(del_), wxNullBitmap, _T(""), TIPS_DEL); - modetbar->AddRadioTool(MODE_SCALEROTATE, _T("Scale/Rotate"), wxBITMAP(sc_rot_), wxNullBitmap, _T(""), TIPS_SCALEROTATE); - modetbar->AddRadioTool(MODE_NUT_BILINEAR, _T("Bilinear"), wxBITMAP(nut_), wxNullBitmap, _T(""), TIPS_NUTB); - //modetbar->AddRadioTool(MODE_NUT_PERSPECTIVE, _T("NUT:P"), wxBITMAP(arr_), wxNullBitmap, _T(""), _T("")); - modetbar->Realize(); - - m_mgr.AddPane(modetbar, wxAuiPaneInfo().Name(_T("modetbar")).Caption(TBNAME_MODE). - ToolbarPane().Top().Position(1).Dockable(true).LeftDockable(false).RightDockable(false)); - - bgimgtbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_FLAT | wxTB_TEXT | wxTB_NODIVIDER | wxTB_HORIZONTAL); - bgimgtbar->SetToolBitmapSize(wxSize(24,15)); - bgimgtbar->AddCheckTool(DRAG_DWG, _T("Pan drawing"), wxBITMAP(pan_shp), wxNullBitmap, _T(""), TIPS_DWG); - bgimgtbar->AddCheckTool(DRAG_BGIMG, _T("Pan background"), wxBITMAP(pan_bg), wxNullBitmap, _T(""), TIPS_BGIMG); - //bgimgtbar->AddRadioTool(DRAG_BOTH, _T("Pan both"), wxBITMAP(pan_both), wxNullBitmap, _T(""), TIPS_BOTH); - bgimgtbar->Realize(); - - m_mgr.AddPane(bgimgtbar, wxAuiPaneInfo().Name(_T("bgimgtbar")).Caption(TBNAME_BGIMG). - ToolbarPane().Top().Position(2).Dockable(true).LeftDockable(false).RightDockable(false)); - -} - -void ASSDrawFrame::SetMenus() -{ - drawMenu = new wxMenu; - drawMenu->Append(MENU_CLEAR, _T("&Clear\tCtrl+N"), TIPS_CLEAR); - //drawMenu->Append(MENU_EDITSRC, _T("&Source"), TIPS_EDITSRC); - drawMenu->Append(MENU_PREVIEW, _T("&Preview\tCtrl+P"), TIPS_PREVIEW, wxITEM_CHECK); - drawMenu->Append(MENU_TRANSFORM, _T("&Transform"), TIPS_TRANSFORM); - drawMenu->Append(MENU_PASTE, _T("&Paste\tCtrl+V"), TIPS_PASTE); - drawMenu->AppendSeparator(); - drawMenu->Append(MENU_UNDO, _T("&Undo\tCtrl+Z"), TIPS_UNDO); - drawMenu->Append(MENU_REDO, _T("&Redo\tCtrl+Y"), TIPS_REDO); - drawMenu->Enable(MENU_UNDO, false); - drawMenu->Enable(MENU_REDO, false); - - modeMenu = new wxMenu; - modeMenu->Append(MODE_ARR, _T("D&rag\tF1"), TIPS_ARR, wxITEM_RADIO); - modeMenu->Append(MODE_M, _T("Draw &M\tF2"), TIPS_M, wxITEM_RADIO); - modeMenu->Append(MODE_L, _T("Draw &L\tF3"), TIPS_L, wxITEM_RADIO); - modeMenu->Append(MODE_B, _T("Draw &B\tF4"), TIPS_B, wxITEM_RADIO); - modeMenu->Append(MODE_DEL, _T("&Delete\tF5"), TIPS_DEL, wxITEM_RADIO); - modeMenu->Append(MODE_SCALEROTATE, _T("&Scale/Rotate\tF6"), TIPS_NUTB, wxITEM_RADIO); - modeMenu->Append(MODE_NUT_BILINEAR, _T("&Bilinear transformation\tF7"), TIPS_SCALEROTATE, wxITEM_RADIO); - - bgimgMenu = new wxMenu; - bgimgMenu->Append(DRAG_DWG, _T("Pan/Zoom &Drawing\tShift+F1"), TIPS_DWG, wxITEM_CHECK); - bgimgMenu->Append(DRAG_BGIMG, _T("Pan/Zoom Back&ground\tShift+F2"), TIPS_BGIMG, wxITEM_CHECK); - bgimgMenu->AppendSeparator(); - bgimgMenu->Append(MENU_BGIMG_ALPHA, _T("Set background image opacity"), _T("")); - wxMenu* reposbgMenu = new wxMenu; - reposbgMenu->Append( MENU_REPOS_BGTOPLEFT, _T("Top left\tCtrl+Shift+7") ); - reposbgMenu->Append( MENU_REPOS_BGTOPRIGHT, _T("Top right\tCtrl+Shift+9") ); - reposbgMenu->Append( MENU_REPOS_BGCENTER, _T("&Center\tCtrl+Shift+5") ); - reposbgMenu->Append( MENU_REPOS_BGBOTLEFT, _T("Bottom left\tCtrl+Shift+1") ); - reposbgMenu->Append( MENU_REPOS_BGBOTRIGHT, _T("Bottom right\tCtrl+Shift+3") ); - bgimgMenu->Append(MENU_BGIMG_RECENTER, _T("Reposition [&0, 0]"), reposbgMenu); - bgimgMenu->Append(MENU_BGIMG_REMOVE, _T("Remove background\tShift+Del"), _T("")); - - wxMenu* reposMenu = new wxMenu; - reposMenu->Append( MENU_REPOS_TOPLEFT, _T("Top left\tCtrl+7") ); - reposMenu->Append( MENU_REPOS_TOPRIGHT, _T("Top right\tCtrl+9") ); - reposMenu->Append( MENU_REPOS_CENTER, _T("&Center\tCtrl+5") ); - reposMenu->Append( MENU_REPOS_BOTLEFT, _T("Bottom left\tCtrl+1") ); - reposMenu->Append( MENU_REPOS_BOTRIGHT, _T("Bottom right\tCtrl+3") ); - - tbarMenu = new wxMenu; - tbarMenu->AppendCheckItem(MENU_TB_DRAW, TBNAME_DRAW); - tbarMenu->AppendCheckItem(MENU_TB_MODE, TBNAME_MODE); - tbarMenu->AppendCheckItem(MENU_TB_BGIMG, TBNAME_BGIMG); - tbarMenu->AppendSeparator(); - tbarMenu->Append(MENU_TB_ALL, _T("Show all")); - tbarMenu->Append(MENU_TB_NONE, _T("Hide all")); - tbarMenu->Append(MENU_TB_DOCK, _T("Dock all")); - tbarMenu->Append(MENU_TB_UNDOCK, _T("Undock all")); - - viewMenu = new wxMenu; - viewMenu->Append(MENU_LIBRARY, _T("&Library"), TIPS_LIBRARY, wxITEM_CHECK); - if (settingsdlg) - viewMenu->Append(MENU_SETTINGS, _T("&Settings"), _T(""), wxITEM_CHECK); - viewMenu->Append(MENU_TBAR, _T("&Toolbars"), tbarMenu); - viewMenu->Append(MENU_RECENTER, _T("Reposition [&0, 0]"), reposMenu); - viewMenu->AppendSeparator(); - viewMenu->Append(MENU_RESETPERSPECTIVE, _T("&Reset workspace")); - - wxMenu* helpMenu = new wxMenu; - helpMenu->Append(MENU_HELP, _T("&Manual")); - helpMenu->Append(wxID_ABOUT, _T("&About")); - - wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(drawMenu, _T("&Canvas")); - menuBar->Append(modeMenu, _T("&Mode")); - menuBar->Append(bgimgMenu, _T("&Background")); - menuBar->Append(viewMenu, _T("&Workspace")); - menuBar->Append(helpMenu, _T("&Help")); - - - SetMenuBar(menuBar); -} - -void ASSDrawFrame::SetPanes() -{ - m_mgr.AddPane(shapelib, wxAuiPaneInfo().Name(_T("library")).Caption(_T("Shapes Library")). - Right().Layer(2).Position(0).CloseButton(true).BestSize(wxSize(120, 480)).MinSize(wxSize(100, 200))); - - m_mgr.AddPane(m_canvas, wxAuiPaneInfo().Name(_T("canvas")).CenterPane()); - - m_mgr.AddPane(srctxtctrl, wxAuiPaneInfo().Name(_T("commands")).Caption(_T("Drawing commands")). - Bottom().Layer(1).CloseButton(false).BestSize(wxSize(320, 48))); - - if (settingsdlg) - m_mgr.AddPane(settingsdlg, wxAuiPaneInfo().Name(_T("settings")).Caption(_T("Settings")). - Right().Layer(3).Position(0).CloseButton(true).BestSize(wxSize(240, 480)).MinSize(wxSize(200, 200)).Show(false)); -} - -ASSDrawFrame::~ASSDrawFrame() -{ - config->SetPath(_T("info")); - config->Write(_T("assdraw3.exe"), wxStandardPaths::Get().GetExecutablePath()); - config->Write(_T("version"), VERSION); - config->SetPath(_T("..")); - - SaveSettings(); - - config->SetPath(_T("perspective")); - config->Write(_T("perspective"), m_mgr.SavePerspective()); - config->SetPath(_T("..")); - - config->DeleteGroup(_T("library")); - config->SetPath(_T("library")); - typedef std::vector< ASSDrawShapePreview *> PrevVec; - PrevVec shapes = shapelib->GetShapePreviews(); - int n = shapes.size(); - config->Write(_T("n"), n); - for (int i = 0; i < n; i++) - config->Write(wxString::Format(_T("%d"),i), shapes[i]->GenerateASS()); - config->SetPath(_T("..")); - - wxFileOutputStream cfgf(configfile); - config->Save(cfgf); - delete config; - - if (settingsdlg) settingsdlg->Destroy(); // we need this since wxPropertyGrid must be Clear()ed before deleting - - m_mgr.UnInit(); -} - -void ASSDrawFrame::_Clear() -{ - wxMessageDialog msgb(this, _T("Clear the canvas and create a new drawing?"), - _T("Confirmation"), wxOK | wxCANCEL | wxICON_QUESTION ); - if (msgb.ShowModal() == wxID_OK) - { - m_canvas->RefreshUndocmds(); - m_canvas->AddUndo(_T("Clear canvas")); - m_canvas->ResetEngine(true); - wxSize siz = m_canvas->GetClientSize(); - m_canvas->ChangeZoomLevelTo(DEFAULT_SCALE, wxPoint(siz.x / 2, siz.y / 2)); - m_canvas->MoveCanvasOriginTo(siz.x / 2, siz.y / 2); - UpdateUndoRedoMenu(); - m_canvas->RefreshDisplay(); - } -} - -void ASSDrawFrame::_Preview() -{ - m_canvas->SetPreviewMode( !m_canvas->IsPreviewMode() ); - UpdateFrameUI(); - m_canvas->RefreshDisplay(); -} - -void ASSDrawFrame::_ToggleLibrary() -{ - m_mgr.GetPane(shapelib).Show(!m_mgr.GetPane(shapelib).IsShown()); - m_mgr.Update(); - UpdateFrameUI(); -} - -void ASSDrawFrame::_ToggleSettings() -{ - if (settingsdlg == NULL) return; - m_mgr.GetPane(settingsdlg).Show(!m_mgr.GetPane(settingsdlg).IsShown()); - m_mgr.Update(); - UpdateFrameUI(); -} - -void ASSDrawFrame::_ResetPerspective() -{ - m_mgr.LoadPerspective(default_perspective, false); - UpdateFrameUI(); - m_mgr.Update(); - DRAGMODE bck = m_canvas->GetDragMode(); - if (m_canvas->HasBackgroundImage()) m_canvas->SetDragMode(DRAGMODE(true, true)); - wxSize clientsize = m_canvas->GetClientSize(); - m_canvas->ChangeZoomLevelTo(DEFAULT_SCALE, wxPoint(clientsize.x / 2, clientsize.y / 2)); - m_canvas->MoveCanvasOriginTo(clientsize.x / 2, clientsize.y / 2); - m_canvas->SetDragMode(bck); - UpdateFrameUI(); -} - -void ASSDrawFrame::_Transform() -{ - if (transformdlg == NULL) - transformdlg = new ASSDrawTransformDlg( this ); - - if (transformdlg->ShowModal() == wxID_OK) - { - m_canvas->Transform( - transformdlg->xformvals.f1, - transformdlg->xformvals.f2, - transformdlg->xformvals.f3, - transformdlg->xformvals.f4, - transformdlg->xformvals.f5, - transformdlg->xformvals.f6, - transformdlg->xformvals.f7, - transformdlg->xformvals.f8 ); - m_canvas->AddUndo(_T("Transform")); - m_canvas->RefreshDisplay(); - UpdateUndoRedoMenu(); - } -} - -void ASSDrawFrame::_Paste() -{ - if (wxTheClipboard->Open()) - { - if (wxTheClipboard->IsSupported( wxDF_BITMAP )) - { - wxBitmapDataObject data; - wxTheClipboard->GetData( data ); - m_canvas->SetBackgroundImage( data.GetBitmap().ConvertToImage() ); - //m_canvas->AskUserForBackgroundAlpha(); - } - else if (wxTheClipboard->IsSupported( wxDF_TEXT )) - { - wxTextDataObject data; - wxTheClipboard->GetData( data ); - UpdateASSCommandStringToSrcTxtCtrl( data.GetText() ); - } - wxTheClipboard->Close(); - } -} - -void ASSDrawFrame::OnChoose_Recenter(wxCommandEvent& event) -{ - int x = 0, y = 0; - wxSize f = m_canvas->GetClientSize(); - - switch (event.GetId()) - { - case MENU_REPOS_TOPLEFT: x = 0, y = 0; break; - case MENU_REPOS_TOPRIGHT: x = f.x, y = 0; break; - case MENU_REPOS_CENTER: x = f.x / 2, y = f.y / 2; break; - case MENU_REPOS_BOTLEFT: x = 0, y = f.y; break; - case MENU_REPOS_BOTRIGHT: x = f.x, y = f.y; break; - } - - m_canvas->MoveCanvasOriginTo(x, y); - m_canvas->RefreshDisplay(); -} - -void ASSDrawFrame::OnChoose_RecenterToBG(wxCommandEvent& event) -{ - unsigned w, h; - wxRealPoint disp; - double scale; - if (m_canvas->GetBackgroundInfo(w, h, disp, scale)) - { - int x = 0, y = 0; - int lx = (int)disp.x, ty = (int)disp.y; - int rx = lx + (int)(w * scale); - int by = ty + (int)(h * scale); - - switch (event.GetId()) - { - case MENU_REPOS_BGTOPLEFT: x = lx, y = ty; break; - case MENU_REPOS_BGTOPRIGHT: x = rx, y = ty; break; - case MENU_REPOS_BGCENTER: x = (rx + lx) / 2, y = (by + ty) / 2; break; - case MENU_REPOS_BGBOTLEFT: x = lx, y = by; break; - case MENU_REPOS_BGBOTRIGHT: x = rx, y = by; break; - } - - m_canvas->MoveCanvasDrawing(x - m_canvas->GetOriginX(), y - m_canvas->GetOriginY()); - m_canvas->RefreshDisplay(); - } -} - -void ASSDrawFrame::_Help() -{ - helpcontroller.DisplayContents(); -} - -void ASSDrawFrame::_About(unsigned timeout) -{ - ASSDrawAboutDlg *aboutdlg = new ASSDrawAboutDlg( this, timeout ); - aboutdlg->ShowModal(); - aboutdlg->Destroy(); -} - -void ASSDrawFrame::OnChoose_Mode(wxCommandEvent& event) -{ - m_canvas->SetDrawMode( (MODE) event.GetId() ); - UpdateFrameUI(); -} - -void ASSDrawFrame::OnChoose_DragMode(wxCommandEvent& event) -{ - DRAGMODE dm = m_canvas->GetDragMode(); - switch (event.GetId()) - { - case DRAG_DWG: dm.drawing = !dm.drawing; break; - case DRAG_BGIMG: dm.bgimg = !dm.bgimg; break; - } - m_canvas->SetDragMode( dm ); - UpdateFrameUI(); -} - -void ASSDrawFrame::OnZoomSliderChanged(wxScrollEvent &event) -{ - double zoom = (double) event.GetPosition() / 100.0; - m_canvas->ChangeZoomLevelTo(zoom, wxPoint((int) m_canvas->GetOriginX(), (int) m_canvas->GetOriginY())); -} - -void ASSDrawFrame::OnToolRClick(wxCommandEvent& event) -{ - int id = event.GetId(); - if (drawtbar->FindById(id) != NULL - || modetbar->FindById(id) != NULL - || bgimgtbar->FindById(id) != NULL) - { - PopupMenu(tbarMenu); - } -} - -void ASSDrawFrame::OnChoose_TBarRClickMenu(wxCommandEvent& event) -{ - int id = event.GetId(); - wxToolBar* tbar[3] = { drawtbar, modetbar, bgimgtbar }; - bool tb[3] = { false, false, false }; - bool show[2] = { false, true }; - bool dock[2] = { false, true }; - switch (id) - { - case MENU_TB_ALL: - tb[0] = true, tb[1] = true, tb[2] = true; - show[0] = true, show[1] = true; - break; - case MENU_TB_NONE: - tb[0] = true, tb[1] = true, tb[2] = true; - show[0] = true, show[1] = false; - break; - case MENU_TB_DOCK: - tb[0] = true, tb[1] = true, tb[2] = true; - dock[0] = true, dock[1] = true; - break; - case MENU_TB_UNDOCK: - tb[0] = true, tb[1] = true, tb[2] = true; - dock[0] = true, dock[1] = false; - break; - case MENU_TB_DRAW: - tb[0] = true; - show[0] = true, show[1] = !m_mgr.GetPane(tbar[0]).IsShown(); - break; - case MENU_TB_MODE: - tb[1] = true; - show[0] = true, show[1] = !m_mgr.GetPane(tbar[1]).IsShown(); - break; - case MENU_TB_BGIMG: - tb[2] = true; - show[0] = true, show[1] = !m_mgr.GetPane(tbar[2]).IsShown(); - break; - } - for (int i = 0; i < 3; i++) - { - if (tb[i]) - { - if (show[0]) - m_mgr.GetPane(tbar[i]).Show(show[1]); - if (dock[0]) - if (dock[1]) - m_mgr.GetPane(tbar[i]).Dock(); - else - m_mgr.GetPane(tbar[i]).Float(); - } - } - m_mgr.Update(); - UpdateFrameUI(); -} - -void ASSDrawFrame::UpdateASSCommandStringFromSrcTxtCtrl(wxString cmds) -{ - m_canvas->ParseASS(cmds, true); - m_canvas->RefreshDisplay(); -} - -void ASSDrawFrame::UpdateASSCommandStringToSrcTxtCtrl(wxString cmd) -{ - if (behaviors.capitalizecmds) - cmd.UpperCase(); - else - cmd.LowerCase(); - srctxtctrl->ChangeValue(cmd); - //srctxtctrl->AppendText(cmd); -} - -void ASSDrawFrame::UndoOrRedo(bool isundo) -{ - if (isundo) - m_canvas->Undo(); - else - m_canvas->Redo(); - UpdateUndoRedoMenu(); - UpdateFrameUI(); -} - -void ASSDrawFrame::UpdateUndoRedoMenu() -{ - wxString nextUndo = m_canvas->GetTopUndo(); - if (nextUndo.IsSameAs(_T(""))) - { - drawMenu->SetLabel(MENU_UNDO, _T("Undo\tCtrl+Z")); - drawMenu->Enable(MENU_UNDO, false); - } - else - { - drawMenu->SetLabel(MENU_UNDO, wxString::Format(_T("Undo: %s\tCtrl+Z"), nextUndo.c_str())); - drawMenu->Enable(MENU_UNDO, true); - } - wxString nextRedo = m_canvas->GetTopRedo(); - if (nextRedo.IsSameAs(_T(""))) - { - drawMenu->SetLabel(MENU_REDO, _T("Redo\tCtrl+Y")); - drawMenu->Enable(MENU_REDO, false); - } - else - { - drawMenu->SetLabel(MENU_REDO, wxString::Format(_T("Redo: %s\tCtrl+Y"), nextRedo.c_str())); - drawMenu->Enable(MENU_REDO, true); - } -} - -void ASSDrawFrame::UpdateFrameUI(unsigned level) -{ - bool hasbg = m_canvas->HasBackgroundImage(); - int zoom = (int) ((m_canvas->GetScale() * 100.0)+0.5); - switch (level) - { - case 0: // all - drawtbar->ToggleTool(TB_PREVIEW, m_canvas->IsPreviewMode()); - modetbar->ToggleTool(m_canvas->GetDrawMode(), true); - drawMenu->Check(MENU_PREVIEW, m_canvas->IsPreviewMode()); - modeMenu->Check(m_canvas->GetDrawMode(), true); - case 2: // bgimg & toolbars - bgimgtbar->ToggleTool(DRAG_DWG, m_canvas->GetDragMode().drawing); - bgimgtbar->ToggleTool(DRAG_BGIMG, m_canvas->GetDragMode().bgimg); - bgimgtbar->EnableTool(DRAG_BGIMG, hasbg); - m_mgr.Update(); - viewMenu->Check(MENU_LIBRARY, m_mgr.GetPane(shapelib).IsShown()); - if (settingsdlg) - viewMenu->Check(MENU_SETTINGS, m_mgr.GetPane(settingsdlg).IsShown()); - bgimgMenu->Check(DRAG_DWG, m_canvas->GetDragMode().drawing); - bgimgMenu->Check(DRAG_BGIMG, m_canvas->GetDragMode().bgimg); - bgimgMenu->Enable(DRAG_BGIMG, hasbg); - bgimgMenu->Enable(MENU_BGIMG_ALPHA, hasbg); - bgimgMenu->Enable(MENU_BGIMG_RECENTER, hasbg); - bgimgMenu->Enable(MENU_BGIMG_REMOVE, hasbg); - tbarMenu->Check(MENU_TB_DRAW, m_mgr.GetPane(drawtbar).IsShown()); - tbarMenu->Check(MENU_TB_MODE, m_mgr.GetPane(modetbar).IsShown()); - tbarMenu->Check(MENU_TB_BGIMG, m_mgr.GetPane(bgimgtbar).IsShown()); - case 3: // zoom slider - zoomslider->SetValue(zoom); - SetStatusText( wxString::Format(_T("%d%%"), zoom), 2 ); - zoomslider->Enable(m_canvas->GetDragMode().drawing && m_canvas->CanZoom()); - } -} - -void ASSDrawFrame::OnClose(wxCloseEvent &event) -{ - if (event.CanVeto() && behaviors.confirmquit) - { - if (wxMessageDialog(this, _T("Do you want to close ASSDraw3 now?"), _T("Confirmation"), wxOK | wxCANCEL).ShowModal() == wxID_OK) - Destroy(); - else - event.Veto(); - } - else - Destroy(); -} diff --git a/contrib/assdraw/src/assdraw.hpp b/contrib/assdraw/src/assdraw.hpp deleted file mode 100644 index 1ebd4dc4f..000000000 --- a/contrib/assdraw/src/assdraw.hpp +++ /dev/null @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: assdraw.hpp -// Purpose: header file for ASSDraw main source file; also includes -// declarations for all GUI elements (except wxRuler, which has -// its own header file) -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "_common.hpp" - -#include -#include -#include -#include -#include - -#include "canvas.hpp" // the canvas -#include "dlgctrl.hpp" // custom dialogs & controls -#include "settings.hpp" // settings property grid -#include "library.hpp" // shape library - -//#define BETAVERSION 2 -#define VERSION _T("3.0 final") - -// this header file declares the following classes -class ASSDrawApp; -class ASSDrawFrame; -class ASSDrawCanvas; - -class ASSDrawApp : public wxApp -{ -public: - bool OnInit(); -}; - -class ASSDrawFrame : public wxFrame -{ -public: - // constructor - ASSDrawFrame(wxApp *app, const wxString& title, const wxPoint& pos, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE); - virtual ~ASSDrawFrame(); - - // event handlers (these functions should _not_ be virtual) - // OnSelect_* for single items, OnChoose_* for many-choose-one items - void OnSelect_Clear(wxCommandEvent& WXUNUSED(event)) { _Clear(); } - void OnSelect_Preview(wxCommandEvent& WXUNUSED(event)) { _Preview(); } - void OnSelect_Transform(wxCommandEvent& WXUNUSED(event)) { _Transform(); } - void OnSelect_Library(wxCommandEvent& WXUNUSED(event)) { _ToggleLibrary(); } - void OnSelect_Settings(wxCommandEvent& WXUNUSED(event)) { _ToggleSettings(); } - void OnSelect_ResetPerspective(wxCommandEvent& WXUNUSED(event)) { _ResetPerspective(); } - void OnSelect_Help(wxCommandEvent& WXUNUSED(event)) { _Help(); } - void OnSelect_About(wxCommandEvent& WXUNUSED(event)) { _About(); } - void OnSelect_Undo(wxCommandEvent& WXUNUSED(event)) { UndoOrRedo( true ); } - void OnSelect_Redo(wxCommandEvent& WXUNUSED(event)) { UndoOrRedo( false ); } - void OnSelect_Paste(wxCommandEvent& WXUNUSED(event)) { _Paste(); } - void OnSelect_RemoveBG(wxCommandEvent& WXUNUSED(event)) { m_canvas->RemoveBackgroundImage(); } - void OnSelect_AlphaBG(wxCommandEvent& WXUNUSED(event)) { m_canvas->AskUserForBackgroundAlpha(); } - void OnChoose_Recenter(wxCommandEvent& event); - void OnChoose_RecenterToBG(wxCommandEvent& event); - void OnChoose_Mode(wxCommandEvent& event); - void OnChoose_DragMode(wxCommandEvent& event); - void OnZoomSliderChanged(wxScrollEvent &event); - void OnToolRClick(wxCommandEvent& event); - void OnChoose_TBarRClickMenu(wxCommandEvent& event); - void OnSettingsChanged(wxCommandEvent& event); - void OnClose(wxCloseEvent &event); - - void UpdateASSCommandStringToSrcTxtCtrl(wxString cmds); - void UpdateASSCommandStringFromSrcTxtCtrl(wxString cmds); - - void UndoOrRedo(bool isundo); - void UpdateUndoRedoMenu(); - - void _Clear(); - void _Preview(); - void _Transform(); - void _ToggleLibrary(); - void _ToggleSettings(); - void _Help(); - void _About(unsigned timeout = 0); - void _Paste(); - void _ResetPerspective(); - - void UpdateFrameUI(unsigned level = 0); - - // the canvas - wxApp *m_app; - ASSDrawCanvas* m_canvas; - wxAuiManager m_mgr; - wxString default_perspective; - ASSDrawSrcTxtCtrl* srctxtctrl; - - // config - wxString configfile; - wxFileConfig *config; - - // toolbars - wxToolBar *drawtbar, *modetbar, *bgimgtbar; - - // zoom slider - wxSlider* zoomslider; - - //library - ASSDrawShapeLibrary *shapelib; - typedef std::vector< ASSDrawEngine* > DrawEngineVec; - DrawEngineVec libshapes; - - // menus -#if wxUSE_MENUS - wxMenu *drawMenu; - wxMenu *modeMenu; - wxMenu *bgimgMenu; - wxMenu *viewMenu; - wxMenu *tbarMenu; -#endif - - // dialogs - ASSDrawTransformDlg* transformdlg; - ASSDrawSettingsDialog* settingsdlg; - - // colors - struct - { - wxColour canvas_bg; - wxColour canvas_shape_normal; - wxColour canvas_shape_preview; - wxColour canvas_shape_outline; - wxColour canvas_shape_guideline; - wxColour canvas_shape_mainpoint; - wxColour canvas_shape_controlpoint; - wxColour canvas_shape_selectpoint; - wxColour library_shape; - wxColour library_libarea; - wxColour origin, ruler_h, ruler_v; - } colors; - - struct - { - long canvas_shape_normal; - long canvas_shape_preview; - long canvas_shape_outline; - long canvas_shape_guideline; - long canvas_shape_mainpoint; - long canvas_shape_controlpoint; - long canvas_shape_selectpoint; - } alphas; - - struct - { - long origincross; - } sizes; - - struct - { - bool capitalizecmds; - bool autoaskimgopac; - bool parse_spc; - bool nosplashscreen; - bool confirmquit; - } behaviors; - - void LoadSettings(); - void SaveSettings(); - void InitializeDefaultSettings(); - void ApplySettings(); - static void wxColourToAggRGBA(wxColour &colour, agg::rgba &rgba); - static void wxColourSetAlpha(wxColour &colour, long alpha); - -protected: - virtual void SetToolBars(); - virtual void SetMenus(); - virtual void SetPanes(); - DECLARE_EVENT_TABLE() - - wxHelpController helpcontroller; - -}; diff --git a/contrib/assdraw/src/assdraw.rc b/contrib/assdraw/src/assdraw.rc deleted file mode 100644 index 162d9bd91..000000000 --- a/contrib/assdraw/src/assdraw.rc +++ /dev/null @@ -1,101 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -APPICO ICON "tsukasa.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -ASSDRAW3_ BITMAP "bitmaps/assdraw3.bmp" -NEW_ BITMAP "bitmaps/new_.bmp" -SRC_ BITMAP "bitmaps/src_.bmp" -PREVIEW_ BITMAP "bitmaps/preview_.bmp" -ARR_ BITMAP "bitmaps/arr_.bmp" -M_ BITMAP "bitmaps/m_.bmp" -N_ BITMAP "bitmaps/n_.bmp" -L_ BITMAP "bitmaps/l_.bmp" -B_ BITMAP "bitmaps/b_.bmp" -S_ BITMAP "bitmaps/s_.bmp" -P_ BITMAP "bitmaps/p_.bmp" -C_ BITMAP "bitmaps/c_.bmp" -DEL_ BITMAP "bitmaps/del_.bmp" -NUT_ BITMAP "bitmaps/nut_.bmp" -SC_ROT_ BITMAP "bitmaps/sc_rot_.bmp" -ROT_ BITMAP "bitmaps/rot_.bmp" -HELP_ BITMAP "bitmaps/help_.bmp" -TRANSFORM BITMAP "bitmaps/transform.bmp" -PAN_SHP BITMAP "bitmaps/pan_shp.bmp" -PAN_BG BITMAP "bitmaps/pan_bg.bmp" -//PAN_BOTH BITMAP "bitmaps/pan_both.bmp" -ADD BITMAP "bitmaps/add_.bmp" -CHECK BITMAP "bitmaps/check_.bmp" -UNCHECK BITMAP "bitmaps/uncheck_.bmp" -DELCROSS BITMAP "bitmaps/del_cross.bmp" - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/contrib/assdraw/src/assdraw_settings.cpp b/contrib/assdraw/src/assdraw_settings.cpp deleted file mode 100644 index d774f55c1..000000000 --- a/contrib/assdraw/src/assdraw_settings.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#include "assdraw.hpp" - -void ASSDrawFrame::InitializeDefaultSettings() -{ - colors.canvas_bg = wxColour(0xFF, 0xFF, 0xFF); - colors.canvas_shape_normal = wxColour(0x0, 0x0, 0xFF, 0x99); - colors.canvas_shape_preview = wxColour(0x0, 0x0, 0xFF); - colors.canvas_shape_outline = wxColour(0x0, 0x0, 0x0); - colors.canvas_shape_guideline = wxColour(0x66, 0x66, 0x66); - colors.canvas_shape_mainpoint = wxColour(0xFF, 0x0, 0x0, 0xCC); - colors.canvas_shape_controlpoint = wxColour(0x0, 0xFF, 0x0, 0xCC); - colors.canvas_shape_selectpoint = wxColour(0x0, 0x0, 0xCC); - colors.library_shape = wxColour(0x0, 0x66, 0x99); - colors.library_libarea = wxColour(0xFF, 0xFF, 0x99); - colors.origin = wxColour(0xFF, 0x0, 0x0); - colors.ruler_h = wxColour(0x0, 0x0, 0x66); - colors.ruler_v = wxColour(0x66, 0x0, 0x0); - - alphas.canvas_shape_normal = 128; - alphas.canvas_shape_preview = 255; - alphas.canvas_shape_outline = 255; - alphas.canvas_shape_guideline = 255; - alphas.canvas_shape_mainpoint = 128; - alphas.canvas_shape_controlpoint = 128; - alphas.canvas_shape_selectpoint = 255; - - sizes.origincross = 2; - - behaviors.capitalizecmds = false; - behaviors.autoaskimgopac = true; - behaviors.parse_spc = false; - behaviors.nosplashscreen = false; - behaviors.confirmquit = true; -} - -void ASSDrawFrame::ApplySettings() -{ - wxColourSetAlpha(colors.canvas_shape_normal, alphas.canvas_shape_normal); - wxColourSetAlpha(colors.canvas_shape_preview, alphas.canvas_shape_preview); - wxColourSetAlpha(colors.canvas_shape_outline, alphas.canvas_shape_outline); - wxColourSetAlpha(colors.canvas_shape_guideline, alphas.canvas_shape_guideline); - wxColourSetAlpha(colors.canvas_shape_mainpoint, alphas.canvas_shape_mainpoint); - wxColourSetAlpha(colors.canvas_shape_controlpoint, alphas.canvas_shape_controlpoint); - wxColourSetAlpha(colors.canvas_shape_selectpoint, alphas.canvas_shape_selectpoint); - - wxColourToAggRGBA(colors.canvas_shape_normal, m_canvas->rgba_shape_normal); - wxColourToAggRGBA(colors.canvas_shape_preview, m_canvas->rgba_shape); - wxColourToAggRGBA(colors.canvas_shape_outline, m_canvas->rgba_outline); - wxColourToAggRGBA(colors.canvas_shape_guideline, m_canvas->rgba_guideline); - wxColourToAggRGBA(colors.canvas_shape_mainpoint, m_canvas->rgba_mainpoint); - wxColourToAggRGBA(colors.canvas_shape_controlpoint, m_canvas->rgba_controlpoint); - wxColourToAggRGBA(colors.canvas_shape_selectpoint, m_canvas->rgba_selectpoint); - wxColourToAggRGBA(colors.origin, m_canvas->rgba_origin); - wxColourToAggRGBA(colors.ruler_h, m_canvas->rgba_ruler_h); - wxColourToAggRGBA(colors.ruler_v, m_canvas->rgba_ruler_v); - - m_canvas->color_bg.r = colors.canvas_bg.Red(); - m_canvas->color_bg.g = colors.canvas_bg.Green(); - m_canvas->color_bg.b = colors.canvas_bg.Blue(); - m_canvas->color_bg.a = colors.canvas_bg.Alpha(); - m_canvas->PrepareBackgroundBitmap(-1.0); - m_canvas->Refresh(); - - shapelib->libarea->SetBackgroundColour(colors.library_libarea); - typedef std::vector< ASSDrawShapePreview *> PrevVec; - PrevVec shapes = shapelib->GetShapePreviews(); - int n = shapes.size(); - for (int i = 0; i < n; i++) - wxColourToAggRGBA(colors.library_shape, shapes[i]->rgba_shape); - shapelib->libarea->Refresh(); - - m_canvas->SetDrawCmdSet(behaviors.parse_spc? _T("m n l b s p c _"):_T("m n l b _")); - - UpdateASSCommandStringToSrcTxtCtrl(m_canvas->GenerateASS()); -} - -void ASSDrawFrame::wxColourToAggRGBA(wxColour &colour, agg::rgba &rgba) -{ - rgba.r = (double) colour.Red() / 255.0; - rgba.g = (double) colour.Green() / 255.0; - rgba.b = (double) colour.Blue() / 255.0; - rgba.a = (double) colour.Alpha() / 255.0; -} - -void ASSDrawFrame::wxColourSetAlpha(wxColour &colour, long alpha) -{ - colour.Set(colour.Red(), colour.Green(), colour.Blue(), alpha); -} - -void ASSDrawFrame::OnSettingsChanged(wxCommandEvent& event) -{ - ApplySettings(); -} - -void ASSDrawFrame::LoadSettings() -{ - #define CFGREADCOLOR(color) if (config->Read(wxString(#color,wxConvUTF8), &tmpstr)) color.Set(tmpstr); - #define CFGREAD(var) config->Read(wxString(#var,wxConvUTF8), &var); - config->SetPath(_T("settings")); - wxString tmpstr; - CFGREADCOLOR(colors.canvas_bg) - CFGREADCOLOR(colors.canvas_shape_normal) - CFGREADCOLOR(colors.canvas_shape_preview) - CFGREADCOLOR(colors.canvas_shape_controlpoint) - CFGREADCOLOR(colors.canvas_shape_guideline) - CFGREADCOLOR(colors.canvas_shape_mainpoint) - CFGREADCOLOR(colors.canvas_shape_outline) - CFGREADCOLOR(colors.canvas_shape_selectpoint) - CFGREADCOLOR(colors.library_libarea) - CFGREADCOLOR(colors.library_shape) - CFGREADCOLOR(colors.origin) - CFGREADCOLOR(colors.ruler_h) - CFGREADCOLOR(colors.ruler_v) - CFGREAD(alphas.canvas_shape_normal) - CFGREAD(alphas.canvas_shape_preview) - CFGREAD(alphas.canvas_shape_controlpoint) - CFGREAD(alphas.canvas_shape_guideline) - CFGREAD(alphas.canvas_shape_mainpoint) - CFGREAD(alphas.canvas_shape_outline) - CFGREAD(alphas.canvas_shape_selectpoint) - CFGREAD(sizes.origincross) - CFGREAD(behaviors.autoaskimgopac) - CFGREAD(behaviors.capitalizecmds) - CFGREAD(behaviors.parse_spc) - CFGREAD(behaviors.nosplashscreen) - CFGREAD(behaviors.confirmquit) - config->SetPath(_T("..")); -} - -void ASSDrawFrame::SaveSettings() -{ - #define CFGWRITE(var) config->Write(wxString(#var,wxConvUTF8), var); - #define CFGWRITECOLOR(color) config->Write(wxString(#color,wxConvUTF8), color.GetAsString(wxC2S_CSS_SYNTAX)); - config->SetPath(_T("settings")); - CFGWRITECOLOR(colors.canvas_bg) - CFGWRITECOLOR(colors.canvas_shape_normal) - CFGWRITECOLOR(colors.canvas_shape_preview) - CFGWRITECOLOR(colors.canvas_shape_controlpoint) - CFGWRITECOLOR(colors.canvas_shape_guideline) - CFGWRITECOLOR(colors.canvas_shape_mainpoint) - CFGWRITECOLOR(colors.canvas_shape_outline) - CFGWRITECOLOR(colors.canvas_shape_selectpoint) - CFGWRITECOLOR(colors.library_libarea) - CFGWRITECOLOR(colors.library_shape) - CFGWRITECOLOR(colors.origin) - CFGWRITECOLOR(colors.ruler_h) - CFGWRITECOLOR(colors.ruler_v) - CFGWRITE(alphas.canvas_shape_normal) - CFGWRITE(alphas.canvas_shape_preview) - CFGWRITE(alphas.canvas_shape_controlpoint) - CFGWRITE(alphas.canvas_shape_guideline) - CFGWRITE(alphas.canvas_shape_mainpoint) - CFGWRITE(alphas.canvas_shape_outline) - CFGWRITE(alphas.canvas_shape_selectpoint) - CFGWRITE(sizes.origincross) - CFGWRITE(behaviors.autoaskimgopac) - CFGWRITE(behaviors.capitalizecmds) - CFGWRITE(behaviors.parse_spc) - CFGWRITE(behaviors.nosplashscreen) - CFGWRITE(behaviors.confirmquit) - config->SetPath(_T("..")); -} diff --git a/contrib/assdraw/src/bitmaps/Copy of assdraw3.bmp b/contrib/assdraw/src/bitmaps/Copy of assdraw3.bmp deleted file mode 100644 index 4fe735e5b..000000000 Binary files a/contrib/assdraw/src/bitmaps/Copy of assdraw3.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/add_.bmp b/contrib/assdraw/src/bitmaps/add_.bmp deleted file mode 100644 index 5a87ed3fb..000000000 Binary files a/contrib/assdraw/src/bitmaps/add_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/arr_.bmp b/contrib/assdraw/src/bitmaps/arr_.bmp deleted file mode 100644 index 34ec029d1..000000000 Binary files a/contrib/assdraw/src/bitmaps/arr_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/arr_1.bmp b/contrib/assdraw/src/bitmaps/arr_1.bmp deleted file mode 100644 index 14f71ee26..000000000 Binary files a/contrib/assdraw/src/bitmaps/arr_1.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/assdraw3.bmp b/contrib/assdraw/src/bitmaps/assdraw3.bmp deleted file mode 100644 index debaf3c8b..000000000 Binary files a/contrib/assdraw/src/bitmaps/assdraw3.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/b_.bmp b/contrib/assdraw/src/bitmaps/b_.bmp deleted file mode 100644 index 3046a9048..000000000 Binary files a/contrib/assdraw/src/bitmaps/b_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/b_.cur b/contrib/assdraw/src/bitmaps/b_.cur deleted file mode 100644 index 117906dd9..000000000 Binary files a/contrib/assdraw/src/bitmaps/b_.cur and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/c_.bmp b/contrib/assdraw/src/bitmaps/c_.bmp deleted file mode 100644 index 8a37dae86..000000000 Binary files a/contrib/assdraw/src/bitmaps/c_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/check_.bmp b/contrib/assdraw/src/bitmaps/check_.bmp deleted file mode 100644 index 41ca19aa3..000000000 Binary files a/contrib/assdraw/src/bitmaps/check_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/del_.bmp b/contrib/assdraw/src/bitmaps/del_.bmp deleted file mode 100644 index 034986fd0..000000000 Binary files a/contrib/assdraw/src/bitmaps/del_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/del_cross.bmp b/contrib/assdraw/src/bitmaps/del_cross.bmp deleted file mode 100644 index e6dc0957f..000000000 Binary files a/contrib/assdraw/src/bitmaps/del_cross.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/help.bmp b/contrib/assdraw/src/bitmaps/help.bmp deleted file mode 100644 index d5636e9aa..000000000 Binary files a/contrib/assdraw/src/bitmaps/help.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/help_.bmp b/contrib/assdraw/src/bitmaps/help_.bmp deleted file mode 100644 index eac6f2e5e..000000000 Binary files a/contrib/assdraw/src/bitmaps/help_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/l_.bmp b/contrib/assdraw/src/bitmaps/l_.bmp deleted file mode 100644 index 92af791d0..000000000 Binary files a/contrib/assdraw/src/bitmaps/l_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/m_.bmp b/contrib/assdraw/src/bitmaps/m_.bmp deleted file mode 100644 index 5e5b4c861..000000000 Binary files a/contrib/assdraw/src/bitmaps/m_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/n_.bmp b/contrib/assdraw/src/bitmaps/n_.bmp deleted file mode 100644 index 47c4ad7f2..000000000 Binary files a/contrib/assdraw/src/bitmaps/n_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/new_.bmp b/contrib/assdraw/src/bitmaps/new_.bmp deleted file mode 100644 index 3c8f88d41..000000000 Binary files a/contrib/assdraw/src/bitmaps/new_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/nut_.bmp b/contrib/assdraw/src/bitmaps/nut_.bmp deleted file mode 100644 index f76644e38..000000000 Binary files a/contrib/assdraw/src/bitmaps/nut_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/p_.bmp b/contrib/assdraw/src/bitmaps/p_.bmp deleted file mode 100644 index 67aeafa72..000000000 Binary files a/contrib/assdraw/src/bitmaps/p_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/pan_bg.bmp b/contrib/assdraw/src/bitmaps/pan_bg.bmp deleted file mode 100644 index 0587ca30e..000000000 Binary files a/contrib/assdraw/src/bitmaps/pan_bg.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/pan_both.bmp b/contrib/assdraw/src/bitmaps/pan_both.bmp deleted file mode 100644 index 84eb52fd0..000000000 Binary files a/contrib/assdraw/src/bitmaps/pan_both.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/pan_shape.bmp b/contrib/assdraw/src/bitmaps/pan_shape.bmp deleted file mode 100644 index 32ada0ae3..000000000 Binary files a/contrib/assdraw/src/bitmaps/pan_shape.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/pan_shp.bmp b/contrib/assdraw/src/bitmaps/pan_shp.bmp deleted file mode 100644 index 1b5da621b..000000000 Binary files a/contrib/assdraw/src/bitmaps/pan_shp.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/preview_.bmp b/contrib/assdraw/src/bitmaps/preview_.bmp deleted file mode 100644 index b8b6fbe98..000000000 Binary files a/contrib/assdraw/src/bitmaps/preview_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/rot_.bmp b/contrib/assdraw/src/bitmaps/rot_.bmp deleted file mode 100644 index b2c14a906..000000000 Binary files a/contrib/assdraw/src/bitmaps/rot_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/s_.bmp b/contrib/assdraw/src/bitmaps/s_.bmp deleted file mode 100644 index 1e8afab55..000000000 Binary files a/contrib/assdraw/src/bitmaps/s_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/sc_rot_.bmp b/contrib/assdraw/src/bitmaps/sc_rot_.bmp deleted file mode 100644 index 546d7fdf1..000000000 Binary files a/contrib/assdraw/src/bitmaps/sc_rot_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/src_.bmp b/contrib/assdraw/src/bitmaps/src_.bmp deleted file mode 100644 index ae2e55e07..000000000 Binary files a/contrib/assdraw/src/bitmaps/src_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/transform.bmp b/contrib/assdraw/src/bitmaps/transform.bmp deleted file mode 100644 index 8ae24e5ad..000000000 Binary files a/contrib/assdraw/src/bitmaps/transform.bmp and /dev/null differ diff --git a/contrib/assdraw/src/bitmaps/uncheck_.bmp b/contrib/assdraw/src/bitmaps/uncheck_.bmp deleted file mode 100644 index b600bebec..000000000 Binary files a/contrib/assdraw/src/bitmaps/uncheck_.bmp and /dev/null differ diff --git a/contrib/assdraw/src/canvas.cpp b/contrib/assdraw/src/canvas.cpp deleted file mode 100644 index a077c1ef5..000000000 --- a/contrib/assdraw/src/canvas.cpp +++ /dev/null @@ -1,1997 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: canvas.cpp -// Purpose: implementations of ASSDraw main canvas class -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#include "assdraw.hpp" -#include "cmd.hpp" -#include "agg_gsv_text.h" -#include "agg_ellipse.h" -#include "agg_conv_dash.h" -#include "agg_trans_bilinear.h" -#include "agg_trans_perspective.h" - -#include "agghelper.hpp" -#include -#include -#include - -// ---------------------------------------------------------------------------- -// the main drawing canvas: ASSDrawCanvas -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(ASSDrawCanvas, ASSDrawEngine) - EVT_MOTION (ASSDrawCanvas::OnMouseMove) - EVT_LEFT_UP(ASSDrawCanvas::OnMouseLeftUp) - EVT_LEFT_DOWN(ASSDrawCanvas::OnMouseLeftDown) - EVT_RIGHT_UP(ASSDrawCanvas::OnMouseRightUp) - EVT_RIGHT_DOWN(ASSDrawCanvas::OnMouseRightDown) - EVT_RIGHT_DCLICK(ASSDrawCanvas::OnMouseRightDClick) - EVT_MOUSEWHEEL(ASSDrawCanvas::OnMouseWheel) - EVT_KEY_DOWN(ASSDrawCanvas::CustomOnKeyDown) - EVT_KEY_UP(ASSDrawCanvas::CustomOnKeyUp) - EVT_MENU(MENU_DRC_LNTOBEZ, ASSDrawCanvas::OnSelect_ConvertLineToBezier) - EVT_MENU(MENU_DRC_BEZTOLN, ASSDrawCanvas::OnSelect_ConvertBezierToLine) - EVT_MENU(MENU_DRC_C1CONTBEZ, ASSDrawCanvas::OnSelect_C1ContinuityBezier) - EVT_MENU(MENU_DRC_MOVE00, ASSDrawCanvas::OnSelect_Move00Here) - EVT_MOUSE_CAPTURE_LOST(ASSDrawCanvas::CustomOnMouseCaptureLost) -END_EVENT_TABLE() - -ASSDrawCanvas::ASSDrawCanvas(wxWindow *parent, ASSDrawFrame *frame, int extraflags) - : ASSDrawEngine( parent, extraflags ) -{ - m_frame = frame; - preview_mode = false; - lastDrag_left = NULL; - lastDrag_right = NULL; - dragAnchor_left = NULL; - dragAnchor_right = NULL; - newcommand = NULL; - mousedownAt_point = NULL; - pointedAt_point = NULL; - draw_mode = MODE_ARR; - - dragOrigin = false; - hilite_cmd = NULL; - hilite_point = NULL; - capturemouse_left = false; - capturemouse_right = false; - bgimg.bgbmp = NULL; - bgimg.bgimg = NULL; - bgimg.alpha = 0.5; - rectbound2upd = -1, rectbound2upd2 = -1; - - rgba_shape_normal = agg::rgba(0,0,1,0.5); - rgba_outline = agg::rgba(0,0,0); - rgba_guideline = agg::rgba(0.5,0.5,0.5); - rgba_mainpoint = agg::rgba(1,0,0,0.75); - rgba_controlpoint = agg::rgba(0,1,0,0.75); - rgba_selectpoint = agg::rgba(0,0,1,0.75); - rgba_origin = agg::rgba(0,0,0); - rgba_ruler_h = agg::rgba(0,0,1); - rgba_ruler_v = agg::rgba(1,0,0); - - wxFlexGridSizer* sizer = new wxFlexGridSizer(1, 1, 0); - sizer->AddGrowableRow(0); - sizer->AddGrowableCol(0); - sizer->Add( this, 0, wxGROW|wxGROW, 5); - parent->SetSizer(sizer); - - // for background image loading - ::wxInitAllImageHandlers(); - bgimg.bgbmp = NULL; - bgimg.bgimg = NULL; - // drag image background file - SetDropTarget(new ASSDrawFileDropTarget(this)); - - hasStatusBar = m_frame->GetStatusBar() != NULL; - - // cursor = crosshair - SetCursor( *wxCROSS_CURSOR ); - - bgimg.alpha_dlg = new wxDialog(this, wxID_ANY, wxString(_T("Background image opacity"))); - bgimg.alpha_slider = new wxSlider(bgimg.alpha_dlg, TB_BGALPHA_SLIDER, 50, 0, 100, __DPDS__ , wxSL_LABELS); - bgimg.alpha_slider->SetSize(280, bgimg.alpha_slider->GetSize().y); - bgimg.alpha_dlg->Fit(); - bgimg.alpha_dlg->Show(false); - bgimg.alpha_slider->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(ASSDrawCanvas::OnAlphaSliderChanged), NULL, this); - bgimg.alpha_slider->Connect(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(ASSDrawCanvas::OnAlphaSliderChanged), NULL, this); - bgimg.alpha_slider->Connect(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(ASSDrawCanvas::OnAlphaSliderChanged), NULL, this); - bgimg.alpha_slider->Connect(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(ASSDrawCanvas::OnAlphaSliderChanged), NULL, this); - bgimg.alpha_slider->Connect(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(ASSDrawCanvas::OnAlphaSliderChanged), NULL, this); - bgimg.alpha_slider->Connect(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(ASSDrawCanvas::OnAlphaSliderChanged), NULL, this); - - RefreshUndocmds(); - -} - -// Destructor -ASSDrawCanvas::~ASSDrawCanvas() -{ - ASSDrawEngine::ResetEngine(false); - if (pointsys) delete pointsys; - if (bgimg.bgbmp) delete bgimg.bgbmp; - if (bgimg.bgimg) delete bgimg.bgimg; -} - -void ASSDrawCanvas::ParseASS(wxString str, bool addundo) -{ - if (addundo) - AddUndo(_T("Modify drawing commands")); - - ASSDrawEngine::ParseASS(str); - - RefreshUndocmds(); -} - -void ASSDrawCanvas::ResetEngine(bool addM) -{ - ClearPointsSelection(); - SetHighlighted(NULL, NULL); - SetPreviewMode(false); - SetDrawMode(MODE_ARR); - ASSDrawEngine::ResetEngine(addM); - RefreshUndocmds(); -} - -void ASSDrawCanvas::SetPreviewMode(bool mode) -{ - preview_mode = mode; - if (preview_mode) - { - if (mousedownAt_point != NULL) - { - mousedownAt_point->cmd_main->Init(); - mousedownAt_point = NULL; - } - - if (pointedAt_point != NULL) - pointedAt_point = NULL; - - SetHighlighted( NULL, NULL ); - - RefreshDisplay(); - } -} - -// (Re)draw canvas -void ASSDrawCanvas::RefreshDisplay() -{ - ASSDrawEngine::RefreshDisplay(); - wxString asscmds = GenerateASS(); - if (oldasscmds != asscmds) - { - m_frame->UpdateASSCommandStringToSrcTxtCtrl(asscmds); - oldasscmds = asscmds; - } -} - -void ASSDrawCanvas::SetDrawMode( MODE mode ) -{ - draw_mode = mode; - - if (!selected_points.empty()) - ClearPointsSelection(); - - RefreshDisplay(); - - if (IsTransformMode()) - { - isshapetransformable = cmds.size() > 1; - - if (isshapetransformable) - { - - // backup cmds - backupcmds.free_all(); - for (DrawCmdList::iterator iterate = cmds.begin(); iterate != cmds.end(); iterate++) - { - DrawCmd* cmd = (*iterate); - for (PointList::iterator iterate2 = cmd->controlpoints.begin(); iterate2 != cmd->controlpoints.end(); iterate2++) - { - wxPoint pp = (*iterate2)->ToWxPoint(); - backupcmds.move_to(pp.x, pp.y); - } - wxPoint pp = (*iterate)->m_point->ToWxPoint(); - backupcmds.move_to(pp.x, pp.y); - } - - // calculate bounding rectangle - agg::trans_affine mtx; - trans_path *rm, *rb; - agg::conv_curve *rc; - ConstructPathsAndCurves(mtx, rm, rb, rc); - rasterizer.reset(); - rasterizer.add_path(*rc); - delete rm; - delete rb; - delete rc; - int minx = rasterizer.min_x(), miny = rasterizer.min_y(); - int maxx = rasterizer.max_x(), maxy = rasterizer.max_y(); - - rectbound[0] = wxRealPoint(minx, miny); - rectbound[1] = wxRealPoint(maxx, miny); - rectbound[2] = wxRealPoint(maxx, maxy); - rectbound[3] = wxRealPoint(minx, maxy); - for (int i = 0; i < 4; i++) - rectbound2[i] = rectbound[i]; - - rectbound2upd = -1; - rectbound2upd2 = -1; - - backupowner = NONE; - InitiateDraggingIfTransformMode(); - - if (maxx - minx < 5 || maxy - miny < 5) - isshapetransformable = false; - } - } - - RefreshUndocmds(); - m_frame->UpdateFrameUI(); - -} - -void ASSDrawCanvas::SetDragMode( DRAGMODE mode ) -{ - drag_mode = mode; -} - -bool ASSDrawCanvas::IsTransformMode() -{ - return draw_mode == MODE_NUT_BILINEAR || draw_mode == MODE_SCALEROTATE; -} - -bool ASSDrawCanvas::CanZoom() -{ - return !IsTransformMode() || !drag_mode.drawing; -} - -bool ASSDrawCanvas::CanMove() -{ - return !IsTransformMode() || dragAnchor_left == NULL; -} - -// Do the dragging -void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event) -{ - mouse_point = event.GetPosition(); - int xx, yy, wx, wy; - xx = mouse_point.x; yy = mouse_point.y; - pointsys->FromWxPoint ( mouse_point, wx, wy ); - if (event.Dragging()) - { - if (IsTransformMode() && isshapetransformable && backupowner == LEFT) - { - // update bounding polygon - if (rectbound2upd > -1) - { - if (!dragAnchor_left) dragAnchor_left = new wxPoint(mouse_point); - wxPoint diff = mouse_point - *dragAnchor_left; - wxRealPoint rdiff(diff.x, diff.y); - switch(draw_mode) - { - case MODE_NUT_BILINEAR: - if (rectbound2upd2 == -1) //only one vertex dragged - rectbound2[rectbound2upd].x = xx, rectbound2[rectbound2upd].y = yy; - else - { - rectbound2[rectbound2upd].x += diff.x, rectbound2[rectbound2upd].y += diff.y; - rectbound2[rectbound2upd2].x += diff.x, rectbound2[rectbound2upd2].y += diff.y; - } - undodesc = _T("Bilinear transform"); - *dragAnchor_left = mouse_point; - break; - case MODE_SCALEROTATE: - if (rectbound2upd2 == -1) //only one vertex dragged - { - int adjacent[2] = { (rectbound2upd + 3) % 4, (rectbound2upd + 1) % 4 }; - int opposite = (rectbound2upd + 2) % 4; - wxRealPoint newpoint = backup[rectbound2upd] + rdiff; - double nx, ny; - for (int i = 0; i < 2; i++) - { - bool isect = agg::calc_intersection( - backup[opposite].x, backup[opposite].y, - backup[adjacent[i]].x, backup[adjacent[i]].y, - newpoint.x, newpoint.y, - backup[adjacent[i]].x + diff.x, backup[adjacent[i]].y + diff.y, - &nx, &ny); - if (isect && !(fabs(nx - backup[opposite].x) < 10 && fabs(ny - backup[opposite].y) < 10)) - rectbound2[adjacent[i]] = wxRealPoint(nx, ny); - } - GetThe4thPoint(backup[opposite].x, backup[opposite].y, - rectbound2[adjacent[0]].x, rectbound2[adjacent[0]].y, - rectbound2[adjacent[1]].x, rectbound2[adjacent[1]].y, - &rectbound2[rectbound2upd].x, &rectbound2[rectbound2upd].y); - if (event.ShiftDown()) // shift down = maintain aspect ratio (damn so complicated) - { - // first create the guide points, which are basically backup points reoriented based on mouse position - wxRealPoint guide[4]; - guide[opposite] = backup[opposite]; - guide[adjacent[0]] = backup[adjacent[0]]; - guide[adjacent[1]] = backup[adjacent[1]]; - for (int i = 0; i < 2; i++) - { - if ((rectbound2[adjacent[i]].x < guide[opposite].x && guide[opposite].x < guide[adjacent[i]].x) - || (rectbound2[adjacent[i]].x > guide[opposite].x && guide[opposite].x > guide[adjacent[i]].x) - || (rectbound2[adjacent[i]].y < guide[opposite].y && guide[opposite].y < guide[adjacent[i]].y) - || (rectbound2[adjacent[i]].y > guide[opposite].y && guide[opposite].y > guide[adjacent[i]].y)) - { - guide[adjacent[i]] = guide[opposite] - (guide[adjacent[i]] - guide[opposite]); - } - } - guide[rectbound2upd] = guide[adjacent[0]] + (guide[adjacent[1]] - guide[opposite]); - // now we determine which rescaled sides have larger enlargement/shrinkage ratio .. - double ix[2], iy[2], dx[2], dy[2]; - for (int i = 0; i < 2; i++) - { - agg::calc_intersection(guide[opposite].x, guide[opposite].y, guide[rectbound2upd].x, guide[rectbound2upd].y, - rectbound2[rectbound2upd].x, rectbound2[rectbound2upd].y, - rectbound2[adjacent[i]].x, rectbound2[adjacent[i]].y, &ix[i], &iy[i]); - dx[i] = ix[i] - guide[opposite].x; - dy[i] = iy[i] - guide[opposite].y; - } - // .. and modify the other sides to follow the ratio - for (int i = 0; i < 2; i++) - { - int j = (i + 1) % 2; - if (fabs(dx[i]) > fabs(dx[j]) || fabs(dy[i]) > fabs(dy[j])) - { - rectbound2[rectbound2upd].x = ix[i]; - rectbound2[rectbound2upd].y = iy[i]; - GetThe4thPoint(rectbound2[adjacent[i]].x, rectbound2[adjacent[i]].y, - guide[opposite].x, guide[opposite].y, ix[i], iy[i], - &rectbound2[adjacent[j]].x, &rectbound2[adjacent[j]].y); - } - } - } - } - else // an edge dragged (i.e. move 2 vertices in sync) - { - // it is guaranteed that rectbound2upd and rectbound2upd2 are in clockwise direction - // from the way they are detected in OnMouseLeftDown() - int toupd[2] = { rectbound2upd, rectbound2upd2 }; - int adjacent[2] = { (rectbound2upd2 + 2) % 4, (rectbound2upd2 + 1) % 4 }; - wxRealPoint vertexone = backup[toupd[0]] + rdiff, vertextwo = backup[toupd[1]] + rdiff; - double nx, ny; - for (int i = 0; i < 2; i++) - { - agg::calc_intersection( - rectbound2[adjacent[i]].x, rectbound2[adjacent[i]].y, - backup[toupd[i]].x, backup[toupd[i]].y, - vertexone.x, vertexone.y, - vertextwo.x, vertextwo.y, - &nx, &ny); - if (!(fabs(nx - backup[adjacent[i]].x) < 10 && fabs(ny - backup[adjacent[i]].y) < 10)) - rectbound2[toupd[i]].x = (int) nx, rectbound2[toupd[i]].y = (int) ny; - } - } - UpdateTranformModeRectCenter(); - undodesc = _T("Scale"); - break; - } - - // update points - UpdateNonUniformTransformation(); - RefreshDisplay(); - } - } - else if (draw_mode != MODE_DEL) - { - - // point left-dragged - if (mousedownAt_point != NULL && mousedownAt_point->isselected) - { - if (!mousedownAt_point->IsAt( wx, wy )) - { - if (draw_mode == MODE_ARR) { - int movex = wx - mousedownAt_point->x(), movey = wy - mousedownAt_point->y(); - PointSet::iterator iter = selected_points.begin(); - for (; iter != selected_points.end(); iter++) - (*iter)->setXY( (*iter)->x() + movex, (*iter)->y() + movey ); - } - else - mousedownAt_point->setXY( wx, wy ); - - EnforceC1Continuity (mousedownAt_point->cmd_main, mousedownAt_point); - - RefreshDisplay(); - if (undodesc == _T("")) - { - if (mousedownAt_point->type == MP) - undodesc = _T("Drag point"); - else - undodesc = _T("Drag control point"); - } - } - } - // origin left-dragged - else if (dragOrigin) - { - if (wx != 0 || wy != 0) - { - wxPoint wxp = pointsys->ToWxPoint ( wx, wy ); - MovePoints(-wx, -wy); - pointsys->originx = wxp.x; - pointsys->originy = wxp.y; - RefreshDisplay(); - undodesc = _T("Move origin"); - } - } - else if (dragAnchor_left != NULL) - { - // handle left-dragging here - if (lastDrag_left && dragAnchor_left != lastDrag_left) - delete lastDrag_left; - lastDrag_left = new wxPoint(xx, yy); - int ax = dragAnchor_left->x, ay = dragAnchor_left->y; - int sx = lastDrag_left->x, sy = lastDrag_left->y; - int lx, rx, ty, by; - if (ax > sx) lx = sx, rx = ax; - else lx = ax, rx = sx; - if (ay > sy) ty = sy, by = ay; - else ty = ay, by = sy; - SelectPointsWithin( lx, rx, ty, by, GetSelectMode(event) ); - RefreshDisplay(); - } - } - - // right-dragged - if (dragAnchor_right != NULL) - { - if (draw_mode == MODE_SCALEROTATE) - { - if (backupowner == RIGHT) - { - double cx = rectcenter.x, cy = rectcenter.y; // center x,y - double diameter = sqrt(pow(rectbound2[0].x - rectbound2[2].x, 2) + pow(rectbound2[0].y - rectbound2[2].y, 2)); - double radius = diameter / 2; - double old_dx = dragAnchor_right->x - cx, old_dy = dragAnchor_right->y - cy; - double new_dx = mouse_point.x - cx, new_dy = mouse_point.y - cy; - double old_angle = atan2(old_dy, old_dx); - double new_angle = atan2(new_dy, new_dx); - double delta = new_angle - old_angle; - for (int i = 0; i < 4; i++) - { - old_dx = backup[i].x - cx, old_dy = backup[i].y - cy; - old_angle = atan2(old_dy, old_dx); - new_angle = old_angle + delta; - new_dx = radius * cos(new_angle), new_dy = radius * sin(new_angle); - rectbound2[i].x = (int)(new_dx + cx), rectbound2[i].y = (int)(new_dy + cy); - } - UpdateNonUniformTransformation(); - RefreshDisplay(); - undodesc = _T("Rotate"); - } - } - else if (CanMove()) - { - MoveCanvas(xx - dragAnchor_right->x, yy - dragAnchor_right->y); - dragAnchor_right->x = xx; - dragAnchor_right->y = yy; - RefreshDisplay(); - } - } - } - else if (!preview_mode)// not dragging and not preview mode - { - if (IsTransformMode()) - { - int oldrectbound = rectbound2upd; - rectbound2upd = -1; - rectbound2upd2 = -1; - for (int i = 0; i < 4; i++) - { - if (abs((int)rectbound2[i].x - mouse_point.x) <= pointsys->scale - && abs((int)rectbound2[i].y - mouse_point.y) <= pointsys->scale) - rectbound2upd = i; - } - for (int i = 0; rectbound2upd == -1 && i < 4; i++) - { - int j = (i+1) % 4; - wxRealPoint &pi = rectbound2[i], &pj = rectbound2[j]; - double dy = fabs(pj.y - pi.y); - double dy3 = dy / 3; - double dx = fabs(pj.x - pi.x); - double dx3 = dx / 3; - double ix, iy; - bool intersect = false; - if (dy > dx) - { - intersect = agg::calc_intersection( - pi.x, pi.y, pj.x, pj.y, - mouse_point.x - pointsys->scale, mouse_point.y, - mouse_point.x + pointsys->scale, mouse_point.y, &ix, &iy); - intersect &= fabs(mouse_point.x - ix) <= pointsys->scale; - intersect &= (pj.y > pi.y? - pj.y - dy3 > iy && iy > pi.y + dy3: - pj.y + dy3 < iy && iy < pi.y - dy3); - } - else - { - intersect = agg::calc_intersection( - pi.x, pi.y, pj.x, pj.y, - mouse_point.x, mouse_point.y - pointsys->scale, - mouse_point.x, mouse_point.y + pointsys->scale, &ix, &iy); - intersect &= fabs(mouse_point.y - iy) <= pointsys->scale; - intersect &= (pj.x > pi.x? - pj.x - dx3 > ix && ix > pi.x + dx3: - pj.x + dx3 < ix && ix < pi.x - dx3); - } - if (intersect) - { - rectbound2upd = i; - rectbound2upd2 = j; - } - } - if (rectbound2upd != -1 || oldrectbound != -1) - RefreshDisplay(); - } - else - { - /* figure out if the mouse is pointing at a point of a command - we need not do this for dragging since this same block has set - the related variables before the user starts to hold the button - (well, before you can drag something you have to move the pointer - over that thing first, right?) and we don't want to mess with those - when it's dragging - */ - - // check if mouse points on any control point first - Point* last_pointedAt_point = pointedAt_point; - ControlAt( wx, wy, pointedAt_point ); - - // then check if mouse points on any m_points - // override any control point set to pointedAt_point above - DrawCmd* p = PointAt( wx, wy ); - if (p != NULL) - { - pointedAt_point = p->m_point; - } - - if (pointedAt_point != last_pointedAt_point) - { - if (pointedAt_point != NULL) - SetHighlighted( pointedAt_point->cmd_main, pointedAt_point ); - else - SetHighlighted( NULL, NULL ); - RefreshDisplay(); - } - } - } // not dragging and preview mode = ignore all mouse movements - - // we are not done yet? - // oh yeah, we need to set the status bar just for fun - if (hasStatusBar) - { - m_frame->SetStatusText( - wxString::Format( _T("%5d %5d"), (int)wx, (int)wy ), 0 ); - if (pointedAt_point == NULL || - (newcommand != NULL && !newcommand->initialized) ) - m_frame->SetStatusText( _T(""), 1 ); - else - m_frame->SetStatusText( _T(" ") + pointedAt_point->cmd_main->ToString().Upper(), 1 ); - } - -} - -// End drag points -void ASSDrawCanvas::OnMouseLeftUp(wxMouseEvent& event) -{ - ProcessOnMouseLeftUp(); - event.Skip( true ); -} - -void ASSDrawCanvas::ProcessOnMouseLeftUp() -{ - if (!capturemouse_left) return; - - // draw mode - if (newcommand != NULL) - { - newcommand->Init(); - switch (newcommand->type) - { - case M: - undodesc = _T("Add a new M"); break; - case L: - undodesc = _T("Add a new L"); break; - case B: - undodesc = _T("Add a new B"); break; - } - newcommand = NULL; - // we need to manually refresh the GUI to draw the new control points - RefreshDisplay(); - } - else if ( draw_mode == MODE_DEL // if it's delete mode - && mousedownAt_point != NULL // and mouse down at a point - && mousedownAt_point == pointedAt_point ) // and released at the same point - { - // first take care of mouse readings - pointedAt_point = NULL; - Point *lastmousedownAt_point = mousedownAt_point; - mousedownAt_point = NULL; - - // try deleting - CMDTYPE t = lastmousedownAt_point->cmd_main->type; - if ( DeleteCommand( lastmousedownAt_point->cmd_main ) ) - { - ClearPointsSelection(); - SetHighlighted( NULL, NULL ); - RefreshDisplay(); - switch (t) - { - case M: - undodesc = _T("Delete a M"); break; - case L: - undodesc = _T("Delete a L"); break; - case B: - undodesc = _T("Delete a B"); break; - } - } - else - { - RefreshDisplay(); // redraw before showing the error box - wxMessageDialog msgb(m_frame, - _T("You must delete that command/point last"), - _T("Error"), wxOK | wxICON_EXCLAMATION ); - msgb.ShowModal(); - } - } - else if ( lastDrag_left && dragAnchor_left ) // point selection - { - if (lastDrag_left && dragAnchor_left != lastDrag_left) - delete lastDrag_left; - delete dragAnchor_left; - lastDrag_left = NULL; - dragAnchor_left = NULL; - } - - if (dragOrigin) - { - dragOrigin = false; - RefreshDisplay(); // clear the crosshair - } - - rectbound2upd = -1; - rectbound2upd2 = -1; - backupowner = NONE; - - if (!undodesc.IsSameAs(_T(""))) - { - AddUndo( undodesc ); - undodesc = _T(""); - RefreshUndocmds(); - } - - mousedownAt_point = NULL; - - if (HasCapture()) - ReleaseMouse(); - capturemouse_left = false; - - RefreshDisplay(); -} - -// Set up to drag points, if any -void ASSDrawCanvas::OnMouseLeftDown(wxMouseEvent& event) -{ - - // no drawing in preview mode - if (preview_mode) - return; - - wxPoint q = event.GetPosition(); - - // wxPoint to Point - int px, py; - pointsys->FromWxPoint(q, px, py); - - // create new cmd if in draw mode / or delete point if del tool selected - switch (draw_mode) - { - case MODE_M: - newcommand = NewCmd(M, px, py); - break; - case MODE_L: - newcommand = NewCmd(L, px, py); - break; - case MODE_B: - newcommand = NewCmd(B, px, py); - break; - } - - // continue working on the new command (if any) - // only if it is not mouse down on any control point - if (newcommand != NULL) - { - if (pointedAt_point != NULL && pointedAt_point->type == CP) - { - // oops, user clicked on a control point so cancel new command - // and let him drag the control point - delete newcommand; - newcommand = NULL; - } - else - { - // first set to drag the new command no matter what - mousedownAt_point = newcommand->m_point; - - // if user drags from existing point, insert the new command - // else append the new command - if (pointedAt_point != NULL) - InsertCmd( newcommand, pointedAt_point->cmd_main ); - else - { - if (cmds.empty() && newcommand->type != M) - AppendCmd( M, px, py ); - newcommand = AppendCmd( newcommand ); - } - - pointedAt_point = mousedownAt_point; - - //highlight it - SetHighlighted( newcommand, newcommand->m_point ); - } - } - - // we already calculated pointedAt_point in OnMouseMove() so just use it - mousedownAt_point = pointedAt_point; - SELECTMODE smode = GetSelectMode(event); - if (mousedownAt_point && !mousedownAt_point->isselected) - { - if (smode == NEW) - { - ClearPointsSelection(); - mousedownAt_point->isselected = true; - selected_points.insert(mousedownAt_point); - } - else - { - wxPoint wxp = mousedownAt_point->ToWxPoint(); - SelectPointsWithin(wxp.x, wxp.x, wxp.y, wxp.y, smode); - } - } - else if (!mousedownAt_point && smode == NEW) - ClearPointsSelection(); - - if ( mousedownAt_point == NULL && px == 0 && py == 0 ) - dragOrigin = true; - - if ( mousedownAt_point == NULL && !dragOrigin ) - { - dragAnchor_left = new wxPoint(q.x, q.y); - lastDrag_left = dragAnchor_left; - } - - if (InitiateDraggingIfTransformMode()) - backupowner = LEFT; - - CaptureMouse(); - capturemouse_left = true; - RefreshDisplay(); - - event.Skip( true ); -} - -// End drag the canvas -void ASSDrawCanvas::OnMouseRightUp(wxMouseEvent& event) -{ - ProcessOnMouseRightUp(); - event.Skip( true ); -} - -void ASSDrawCanvas::ProcessOnMouseRightUp() -{ - if (!capturemouse_right) return; - - if (lastDrag_right && dragAnchor_right != lastDrag_right) - delete lastDrag_right; - if (dragAnchor_right) - delete dragAnchor_right; - dragAnchor_right = NULL; - lastDrag_right = NULL; - - // don't crash the program - if (HasCapture()) - ReleaseMouse(); - capturemouse_right = false; - - rectbound2upd = -1; - rectbound2upd2 = -1; - backupowner = NONE; - - if (!undodesc.IsSameAs(_T(""))) - { - AddUndo( undodesc ); - undodesc = _T(""); - RefreshUndocmds(); - } - - RefreshDisplay(); - SetFocus(); -} - -// Set up to drag the canvas -void ASSDrawCanvas::OnMouseRightDown(wxMouseEvent &event) -{ - wxPoint q = event.GetPosition(); - dragAnchor_right = new wxPoint(q.x, q.y); - lastDrag_right = dragAnchor_right; - CaptureMouse(); - capturemouse_right = true; - - if (InitiateDraggingIfTransformMode()) - backupowner = RIGHT; - - event.Skip( true ); -} - -// Reset to point-and-drag mode -void ASSDrawCanvas::OnMouseRightDClick(wxMouseEvent& event) -{ - wxMenu* menu = new wxMenu(); - - if (pointedAt_point) - { - ProcessOnMouseLeftUp(); - ProcessOnMouseRightUp(); - dblclicked_point_right = pointedAt_point; - pointedAt_point = NULL; - wxMenuItem *cmdmenuitem = new wxMenuItem(menu, MENU_DUMMY, dblclicked_point_right->cmd_main->ToString()); -#ifdef __WINDOWS__ - wxFont f = cmdmenuitem->GetFont(); - f.SetWeight(wxFONTWEIGHT_BOLD); - cmdmenuitem->SetFont(f); -#endif - menu->Append(cmdmenuitem); - menu->Enable(MENU_DUMMY, false); - switch (dblclicked_point_right->cmd_main->type) - { - case L: - menu->Append(MENU_DRC_LNTOBEZ, _T("Convert to Bezier curve (B command)")); - break; - case B: - if (dblclicked_point_right->type != MP) break; - menu->AppendCheckItem(MENU_DRC_BEZTOLN, _T("Convert to line (L command)")); - if (dblclicked_point_right->cmd_next && dblclicked_point_right->cmd_next->type == B) - { - menu->AppendCheckItem(MENU_DRC_C1CONTBEZ, _T("Smooth connection")); - if (static_cast(dblclicked_point_right->cmd_main)->C1Cont) - menu->Check(MENU_DRC_C1CONTBEZ, true); - } - break; - } - - } - else - { - menu->Append(MENU_DRC_MOVE00, _T("Move [0,0] here")); - menu->AppendSeparator(); - menu->AppendRadioItem(MODE_ARR, _T("Mode: D&rag")); - menu->AppendRadioItem(MODE_M, _T("Mode: Draw &M")); - menu->AppendRadioItem(MODE_L, _T("Mode: Draw &L")); - menu->AppendRadioItem(MODE_B, _T("Mode: Draw &B")); - menu->AppendRadioItem(MODE_DEL, _T("Mode: &Delete")); - menu->Check(GetDrawMode(), true); - } - - if (menu->GetMenuItemCount() > 0) // only if there is menu item - { - SetHighlighted(NULL, NULL); - mousedownAt_point = NULL; - RefreshDisplay(); - PopupMenu(menu); - } - delete menu; - - event.Skip( true ); -} - -bool ASSDrawCanvas::InitiateDraggingIfTransformMode() -{ - if (IsTransformMode() && isshapetransformable && backupowner == NONE) - { - for (int i = 0; i < 4; i++) - backup[i] = rectbound2[i]; - UpdateTranformModeRectCenter(); - return true; - } - else - return false; -} - -void ASSDrawCanvas::UpdateTranformModeRectCenter() -{ - double cx, cy; - if (agg::calc_intersection(rectbound2[0].x, rectbound2[0].y, rectbound2[2].x, rectbound2[2].y, - rectbound2[1].x, rectbound2[1].y, rectbound2[3].x, rectbound2[3].y, &cx, &cy)) - { - rectcenter = wxRealPoint(cx, cy); - } -} - -bool ASSDrawCanvas::GetThe4thPoint(double ox, double oy, double a1x, double a1y, double a2x, double a2y, double *x, double *y) -{ - *x = a1x + a2x - ox; - *y = a1y + a2y - oy; - return true; -} - -// Mousewheel -void ASSDrawCanvas::OnMouseWheel(wxMouseEvent &event) -{ - double amount = event.GetWheelRotation() / event.GetWheelDelta(); - if (event.ControlDown()) amount /= 10.0; - bgimg.new_center = wxRealPoint(mouse_point.x, mouse_point.y); - ChangeZoomLevel( amount, mouse_point ); -} - -void ASSDrawCanvas::ChangeZoomLevelTo( double zoom, wxPoint bgzoomctr ) -{ - ChangeZoomLevel(zoom - pointsys->scale, bgzoomctr); -} - -void ASSDrawCanvas::ChangeZoomLevel( double amount, wxPoint bgzoomctr ) -{ - double old_scale = pointsys->scale; - if (CanZoom() && drag_mode.drawing) - ChangeDrawingZoomLevel( amount ); - - if (CanZoom() && drag_mode.bgimg) - if (drag_mode.drawing) - ChangeBackgroundZoomLevel(bgimg.scale * pointsys->scale / old_scale, wxRealPoint(pointsys->originx, pointsys->originy)); - else - ChangeBackgroundZoomLevel(bgimg.scale + amount / 10.0, wxRealPoint(bgzoomctr.x, bgzoomctr.y)); - - RefreshDisplay(); -} - -void ASSDrawCanvas::ChangeDrawingZoomLevel( double scrollamount ) -{ - if (!CanZoom()) return; - double zoom = pointsys->scale + scrollamount; - if (zoom <= 50.0) - { - if (zoom < 1.0) zoom = 1.0; - pointsys->scale = zoom; - } - - m_frame->UpdateFrameUI(); -} - -void ASSDrawCanvas::ChangeBackgroundZoomLevel(double zoom, wxRealPoint newcenter) -{ - bgimg.new_scale = zoom; - bgimg.new_center = newcenter; - if (bgimg.new_scale < 0.01) bgimg.new_scale = 0.01; - UpdateBackgroundImgScalePosition(); -} - -void ASSDrawCanvas::MoveCanvasOriginTo(double originx, double originy) -{ - MoveCanvas(originx - pointsys->originx, originy - pointsys->originy); -} - -void ASSDrawCanvas::MoveCanvas(double xamount, double yamount) -{ - if (CanMove() && drag_mode.drawing) - MoveCanvasDrawing(xamount, yamount); - if (CanMove() && drag_mode.bgimg) - MoveCanvasBackground(xamount, yamount); -} - -void ASSDrawCanvas::MoveCanvasDrawing(double xamount, double yamount) -{ - if (!CanMove()) return; - pointsys->originx += xamount; - pointsys->originy += yamount; - if (IsTransformMode()) - { - for (int i = 0; i < 4; i++) - { - rectbound[i].x += (int) xamount; - rectbound[i].y += (int) yamount; - rectbound2[i].x += (int) xamount; - rectbound2[i].y += (int) yamount; - } - unsigned vertices = backupcmds.total_vertices(); - double x, y; - for (int i = 0; i < vertices; i++) - { - backupcmds.vertex(i, &x, &y); - backupcmds.modify_vertex(i, x + xamount, y + yamount); - } - } -} - -void ASSDrawCanvas::MoveCanvasBackground(double xamount, double yamount) -{ - bgimg.new_disp.x += xamount; - bgimg.new_disp.y += yamount; - UpdateBackgroundImgScalePosition(); -} - -void ASSDrawCanvas::OnSelect_ConvertLineToBezier(wxCommandEvent&) -{ - if (!dblclicked_point_right) return; - AddUndo( _T("Convert Line to Bezier") ); - DrawCmd_B *newB = new DrawCmd_B(dblclicked_point_right->x(), dblclicked_point_right->y(), - pointsys, dblclicked_point_right->cmd_main); - InsertCmd ( newB, dblclicked_point_right->cmd_main ); - ClearPointsSelection(); - SetHighlighted(NULL, NULL); - DeleteCommand(dblclicked_point_right->cmd_main); - pointedAt_point = newB->m_point; - newB->Init(); - RefreshDisplay(); - RefreshUndocmds(); -} - -void ASSDrawCanvas::OnSelect_ConvertBezierToLine(wxCommandEvent&) -{ - if (!dblclicked_point_right) return; - AddUndo( _T("Convert Bezier to Line") ); - DrawCmd_L *newL = new DrawCmd_L(dblclicked_point_right->x(), dblclicked_point_right->y(), pointsys, dblclicked_point_right->cmd_main); - InsertCmd ( newL, dblclicked_point_right->cmd_main ); - ClearPointsSelection(); - SetHighlighted(NULL, NULL); - DeleteCommand(dblclicked_point_right->cmd_main); - pointedAt_point = newL->m_point; - newL->Init(); - RefreshDisplay(); - RefreshUndocmds(); -} - -void ASSDrawCanvas::OnSelect_C1ContinuityBezier(wxCommandEvent&) -{ - if (!dblclicked_point_right) return; - DrawCmd_B *cmdb = static_cast(dblclicked_point_right->cmd_main); - AddUndo( cmdb->C1Cont? _T("Unset continuous"):_T("Set continuous") ); - cmdb->C1Cont = !cmdb->C1Cont; - RefreshUndocmds(); -} - -void ASSDrawCanvas::OnSelect_Move00Here(wxCommandEvent&) -{ - AddUndo( _T("Move origin") ); - int wx, wy; - pointsys->FromWxPoint(mouse_point, wx, wy); - wxPoint wxp = pointsys->ToWxPoint(wx, wy); - pointsys->originx = wxp.x; - pointsys->originy = wxp.y; - MovePoints(-wx, -wy); - RefreshDisplay(); - RefreshUndocmds(); -} - -void ASSDrawCanvas::ConnectSubsequentCmds (DrawCmd* cmd1, DrawCmd* cmd2) -{ - ASSDrawEngine::ConnectSubsequentCmds(cmd1, cmd2); - if (cmd1 && cmd1->type == B) - { - DrawCmd_B *cmd1b = static_cast< DrawCmd_B* >(cmd1); - cmd1b->C1Cont = false; - } -} - -void ASSDrawCanvas::EnforceC1Continuity (DrawCmd* cmd, Point* pnt) -{ - if (!cmd || !pnt) return; - if (cmd->type != B && cmd->type != S) return; - if (pnt->type == MP) return; - Point *theotherpoint, *mainpoint; - if (pnt->num == 1) - { - if (!cmd->prev || (cmd->prev->type != B && cmd->prev->type != S)) return; - DrawCmd_B *prevb = static_cast< DrawCmd_B* >(cmd->prev); - if (!prevb->C1Cont) return; - PointList::iterator it = prevb->controlpoints.end(); - it--; - theotherpoint = *it; - mainpoint = prevb->m_point; - } - else if (pnt->num = cmd->controlpoints.size()) - { - DrawCmd_B *thisb = static_cast< DrawCmd_B* >(cmd); - if (!thisb->C1Cont) return; - theotherpoint = *(cmd->m_point->cmd_next->controlpoints.begin()); - mainpoint = thisb->m_point; - } - else - return; - theotherpoint->setXY( mainpoint->x() + mainpoint->x() - pnt->x(), - mainpoint->y() + mainpoint->y() - pnt->y() ); -} - -// Undo/Redo system -void ASSDrawCanvas::AddUndo( wxString desc ) -{ - PrepareUndoRedo(_undo, false, _T(""), desc); - undos.push_back( _undo ); - // also empty redos - redos.clear(); - m_frame->UpdateUndoRedoMenu(); -} - -bool ASSDrawCanvas::UndoOrRedo(bool isundo) -{ - std::list* main = (isundo? &undos:&redos); - std::list* sub = (isundo? &redos:&undos); - - if (main->empty()) - return false; - - UndoRedo r = main->back(); - // push into sub - UndoRedo nr(r); - PrepareUndoRedo(nr, true, GenerateASS(), r.desc); - sub->push_back( nr ); - // parse - r.Export(this); - // delete that - std::list::iterator iter = main->end(); - iter--; - main->erase(iter); - - // reset some values before refreshing - mousedownAt_point = NULL; - pointedAt_point = NULL; - SetHighlighted ( NULL, NULL ); - ClearPointsSelection(); - RefreshDisplay(); - RefreshUndocmds(); - return true; -} - -bool ASSDrawCanvas::Undo() -{ - return UndoOrRedo( true ); -} - -bool ASSDrawCanvas::Redo() -{ - return UndoOrRedo( false ); -} - -wxString ASSDrawCanvas::GetTopUndo() -{ - if (undos.empty()) - return _T(""); - else - return undos.back().desc; -} - -wxString ASSDrawCanvas::GetTopRedo() -{ - if (redos.empty()) - return _T(""); - else - return redos.back().desc; -} - -void ASSDrawCanvas::RefreshUndocmds() -{ - _undo.Import(this, true, GenerateASS()); -} - -void ASSDrawCanvas::PrepareUndoRedo(UndoRedo& ur, bool prestage, wxString cmds, wxString desc) -{ - ur.Import(this, prestage, cmds); - ur.desc = desc; -} - -// set command and point to highlight -void ASSDrawCanvas::SetHighlighted ( DrawCmd* cmd, Point* point ) -{ - hilite_cmd = cmd; - hilite_point = point; -} - -int ASSDrawCanvas::SelectPointsWithin( int lx, int rx, int ty, int by, SELECTMODE smode ) -{ - - DrawCmdList::iterator iterate = cmds.begin(); - for (; iterate != cmds.end(); iterate++) - { - wxPoint wx = (*iterate)->m_point->ToWxPoint(); - - if (wx.x >= lx && wx.x <= rx && wx.y >= ty && wx.y <= by) - (*iterate)->m_point->isselected = (smode != DEL); - else - (*iterate)->m_point->isselected &= (smode != NEW); - - if ((*iterate)->m_point->isselected) - selected_points.insert((*iterate)->m_point); - else - selected_points.erase((*iterate)->m_point); - - PointList::iterator pnt_iterator = (*iterate)->controlpoints.begin(); - PointList::iterator end = (*iterate)->controlpoints.end(); - for (; pnt_iterator != end; pnt_iterator++) - { - wxPoint wx = (*pnt_iterator)->ToWxPoint(); - - if (wx.x >= lx && wx.x <= rx && wx.y >= ty && wx.y <= by) - (*pnt_iterator)->isselected = (smode != DEL); - else - (*pnt_iterator)->isselected &= (smode != NEW); - - if ((*pnt_iterator)->isselected) - selected_points.insert(*pnt_iterator); - else - selected_points.erase(*pnt_iterator); - } - } - - return selected_points.size(); - -} - -void ASSDrawCanvas::ClearPointsSelection() -{ - if (!selected_points.empty()) - { - PointSet::iterator piter = selected_points.begin(); - for (; piter != selected_points.end(); piter++) - { - (*piter)->isselected = false; - } - selected_points.clear(); - } -} - -SELECTMODE ASSDrawCanvas::GetSelectMode(wxMouseEvent& event) -{ - SELECTMODE smode = NEW; - bool CtrlDown = event.CmdDown(); - bool AltDown = event.AltDown(); - if (CtrlDown && !AltDown) smode = ADD; - else if (!CtrlDown && AltDown) smode = DEL; - return smode; -} - -void ASSDrawCanvas::DoDraw( RendererBase& rbase, RendererPrimitives& rprim, RendererSolid& rsolid, agg::trans_affine& mtx ) -{ - ASSDrawEngine::Draw_Clear( rbase ); - int ww, hh; GetClientSize(&ww, &hh); - - if (bgimg.bgbmp) - { - rasterizer.reset(); - interpolator_type interpolator(bgimg.img_mtx); - PixelFormat::AGGType ipixfmt(bgimg.ibuf); - span_gen_type spangen(ipixfmt, agg::rgba_pre(0, 0, 0), interpolator); - agg::conv_transform< agg::path_storage > bg_border(bgimg.bg_path, bgimg.path_mtx); - agg::conv_clip_polygon< agg::conv_transform< agg::path_storage > > bg_clip(bg_border); - bg_clip.clip_box(0, 0, ww, hh); - rasterizer.add_path(bg_clip); - agg::render_scanlines_aa(rasterizer, scanline, rbase, bgimg.spanalloc, spangen); - } - - ASSDrawEngine::Draw_Draw( rbase, rprim, rsolid, mtx, preview_mode? rgba_shape:rgba_shape_normal ); - - if (!preview_mode) - { - // [0, 0] - rasterizer.reset(); - agg::path_storage org_path; - org_path.move_to(0, m_frame->sizes.origincross); - org_path.line_to(0, -m_frame->sizes.origincross); - org_path.move_to(m_frame->sizes.origincross, 0); - org_path.line_to(-m_frame->sizes.origincross, 0); - agg::conv_transform< agg::path_storage > org_path_t(org_path, mtx); - agg::conv_curve< agg::conv_transform< agg::path_storage > > crosshair(org_path_t); - agg::conv_stroke< agg::conv_curve< agg::conv_transform< agg::path_storage > > > chstroke(crosshair); - rasterizer.add_path(chstroke); - rsolid.color(rgba_origin); - render_scanlines(rsolid, false); - - if (IsTransformMode() && isshapetransformable) - { - if (draw_mode == MODE_SCALEROTATE) - { - // rotation centerpoint - rasterizer.reset(); - double len = 10.0; - org_path.free_all(); - org_path.move_to(rectcenter.x - len, rectcenter.y - len); - org_path.line_to(rectcenter.x + len, rectcenter.y + len); - org_path.move_to(rectcenter.x + len, rectcenter.y - len); - org_path.line_to(rectcenter.x - len, rectcenter.y + len); - agg::conv_stroke< agg::path_storage > cstroke(org_path); - rasterizer.add_path(cstroke); - agg::ellipse circ(rectcenter.x, rectcenter.y, len, len); - agg::conv_stroke< agg::ellipse > c(circ); - rasterizer.add_path(c); - rsolid.color(rgba_origin); - render_scanlines(rsolid, false); - } - - rasterizer.reset(); - agg::path_storage org_path; - org_path.move_to(rectbound2[0].x, rectbound2[0].y); - org_path.line_to(rectbound2[1].x, rectbound2[1].y); - org_path.line_to(rectbound2[2].x, rectbound2[2].y); - org_path.line_to(rectbound2[3].x, rectbound2[3].y); - org_path.line_to(rectbound2[0].x, rectbound2[0].y); - agg::conv_stroke chstroke(org_path); - chstroke.width(1); - rsolid.color(rgba_origin); - rasterizer.add_path(chstroke); - if (rectbound2upd != -1) - { - agg::ellipse circ(rectbound2[rectbound2upd].x, rectbound2[rectbound2upd].y, - pointsys->scale, pointsys->scale); - agg::conv_contour< agg::ellipse > c(circ); - rasterizer.add_path(c); - } - if (rectbound2upd2 != -1) - { - agg::ellipse circ(rectbound2[rectbound2upd2].x, rectbound2[rectbound2upd2].y, - pointsys->scale, pointsys->scale); - agg::conv_contour< agg::ellipse > c(circ); - rasterizer.add_path(c); - } - render_scanlines(rsolid, false); - } - else - { - // outlines - agg::conv_stroke< agg::conv_transform< agg::path_storage > > bguidestroke(*rb_path); - bguidestroke.width(1); - rsolid.color(rgba_guideline); - rasterizer.add_path(bguidestroke); - render_scanlines(rsolid); - - agg::conv_stroke< agg::conv_curve< agg::conv_transform< agg::path_storage > > > stroke(*rm_curve); - stroke.width(1); - rsolid.color(rgba_outline); - rasterizer.add_path(stroke); - render_scanlines(rsolid); - - double diameter = pointsys->scale; - double radius = diameter / 2.0; - // hilite - if (hilite_cmd && hilite_cmd->type != M) - { - rasterizer.reset(); - agg::path_storage h_path; - AddDrawCmdToAGGPathStorage(hilite_cmd, h_path, HILITE); - agg::conv_transform< agg::path_storage> h_path_trans(h_path, mtx); - agg::conv_curve< agg::conv_transform< agg::path_storage> > curve(h_path_trans); - agg::conv_dash< agg::conv_curve< agg::conv_transform< agg::path_storage > > > d(curve); - d.add_dash(10,5); - agg::conv_stroke< agg::conv_dash< agg::conv_curve< agg::conv_transform< agg::path_storage > > > > stroke(d); - stroke.width(3); - rsolid.color(rgba_outline); - rasterizer.add_path(stroke); - render_scanlines(rsolid); - } - - // m_point - rasterizer.reset(); - DrawCmdList::iterator ci = cmds.begin(); - while (ci != cmds.end()) - { - double lx = (*ci)->m_point->x() * pointsys->scale + pointsys->originx - radius; - double ty = (*ci)->m_point->y() * pointsys->scale + pointsys->originy - radius; - agg::path_storage sqp = agghelper::RectanglePath(lx, lx + diameter, ty, ty + diameter); - agg::conv_contour< agg::path_storage > c(sqp); - rasterizer.add_path(c); - ci++; - } - render_scanlines_aa_solid(rbase, rgba_mainpoint); - - // control_points - rasterizer.reset(); - ci = cmds.begin(); - while (ci != cmds.end()) - { - PointList::iterator pi = (*ci)->controlpoints.begin(); - while (pi != (*ci)->controlpoints.end()) - { - agg::ellipse circ((*pi)->x() * pointsys->scale + pointsys->originx, - (*pi)->y() * pointsys->scale + pointsys->originy, radius, radius); - agg::conv_contour< agg::ellipse > c(circ); - rasterizer.add_path(c); - pi++; - } - ci++; - } - render_scanlines_aa_solid(rbase, rgba_controlpoint); - - // selection - rasterizer.reset(); - PointSet::iterator si = selected_points.begin(); - while (si != selected_points.end()) - { - agg::ellipse circ((*si)->x() * pointsys->scale + pointsys->originx, - (*si)->y() * pointsys->scale + pointsys->originy, radius + 3, radius + 3); - agg::conv_stroke< agg::ellipse > s(circ); - rasterizer.add_path(s); - si++; - } - render_scanlines_aa_solid(rbase, rgba_selectpoint); - - // hover - if (hilite_point) - { - rasterizer.reset(); - agg::ellipse circ(hilite_point->x() * pointsys->scale + pointsys->originx, - hilite_point->y() * pointsys->scale + pointsys->originy, radius + 3, radius + 3); - agg::conv_stroke< agg::ellipse > s(circ); - s.width(2); - rasterizer.add_path(s); - render_scanlines_aa_solid(rbase, rgba_selectpoint); - - rasterizer.reset(); - agg::gsv_text t; - t.flip(true); - t.size(8.0); - wxPoint pxy = hilite_point->ToWxPoint(true); - t.start_point(pxy.x + 5, pxy.y -5 ); - t.text(wxString::Format(_T("%d,%d"), hilite_point->x(), hilite_point->y()).mb_str(wxConvUTF8)); - agg::conv_stroke< agg::gsv_text > pt(t); - pt.line_cap(agg::round_cap); - pt.line_join(agg::round_join); - pt.width(1.5); - rasterizer.add_path(pt); - rsolid.color(agg::rgba(0,0,0)); - render_scanlines(rsolid, false); - - rasterizer.reset(); - agg::path_storage sb_path; - sb_path.move_to(pxy.x, 0); - sb_path.line_to(pxy.x, hh); - sb_path.move_to(0, pxy.y); - sb_path.line_to(ww, pxy.y); - agg::conv_curve< agg::path_storage > curve(sb_path); - agg::conv_dash< agg::conv_curve< agg::path_storage > > d(curve); - d.add_dash(10,5); - agg::conv_stroke< agg::conv_dash< agg::conv_curve< agg::path_storage > > > stroke(d); - stroke.width(1); - rsolid.color(agg::rgba(0,0,0,0.5)); - rasterizer.add_path(stroke); - render_scanlines(rsolid); - } - - // selection box - if (lastDrag_left) - { - double x1 = lastDrag_left->x, y1 = lastDrag_left->y; - double x2 = dragAnchor_left->x, y2 = dragAnchor_left->y; - double lx, rx, ty, by; - if (x1 < x2) lx = x1, rx = x2; - else lx = x2, rx = x1; - if (y1 < y2) ty = y1, by = y2; - else ty = y2, by = y1; - rasterizer.reset(); - agg::path_storage sb_path = agghelper::RectanglePath(lx, rx, ty, by); - agg::conv_curve< agg::path_storage > curve(sb_path); - agg::conv_dash< agg::conv_curve< agg::path_storage > > d(curve); - d.add_dash(10,5); - agg::conv_stroke< agg::conv_dash< agg::conv_curve< agg::path_storage > > > stroke(d); - stroke.width(1.0); - rsolid.color(agg::rgba(0,0,0,0.5)); - rasterizer.add_path(stroke); - render_scanlines(rsolid); - } - } - } - - // ruler - int w, h; - GetClientSize( &w, &h ); - double scale = pointsys->scale; - double coeff = 9 / scale + 1; - int numdist = (int) floor(coeff) * 5; - { - rsolid.color(rgba_ruler_h); - rasterizer.reset(); - agg::path_storage rlr_path; - double start = pointsys->originx; - int t = - (int) floor(start / scale); - double s = (start + t * scale); - double collect = s; - int len; - - for (; s <= w; s += scale) - { - bool longtick = t % numdist == 0; - if (longtick) - { - len = 10; - agg::gsv_text txt; - txt.flip(true); - txt.size(6.0); - txt.start_point(s, 20); - txt.text(wxString::Format(_T("%d"), t).mb_str(wxConvUTF8)); - agg::conv_stroke< agg::gsv_text > pt(txt); - rasterizer.add_path(pt); - } - else - len = 5; - t++ ; - collect += scale; - if (collect > 5.0) - { - collect = 0.0; - rlr_path.move_to(s, 0); - rlr_path.line_to(s, len); - } - } - agg::conv_stroke< agg::path_storage > rlr_stroke(rlr_path); - rlr_stroke.width(1); - rasterizer.add_path(rlr_stroke); - render_scanlines(rsolid, false); - } - { - rasterizer.reset(); - rsolid.color(rgba_ruler_v); - agg::path_storage rlr_path; - double start = pointsys->originy; - int t = - (int) floor(start / scale); - double s = (start + t * scale); - double collect = 0; - int len; - - for (; s <= h; s += scale) - { - bool longtick = t % numdist == 0; - if (longtick) - { - len = 10; - agg::gsv_text txt; - txt.flip(true); - txt.size(6.0); - txt.start_point(12, s); - txt.text(wxString::Format(_T("%d"), t).mb_str(wxConvUTF8)); - agg::conv_stroke< agg::gsv_text > pt(txt); - rasterizer.add_path(pt); - } - else - len = 5; - t++ ; - collect += scale; - if (collect > 5.0) - { - collect = 0.0; - rlr_path.move_to(0, s); - rlr_path.line_to(len, s); - } - } - agg::conv_stroke< agg::path_storage > rlr_stroke(rlr_path); - rlr_stroke.width(1); - rasterizer.add_path(rlr_stroke); - render_scanlines(rsolid, false); - } - -} - -void ASSDrawCanvas::ReceiveBackgroundImageFileDropEvent(const wxString& filename) -{ - const wxChar *shortfname = wxFileName::FileName(filename).GetFullName().c_str(); - m_frame->SetStatusText(wxString::Format(_T("Loading '%s' as canvas background ..."), shortfname), 1); - wxImage img; - img.LoadFile(filename); - if (img.IsOk()) - { - SetBackgroundImage(img, filename); - } - m_frame->SetStatusText(_T("Canvas background loaded"), 1); -} - -void ASSDrawCanvas::RemoveBackgroundImage() -{ - if (bgimg.bgimg) delete bgimg.bgimg; - bgimg.bgimg = NULL; - if (bgimg.bgbmp) delete bgimg.bgbmp; - bgimg.bgbmp = NULL; - bgimg.bgimgfile = _T(""); - RefreshDisplay(); - drag_mode = DRAGMODE(); - bgimg.alpha_dlg->Show(false); - m_frame->UpdateFrameUI(); -} - -void ASSDrawCanvas::SetBackgroundImage(const wxImage& img, wxString fname, bool ask4alpha) -{ - if (bgimg.bgimg) delete bgimg.bgimg; - bgimg.bgimg = new wxImage(img); - bgimg.bgimgfile = fname; - PrepareBackgroundBitmap(bgimg.alpha); - UpdateBackgroundImgScalePosition(true); - RefreshDisplay(); - m_frame->UpdateFrameUI(); - if (ask4alpha && m_frame->behaviors.autoaskimgopac) - AskUserForBackgroundAlpha(); -} - -void ASSDrawCanvas::AskUserForBackgroundAlpha() -{ - bgimg.alpha_slider->SetValue((int) (100 - bgimg.alpha * 100)); - bgimg.alpha_dlg->Show(); - SetFocus(); -} - -void ASSDrawCanvas::PrepareBackgroundBitmap(double alpha) -{ - if (alpha >= 0.0 && alpha <= 1.0) bgimg.alpha = alpha; - if (bgimg.bgimg == NULL) return; - if (bgimg.bgbmp) delete bgimg.bgbmp; - bgimg.bgbmp = new wxBitmap(*bgimg.bgimg); - PixelData data(*bgimg.bgbmp); - wxAlphaPixelFormat::ChannelType* pd = (wxAlphaPixelFormat::ChannelType*) &data.GetPixels().Data(); - const int stride = data.GetRowStride(); - if (stride < 0) - pd += (data.GetHeight() - 1) * stride; - bgimg.ibuf.attach(pd, data.GetWidth(), data.GetHeight(), stride); - - // apply alpha - rasterizer.reset(); - unsigned w = bgimg.bgbmp->GetWidth(), h = bgimg.bgbmp->GetHeight(); - bgimg.bg_path = agghelper::RectanglePath(0, w, 0, h); - agg::conv_contour< agg::path_storage > cont(bgimg.bg_path); - rasterizer.add_path(cont); - PixelFormat::AGGType pxt(bgimg.ibuf); - RendererBase rpxt(pxt); - agg::render_scanlines_aa_solid(rasterizer, scanline, rpxt, agg::rgba(color_bg.r / 255.0, color_bg.g / 255.0, color_bg.b / 255.0, bgimg.alpha)); -} - -void ASSDrawCanvas::UpdateBackgroundImgScalePosition(bool firsttime) -{ - if (bgimg.bgbmp == NULL) return; - // transform the enclosing polygon - unsigned w = bgimg.bgbmp->GetWidth(), h = bgimg.bgbmp->GetHeight(); - bgimg.bg_path = agghelper::RectanglePath(0, w, 0, h); - // linear interpolation on image buffer - wxRealPoint center, disp; - double scale; - if (firsttime) // first time - { - bgimg.img_mtx = agg::trans_affine(); - scale = 1.0; - center = wxRealPoint(0.0, 0.0); - disp = wxRealPoint(0.0, 0.0); - bgimg.path_mtx = bgimg.img_mtx; - } - else - { - wxRealPoint d_disp(bgimg.new_disp.x - bgimg.disp.x, bgimg.new_disp.y - bgimg.disp.y); - scale = bgimg.new_scale; - disp = bgimg.disp; - center = bgimg.new_center; - if (bgimg.scale == scale) - { - bgimg.img_mtx.invert(); - bgimg.img_mtx *= agg::trans_affine_translation(d_disp.x, d_disp.y); - d_disp.x /= scale; - d_disp.y /= scale; - } - else - { - d_disp.x /= scale; - d_disp.y /= scale; - bgimg.img_mtx = agg::trans_affine(); - disp.x += (center.x - bgimg.center.x) * (1.0 - 1.0 / bgimg.scale); - disp.y += (center.y - bgimg.center.y) * (1.0 - 1.0 / bgimg.scale); - bgimg.img_mtx *= agg::trans_affine_translation(-center.x + disp.x, -center.y + disp.y); - bgimg.img_mtx *= agg::trans_affine_scaling(scale); - bgimg.img_mtx *= agg::trans_affine_translation(center.x + d_disp.x, center.y + d_disp.y); - } - bgimg.path_mtx = bgimg.img_mtx; - bgimg.img_mtx.invert(); - disp.x += d_disp.x; - disp.y += d_disp.y; - } - //update - bgimg.scale = scale; - bgimg.center = center; - bgimg.disp = disp; - bgimg.new_scale = scale; - bgimg.new_center = center; - bgimg.new_disp = disp; -} - -bool ASSDrawCanvas::GetBackgroundInfo(unsigned& w, unsigned& h, wxRealPoint& disp, double& scale) -{ - if (!HasBackgroundImage()) return false; - w = bgimg.bgbmp->GetWidth(), h = bgimg.bgbmp->GetHeight(); - double t, l; - agg::conv_transform trr(bgimg.bg_path, bgimg.path_mtx); - trr.rewind(0); - trr.vertex(&l, &t); - disp = wxRealPoint(l, t); - scale = bgimg.scale; - return true; -} - -void ASSDrawCanvas::UpdateNonUniformTransformation() -{ - double bound[8] = { - rectbound2[0].x, rectbound2[0].y, - rectbound2[1].x, rectbound2[1].y, - rectbound2[2].x, rectbound2[2].y, - rectbound2[3].x, rectbound2[3].y }; - agg::path_storage trans; - unsigned vertices = backupcmds.total_vertices(); - - agg::trans_bilinear trans_b(rectbound[0].x, rectbound[0].y, rectbound[2].x, rectbound[2].y, bound); - agg::conv_transform transb(backupcmds, trans_b); - transb.rewind(0); - for (int i = 0; i < vertices; i++) - { - double x, y; - transb.vertex(&x, &y); - trans.move_to(x, y); - } - - trans.rewind(0); - for (DrawCmdList::iterator iterate = cmds.begin(); iterate != cmds.end(); iterate++) - { - DrawCmd* cmd = (*iterate); - for (PointList::iterator iterate2 = cmd->controlpoints.begin(); iterate2 != cmd->controlpoints.end(); iterate2++) - { - double x, y; - trans.vertex(&x, &y); - int wx, wy; - pointsys->FromWxPoint ( wxPoint((int)x, (int)y), wx, wy ); - (*iterate2)->setXY(wx, wy); - } - double x, y; - trans.vertex(&x, &y); - int wx, wy; - pointsys->FromWxPoint ( wxPoint((int)x, (int)y), wx, wy ); - (*iterate)->m_point->setXY(wx, wy); - } - -} - -void ASSDrawCanvas::CustomOnKeyDown(wxKeyEvent &event) -{ - int keycode = event.GetKeyCode(); - double scrollamount = (event.GetModifiers() == wxMOD_CMD? 10.0:1.0); - if (event.GetModifiers() == wxMOD_SHIFT) - { - MODE d_mode = GetDrawMode(); - if ((int) d_mode > (int) MODE_ARR && (int) d_mode < (int) MODE_SCALEROTATE) - { - mode_b4_shift = d_mode; - SetDrawMode( MODE_ARR ); - m_frame->UpdateFrameUI(); - } - } - else - { - switch (keycode) - { - case WXK_PAGEUP: - ChangeZoomLevel( 1.0 /scrollamount, wxPoint( (int) pointsys->originx, (int) pointsys->originy ) ); - RefreshDisplay(); - break; - case WXK_PAGEDOWN: - ChangeZoomLevel( - 1.0 /scrollamount, wxPoint( (int) pointsys->originx, (int) pointsys->originy ) ); - RefreshDisplay(); - break; - case WXK_UP: - MoveCanvas(0.0, -scrollamount); - RefreshDisplay(); - break; - case WXK_DOWN: - MoveCanvas(0.0, scrollamount); - RefreshDisplay(); - break; - case WXK_LEFT: - MoveCanvas(-scrollamount, 0.0); - RefreshDisplay(); - break; - case WXK_RIGHT: - MoveCanvas(scrollamount, 0.0); - RefreshDisplay(); - break; - case WXK_TAB: - if (mousedownAt_point == NULL && !IsTransformMode() && cmds.size() > 0) - { - if (pointedAt_point == NULL) - { - Point *nearest = NULL; - double dist = 0.0; - DrawCmdList::iterator it = cmds.begin(); - while(it != cmds.end()) - { - wxPoint point = (*it)->m_point->ToWxPoint(); - double distance = sqrt(pow(double(point.x - mouse_point.x), 2) + pow(double(point.y - mouse_point.y), 2)); - if (nearest == NULL || distance < dist) - { - nearest = (*it)->m_point; - dist = distance; - } - PointList::iterator it2 = (*it)->controlpoints.begin(); - while (it2 != (*it)->controlpoints.end()) - { - wxPoint point = (*it2)->ToWxPoint(); - double distance = sqrt(pow((double)point.x - mouse_point.x, 2) + pow((double)point.y - mouse_point.y, 2)); - if (nearest == NULL || distance < dist) - { - nearest = (*it2); - dist = distance; - } - it2++; - } - it++; - } - if (nearest != NULL) - { - wxPoint point = nearest->ToWxPoint(); - WarpPointer(point.x, point.y); - } - } - else - { - Point *warpto = NULL; - if (pointedAt_point->type == MP && pointedAt_point->cmd_next) - if (pointedAt_point->cmd_next->controlpoints.size() > 0) - warpto = pointedAt_point->cmd_next->controlpoints.front(); - else - warpto = pointedAt_point->cmd_next->m_point; - } - else - { - PointList::iterator it = pointedAt_point->cmd_main->controlpoints.begin(); - while (*it != pointedAt_point) it++; - it++; - if (it == pointedAt_point->cmd_main->controlpoints.end()) - warpto = pointedAt_point->cmd_main->m_point; - else - warpto = *it; - } - if (warpto == NULL) - warpto = cmds.front()->m_point; - wxPoint point = warpto->ToWxPoint(); - WarpPointer(point.x, point.y); - } - } - break; - default: - event.Skip(); - } - } -} - -void ASSDrawCanvas::CustomOnKeyUp(wxKeyEvent &event) -{ - if (event.GetModifiers() != wxMOD_SHIFT && (int) mode_b4_shift > (int) MODE_ARR) - { - SetDrawMode( mode_b4_shift ); - m_frame->UpdateFrameUI(); - mode_b4_shift = MODE_ARR; - } -} - -void ASSDrawCanvas::OnAlphaSliderChanged(wxScrollEvent &event) -{ - double pos = (double) event.GetPosition(); - PrepareBackgroundBitmap(1.0 - pos / 100.0); - RefreshDisplay(); -} - -void ASSDrawCanvas::CustomOnMouseCaptureLost(wxMouseCaptureLostEvent &) -{ - if (capturemouse_left) - ProcessOnMouseLeftUp(); - - if (capturemouse_right) - ProcessOnMouseRightUp(); -} - -void UndoRedo::Import(ASSDrawCanvas *canvas, bool prestage, wxString cmds) -{ - if (prestage) - { - this->cmds = cmds; - this->backupcmds.free_all(); - this->backupcmds.concat_path(canvas->backupcmds); - for (int i = 0; i < 4; i++) - { - this->rectbound[i] = canvas->rectbound[i]; - this->rectbound2[i] = canvas->rectbound2[i]; - this->backup[i] = canvas->backup[i]; - } - this->isshapetransformable = canvas->isshapetransformable; - } - else - { - this->originx = canvas->pointsys->originx; - this->originy = canvas->pointsys->originy; - this->scale = canvas->pointsys->scale; - - this->bgimgfile = canvas->bgimg.bgimgfile; - this->bgdisp = canvas->bgimg.disp; - this->bgcenter = canvas->bgimg.center; - this->bgscale = canvas->bgimg.scale; - this->bgalpha = canvas->bgimg.alpha; - this->c1cont = canvas->PrepareC1ContData(); - this->draw_mode = canvas->draw_mode; - } -} - -void UndoRedo::Export(ASSDrawCanvas *canvas) -{ - canvas->pointsys->originx = this->originx; - canvas->pointsys->originy = this->originy; - canvas->pointsys->scale = this->scale; - canvas->ParseASS( this->cmds ); - DrawCmdList::iterator it1 = canvas->cmds.begin(); - std::vector< bool >::iterator it2 = this->c1cont.begin(); - for(; it1 != canvas->cmds.end() && it2 != this->c1cont.end(); it1++, it2++) - if (*it2 && (*it1)->type == B) - static_cast(*it1)->C1Cont = true; - - if (canvas->bgimg.bgimgfile != this->bgimgfile) - { - canvas->RemoveBackgroundImage(); - if (!this->bgimgfile.IsSameAs(_T("")) && ::wxFileExists(this->bgimgfile)) - { - canvas->bgimg.alpha = this->bgalpha; - canvas->ReceiveBackgroundImageFileDropEvent(this->bgimgfile); - } - } - else - { - canvas->bgimg.new_scale = this->bgscale; - canvas->bgimg.new_center = this->bgcenter; - canvas->bgimg.new_disp = this->bgdisp; - canvas->bgimg.alpha = this->bgalpha; - canvas->UpdateBackgroundImgScalePosition(); - } - - canvas->draw_mode = this->draw_mode; - if (canvas->IsTransformMode()) - { - canvas->backupcmds.free_all(); - canvas->backupcmds.concat_path(this->backupcmds); - for (int i = 0; i < 4; i++) - { - canvas->rectbound[i] = this->rectbound[i]; - canvas->rectbound2[i] = this->rectbound2[i]; - canvas->backup[i] = this->backup[i]; - } - canvas->UpdateNonUniformTransformation(); - canvas->InitiateDraggingIfTransformMode(); - canvas->rectbound2upd = -1; - canvas->rectbound2upd2 = -1; - canvas->isshapetransformable = this->isshapetransformable; - } -} diff --git a/contrib/assdraw/src/canvas.hpp b/contrib/assdraw/src/canvas.hpp deleted file mode 100644 index aee896ee2..000000000 --- a/contrib/assdraw/src/canvas.hpp +++ /dev/null @@ -1,304 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: canvas.hpp -// Purpose: header file for ASSDraw main canvas class -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include - -#include "engine.hpp" -#include "enums.hpp" - -#include -#include -#include - -#include "agg_span_allocator.h" -#include "agg_span_interpolator_linear.h" -#include "agg_span_image_filter_rgb.h" -#include "agg_span_image_filter_rgba.h" -#include "agg_image_accessors.h" -#include "agg_conv_clip_polygon.h" - -class ASSDrawFrame; -class ASSDrawCanvas; - -struct UndoRedo -{ - wxString cmds; - wxString desc; - double originx, originy, scale; - - std::vector< bool > c1cont; - wxString bgimgfile; - wxRealPoint bgdisp, bgcenter; - double bgscale, bgalpha; - - MODE draw_mode; - agg::path_storage backupcmds; - wxRealPoint rectbound[4], rectbound2[4], backup[4]; - bool isshapetransformable; - - void Import(ASSDrawCanvas *canvas, bool prestage, wxString cmds = _T("")); - void Export(ASSDrawCanvas *canvas); - -}; - -// for multiple point selection -enum SELECTMODE { NEW, ADD, DEL }; - -class ASSDrawCanvas: public ASSDrawEngine, public wxClientData -{ -public: - ASSDrawCanvas( wxWindow *parent, ASSDrawFrame *frame, int extraflags = 0 ); - - // destructor - ~ASSDrawCanvas(); - - virtual void ResetEngine(bool addM); - virtual void SetPreviewMode( bool mode ); - virtual bool IsPreviewMode() { return preview_mode; } - virtual void ParseASS(wxString str, bool addundo = false); - - virtual void SetDrawMode( MODE mode ); - virtual MODE GetDrawMode() { return draw_mode; } - virtual bool IsTransformMode(); - virtual void SetDragMode( DRAGMODE mode ); - virtual DRAGMODE GetDragMode() { return drag_mode; } - virtual void RefreshDisplay(); - virtual bool CanZoom(); - virtual bool CanMove(); - - virtual void OnMouseMove(wxMouseEvent &event); - virtual void OnMouseLeftUp(wxMouseEvent &event); - virtual void OnMouseLeftDown(wxMouseEvent &event); - virtual void OnMouseRightUp(wxMouseEvent &event); - virtual void OnMouseRightDown(wxMouseEvent &event); - virtual void OnMouseRightDClick(wxMouseEvent &event); - virtual void OnMouseWheel(wxMouseEvent &event); - virtual void CustomOnKeyDown(wxKeyEvent &event); - virtual void CustomOnKeyUp(wxKeyEvent &event); - virtual void ChangeZoomLevel(double zoomamount, wxPoint bgzoomctr); - virtual void ChangeZoomLevelTo(double zoom, wxPoint bgzoomctr); - virtual void ChangeDrawingZoomLevel(double zoom); - virtual void ChangeBackgroundZoomLevel(double zoom, wxRealPoint newcenter); - virtual void MoveCanvas(double xamount, double yamount); - virtual void MoveCanvasOriginTo(double originx, double originy); - virtual void MoveCanvasDrawing(double xamount, double yamount); - virtual void MoveCanvasBackground(double xamount, double yamount); - virtual void OnSelect_ConvertLineToBezier(wxCommandEvent& WXUNUSED(event)); - virtual void OnSelect_ConvertBezierToLine(wxCommandEvent& WXUNUSED(event)); - virtual void OnSelect_C1ContinuityBezier(wxCommandEvent& WXUNUSED(event)); - virtual void OnSelect_Move00Here(wxCommandEvent& WXUNUSED(event)); - void OnAlphaSliderChanged(wxScrollEvent &event); - - // to replace _PointSystem() that has been made protected - double GetScale() { return pointsys->scale; } - double GetOriginX() { return pointsys->originx; } - double GetOriginY() { return pointsys->originy; } - - // undo/redo system - virtual void AddUndo( wxString desc ); - virtual bool UndoOrRedo(bool isundo); - virtual bool Undo(); - virtual bool Redo(); - virtual wxString GetTopUndo(); - virtual wxString GetTopRedo(); - virtual void RefreshUndocmds(); - - virtual bool HasBackgroundImage() { return bgimg.bgimg != NULL; } - virtual void RemoveBackgroundImage(); - virtual void ReceiveBackgroundImageFileDropEvent(const wxString& filename); - virtual void SetBackgroundImage(const wxImage& img, wxString fname = _T(""), bool ask4alpha = true); - virtual void PrepareBackgroundBitmap(double alpha); - virtual void AskUserForBackgroundAlpha(); - virtual bool GetBackgroundInfo(unsigned& w, unsigned& h, wxRealPoint& disp, double& scale); - - agg::rgba rgba_shape_normal, rgba_outline, rgba_guideline; - agg::rgba rgba_mainpoint, rgba_controlpoint, rgba_selectpoint; - agg::rgba rgba_origin, rgba_ruler_h, rgba_ruler_v; - -protected: - - typedef PixelFormat::AGGType::color_type color_type; - typedef agg::span_interpolator_linear<> interpolator_type; - typedef agg::span_image_filter_rgb_bilinear_clip span_gen_type; - - // The GUI window - ASSDrawFrame* m_frame; - - // highlight mechanism - DrawCmd* hilite_cmd; - Point* hilite_point; - - // mouse capture - bool capturemouse_left, capturemouse_right; - virtual void CustomOnMouseCaptureLost(wxMouseCaptureLostEvent &event); - virtual void ProcessOnMouseLeftUp(); - virtual void ProcessOnMouseRightUp(); - - // selection mechanism - PointSet selected_points; - - // if it has status bar - bool hasStatusBar; - - // some mouse readings - Point* mousedownAt_point; - Point* pointedAt_point; - Point* dblclicked_point_right; - wxPoint mouse_point; - - // The wxPoint being dragged by left button - wxPoint* dragAnchor_left; - wxPoint* lastDrag_left; - - // The wxPoint being dragged by right button - wxPoint* dragAnchor_right; - wxPoint* lastDrag_right; - - // true if the drawing origin (0, 0) is being dragged - bool dragOrigin; - - // The newest command being initialized thru dragging action - DrawCmd* newcommand; - - // the draw mode - MODE draw_mode; - DRAGMODE drag_mode; - - // holding shift key temporarily switches to drag mode (MODE_ARR) - // so we want to save the mode before the key-down to restore it on key-up - MODE mode_b4_shift; - - // true if preview mode (i.e don't draw anything except the shape itself; - // also draw the shape as closed) - bool preview_mode; - - // background image! - struct - { - agg::rendering_buffer ibuf; - wxImage *bgimg; - wxBitmap *bgbmp; - wxString bgimgfile; - agg::path_storage bg_path; - agg::span_allocator spanalloc; - //span_gen_type spangen; - agg::trans_affine img_mtx, path_mtx; - - wxRealPoint disp, center, new_disp, new_center; - double scale, new_scale, alpha; - wxDialog* alpha_dlg; - wxSlider* alpha_slider; - } bgimg; - - // Undo/redo system (simply stores the ASS commands) - std::list undos; - std::list redos; - UndoRedo _undo; - - // last action and commands (for undo/redo system) - wxString undodesc; - - wxString oldasscmds; - - // was preview_mode - //bool was_preview_mode; - - PointSystem* _PointSystem() { return pointsys; } - - // for Undo/Redo system - virtual void PrepareUndoRedo(UndoRedo& ur, bool prestage, wxString cmds, wxString desc); - - // -------------------- points highlight/selection --------------------------- - - // set command and point to highlight - virtual void SetHighlighted ( DrawCmd* cmd, Point* point ); - - // selects all points within (lx, ty) , (rx, by) returns # of selected points - virtual int SelectPointsWithin( int lx, int rx, int ty, int by, SELECTMODE smode = NEW ); - virtual void ClearPointsSelection(); - virtual SELECTMODE GetSelectMode(wxMouseEvent &event); - - // -------------------- misc --------------------------- - - // non-uniform transformation - virtual bool InitiateDraggingIfTransformMode(); - virtual void UpdateTranformModeRectCenter(); - virtual bool GetThe4thPoint(double ox, double oy, double a1x, double a1y, double a2x, double a2y, double *x, double *y); - enum { NONE, LEFT, RIGHT } backupowner; - agg::path_storage backupcmds; - int rectbound2upd, rectbound2upd2; - wxRealPoint rectbound[4], rectbound2[4], backup[4], rectcenter; - bool isshapetransformable; - - // do the real drawing - virtual void DoDraw( RendererBase& rbase, RendererPrimitives& rprim, RendererSolid& rsolid, agg::trans_affine& mtx ); - - // update background image scale & position - virtual void UpdateBackgroundImgScalePosition(bool firsttime = false); - - // perform extra stuff other than calling ASSDrawEngine::ConnectSubsequentCmds - virtual void ConnectSubsequentCmds (DrawCmd* cmd1, DrawCmd* cmd2); - - // make sure the c1 continuity is followed after performing a drag-point action - virtual void EnforceC1Continuity (DrawCmd* cmd, Point* pnt); - - // after the bounding quadrangle has changed, update the shape to fill up inside it - virtual void UpdateNonUniformTransformation(); - - friend struct UndoRedo; - - DECLARE_EVENT_TABLE() -}; - -class ASSDrawFileDropTarget : public wxFileDropTarget -{ -public: - ASSDrawFileDropTarget(ASSDrawCanvas *canvas): wxFileDropTarget() - { - m_canvas = canvas; - } - - virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) - { - m_canvas->ReceiveBackgroundImageFileDropEvent(filenames.Item(0)); - return true; - } - -protected: - ASSDrawCanvas *m_canvas; - -}; diff --git a/contrib/assdraw/src/canvas_mouse.cpp b/contrib/assdraw/src/canvas_mouse.cpp deleted file mode 100644 index 22b64a5f4..000000000 --- a/contrib/assdraw/src/canvas_mouse.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "canvas_mouse.hpp" -#include "canvas.hpp" - -DEFINE_EVENT_TYPE( wxEVT_MOUSEONCANVAS ) - - -ASSDrawMouseOnCanvasEvent::ASSDrawMouseOnCanvasEvent(const ASSDrawCanvas* canvas) - : wxNotifyEvent(), - _canvas(canvas) -{ - _data = NULL; -} - -wxEvent* ASSDrawMouseOnCanvasEvent::Clone() -{ - ASSDrawMouseOnCanvasEvent *clone = new ASSDrawMouseOnCanvasEvent(_canvas); - clone->SetData(_data); - return clone; -} - -void ASSDrawMouseOnCanvasEvent::SetData(MouseOnCanvasData *data) -{ - _data = data; -} - -MouseOnCanvasData* ASSDrawMouseOnCanvasEvent::GetData() -{ - return _data; -} diff --git a/contrib/assdraw/src/canvas_mouse.hpp b/contrib/assdraw/src/canvas_mouse.hpp deleted file mode 100644 index d64011336..000000000 --- a/contrib/assdraw/src/canvas_mouse.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#pragma once - -#include "_common.hpp" -#include "enums.hpp" -#include "engine.hpp" - -#include - -struct MouseOnCanvasData -{ - MODE mode; - wxMouseEvent event; - enum { NONE, LEFT, RIGHT, BOTH } button; - - Point* mousedownAt_point; - Point* pointedAt_point; - Point* dblclicked_point_right; - - wxPoint mouse_point; - wxPoint* dragAnchor_left; - wxPoint* lastDrag_left; - wxPoint* dragAnchor_right; - wxPoint* lastDrag_right; -}; - -class ASSDrawCanvas; - -class ASSDrawMouseOnCanvasEvent : public wxNotifyEvent -{ -public: - ASSDrawMouseOnCanvasEvent(const ASSDrawCanvas* canvas); - - wxEvent* Clone(); - - void SetData(MouseOnCanvasData *data); - - MouseOnCanvasData* GetData(); - -private: - const ASSDrawCanvas* _canvas; - MouseOnCanvasData* _data; - -}; - -DECLARE_EVENT_TYPE( wxEVT_MOUSEONCANVAS, -1 ) - -typedef void (wxEvtHandler::*wxMouseOnCanvasEventFunction)(ASSDrawMouseOnCanvasEvent&); - -#define EVT_MOUSEONCANVAS(fn) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_MOUSEONCANVAS, -1, -1, \ - (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNotifyEventFunction) \ - wxStaticCastEvent( wxMouseOnCanvasEventFunction, & fn ), (wxObject *) NULL ), - -class ASSDrawMouseOnCanvasHandler -{ - - -}; diff --git a/contrib/assdraw/src/cmd.cpp b/contrib/assdraw/src/cmd.cpp deleted file mode 100644 index 58668f68f..000000000 --- a/contrib/assdraw/src/cmd.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: cmd.cpp -// Purpose: ASSDraw drawing command classes -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#include "cmd.hpp" // the header for this file -#include -// ---------------------------------------------------------------------------- -// DrawCmd_M -// ---------------------------------------------------------------------------- - -// constructor -DrawCmd_M::DrawCmd_M ( int x, int y, PointSystem *ps, DrawCmd *prev ) - : DrawCmd ( x, y, ps, prev ) -{ - type = M; -} - -// to ASS drawing command -wxString DrawCmd_M::ToString() -{ - return wxString::Format(_T("m %d %d"), m_point->x(), m_point->y()); -} - - - -// ---------------------------------------------------------------------------- -// DrawCmd_L -// ---------------------------------------------------------------------------- - -// constructor -DrawCmd_L::DrawCmd_L ( int x, int y, PointSystem *ps, DrawCmd *prev ) - : DrawCmd ( x, y, ps, prev ) -{ - type = L; -} - -// to ASS drawing command -wxString DrawCmd_L::ToString() -{ - return wxString::Format(_T("l %d %d"), m_point->x(), m_point->y()); -} - - - -// ---------------------------------------------------------------------------- -// DrawCmd_B -// ---------------------------------------------------------------------------- - -// constructor -DrawCmd_B::DrawCmd_B -( int x, int y, int x1, int y1, int x2, int y2, PointSystem *ps, DrawCmd *prev ) - : DrawCmd ( x, y, ps, prev ) -{ - type = B; - controlpoints.push_back( new Point(x1, y1, ps, CP, this, 1) ); - controlpoints.push_back( new Point(x2, y2, ps, CP, this, 2) ); - initialized = true; - C1Cont = false; -} - -// constructor -DrawCmd_B::DrawCmd_B ( int x, int y, PointSystem *ps, DrawCmd *prev ) - : DrawCmd ( x, y, ps, prev ) -{ - type = B; - initialized = false; - C1Cont = false; -} - -// initialize; generate control points -void DrawCmd_B::Init ( unsigned n ) -{ - // Ignore if this is already initted - if (initialized) return; - - wxPoint wx0 = prev->m_point->ToWxPoint(); - wxPoint wx1 = m_point->ToWxPoint(); - int xdiff = (wx1.x - wx0.x) / 3; - int ydiff = (wx1.y - wx0.y) / 3; - int xg, yg; - - // first control - m_point->pointsys->FromWxPoint( wx0.x + xdiff, wx0.y + ydiff, xg, yg ); - controlpoints.push_back( new Point( xg, yg, m_point->pointsys, CP, this, 1 ) ); - - // second control - m_point->pointsys->FromWxPoint( wx1.x - xdiff, wx1.y - ydiff, xg, yg ); - controlpoints.push_back( new Point( xg, yg, m_point->pointsys, CP, this, 2 ) ); - - initialized = true; - -} - -// to ASS drawing command -wxString DrawCmd_B::ToString() -{ - if (initialized) { - PointList::iterator iterate = controlpoints.begin(); - Point* c1 = (*iterate++); - Point* c2 = (*iterate); - return wxString::Format(_T("b %d %d %d %d %d %d"), c1->x(), c1->y(), c2->x(), c2->y(), m_point->x(), m_point->y()); - } - else - return wxString::Format(_T("b ? ? ? ? %d %d"), m_point->x(), m_point->y()); -} - - -// ---------------------------------------------------------------------------- -// DrawCmd_S -// ---------------------------------------------------------------------------- - -// constructor -DrawCmd_S::DrawCmd_S - ( int x, int y, PointSystem *ps, DrawCmd *prev ) - : DrawCmd ( x, y, ps, prev ) -{ - type = S; - initialized = false; - closed = false; -} - -// constructor -DrawCmd_S::DrawCmd_S - ( int x, int y, std::vector< int > vals, PointSystem *ps, DrawCmd *prev ) - : DrawCmd ( x, y, ps, prev ) -{ - type = S; - std::vector< int >::iterator it = vals.begin(); - unsigned n = 0; - while (it != vals.end()) - { - int ix = *it; it++; - int iy = *it; it++; - n++; - //::wxLogMessage(_T("%d %d\n"), ix, iy); - controlpoints.push_back( new Point( ix, iy, ps, CP, this, n ) ); - } - - initialized = true; - closed = false; -} - -// initialize; generate control points -void DrawCmd_S::Init(unsigned n) -{ - // Ignore if this is already initted - if (initialized) return; - - wxPoint wx0 = prev->m_point->ToWxPoint(); - wxPoint wx1 = m_point->ToWxPoint(); - int xdiff = (wx1.x - wx0.x) / 3; - int ydiff = (wx1.y - wx0.y) / 3; - int xg, yg; - - // first control - m_point->pointsys->FromWxPoint( wx0.x + xdiff, wx0.y + ydiff, xg, yg ); - controlpoints.push_back( new Point( xg, yg, m_point->pointsys, CP, this, 1 ) ); - - // second control - m_point->pointsys->FromWxPoint( wx1.x - xdiff, wx1.y - ydiff, xg, yg ); - controlpoints.push_back( new Point( xg, yg, m_point->pointsys, CP, this, 2 ) ); - - initialized = true; - -} - -// to ASS drawing command -wxString DrawCmd_S::ToString() -{ - PointList::iterator iterate = controlpoints.begin(); - wxString assout = _T("s"); - for (; iterate != controlpoints.end(); iterate++) - { - if (initialized) - assout = wxString::Format(_T("%s %d %d"), assout.c_str(), (*iterate)->x(), (*iterate)->y()); - else - assout = wxString::Format(_T("%s ? ?"), assout.c_str()); - } - assout = wxString::Format(_T("%s %d %d"), assout.c_str(), m_point->x(), m_point->y()); - if (closed) assout = wxString::Format(_T("%s c"), assout.c_str()); - return assout; -} diff --git a/contrib/assdraw/src/cmd.hpp b/contrib/assdraw/src/cmd.hpp deleted file mode 100644 index 25ef16102..000000000 --- a/contrib/assdraw/src/cmd.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/////////////////////////////////////////////////////////////////////////////// -// Name: cmd.hpp -// Purpose: header file for ASSDraw drawing command classes -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "engine.hpp" // include the engine header for DrawCmd -#include // ok, we use vector too - -// this header file declares the following classes -class DrawCmd_M; -class DrawCmd_L; -class DrawCmd_B; - -// The M command -class DrawCmd_M: public DrawCmd -{ -public: - // Constructor - DrawCmd_M ( int x, int y, PointSystem *ps, DrawCmd *prev ); - - // to ASS drawing command - wxString ToString(); - -}; - -// The L command -class DrawCmd_L: public DrawCmd -{ -public: - // Constructor - DrawCmd_L ( int x, int y, PointSystem *ps, DrawCmd *prev ); - - // to ASS drawing command - wxString ToString(); - -}; - -// The B command -class DrawCmd_B: public DrawCmd -{ -public: - // Constructor - DrawCmd_B ( int x, int y, int x1, int y1, int x2, int y2, PointSystem *ps, DrawCmd *prev ); - - // Special constructor where only m_point is defined - // Need to call Init() to generate the controls - DrawCmd_B ( int x, int y, PointSystem *ps, DrawCmd *prev ); - - // Init this B command; generate controlpoints - void Init ( unsigned n = 0 ); - - // to ASS drawing command - wxString ToString(); - - //special - bool C1Cont; - -}; - -// The S command -class DrawCmd_S: public DrawCmd -{ -public: - // Constructor - DrawCmd_S ( int x, int y, PointSystem *ps, DrawCmd *prev ); - - // Constructor (with points info) - DrawCmd_S ( int x, int y, std::vector< int > vals, PointSystem *ps, DrawCmd *prev ); - - // Init this S command; generate controlpoints - void Init ( unsigned n = 0 ); - - // to ASS drawing command - wxString ToString(); - - // special - bool closed; -}; - diff --git a/contrib/assdraw/src/convert.bat b/contrib/assdraw/src/convert.bat deleted file mode 100644 index 255b89fc4..000000000 --- a/contrib/assdraw/src/convert.bat +++ /dev/null @@ -1,2 +0,0 @@ -perl t-stringifier.pl agg_bcspline.h agg_conv_bcspline.h agg_vcgen_bcspline.h resource.h agg_bcspline.cpp agg_vcgen_bcspline.cpp assdraw.cpp assdraw_settings.cpp canvas.cpp canvas_mouse.cpp cmd.cpp dlgctrl.cpp engine.cpp library.cpp settings.cpp -pause \ No newline at end of file diff --git a/contrib/assdraw/src/dlgctrl.cpp b/contrib/assdraw/src/dlgctrl.cpp deleted file mode 100644 index 10a57d0d7..000000000 --- a/contrib/assdraw/src/dlgctrl.cpp +++ /dev/null @@ -1,375 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: dlgctrl.cpp -// Purpose: custom dialogs and controls -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#include "assdraw.hpp" - -#if !defined(__WINDOWS__) -#include "xpm/res.h" -#endif - -BEGIN_EVENT_TABLE(ASSDrawSrcTxtCtrl, wxTextCtrl) - EVT_CHAR(ASSDrawSrcTxtCtrl::CustomOnChar) - EVT_TEXT(wxID_ANY, ASSDrawSrcTxtCtrl::CustomOnText) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(ASSDrawTransformDlg, wxDialog) - EVT_COMBOBOX(-1, ASSDrawTransformDlg::OnTemplatesCombo) -END_EVENT_TABLE() - -//BEGIN_EVENT_TABLE(ASSDrawCanvasRecenterButton, wxWindow) -//END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// ASSDrawSrcTxtCtrl -// ---------------------------------------------------------------------------- - -ASSDrawSrcTxtCtrl::ASSDrawSrcTxtCtrl(wxWindow *parent, ASSDrawFrame *frame) - : wxTextCtrl(parent, wxID_ANY, _T(""), __DPDS__ , wxTE_MULTILINE ) -{ - m_frame = frame; -} - -void ASSDrawSrcTxtCtrl::CustomOnChar(wxKeyEvent &event) -{ - switch (event.GetKeyCode()) - { - case WXK_RETURN: - m_frame->UpdateASSCommandStringFromSrcTxtCtrl(GetValue()); - break; - case WXK_TAB: - break; //do nothing - default: - //m_frame->SetTitle(wxString::Format(_T("Key: %d"), event.GetKeyCode())); - event.Skip(true); - } - - //SetBackgroundColour(IsModified()? wxColour(0xFF, 0xFF, 0x99):*wxWHITE); -} - -void ASSDrawSrcTxtCtrl::CustomOnText(wxCommandEvent &event) -{ - //SetBackgroundColour(IsModified()? wxColour(0xFF, 0xFF, 0x99):*wxWHITE); -} - -// ---------------------------------------------------------------------------- -// ASSDrawTransformDlg -// ---------------------------------------------------------------------------- - -ASSDrawTransformDlg::ASSDrawTransformDlg(ASSDrawFrame* parent) - : wxDialog(parent, -1, wxString(_T("Transform"))) -{ - m_frame = parent; - - wxBoxSizer* sizer_main = new wxBoxSizer(wxVERTICAL); - this->SetSizer(sizer_main); - - wxBoxSizer* sizer_templates = new wxBoxSizer(wxHORIZONTAL); - sizer_main->Add(sizer_templates, 0, wxGROW|wxLEFT, 5); - - sizer_templates->Add(new wxStaticText( this, -1, _("Templates"), __DPDS__ , 0 ), - 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - combo_templates = new wxComboBox( this, -1, combo_templatesStrings[0], __DPDS__ , 10, combo_templatesStrings, wxCB_READONLY ); - sizer_templates->Add(combo_templates, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxFlexGridSizer* sizer_fields = new wxFlexGridSizer(3, 4, 0, 0); - sizer_main->Add(sizer_fields, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT, 5); - - int flag_txtctrl = wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL; - int flag_statictxt = wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL; - - sizer_fields->Add(new wxStaticText( this, -1, _("m11"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_m11 = new wxTextCtrl( this, -1, _T("1.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_m11, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("m12"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_m12 = new wxTextCtrl( this, -1, _T("0.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_m12, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("m21"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_m21 = new wxTextCtrl( this, -1, _T("0.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_m21, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("m22"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_m22 = new wxTextCtrl( this, -1, _T("1.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_m22, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("mx"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_mx = new wxTextCtrl( this, -1, _T("0.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_mx, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("my"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_my = new wxTextCtrl( this, -1, _T("0.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_my, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("nx"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_nx = new wxTextCtrl( this, -1, _T("0.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_nx, 0, flag_txtctrl, 5); - - sizer_fields->Add(new wxStaticText( this, -1, _("ny"), __DPDS__ , 0 ), - 0, flag_statictxt, 5); - - txtctrl_ny = new wxTextCtrl( this, -1, _T("0.0"), __DPDS__ , wxTE_RIGHT ); - sizer_fields->Add(txtctrl_ny, 0, flag_txtctrl, 5); - - wxStaticBitmap* staticbmp = new wxStaticBitmap( this, -1, wxBITMAP(transform), wxDefaultPosition, wxSize(224, 56), 0 ); - sizer_main->Add(staticbmp, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - wxStdDialogButtonSizer* sizer_stdbutt = new wxStdDialogButtonSizer; - - sizer_main->Add(sizer_stdbutt, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - wxButton* button_ok = new wxButton( this, wxID_OK, _("&OK"), __DPDS__ , 0 ); - sizer_stdbutt->AddButton(button_ok); - - wxButton* button_cancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), __DPDS__ , 0 ); - sizer_stdbutt->AddButton(button_cancel); - - sizer_stdbutt->Realize(); - - sizer_main->Fit(this); - -} - -void ASSDrawTransformDlg::OnTemplatesCombo(wxCommandEvent &event) -{ - int pos = -1; - for (int i = 0; i < combo_templatesCount; i++) - if (combo_templatesStrings[i].IsSameAs(((wxComboBox *) event.GetEventObject())->GetValue())) - { - pos = i; - break; - } - if (pos == -1) - return; - - txtctrl_m11->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f1) ); - txtctrl_m12->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f2) ); - txtctrl_m21->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f3) ); - txtctrl_m22->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f4) ); - txtctrl_mx->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f5) ); - txtctrl_my->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f6) ); - txtctrl_nx->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f7) ); - txtctrl_ny->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f8) ); -} - -void ASSDrawTransformDlg::EndModal(int retCode) -{ - if (retCode != wxID_OK) - { - wxDialog::EndModal(retCode); - return; - } - - bool ok = true; - - ok = ok && txtctrl_m11->GetValue().ToDouble( &xformvals.f1 ); - ok = ok && txtctrl_m12->GetValue().ToDouble( &xformvals.f2 ); - ok = ok && txtctrl_m21->GetValue().ToDouble( &xformvals.f3 ); - ok = ok && txtctrl_m22->GetValue().ToDouble( &xformvals.f4 ); - ok = ok && txtctrl_mx->GetValue().ToDouble( &xformvals.f5 ); - ok = ok && txtctrl_my->GetValue().ToDouble( &xformvals.f6 ); - ok = ok && txtctrl_nx->GetValue().ToDouble( &xformvals.f7 ); - ok = ok && txtctrl_ny->GetValue().ToDouble( &xformvals.f8 ); - - if (ok) - wxDialog::EndModal(wxID_OK); - else - wxMessageBox(_T("One or more values entered are not real numbers.\nPlease fix."), _T("Value error"), wxOK | wxICON_INFORMATION, m_frame); - -} - - -ASSDrawAboutDlg::ASSDrawAboutDlg(ASSDrawFrame *parent, unsigned timeout) - : wxDialog(parent, wxID_ANY, wxString(TITLE), __DPDS__ , wxSIMPLE_BORDER), time_out(timeout) -{ - SetBackgroundColour(*wxWHITE); - htmlwin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(396, 200), wxHW_DEFAULT_STYLE | wxSIMPLE_BORDER); - htmlwin->SetPage( -_T(" \ -

ASSDraw3 is a tool for designing shapes to be used in ASS subtitle file. \ -

To add lines or curves, initiate the draw mode by clicking on the drawing tools. \ -Then, either click on empty space or drag from an existing point to add the new lines/curves. \ -Control points for Bezier curves are generated once you release the mouse button. \ -

To modify shapes, drag their points (squares) and control points (circles) in the drag mode. \ -

Some tips & tricks: \ -

    \ -
  • Set background image by dragging image file from explorer onto the canvas \ -
  • Use the Shapes Library to store your drawings \ -
  • Ctrl-Z for undo, Ctrl-Y for redo \ -
  • Use your mousewheel to zoom in/out (PageUp/PageDown keys work too) \ -
  • Dragging with right mouse button moves the drawing and/or background image around. \ -
  • Double clicking with right mouse button for popup menus. \ -
  • Holding shift key while in the draw mode temporarily switches to the drag mode \ -
  • The shapes origin (coordinate [0, 0] depicted by the small cross) is draggable \ -
\ -

Acknowledgements: \ -

\ -

ai-chan recommends Aegisub for all your subtitle and typesetting needs! \ -") - ); - htmlwin->Connect(wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler(ASSDrawAboutDlg::OnURL), NULL, this); - - wxFlexGridSizer *sizer = new wxFlexGridSizer(1); - sizer->AddGrowableCol(0); - //sizer->AddGrowableRow(1); - - sizer->Add(new BigStaticBitmapCtrl(this, wxBITMAP(assdraw3_), *wxWHITE, this), 1, wxEXPAND); - sizer->Add(htmlwin, 1, wxLEFT | wxRIGHT, 2); - sizer->Add(new wxStaticText(this, wxID_ANY, wxString::Format(_T("Version: %s"), VERSION)), 1, wxEXPAND | wxALL, 2); - sizer->Add(new wxButton(this, wxID_OK), 0, wxALIGN_CENTER | wxBOTTOM, 10); - SetSizer(sizer); - sizer->Layout(); - sizer->Fit(this); - - Center(); - //if (CanSetTransparent()) SetTransparent(0xCC); - - timer.SetOwner(this); - Connect(wxEVT_TIMER, wxTimerEventHandler(ASSDrawAboutDlg::OnTimeout)); - Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(ASSDrawAboutDlg::OnMouseEnterWindow)); -} - -ASSDrawAboutDlg::~ASSDrawAboutDlg() -{ - timer.Stop(); -} - -int ASSDrawAboutDlg::ShowModal() -{ - if (time_out > 0) - timer.Start(time_out * 1000, true); - return wxDialog::ShowModal(); -} - -void ASSDrawAboutDlg::OnURL(wxHtmlLinkEvent &event) -{ - wxString URL(event.GetLinkInfo().GetHref()); - if (URL.StartsWith(_T("http://"))) - ::wxLaunchDefaultBrowser(URL); - else - event.Skip(true); -} - -void ASSDrawAboutDlg::OnTimeout(wxTimerEvent& event) -{ - if (IsShown()) - EndModal(wxID_OK); -} - -void ASSDrawAboutDlg::OnMouseEnterWindow(wxMouseEvent& event) -{ - // if mouse enters this dialog, stop the timout timer - // and dialog will only close through user input - timer.Stop(); -} - -BEGIN_EVENT_TABLE(BigStaticBitmapCtrl, wxPanel) - EVT_PAINT(BigStaticBitmapCtrl::OnPaint) - EVT_MOTION (BigStaticBitmapCtrl::OnMouseMove) - EVT_LEFT_UP(BigStaticBitmapCtrl::OnMouseLeftUp) - EVT_LEFT_DOWN(BigStaticBitmapCtrl::OnMouseLeftDown) -END_EVENT_TABLE() - -BigStaticBitmapCtrl::BigStaticBitmapCtrl(wxWindow *parent, wxBitmap bmap, wxColour bgcol, wxWindow *todrag) - : wxPanel(parent, wxID_ANY) -{ - bitmap = bmap; - bgbrush = wxBrush(bgcol); - window_to_drag = todrag; - SetSize(bitmap.GetWidth(), bitmap.GetHeight()); - Refresh(); -} - -BigStaticBitmapCtrl::~BigStaticBitmapCtrl() -{ -} - -void BigStaticBitmapCtrl::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this); - dc.SetBackground(bgbrush); - dc.Clear(); - dc.DrawBitmap(bitmap, wxPoint(0,0)); -} - -void BigStaticBitmapCtrl::OnMouseLeftDown(wxMouseEvent &event) -{ - if (window_to_drag != NULL) - { - dragpoint = event.GetPosition(); - } - CaptureMouse(); -} - -void BigStaticBitmapCtrl::OnMouseLeftUp(wxMouseEvent &event) -{ - ReleaseMouse(); -} - -void BigStaticBitmapCtrl::OnMouseMove(wxMouseEvent &event) -{ - if (window_to_drag != NULL && event.Dragging() && HasCapture()) - { - wxPoint npoint(event.GetPosition()); - wxPoint wndpos = window_to_drag->GetScreenPosition(); - wxPoint thispos = this->GetScreenPosition(); - //ReleaseMouse(); - window_to_drag->Move(wndpos.x + npoint.x - dragpoint.x, - wndpos.y + npoint.y - dragpoint.y); - //CaptureMouse(); - if (thispos == this->GetScreenPosition()) // if this ctrl did not move when window_to_drag moved - dragpoint = npoint; - } - event.Skip(true); -} diff --git a/contrib/assdraw/src/dlgctrl.hpp b/contrib/assdraw/src/dlgctrl.hpp deleted file mode 100644 index b5225d181..000000000 --- a/contrib/assdraw/src/dlgctrl.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#pragma once - -#include "_common.hpp" -#include -#include - - -class ASSDrawFrame; - -class ASSDrawSrcTxtCtrl : public wxTextCtrl -{ -public: - ASSDrawSrcTxtCtrl(wxWindow *parent, ASSDrawFrame *frame); - virtual void CustomOnChar(wxKeyEvent &event); - virtual void CustomOnText(wxCommandEvent &event); - -protected: - ASSDrawFrame *m_frame; - DECLARE_EVENT_TABLE() -}; - -struct EightDouble -{ - double f1, f2, f3, f4, f5, f6, f7, f8; -}; - -class ASSDrawTransformDlg : public wxDialog -{ - -public: - ASSDrawTransformDlg(ASSDrawFrame* parent); - void OnTemplatesCombo(wxCommandEvent &event); - void EndModal(int retCode); - - ASSDrawFrame* m_frame; - wxComboBox* combo_templates; - wxTextCtrl* txtctrl_m11; - wxTextCtrl* txtctrl_m12; - wxTextCtrl* txtctrl_m21; - wxTextCtrl* txtctrl_m22; - wxTextCtrl* txtctrl_mx; - wxTextCtrl* txtctrl_my; - wxTextCtrl* txtctrl_nx; - wxTextCtrl* txtctrl_ny; - EightDouble xformvals; - - static wxString combo_templatesStrings[]; - static int combo_templatesCount; - static EightDouble combo_templatesValues[]; - - DECLARE_EVENT_TABLE() - -}; - -class ASSDrawAboutDlg : public wxDialog -{ -public: - ASSDrawAboutDlg(ASSDrawFrame *parent, unsigned timeout = 0); - virtual ~ASSDrawAboutDlg(); - virtual void OnURL(wxHtmlLinkEvent &event); - virtual int ShowModal(); - virtual void OnTimeout(wxTimerEvent& event); - virtual void OnMouseEnterWindow(wxMouseEvent& event); - -protected: - wxTimer timer; - wxHtmlWindow *htmlwin; - const unsigned time_out; -}; - -class BigStaticBitmapCtrl : public wxPanel -{ -public: - BigStaticBitmapCtrl(wxWindow *parent, wxBitmap bmap, wxColour bgcol, wxWindow *todrag = NULL); - virtual ~BigStaticBitmapCtrl(); - virtual void OnPaint(wxPaintEvent& event); - virtual void OnMouseLeftDown(wxMouseEvent &event); - virtual void OnMouseLeftUp(wxMouseEvent &event); - virtual void OnMouseMove(wxMouseEvent &event); - -protected: - wxBitmap bitmap; - wxBrush bgbrush; - wxWindow *window_to_drag; - wxPoint dragpoint, wndpos; - - DECLARE_EVENT_TABLE() -}; diff --git a/contrib/assdraw/src/engine.cpp b/contrib/assdraw/src/engine.cpp deleted file mode 100644 index 5f78fe5f7..000000000 --- a/contrib/assdraw/src/engine.cpp +++ /dev/null @@ -1,749 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: engine.cpp -// Purpose: ASSDraw drawing engine -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#include "engine.hpp" // the header -#include "cmd.hpp" // we need the drawing command classes declaration -#include // we use string tokenizer -#include // ok, we use vector too -#include -#include - - - -// ---------------------------------------------------------------------------- -// Point -// ---------------------------------------------------------------------------- - -// constructor -Point::Point ( int _x, int _y, PointSystem* ps, POINTTYPE t, DrawCmd* cmd, unsigned n ) -{ - x_ = _x; - y_ = _y; - pointsys = ps; - cmd_main = cmd; - cmd_next = NULL; - type = t; - isselected = false; - num = n; -} - -// setters -void Point::setXY( int _x, int _y) -{ - x_ = _x; - y_ = _y; -} - -// simply returns true if px and py are the coordinate values -bool Point::IsAt( int px, int py ) -{ - return (x_ == px && y_ == py ); -} - -// convert this point to wxPoint using scale and originx, originy -wxPoint Point::ToWxPoint ( bool useorigin ) -{ - if (useorigin) - return pointsys->ToWxPoint( x_, y_ ); - else - return *(new wxPoint(x_ * (int) pointsys->scale, y_ * (int) pointsys->scale )); -} - -// check if wxpoint is nearby this point -bool Point::CheckWxPoint ( wxPoint wxpoint ) -{ - wxPoint p = ToWxPoint(); - int cx, cy; - pointsys->FromWxPoint( wxpoint, cx, cy ); - //delete &p; - return (x_ == cx && y_ == cy ); -} - - - -// ---------------------------------------------------------------------------- -// DrawCmd -// ---------------------------------------------------------------------------- - -// constructor -DrawCmd::DrawCmd ( int x, int y, PointSystem *ps, DrawCmd *pv ) -{ - m_point = new Point ( x, y, ps, MP, this ); - m_point->cmd_main = this; - prev = pv; - dobreak = false; - invisible = false; -} - -// destructor -DrawCmd::~DrawCmd ( ) -{ - if (m_point) - delete m_point; - for (PointList::iterator iter_cpoint = controlpoints.begin(); - iter_cpoint != controlpoints.end(); iter_cpoint++) - delete (*iter_cpoint); -} - - - -// ---------------------------------------------------------------------------- -// ASSDrawEngine -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(ASSDrawEngine, GUI::AGGWindow) - EVT_PAINT (ASSDrawEngine::OnPaint) -END_EVENT_TABLE() - -// constructor -ASSDrawEngine::ASSDrawEngine( wxWindow *parent, int extraflags ) - : GUI::AGGWindow(parent, -1, wxDefaultPosition, wxDefaultSize, - wxNO_FULL_REPAINT_ON_RESIZE | extraflags ) -{ - pointsys = new PointSystem(1, 0, 0) ; - refresh_called = false; - fitviewpoint_hmargin = 10; - fitviewpoint_vmargin = 10; - setfitviewpoint = false; - rgba_shape = agg::rgba(0,0,1); - color_bg = PixelFormat::AGGType::color_type(255, 255, 255); - drawcmdset = _T("m n l b s p c _"); //the spaces and underscore are in there for a reason, guess? - ResetEngine(); -} - -ASSDrawEngine::~ASSDrawEngine() -{ - ResetEngine ( false ); - //delete pointsys; -} - -// parse ASS draw commands; returns the number of parsed commands -int ASSDrawEngine::ParseASS ( wxString str ) -{ - ResetEngine( false ); - str.Replace(_T("\t"), _T("")); - str.Replace(_T("\r"), _T("")); - str.Replace(_T("\n"), _T("")); - str = str.Lower() + _T(" _ _"); - // we don't use regex because the pattern is too simple - wxStringTokenizer tkz( str, _T(" ") ); - wxString currcmd(_T("")); - std::vector val; - wxString token; - long tmp_int; - - bool n_collected = false; - DrawCmd_S *s_command = NULL; - wxPoint tmp_n_pnt; - - while ( tkz.HasMoreTokens() ) - { - token = tkz.GetNextToken(); - - if ( drawcmdset.Find(token) > -1 ) - { - bool done; - - do { - done = true; - - // N - if (currcmd.IsSameAs(_T("n")) && val.size() >= 2) - { - tmp_n_pnt.x = val[0], tmp_n_pnt.y = val[1]; - n_collected = true; - } - else if(n_collected) - { - AppendCmd ( L, tmp_n_pnt.x, tmp_n_pnt.y ); - n_collected = false; - } - - if (s_command != NULL) - { - bool ends = true; - if (currcmd.IsSameAs(_T("p"))&& val.size() >= 2) - { - s_command->m_point->type = CP; - s_command->m_point->num = s_command->controlpoints.size() + 1; - s_command->controlpoints.push_back(s_command->m_point); - s_command->m_point = new Point(val[0], val[1], pointsys, MP, s_command); - ends = false; - } - else if (currcmd.IsSameAs(_T("c"))) - s_command->closed = true; - - if (ends) - { - AppendCmd(s_command); - s_command = NULL; - } - } - - // M - if (currcmd.IsSameAs(_T("m")) && val.size() >= 2) - AppendCmd ( M, val[0], val[1] ); - - // L - if (currcmd.IsSameAs(_T("l")) && val.size() >= 2) - { - AppendCmd ( L, val[0], val[1] ); - val.erase(val.begin(), val.begin()+2); - // L is greedy - if (val.size() >= 2) - done = false; - } - - // B - if (currcmd.IsSameAs(_T("b")) && val.size() >= 6) - { - AppendCmd ( new DrawCmd_B(val[4], val[5], val[0], val[1], - val[2], val[3], pointsys, LastCmd()) ); - val.erase(val.begin(), val.begin()+6); - // so is B - if (val.size() >= 6) - done = false; - } - - // S - if (currcmd.IsSameAs(_T("s")) && val.size() >= 6) - { - int num = (val.size() / 2) * 2; - std::vector val2; - int i = 0; - for (; i < num - 2; i++) - val2.push_back(val[i]); - - s_command = new DrawCmd_S(val[num - 2], val[num - 1], val2, pointsys, LastCmd()); - } - // more to come later - } while (!done); - - val.clear(); - currcmd = token; - } - else if (token.ToLong( &tmp_int )) - { - val.push_back( (int) tmp_int ); - } - } - - return (int) cmds.size(); -} - -// generate ASS draw commands -wxString ASSDrawEngine::GenerateASS ( ) -{ - wxString output = _T(""); - for (DrawCmdList::iterator iterate = cmds.begin(); iterate != cmds.end(); iterate++) - output = output + (*iterate)->ToString() + _T(" "); - return output; -} - -// reset; delete all points and add a new M(0,0) -void ASSDrawEngine::ResetEngine() -{ - ResetEngine(true); -} - -// reset; delete all points and add a new M(0,0) if addM == true -void ASSDrawEngine::ResetEngine( bool addM ) -{ - for (DrawCmdList::iterator iterate = cmds.begin(); iterate != cmds.end(); iterate++) - delete (*iterate); - cmds.clear(); - if (addM) AppendCmd( M, 0, 0 ); -} - -// Create draw command of type 'type' and m_point (x, y), append to the -// list and return it -DrawCmd* ASSDrawEngine::AppendCmd ( CMDTYPE type, int x, int y ) -{ - - // use a variation of this method - return AppendCmd( NewCmd( type, x, y ) ); -} - -// Append draw command -DrawCmd* ASSDrawEngine::AppendCmd ( DrawCmd* cmd ) -{ - // no NULL command! - if (cmd == NULL) return NULL; - - // set dependency of this command on the m_point of the last command - if (!cmds.empty()) - ConnectSubsequentCmds( cmds.back(), cmd ); - else - { - // since this is the first command, if it's not an M make it into one - if (cmd->type != M) - cmd = NewCmd( M, cmd->m_point->x(), cmd->m_point->y() ); - ConnectSubsequentCmds( NULL, cmd ); - } - // put it in the list - cmds.push_back( cmd ); - - return cmd; -} - -// create draw command of type 'type' and m_point (x, y), insert to the -// list after the _cmd and return it -DrawCmd* ASSDrawEngine::InsertCmd ( CMDTYPE type, int x, int y, DrawCmd* _cmd ) -{ - // prepare the new DrawCmd - DrawCmd* c = NewCmd( type, x, y ); - - // use a variation of this method - InsertCmd( c, _cmd ); - - return NULL; -} - -// insert draw command cmd after _cmd -void ASSDrawEngine::InsertCmd ( DrawCmd* cmd, DrawCmd* _cmd ) -{ - DrawCmdList::iterator iterate = cmds.begin(); - for (; iterate != cmds.end() && *iterate != _cmd; iterate++) - { - // do nothing - } - - if (iterate == cmds.end()) - { - AppendCmd( cmd ); - } - else - { - iterate++; - if (iterate != cmds.end()) - { - ConnectSubsequentCmds( cmd, (*iterate) ); - } - cmds.insert( iterate, cmd ); - ConnectSubsequentCmds( _cmd, cmd ); - } -} - -DrawCmd* ASSDrawEngine::NewCmd ( CMDTYPE type, int x, int y ) -{ - DrawCmd* c = NULL; - - switch (type) - { - case M: - c = new DrawCmd_M(x, y, pointsys, LastCmd()); - break; - case L: - c = new DrawCmd_L(x, y, pointsys, LastCmd()); - break; - case B: - c = new DrawCmd_B(x, y, pointsys, LastCmd()); - break; - case S: - c = new DrawCmd_S(x, y, pointsys, LastCmd()); - break; - } - return c; -} - -// returns the iterator for the list -DrawCmdList::iterator ASSDrawEngine::Iterator ( ) -{ - return cmds.begin(); -} - -// returns the 'end' iterator for the list -DrawCmdList::iterator ASSDrawEngine::IteratorEnd ( ) -{ - return cmds.end(); -} - -// returns the last command in the list -DrawCmd* ASSDrawEngine::LastCmd () -{ - if (cmds.size() == 0) - return NULL; - else - return cmds.back(); -} - -// move all points by relative amount of x, y coordinates -void ASSDrawEngine::MovePoints ( int x, int y ) -{ - DrawCmdList::iterator iterate = cmds.begin(); - PointList::iterator iterate2; - - for (; iterate != cmds.end(); iterate++) - { - (*iterate)->m_point->setXY( (*iterate)->m_point->x() + x, (*iterate)->m_point->y() + y ); - for (iterate2 = (*iterate)->controlpoints.begin(); - iterate2 != (*iterate)->controlpoints.end(); iterate2++) - { - (*iterate2)->setXY( (*iterate2)->x() + x, (*iterate2)->y() + y ); - } - } -} - -// transform all points using the calculation: -// | (m11) (m12) | x | (x - mx) | + | nx | -// | (m21) (m22) | | (y - my) | | ny | -void ASSDrawEngine::Transform( float m11, float m12, float m21, float m22, - float mx, float my, float nx, float ny ) -{ - DrawCmdList::iterator iterate = cmds.begin(); - PointList::iterator iterate2; - float x, y; - for (; iterate != cmds.end(); iterate++) - { - x = ((float) (*iterate)->m_point->x()) - mx; - y = ((float) (*iterate)->m_point->y()) - my; - (*iterate)->m_point->setXY((int) (x * m11 + y * m12 + nx), (int) (x * m21 + y * m22 + ny) ); - for (iterate2 = (*iterate)->controlpoints.begin(); - iterate2 != (*iterate)->controlpoints.end(); iterate2++) - { - x = ((float) (*iterate2)->x()) - mx; - y = ((float) (*iterate2)->y()) - my; - (*iterate2)->setXY((int) (x * m11 + y * m12 + nx), (int) (x * m21 + y * m22 + ny) ); - } - } -} - -// returns some DrawCmd if its m_point = (x, y) -DrawCmd* ASSDrawEngine::PointAt ( int x, int y ) -{ - DrawCmd* c = NULL; - DrawCmdList::iterator iterate = cmds.begin(); - - for (; iterate != cmds.end(); iterate++) - { - if ( (*iterate)->m_point->IsAt( x, y ) ) - c = (*iterate); - } - - //delete &iterate; - - return c; -} - -// returns some DrawCmd if one of its control point = (x, y) -// also set &point to refer to that control point -DrawCmd* ASSDrawEngine::ControlAt ( int x, int y, Point* &point ) -{ - DrawCmd* c = NULL; - point = NULL; - DrawCmdList::iterator cmd_iterator = cmds.begin(); - PointList::iterator pnt_iterator; - PointList::iterator end; - - for (; cmd_iterator != cmds.end(); cmd_iterator++) - { - pnt_iterator = (*cmd_iterator)->controlpoints.begin(); - end = (*cmd_iterator)->controlpoints.end(); - for (; pnt_iterator != end; pnt_iterator++) - { - if ( (*pnt_iterator)->IsAt( x, y ) ) - { - c = (*cmd_iterator); - point = (*pnt_iterator); - } - } - } - - return c; -} - -// attempts to delete a commmand, returns true|false if successful|fail -bool ASSDrawEngine::DeleteCommand ( DrawCmd* cmd ) -{ - - DrawCmdList::iterator iterate = cmds.begin(); - // can't delete the first command without deleting other commands first - if ( cmd == (*iterate) && cmds.size() > 1) return false; - - DrawCmd* lastiter = NULL; - - for (; iterate != cmds.end(); iterate++) - { - if ( cmd == (*iterate) ) - { - iterate++; - DrawCmd* nxt = (iterate != cmds.end()? (*iterate):NULL); - ConnectSubsequentCmds( lastiter, nxt ); - iterate--; - cmds.erase( iterate ); - delete cmd; - break; - } - else - lastiter = (*iterate); - } - - return true; -} - -// set stuff to connect two drawing commands cmd1 and cmd2 such that -// cmd1 comes right before cmd2 -void ASSDrawEngine::ConnectSubsequentCmds (DrawCmd* cmd1, DrawCmd* cmd2) -{ - if (cmd1 != NULL) - { - cmd1->m_point->cmd_next = cmd2; - } - - if (cmd2 != NULL) - { - cmd2->prev = cmd1; - } -} - -void ASSDrawEngine::RefreshDisplay() -{ - if (!refresh_called) - { - Refresh(); - refresh_called = true; - } -} - -void ASSDrawEngine::OnPaint(wxPaintEvent& event) -{ - draw(); - onPaint(event); - if (setfitviewpoint) - { - FitToViewPoint( fitviewpoint_hmargin, fitviewpoint_vmargin ); - setfitviewpoint = false; - RefreshDisplay(); - } -} - -void ASSDrawEngine::draw() -{ - refresh_called = false; - - PixelFormat::AGGType pixf(rBuf); - RendererBase rbase(pixf); - RendererPrimitives rprim(rbase); - RendererSolid rsolid(rbase); - - agg::trans_affine mtx; - ConstructPathsAndCurves(mtx, rm_path, rb_path, rm_curve); - - rasterizer.reset(); - update_rendered_bound_coords(true); - DoDraw(rbase, rprim, rsolid, mtx); - - delete rm_path, rb_path, rm_curve; -} - -void ASSDrawEngine::ConstructPathsAndCurves(agg::trans_affine& mtx, - trans_path*& _rm_path, trans_path*& _rb_path, agg::conv_curve*& _rm_curve) -{ - mtx *= agg::trans_affine_scaling(pointsys->scale); - mtx *= agg::trans_affine_translation(pointsys->originx, pointsys->originy); - - m_path.remove_all(); - b_path.remove_all(); - - DrawCmdList::iterator ci = cmds.begin(); - while (ci != cmds.end()) - { - AddDrawCmdToAGGPathStorage(*ci, m_path); - AddDrawCmdToAGGPathStorage(*ci, b_path, CTRL_LN); - ci++; - } - _rm_path = new trans_path(m_path, mtx); - _rb_path = new trans_path(b_path, mtx); - _rm_curve = new agg::conv_curve(*rm_path); -} - -void ASSDrawEngine::DoDraw( RendererBase& rbase, RendererPrimitives& rprim, RendererSolid& rsolid, agg::trans_affine& mtx ) -{ - Draw_Clear( rbase ); - Draw_Draw( rbase, rprim, rsolid, mtx, rgba_shape ); -} - -void ASSDrawEngine::Draw_Clear( RendererBase& rbase ) -{ - rbase.clear(color_bg); -} - -void ASSDrawEngine::Draw_Draw( RendererBase& rbase, RendererPrimitives& rprim, RendererSolid& rsolid, agg::trans_affine& mtx, agg::rgba color ) -{ - agg::conv_contour< agg::conv_curve< agg::conv_transform< agg::path_storage > > > contour(*rm_curve); - rasterizer.add_path(contour); - render_scanlines_aa_solid(rbase, color); -} - -void ASSDrawEngine::AddDrawCmdToAGGPathStorage(DrawCmd* cmd, agg::path_storage& path, DRAWCMDMODE mode) -{ - if (mode == HILITE && cmd->prev) - path.move_to(cmd->prev->m_point->x(), cmd->prev->m_point->y()); - - switch(cmd->type) - { - case M: - path.move_to(cmd->m_point->x(),cmd->m_point->y()); - break; - - case B: - if (cmd->initialized) - { - //path.move_to(cmd->prev->m_point->x(),cmd->prev->m_point->y()); - PointList::iterator iterate = cmd->controlpoints.begin(); - int x[2], y[2]; - x[0] = (*iterate)->x(); - y[0] = (*iterate)->y(); - iterate++; - x[1] = (*iterate)->x(); - y[1] = (*iterate)->y(); - path.curve4(x[0], y[0], x[1], y[1], cmd->m_point->x(),cmd->m_point->y()); - break; - } - - case L: - if (mode == CTRL_LN) - path.move_to(cmd->m_point->x(),cmd->m_point->y()); - else - path.line_to(cmd->m_point->x(),cmd->m_point->y()); - break; - - case S: - unsigned np = cmd->controlpoints.size(); - agg::pod_array m_polygon(np * 2); - unsigned _pn = 0; - PointList::iterator iterate = cmd->controlpoints.begin(); - while (iterate != cmd->controlpoints.end()) - { - m_polygon[_pn] = (*iterate)->x(); _pn++; - m_polygon[_pn] = (*iterate)->y(); _pn++; - iterate++; - } - //m_polygon[_pn++] = cmd->m_point->x(); - //m_polygon[_pn++] = cmd->m_point->y(); - //path.move_to(cmd->prev->m_point->x(),cmd->prev->m_point->y()); - if (mode == CTRL_LN) - { - _pn = 0; - while (_pn < np * 2) - { - path.line_to((int) m_polygon[_pn],(int) m_polygon[_pn + 1]); - _pn += 2; - } - path.line_to(cmd->m_point->x(), cmd->m_point->y()); - } - else - { - //path.line_to((int) m_polygon[0],(int) m_polygon[1]); - aggpolygon poly(&m_polygon[0], np, false, false); - agg::conv_bcspline bspline(poly); - bspline.interpolation_step(0.01); - agg::path_storage npath; - npath.join_path(bspline); - path.join_path(npath); - if (mode == HILITE) - path.move_to((int) m_polygon[np * 2 - 2], (int) m_polygon[np * 2 - 1] ); - path.line_to(cmd->m_point->x(), cmd->m_point->y()); - } - break; - } - -} - -void ASSDrawEngine::render_scanlines_aa_solid(RendererBase& rbase, agg::rgba rgba, bool affectboundaries) -{ - agg::render_scanlines_aa_solid(rasterizer, scanline, rbase, rgba); - if (affectboundaries) update_rendered_bound_coords(); -} - -void ASSDrawEngine::render_scanlines(RendererSolid& rsolid, bool affectboundaries) -{ - agg::render_scanlines(rasterizer, scanline, rsolid); - if (affectboundaries) update_rendered_bound_coords(); -} - -void ASSDrawEngine::update_rendered_bound_coords(bool rendered_fresh) -{ - int min_x = rasterizer.min_x(); - int min_y = rasterizer.min_y(); - int max_x = rasterizer.max_x(); - int max_y = rasterizer.max_y(); - if (min_x < rendered_min_x || rendered_fresh) rendered_min_x = min_x; - if (min_y < rendered_min_y || rendered_fresh) rendered_min_y = min_y; - if (max_x > rendered_max_x || rendered_fresh) rendered_max_x = max_x; - if (max_y > rendered_max_y || rendered_fresh) rendered_max_y = max_y; -} - -void ASSDrawEngine::FitToViewPoint(int hmargin, int vmargin) -{ - wxSize v = GetClientSize(); - double wide = rendered_max_x - rendered_min_x; - double high = rendered_max_y - rendered_min_y; - double widthratio = (double) (v.x - hmargin * 2) / wide; - double heightratio = (double) (v.y - vmargin * 2) / high; - double ratio = (widthratio < heightratio? widthratio:heightratio); - pointsys->scale = pointsys->scale * ratio; - if (pointsys->scale < 0.01) pointsys->scale = 0.01; - double new_min_x = pointsys->originx + (rendered_min_x - pointsys->originx) * ratio; - double new_max_x = pointsys->originx + (rendered_max_x - pointsys->originx) * ratio; - pointsys->originx += (v.x - new_max_x + new_min_x) / 2 - new_min_x; - double new_min_y = pointsys->originy + (rendered_min_y - pointsys->originy) * ratio; - double new_max_y = pointsys->originy + (rendered_max_y - pointsys->originy) * ratio; - pointsys->originy += (v.y - new_max_y + new_min_y) / 2 - new_min_y; - RefreshDisplay(); -} - -void ASSDrawEngine::SetFitToViewPointOnNextPaint(int hmargin, int vmargin) -{ - if (vmargin >= 0) fitviewpoint_vmargin = vmargin; - if (hmargin >= 0) fitviewpoint_hmargin = hmargin; - setfitviewpoint = true; -} - -std::vector< bool > ASSDrawEngine::PrepareC1ContData() -{ - std::vector< bool > out; - for (DrawCmdList::iterator it = cmds.begin(); it != cmds.end(); it++) - { - bool c1 = false; - if ((*it)->type == B) - { - DrawCmd_B *cmdb = static_cast(*it); - c1 = cmdb->C1Cont; - } - out.push_back(c1); - } - return out; -} diff --git a/contrib/assdraw/src/engine.hpp b/contrib/assdraw/src/engine.hpp deleted file mode 100644 index b730ec6fc..000000000 --- a/contrib/assdraw/src/engine.hpp +++ /dev/null @@ -1,406 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: engine.hpp -// Purpose: header file for ASSDraw drawing engine -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "_common.hpp" - -// we use these 2 standard libraries -#include -#include -#include -#include - -// agg support -#include "wxAGG/AGGWindow.h" -#include "agg_color_rgba.h" -#include "agg_rasterizer_scanline_aa.h" -#include "agg_scanline_p.h" -#include "agg_renderer_base.h" -#include "agg_renderer_primitives.h" -#include "agg_renderer_scanline.h" -#include "agg_path_storage.h" -#include "agg_curves.h" -#include "agg_conv_curve.h" -#include "agg_conv_contour.h" -#include "agg_conv_stroke.h" -#include "agg_conv_bcspline.h" -#include "agg_math.h" - -#define DEFAULT_SCALE 10 - -// this header file declare the following classes -class DrawEngine; -class Point; -class PointSystem; -class DrawCmd; - -typedef std::list DrawCmdList; -typedef std::list PointList; -typedef std::set PointSet; - -// Command type -enum CMDTYPE -{ - M = 0, - N = 1, - L = 2, - B = 3, - S = 4, - P = 5, - C = 6 -}; - -// Point type -enum POINTTYPE -{ - MP, // main point - CP // control point -}; - -// A PointSystem is a centralized entity holding the parameters: -// scale, originx and originy, all of which are needed by Point -class PointSystem -{ -public: - double scale, originx, originy; - - PointSystem ( double sc = 1.0, double origx = 0.0, double origy = 0.0 ) - { Set( sc, origx, origy ); } - - // set scale, originx and originy; - void Set( double sc, double origx, double origy ) - { scale = sc, originx = origx, originy = origy; } - - wxRealPoint ToWxRealPoint ( double x, double y ) - { return wxRealPoint( originx + x * scale, originy + y * scale ); } - - // given drawing command coordinates returns the wxPoint on the GUI - wxPoint ToWxPoint ( double x, double y ) - { return wxPoint( (int) (originx + x * scale), (int) (originy + y * scale) ); } - - // given wxPoint on the GUI returns the nearest drawing command coords - void FromWxPoint ( int wxpx, int wxpy, int &x, int &y ) - { - x = int( floor( ((double) wxpx - originx) / scale + 0.5 ) ); - y = int( floor( ((double) wxpy - originy) / scale + 0.5 ) ); - } - - // given wxPoint on the GUI returns the nearest drawing command coords - void FromWxPoint ( wxPoint wxp, int &x, int &y ) - { - FromWxPoint( wxp.x, wxp.y, x, y ); - } -}; - -// The point class -// note: this actually refers to the x,y-coordinate in drawing commands, -// not the coordinate in the GUI -class Point -{ -public: - POINTTYPE type; - PointSystem *pointsys; - - // drawing commands that depend on this point - DrawCmd* cmd_main; - DrawCmd* cmd_next; - bool isselected; - unsigned num; - - // constructor - //Point ( ) { cmd_main = NULL; cmd_next = NULL; } - - // constructor - Point ( int _x, int _y, PointSystem* ps, POINTTYPE t, DrawCmd* cmd, unsigned n = 0 ); - - // getters - int x() { return x_; } - - int y() { return y_; } - - //set x and y - void setXY( int _x, int _y); - - // simply returns true if px and py are the coordinate values - bool IsAt( int px, int py ); - - // convert this point to wxPoint using scale and originx, originy - wxPoint ToWxPoint () { return ToWxPoint(true); } - - // convert this point to wxPoint using scale; - // also use originx and originy if useorigin = true - wxPoint ToWxPoint (bool useorigin); - - // check if wxpoint is nearby this point - bool CheckWxPoint ( wxPoint wxpoint ); - -private: - int x_, y_; - -}; - -// The base class for all draw commands -class DrawCmd -{ -public: - CMDTYPE type; - - // main point (almost every command has one) - // for B and S it's the last (destination) point - Point* m_point; - - // other points than the main point - // subclasses must populate this list even if they define - // new variables for other points - PointList controlpoints; - - // Linked list feature - DrawCmd *prev; - - // Must set to true if the next command should NOT utilize this command - // for the drawing - bool dobreak; - - // Set to true if invisible m_point (not drawn) - bool invisible; - - // true if this DrawCmd has been initialized with Init(), false otherwise - // (initialized means that the control points have been generated) - bool initialized; - - // ----------------------------------------------------------- - // Constructor(s) - DrawCmd ( int x, int y, PointSystem *ps, DrawCmd *pv ); - - // Destructor - virtual ~DrawCmd (); - - // Init the draw command (for example to generate the control points) - virtual void Init(unsigned n = 0) { initialized = true; } - - virtual wxString ToString() { return wxT(""); } - -}; - -class ASSDrawEngine: public GUI::AGGWindow -{ -public: - ASSDrawEngine( wxWindow *parent, int extraflags = 0 ); - - // destructor - ~ASSDrawEngine(); - - virtual void SetDrawCmdSet(wxString set) { drawcmdset = set; } - - virtual void ResetEngine(); - virtual void ResetEngine(bool addM); - virtual void RefreshDisplay(); - - void FitToViewPoint(int hmargin, int vmargin); - void SetFitToViewPointOnNextPaint(int hmargin = -1, int vmargin = -1); - - PointSystem* _PointSystem() { return pointsys; } - - // ASS draw commands; returns the number of parsed commands - virtual int ParseASS ( wxString str ); - // generate ASS draw commands - virtual wxString GenerateASS ( ); - - // drawing - virtual void OnPaint(wxPaintEvent &event); - - // -------------------- adding new commands ---------------------------- - - // create draw command of type 'type' and m_point (x, y), append to the - // list and return it - virtual DrawCmd* AppendCmd ( CMDTYPE type, int x, int y ); - - // append draw command - virtual DrawCmd* AppendCmd ( DrawCmd* cmd ); - - // create draw command of type 'type' and m_point (x, y), insert to the - // list after the _cmd and return it - virtual DrawCmd* InsertCmd ( CMDTYPE type, int x, int y, DrawCmd* _cmd ); - - // insert draw command cmd after _cmd - virtual void InsertCmd ( DrawCmd* cmd, DrawCmd* _cmd ); - - // Create new DrawCmd - DrawCmd* NewCmd ( CMDTYPE type, int x, int y ); - - // -------------------- read/modify commands --------------------------- - - // returns the iterator for the list - virtual DrawCmdList::iterator Iterator ( ); - - // returns the 'end' iterator for the list - virtual DrawCmdList::iterator IteratorEnd ( ); - - // returns the last command in the list - virtual DrawCmd* LastCmd (); - - // returns the total number of commands in the list - //virtual int CmdCount () { return cmds.size(); } - - // move all points by relative amount of x, y coordinates - virtual void MovePoints ( int x, int y ); - - // transform all points using the calculation: - // | (m11) (m12) | x | (x - mx) | + | nx | - // | (m21) (m22) | | (y - my) | | ny | - virtual void Transform( float m11, float m12, float m21, float m22, - float mx, float my, float nx, float ny ); - - // returns some DrawCmd if its m_point = (x, y) - virtual DrawCmd* PointAt ( int x, int y ); - - // returns some DrawCmd if one of its control point = (x, y) - // also set &point to refer to that control point - virtual DrawCmd* ControlAt ( int x, int y, Point* &point ); - - // attempts to delete a commmand, returns true|false if successful|fail - virtual bool DeleteCommand ( DrawCmd* cmd ); - - agg::rgba rgba_shape; - PixelFormat::AGGType::color_type color_bg; - -protected: - /// The AGG base renderer - typedef agg::renderer_base RendererBase; - /// The AGG primitives renderer - typedef agg::renderer_primitives RendererPrimitives; - /// The AGG solid renderer - typedef agg::renderer_scanline_aa_solid RendererSolid; - - enum DRAWCMDMODE { - NORMAL, - CTRL_LN, - HILITE - }; - - DrawCmdList cmds; - wxString drawcmdset; - - PointSystem* pointsys; - - // for FitToViewPoint feature - bool setfitviewpoint; - int fitviewpoint_vmargin, fitviewpoint_hmargin; - - // AGG - agg::rasterizer_scanline_aa<> rasterizer; ///< Scanline rasterizer - agg::scanline_p8 scanline; ///< Scanline container - void render_scanlines_aa_solid(RendererBase& rbase, agg::rgba rbga, bool affectboundaries = true); - void render_scanlines(RendererSolid& rsolid, bool affectboundaries = true); - int rendered_min_x, rendered_min_y, rendered_max_x, rendered_max_y; //bounding coord of rendered shapes - void update_rendered_bound_coords(bool rendered_fresh = false); - - typedef agg::conv_transform trans_path; - agg::path_storage m_path, b_path; - trans_path *rm_path, *rb_path; - agg::conv_curve *rm_curve; - - void draw(); - virtual void ConstructPathsAndCurves(agg::trans_affine& mtx, trans_path*& _rm_path, trans_path*& _rb_path, agg::conv_curve*& _rm_curve); - virtual void DoDraw( RendererBase& rbase, RendererPrimitives& rprim, RendererSolid& rsolid, agg::trans_affine& mtx ); - virtual void Draw_Clear( RendererBase& rbase ); - virtual void Draw_Draw( RendererBase& rbase, RendererPrimitives& rprim, RendererSolid& rsolid, agg::trans_affine& mtx, agg::rgba color ); - bool refresh_called; - - // set stuff to connect two drawing commands cmd1 and cmd2 such that - // cmd1 comes right before cmd2 - virtual void ConnectSubsequentCmds (DrawCmd* cmd1, DrawCmd* cmd2); - - virtual void AddDrawCmdToAGGPathStorage(DrawCmd* cmd, agg::path_storage& path, DRAWCMDMODE mode = NORMAL); - - virtual std::vector< bool > PrepareC1ContData(); - - DECLARE_EVENT_TABLE() -}; - -namespace agg -{ - class simple_polygon_vertex_source - { - public: - simple_polygon_vertex_source(const double* polygon, unsigned np, - bool roundoff = false, - bool close = true) : - m_polygon(polygon), - m_num_points(np), - m_vertex(0), - m_roundoff(roundoff), - m_close(close) - { - } - - void close(bool f) { m_close = f; } - bool close() const { return m_close; } - - void rewind(unsigned) - { - m_vertex = 0; - } - - unsigned vertex(double* x, double* y) - { - if(m_vertex > m_num_points) return path_cmd_stop; - if(m_vertex == m_num_points) - { - ++m_vertex; - return path_cmd_end_poly | (m_close ? path_flags_close : 0); - } - *x = m_polygon[m_vertex * 2]; - *y = m_polygon[m_vertex * 2 + 1]; - if(m_roundoff) - { - *x = floor(*x) + 0.5; - *y = floor(*y) + 0.5; - } - ++m_vertex; - return (m_vertex == 1) ? path_cmd_move_to : path_cmd_line_to; - } - - private: - const double* m_polygon; - unsigned m_num_points; - unsigned m_vertex; - bool m_roundoff; - bool m_close; - }; -}; - -typedef agg::simple_polygon_vertex_source aggpolygon; diff --git a/contrib/assdraw/src/enums.hpp b/contrib/assdraw/src/enums.hpp deleted file mode 100644 index e59217056..000000000 --- a/contrib/assdraw/src/enums.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#pragma once - -// enum for IDs of menus -enum { - MENU_DUMMY = 200, - MENU_CLEAR, - MENU_PREVIEW, - MENU_TRANSFORM, - MENU_LIBRARY, - MENU_HELP, - MENU_RESETPERSPECTIVE, - MENU_SETTINGS, - MENU_UNDO, - MENU_REDO, - MENU_PASTE, - MENU_BGIMG_LOAD, - MENU_BGIMG_ALPHA, - MENU_BGIMG_REMOVE, - MENU_RECENTER, - MENU_TBAR, - MENU_REPOS_TOPLEFT, - MENU_REPOS_TOPRIGHT, - MENU_REPOS_CENTER, - MENU_REPOS_BOTLEFT, - MENU_REPOS_BOTRIGHT, - MENU_BGIMG_RECENTER, - MENU_REPOS_BGTOPLEFT, - MENU_REPOS_BGTOPRIGHT, - MENU_REPOS_BGCENTER, - MENU_REPOS_BGBOTLEFT, - MENU_REPOS_BGBOTRIGHT, - MENU_DRC_LNTOBEZ, - MENU_DRC_C1CONTBEZ, - MENU_DRC_BEZTOLN, - MENU_DRC_MOVE00, - MENU_TB_ALL, - MENU_TB_NONE, - MENU_TB_DOCK, - MENU_TB_UNDOCK, - MENU_TB_DRAW, - MENU_TB_MODE, - MENU_TB_BGIMG -}; - -// enum for modes (i.e. create m, b, l etc or normal mode) -// also use as tools IDs -enum MODE -{ - MODE_ARR = 100, - MODE_M = 101, - MODE_N = 102, - MODE_L = 103, - MODE_B = 104, - MODE_S = 105, - MODE_P = 106, - MODE_C = 107, - MODE_DEL = 108, - MODE_SCALEROTATE = 109, - MODE_NUT_BILINEAR = 110 -}; - -// enum for IDs of other tools on the toolbar -enum { - TB_CLEAR = 111, - TB_EDITSRC = 112, - TB_PREVIEW = 113, - TB_TRANSFORM = 114, - TB_HELP = 115, - TB_ZOOMSLIDER = 116, - TB_BGALPHA_SLIDER = 117 -}; - -enum DRAGMODETOOL -{ - DRAG_DWG = 120, - DRAG_BGIMG = 121, - DRAG_BOTH = 122 -}; - -struct DRAGMODE -{ - bool drawing; - bool bgimg; - DRAGMODE() { drawing = true, bgimg = false; } - DRAGMODE(bool d, bool b) { drawing = d, bgimg = b; } -}; diff --git a/contrib/assdraw/src/include_once.hpp b/contrib/assdraw/src/include_once.hpp deleted file mode 100644 index 9ef9e8eea..000000000 --- a/contrib/assdraw/src/include_once.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: include_once.hpp -// Purpose: A header file that is included exactly once for the whole code -// (supposed to be included by assdraw.cpp only) -// Put must-define-exactly-once codes here -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -// tooltips -const wxString TIPS_CLEAR = wxT("Clear the canvas and create a new drawing"); -const wxString TIPS_EDITSRC = wxT("Edit the source"); -const wxString TIPS_PREVIEW = wxT("Draw the shapes without enlarged points and control points"); -const wxString TIPS_TRANSFORM = wxT("Transform the drawing using matrix transformation"); -const wxString TIPS_LIBRARY = wxT("Shapes library"); -const wxString TIPS_HELP = wxT("Help! Help!"); -const wxString TIPS_PASTE = wxT("Depending on what's in the clipboard, import as drawing commands or background"); -const wxString TIPS_UNDO = wxT("Undo last action"); -const wxString TIPS_REDO = wxT("Redo last undo"); -const wxString TIPS_ARR = wxT("Drag mode"); -const wxString TIPS_M = wxT("Draw M mode (Close current shape and move the virtual pen to a new point)"); -const wxString TIPS_N = wxT("Draw N mode (Same as M but doesn't close the shape)"); -const wxString TIPS_L = wxT("Draw L mode (Straight line)"); -const wxString TIPS_B = wxT("Draw B mode (Cubic Bezier curve)"); -const wxString TIPS_S = wxT("Draw S mode (Spline)"); -const wxString TIPS_P = wxT("Draw P mode (Extends a spline with another point)"); -const wxString TIPS_C = wxT("Draw C mode (Close the last spline)"); -const wxString TIPS_DEL = wxT("Delete mode"); -const wxString TIPS_NUTB = wxT("Bilinear transformation mode: Drag the vertices to distort the shape; Dragging an edge moves two adjacent vertices together"); -const wxString TIPS_SCALEROTATE = wxT("Scale/Rotate mode: Drag a vertex or an edge to rescale the shape; Right-drag to rotate"); -const wxString TIPS_DWG = wxT("Right-dragging pans drawing, mousewheel zooms in/out drawing"); -const wxString TIPS_BGIMG = wxT("Right-dragging pans background, mousewheel zooms in/out background"); -const wxString TIPS_BOTH = wxT("Right-dragging pans drawing & background, mousewheel zooms in/out drawing & background"); - -const wxString TBNAME_DRAW = wxT("Canvas"); -const wxString TBNAME_MODE = wxT("Drawing mode"); -const wxString TBNAME_BGIMG = wxT("Background"); -const wxString TBNAME_ZOOM = wxT("Zoom"); - -wxString ASSDrawTransformDlg::combo_templatesStrings[] = { - _(" - { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 5.0f }, //5 units down - { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 5.0f, 0.0f }, //5 units left - { 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 2.0f, 1.0f, 2.0f }, //90 CW (1,2) - { 0.0f, 1.0f, -1.0f, 0.0f, -1.0f, 2.0f, -1.0f, 2.0f }, //90 CCW, (-1,2) - { -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f }, //180 (0,0) - { -1.0f, 0.0f, 0.0f, 1.0f, 4.0f, 0.0f, 4.0f, 0.0f }, //Flip X = 4 - { 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 3.0f, 0.0f, 3.0f }, //Flip Y = 3 - { 2.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }, //Scale X * 2 - { 1.0f, 0.0f, 0.0f, 3.0f, 0.0f, 0.0f, 0.0f, 0.0f } //Scale Y * 3 -}; diff --git a/contrib/assdraw/src/library.cpp b/contrib/assdraw/src/library.cpp deleted file mode 100644 index bfb7e9d97..000000000 --- a/contrib/assdraw/src/library.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "assdraw.hpp" -#include "library.hpp" - -#include - -#if !defined(__WINDOWS__) -#include "xpm/res.h" -#endif - -BEGIN_EVENT_TABLE(ASSDrawShapePreview, ASSDrawEngine) - EVT_SIZE(ASSDrawShapePreview::OnSize) -END_EVENT_TABLE() - -ASSDrawShapePreview::ASSDrawShapePreview( wxWindow *parent, ASSDrawShapeLibrary *_shapelib, wxString initialcmds ) - : ASSDrawEngine(parent, wxSIMPLE_BORDER) -{ - shapelib = _shapelib; - if (ParseASS(initialcmds) > 0) - SetFitToViewPointOnNextPaint(5, 5); - cb = new wxCheckBox(this, wxID_ANY, _T("")); -} - -void ASSDrawShapePreview::OnSize(wxSizeEvent& event) -{ - return; - wxSize siz = event.GetSize(); - - if (shapelib->layout == HORIZONTAL) - SetSize(siz.x, siz.x); - else - SetSize(siz.y, siz.y); - SetFitToViewPointOnNextPaint(10, 10); -} - -BEGIN_EVENT_TABLE(ASSDrawShapeLibrary, wxScrolledWindow) - EVT_SIZE(ASSDrawShapeLibrary::OnSize) - EVT_MENU_RANGE(MENU_RANGE_START, MENU_RANGE_END, ASSDrawShapeLibrary::OnPopupMenuClicked) - EVT_TOOL(TOOL_SAVE, ASSDrawShapeLibrary::SaveShapeFromCanvas) - EVT_TOOL_RANGE(TOOL_CHECK, TOOL_UNCHECK, ASSDrawShapeLibrary::CheckUncheckAllPreviews) - EVT_TOOL(TOOL_DELETE, ASSDrawShapeLibrary::DeleteChecked) -END_EVENT_TABLE() - -ASSDrawShapeLibrary::ASSDrawShapeLibrary( wxWindow *parent, ASSDrawFrame *frame ) - : wxScrolledWindow(parent, wxID_ANY) -{ - m_frame = frame; - //sizer = NULL; - layout = VERTICAL; - - wxToolBar *tbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT | wxTB_NODIVIDER); - tbar->SetMargins(0, 3); - tbar->AddTool(TOOL_SAVE, _T("Save canvas"), wxBITMAP(add)); - tbar->AddSeparator(); - tbar->AddTool(TOOL_CHECK, _T("Select all"), wxBITMAP(check)); - tbar->AddTool(TOOL_UNCHECK, _T("Select none"), wxBITMAP(uncheck)); - tbar->AddTool(TOOL_DELETE, _T("Delete selected"), wxBITMAP(delcross)); - - libarea = new wxScrolledWindow(this, wxID_ANY, __DPDS__ , wxScrolledWindowStyle | wxSIMPLE_BORDER); - libarea->SetBackgroundColour(wxColour(0xFF, 0xFF, 0x99)); - sizer = new wxFlexGridSizer(0, 1, 0, 0); - ((wxFlexGridSizer*) sizer)->AddGrowableCol(0); - libarea->SetSizer(sizer); - libarea->SetScrollbars(20, 20, 50, 50); - libsizer = new wxFlexGridSizer(2, 1, 0, 0); - libsizer->AddGrowableCol(0); - libsizer->AddGrowableRow(1); - libsizer->Add(tbar, 0, wxBOTTOM, 2); - libsizer->Add(libarea,1,wxEXPAND); - tbar->Realize(); - libsizer->Layout(); - - SetSizer(libsizer); -} - -void ASSDrawShapeLibrary::OnSize(wxSizeEvent& event) -{ - if (sizer == NULL || sizer->GetChildren().size() == 0) return; - - wxSize siz = GetClientSize(); - libsizer->SetDimension(0, 0, siz.x, siz.y); - - UpdatePreviewDisplays(); -} - -ASSDrawShapePreview* ASSDrawShapeLibrary::AddShapePreview(wxString cmds, bool addtotop) -{ - ASSDrawShapePreview *prev = new ASSDrawShapePreview(libarea, this, cmds); - prev->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(ASSDrawShapeLibrary::OnMouseLeftDClick), NULL, this); - prev->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(ASSDrawShapeLibrary::OnMouseRightClick), NULL, this); - ASSDrawFrame::wxColourToAggRGBA(m_frame->colors.library_shape, prev->rgba_shape); - if (addtotop) - sizer->Insert(0, prev, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5); - else - sizer->Add(prev, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5); - UpdatePreviewDisplays(); - return prev; -} - -void ASSDrawShapeLibrary::UpdatePreviewDisplays() -{ - wxSize siz = GetClientSize(); - int dim = siz.x - 15; - libarea->Show(false); - wxwxSizerItemListNode *node = sizer->GetChildren().GetFirst(); - while (node != NULL) - { - ASSDrawShapePreview *shprvw = (ASSDrawShapePreview *) node->GetData()->GetWindow(); - shprvw->SetSize(dim, dim); - sizer->SetItemMinSize(shprvw, dim - 20, dim - 20); - shprvw->SetFitToViewPointOnNextPaint(10, 10); - shprvw->Refresh(); - node = node->GetNext(); - } - sizer->Layout(); - sizer->FitInside(libarea); - libarea->Show(true); -} - -void ASSDrawShapeLibrary::OnMouseLeftDClick(wxMouseEvent &event) -{ - ASSDrawShapePreview *preview = (ASSDrawShapePreview *) event.GetEventObject(); - LoadToCanvas(preview); -} - -void ASSDrawShapeLibrary::OnMouseRightClick(wxMouseEvent &event) -{ - ASSDrawShapePreview *prev = (ASSDrawShapePreview *) event.GetEventObject(); - if (prev && prev->shapelib == this) - { - activepreview = prev; - wxMenu *menu = new wxMenu; - wxMenuItem *menuload = new wxMenuItem(menu, MENU_LOAD, _T("Load to canvas")); -#ifdef __WINDOWS__ - wxFont f = menuload->GetFont(); - f.SetWeight(wxFONTWEIGHT_BOLD); - menuload->SetFont(f); -#endif - menu->Append(menuload); - //menu->Append(MENU_LOAD, _T("Load to canvas"))->GetFont().SetWeight(wxFONTWEIGHT_BOLD); - menu->Append(MENU_COPYCLIPBOARD, _T("Copy commands to clipboard")); - menu->Append(MENU_SAVECANVAS, _T("Save canvas here")); - wxMenu *submenu = new wxMenu; - submenu->Append(MENU_DELETE, _T("Confirm delete?")); - menu->Append(MENU_DUMMY, _T("Delete from library"), submenu); - PopupMenu(menu); - delete menu; - } -} - -void ASSDrawShapeLibrary::OnPopupMenuClicked(wxCommandEvent &event) -{ - int id = event.GetId(); - switch(id) - { - case MENU_LOAD: - LoadToCanvas(activepreview); - break; - case MENU_COPYCLIPBOARD: - if (wxTheClipboard->Open()) - { - if (wxTheClipboard->IsSupported( wxDF_TEXT )) - { - wxTheClipboard->SetData( new wxTextDataObject( activepreview->GenerateASS() ) ); - } - wxTheClipboard->Close(); - } - break; - case MENU_SAVECANVAS: - activepreview->ParseASS(m_frame->m_canvas->GenerateASS()); - activepreview->SetFitToViewPointOnNextPaint(); - activepreview->RefreshDisplay(); - break; - case MENU_DELETE: - sizer->Detach(activepreview); - activepreview->Show(false); - activepreview->Destroy(); - UpdatePreviewDisplays(); - Refresh(); - break; - } -} - -void ASSDrawShapeLibrary::SaveShapeFromCanvas(wxCommandEvent& WXUNUSED(event)) -{ - AddShapePreview(m_frame->m_canvas->GenerateASS(), true); -} - -void ASSDrawShapeLibrary::CheckUncheckAllPreviews(wxCommandEvent &event) -{ - bool checked = event.GetId() == TOOL_CHECK; - wxwxSizerItemListNode *node = sizer->GetChildren().GetFirst(); - while (node != NULL) - { - ASSDrawShapePreview *shprvw = (ASSDrawShapePreview *) node->GetData()->GetWindow(); - shprvw->cb->SetValue(checked); - node = node->GetNext(); - } -} - -void ASSDrawShapeLibrary::DeleteChecked(wxCommandEvent& WXUNUSED(event)) -{ - wxwxSizerItemListNode *node = sizer->GetChildren().GetFirst(); - while (node != NULL) - { - ASSDrawShapePreview *shprvw = (ASSDrawShapePreview *) node->GetData()->GetWindow(); - if (shprvw->cb->GetValue()) - { - sizer->Detach(shprvw); - shprvw->Show(false); - shprvw->Destroy(); - } - node = node->GetNext(); - } - UpdatePreviewDisplays(); - Refresh(); -} - -std::vector< ASSDrawShapePreview *> ASSDrawShapeLibrary::GetShapePreviews() -{ - std::vector< ASSDrawShapePreview *> out; - wxwxSizerItemListNode *node = sizer->GetChildren().GetFirst(); - while (node != NULL) - { - ASSDrawShapePreview *shprvw = (ASSDrawShapePreview *) node->GetData()->GetWindow(); - out.push_back(shprvw); - node = node->GetNext(); - } - return out; -} - -void ASSDrawShapeLibrary::LoadToCanvas(ASSDrawShapePreview *preview) -{ - m_frame->m_canvas->AddUndo(_T("Load shape from library")); - m_frame->m_canvas->ParseASS(preview->GenerateASS()); - m_frame->m_canvas->RefreshDisplay(); - m_frame->m_canvas->RefreshUndocmds(); - m_frame->UpdateFrameUI(); -} diff --git a/contrib/assdraw/src/library.hpp b/contrib/assdraw/src/library.hpp deleted file mode 100644 index 20179d12f..000000000 --- a/contrib/assdraw/src/library.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#pragma once - -#include "engine.hpp" -#include - -class ASSDrawFrame; -class ASSDrawShapeLibrary; - -enum LIBLAYOUT { VERTICAL, HORIZONTAL }; - -enum { - MENU_RANGE_START = 450, - MENU_LOAD, - MENU_COPYCLIPBOARD, - MENU_SAVECANVAS, - MENU_DELETE, - MENU_RANGE_END, - TOOL_SAVE, - TOOL_CHECK, - TOOL_UNCHECK, - TOOL_DELETE -}; - -class ASSDrawShapePreview : public ASSDrawEngine -{ -protected: - ASSDrawShapePreview( wxWindow *parent, ASSDrawShapeLibrary *shapelib, wxString initialcmds = _T("")); - virtual void OnSize(wxSizeEvent& event); - - ASSDrawShapeLibrary *shapelib; - wxCheckBox *cb; - DECLARE_EVENT_TABLE() - friend class ASSDrawShapeLibrary; -}; - -class ASSDrawShapeLibrary : public wxScrolledWindow -{ -public: - ASSDrawShapeLibrary( wxWindow *parent, ASSDrawFrame *frame ); - virtual ASSDrawShapePreview* AddShapePreview(wxString cmds, bool addtotop = false); - virtual void OnSize(wxSizeEvent& event); - virtual void OnMouseLeftDClick(wxMouseEvent &event); - virtual void OnMouseRightClick(wxMouseEvent &event); - virtual void OnPopupMenuClicked(wxCommandEvent &event); - virtual void SaveShapeFromCanvas(wxCommandEvent& WXUNUSED(event)); - virtual void CheckUncheckAllPreviews(wxCommandEvent &event); - virtual void DeleteChecked(wxCommandEvent& WXUNUSED(event)); - virtual void UpdatePreviewDisplays(); - virtual std::vector< ASSDrawShapePreview *> GetShapePreviews(); - virtual void LoadToCanvas(ASSDrawShapePreview *preview); - - wxScrolledWindow* libarea; - wxFlexGridSizer *libsizer; - wxSizer* sizer; - LIBLAYOUT layout; -protected: - ASSDrawFrame *m_frame; - ASSDrawShapePreview *activepreview; - - DECLARE_EVENT_TABLE() -}; diff --git a/contrib/assdraw/src/resource.h b/contrib/assdraw/src/resource.h deleted file mode 100644 index dab23b6f5..000000000 --- a/contrib/assdraw/src/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by assdraw.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/contrib/assdraw/src/settings.cpp b/contrib/assdraw/src/settings.cpp deleted file mode 100644 index 35246a4b3..000000000 --- a/contrib/assdraw/src/settings.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/////////////////////////////////////////////////////////////////////////////// -// Name: settings.cpp -// Purpose: settings property grid -// Author: ai-chan -// Created: 08/26/06 -// Copyright: (c) ai-chan -// Licence: 3-clause BSD -/////////////////////////////////////////////////////////////////////////////// - -#include "assdraw.hpp" -#include "settings.hpp" - -DEFINE_EVENT_TYPE(wxEVT_SETTINGS_CHANGED) - -// ---------------------------------------------------------------------------- -// ASSDrawSettingsDialog -// ---------------------------------------------------------------------------- - -ASSDrawSettingsDialog::ASSDrawSettingsDialog(wxWindow *parent, ASSDrawFrame *frame, int id) - : wxPanel(parent, id) -{ - m_frame = frame; - propgrid = NULL; -} - -void ASSDrawSettingsDialog::Init() -{ - propgrid = new wxPropertyGrid(this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - //wxPG_BOLD_MODIFIED | - //wxPG_SPLITTER_AUTO_CENTER | - //wxPG_AUTO_SORT | - //wxPG_HIDE_MARGIN | wxPG_STATIC_SPLITTER | - wxPG_TOOLTIPS | - //wxPG_NOCATEGORIES | - wxTAB_TRAVERSAL //| - //wxSUNKEN_BORDER - ); - - #define APPENDCOLOURPROP(pgid, label, color) pgid = propgrid->Append(new wxColourProperty(label, wxPG_LABEL, color)); - #define APPENDUINTPROP(pgid, label, uint) \ - pgid = propgrid->Append(new wxUIntProperty(label, wxPG_LABEL, uint) ); \ - propgrid->SetPropertyValidator( pgid, validator ); - #define APPENDBOOLPROP(pgid, label, boolvar) \ - pgid = propgrid->Append(new wxBoolProperty (label, wxPG_LABEL, boolvar ) ); \ - propgrid->SetPropertyAttribute( pgid, wxPG_BOOL_USE_CHECKBOX, (long)1 ); - wxLongPropertyValidator validator(0x0,0xFF); - - propgrid->Append(new wxPropertyCategory(_T("Appearance"),wxPG_LABEL) ); - APPENDCOLOURPROP(colors_canvas_bg_pgid, _T("Canvas"), m_frame->colors.canvas_bg) - APPENDCOLOURPROP(colors_canvas_shape_normal_pgid, _T("Drawing"), m_frame->colors.canvas_shape_normal) - APPENDUINTPROP(alphas_canvas_shape_normal_pgid, _T("Drawing @"), m_frame->alphas.canvas_shape_normal) - APPENDCOLOURPROP(colors_canvas_shape_preview_pgid, _T("Preview"), m_frame->colors.canvas_shape_preview) - APPENDUINTPROP(alphas_canvas_shape_preview_pgid, _T("Preview @"), m_frame->alphas.canvas_shape_preview) - APPENDCOLOURPROP(colors_canvas_shape_outline_pgid, _T("Outline"), m_frame->colors.canvas_shape_outline) - APPENDUINTPROP(alphas_canvas_shape_outline_pgid, _T("Outline @"), m_frame->alphas.canvas_shape_outline) - APPENDCOLOURPROP(colors_canvas_shape_guideline_pgid, _T("Control lines"), m_frame->colors.canvas_shape_guideline) - APPENDUINTPROP(alphas_canvas_shape_guideline_pgid, _T("Control lines @"), m_frame->alphas.canvas_shape_guideline) - APPENDCOLOURPROP(colors_canvas_shape_mainpoint_pgid, _T("Points"), m_frame->colors.canvas_shape_mainpoint) - APPENDUINTPROP(alphas_canvas_shape_mainpoint_pgid, _T("Points @"), m_frame->alphas.canvas_shape_mainpoint) - APPENDCOLOURPROP(colors_canvas_shape_controlpoint_pgid, _T("Control points"), m_frame->colors.canvas_shape_controlpoint) - APPENDUINTPROP(alphas_canvas_shape_controlpoint_pgid, _T("Control points @"), m_frame->alphas.canvas_shape_controlpoint) - APPENDCOLOURPROP(colors_canvas_shape_selectpoint_pgid, _T("Selected points"), m_frame->colors.canvas_shape_selectpoint) - APPENDUINTPROP(alphas_canvas_shape_selectpoint_pgid, _T("Selected points @"), m_frame->alphas.canvas_shape_selectpoint) - APPENDCOLOURPROP(colors_library_libarea_pgid, _T("Library"), m_frame->colors.library_libarea) - APPENDCOLOURPROP(colors_library_shape_pgid, _T("Library shapes"), m_frame->colors.library_shape) - APPENDCOLOURPROP(colors_origin_pgid, _T("Origin"), m_frame->colors.origin) - APPENDUINTPROP(sizes_origincross_pgid, _T("Origin cross size"), m_frame->sizes.origincross) - APPENDCOLOURPROP(colors_ruler_h_pgid, _T("H ruler"), m_frame->colors.ruler_h) - APPENDCOLOURPROP(colors_ruler_v_pgid, _T("V ruler"), m_frame->colors.ruler_v) - - propgrid->Append(new wxPropertyCategory(_T("Behaviors"),wxPG_LABEL) ); - APPENDBOOLPROP(behaviors_capitalizecmds_pgid, _T("Capitalize commands"), m_frame->behaviors.capitalizecmds); - APPENDBOOLPROP(behaviors_autoaskimgopac_pgid, _T("Ask for image opacity"), m_frame->behaviors.autoaskimgopac); - APPENDBOOLPROP(behaviors_parse_spc_pgid, _T("Parse S/P/C"), m_frame->behaviors.parse_spc); - APPENDBOOLPROP(behaviors_nosplashscreen_pgid, _T("No splash screen"), m_frame->behaviors.nosplashscreen); - APPENDBOOLPROP(behaviors_confirmquit_pgid, _T("Confirm quit"), m_frame->behaviors.confirmquit); - - wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 1, 0, 0); - sizer->AddGrowableCol(0); - sizer->AddGrowableRow(0); - sizer->Add(propgrid, 1, wxEXPAND); - - wxBoxSizer *bsizer = new wxBoxSizer(wxHORIZONTAL); - wxButton *abutton = new wxButton(this, wxID_ANY, _T("Apply")); - abutton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ASSDrawSettingsDialog::OnSettingsApplyButtonClicked), NULL, this); - bsizer->Add(abutton, 2, wxEXPAND); - wxButton *rbutton = new wxButton(this, wxID_ANY, _T("Revert")); - rbutton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ASSDrawSettingsDialog::OnSettingsRevertButtonClicked), NULL, this); - bsizer->Add(rbutton, 1, wxEXPAND); - bsizer->Layout(); - - sizer->Add(bsizer, 1, wxEXPAND); - sizer->Layout(); - SetSizer(sizer); -} - -ASSDrawSettingsDialog::~ASSDrawSettingsDialog() -{ - if (propgrid) propgrid->Clear(); -} - -void ASSDrawSettingsDialog::OnSettingsApplyButtonClicked(wxCommandEvent &event) -{ - - wxButton *button = (wxButton *) event.GetEventObject(); - //wxPropertyGrid *propgrid = (wxPropertyGrid *) button->GetClientData(); - if (propgrid == NULL) return; - - #define PARSECOLOR(color, pgid) \ - { \ - wxVariant variant = propgrid->GetPropertyValue(pgid); \ - color = *wxGetVariantCast(variant,wxColour); \ - } - - #define PARSE(ptr, pgid) propgrid->GetPropertyValue(pgid).Convert(ptr); - - PARSECOLOR(m_frame->colors.canvas_bg, colors_canvas_bg_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_controlpoint, colors_canvas_shape_controlpoint_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_guideline, colors_canvas_shape_guideline_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_mainpoint, colors_canvas_shape_mainpoint_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_normal, colors_canvas_shape_normal_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_outline, colors_canvas_shape_outline_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_preview, colors_canvas_shape_preview_pgid) - PARSECOLOR(m_frame->colors.canvas_shape_selectpoint, colors_canvas_shape_selectpoint_pgid) - PARSECOLOR(m_frame->colors.library_libarea, colors_library_libarea_pgid) - PARSECOLOR(m_frame->colors.library_shape, colors_library_shape_pgid) - PARSECOLOR(m_frame->colors.origin, colors_origin_pgid) - PARSECOLOR(m_frame->colors.ruler_h, colors_ruler_h_pgid) - PARSECOLOR(m_frame->colors.ruler_v, colors_ruler_v_pgid) - - PARSE(&m_frame->alphas.canvas_shape_controlpoint, alphas_canvas_shape_controlpoint_pgid) - PARSE(&m_frame->alphas.canvas_shape_guideline, alphas_canvas_shape_guideline_pgid) - PARSE(&m_frame->alphas.canvas_shape_mainpoint, alphas_canvas_shape_mainpoint_pgid) - PARSE(&m_frame->alphas.canvas_shape_normal, alphas_canvas_shape_normal_pgid) - PARSE(&m_frame->alphas.canvas_shape_outline, alphas_canvas_shape_outline_pgid) - PARSE(&m_frame->alphas.canvas_shape_preview, alphas_canvas_shape_preview_pgid) - PARSE(&m_frame->alphas.canvas_shape_selectpoint, alphas_canvas_shape_selectpoint_pgid) - - PARSE(&m_frame->sizes.origincross, sizes_origincross_pgid) - - PARSE(&m_frame->behaviors.autoaskimgopac, behaviors_autoaskimgopac_pgid) - PARSE(&m_frame->behaviors.capitalizecmds, behaviors_capitalizecmds_pgid) - PARSE(&m_frame->behaviors.parse_spc, behaviors_parse_spc_pgid) - PARSE(&m_frame->behaviors.nosplashscreen, behaviors_nosplashscreen_pgid) - PARSE(&m_frame->behaviors.confirmquit, behaviors_confirmquit_pgid) - - wxCommandEvent evento( wxEVT_SETTINGS_CHANGED, event.GetId() ); - evento.SetEventObject( button ); - m_frame->GetEventHandler()->ProcessEvent( evento ); - -} - -void ASSDrawSettingsDialog::OnSettingsRevertButtonClicked(wxCommandEvent &event) -{ - RefreshSettingsDisplay(); -} - -void ASSDrawSettingsDialog::RefreshSettingsDisplay() -{ - if (propgrid == NULL) return; - - #define UPDATESETTING(value, pgid) propgrid->SetPropertyValue(pgid, value); - - UPDATESETTING(m_frame->colors.canvas_bg, colors_canvas_bg_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_controlpoint, colors_canvas_shape_controlpoint_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_guideline, colors_canvas_shape_guideline_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_mainpoint, colors_canvas_shape_mainpoint_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_normal, colors_canvas_shape_normal_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_outline, colors_canvas_shape_outline_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_preview, colors_canvas_shape_preview_pgid) - UPDATESETTING(m_frame->colors.canvas_shape_selectpoint, colors_canvas_shape_selectpoint_pgid) - UPDATESETTING(m_frame->colors.library_libarea, colors_library_libarea_pgid) - UPDATESETTING(m_frame->colors.library_shape, colors_library_shape_pgid) - UPDATESETTING(m_frame->colors.origin, colors_origin_pgid) - UPDATESETTING(m_frame->colors.ruler_h, colors_ruler_h_pgid) - UPDATESETTING(m_frame->colors.ruler_v, colors_ruler_v_pgid) - - UPDATESETTING(m_frame->alphas.canvas_shape_controlpoint, alphas_canvas_shape_controlpoint_pgid) - UPDATESETTING(m_frame->alphas.canvas_shape_guideline, alphas_canvas_shape_guideline_pgid) - UPDATESETTING(m_frame->alphas.canvas_shape_mainpoint, alphas_canvas_shape_mainpoint_pgid) - UPDATESETTING(m_frame->alphas.canvas_shape_normal, alphas_canvas_shape_normal_pgid) - UPDATESETTING(m_frame->alphas.canvas_shape_outline, alphas_canvas_shape_outline_pgid) - UPDATESETTING(m_frame->alphas.canvas_shape_preview, alphas_canvas_shape_preview_pgid) - UPDATESETTING(m_frame->alphas.canvas_shape_selectpoint, alphas_canvas_shape_selectpoint_pgid) - - UPDATESETTING(m_frame->sizes.origincross, sizes_origincross_pgid) - - UPDATESETTING(m_frame->behaviors.capitalizecmds, behaviors_capitalizecmds_pgid) - UPDATESETTING(m_frame->behaviors.autoaskimgopac, behaviors_autoaskimgopac_pgid) - UPDATESETTING(m_frame->behaviors.parse_spc, behaviors_parse_spc_pgid) - UPDATESETTING(m_frame->behaviors.nosplashscreen, behaviors_nosplashscreen_pgid) - UPDATESETTING(m_frame->behaviors.confirmquit, behaviors_confirmquit_pgid) - -} diff --git a/contrib/assdraw/src/settings.hpp b/contrib/assdraw/src/settings.hpp deleted file mode 100644 index 835fe7df7..000000000 --- a/contrib/assdraw/src/settings.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#pragma once - -#include "_common.hpp" -#include -#include - -class ASSDrawFrame; - -DECLARE_EVENT_TYPE(wxEVT_SETTINGS_CHANGED, -1) - -typedef wxPGProperty* wxPGId; - -class ASSDrawSettingsDialog : public wxPanel -{ -public: - - ASSDrawFrame* m_frame; - - ASSDrawSettingsDialog( wxWindow *parent, ASSDrawFrame *frame, int id = wxID_ANY ); - virtual ~ASSDrawSettingsDialog(); - - virtual void Init(); - virtual void OnSettingsApplyButtonClicked(wxCommandEvent &event); - virtual void OnSettingsRevertButtonClicked(wxCommandEvent &event); - virtual void RefreshSettingsDisplay(); - - wxPGId colors_canvas_bg_pgid; - wxPGId colors_canvas_shape_normal_pgid; - wxPGId colors_canvas_shape_preview_pgid; - wxPGId colors_canvas_shape_outline_pgid; - wxPGId colors_canvas_shape_guideline_pgid; - wxPGId colors_canvas_shape_mainpoint_pgid; - wxPGId colors_canvas_shape_controlpoint_pgid; - wxPGId colors_canvas_shape_selectpoint_pgid; - wxPGId colors_library_shape_pgid; - wxPGId colors_library_libarea_pgid; - wxPGId colors_origin_pgid; - wxPGId colors_ruler_h_pgid; - wxPGId colors_ruler_v_pgid; - wxPGId alphas_canvas_shape_normal_pgid; - wxPGId alphas_canvas_shape_preview_pgid; - wxPGId alphas_canvas_shape_outline_pgid; - wxPGId alphas_canvas_shape_guideline_pgid; - wxPGId alphas_canvas_shape_mainpoint_pgid; - wxPGId alphas_canvas_shape_controlpoint_pgid; - wxPGId alphas_canvas_shape_selectpoint_pgid; - wxPGId sizes_origincross_pgid; - wxPGId behaviors_capitalizecmds_pgid; - wxPGId behaviors_autoaskimgopac_pgid; - wxPGId behaviors_parse_spc_pgid; - wxPGId behaviors_nosplashscreen_pgid; - wxPGId behaviors_confirmquit_pgid; - - wxPropertyGrid *propgrid; - //DECLARE_EVENT_TABLE() - -}; - -class wxLongPropertyValidator : public wxValidator -{ -public: - - wxLongPropertyValidator( const int min, const int max ) - : wxValidator() - { - m_min = min, m_max = max; - } - - virtual wxObject* Clone() const - { - return new wxLongPropertyValidator( m_min, m_max ); - } - - virtual bool Validate(wxWindow* WXUNUSED(parent)) - { - wxTextCtrl* tc = wxDynamicCast(GetWindow(), wxTextCtrl); - wxCHECK_MSG(tc, true, wxT("validator window must be wxTextCtrl")); - - wxString val = tc->GetValue(); - - long valint = 0; - val.ToLong(&valint); - - if (valint < m_min) valint = m_min; - if (valint > m_max) valint = m_max; - - tc->SetValue(wxString::Format(_T("%d"), valint)); - - return true; - } - -private: - int m_min, m_max; -}; diff --git a/contrib/assdraw/src/t-stringifier.pl b/contrib/assdraw/src/t-stringifier.pl deleted file mode 100644 index c1157a05e..000000000 --- a/contrib/assdraw/src/t-stringifier.pl +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/perl - -########################### -# t-stringifier.pl - replaces "strings" with _T("strings") -# -# Usage: t-stringifier.pl file1 [file2 [file...]] -# NOTE: changes existing files in place so backup stuff or rewrite the script -# (more specifically comment out the rename() call at the end of the main loop) -# if you're paranoid. -# -# Written by Karl Blomster 2008 -# This script is in the public domain. -########################### - - -use warnings; -use strict; - -my @infiles = @ARGV; - -foreach my $infile (@infiles) { - my $outfile = $infile . ".out"; - open(INFILE, "<", $infile) or die("Couldn't open $infile for reading: $!"); - open(OUTFILE, ">", $outfile) or die("Couldn't open $outfile for writing: $!"); - - print("Processing: $infile \n"); - - while () { - print OUTFILE $_ and next() if (m!^#\s*include!); - - my $line = $_; - - $line =~ s/(_T\(|_\(|wxT\()?"(.*?)(? - -namespace GUI { - - BEGIN_EVENT_TABLE(AGGWindow, wxWindow) - EVT_PAINT(AGGWindow::onPaint) - EVT_SIZE(AGGWindow::onSize) - EVT_ERASE_BACKGROUND(AGGWindow::onEraseBackground) - END_EVENT_TABLE() - - AGGWindow::AGGWindow(wxWindow* parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, long style): - wxWindow(parent, id, pos, size, style, wxT("AGGWindow")), - bitmap(NULL) { - } - - void AGGWindow::init(const int width, const int height) { - memDC.SelectObject(wxNullBitmap); - delete bitmap; - - int ncheight = height, ncwidth = width; - if (ncwidth < 1) ncwidth = 1; - if (ncheight < 1) ncheight = 1; - - bitmap = new wxBitmap(ncwidth, ncheight, PixelFormat::wxWidgetsType::BitsPerPixel); - - // Draw the bitmap - attachAndDraw(); - - memDC.SelectObject(*bitmap); - - // Request a full redraw of the window - Refresh(false); - } - - AGGWindow::~AGGWindow() { - memDC.SelectObject(wxNullBitmap); - delete bitmap; - } - - void AGGWindow::attachAndDraw() { - // Get raw access to the wxWidgets bitmap -- this locks the pixels and - // unlocks on destruction. - PixelData data(*bitmap); - assert(data); - -#if 1 - // This cast looks like it is ignoring byte-ordering, but the - // pixel format already explicitly handles that. - assert(data.GetPixels().IsOk()); - wxAlphaPixelFormat::ChannelType* pd = (wxAlphaPixelFormat::ChannelType*) &data.GetPixels().Data(); - - // wxWidgets always returns a pointer to the first row of pixels, whether - // that is stored at the beginning of the buffer (stride > 0) or at the - // end of the buffer (stride < 0). AGG always wants a pointer to the - // beginning of the buffer, no matter what the stride. (AGG does handle - // negative strides correctly.) - // Upshot: if the stride is negative, rewind the pointer from the end of - // the buffer to the beginning. - const int stride = data.GetRowStride(); - if (stride < 0) - pd += (data.GetHeight() - 1) * stride; - - rBuf.attach(pd, data.GetWidth(), data.GetHeight(), stride); - - // Call the user code to actually draw. - draw(); -#else - PixelData::Iterator p(data); - - // we draw a (10, 10)-(20, 20) rect manually using the given r, g, b - p.Offset(data, 10, 10); - - for ( int y = 0; y < 10; ++y ) - { - PixelData::Iterator rowStart = p; - - for ( int x = 0; x < 10; ++x, ++p ) - { - p.Red() = 255; - p.Green() = 0; - p.Blue() = 255; - } - - p = rowStart; - p.OffsetY(data, 1); - } -#endif - } - - void AGGWindow::onSize(wxSizeEvent& event) { - const wxSize size = GetClientSize(); - if (bitmap && size.GetWidth() == bitmap->GetWidth() && size.GetHeight() == bitmap->GetHeight()) - return; - - init(size.GetWidth(), size.GetHeight()); - } - - void AGGWindow::onPaint(wxPaintEvent& event) { - wxPaintDC dc(this); - - wxCoord width, height; - dc.GetSize(&width, &height); - if (!bitmap || bitmap->GetWidth() != width || bitmap->GetHeight() != height) - init(width, height); - - // Iterate over regions needing repainting - wxRegionIterator regions(GetUpdateRegion()); - wxRect rect; - while (regions) { - rect = regions.GetRect(); - dc.Blit(rect.x, rect.y, rect.width, rect.height, &memDC, rect.x, rect.y); - ++regions; - } - } - - void AGGWindow::onEraseBackground(wxEraseEvent& WXUNUSED(event)) { - // Do nothing to "avoid flashing in MSW" Grr. - } - -} - diff --git a/contrib/assdraw/src/wxAGG/AGGWindow.h b/contrib/assdraw/src/wxAGG/AGGWindow.h deleted file mode 100644 index 01039da39..000000000 --- a/contrib/assdraw/src/wxAGG/AGGWindow.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef WX_AGG_WINDOW_H -#define WX_AGG_WINDOW_H - -#include "PixelFormatConvertor.h" - -#include -#include -#include -#include - -#include "agg_rendering_buffer.h" - -namespace GUI { - - /// A simple widget that displays a bitmap that AGG can draw on. - /// It reallocates the bitmap so that it always is the current size of the - /// entire panel and calls the virtual method draw() to draw to the bitmap. - /// This should be useable anywhere a wxWindow can be, e.g. in actual windows, - /// buttons, etc. - class AGGWindow: public wxWindow { - public: - /// Create an AGGWindow. Defaults are taken from wxWindow::wxWindow(), see - /// that documentation for more information. - AGGWindow(wxWindow* parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL); - - /// Clean up resources held - virtual ~AGGWindow(); - - protected: - - /// The conversion between wxWidgets' pixel format and AGG's pixel format - typedef PixelFormatConvertor PixelFormat; - - /// The wxWidgets "pixel data" type, an accessor to the raw pixels - typedef wxPixelData PixelData; - - - /// Create the bitmap given the current size. - void init(const int width, const int height); - - /// Attach the AGG rendering buffer to the bitmap and call the user draw() code. - void attachAndDraw(); - - /// Paint the bitmap onto the panel. - void onPaint(wxPaintEvent& event); - - /// Resize the bitmap to match the window. - void onSize(wxSizeEvent& event); - - /// Handle the erase-background event. - void onEraseBackground(wxEraseEvent& event); - - /// Draw into the bitmap using AGG. - virtual void draw() = 0; - - - wxBitmap* bitmap; ///< wxWidgets bitmap for AGG to draw into - wxMemoryDC memDC; ///< Memory "device context" for drawing the bitmap - - agg::rendering_buffer rBuf; ///< AGG's rendering buffer, pointing into the bitmap - - DECLARE_EVENT_TABLE() /// Allocate wxWidgets storage for event handlers - }; -} - -#endif diff --git a/contrib/assdraw/src/wxAGG/Makefile.am b/contrib/assdraw/src/wxAGG/Makefile.am deleted file mode 100644 index 30e088286..000000000 --- a/contrib/assdraw/src/wxAGG/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AM_CXXFLAGS = @WX_CPPFLAGS@ @LIBAGG_CFLAGS@ - -noinst_LIBRARIES = libaggwindow.a - -libaggwindow_a_SOURCES = \ - AGGWindow.cpp \ - AGGWindow.h \ - PixelFormatConvertor.h diff --git a/contrib/assdraw/src/wxAGG/PixelFormatConvertor.h b/contrib/assdraw/src/wxAGG/PixelFormatConvertor.h deleted file mode 100644 index d1b0741c4..000000000 --- a/contrib/assdraw/src/wxAGG/PixelFormatConvertor.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2007, ai-chan -* All rights reserved. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the ASSDraw3 Team nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY AI-CHAN ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL AI-CHAN BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef WX_AGG_PIXEL_FORMAT_CONVERTOR_H -#define WX_AGG_PIXEL_FORMAT_CONVERTOR_H - -#include "agg_pixfmt_rgb.h" -#include "agg_pixfmt_rgba.h" - -namespace { - - /// Given a particular combination of channel type, bits per pixel and - /// channel indices, return the AGG format that matches. - /// The actual template specializations that follow give the actual types, - /// and using a combination of parameters that are not listed will give - /// a compile-time error. - template - struct wxWidgetsToAGGHelper { - //empty - }; - - /// 24-bit RGB - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_rgb24 format; - }; - - /// 24-bit BGR - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_bgr24 format; - }; - - /// 32-bit RGB, alpha unused but stored as ARGB. - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_argb32 format; - }; - - /// 32-bit RGB, alpha unused but stored as RGBA. - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_rgba32 format; - }; - - /// 32-bit BGR, alpha unused but stored as ABGR. - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_abgr32 format; - }; - - /// 32-bit BGR, alpha unused but stored as BGRA. - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_bgra32 format; - }; - - /// 32-bit RGBA - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_rgba32 format; - }; - - /// 32-bit BGRA - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_bgra32 format; - }; - - /// 32-bit ARGB - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_argb32 format; - }; - - /// 32-bit ABGR - template <> struct wxWidgetsToAGGHelper { - typedef agg::pixfmt_abgr32 format; - }; -} - -namespace GUI { - /// Convert between a wxWidgets pixel format class and an AGG pixel format class. - /// Usage examples: - /// PixelFormatConvertor::AGGType or - /// PixelFormatConvertor::AGGType. - template - class PixelFormatConvertor { - public: - typedef wxWidgetsPixelFormat wxWidgetsType; - - // Break out the wxWidgets parameters and feed to the helper class. - typedef typename wxWidgetsToAGGHelper::format AGGType; - }; -} - -#endif diff --git a/contrib/assdraw/src/xpm/Makefile.am b/contrib/assdraw/src/xpm/Makefile.am deleted file mode 100644 index 77d90ad68..000000000 --- a/contrib/assdraw/src/xpm/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_LIBRARIES = libres.a - -libres_a_SOURCES = res.cpp res.h - diff --git a/contrib/assdraw/src/xpm/add__xpm.xpm b/contrib/assdraw/src/xpm/add__xpm.xpm deleted file mode 100644 index b118b1acf..000000000 --- a/contrib/assdraw/src/xpm/add__xpm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -const char *add_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -" c black", -". c #99999999FFFF", -"X c None", -/* pixels */ -"XXXXX XXXXX", -"XXXXX .... XXXXX", -"XXXXX .... XXXXX", -"XXXXX .... XXXXX", -"X .... X", -"X ............ X", -"X ............ X", -"X ............ X", -"X ............ X", -"X .... X", -"XXXXX .... XXXXX", -"XXXXX .... XXXXX", -"XXXXX .... XXXXX", -"XXXXX XXXXX", -"XXXXXXXXXXXXXXXX" -}; diff --git a/contrib/assdraw/src/xpm/appico_xpm.xpm b/contrib/assdraw/src/xpm/appico_xpm.xpm deleted file mode 100644 index f80ee6c27..000000000 --- a/contrib/assdraw/src/xpm/appico_xpm.xpm +++ /dev/null @@ -1,292 +0,0 @@ -/* XPM */ -const char *appico_xpm[] = { -/* columns rows colors chars-per-pixel */ -"32 32 254 2", -" c black", -". c #121508", -"X c #1E1913", -"o c #222200", -"O c #252817", -"+ c #313117", -"@ c #15152A", -"# c #2A002A", -"$ c #3F003F", -"% c #3F1F3F", -"& c #332023", -"* c #26392C", -"= c #333223", -"- c #322E36", -"; c #2C3939", -": c #4D313F", -"> c #55383E", -", c #555500", -"< c #464F2B", -"1 c #54542A", -"2 c #4D4E3F", -"3 c #575937", -"4 c #5E672D", -"5 c #6D7029", -"6 c #362B56", -"7 c #363571", -"8 c #4C355F", -"9 c #583B55", -"0 c #443579", -"q c #3C4575", -"w c #4A4757", -"e c #644D5D", -"r c #6A5D5A", -"t c #50624A", -"y c #626448", -"u c #626D51", -"i c #787A55", -"p c #554875", -"a c #67537A", -"s c #70517F", -"d c #756C60", -"f c #7F7C65", -"g c #626D75", -"h c #637479", -"j c #AB713F", -"k c #AF7D4C", -"l c #8F7662", -"z c #9C7277", -"x c #E76F5B", -"c c #81992A", -"v c #D3B80F", -"b c #EFBE0F", -"n c #C1A821", -"m c #F5CE11", -"M c #DDCC22", -"N c #90805C", -"B c #97A447", -"V c #8BBB4C", -"C c #91B648", -"Z c #99AA55", -"A c #91BB5D", -"S c #A5B859", -"D c #8B8F65", -"F c #959469", -"G c #878B7D", -"H c #989970", -"J c #AB956B", -"K c #BABC6D", -"L c #ACA977", -"P c #B8B376", -"I c #C7814B", -"U c #EB8D50", -"Y c #DB8A69", -"T c #DAA87A", -"R c #A0C64B", -"E c #BEC254", -"W c #A9D058", -"Q c #AEC96B", -"! c #AAD071", -"~ c #D1D647", -"^ c #DBDF5C", -"/ c #CCE252", -"( c #D8ED5F", -") c #E5EC56", -"_ c #E2F35A", -"` c #FEFE59", -"' c #CECF6F", -"] c #C6D460", -"[ c #D7DC65", -"{ c #CFD47E", -"} c #D5D879", -"| c #CAE365", -" . c #D3EB6C", -".. c #D0EA72", -"X. c #E3E864", -"o. c #EBF268", -"O. c #FDFD66", -"+. c #E3E976", -"@. c #E8F376", -"#. c #FDFD74", -"$. c #3B3D8E", -"%. c #3B3CA8", -"&. c #413DB3", -"*. c #554887", -"=. c #405587", -"-. c #494197", -";. c #544894", -":. c #5E5896", -">. c #654F9C", -",. c #655A9B", -"<. c #785E98", -"1. c #577494", -"2. c #67718D", -"3. c #78778A", -"4. c #65639A", -"5. c #756499", -"6. c #667F99", -"7. c #73769E", -"8. c #4C4BB1", -"9. c #6E5CA1", -"0. c #745DA2", -"q. c #615AB9", -"w. c #6B66A8", -"e. c #7B65A7", -"r. c #797BA3", -"t. c #6B66B7", -"y. c #7565B2", -"u. c #7A7BB5", -"i. c #4443C6", -"p. c #6E63CC", -"a. c #796BC6", -"s. c #7673C2", -"d. c #6B64D8", -"f. c #766DD7", -"g. c #7C74D6", -"h. c #7C74E0", -"j. c #816CAF", -"k. c #8964B8", -"l. c #867AB6", -"z. c #8479D8", -"x. c #917BD3", -"c. c #887BE7", -"v. c #917BE8", -"b. c #8D79F4", -"n. c #987CF9", -"m. c #6481A1", -"M. c #7B83B8", -"N. c #868289", -"B. c #979D80", -"V. c #888695", -"C. c #8C929A", -"Z. c #9A9898", -"A. c #A69898", -"S. c #98BF95", -"D. c #B3AE8E", -"F. c #B7B98C", -"G. c #ACAB96", -"H. c #B6B792", -"J. c #8A88A8", -"K. c #9285AA", -"L. c #9996A3", -"P. c #8480BE", -"I. c #978EBC", -"U. c #9E9DBA", -"Y. c #A39BB6", -"T. c #93B8B1", -"R. c #A8A0A6", -"E. c #B3A9AF", -"W. c #B4B0A4", -"Q. c #A8A6B6", -"!. c #B3AFBF", -"~. c #B9B6B6", -"^. c #D3AC80", -"/. c #DABC98", -"(. c #E1AC82", -"). c #FFBB89", -"_. c #E9BD91", -"`. c #C5B7A7", -"'. c #BEC18C", -"]. c #A6C19D", -"[. c #98C6B1", -"{. c #A4C7AA", -"}. c #C8C385", -"|. c #D1D28E", -" X c #C7C998", -".X c #CCD59C", -"XX c #FFC18C", -"oX c #E9C994", -"OX c #F4C890", -"+X c #E9D198", -"@X c #FFD698", -"#X c #DAE082", -"$X c #D8ED9A", -"%X c #FFE19F", -"&X c #F0F09E", -"*X c #D5CEA3", -"=X c #D9D9A5", -"-X c #C7C3B8", -";X c #D4C8BB", -":X c #DCD8B8", -">X c #EBCAA2", -",X c #FADBA1", -".i.%.7 ,X,X,X6XZXZXoXx x Y ZXZX6X@X_.eXkXkXg.q.h.w. ", -" p 9 ;.i.&.0 l >X2X6XZXZX6XoX_.5XZXZX6X2X/.0XkXc.t.q.t.9X ", -" & *.i.&.0 6 6 K.-XVXAXZXZXZXZXZXZX4X`.:.z.kX8.8.p e 5. ", -" -.i.%.9 6 6 &.8.w.V. XZXZX2XG.J.w.8.8.c.iX8.-.a > 9 ", -" 7 %.7 X X 7 %.=.T.N I I j 1.1.$.7 8.c.t.%.6 - ", -" ; $.B v c c t m.[.[.J U U k [.T.u H.Z.7Xg q t o ", -" * v m m +.! [.bX[.k U U J ].4X c #A2A29F9F9F9F", -", c #B6B6B6B6B6B6", -"< c gray74", -"1 c #C5C5C5C5C5C5", -"2 c #C9C9C9C9CACA", -"3 c gray80", -"4 c #CDCDCDCDCDCD", -"5 c #CECECECECECE", -"6 c #D0D0D0D0D0D0", -"7 c #D1D1D1D1D0D0", -"8 c gray82", -"9 c gray83", -"0 c #D7D7D7D7D6D6", -"q c #D7D7D7D7D7D7", -"w c gainsboro", -"e c #DFDFDFDFDFDF", -"r c #E2E2E2E2E2E2", -"t c gray90", -"y c #E6E6E6E6E6E6", -"u c #EAEAEAEAEAEA", -"i c #ECECECECECEC", -"p c gray93", -"a c #F2F2F3F3F2F2", -"s c #F9F9F9F9F9F9", -"d c gray99", -"f c gray100", -"g c None", -/* pixels */ -"ggggyggggggggggg", -"gggg-9gggggggggg", -"gggg- 8ggggggggg", -"gggg-0 5gggggggg", -"gggg-f,#5ggggggg", -"gggg-fs* 5gggggg", -"gggg-dp,* 4ggggg", -"gggg-ae2>* 5gggg", -"gggg-t7X uggg", -"gggg-0% X193gggg", -"gggg-$<@ &gggggg", -"gggg-6w: oqggggg", -"ggggiggrO =ggggg", -"gggggggw;.+pgggg", -"ggggggggt +ugggg" -}; diff --git a/contrib/assdraw/src/xpm/arr__xpm.xpm b/contrib/assdraw/src/xpm/arr__xpm.xpm deleted file mode 100644 index 5022b7852..000000000 --- a/contrib/assdraw/src/xpm/arr__xpm.xpm +++ /dev/null @@ -1,64 +0,0 @@ -/* XPM */ -const char *arr__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 43 1", -" c black", -". c gray1", -"X c gray2", -"o c gray9", -"O c #282828282828", -"+ c #2A2A2A2A2A2A", -"@ c #3A3A3A3A3A3A", -"# c #3C3C3C3C3C3C", -"$ c #494949494949", -"% c gray35", -"& c #747473737373", -"* c #777777777777", -"= c #888887878787", -"- c #8F8F8E8E8E8E", -"; c gray60", -": c #9D9D9D9D9D9D", -"> c #A2A29F9F9F9F", -", c #B6B6B6B6B6B6", -"< c gray74", -"1 c #C5C5C5C5C5C5", -"2 c #C9C9C9C9CACA", -"3 c gray80", -"4 c #CDCDCDCDCDCD", -"5 c #CECECECECECE", -"6 c #D0D0D0D0D0D0", -"7 c #D1D1D1D1D0D0", -"8 c gray82", -"9 c gray83", -"0 c #D7D7D7D7D6D6", -"q c #D7D7D7D7D7D7", -"w c gainsboro", -"e c #DFDFDFDFDFDF", -"r c #E2E2E2E2E2E2", -"t c gray90", -"y c #E6E6E6E6E6E6", -"u c #EAEAEAEAEAEA", -"i c #ECECECECECEC", -"p c gray93", -"a c #F2F2F3F3F2F2", -"s c #F9F9F9F9F9F9", -"d c gray99", -"f c gray100", -"g c None", -/* pixels */ -"ggggyggggggggggg", -"gggg-9gggggggggg", -"gggg- 8ggggggggg", -"gggg-0 5gggggggg", -"gggg-f,#5ggggggg", -"gggg-fs* 5gggggg", -"gggg-dp,* 4ggggg", -"gggg-ae2>* 5gggg", -"gggg-t7X uggg", -"gggg-0% X193gggg", -"gggg-$<@ &gggggg", -"gggg-6w: oqggggg", -"ggggiggrO =ggggg", -"gggggggw;.+pgggg", -"ggggggggt +ugggg" -}; diff --git a/contrib/assdraw/src/xpm/assdraw3_xpm.xpm b/contrib/assdraw/src/xpm/assdraw3_xpm.xpm deleted file mode 100644 index 3fec4fe03..000000000 --- a/contrib/assdraw/src/xpm/assdraw3_xpm.xpm +++ /dev/null @@ -1,362 +0,0 @@ -/* XPM */ -const char *assdraw3__xpm[] = { -/* columns rows colors chars-per-pixel */ -"400 100 256 2", -" c #28AB0BFA0F09", -". c #28960E0E13CB", -"X c #765D23C626EF", -"o c #5590382452C9", -"O c #7143583C597E", -"+ c #72C050027049", -"@ c #83F81A0E1A0E", -"# c #8C6430583368", -"$ c #87FC3C8E4395", -"% c #917749A94FF5", -"& c #910059486920", -"* c #90BF6D3E70D5", -"= c #A1096E346C0F", -"- c #AF2F96FE721A", -"; c #E654B694684E", -": c #F2CAC2D668DF", -"> c #36C239BEABF3", -", c #37064141AE58", -"< c #3A9D4229AE8E", -"1 c #3AC846E1B34F", -"2 c #3C664C47B584", -"3 c #3BF750FEB66D", -"4 c #3D4E5802BC51", -"5 c #3DC96161BF79", -"6 c #7636552590B8", -"7 c #42114D5DB551", -"8 c #40404F4FB8B8", -"9 c #43FB5266B639", -"0 c #48C55424B730", -"q c #431255BABB08", -"w c #43E45BA1BCB2", -"e c #4DB45926BA20", -"r c #4AD25C1DBC76", -"t c #49CD6262BE4E", -"y c #52676459BEE3", -"u c #3DDF6E97C9D7", -"i c #4CA86B87C7C7", -"p c #497E78D9CCD2", -"a c #568C78CFCC0E", -"s c #49297A84D662", -"d c #55427C03D410", -"f c #5C9C7BFCD1E1", -"g c #933A70B08E99", -"h c #9CB272409D38", -"j c #93B971DCAEBB", -"k c #C4C47F7F8181", -"l c #994977CACA20", -"z c #993C778ED200", -"x c #A3097D4AC62C", -"c c #3EBF8808D757", -"v c #062B96DFFFFF", -"b c #18349E22FFFF", -"n c #343E8F05FFFF", -"m c #3A3A8F8FFFFF", -"M c #341392F7FFFF", -"N c #3BD4949CFFFF", -"B c #32339C25FFFF", -"V c #3C0D9BCEFFFF", -"C c #2222A2A2FFFF", -"Z c #2CFFA676FFFF", -"A c #2E92AC92FFFF", -"S c #313FA3C1FFFF", -"D c #3C29A42BFFF8", -"F c #340BAB35FFFF", -"G c #3C4AACD6FFE6", -"H c #2CE2B584FFFF", -"J c #2C41B8DBFFFF", -"K c #33D1B5BCFFFF", -"L c #3C20B48CFF30", -"P c #3450B985FFFF", -"I c #3C65BACAFF95", -"U c #56F68383CEA6", -"Y c #487F87FED841", -"T c #4C358CDFD71A", -"R c #582F8856D760", -"E c #5852979FDC15", -"W c #66CD8807D103", -"Q c #65B489C4D61F", -"! c #66D796E9DB25", -"~ c #74009813DB2B", -"^ c #5D38A1EADF83", -"/ c #6E44A421DE0C", -"( c #4F5F8B86E567", -") c #48969863E8D8", -"_ c #587D97F7E9E9", -"` c #496A97B0F5EB", -"' c #43A49648FE2B", -"] c #43689BE0FF5B", -"[ c #4B189CEBFF90", -"{ c #55CC9C62F711", -"} c #66E799F6E703", -"| c #726B9C5AE460", -" . c #488DA8B4ECBC", -".. c #586DA881E935", -"X. c #4E4EB0B0EFEF", -"o. c #5A4DB224EDFF", -"O. c #46F4A98AF404", -"+. c #4321A3AFFF1B", -"@. c #4D27A393FF7A", -"#. c #4354ABEDFEE4", -"$. c #4BD7AC56FEFA", -"%. c #55A2A7C4F48D", -"&. c #53DDA385FE94", -"*. c #5BE8A589FF9D", -"=. c #5363AC12FEB9", -"-. c #5C99AB49FFB8", -";. c #4807B49BF5C3", -":. c #4317B372FF10", -">. c #4C03B446FECA", -",. c #43A1BD08FF53", -"<. c #4B12BCE2FE59", -"1. c #56B2B52EF88E", -"2. c #5296B4E1FF39", -"3. c #5480BAE7FF1E", -"4. c #5C2ABBB4FF9F", -"5. c #678AA81EE7FD", -"6. c #775EA85EE91D", -"7. c #66F9B3C5EC19", -"8. c #7987B6D6EB12", -"9. c #63F0AB70FF9C", -"0. c #67F1AA89FB42", -"q. c #7568ACF4F599", -"w. c #65CEB620FA05", -"e. c #6BE7B352FFDB", -"r. c #62D6BCE6FFC1", -"t. c #69D7BDA0FFC7", -"y. c #7445B41AFFB0", -"u. c #7771B90BFB58", -"i. c #7CFBBBB9FFDA", -"p. c #465DC0C0FFFF", -"a. c #4B39C159FFF4", -"s. c #5402C363FFEE", -"d. c #5C08C549FFC7", -"f. c #5E4AC8C8FFD7", -"g. c #7D27C0C0EFEF", -"h. c #6BC1C26CF6EA", -"j. c #637AC51CFF58", -"k. c #6C8BC406FF82", -"l. c #6459C983FFF2", -"z. c #6BF1CB67FFDA", -"x. c #78EFC45FF587", -"c. c #73ACC4B8FF4E", -"v. c #7AE0C563FFC1", -"b. c #73FECDDAFFD6", -"n. c #7D0ACC39FFD0", -"m. c #7676D100FFFF", -"M. c #7CECD1F1FFFD", -"N. c #AD418EA89292", -"B. c #A8A196DE9560", -"V. c #AE7D90C8B02F", -"C. c #B1EEA9E1B4A9", -"Z. c #D93B929299E1", -"A. c #CC5EB10F930F", -"S. c #E9BAA4369224", -"D. c #CF39B2CFAFCF", -"F. c #F80AB8E3B4B4", -"G. c #BE3EC7C7BCBC", -"H. c #DF84CDC89EFE", -"J. c #FA24EA148F39", -"K. c #FB99E9B995EB", -"L. c #FA72E78F983D", -"P. c #FC13E9B69A64", -"I. c #FACEC494BCA2", -"U. c #E9F1D33EB055", -"Y. c #FADAEAF3A8DA", -"T. c #AD4398F3D9D9", -"R. c #B4BE9084D060", -"E. c #B21DB290CB18", -"W. c #8974B187EC76", -"Q. c #8633B972EC03", -"!. c #8A5CBB6CF842", -"~. c #8432BCD8FFAD", -"^. c #94D6BD38F488", -"/. c #C7AAA02ED27C", -"(. c #C9D8AC35D1A5", -"). c #C5459E61E9D8", -"_. c #C88A9F32F3A5", -"`. c #CAE6A742E767", -"'. c #C6D7A24FEDA6", -"]. c #CADFA3EEEDB2", -"[. c #D42DB04CED0D", -"{. c #C72AA224F318", -"}. c #CA9BA2E3F33B", -"|. c #CC28A631F61E", -" X c #BB02C666DB8D", -".X c #899BC340EECB", -"XX c #9309C49CEF02", -"oX c #8CCCCB08F4F2", -"OX c #86BDC4C7F8A3", -"+X c #8C8AC3A3FFB1", -"@X c #84A6CC40FFA5", -"#X c #8B89CD17FF99", -"$X c #9A4EC6C5F75E", -"%X c #9372CCE5F4BA", -"&X c #9414C4D3FE9F", -"*X c #942ECC3DFF0A", -"=X c #9CA4CB6BFEA6", -"-X c #844ED403FFF3", -";X c #8BE4D56DFFC1", -":X c #8E73D8EAFFFF", -">X c #99B5D2B3F720", -",X c #93F0D3D0FEA2", -".@.[ [ [ $.,.,.[ $.,.,.$.@.@.:.,.,.#.] #.I I I I I D ] L P P G V N N N N D P D V P V N F K N F K V N N N V F P P K V N K P P P P K V V K P K D V D K P F N D P F N N N N D K K N D P K D V V F P P F N F P P P K K D V K P P F V N N N N D P D V P V N F K N F K V N N N V F P P K V N K P P P P K V V K P K D V D K P F N D P F N N N N D K K N D P K D V V F P P F N F P P P K K D V K P P F V N N N N D P D V P V N F K N F K V N N N V F P P K V N K P P P P K V V K P K D V D K P F N D P F N N N N D K K N D P K D V V F P P F N F P P P K K D V K P P F V N N N N D P D V P V N F K N F K V N N N V F P P K V N K P P P P K V V K P K D V D K P F N D P F N N N N D K K N D P K D V V F P P F N F P ", -"P P P K G V V L P P K G N N N N G L N L D V P D V K D N N N D L I I L D ] L L I I ,.,.,.#.[ #.,.,.,.<.<.<.<.$.[ <.a.>.[ &.[ &.=.<.a.=.&.>.a.<.<.<.,.,.<.@.@.,.,.,.,.,.:.:.] +.L I I L G ' ' ' N G L N L D V P D V K D N N N D K P P L D V G K K P P P P G N D P P K P P P K V N L P G N N N N V K P V N L P P P P P P L V V L P P P P K G V V L P P K G N N N N G L N L D V P D V K D N N N D K P P L D V G K K P P P P G N D P P K P P P K V N L P G N N N N V K P V N L P P P P P P L V V L P P P P K G V V L P P K G N N N N G L N L D V P D V K D N N N D K P P L D V G K K P P P P G N D P P K P P P K V N L P G N N N N V K P V N L P P P P P P L V V L P P P P K G V V L P P K G N N N N G L N L D V P D V K D N N N D K P P L D V G K K P P P P G N D P P K P P P K V N L P G N N N N V K P V N L P P P P P P L V V L P ", -"P L D V V V N V D G L P L D N N V L V D D V D V D G V N D L I I L D ] ' ] ] ] ] :.,.,.,.,.$.[ $.<.<.a.a.3.=.&.&.3.s.2.&.&.&.&.=.s.s.2.&.=.3.s.a.a.a.>.&.&.>.<.,.,.:.$.[ [ [ [ ] +.:.I I L +.' ' +.L V D D V D V D G V N D L P I L D V N V V V V L P I I L D N D L I P P L V V V L P G N N N N V I I D N V G I P P P G V V L P P P L D V V V N V D G L P L D N N V L V D D V D V D G V N D L P I L D V N V V V V L P I I L D N D L I P P L V V V L P G N N N N V I I D N V G I P P P G V V L P P P L D V V V N V D G L P L D N N V L V D D V D V D G V N D L P I L D V N V V V V L P I I L D N D L I P P L V V V L P G N N N N V I I D N V G I P P P G V V L P P P L D V V V N V D G L P L D N N V L V D D V D V D G V N D L P I L D V N V V V V L P I I L D N D L I P P L V V V L P G N N N N V I I D N V G I P P P G V V L P P ", -"L ] ] G L L L G D ' +.G I I L +.' D ] ' ] ] ] ' D ] ] G I I G +.] ] +.:.,.,.:.$.[ $.<.<.<.a.2.&.&.=.2.2.*.-.4.-.s.s.4.*.*.*.*.-.d.s.4.-.-.*.-.3.2.=.*.&.3.a.a.<.<.@.@.$.>.<.:.:.@.[ +.#.,.I L +.' +.] ' ] ] ] ' D ] ] G I I G +.] ] D L I I L D ' D I I I I G ' ] D D D ] ] G ] I I G ' ' ' ' ] I I G ] D ' D G G +.] ] L I I I L ] ] G L L L G D ' +.G I I L +.' D ] ' ] ] ] ' D ] ] G I I G +.] ] D L I I L D ' D I I I I G ' ] D D D ] ] G ] I I G ' ' ' ' ] I I G ] D ' D G G +.] ] L I I I L ] ] G L L L G D ' +.G I I L +.' D ] ' ] ] ] ' D ] ] G I I G +.] ] D L I I L D ' D I I I I G ' ] D D D ] ] G ] I I G ' ' ' ' ] I I G ] D ' D G G +.] ] L I I I L ] ] G L L L G D ' +.G I I L +.' D ] ' ] ] ] ' D ] ] G I I G +.] ] D L I I L D ' D I I I I G ' ] D D D ] ] G ] I I G ' ' ' ' ] I I G ] D ' D G G +.] ] L I I I ", -"+.] L I I I I I I L +.] ] +.L I +.' ] G L I L +.' ] L I #.+.] ] #.:.,.,.,.,.,.<.$.&.=.<.a.s.s.3.-.-.-.-.-.4.4.9.d.d.d.w.9.9.9.r.d.f.w.9.d.-.-.-.-.-.4.s.s.s.s.s.=.&.2.a.a.a.<.<.,.:.$.[ [ #.:.,.+.' ] #.L I L +.' ] L I G +.] ] #.L I I I I I I +.' #.I I I I L +.] ] +.+.L L ] L I L +.] ' ] G I I +.+.I +.] ] ] ] #.I I I I I +.] L I I I I I I L +.] ' +.L L +.' ' G L L L +.' ] L I G ] ] ] G L I I I I I I +.' D L I I I G +.] ] ] +.L L ] L L L +.] ' ] G I I +.+.I +.] ] ] ] #.I I I I I +.] L I I I I I I L +.] ] +.L I +.' ] G L I L +.' ] L I G +.] ] #.L I I I I I I +.' #.I I I I L +.] ] +.+.L L ] L I I +.] ' ] L I I +.+.I +.] ] ] ] #.I I I I I +.] L I I I I I I L +.] ] +.L I +.' ] G L I L +.' ] L I G +.] ] #.L I I I I I I +.' #.I I I I L +.] ] +.+.L L ] L I I +.] ' ] L I I +.+.I +.] ] ] ] #.I I I I I ", -"] #.I I :.:.:.:.I I I :.#.+.] +.] ] :.I I I I I #.' +.] ] +.:.,.,.,.,.>.>.>.<.a.<.&.&.s.s.s.d.d.d.d.d.j.f.l.j.9.r.l.l.j.j.j.j.l.l.j.e.r.l.l.j.j.j.f.f.d.d.d.d.s.-.2.s.s.3.2.>.<.<.<.<.<.>.@.[ @.[ +.:.,.,.,.,.I #.' +.] ] +.:.I I I :.:.#.#.I I I ] ] I I I I I I I :.:.I I I ] #.I I L L L L I I L ] #.I I I :.:.I I I I I I I ] #.I I L G G L I I I L G ] ] ] ' ] L I L I I I +.' +.] ] +.G I I L L G G G L I L ] ] L I I I I I L L L I I L ] D I I L L L L I I L ] #.I I I L L I I I I I I I ] #.I I :.:.:.:.I I I :.#.+.] +.] ] :.I I I I I #.' +.] ] +.:.I I I :.:.#.#.I I I ] ] I I I I I I I :.:.I I I ] #.I I I I :.I I I :.] #.I I I :.:.I I I I I I I ] #.I I :.:.:.:.I I I :.#.+.] +.] ] :.I I I I I #.' +.] ] +.:.I I I :.:.#.#.I I I ] ] I I I I I I I :.:.I I I ] #.I I I I :.I I I :.] #.I I I :.:.I I I I I I I ", -"[ :.,.:.+.] ] [ +.+.#.:.,.,.:.+.' :.,.,.,.,.,.,.,.+.[ #.:.,.,.:.$.@.@.&.[ &.=.s.s.2.*.d.d.d.f.f.j.l.l.l.l.l.l.t.e.k.z.z.z.z.z.z.k.e.y.k.z.z.l.l.l.l.l.l.j.f.d.d.9.d.d.4.-.*.*.&.&.=.2.<.<.<.>.@.[ >.,.,.,.,.,.,.,.+.] #.:.,.,.:.#.+.[ ] ] ] #.,.,.#.[ ,.,.,.,.,.,.,.,.I I ,.I +.] #.L I I I I I :.] ] :.I ,.I I ,.,.,.,.,.,.,.,.] :.I :.] ' ' ] ] +.#.:.L L #.] ' #.I I I :.I I :.+.] #.:.I I :.#.] ] ' ' ' +.I L +.' L L L I I L I I I L L I +.' #.L L L L L I #.] ] :.I I I I I I I I I I ,.,.[ :.,.:.+.] ] [ +.+.#.:.,.,.:.+.' :.,.,.,.,.,.,.,.+.] #.:.,.,.:.#.+.[ ] ] ] #.,.,.#.[ ,.,.,.,.,.,.,.,.,.,.,.,.#.[ #.,.,.,.,.,.,.:.+.[ :.,.,.,.,.,.,.,.,.,.,.,.,.[ :.,.:.+.] ] [ +.+.#.:.,.,.:.+.' :.,.,.,.,.,.,.,.+.] #.:.,.,.:.#.+.[ ] ] ] #.,.,.#.[ ,.,.,.,.,.,.,.,.,.,.,.,.#.[ #.,.,.,.,.,.,.:.+.[ :.,.,.,.,.,.,.,.,.,.,.,.,.", -"[ ,.,.#.[ [ [ [ [ [ [ [ @.#.:.+.[ ,.,.,.+.+.:.,.,.#.[ #.$.@.@.[ [ [ [ &.&.&.*.s.d.4.9.d.f.l.l.l.l.l.z.z.z.z.z.b.u.y.u.c.c.c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 1 p ......o.7.7.7.7.7.7.5.} } } _ R q 2 @X@X@X@X2 1 p ^ ....o.7.7.7.7.7.5.7.7.5.} } } } } } d 2 2 @X@X@X2 t E 7.5.5.w.h.h.w.q.q.q.q.0.5.5.} } d 2 2 @X@X@X2 2 U E p 2 w @X@X@X@X2 1 p T U d d d d E E E R p w 2 2 2 2 2 1 > > 4 @X@X@X4 1 i p 2 1 @X@X@X2 2 a R R R d 2 2 @X@X@X2 2 U ...._ d 2 2 @X@X@X2 2 d R R d 2 < @X@X@X@X@X@X@X@X@X3 3 T 7.7.7.w.w.q.q.y.y.u.u.y.y.u.b.b.b.b.b.b.b.b.b.b.b.b.b.b.y.b.b.c.y.y.y.y.y.y.y.y.y.y.y.y.y.b.b.b.y.y.u.b.b.c.y.y.y.y.y.y.y.y.y.y.y.y.y.b.", -"b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.v.i.i.v.n.-X-X-X;X#X&X,X1X2XqXqXuXiXeX% Y.K.P.K.P.K.K.P.L.A.- R.]._.|.}.'.}.'./.R.}.).].R.zXU.kXlXkXN.`.}.h zX/.{.V.H.L.K.K.P.K.K.K.K.P.P.N.{.{.'.'.'.'.'.'.{.'.NXV.0XwXqX2X2X1X,X*X+X#X-X-XM.M.M.M.b.b.b.b.c.h.h.q.w.7.R r 7 7 7 7 1 < q n.n.n.n.9 2 p E E d 2 2 n.n.n.n.3 w R } } } } } } i 2 w n.n.n.w < q U ....5.7.7.7.7.7.5.} } 5.5...E p 2 q n.n.n.w < q U ....5.7.7.7.7.7.5.7.7.7.} } } } } } d 8 2 n.n.n.7 3 E 7.7.q.w.h.h.y.q.t.t.w.q.q.5.} } d 2 2 n.n.n.2 2 U E U 2 2 n.n.n.n.3 w E ..} } _ ......^ E p 8 < 1 2 2 2 2 2 2 w n.n.n.n.n.1 3 w 1 1 n.n.n.2 2 a E E _ U 2 2 n.n.n.2 2 U ...._ d w 2 n.n.n.2 2 d E E d q < q n.n.n.n.n.n.n.n.3 2 U 5.7.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{.}.R.yXyXaXaX0XwXqX9X5X=X=X&X*X#XoXOX!.| i 7 G G G G G r < r Q 6.6.8.8.g.8.q.8.g.8.6.6.~ Q Q ! ! a r < t G G G G 7 7 a Q a 7 7 G G G 7 7 U ! ! ! ! f 7 7 G G G G 7 9 W | 5.R 7 7 G G G 7 7 a ! / / / U 7 9 G G G G 9 9 Q 8.8.8.! r 7 G G G 7 1 U / 6.6.6.6.6.8.8.| ! ! U t 9 9 t G G G G r < t ! 6.6.6.Q 9 7 G G r 9 f 6.6.8.8.8.8.8.6.f 9 t G G G G r 7 7 7 9 9 t G G G G 9 9 Q 8.6.6.| U 9 r G G G G G G G G t 9 r G G G G G G G G G G q > > > 1 G G G G G t 9 9 9 r G G G G G r 9 f 6.W.!.OXOXOX-X+X!.;X;X+X;X;X+X+X+X+X+X#X;X:X;X#X+X;X;X;X;X;X;X+X+X;X;X;X#X+X#X;X;X;X+X#X;X;X+X+X+X+X#X;X;X+X#X;X;X#X+X+X#X;X;X#X+X#X:X", -";X;X:X;X;X&X&X;X:X:X,X*X&X&X&X=X r F F F r < r Q 8.8.8.g.g.g.Q.W..Xg.Q.W.W.W.W.8.8.8.6.f 7 2 F F F F 7 1 i W a 7 7 F F F w 7 i ! / / ! a 1 7 F F F F 7 9 W | 6.W 7 9 F F F e 7 a ! / ! ! a 2 9 F F F F 9 9 Q 6.8.8.! 9 9 F F F r < w a W Q Q Q Q ! ! a r 9 9 9 t F F F F F r < r Q 6.8.8.8.Q 9 > 7 7 < y ~ 6.W.W.Q.8.W.8.8.| y 9 F F F F F F r 9 t F F F F F F 9 9 ! 8.8.6.6.! i 9 9 t F F F F F r < < < 0 F F F F F F F F q < 2 9 2 9 F F F F F F F F F F F F F F r < y | W.W.!.OXOX!.#X#X+X;X#X&X;X#X&X&X&X#X;X:X:X;X#X&X;X;X;X:X:X:X:X#X&X#X;X:X;X;X;X;X;X#X&X;X:X#X&X&X&X&X&X;X:X*X&X;X:X:X;X;X:X:X;X&X&X;X:X", -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IXIXIXIXIXIXIXIXIXLXLXLXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXLXIXIXIXLXLXLXLXIXIXIXLXIXIXIXIXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXLXLXLXLXIXIXIXIXIXIXLXIXIXLXIXIXIXLXLXLXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXLXIXIXIXLXLXLXLXIXIXIXLXIXIXIXIXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXLXLXLXLXIXIXIXIXIXIXLXIXIXLXIXIXIXLXLXLXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXLXIXIXIXLXLXLXLXIXIXIXLXIXIXIXIXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXLXLXLXLXIXIXIXIXIXIXLXIXIXLXIXIXIXLXLXLXIXIXIXIXIXIXLXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXIXLXIXIXIXLXLXLXLXIXIXIXLXIXIXIXIXIXIXIXIXIXIXLXIXIX" -}; diff --git a/contrib/assdraw/src/xpm/b__xpm.xpm b/contrib/assdraw/src/xpm/b__xpm.xpm deleted file mode 100644 index b3343e00d..000000000 --- a/contrib/assdraw/src/xpm/b__xpm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -const char *b__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -" c gray20", -". c #12120000FFFF", -"X c None", -/* pixels */ -"XX.XXXXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -".....XXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -"XX.XX XXXX", -"XXXXX XXX", -"XXXXX XXXX XXX", -"XXXXX XXXX XXX", -"XXXXX XXXX", -"XXXXX XXX", -"XXXXX XXXX XXX", -"XXXXX XXXX XXX", -"XXXXX XXX", -"XXXXX XXXX", -"XXXXXXXXXXXXXXXX" -}; diff --git a/contrib/assdraw/src/xpm/c__xpm.xpm b/contrib/assdraw/src/xpm/c__xpm.xpm deleted file mode 100644 index 3fb56e641..000000000 --- a/contrib/assdraw/src/xpm/c__xpm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -const char *c__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -" c gray20", -". c #12120000FFFF", -"X c None", -/* pixels */ -"XX.XXXXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -".....XXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -"XX.XXXX XXXXX", -"XXXXXX XXXX", -"XXXXX XX XXX", -"XXXXX XXXX XXXX", -"XXXXX XXXXXXXXX", -"XXXXX XXXXXXXXX", -"XXXXX XXXX XXXX", -"XXXXX XX XXX", -"XXXXXX XXXX", -"XXXXXXX XXXXX", -"XXXXXXXXXXXXXXXX" -}; diff --git a/contrib/assdraw/src/xpm/check__xpm.xpm b/contrib/assdraw/src/xpm/check__xpm.xpm deleted file mode 100644 index 9da7d4673..000000000 --- a/contrib/assdraw/src/xpm/check__xpm.xpm +++ /dev/null @@ -1,27 +0,0 @@ -/* XPM */ -const char *check_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 6 1", -" c black", -". c gray25", -"X c #808080808080", -"o c #D4D4D0D0C8C8", -"O c gray100", -"+ c None", -/* pixels */ -"++++++++++++++++", -"++XXXXXXXXXXXX++", -"++X..........o++", -"++X.OOOOOOOOOo++", -"++X.OOOOOOO Oo++", -"++X.OOOOOO Oo++", -"++X.O OOO Oo++", -"++X.O O OOo++", -"++X.O OOOo++", -"++X.OO OOOOo++", -"++X.OOO OOOOOo++", -"++X.OOOOOOOOOo++", -"++Xooooooooooo++", -"++++++++++++++++", -"++++++++++++++++" -}; diff --git a/contrib/assdraw/src/xpm/del__xpm.xpm b/contrib/assdraw/src/xpm/del__xpm.xpm deleted file mode 100644 index d03abec06..000000000 --- a/contrib/assdraw/src/xpm/del__xpm.xpm +++ /dev/null @@ -1,90 +0,0 @@ -/* XPM */ -const char *del__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 69 1", -" c black", -". c #0C0C0C0C0C0C", -"X c gray5", -"o c gray9", -"O c #191919191919", -"+ c gray11", -"@ c #262625252424", -"# c #313131313131", -"$ c #323232323232", -"% c #353534343232", -"& c #373735353333", -"* c #373737373737", -"= c #383838383737", -"- c #3E3E3E3E3E3E", -"; c #414141414141", -": c #575755555252", -"> c #555555555555", -", c #5D5D5A5A5757", -"< c gray35", -"1 c gray36", -"2 c #646464646464", -"3 c gray42", -"4 c #70706E6E6A6A", -"5 c #71716F6F6B6B", -"6 c #818181818181", -"7 c #868686868686", -"8 c #878787878686", -"9 c #888888888787", -"0 c #8F8F8C8C8787", -"q c gray55", -"w c #8F8F8E8E8D8D", -"e c #979793938D8D", -"r c gray57", -"t c #969695959292", -"y c gray59", -"u c #9F9F9F9F9F9F", -"i c #A3A39F9F9999", -"p c #A0A0A0A0A0A0", -"a c gray64", -"s c #AAAAA6A6A0A0", -"d c #AEAEACACA7A7", -"f c #A9A9A9A9A9A9", -"g c #B1B1AEAEA7A7", -"h c #B3B3B0B0A9A9", -"j c #B7B7B4B4ADAD", -"k c #B9B9B7B7B1B1", -"l c #BEBEBBBBB5B5", -"z c #BCBCBCBCBCBC", -"x c #C2C2BFBFB8B8", -"c c #C3C3C0C0B8B8", -"v c #C3C3C0C0B9B9", -"b c #C7C7C3C3BBBB", -"n c #C6C6C3C3BCBC", -"m c gray78", -"M c #CBCBC8C8C0C0", -"N c #CFCFCBCBC4C4", -"B c #C8C8C8C8C8C8", -"V c gray80", -"C c #D2D2CECEC6C6", -"Z c #D3D3CFCFC7C7", -"A c #D0D0D0D0D0D0", -"S c LightGray", -"D c gray86", -"F c #DDDDDDDDDDDD", -"G c gray90", -"H c gray93", -"J c #F4F4F4F4F4F4", -"K c #F6F6F6F6F6F6", -"L c None", -/* pixels */ -"LLLLN*LLLLLLLLLL", -"LLLLk=0LLLLLLLLL", -"LLLZt &LLLLLLLLL", -"LLLv9<-iLLLLLLLL", -"LLZtB1p%LL L", -"LLlyH1F$eLLLLLLL", -"LCwAH1Ff@cLLLLLL", -"LdaJHuFS>5LLLLLL", -"n8KJH FSm+sLLLLL", -"LrqJHDFS3:xLLLLL", -"Lb#DHGFzohLLLLLL", -"LL46HGF2,LLLLLLL", -"LLgOHGF LLLLLLLL", -"LLX..X...LLLLLLL", -"LLM;V7.XjLLLLLLL" -}; diff --git a/contrib/assdraw/src/xpm/del_cross_xpm.xpm b/contrib/assdraw/src/xpm/del_cross_xpm.xpm deleted file mode 100644 index fea2c7c99..000000000 --- a/contrib/assdraw/src/xpm/del_cross_xpm.xpm +++ /dev/null @@ -1,106 +0,0 @@ -/* XPM */ -const char *delcross_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 85 1", -" c #3F3F14141818", -". c #4C4C19192121", -"X c #656522222626", -"o c #797927272C2C", -"O c #6E6E24243333", -"+ c #82822A2A2D2D", -"@ c #919130303434", -"# c #949431313535", -"$ c #979732323434", -"% c #979732323B3B", -"& c #9E9E35353D3D", -"* c #9E9E34343F3F", -"= c #A0A036363939", -"- c #A5A538383C3C", -"; c #A7A73A3A3E3E", -": c #ACAC3B3B3E3E", -"> c #B5B53D3D3D3D", -", c #9E9E34344848", -"< c #A5A539394242", -"1 c #AEAE3D3D4040", -"2 c #A3A337374D4D", -"3 c #B7B73F3F4343", -"4 c #B3B33F3F4747", -"5 c #B5B53F3F4545", -"6 c #B3B33C3C5353", -"7 c #B1B13D3D5454", -"8 c #B3B33C3C5656", -"9 c #B5B53D3D5959", -"0 c #B7B740404141", -"q c #BDBD42424545", -"w c #B7B741414848", -"e c #B3B340405C5C", -"r c #BFBF45455E5E", -"t c #C3C345454C4C", -"y c #D0D04B4B5252", -"u c #C9C948486666", -"i c #CFCF4B4B6868", -"p c #D0D04C4C6A6A", -"a c #D2D24C4C6C6C", -"s c #E4E457577575", -"d c #E2E258587676", -"f c #E7E75B5B7979", -"g c #EAEA5B5B7A7A", -"h c #E8E85C5C7979", -"j c #EAEA5C5C7A7A", -"k c #F1F160607B7B", -"l c #F1F162627F7F", -"z c #F4F464648080", -"x c #F6F666668080", -"c c #F5F564648282", -"v c #F7F766668585", -"b c #FAFA69698484", -"n c #FFFF6D6D8686", -"m c #FCFC6B6B8888", -"M c #FFFF6D6D8989", -"N c #FFFF6F6F8B8B", -"B c #FFFF71718989", -"V c #FFFF74748F8F", -"C c #FFFF83839B9B", -"Z c #FFFF89899B9B", -"A c #FFFF89899D9D", -"S c #FFFF8D8DA2A2", -"D c #FFFF9393A5A5", -"F c #FFFF9595A6A6", -"G c #FFFF9E9EA7A7", -"H c #FFFFA6A6ABAB", -"J c #FFFFA5A5B1B1", -"K c #FFFFAFAFB1B1", -"L c #FFFFADADB4B4", -"P c #FFFFB0B0B2B2", -"I c #FFFFB0B0B9B9", -"U c #FFFFB5B5B8B8", -"Y c #FFFFB4B4BCBC", -"T c #FFFFBBBBBBBB", -"R c #FFFFBCBCBBBB", -"E c #FFFFB8B8BDBD", -"W c #FFFFC0C0BEBE", -"Q c #FFFFC0C0C2C2", -"! c #FFFFC4C4C2C2", -"~ c #FFFFC3C3C4C4", -"^ c #FFFFC4C4C7C7", -"/ c #FFFFC7C7C6C6", -"( c #FFFFC7C7C7C7", -") c #FFFFCCCCC9C9", -"_ c None", -/* pixels */ -"_^jY____________", -"_DqtJ________S__", -"_Fh;5C_____Iym__", -"__Eg10l___c4V___", -"____Aw3vQN>M____", -"_____~p-& c #52528282D0D0", -", c #63638E8ED5D5", -"< c #69699292D7D7", -"1 c #71719898D9D9", -"2 c #79799E9EDBDB", -"3 c #7C7CA0A0DCDC", -"4 c #8989A9A9DFDF", -"5 c #8C8CACACE0E0", -"6 c #9595B2B2E3E3", -"7 c #9A9AB6B6E4E4", -"8 c #9B9BB7B7E5E5", -"9 c #A6A6BFBFE8E8", -"0 c #A8A8C0C0E8E8", -"q c #ADADC4C4E9E9", -"w c #B1B1C7C7EBEB", -"e c #B8B8CCCCECEC", -"r c #BEBED0D0EEEE", -"t c #C4C4D5D5F0F0", -"y c #CBCBD9D9F1F1", -"u c #CCCCDADAF2F2", -"i c #D2D2DFDFF4F4", -"p c #D9D9E4E4F5F5", -"a c #DCDCE6E6F6F6", -"s c #DFDFE8E8F7F7", -"d c #E2E2EAEAF8F8", -"f c #EAEAF0F0FAFA", -"g c #EDEDF2F2FBFB", -"h c #F0F0F5F5FCFC", -"j c #F5F5F8F8FDFD", -"k c #F7F7F9F9FDFD", -"l c #FAFAFCFCFEFE", -"z c #FDFDFEFEFFFF", -"x c gray100", -"c c None", -/* pixels */ -"ccc%%%%%%%o-cccc", -"ccc%urw073%4-ccc", -"ccc%iurw07%k4>cc", -"cc9$$$<0w0%kk4$c", -"c1 @2,O c gray43", -", c #6F6F6F6F6F6F", -"< c gray44", -"1 c #767676767676", -"2 c #797979797979", -"3 c #7C7C7C7C7C7C", -"4 c #7F7F7F7F7F7F", -"5 c #818181818181", -"6 c #8D8D8D8D8D8D", -"7 c #8E8E8E8E8E8E", -"8 c #939393939393", -"9 c gray58", -"0 c #959595959595", -"q c gray59", -"w c gray60", -"e c #9A9A9A9A9A9A", -"r c #A4A4A1A19696", -"t c #A8A8A6A69C9C", -"y c #A7A7A7A7A7A7", -"u c gray66", -"i c #B1B1AFAFA5A5", -"p c #B3B3B1B1A8A8", -"a c #BDBDBBBBAFAF", -"s c gray70", -"d c #CDCDCACABCBC", -"f c #C8C8C8C8C8C8", -"g c #CACACACACACA", -"h c #CDCDCDCDCDCD", -"j c gray81", -"k c gray83", -"l c #D5D5D5D5D5D5", -"z c #D7D7D7D7D7D7", -"x c #D8D8D8D8D8D8", -"c c gray86", -"v c #DFDFDFDFDFDF", -"b c #E7E7E4E4D3D3", -"n c #E4E4E4E4E4E4", -"m c #E7E7E7E7E7E7", -"M c gray91", -"N c gray92", -"B c #EEEEEEEEEEEE", -"V c #EFEFEFEFEFEF", -"C c #F1F1F1F1F1F1", -"Z c gray95", -"A c #F3F3F3F3F3F3", -"S c #F6F6F6F6F6F6", -"D c gray100", -"F c None", -/* pixels */ -"FFFFFFFFFFFFFFFF", -"FFFFFFFFFFFFFFFF", -"FFFFFFFa@-------", -"FFFFFFaOZBnzhf,;", -"FFFFFaOZCmcjf<0$", -"FFFFaOZANvkf9755>%+2q.rFF", -"b;sxxxklf*6.rFFF", -"p8SSSSSSu4.rFFFF", -"1MDDDDDV&.rFFFFF", -"ooooooo+ rFFFFFF", -"FFFFFFFFFFFFFFFF", -"FFFFFFFFFFFFFFFF" -}; diff --git a/contrib/assdraw/src/xpm/nut__xpm.xpm b/contrib/assdraw/src/xpm/nut__xpm.xpm deleted file mode 100644 index 83f93a2c6..000000000 --- a/contrib/assdraw/src/xpm/nut__xpm.xpm +++ /dev/null @@ -1,76 +0,0 @@ -/* XPM */ -const char *nut__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 55 1", -" c #7F7F00000000", -". c #000013137F7F", -"X c #030315157F7F", -"o c #6C6C41416060", -"O c #808007070707", -"+ c #808009090909", -"@ c #838313131313", -"# c #848412121212", -"$ c #868618181818", -"% c #88881D1D1D1D", -"& c #88881E1E1E1E", -"* c #8A8A24242424", -"= c #8E8E30303030", -"- c #92923C3C3C3C", -"; c #949442424242", -": c #969648484848", -"> c #98984E4E4E4E", -", c #9A9A54545454", -"< c #9D9D5A5A5A5A", -"1 c #A1A165656565", -"2 c #A3A36B6B6B6B", -"3 c #A5A56F6F6F6F", -"4 c #A5A571717171", -"5 c #A7A777777777", -"6 c #A9A97D7D7D7D", -"7 c #0A0A1C1C8181", -"8 c #0C0C1C1C8080", -"9 c #0D0D1F1F8282", -"0 c #151525258484", -"q c #151525258585", -"w c #171728288686", -"e c #1F1F2F2F8888", -"r c #242432328A8A", -"t c #2A2A38388C8C", -"y c #2D2D3B3B8D8D", -"u c #61616A6A9F9F", -"i c #64646C6CA0A0", -"p c #74747C7CA6A6", -"a c #77777E7EA7A7", -"s c #AFAF8F8F8F8F", -"d c #B3B39B9B9B9B", -"f c #83838989ABAB", -"g c #89898E8EADAD", -"h c #8D8D9292AEAE", -"j c #8F8F9494AFAF", -"k c #9B9B9F9FB3B3", -"l c #B5B5A1A1A1A1", -"z c #B7B7A7A7A7A7", -"x c #B9B9ADADADAD", -"c c #A7A7A9A9B7B7", -"v c #BBBBB3B3B3B3", -"b c #B3B3B4B4BBBB", -"n c #BDBDB9B9B9B9", -"m c #B9B9BABABDBD", -"M c None", -/* pixels */ -"# @nMMMM", -" MMMMebMMM:5MMMM", -" MMMc9.MMMs=MMMM", -" ......pMMM#xMMM", -" h........0<1MMM", -" Mc......tkd*MMM", -" MMuX....bMM&lMM", -" MMy.....jMM1d7.MM...fMM=sM", -"z4*$,dMMa.wmM5:M", -"MMMz2*$,dgqiMv#n", -"MMMMMMz2*$o8MM;6", -"MMMMMMMMMz2*$,3-", -"MMMMMMMMMMMMz2%O" -}; diff --git a/contrib/assdraw/src/xpm/p__xpm.xpm b/contrib/assdraw/src/xpm/p__xpm.xpm deleted file mode 100644 index 4b22e4a8f..000000000 --- a/contrib/assdraw/src/xpm/p__xpm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -const char *p__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -" c gray20", -". c #12120000FFFF", -"X c None", -/* pixels */ -"XX.XXXXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -".....XXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -"XX.XX XXXXX", -"XXXXX XXXX", -"XXXXX XXX XXXX", -"XXXXX XXX XXXX", -"XXXXX XXXX", -"XXXXX XXXXX", -"XXXXX XXXXXXXXX", -"XXXXX XXXXXXXXX", -"XXXXX XXXXXXXXX", -"XXXXX XXXXXXXXX", -"XXXXXXXXXXXXXXXX" -}; diff --git a/contrib/assdraw/src/xpm/pan_bg_xpm.xpm b/contrib/assdraw/src/xpm/pan_bg_xpm.xpm deleted file mode 100644 index 69f5ae000..000000000 --- a/contrib/assdraw/src/xpm/pan_bg_xpm.xpm +++ /dev/null @@ -1,87 +0,0 @@ -/* XPM */ -const char *pan_bg_xpm[] = { -/* columns rows colors chars-per-pixel */ -"24 15 66 1", -" c #2A2A35354D4D", -". c #2C2C38384B4B", -"X c #36364A4A6464", -"o c #474757576E6E", -"O c #4D4D5C5C7272", -"+ c #5E5E66667171", -"@ c #606060606060", -"# c #C1C14B4B2B2B", -"$ c #CFCF55553636", -"% c #CBCB75752424", -"& c #BABA6D6D6666", -"* c #CCCC69695656", -"= c #C9C973736666", -"- c #FFFF7F7F7F7F", -"; c #EDEDA0A04C4C", -": c #EFEFA5A54F4F", -"> c #585866668585", -", c #646475759696", -"< c #7D7D89899E9E", -"1 c #72728383A7A7", -"2 c #80808A8A9D9D", -"3 c #86868E8E9D9D", -"4 c #89899999AFAF", -"5 c #8A8A9A9AAEAE", -"6 c #81819292BABA", -"7 c #9696A3A3B4B4", -"8 c #9D9DA7A7BBBB", -"9 c #A3A3ABABBABA", -"0 c #D3D396968D8D", -"q c #D2D297978D8D", -"w c #DDDDA5A59B9B", -"e c #E8E8C3C39393", -"r c #83839999C7C7", -"t c #9090A5A5C3C3", -"y c #9191A5A5C3C3", -"u c #9191A5A5C4C4", -"i c #9292A6A6C5C5", -"p c #9292A7A7C5C5", -"a c #9191A5A5C6C6", -"s c #9393A7A7C6C6", -"d c #9393A7A7C7C7", -"f c #9898A8A8C5C5", -"g c #9898AAAAC5C5", -"h c #9797A7A7C9C9", -"j c #9595A8A8CFCF", -"k c #9B9BB1B1DFDF", -"l c #AAAAB4B4C7C7", -"z c #D4D4C3C3D0D0", -"x c #CDCDDADAE9E9", -"c c #D2D2D8D8E2E2", -"v c #D6D6DCDCE6E6", -"b c #C8C8DADAFDFD", -"n c #D2D2DDDDF0F0", -"m c #D5D5DFDFF1F1", -"M c #E1E1E5E5ECEC", -"N c #F2F2E2E2E2E2", -"B c #F5F5E5E5E2E2", -"V c #F1F1E9E9ECEC", -"C c #EBEBEFEFFBFB", -"Z c #EFEFF5F5F9F9", -"A c #F1F1F4F4FAFA", -"S c #F2F2F5F5FCFC", -"D c #FAFAFBFBFEFE", -"F c #FDFDFEFEFEFE", -"G c gray100", -"H c None", -/* pixels */ -"HHHHH@HHHHHHHHHHHHHHHHHH", -"HHHHH@HHHHHHHHHHHHHHHHHH", -"HHHHH@HHHHHHHHHHHHHHHHHH", -"HHHHH@HHHHHHassdssyyygHH", -"H@@@@@@@@@HHsGFGABw0VXHH", -"H@HHH@---@HHiGGAAqe:&XHH", -"H@HHH@---@HHsGGZZ=;%#XHH", -"H@HHH@---@HHpGGvxN*$zXHH", -"H@HHH@---@HHiGc4.XHH", -"H@HHHHHHH@HHyXXXXXXXXXHH", -"H@HHHHHHH@HHHHHHHHHHHHHH", -"H@@@@@@@@@HHHHHHHHHHHHHH" -}; diff --git a/contrib/assdraw/src/xpm/pan_both_xpm.xpm b/contrib/assdraw/src/xpm/pan_both_xpm.xpm deleted file mode 100644 index 3c41b2280..000000000 --- a/contrib/assdraw/src/xpm/pan_both_xpm.xpm +++ /dev/null @@ -1,97 +0,0 @@ -/* XPM */ -const char *pan_both_xpm[] = { -/* columns rows colors chars-per-pixel */ -"24 15 76 1", -" c #1B1B22225353", -". c #0D0D0D0D6767", -"X c #0F0F14146161", -"o c #111115156464", -"O c #121219196262", -"+ c #131313136969", -"@ c #131314146C6C", -"# c #111115156F6F", -"$ c #19191A1A6E6E", -"% c #1E1E1E1E6F6F", -"& c #1D1D21217878", -"* c #232330306262", -"= c #282837376262", -"- c #2A2A2A2A7575", -"; c #3C3C3C3C7E7E", -": c #36364A4A6464", -"> c #606060606060", -", c #C1C14B4B2B2B", -"< c #CFCF55553636", -"1 c #CBCB75752424", -"2 c #BABA6D6D6666", -"3 c #CCCC69695656", -"4 c #C9C973736666", -"5 c #FFFF7F7F7F7F", -"6 c #EDEDA0A04C4C", -"7 c #EFEFA5A54F4F", -"8 c #484848488484", -"9 c #5A5A5A5A8E8E", -"0 c #45454B4B9696", -"q c #5F5F5F5F9090", -"w c #656565659292", -"e c #777777779B9B", -"r c #7E7E7E7E9F9F", -"t c #B2B20000FFFF", -"y c #7D7D89899E9E", -"u c #7B7B8888B1B1", -"i c #83838383A1A1", -"p c #89899999AFAF", -"a c #8A8A9A9AAEAE", -"s c #9B9B9B9BADAD", -"d c #9696A3A3B4B4", -"f c #A1A1A1A1B0B0", -"g c #A7A7A7A7B3B3", -"h c #B9B9B9B9BCBC", -"j c #D3D396968D8D", -"k c #D2D297978D8D", -"l c #DDDDA5A59B9B", -"z c #E8E8C3C39393", -"x c #9090A5A5C3C3", -"c c #9191A5A5C3C3", -"v c #9191A5A5C4C4", -"b c #9292A6A6C5C5", -"n c #9292A7A7C5C5", -"m c #9191A5A5C6C6", -"M c #9393A7A7C6C6", -"N c #9393A7A7C7C7", -"B c #9898AAAAC5C5", -"V c #9595A8A8CFCF", -"C c #AAAAB3B3D4D4", -"Z c #D4D4C3C3D0D0", -"A c #C0C0CACAE3E3", -"S c #CDCDDADAE9E9", -"D c #D2D2D8D8E2E2", -"F c #D6D6DCDCE6E6", -"G c #E1E1E5E5ECEC", -"H c #F2F2E2E2E2E2", -"J c #F5F5E5E5E2E2", -"K c #F1F1E9E9ECEC", -"L c #EBEBEFEFFBFB", -"P c #EFEFF5F5F9F9", -"I c #F1F1F4F4FAFA", -"U c #F2F2F5F5FCFC", -"Y c #FAFAFBFBFEFE", -"T c #FDFDFEFEFEFE", -"R c gray100", -"E c None", -/* pixels */ -"EEEEE>EEEEEmMMNMMcccBEEE", -"EEEEE>EEEEEMRTRIJljK:EEE", -"EEEEE>EEEEEbRRIIkz72:EEE", -"EEEEE>EEEEEMRRPP461,:EEE", -"E>>>>>>>>>EnRRFSH3EEE>555>EbRDpyu$@0*EEE", -"E>EEE>555>EvGaUCott O%sE", -"E>EEE>555>EvdYA&tttttt-f", -"E>EEE>555>ExLV#tttttttt+", -"E>>>>>>>>>Ec::=Xttttttw9", -"E>EEEEEEE>EEEEEe8ttttt-h", -"E>EEEEEEE>EEEEEE9wttt-sE", -"E>EEEEEEE>EEEEEEE;itqqEE", -"E>EEEEEEE>EEEEEEEh-r-hEE", -"E>>>>>>>>>EEEEEEEEg.fEEE" -}; diff --git a/contrib/assdraw/src/xpm/pan_shape_xpm.xpm b/contrib/assdraw/src/xpm/pan_shape_xpm.xpm deleted file mode 100644 index 40736fb33..000000000 --- a/contrib/assdraw/src/xpm/pan_shape_xpm.xpm +++ /dev/null @@ -1,63 +0,0 @@ -/* XPM */ -const char *pan_shape_xpm[] = { -/* columns rows colors chars-per-pixel */ -"30 15 42 1", -" c black", -". c #010101010101", -"X c #070707070707", -"o c #0C0C0C0C0C0C", -"O c #484848484848", -"+ c #FFFF00006E6E", -"@ c #121223238585", -"# c #141424248585", -"$ c #181829298787", -"% c #1D1D2E2E8989", -"& c #1E1E2E2E8989", -"* c #2A2A39398D8D", -"= c #30303E3E8F8F", -"- c #363644449191", -"; c #3A3A48489292", -": c #3C3C49499393", -"> c #42424E4E9595", -", c #484854549797", -"< c #4E4E59599999", -"1 c #5A5A64649D9D", -"2 c #66666F6FA2A2", -"3 c #78787F7FA8A8", -"4 c #39395050D3D3", -"5 c #3C3C5252D4D4", -"6 c #3F3F5555D5D5", -"7 c #42425858D6D6", -"8 c #45455A5AD7D7", -"9 c #47475C5CD7D7", -"0 c #4B4B6060D9D9", -"q c #54546868DCDC", -"w c #5A5A6D6DDEDE", -"e c #5D5D7070DFDF", -"r c #60607373E0E0", -"t c #84848A8AACAC", -"y c #8A8A8F8FAEAE", -"u c #90909595B0B0", -"i c #A2A2A5A5B6B6", -"p c #A8A8AAAAB8B8", -"a c #AEAEB0B0BABA", -"s c #B4B4B5B5BCBC", -"d c #BABABBBBBEBE", -"f c None", -/* pixels */ -"ffffOfffffffffffffffffffffffff", -"ffff fffffffffffffffffffffffff", -"ffff fffffffffffffffu%3fffffff", -"ffff fffffffffffffi:=9,$3fffff", -"X .fffffffa<&7rrrq,$3fff", -" fff +++ fffffd2&4rrrrrrrq,$3f", -" fff +++ fffft&1wrrrrrrrrrrq,=", -" fff +++ fff#;qrrrrrrrrrrrrr5,", -" fff +++ fff>6rrrrrrrrrrrq1@,p", -" fffy-rrrrrrrrr8:$2aff", -" fffffff fffd@wrrrrre4&-tfffff", -" fffffff ffff,5rrrq1@ c #656565659292", -", c #777777779B9B", -"< c #7D7D7D7D9E9E", -"1 c #7E7E7E7E9F9F", -"2 c #A1A14949D3D3", -"3 c #A6A64D4DD6D6", -"4 c #A9A95050D7D7", -"5 c #AAAA5151D8D8", -"6 c #ACAC5353D9D9", -"7 c #AFAF5656DADA", -"8 c #B5B55C5CDDDD", -"9 c #B8B85F5FDFDF", -"0 c #83838383A1A1", -"q c #8F8F8F8FA7A7", -"w c #9B9B9B9BADAD", -"e c #A1A1A1A1B0B0", -"r c #A7A7A7A7B3B3", -"t c #ADADADADB6B6", -"y c #B9B9B9B9BCBC", -"u c None", -/* pixels */ -"uuuuu&uuuuuuuuuuuuuuuuuu", -"uuuuu&uuuuuuuuuuuuuuuuuu", -"uuuuu&uuuuuuuuuuuuuuuuuu", -"uuuuu&uuuuuuuuwOX=;uu", -"u&uuu&***&uuu,-99993@yuu", -"u&&&&&&&&&uuuu;>998@wuuu", -"u&uuuuuuu&uuuuu%09::uuuu", -"u&uuuuuuu&uuuuuy@1@yuuuu", -"u&uuuuuuu&uuuuuur euuuuu", -"u&uuuuuuu&uuuuuuuuuuuuuu", -"u&&&&&&&&&uuuuuuuuuuuuuu" -}; diff --git a/contrib/assdraw/src/xpm/preview__xpm.xpm b/contrib/assdraw/src/xpm/preview__xpm.xpm deleted file mode 100644 index 330bf6949..000000000 --- a/contrib/assdraw/src/xpm/preview__xpm.xpm +++ /dev/null @@ -1,100 +0,0 @@ -/* XPM */ -const char *preview__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 79 1", -" c gray20", -". c #353535353535", -"X c gray21", -"o c gray22", -"O c gray23", -"+ c #3C3C3C3C3C3C", -"@ c #3E3E3E3E3E3E", -"# c #3F3F3F3F3F3F", -"$ c gray25", -"% c #414141414141", -"& c gray26", -"* c #434343434343", -"= c gray27", -"- c #464646464646", -"; c #484848484848", -": c #494949494949", -"> c gray29", -", c #4B4B4B4B4B4B", -"< c #4C4C4C4C4C4C", -"1 c gray30", -"2 c #505050505050", -"3 c gray32", -"4 c gray33", -"5 c #555555555555", -"6 c #565656565656", -"7 c gray34", -"8 c gray35", -"9 c #5A5A5A5A5A5A", -"0 c #5B5B5B5B5B5B", -"q c #5D5D5D5D5D5D", -"w c #676767676767", -"e c #6D6D6D6D6D6D", -"r c gray43", -"t c #6F6F6F6F6F6F", -"y c gray44", -"u c #727272727272", -"i c gray46", -"p c #777777777777", -"a c gray47", -"s c #7B7B7B7B7B7B", -"d c gray49", -"f c #7E7E7E7E7E7E", -"g c #808080808080", -"h c #848484848484", -"j c #898989898989", -"k c gray54", -"l c #8B8B8B8B8B8B", -"z c gray55", -"x c #8D8D8D8D8D8D", -"c c #909090909090", -"v c gray57", -"b c gray58", -"n c gray59", -"m c #979797979797", -"M c #9A9A9A9A9A9A", -"N c #9B9B9B9B9B9B", -"B c #9D9D9D9D9D9D", -"V c #9F9F9F9F9F9F", -"C c #A0A0A0A0A0A0", -"Z c gray63", -"A c gray64", -"S c #A4A4A4A4A4A4", -"D c #A5A5A5A5A5A5", -"F c gray65", -"G c #A7A7A7A7A7A7", -"H c #A9A9A9A9A9A9", -"J c gray67", -"K c #ACACACACACAC", -"L c gray68", -"P c #AEAEAEAEAEAE", -"I c #B4B4B4B4B4B4", -"U c gray71", -"Y c #B9B9B9B9B9B9", -"T c gray73", -"R c #BBBBBBBBBBBB", -"E c gray74", -"W c gray", -"Q c gray75", -"! c None", -/* pixels */ -"!!!!!!!!d.6Q!!!!", -"!!!!!!!coI4j!!!!", -"!!!r,51%P!zq!E!!", -"!!B*DCAW!!F@a$&S", -"!!V:!!!!!!QguJk6", -"!!!-m!!!!!!!!!k0", -"!!!st!!!!!!!!sXG", -"!!Y+n!!!!!!l*5K!", -"!R=f!!!!!!x#N!!!", -"!5t!!!!!!!wp!!!!", -"N+!!!!!!!!HoM!!!", -"8l!!!y5t!!!ZO!!!", -"3n!!99G2h!!b!!L RU.B!!!", -"!h>7T!!!i;=f!!!!" -}; diff --git a/contrib/assdraw/src/xpm/res.cpp b/contrib/assdraw/src/xpm/res.cpp deleted file mode 100644 index 0f0a787a0..000000000 --- a/contrib/assdraw/src/xpm/res.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#define static -#include "appico_xpm.xpm" -#include "add__xpm.xpm" -#include "arr_1_xpm.xpm" -#include "arr__xpm.xpm" -#include "assdraw3_xpm.xpm" -#include "b__xpm.xpm" -#include "c__xpm.xpm" -#include "check__xpm.xpm" -#include "del__xpm.xpm" -#include "del_cross_xpm.xpm" -#include "help__xpm.xpm" -#include "help_xpm.xpm" -#include "l__xpm.xpm" -#include "m__xpm.xpm" -#include "n__xpm.xpm" -#include "new__xpm.xpm" -#include "nut__xpm.xpm" -#include "p__xpm.xpm" -#include "pan_bg_xpm.xpm" -#include "pan_both_xpm.xpm" -#include "pan_shape_xpm.xpm" -#include "pan_shp_xpm.xpm" -#include "preview__xpm.xpm" -#include "rot__xpm.xpm" -#include "s__xpm.xpm" -#include "sc_rot__xpm.xpm" -#include "src__xpm.xpm" -#include "transform_xpm.xpm" -#include "uncheck__xpm.xpm" diff --git a/contrib/assdraw/src/xpm/res.h b/contrib/assdraw/src/xpm/res.h deleted file mode 100644 index 58753b313..000000000 --- a/contrib/assdraw/src/xpm/res.h +++ /dev/null @@ -1,29 +0,0 @@ -extern char *appico_xpm[]; -extern char *add_xpm[]; -extern char *arr___xpm[]; -extern char *arr__xpm[]; -extern char *assdraw3__xpm[]; -extern char *b__xpm[]; -extern char *c__xpm[]; -extern char *check_xpm[]; -extern char *del__xpm[]; -extern char *delcross_xpm[]; -extern char *help__xpm[]; -extern char *help_xpm[]; -extern char *l__xpm[]; -extern char *m__xpm[]; -extern char *n__xpm[]; -extern char *new__xpm[]; -extern char *nut__xpm[]; -extern char *p__xpm[]; -extern char *pan_bg_xpm[]; -extern char *pan_both_xpm[]; -extern char *pan_shape_xpm[]; -extern char *pan_shp_xpm[]; -extern char *preview__xpm[]; -extern char *rot__xpm[]; -extern char *s__xpm[]; -extern char *sc_rot__xpm[]; -extern char *src__xpm[]; -extern char *transform_xpm[]; -extern char *uncheck_xpm[]; diff --git a/contrib/assdraw/src/xpm/rot__xpm.xpm b/contrib/assdraw/src/xpm/rot__xpm.xpm deleted file mode 100644 index 865230523..000000000 --- a/contrib/assdraw/src/xpm/rot__xpm.xpm +++ /dev/null @@ -1,102 +0,0 @@ -/* XPM */ -const char *rot__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 81 1", -" c #62625858C4C4", -". c #62625959C4C4", -"X c #64645A5AC4C4", -"o c #65655B5BC4C4", -"O c #65655B5BC5C5", -"+ c #66665C5CC4C4", -"@ c #66665D5DC5C5", -"# c #67675D5DC5C5", -"$ c #67675E5EC5C5", -"% c #68685E5EC5C5", -"& c #69695F5FC5C5", -"* c #69696060C6C6", -"= c #6A6A6161C6C6", -"- c #6E6E6565C7C7", -"; c #6F6F6767C7C7", -": c #73736A6AC7C7", -"> c #77776E6EC7C7", -", c #73736A6AC8C8", -"< c #73736B6BC8C8", -"1 c #74746B6BC8C8", -"2 c #76766D6DC8C8", -"3 c #7D7D7474C9C9", -"4 c #7E7E7575C9C9", -"5 c #7E7E7676C9C9", -"6 c #7E7E7676CBCB", -"7 c #7F7F7676CBCB", -"8 c #80807777CACA", -"9 c #81817878CBCB", -"0 c #81817979CDCD", -"q c #82827A7ACCCC", -"w c #87877F7FCCCC", -"e c #88887F7FCCCC", -"r c #88888080CDCD", -"t c #8E8E8686CDCD", -"y c #91918989CFCF", -"u c #93938A8ACECE", -"i c #92928A8ACFCF", -"p c #96968E8ECECE", -"a c #92928B8BD0D0", -"s c #A1A19999D0D0", -"d c #A3A39B9BD3D3", -"f c #A4A49D9DD3D3", -"g c #A5A59E9ED2D2", -"h c #A7A79F9FD3D3", -"j c #A3A39D9DD4D4", -"k c #A4A49D9DD4D4", -"l c #A6A69E9ED5D5", -"z c #A7A7A0A0D4D4", -"x c #ABABA4A4D2D2", -"c c #A8A8A1A1D5D5", -"v c #A9A9A2A2D4D4", -"b c #AAAAA3A3D7D7", -"n c #A7A7A0A0D8D8", -"m c #B1B1ABABD5D5", -"M c #B7B7B0B0D7D7", -"N c #BABAB3B3D7D7", -"B c #BBBBB5B5D5D5", -"V c #BFBFB9B9D6D6", -"C c #BFBFBABAD9D9", -"Z c #C3C3BDBDDADA", -"A c #C2C2BDBDDEDE", -"S c #C4C4BFBFDCDC", -"D c #C5C5C0C0DCDC", -"F c #C7C7C2C2DEDE", -"G c #C8C8C2C2DADA", -"H c #CACAC5C5D8D8", -"J c #C9C9C4C4DADA", -"K c #CBCBC6C6DBDB", -"L c #CCCCC7C7DFDF", -"P c #D1D1CCCCDCDC", -"I c #D4D4CFCFDEDE", -"U c #D6D6D1D1DDDD", -"Y c #D0D0CACAE1E1", -"T c #D2D2CCCCE1E1", -"R c #D4D4CFCFE0E0", -"E c #D3D3CECEE4E4", -"W c #D6D6D1D1E1E1", -"Q c #D8D8D3D3E1E1", -"! c #D8D8D2D2E3E3", -"~ c #DBDBD7D7E5E5", -"^ c None", -/* pixels */ -"^^^^^^^^^^^^^^^^", -"^^En0&+^^^^^^^^^", -"^A9O ~^^^^^^^^", -"TqO7bY^^^^^^!^^^", -"c*6L^^^^^^^WkF^^", -"rOl^^^^^^^WjpV^^^^^", -"^^^^^^^^^^^^^^^^" -}; diff --git a/contrib/assdraw/src/xpm/s__xpm.xpm b/contrib/assdraw/src/xpm/s__xpm.xpm deleted file mode 100644 index 4eac4e49d..000000000 --- a/contrib/assdraw/src/xpm/s__xpm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -const char *s__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -" c gray20", -". c #12120000FFFF", -"X c None", -/* pixels */ -"XX.XXXXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -".....XXXXXXXXXXX", -"XX.XXXXXXXXXXXXX", -"XX.XXX XXXXX", -"XXXXX XXXX", -"XXXXX XXX XXXX", -"XXXXX XXXXXXXXX", -"XXXXX XXXXX", -"XXXXXX XXXX", -"XXXXXXXXXX XXXX", -"XXXXX XXX XXXX", -"XXXXX XXXX", -"XXXXXX XXXXX", -"XXXXXXXXXXXXXXXX" -}; diff --git a/contrib/assdraw/src/xpm/sc_rot__xpm.xpm b/contrib/assdraw/src/xpm/sc_rot__xpm.xpm deleted file mode 100644 index ea44fb665..000000000 --- a/contrib/assdraw/src/xpm/sc_rot__xpm.xpm +++ /dev/null @@ -1,140 +0,0 @@ -/* XPM */ -const char *sc_rot__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 119 2", -" c #212126264747", -". c #2B2B2B2B4848", -"X c #363636364D4D", -"o c #3B3B3B3B5C5C", -"O c #141425256565", -"+ c #0B0B27277D7D", -"@ c #282828286262", -"# c #373737376060", -"$ c #363636366363", -"% c #323232327878", -"& c #3C3C4C4C5858", -"* c #35354F4F6161", -"= c #2F2F56567373", -"- c #303055557070", -"; c #404040405454", -": c #41414F4F5959", -"> c #505050505050", -", c #505050505959", -"< c #585858585858", -"1 c #434343437F7F", -"2 c #4B4B4B4B7979", -"3 c #6F6F6F6F7676", -"4 c #686868687D7D", -"5 c gray44", -"6 c gray47", -"7 c #7C7C7C7C7C7C", -"8 c #0B0B27279C9C", -"9 c #202020208C8C", -"0 c #16161C1CA0A0", -"q c #00003737A0A0", -"w c #00003737ACAC", -"e c #0B0B2727BBBB", -"r c #00003737B9B9", -"t c #22222222A2A2", -"y c #25252525A5A5", -"u c #28282828A8A8", -"i c #2F2F2F2FAFAF", -"p c #35353535A2A2", -"a c #37373737B7B7", -"s c #3B3B3B3BBBBB", -"d c #3E3E3E3EBEBE", -"f c #181843438585", -"g c #28285F5F8888", -"h c #1F1F67679E9E", -"j c #202062629595", -"k c #242465659494", -"l c #222267679A9A", -"z c #222268689A9A", -"x c #00004747B0B0", -"c c #00005050B9B9", -"v c #16167777BDBD", -"b c #20206A6AA0A0", -"n c #4B4B4B4B8686", -"m c #474747478888", -"M c #474747478D8D", -"N c #474747478F8F", -"B c #525252528D8D", -"V c #474747479393", -"C c #414141419595", -"Z c #474747479494", -"A c #474747479595", -"S c #474747479A9A", -"D c #474747479B9B", -"F c #474747479C9C", -"G c #5E5E5E5E9090", -"H c #5E5E5E5E9292", -"J c #696969698080", -"K c #606060608A8A", -"L c #6A6A6A6A9898", -"P c #797979799696", -"I c #757575759D9D", -"U c #767676769E9E", -"Y c #47474747A0A0", -"T c #47474747A1A1", -"R c #47474747A3A3", -"E c #44444444A5A5", -"W c #47474747A6A6", -"Q c #47474747A7A7", -"! c #47474747ACAC", -"~ c #47474747AEAE", -"^ c #47474747AFAF", -"/ c #47474747B4B4", -"( c #47474747B9B9", -") c #47474747BABA", -"_ c #00003737C5C5", -"` c #00003737CCCC", -"' c #00003737D2D2", -"] c #00003737D8D8", -"[ c #00003737DFDF", -"{ c #00005A5AC3C3", -"} c #00006C6CD6D6", -"| c #00007F7FE9E9", -" . c #47474747C0C0", -".. c #47474747C1C1", -"X. c #44444444C4C4", -"o. c #46464646C6C6", -"O. c #47474747C6C6", -"+. c #47474747C7C7", -"@. c #00009191FCFC", -"#. c #00009494FFFF", -"$. c #909090909090", -"%. c #80808080A2A2", -"&. c #82828282A3A3", -"*. c #8C8C8C8CA8A8", -"=. c #8F8F8F8FA9A9", -"-. c #98989898ADAD", -";. c #99999999AEAE", -":. c #A4A4A4A4A4A4", -">. c gray66", -",. c #ACACACACACAC", -"<. c #A3A3A3A3B2B2", -"1. c #A4A4A4A4B3B3", -"2. c #A7A7A7A7B4B4", -"3. c #B0B0B0B0B8B8", -"4. c #B1B1B1B1B9B9", -"5. c #BCBCBCBCBDBD", -"6. c #BCBCBCBCBEBE", -"7. c gray75", -"8. c None", -/* pixels */ -": * = g j b b : 7 >.8.8.8.8.8.8.", -"k v z - O c f 4 , > 6 >.8.8.8.", -"b #.#.@.q ] ` 8 D N n 2 o ; 3 ,.", -"b #.#.| w [ [ e +.+. ./ W C % . ", -"b #.#.} r [ [ e +.+.+.+.+.+.) G ", -"b #.#.{ _ [ [ e +.+.+.+.+.+.~ I ", -"b #.#.x ' [ [ e +.+.+.+.+.+.T *.", -"& l h + e e e 0 X.+.+.+.+.+.Z 1.", -"$.5 <.A +.+.+.d t o.+.+.+.O.m 6.", -"8.< P R +.+.+.+.a u +.+.+.( H 8.", -"8.:.# ^ +.+.+.+.+.i i +.+.! U 8.", -"8.8.$ p +.+.+.+.+.+.u a +.Y =.8.", -"8.5.J @ M S Q / ..+.o.y s V 2.8.", -"8.8.8.8.4.;.&.L B N F E 9 1 7.8.", -"8.8.8.8.8.8.8.8.8.3.-.%.K X 8.8." -}; diff --git a/contrib/assdraw/src/xpm/src__xpm.xpm b/contrib/assdraw/src/xpm/src__xpm.xpm deleted file mode 100644 index b53d5fe1f..000000000 --- a/contrib/assdraw/src/xpm/src__xpm.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -const char *src__xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 4 1", -" c black", -". c #0000BFBFBFBF", -"X c cyan", -"o c None", -/* pixels */ -"oooooo ooooooo", -"ooo oo . oo oooo", -"oo X o o X ooo", -"o X. XXX .. oo", -"oo XX..... ooo", -"ooo X. .. oooo", -" X. ooo .. o", -" X .. ooo X. . o", -" .. ooo X. o", -"ooo .. X. oooo", -"oo ...XX.. ooo", -"o X. ... .. oo", -"oo . o o . ooo", -"ooo oo . oo oooo", -"oooooo ooooooo" -}; diff --git a/contrib/assdraw/src/xpm/transform_xpm.xpm b/contrib/assdraw/src/xpm/transform_xpm.xpm deleted file mode 100644 index 9c2d7d9f7..000000000 --- a/contrib/assdraw/src/xpm/transform_xpm.xpm +++ /dev/null @@ -1,65 +0,0 @@ -/* XPM */ -const char *transform_xpm[] = { -/* columns rows colors chars-per-pixel */ -"224 56 3 1", -" c black", -". c red", -"X c gray100", -/* pixels */ -"................................................................................................................................................................................................................................", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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", -".XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXX XXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX.", -".XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXX XX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX.", -".XXXXX XXXX X XXXX XXXXXXXXXXXXXXX XXXXXX X XX XXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXX X XX XXXXXX XXXXXXXXX XXXXX XX XXXX XXXX X XXXXXXXXXXXXXX X XX XX X XXX XXXX XXXXXXXXXXXXX XXXXX X XX X XXXX XXXXX.", -".XXXXX XXXXX XXX XXXXX XXXXXXXXXXXXXXX XXXXX XX XX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXX XX XX XXXXX XXXXXXXX XXXXXX XX XXXX XXXXX XXX XXXXXXXXXXXXXX XX XX XX XXX XXXX XXXX XXXXXXXXXXXXX XXXX XX XX XXX XXXXX XXXXX.", -".XXXXX XXXXXX X XXXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXXXX XXXXXXX XXXXXXX XX XXXX XXXXXX X XXXX XXX XXX XXX XXX X XXXXX XXXX XXXXXXXXXXXXX XXXXX XXX XXX X XXXXXX XXXXX.", -".XXXXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXXXX XXXXXX XXXXXXXX XX XXXX XXXXXXX XXXXXXXXXXXXXXXXX XXX XXX XXXX XXXXXX XXXX XXXXXXXXXXXXX XXXXX XXX XXXX XXXXXXX XXXXX.", -".XXXXX XXXXXX X XXXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXXXX XXXXX XXXXXXXXX XX XXXX XXXXXX X XXXXXXXXXXXXXXXX XXX XXX XXX X XXXXX XXXX XXXXXXXXXXXXX XXXXX XXX XXX X XXXXXX XXXXX.", -".XXXXX XXXXX XXX XXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXXXX XXXX XXXX XXXXX XX XXXXXXXXXX XXX XXXXXXXXXXXXXXX XXX XXX XX XXX XXXXXXXXX XXXXXXXXXXXXX XXXXX XXX XX XXX XXXXX XXXXX.", -".XXXXX XXXX X XXXX XXXXXXXXXXXXXXX XXXXX X X XXX XXXXX XXXXXXXXXXXXXXXXX X X XXX XXX XXXXX XX XXXXX XXX X XXXXXXXXXXXXX X X X XX XXXXX XXXXXXXXXXXXX XXXX X X XXXX XXXXX.", -".XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXX XXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX.", -".XXXXX XXXXXXXXXXXXXXX XXXXX XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXX X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XXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX.", -".XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXXX XXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX.", -".XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXX XX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX.", -".XXXXX XXXX X XXXX XXXXXXXXXXXXXXX XXXXXX X XX XXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXX X XX XXXXXXXX XXXXXXX XXXXX XX XXXX XXXX X XXXXXXXXXXXXXX X XX XX X XXX XXXX XXXXXXXXXXXXX XXXXX X XX X XXXX XXXXX.", -".XXXXX XXXXX XXX XXXXX XXXXXXXXXXXXXXX XXXXX XX XX XXXXXX XXXXXX XXXXXXXXXXXXXXXXXX XX XX XXXXXX XXXXXXX XXXXXX XX XXXX XXXXX XXX XXXXXXXXXXXXXX XX XX XX XXX XXXX XXXX XXXXXXXXXXXXX XXXX XX XX XXX XXXXX XXXXX.", -".XXXXX XXXXX XXX XXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXXXX XXXXXXX XXXXXXX XX XXXX XXXXX XXX XXX XXX XXX XXX XX XXX XXXX XXXX XXXXXXXXXXXXX XXXXX XXX XX XXX XXXXX XXXXX.", -".XXXXX XXXXXX X XXXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXXX XXXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXXX XXXXXXX XXXXXXXX XX XXXX XXXXXX X XXXXXXXXXXXXXXXX XXX XXX XXX X XXXXX XXXX XXXXXXXXXXXXX XXXXX XXX XXX X XXXXXX XXXXX.", -".XXXXX XXXXXX X XXXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XXX XXXXXXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XXX XXXXXXX XXXXXXXXX XX XXXX XXXXXX X XXXXXXXXXXXXXXXX XXX XXX XXX X XXXXX XXXX XXXXXXXXXXXXX XXXXX XXX XXX X XXXXXX XXXXX.", -".XXXXX XXXXXXX XXXXXX XXXXXXXXXXXXXXX XXXXXX XXX XXX XX XXXX XXXXX XXXXXXXXXXXXXXXXXXX XXX XXX XX XXXX XX XXXX XXXXX XX XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXX XXX XXXX XXXXXXXXXX XXXXXXXXXXXXX XXXXX XXX XXXX XXXXXX XXXXX.", -".XXXXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXX XXXXX X X X XXXX XXXXXXXXXXXXXXXXX X X X XX XXXXX XX XXXXX XXXXXX XXXXXXXXXXXXXXXX X X XXX XXXXX XXXXX XXXXXXXXXXXXX XXXX X XXX XXXXXXX XXXXX.", -".XXXXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXXXX.", -".XXXXX XXXXXX XXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -".XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.", -"................................................................................................................................................................................................................................" -}; diff --git a/contrib/assdraw/src/xpm/uncheck__xpm.xpm b/contrib/assdraw/src/xpm/uncheck__xpm.xpm deleted file mode 100644 index d3be0ca5b..000000000 --- a/contrib/assdraw/src/xpm/uncheck__xpm.xpm +++ /dev/null @@ -1,26 +0,0 @@ -/* XPM */ -const char *uncheck_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 5 1", -" c gray25", -". c #808080808080", -"X c #D4D4D0D0C8C8", -"o c gray100", -"O c None", -/* pixels */ -"OOOOOOOOOOOOOOOO", -"OO............OO", -"OO. XOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO. oooooooooXOO", -"OO.XXXXXXXXXXXOO", -"OOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOO" -}; diff --git a/devel/OverLua/GPLv2.txt b/devel/OverLua/GPLv2.txt deleted file mode 100644 index d511905c1..000000000 --- a/devel/OverLua/GPLv2.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/devel/OverLua/avisynth.cpp b/devel/OverLua/avisynth.cpp deleted file mode 100644 index f1a51230f..000000000 --- a/devel/OverLua/avisynth.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Avisynth interface for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -// Must be included before , otherwise some macros from get in the way -#include "image.h" - -#include -#include -#include - -#include "avisynth.h" - -#include "overlua.h" -#include "vfr.h" - -// Lots of code lifted from the CSRI avisynth.cpp - -class OverLuaAvisynth : public GenericVideoFilter { -private: - OverLuaScript *script; - double spf; // seconds per frame - for frame/timestamp conversion - VFRTranslator *vfr; - -public: - OverLuaAvisynth(PClip _child, IScriptEnvironment *env, const char *file, const char *datastring, const char *vfrfile) - : GenericVideoFilter(_child) - { - switch (vi.pixel_type) { - case VideoInfo::CS_BGR24: - case VideoInfo::CS_BGR32: - // safe - break; - default: - env->ThrowError("OverLua: Unsupported pixel format, only RGB formats supported"); - } - - try { - script = new OverLuaScript(file, datastring); - spf = (double)vi.fps_denominator / (double)vi.fps_numerator; - if (vfrfile) - vfr = GetVFRTranslator(vfrfile); - else - vfr = 0; - } - catch (const char *e) { - env->ThrowError(e); - } - catch (...) { - env->ThrowError("Unknown exception in OverLua"); - } - } - - ~OverLuaAvisynth() - { - if (vfr) - delete vfr; - delete script; - } - - PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment *env) - { - OutputDebugStringW(L"Entering OverLua GetFrame\n"); - PVideoFrame avsframe = child->GetFrame(n, env); - env->MakeWritable(&avsframe); - - double frametime = n * spf; - if (vfr) - frametime = vfr->TimeStampFromFrameNumber(n); - ptrdiff_t stride = avsframe->GetPitch(); - unsigned char *plane = avsframe->GetWritePtr(); - - plane += (vi.height - 1) * stride; - stride = -stride; - - try { - switch (vi.pixel_type) { - case VideoInfo::CS_BGR24: { - ImageBGR *frame = new ImageBGR(vi.width, vi.height, stride, plane); - script->RenderFrameRGB(*frame, frametime); - } break; - case VideoInfo::CS_BGR32: { - ImageBGRX *frame = new ImageBGRX(vi.width, vi.height, stride, plane); - script->RenderFrameRGB(*frame, frametime); - } break; - } - } - catch (const char *e) { - wchar_t *ew = new wchar_t[2048]; - MultiByteToWideChar(CP_UTF8, 0, e, -1, ew, 2048); - MessageBoxW(0, ew, L"OverLua execution error", MB_ICONERROR); - delete[] ew; - env->ThrowError(e); - } - catch (...) { - MessageBoxW(0, L"Unknown error", L"OverLua execution error", MB_ICONERROR); - env->ThrowError("OverLua: unknown execution error"); - } - - OutputDebugStringW(L"Leaving OverLua GetFrame\n"); - return avsframe; - } - - static AVSValue __cdecl Create(AVSValue args, void* user_data, IScriptEnvironment* env) - { - return new OverLuaAvisynth(args[0].AsClip(), env, args[1].AsString(), args[2].AsString(0), args[3].AsString(0)); - } -}; - - -extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) -{ - env->AddFunction("OverLua", "cs[data]s[vfr]s", OverLuaAvisynth::Create, 0); - return "OverLua"; -} - diff --git a/devel/OverLua/avisynth.h b/devel/OverLua/avisynth.h deleted file mode 100644 index d0a543aa3..000000000 --- a/devel/OverLua/avisynth.h +++ /dev/null @@ -1,754 +0,0 @@ -// Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al. -// http://www.avisynth.org - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// Linking Avisynth statically or dynamically with other modules is making a -// combined work based on Avisynth. Thus, the terms and conditions of the GNU -// General Public License cover the whole combination. -// -// As a special exception, the copyright holders of Avisynth give you -// permission to link Avisynth with independent modules that communicate with -// Avisynth solely through the interfaces defined in avisynth.h, regardless of the license -// terms of these independent modules, and to copy and distribute the -// resulting combined work under terms of your choice, provided that -// every copy of the combined work is accompanied by a complete copy of -// the source code of Avisynth (the version of Avisynth used to produce the -// combined work), being distributed under the terms of the GNU General -// Public License plus this exception. An independent module is a module -// which is not derived from or based on Avisynth, such as 3rd-party filters, -// import and export plugins, or graphical user interfaces. - - - - - -#ifndef __AVISYNTH_H__ -#define __AVISYNTH_H__ - -enum { AVISYNTH_INTERFACE_VERSION = 3 }; - - -/* Define all types necessary for interfacing with avisynth.dll - Moved from internal.h */ - -// Win32 API macros, notably the types BYTE, DWORD, ULONG, etc. -#include - -// COM interface macros -#include - - -// Raster types used by VirtualDub & Avisynth -#define in64 (__int64)(unsigned short) -typedef unsigned long Pixel; // this will break on 64-bit machines! -typedef unsigned long Pixel32; -typedef unsigned char Pixel8; -typedef long PixCoord; -typedef long PixDim; -typedef long PixOffset; - - -/* Compiler-specific crap */ - -// Tell MSVC to stop precompiling here -#ifdef _MSC_VER - #pragma hdrstop -#endif - -// Set up debugging macros for MS compilers; for others, step down to the -// standard interface -#ifdef _MSC_VER - #include -#else - #define _RPT0(a,b) ((void)0) - #define _RPT1(a,b,c) ((void)0) - #define _RPT2(a,b,c,d) ((void)0) - #define _RPT3(a,b,c,d,e) ((void)0) - #define _RPT4(a,b,c,d,e,f) ((void)0) - - #define _ASSERTE(x) assert(x) - #define _ASSERT(x) assert(x) - #include -#endif - - - -// I had problems with Premiere wanting 1-byte alignment for its structures, -// so I now set the Avisynth struct alignment explicitly here. -#pragma pack(push,8) - -#define FRAME_ALIGN 16 -// Default frame alignment is 16 bytes, to help P4, when using SSE2 - -// The VideoInfo struct holds global information about a clip (i.e. -// information that does not depend on the frame number). The GetVideoInfo -// method in IClip returns this struct. - -// Audio Sample information -typedef float SFLOAT; - -enum {SAMPLE_INT8 = 1<<0, - SAMPLE_INT16 = 1<<1, - SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware. - SAMPLE_INT32 = 1<<3, - SAMPLE_FLOAT = 1<<4}; - -enum { - PLANAR_Y=1<<0, - PLANAR_U=1<<1, - PLANAR_V=1<<2, - PLANAR_ALIGNED=1<<3, - PLANAR_Y_ALIGNED=PLANAR_Y|PLANAR_ALIGNED, - PLANAR_U_ALIGNED=PLANAR_U|PLANAR_ALIGNED, - PLANAR_V_ALIGNED=PLANAR_V|PLANAR_ALIGNED, - }; - -struct VideoInfo { - int width, height; // width=0 means no video - unsigned fps_numerator, fps_denominator; - int num_frames; - // This is more extensible than previous versions. More properties can be added seeminglesly. - - // Colorspace properties. - enum { - CS_BGR = 1<<28, - CS_YUV = 1<<29, - CS_INTERLEAVED = 1<<30, - CS_PLANAR = 1<<31 - }; - - // Specific colorformats - enum { CS_UNKNOWN = 0, - CS_BGR24 = 1<<0 | CS_BGR | CS_INTERLEAVED, - CS_BGR32 = 1<<1 | CS_BGR | CS_INTERLEAVED, - CS_YUY2 = 1<<2 | CS_YUV | CS_INTERLEAVED, - CS_YV12 = 1<<3 | CS_YUV | CS_PLANAR, // y-v-u, planar - CS_I420 = 1<<4 | CS_YUV | CS_PLANAR, // y-u-v, planar - CS_IYUV = 1<<4 | CS_YUV | CS_PLANAR // same as above - }; - int pixel_type; // changed to int as of 2.5 - - - int audio_samples_per_second; // 0 means no audio - int sample_type; // as of 2.5 - __int64 num_audio_samples; // changed as of 2.5 - int nchannels; // as of 2.5 - - // Imagetype properties - - int image_type; - - enum { - IT_BFF = 1<<0, - IT_TFF = 1<<1, - IT_FIELDBASED = 1<<2 - }; - - // useful functions of the above - bool HasVideo() const { return (width!=0); } - bool HasAudio() const { return (audio_samples_per_second!=0); } - bool IsRGB() const { return !!(pixel_type&CS_BGR); } - bool IsRGB24() const { return (pixel_type&CS_BGR24)==CS_BGR24; } // Clear out additional properties - bool IsRGB32() const { return (pixel_type & CS_BGR32) == CS_BGR32 ; } - bool IsYUV() const { return !!(pixel_type&CS_YUV ); } - bool IsYUY2() const { return (pixel_type & CS_YUY2) == CS_YUY2; } - bool IsYV12() const { return ((pixel_type & CS_YV12) == CS_YV12)||((pixel_type & CS_I420) == CS_I420); } - bool IsColorSpace(int c_space) const { return ((pixel_type & c_space) == c_space); } - bool Is(int property) const { return ((pixel_type & property)==property ); } - bool IsPlanar() const { return !!(pixel_type & CS_PLANAR); } - bool IsFieldBased() const { return !!(image_type & IT_FIELDBASED); } - bool IsParityKnown() const { return ((image_type & IT_FIELDBASED)&&(image_type & (IT_BFF|IT_TFF))); } - bool IsBFF() const { return !!(image_type & IT_BFF); } - bool IsTFF() const { return !!(image_type & IT_TFF); } - - bool IsVPlaneFirst() const {return ((pixel_type & CS_YV12) == CS_YV12); } // Don't use this - int BytesFromPixels(int pixels) const { return pixels * (BitsPerPixel()>>3); } // Will not work on planar images, but will return only luma planes - int RowSize() const { return BytesFromPixels(width); } // Also only returns first plane on planar images - int BMPSize() const { if (IsPlanar()) {int p = height * ((RowSize()+3) & ~3); p+=p>>1; return p; } return height * ((RowSize()+3) & ~3); } - __int64 AudioSamplesFromFrames(__int64 frames) const { return (fps_numerator && HasVideo()) ? ((__int64)(frames) * audio_samples_per_second * fps_denominator / fps_numerator) : 0; } - int FramesFromAudioSamples(__int64 samples) const { return (fps_denominator && HasAudio()) ? (int)((samples * (__int64)fps_numerator)/((__int64)fps_denominator * (__int64)audio_samples_per_second)) : 0; } - __int64 AudioSamplesFromBytes(__int64 bytes) const { return HasAudio() ? bytes / BytesPerAudioSample() : 0; } - __int64 BytesFromAudioSamples(__int64 samples) const { return samples * BytesPerAudioSample(); } - int AudioChannels() const { return nchannels; } - int SampleType() const{ return sample_type;} - bool IsSampleType(int testtype) const{ return !!(sample_type&testtype);} - int SamplesPerSecond() const { return audio_samples_per_second; } - int BytesPerAudioSample() const { return nchannels*BytesPerChannelSample();} - void SetFieldBased(bool isfieldbased) { if (isfieldbased) image_type|=IT_FIELDBASED; else image_type&=~IT_FIELDBASED; } - void Set(int property) { image_type|=property; } - void Clear(int property) { image_type&=~property; } - - int BitsPerPixel() const { - switch (pixel_type) { - case CS_BGR24: - return 24; - case CS_BGR32: - return 32; - case CS_YUY2: - return 16; - case CS_YV12: - case CS_I420: - return 12; - default: - return 0; - } - } - int BytesPerChannelSample() const { - switch (sample_type) { - case SAMPLE_INT8: - return sizeof(signed char); - case SAMPLE_INT16: - return sizeof(signed short); - case SAMPLE_INT24: - return 3; - case SAMPLE_INT32: - return sizeof(signed int); - case SAMPLE_FLOAT: - return sizeof(SFLOAT); - default: - _ASSERTE("Sample type not recognized!"); - return 0; - } - } - - // useful mutator - void SetFPS(unsigned numerator, unsigned denominator) { - if ((numerator == 0) || (denominator == 0)) { - fps_numerator = 0; - fps_denominator = 1; - } - else { - unsigned x=numerator, y=denominator; - while (y) { // find gcd - unsigned t = x%y; x = y; y = t; - } - fps_numerator = numerator/x; - fps_denominator = denominator/x; - } - } - - // Range protected multiply-divide of FPS - void MulDivFPS(unsigned multiplier, unsigned divisor) { - unsigned __int64 numerator = UInt32x32To64(fps_numerator, multiplier); - unsigned __int64 denominator = UInt32x32To64(fps_denominator, divisor); - - unsigned __int64 x=numerator, y=denominator; - while (y) { // find gcd - unsigned __int64 t = x%y; x = y; y = t; - } - numerator /= x; // normalize - denominator /= x; - - unsigned __int64 temp = numerator | denominator; // Just looking top bit - unsigned u = 0; -#ifdef __GNUC__ - while (temp & 0xffffffff80000000LL) { // or perhaps > 16777216*2 -#else - while (temp & 0xffffffff80000000) { // or perhaps > 16777216*2 -#endif - temp = Int64ShrlMod32(temp, 1); - u++; - } - if (u) { // Scale to fit - const unsigned round = 1 << (u-1); - SetFPS( (unsigned)Int64ShrlMod32(numerator + round, u), - (unsigned)Int64ShrlMod32(denominator + round, u) ); - } - else { - fps_numerator = (unsigned)numerator; - fps_denominator = (unsigned)denominator; - } - } - - // Test for same colorspace - bool IsSameColorspace(const VideoInfo& vi) const { - if (vi.pixel_type == pixel_type) return TRUE; - if (IsYV12() && vi.IsYV12()) return TRUE; - return FALSE; - } - -}; - - - - -// VideoFrameBuffer holds information about a memory block which is used -// for video data. For efficiency, instances of this class are not deleted -// when the refcount reaches zero; instead they're stored in a linked list -// to be reused. The instances are deleted when the corresponding AVS -// file is closed. - -class VideoFrameBuffer { - BYTE* const data; - const int data_size; - // sequence_number is incremented every time the buffer is changed, so - // that stale views can tell they're no longer valid. - long sequence_number; - - friend class VideoFrame; - friend class Cache; - friend class ScriptEnvironment; - long refcount; - -public: - VideoFrameBuffer(int size); - VideoFrameBuffer(); - ~VideoFrameBuffer(); - - const BYTE* GetReadPtr() const { return data; } - BYTE* GetWritePtr() { ++sequence_number; return data; } - int GetDataSize() { return data_size; } - int GetSequenceNumber() { return sequence_number; } - int GetRefcount() { return refcount; } -}; - - -class IClip; -class PClip; -class PVideoFrame; -class IScriptEnvironment; -class AVSValue; - - -// VideoFrame holds a "window" into a VideoFrameBuffer. Operator new -// is overloaded to recycle class instances. - -class VideoFrame { - int refcount; - VideoFrameBuffer* const vfb; - const int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture. - - friend class PVideoFrame; - void AddRef() { InterlockedIncrement((long *)&refcount); } - void Release() { if (refcount==1) InterlockedDecrement(&vfb->refcount); InterlockedDecrement((long *)&refcount); } - - friend class ScriptEnvironment; - friend class Cache; - - VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height); - VideoFrame(VideoFrameBuffer* _vfb, int _offset, int _pitch, int _row_size, int _height, int _offsetU, int _offsetV, int _pitchUV); - - void* operator new(size_t size); -// TESTME: OFFSET U/V may be switched to what could be expected from AVI standard! -public: - int GetPitch() const { return pitch; } - int GetPitch(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: return pitchUV;} return pitch; } - int GetRowSize() const { return row_size; } - int GetRowSize(int plane) const { - switch (plane) { - case PLANAR_U: case PLANAR_V: if (pitchUV) return row_size>>1; else return 0; - case PLANAR_U_ALIGNED: case PLANAR_V_ALIGNED: - if (pitchUV) { - int r = ((row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)) )>>1; // Aligned rowsize - if (r<=pitchUV) - return r; - return row_size>>1; - } else return 0; - case PLANAR_Y_ALIGNED: - int r = (row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)); // Aligned rowsize - if (r<=pitch) - return r; - return row_size; - } - return row_size; } - int GetHeight() const { return height; } - int GetHeight(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: if (pitchUV) return height>>1; return 0;} return height; } - - // generally you shouldn't use these three - VideoFrameBuffer* GetFrameBuffer() const { return vfb; } - int GetOffset() const { return offset; } - int GetOffset(int plane) const { switch (plane) {case PLANAR_U: return offsetU;case PLANAR_V: return offsetV;default: return offset;}; } - - // in plugins use env->SubFrame() - VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height) const; - VideoFrame* Subframe(int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int pitchUV) const; - - - const BYTE* GetReadPtr() const { return vfb->GetReadPtr() + offset; } - const BYTE* GetReadPtr(int plane) const { return vfb->GetReadPtr() + GetOffset(plane); } - - bool IsWritable() const { return (refcount == 1 && vfb->refcount == 1); } - - BYTE* GetWritePtr() const { - if (vfb->GetRefcount()>1) { - _ASSERT(FALSE); - //throw AvisynthError("Internal Error - refcount was more than one!"); - } - return IsWritable() ? (vfb->GetWritePtr() + offset) : 0; - } - - BYTE* GetWritePtr(int plane) const { - if (plane==PLANAR_Y) { - if (vfb->GetRefcount()>1) { - _ASSERT(FALSE); -// throw AvisynthError("Internal Error - refcount was more than one!"); - } - return IsWritable() ? vfb->GetWritePtr() + GetOffset(plane) : 0; - } - return vfb->data + GetOffset(plane); - } - - ~VideoFrame() { InterlockedDecrement(&vfb->refcount); } -}; - -enum { - CACHE_NOTHING=0, - CACHE_RANGE=1, - CACHE_ALL=2, - CACHE_AUDIO=3, - CACHE_AUDIO_NONE=4 - }; - -// Base class for all filters. -class IClip { - friend class PClip; - friend class AVSValue; - int refcnt; - void AddRef() { InterlockedIncrement((long *)&refcnt); } - void Release() { InterlockedDecrement((long *)&refcnt); if (!refcnt) delete this; } -public: - IClip() : refcnt(0) {} - - virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; } - - virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0; - virtual bool __stdcall GetParity(int n) = 0; // return field parity if field_based, else parity of first field in frame - virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples - virtual void __stdcall SetCacheHints(int cachehints,int frame_range) = 0 ; // We do not pass cache requests upwards, only to the next filter. - virtual const VideoInfo& __stdcall GetVideoInfo() = 0; - virtual __stdcall ~IClip() {} -}; - - -// smart pointer to IClip -class PClip { - - IClip* p; - - IClip* GetPointerWithAddRef() const { if (p) p->AddRef(); return p; } - friend class AVSValue; - friend class VideoFrame; - - void Init(IClip* x) { - if (x) x->AddRef(); - p=x; - } - void Set(IClip* x) { - if (x) x->AddRef(); - if (p) p->Release(); - p=x; - } - -public: - PClip() { p = 0; } - PClip(const PClip& x) { Init(x.p); } - PClip(IClip* x) { Init(x); } - void operator=(IClip* x) { Set(x); } - void operator=(const PClip& x) { Set(x.p); } - - IClip* operator->() const { return p; } - - // useful in conditional expressions - operator void*() const { return p; } - bool operator!() const { return !p; } - - ~PClip() { if (p) p->Release(); } -}; - - -// smart pointer to VideoFrame -class PVideoFrame { - - VideoFrame* p; - - void Init(VideoFrame* x) { - if (x) x->AddRef(); - p=x; - } - void Set(VideoFrame* x) { - if (x) x->AddRef(); - if (p) p->Release(); - p=x; - } - -public: - PVideoFrame() { p = 0; } - PVideoFrame(const PVideoFrame& x) { Init(x.p); } - PVideoFrame(VideoFrame* x) { Init(x); } - void operator=(VideoFrame* x) { Set(x); } - void operator=(const PVideoFrame& x) { Set(x.p); } - - VideoFrame* operator->() const { return p; } - - // for conditional expressions - operator void*() const { return p; } - bool operator!() const { return !p; } - - ~PVideoFrame() { if (p) p->Release();} -}; - - -class AVSValue { -public: - - AVSValue() { type = 'v'; } - AVSValue(IClip* c) { type = 'c'; clip = c; if (c) c->AddRef(); } - AVSValue(const PClip& c) { type = 'c'; clip = c.GetPointerWithAddRef(); } - AVSValue(bool b) { type = 'b'; boolean = b; } - AVSValue(int i) { type = 'i'; integer = i; } -// AVSValue(__int64 l) { type = 'l'; longlong = l; } - AVSValue(float f) { type = 'f'; floating_pt = f; } - AVSValue(double f) { type = 'f'; floating_pt = float(f); } - AVSValue(const char* s) { type = 's'; string = s; } - AVSValue(const AVSValue* a, int size) { type = 'a'; array = a; array_size = size; } - AVSValue(const AVSValue& v) { Assign(&v, true); } - - ~AVSValue() { if (IsClip() && clip) clip->Release(); } - AVSValue& operator=(const AVSValue& v) { Assign(&v, false); return *this; } - - // Note that we transparently allow 'int' to be treated as 'float'. - // There are no int<->bool conversions, though. - - bool Defined() const { return type != 'v'; } - bool IsClip() const { return type == 'c'; } - bool IsBool() const { return type == 'b'; } - bool IsInt() const { return type == 'i'; } -// bool IsLong() const { return (type == 'l'|| type == 'i'); } - bool IsFloat() const { return type == 'f' || type == 'i'; } - bool IsString() const { return type == 's'; } - bool IsArray() const { return type == 'a'; } - - PClip AsClip() const { _ASSERTE(IsClip()); return IsClip()?clip:0; } - bool AsBool() const { _ASSERTE(IsBool()); return boolean; } - int AsInt() const { _ASSERTE(IsInt()); return integer; } -// int AsLong() const { _ASSERTE(IsLong()); return longlong; } - const char* AsString() const { _ASSERTE(IsString()); return IsString()?string:0; } - double AsFloat() const { _ASSERTE(IsFloat()); return IsInt()?integer:floating_pt; } - - bool AsBool(bool def) const { _ASSERTE(IsBool()||!Defined()); return IsBool() ? boolean : def; } - int AsInt(int def) const { _ASSERTE(IsInt()||!Defined()); return IsInt() ? integer : def; } - double AsFloat(double def) const { _ASSERTE(IsFloat()||!Defined()); return IsInt() ? integer : type=='f' ? floating_pt : def; } - const char* AsString(const char* def) const { _ASSERTE(IsString()||!Defined()); return IsString() ? string : def; } - - int ArraySize() const { _ASSERTE(IsArray()); return IsArray()?array_size:1; } - - const AVSValue& operator[](int index) const { - _ASSERTE(IsArray() && index>=0 && index=0 && indexIsClip() && src->clip) - src->clip->AddRef(); - if (!init && IsClip() && clip) - clip->Release(); - // make sure this copies the whole struct! - ((__int32*)this)[0] = ((__int32*)src)[0]; - ((__int32*)this)[1] = ((__int32*)src)[1]; - } -}; - - -// instantiable null filter -class GenericVideoFilter : public IClip { -protected: - PClip child; - VideoInfo vi; -public: - GenericVideoFilter(PClip _child) : child(_child) { vi = child->GetVideoInfo(); } - PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { return child->GetFrame(n, env); } - void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) { child->GetAudio(buf, start, count, env); } - const VideoInfo& __stdcall GetVideoInfo() { return vi; } - bool __stdcall GetParity(int n) { return child->GetParity(n); } - void __stdcall SetCacheHints(int cachehints,int frame_range) { } ; // We do not pass cache requests upwards, only to the next filter. -}; - - -class AvisynthError /* exception */ { -public: - const char* const msg; - AvisynthError(const char* _msg) : msg(_msg) {} -}; - - - - -/* Helper classes useful to plugin authors */ - -class AlignPlanar : public GenericVideoFilter -{ -public: - AlignPlanar(PClip _clip); - static PClip Create(PClip clip); - PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env); -}; - - - -class FillBorder : public GenericVideoFilter -{ -public: - FillBorder(PClip _clip); - static PClip Create(PClip clip); - PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env); -}; - - - -class ConvertAudio : public GenericVideoFilter -/** - * Helper class to convert audio to any format - **/ -{ -public: - ConvertAudio(PClip _clip, int prefered_format); - void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env); - void __stdcall SetCacheHints(int cachehints,int frame_range); // We do pass cache requests upwards, to the cache! - - static PClip Create(PClip clip, int sample_type, int prefered_type); - static AVSValue __cdecl Create_float(AVSValue args, void*, IScriptEnvironment*); - static AVSValue __cdecl Create_32bit(AVSValue args, void*, IScriptEnvironment*); - static AVSValue __cdecl Create_24bit(AVSValue args, void*, IScriptEnvironment*); - static AVSValue __cdecl Create_16bit(AVSValue args, void*, IScriptEnvironment*); - static AVSValue __cdecl Create_8bit(AVSValue args, void*, IScriptEnvironment*); - virtual ~ConvertAudio(); - -private: - void convertToFloat(char* inbuf, float* outbuf, char sample_type, int count); - void convertToFloat_3DN(char* inbuf, float* outbuf, char sample_type, int count); - void convertToFloat_SSE(char* inbuf, float* outbuf, char sample_type, int count); - void convertToFloat_SSE2(char* inbuf, float* outbuf, char sample_type, int count); - void convertFromFloat(float* inbuf, void* outbuf, char sample_type, int count); - void convertFromFloat_3DN(float* inbuf, void* outbuf, char sample_type, int count); - void convertFromFloat_SSE(float* inbuf, void* outbuf, char sample_type, int count); - void convertFromFloat_SSE2(float* inbuf, void* outbuf, char sample_type, int count); - - __inline int Saturate_int8(float n); - __inline short Saturate_int16(float n); - __inline int Saturate_int24(float n); - __inline int Saturate_int32(float n); - - char src_format; - char dst_format; - int src_bps; - char *tempbuffer; - SFLOAT *floatbuffer; - int tempbuffer_size; -}; - - -// For GetCPUFlags. These are backwards-compatible with those in VirtualDub. -enum { - /* slowest CPU to support extension */ - CPUF_FORCE = 0x01, // N/A - CPUF_FPU = 0x02, // 386/486DX - CPUF_MMX = 0x04, // P55C, K6, PII - CPUF_INTEGER_SSE = 0x08, // PIII, Athlon - CPUF_SSE = 0x10, // PIII, Athlon XP/MP - CPUF_SSE2 = 0x20, // PIV, Hammer - CPUF_3DNOW = 0x40, // K6-2 - CPUF_3DNOW_EXT = 0x80, // Athlon - CPUF_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, which only Hammer - // will have anyway) - CPUF_SSE3 = 0x100, // Some P4 & Athlon 64. -}; -#define MAX_INT 0x7fffffff -#define MIN_INT -0x7fffffff - - - -class IScriptEnvironment { -public: - virtual __stdcall ~IScriptEnvironment() {} - - virtual /*static*/ long __stdcall GetCPUFlags() = 0; - - virtual char* __stdcall SaveString(const char* s, int length = -1) = 0; - virtual char* __stdcall Sprintf(const char* fmt, ...) = 0; - // note: val is really a va_list; I hope everyone typedefs va_list to a pointer - virtual char* __stdcall VSprintf(const char* fmt, void* val) = 0; - - __declspec(noreturn) virtual void __stdcall ThrowError(const char* fmt, ...) = 0; - - class NotFound /*exception*/ {}; // thrown by Invoke and GetVar - - typedef AVSValue (__cdecl *ApplyFunc)(AVSValue args, void* user_data, IScriptEnvironment* env); - - virtual void __stdcall AddFunction(const char* name, const char* params, ApplyFunc apply, void* user_data) = 0; - virtual bool __stdcall FunctionExists(const char* name) = 0; - virtual AVSValue __stdcall Invoke(const char* name, const AVSValue args, const char** arg_names=0) = 0; - - virtual AVSValue __stdcall GetVar(const char* name) = 0; - virtual bool __stdcall SetVar(const char* name, const AVSValue& val) = 0; - virtual bool __stdcall SetGlobalVar(const char* name, const AVSValue& val) = 0; - - virtual void __stdcall PushContext(int level=0) = 0; - virtual void __stdcall PopContext() = 0; - - // align should be 4 or 8 - virtual PVideoFrame __stdcall NewVideoFrame(const VideoInfo& vi, int align=FRAME_ALIGN) = 0; - - virtual bool __stdcall MakeWritable(PVideoFrame* pvf) = 0; - - virtual /*static*/ void __stdcall BitBlt(BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height) = 0; - - typedef void (__cdecl *ShutdownFunc)(void* user_data, IScriptEnvironment* env); - virtual void __stdcall AtExit(ShutdownFunc function, void* user_data) = 0; - - virtual void __stdcall CheckVersion(int version = AVISYNTH_INTERFACE_VERSION) = 0; - - virtual PVideoFrame __stdcall Subframe(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height) = 0; - - virtual int __stdcall SetMemoryMax(int mem) = 0; - - virtual int __stdcall SetWorkingDir(const char * newdir) = 0; - - virtual void* __stdcall ManageCache(int key, void* data) = 0; - - enum PlanarChromaAlignmentMode { - PlanarChromaAlignmentOff, - PlanarChromaAlignmentOn, - PlanarChromaAlignmentTest }; - - virtual bool __stdcall PlanarChromaAlignment(PlanarChromaAlignmentMode key) = 0; - - virtual PVideoFrame __stdcall SubframePlanar(PVideoFrame src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV) = 0; -}; - - -// avisynth.dll exports this; it's a way to use it as a library, without -// writing an AVS script or without going through AVIFile. -IScriptEnvironment* __stdcall CreateScriptEnvironment(int version = AVISYNTH_INTERFACE_VERSION); - - -#pragma pack(pop) - -#endif //__AVISYNTH_H__ diff --git a/devel/OverLua/cairo_wrap.cpp b/devel/OverLua/cairo_wrap.cpp deleted file mode 100644 index f48a1a3a1..000000000 --- a/devel/OverLua/cairo_wrap.cpp +++ /dev/null @@ -1,2738 +0,0 @@ -/* - * Lua interface for the cairo graphics library - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#include "cairo_wrap.h" -#include "../lua51/src/lauxlib.h" - -#include - -#ifdef WIN32 -#include -#endif - - -// Macros to help implementing callables - -#define CALLABLE_IMPL(C,N) int C ## ::lua_ ## N (lua_State *L) -#define CALLABLE_NOTIMPL(C,N) CALLABLE_IMPL(C,N) { lua_pushliteral(L, "Method " # N " in class " # C " is not implemented"); lua_error(L); return 0; } -#define CALLABLE_REG(name) AddCallable(lua_ ## name, # name) -#define CALLABLE_REG2(func,name) AddCallable(lua_ ## func, # name) - - -// Maps from strings to various cairo enum types - -static const char *status_names_list[] = { - "success", - "no_memory", - "invalid_restore", "invalid_pop_group", "no_current_point", - "invalid_matrix", "invalid_status", "null_pointer", - "invalid_string", "invalid_path_data", - "read_error", "write_error", - "surface_type_mismatch", "pattern_type_mismatch", - "invalid_content", "invalid_format", "invalid_visual", - "file_not_found", - "invalid_dash", "invalid_dsc_comment", "invalid_index", - "clip_not_representable", - 0 }; -static const char *fill_rule_list[] = {"winding", "even_odd", 0}; -static const char *line_cap_list[] = {"butt", "round", "square", 0}; -static const char *line_join_list[] = {"miter", "round", "bevel", 0}; -static const char *antialias_types_list[] = {"default", "none", "gray", "subpixel", 0}; -static const char *subpixel_order_list[] ={"default", "rgb", "bgr", "vrgb", "vbgr", 0}; -static const char *hint_style_list[] = {"default", "none", "slight", "medium", "full", 0}; -static const char *hint_metrics_list[] = {"default", "on", "off", 0}; -static const char *content_types_list[] = {"c", "a", "ca", 0}; -static const char *operators_list[] = { - "clear", - "source", "over", "in", "out", "atop", - "dest", "dest_over", "dest_in", "dest_out", "dest_atop", - "xor", "add", "saturate", - 0 }; -static const char *font_slant_list[] = {"", "italic", "oblique", 0}; -static const char *font_weight_list[] = {"", "bold", 0}; -static const char *image_formats_list[] = {"argb32", "rgb24", "a8", "a1", "rgb16_565", 0}; -static const char *pattern_extend_list[] = {"none", "repeat", "reflect", "pad", 0}; -static const char *pattern_filter_list[] = {"fast", "good", "best", "nearest", "bilinear", "gaussian", 0}; -static const char *pattern_type_list[] = {"solid", "surface", "linear", "radial", 0}; - - -// Misc. helper functions - -static void font_extents_to_lua(lua_State *L, cairo_font_extents_t &extents) -{ - lua_newtable(L); - lua_pushnumber(L, extents.ascent); - lua_setfield(L, -2, "ascent"); - lua_pushnumber(L, extents.descent); - lua_setfield(L, -2, "descent"); - lua_pushnumber(L, extents.height); - lua_setfield(L, -2, "height"); - lua_pushnumber(L, extents.max_x_advance); - lua_setfield(L, -2, "max_x_advance"); - lua_pushnumber(L, extents.max_y_advance); - lua_setfield(L, -2, "max_y_advance"); -} - -static void text_extents_to_lua(lua_State *L, cairo_text_extents_t &extents) -{ - lua_newtable(L); - lua_pushnumber(L, extents.x_bearing); - lua_setfield(L, -2, "x_bearing"); - lua_pushnumber(L, extents.y_bearing); - lua_setfield(L, -2, "y_bearing"); - lua_pushnumber(L, extents.width); - lua_setfield(L, -2, "width"); - lua_pushnumber(L, extents.height); - lua_setfield(L, -2, "height"); - lua_pushnumber(L, extents.x_advance); - lua_setfield(L, -2, "x_advance"); - lua_pushnumber(L, extents.y_advance); - lua_setfield(L, -2, "y_advance"); -} - - -// Context (cairo_t) - -CALLABLE_IMPL(LuaCairoContext, reference) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoContext *newctx = new LuaCairoContext(L, ctx->context); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, status) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t st = cairo_status(ctx->context); - lua_pushstring(L, status_names_list[st]); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, save) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_save(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, restore) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_restore(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_target) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_surface_t *surf = cairo_get_target(ctx->context); - new LuaCairoSurface(L, surf); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, push_group) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_push_group(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, push_group_with_content) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_content_t ct = (cairo_content_t)luaL_checkoption(L, 1, "ca", content_types_list); - cairo_push_group_with_content(ctx->context, ct); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, pop_group) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_pattern_t *pat = cairo_pop_group(ctx->context); - LuaCairoPattern *patobj = new LuaCairoPattern(L, pat); - cairo_pattern_destroy(pat); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, pop_group_to_source) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_pop_group_to_source(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_group_target) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_surface_t *surf = cairo_get_group_target(ctx->context); - new LuaCairoSurface(L, surf); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_source_rgb) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double r = luaL_checknumber(L, 1); - double g = luaL_checknumber(L, 2); - double b = luaL_checknumber(L, 3); - cairo_set_source_rgb(ctx->context, r, g, b); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, set_source_rgba) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double r = luaL_checknumber(L, 1); - double g = luaL_checknumber(L, 2); - double b = luaL_checknumber(L, 3); - double a = luaL_checknumber(L, 4); - cairo_set_source_rgba(ctx->context, r, g, b, a); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, set_source) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoPattern *pat = LuaCairoPattern::GetObjPointer(L, 1); - cairo_set_source(ctx->context, pat->GetPattern()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, set_source_surface) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoSurface *surf = LuaCairoSurface::GetObjPointer(L, 1); - double surfx = luaL_checknumber(L, 2); - double surfy = luaL_checknumber(L, 3); - cairo_set_source_surface(ctx->context, surf->GetSurface(), surfx, surfy); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_source) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_pattern_t *pat = cairo_get_source(ctx->context); - // The pattern is owned by cairo here, so creating the Lua object will create the needed reference from Lua - new LuaCairoPattern(L, pat); - // Meaning that calling pattern_destroy here would be wrong - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_antialias) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_antialias_t aa = (cairo_antialias_t)luaL_checkoption(L, 1, NULL, antialias_types_list); - cairo_set_antialias(ctx->context, aa); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_antialias) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_antialias_t aa = cairo_get_antialias(ctx->context); - lua_pushstring(L, antialias_types_list[aa]); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_dash) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - - if (lua_isnoneornil(L, 1)) { - // left out parameters, disable dashing - cairo_set_dash(ctx->context, NULL, 0, 0); - return 0; - - } else if (lua_istable(L, 1)) { - // dashing pattern in table, complex case - double offset = luaL_optnumber(L, 2, 0); - size_t num_dashes = lua_objlen(L, 1); - double *dashes = new double[num_dashes]; - size_t i = 0; - lua_pushnil(L); - while (lua_next(L, 1)) { - if (lua_isnumber(L, -1)) { - dashes[i] = lua_tonumber(L, -1); - } else { - dashes[i] = 0; - } - lua_pop(L, 1); - } - cairo_set_dash(ctx->context, dashes, (int)num_dashes, offset); - delete[] dashes; - return 0; - - } else if (lua_isnumber(L, 1)) { - // single dash, alternating on/off - double dash = luaL_checknumber(L, 1); - double offset = luaL_optnumber(L, 2, 0); - if (dash > 0) { - cairo_set_dash(ctx->context, &dash, 1, offset); - } else { - // ok number was invalid, disable dashing instead of putting context into error state - cairo_set_dash(ctx->context, NULL, 0, 0); - } - return 0; - - } else { - luaL_error(L, "First argument to set_dash must be nil, table or number, was %s", luaL_typename(L, 1)); - return 0; - } -} - -CALLABLE_IMPL(LuaCairoContext, get_dash_count) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - int dash_count = cairo_get_dash_count(ctx->context); - lua_pushinteger(L, dash_count); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, get_dash) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - int dash_count = cairo_get_dash_count(ctx->context); - - if (dash_count <= 0) { - lua_newtable(L); - lua_pushnumber(L, 0); - return 2; - } - - double *dashes = new double[dash_count]; - double offset; - cairo_get_dash(ctx->context, dashes, &offset); - lua_newtable(L); - for (int i = 0; i < dash_count; i++) { - lua_pushnumber(L, dashes[i]); - lua_rawseti(L, -2, i+1); - } - delete[] dashes; - lua_pushnumber(L, offset); - return 2; -} - -CALLABLE_IMPL(LuaCairoContext, set_fill_rule) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_fill_rule_t fr = (cairo_fill_rule_t)luaL_checkoption(L, 1, NULL, fill_rule_list); - cairo_set_fill_rule(ctx->context, fr); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_fill_rule) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_fill_rule_t fr = cairo_get_fill_rule(ctx->context); - lua_pushstring(L, fill_rule_list[fr]); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_line_cap) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_line_cap_t lc = (cairo_line_cap_t)luaL_checkoption(L, 1, NULL, line_cap_list); - cairo_set_line_cap(ctx->context, lc); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_line_cap) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_line_cap_t lc = cairo_get_line_cap(ctx->context); - lua_pushstring(L, line_cap_list[lc]); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_line_join) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_line_join_t lj = (cairo_line_join_t)luaL_checkoption(L, 1, NULL, line_join_list); - cairo_set_line_join(ctx->context, lj); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_line_join) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_line_join_t lj = cairo_get_line_join(ctx->context); - lua_pushstring(L, line_join_list[lj]); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_line_width) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double w = luaL_checknumber(L, 1); - cairo_set_line_width(ctx->context, w); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_line_width) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double w = cairo_get_line_width(ctx->context); - lua_pushnumber(L, w); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_miter_limit) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double l = luaL_checknumber(L, 1); - cairo_set_miter_limit(ctx->context, l); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_miter_limit) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double l = cairo_get_miter_limit(ctx->context); - lua_pushnumber(L, l); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_operator) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_operator_t op = (cairo_operator_t)luaL_checkoption(L, 1, NULL, operators_list); - cairo_set_operator(ctx->context, op); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_operator) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_operator_t op = cairo_get_operator(ctx->context); - lua_pushstring(L, operators_list[op]); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_tolerance) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double tol = luaL_checknumber(L, 1); - cairo_set_tolerance(ctx->context, tol); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_tolerance) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double tol = cairo_get_tolerance(ctx->context); - lua_pushnumber(L, tol); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, clip) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_clip(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, clip_preserve) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_clip_preserve(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, clip_extents) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x1, y1, x2, y2; - cairo_clip_extents(ctx->context, &x1, &y1, &x2, &y2); - lua_pushnumber(L, x1); - lua_pushnumber(L, y1); - lua_pushnumber(L, x2); - lua_pushnumber(L, y2); - return 4; -} - -CALLABLE_IMPL(LuaCairoContext, reset_clip) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_reset_clip(ctx->context); - return 0; -} - -CALLABLE_NOTIMPL(LuaCairoContext, copy_clip_rectangle_list) - -CALLABLE_IMPL(LuaCairoContext, fill) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_fill(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, fill_preserve) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_fill_preserve(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, fill_extents) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x1, y1, x2, y2; - cairo_fill_extents(ctx->context, &x1, &y1, &x2, &y2); - lua_pushnumber(L, x1); - lua_pushnumber(L, y1); - lua_pushnumber(L, x2); - lua_pushnumber(L, y2); - return 4; -} - -CALLABLE_IMPL(LuaCairoContext, in_fill) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - lua_pushboolean(L, cairo_in_fill(ctx->context, x, y)); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, mask) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoPattern *pat = LuaCairoPattern::GetObjPointer(L, 1); - cairo_mask(ctx->context, pat->GetPattern()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, mask_surface) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoSurface *surf = LuaCairoSurface::GetObjPointer(L, 1); - double surfx = luaL_checknumber(L, 2); - double surfy = luaL_checknumber(L, 3); - cairo_mask_surface(ctx->context, surf->GetSurface(), surfx, surfy); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, paint) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_paint(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, paint_with_alpha) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double a = luaL_checknumber(L, 1); - cairo_paint_with_alpha(ctx->context, a); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, stroke) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_stroke(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, stroke_preserve) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_stroke_preserve(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, stroke_extents) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x1, y1, x2, y2; - cairo_stroke_extents(ctx->context, &x1, &y1, &x2, &y2); - lua_pushnumber(L, x1); - lua_pushnumber(L, y1); - lua_pushnumber(L, x2); - lua_pushnumber(L, y2); - return 4; -} - -CALLABLE_IMPL(LuaCairoContext, in_stroke) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - lua_pushboolean(L, cairo_in_stroke(ctx->context, x, y)); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, copy_page) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_copy_page(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, show_page) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_show_page(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, copy_path) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_path_t *path = cairo_copy_path(ctx->context); - new LuaCairoPath(L, path); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, copy_path_flat) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_path_t *path = cairo_copy_path_flat(ctx->context); - new LuaCairoPath(L, path); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, append_path) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoPath *path = LuaCairoPath::GetObjPointer(L, 1); - cairo_append_path(ctx->context, path->GetPath()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_current_point) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x, y; - cairo_get_current_point(ctx->context, &x, &y); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - return 2; -} - -CALLABLE_IMPL(LuaCairoContext, new_path) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_new_path(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, new_sub_path) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_new_sub_path(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, close_path) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_close_path(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, arc) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double xc = luaL_checknumber(L, 1); - double yc = luaL_checknumber(L, 2); - double radius = luaL_checknumber(L, 3); - double angle1 = luaL_checknumber(L, 4); - double angle2 = luaL_checknumber(L, 5); - cairo_arc(ctx->context, xc, yc, radius, angle1, angle2); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, arc_negative) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double xc = luaL_checknumber(L, 1); - double yc = luaL_checknumber(L, 2); - double radius = luaL_checknumber(L, 3); - double angle1 = luaL_checknumber(L, 4); - double angle2 = luaL_checknumber(L, 5); - cairo_arc_negative(ctx->context, xc, yc, radius, angle1, angle2); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, curve_to) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x1 = luaL_checknumber(L, 1); - double y1 = luaL_checknumber(L, 2); - double x2 = luaL_checknumber(L, 3); - double y2 = luaL_checknumber(L, 4); - double x3 = luaL_checknumber(L, 5); - double y3 = luaL_checknumber(L, 6); - cairo_curve_to(ctx->context, x1, y1, x2, y2, x3, y3); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, line_to) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_line_to(ctx->context, x, y); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, move_to) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_move_to(ctx->context, x, y); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, rectangle) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x1 = luaL_checknumber(L, 1); - double y1 = luaL_checknumber(L, 2); - double x2 = luaL_checknumber(L, 3); - double y2 = luaL_checknumber(L, 4); - cairo_rectangle(ctx->context, x1, y1, x2, y2); - return 0; -} - -CALLABLE_NOTIMPL(LuaCairoContext, glyph_path) - -CALLABLE_IMPL(LuaCairoContext, text_path) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - const char *utf8 = luaL_checkstring(L, 1); - cairo_text_path(ctx->context, utf8); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, rel_curve_to) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x1 = luaL_checknumber(L, 1); - double y1 = luaL_checknumber(L, 2); - double x2 = luaL_checknumber(L, 3); - double y2 = luaL_checknumber(L, 4); - double x3 = luaL_checknumber(L, 5); - double y3 = luaL_checknumber(L, 6); - cairo_rel_curve_to(ctx->context, x1, y1, x2, y2, x3, y3); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, rel_line_to) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_rel_line_to(ctx->context, x, y); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, rel_move_to) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_rel_move_to(ctx->context, x, y); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, translate) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double tx = luaL_checknumber(L, 1); - double ty = luaL_checknumber(L, 2); - cairo_translate(ctx->context, tx, ty); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, scale) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double sx = luaL_checknumber(L, 1); - double sy = luaL_checknumber(L, 2); - cairo_scale(ctx->context, sx, sy); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, rotate) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double rads = luaL_checknumber(L, 1); - cairo_rotate(ctx->context, rads); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, transform) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = LuaCairoMatrix::GetObjPointer(L, 1); - cairo_transform(ctx->context, mat->GetMatrix()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, set_matrix) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = LuaCairoMatrix::GetObjPointer(L, 1); - cairo_set_matrix(ctx->context, mat->GetMatrix()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_matrix) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_matrix_t mat; - cairo_get_matrix(ctx->context, &mat); - new LuaCairoMatrix(L, &mat); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, identity_matrix) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_identity_matrix(ctx->context); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, user_to_device) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_user_to_device(ctx->context, &x, &y); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - return 2; -} - -CALLABLE_IMPL(LuaCairoContext, user_to_device_distance) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_user_to_device_distance(ctx->context, &x, &y); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - return 2; -} - -CALLABLE_IMPL(LuaCairoContext, device_to_user) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_device_to_user(ctx->context,& x, &y); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - return 2; -} - -CALLABLE_IMPL(LuaCairoContext, device_to_user_distance) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_device_to_user_distance(ctx->context, &x, &y); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - return 2; - -} - -CALLABLE_IMPL(LuaCairoContext, select_font_face) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - const char *family = luaL_checkstring(L, 1); - cairo_font_slant_t slant = (cairo_font_slant_t)luaL_checkoption(L, 2, "", font_slant_list); - cairo_font_weight_t weight = (cairo_font_weight_t)luaL_checkoption(L, 3, "", font_weight_list); - cairo_select_font_face(ctx->context, family, slant, weight); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, set_font_size) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - double sz = luaL_checknumber(L, 1); - cairo_set_font_size(ctx->context, sz); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, set_font_matrix) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = LuaCairoMatrix::GetObjPointer(L, 1); - cairo_set_font_matrix(ctx->context, mat->GetMatrix()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_font_matrix) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = new LuaCairoMatrix(L); - cairo_get_font_matrix(ctx->context, mat->GetMatrix()); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_font_options) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontOptions *fo = LuaCairoFontOptions::GetObjPointer(L, 1); - cairo_set_font_options(ctx->context, fo->GetFontOptions()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_font_options) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontOptions *fo = new LuaCairoFontOptions(L); - cairo_get_font_options(ctx->context, fo->GetFontOptions()); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_font_face) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontFace *face = LuaCairoFontFace::GetObjPointer(L, 1); - cairo_set_font_face(ctx->context, face->GetFontFace()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_font_face) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_font_face_t *face = cairo_get_font_face(ctx->context); - new LuaCairoFontFace(L, face); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, set_scaled_font) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoScaledFont *sf = LuaCairoScaledFont::GetObjPointer(L, 1); - cairo_set_scaled_font(ctx->context, sf->GetScaledFont()); - return 0; -} - -CALLABLE_IMPL(LuaCairoContext, get_scaled_font) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_scaled_font_t *sf = cairo_get_scaled_font(ctx->context); - new LuaCairoScaledFont(L, sf); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, show_text) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - const char *utf8 = luaL_checkstring(L, 1); - cairo_show_text(ctx->context, utf8); - return 0; -} - -CALLABLE_NOTIMPL(LuaCairoContext, show_glyphs) - -CALLABLE_IMPL(LuaCairoContext, font_extents) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - cairo_font_extents_t extents; - cairo_font_extents(ctx->context, &extents); - font_extents_to_lua(L, extents); - return 1; -} - -CALLABLE_IMPL(LuaCairoContext, text_extents) -{ - LuaCairoContext *ctx = GetObjPointer(L, lua_upvalueindex(1)); - const char *utf8 = luaL_checkstring(L, 1); - cairo_text_extents_t extents; - cairo_text_extents(ctx->context, utf8, &extents); - text_extents_to_lua(L, extents); - return 1; -} - -CALLABLE_NOTIMPL(LuaCairoContext, glyph_extents) - -const char *LuaCairoContext::GetTypeName() -{ - return "context"; -} - -LuaCairoContext::LuaCairoContext(lua_State *L, cairo_t *_context) : - LuaCairoBase(L) -{ - CALLABLE_REG(reference); - CALLABLE_REG(status); - CALLABLE_REG(save); - CALLABLE_REG(restore); - CALLABLE_REG(get_target); - CALLABLE_REG(push_group); - CALLABLE_REG(push_group_with_content); - CALLABLE_REG(pop_group); - CALLABLE_REG(pop_group_to_source); - CALLABLE_REG(get_group_target); - CALLABLE_REG(set_source_rgb); - CALLABLE_REG(set_source_rgba); - CALLABLE_REG(set_source); - CALLABLE_REG(set_source_surface); - CALLABLE_REG(get_source); - CALLABLE_REG(set_antialias); - CALLABLE_REG(get_antialias); - CALLABLE_REG(set_dash); - CALLABLE_REG(get_dash_count); - CALLABLE_REG(get_dash); - CALLABLE_REG(set_fill_rule); - CALLABLE_REG(get_fill_rule); - CALLABLE_REG(set_line_cap); - CALLABLE_REG(get_line_cap); - CALLABLE_REG(set_line_join); - CALLABLE_REG(get_line_join); - CALLABLE_REG(set_line_width); - CALLABLE_REG(get_line_width); - CALLABLE_REG(set_miter_limit); - CALLABLE_REG(get_miter_limit); - CALLABLE_REG(set_operator); - CALLABLE_REG(get_operator); - CALLABLE_REG(set_tolerance); - CALLABLE_REG(get_tolerance); - CALLABLE_REG(clip); - CALLABLE_REG(clip_preserve); - CALLABLE_REG(clip_extents); - CALLABLE_REG(reset_clip); - CALLABLE_REG(copy_clip_rectangle_list); - CALLABLE_REG(fill); - CALLABLE_REG(fill_preserve); - CALLABLE_REG(fill_extents); - CALLABLE_REG(in_fill); - CALLABLE_REG(mask); - CALLABLE_REG(mask_surface); - CALLABLE_REG(paint); - CALLABLE_REG(paint_with_alpha); - CALLABLE_REG(stroke); - CALLABLE_REG(stroke_preserve); - CALLABLE_REG(stroke_extents); - CALLABLE_REG(in_stroke); - CALLABLE_REG(copy_page); - CALLABLE_REG(show_page); - CALLABLE_REG(copy_path); - CALLABLE_REG(copy_path_flat); - CALLABLE_REG(append_path); - CALLABLE_REG(get_current_point); - CALLABLE_REG(new_path); - CALLABLE_REG(new_sub_path); - CALLABLE_REG(close_path); - CALLABLE_REG(arc); - CALLABLE_REG(arc_negative); - CALLABLE_REG(curve_to); - CALLABLE_REG(line_to); - CALLABLE_REG(move_to); - CALLABLE_REG(rectangle); - CALLABLE_REG(glyph_path); - CALLABLE_REG(text_path); - CALLABLE_REG(rel_curve_to); - CALLABLE_REG(rel_line_to); - CALLABLE_REG(rel_move_to); - CALLABLE_REG(translate); - CALLABLE_REG(scale); - CALLABLE_REG(rotate); - CALLABLE_REG(transform); - CALLABLE_REG(set_matrix); - CALLABLE_REG(get_matrix); - CALLABLE_REG(identity_matrix); - CALLABLE_REG(user_to_device); - CALLABLE_REG(user_to_device_distance); - CALLABLE_REG(device_to_user); - CALLABLE_REG(device_to_user_distance); - CALLABLE_REG(select_font_face); - CALLABLE_REG(set_font_size); - CALLABLE_REG(set_font_matrix); - CALLABLE_REG(get_font_matrix); - CALLABLE_REG(set_font_options); - CALLABLE_REG(get_font_options); - CALLABLE_REG(set_font_face); - CALLABLE_REG(get_font_face); - CALLABLE_REG(set_scaled_font); - CALLABLE_REG(get_scaled_font); - CALLABLE_REG(show_text); - CALLABLE_REG(show_glyphs); - CALLABLE_REG(font_extents); - CALLABLE_REG(text_extents); - CALLABLE_REG(glyph_extents); - - cairo_reference(_context); - context = _context; -} - -LuaCairoContext::~LuaCairoContext() -{ - cairo_destroy(context); -} - - -// Surface (cairo_surface_t) - -CALLABLE_IMPL(LuaCairoSurface, create_similar) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_content_t ct = (cairo_content_t)luaL_checkoption(L, 1, NULL, content_types_list); - int width = luaL_checkint(L, 2); - int height = luaL_checkint(L, 3); - cairo_surface_t *nsurf = cairo_surface_create_similar(surf->surface, ct, width, height); - new LuaCairoSurface(L, nsurf); - cairo_surface_destroy(nsurf); - return 1; -} - -CALLABLE_NOTIMPL(LuaCairoSurface, reference) - -CALLABLE_IMPL(LuaCairoSurface, status) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t st = cairo_surface_status(surf->surface); - lua_pushstring(L, status_names_list[st]); - return 1; -} - -CALLABLE_IMPL(LuaCairoSurface, create_context) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - - cairo_t *context = cairo_create(surf->surface); - - if (!context || cairo_status(context) != CAIRO_STATUS_SUCCESS) { - lua_pushliteral(L, "Failed creating cairo context"); - lua_error(L); - return 0; - } - - LuaCairoContext *ctxojb = new LuaCairoContext(L, context); - cairo_destroy(context); - return 1; -} - -CALLABLE_IMPL(LuaCairoSurface, finish) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_surface_finish(surf->surface); - return 0; -} - -CALLABLE_IMPL(LuaCairoSurface, flush) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_surface_flush(surf->surface); - return 0; -} - -CALLABLE_IMPL(LuaCairoSurface, get_font_options) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontOptions *fo = new LuaCairoFontOptions(L); - cairo_surface_get_font_options(surf->surface, fo->GetFontOptions()); - return 1; -} - -CALLABLE_IMPL(LuaCairoSurface, get_content) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_content_t ct = cairo_surface_get_content(surf->surface); - lua_pushstring(L, content_types_list[ct]); - return 1; -} - -CALLABLE_IMPL(LuaCairoSurface, mark_dirty) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_surface_mark_dirty(surf->surface); - return 0; -} - -CALLABLE_IMPL(LuaCairoSurface, mark_dirty_rectangle) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - int x = luaL_checkint(L, 1); - int y = luaL_checkint(L, 2); - int width = luaL_checkint(L, 3); - int height = luaL_checkint(L, 4); - cairo_surface_mark_dirty_rectangle(surf->surface, x, y, width, height); - return 0; -} - -CALLABLE_IMPL(LuaCairoSurface, set_device_offset) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - double xofs = luaL_checknumber(L, 1); - double yofs = luaL_checknumber(L, 2); - cairo_surface_set_device_offset(surf->surface, xofs, yofs); - return 0; -} - -CALLABLE_IMPL(LuaCairoSurface, get_device_offset) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - double xofs, yofs; - cairo_surface_get_device_offset(surf->surface, &xofs, &yofs); - lua_pushnumber(L, xofs); - lua_pushnumber(L, yofs); - return 2; -} - -CALLABLE_IMPL(LuaCairoSurface, set_fallback_resolution) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - double xppi = luaL_checknumber(L, 1); - double yppi = luaL_checknumber(L, 2); - cairo_surface_set_device_offset(surf->surface, xppi, yppi); - return 0; -} - -CALLABLE_NOTIMPL(LuaCairoSurface, get_type) - -CALLABLE_IMPL(LuaCairoSurface, image_get_format) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - if (cairo_surface_get_type(surf->GetSurface()) != CAIRO_SURFACE_TYPE_IMAGE) { - lua_pushliteral(L, "Surface is not an image surface"); - lua_error(L); - return 0; - } - - switch (cairo_image_surface_get_format(surf->GetSurface())) { - case CAIRO_FORMAT_ARGB32: - lua_pushliteral(L, "argb32"); - return 1; - case CAIRO_FORMAT_RGB24: - lua_pushliteral(L, "rgb24"); - return 1; - case CAIRO_FORMAT_A8: - lua_pushliteral(L, "a8"); - return 1; - case CAIRO_FORMAT_A1: - lua_pushliteral(L, "a1"); - return 1; - default: - lua_pushnil(L); - return 1; - } -} - -CALLABLE_IMPL(LuaCairoSurface, image_get_width) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - if (cairo_surface_get_type(surf->GetSurface()) != CAIRO_SURFACE_TYPE_IMAGE) { - lua_pushliteral(L, "Surface is not an image surface"); - lua_error(L); - return 0; - } - - lua_pushinteger(L, cairo_image_surface_get_width(surf->GetSurface())); - return 1; -} - -CALLABLE_IMPL(LuaCairoSurface, image_get_height) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - if (cairo_surface_get_type(surf->GetSurface()) != CAIRO_SURFACE_TYPE_IMAGE) { - lua_pushliteral(L, "Surface is not an image surface"); - lua_error(L); - return 0; - } - - lua_pushinteger(L, cairo_image_surface_get_height(surf->GetSurface())); - return 1; -} - -CALLABLE_NOTIMPL(LuaCairoSurface, image_set_pixel) - -CALLABLE_IMPL(LuaCairoSurface, image_get_pixel) -{ - LuaCairoSurface *surf = GetObjPointer(L, lua_upvalueindex(1)); - int x = luaL_checkint(L, 1); - int y = luaL_checkint(L, 2); - if (cairo_surface_get_type(surf->surface) != CAIRO_SURFACE_TYPE_IMAGE) { - lua_pushliteral(L, "Surface is not an image surface"); - lua_error(L); - return 0; - } - - // Assume the surface is already flush()ed - int width = cairo_image_surface_get_width(surf->surface); - int height = cairo_image_surface_get_height(surf->surface); - int stride = cairo_image_surface_get_stride(surf->surface); - cairo_format_t format = cairo_image_surface_get_format(surf->surface); - unsigned char *data = cairo_image_surface_get_data(surf->surface); - - switch (format) { - case CAIRO_FORMAT_ARGB32: { - uint32_t pixel = *(uint32_t*)(data + y*stride + x * 4); - lua_pushinteger(L, (pixel & 0xff000000)>>24); // alpha - lua_pushinteger(L, (pixel & 0x00ff0000)>>16); // red - lua_pushinteger(L, (pixel & 0x0000ff00)>>8); // green - lua_pushinteger(L, pixel & 0x000000ff); // blue - return 4; } - - case CAIRO_FORMAT_RGB24: { - uint32_t pixel = *(uint32_t*)(data + y*stride + x * 4); - lua_pushinteger(L, (pixel & 0x00ff0000)>>16); // red - lua_pushinteger(L, (pixel & 0x0000ff00)>>8); // green - lua_pushinteger(L, pixel & 0x000000ff); // blue - return 3; } - - case CAIRO_FORMAT_A8: - lua_pushinteger(L, data[y*stride+x]); - return 1; - - default: - lua_pushliteral(L, "Unhandled pixel format in image surface get pixel"); - lua_error(L); - return 0; - } -} - -CALLABLE_IMPL(LuaCairoSurface, image_surface_create) -{ - // Swap arguments a bit and make a default value for the format - int width = luaL_checkint(L, 1); - int height = luaL_checkint(L, 2); - cairo_format_t format = (cairo_format_t)luaL_checkoption(L, 3, "argb32", image_formats_list); - - // Create surface from parameters - cairo_surface_t *surf = cairo_image_surface_create(format, width, height); - - // Check that the surface was successfully created - if (!surf || cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS) - return 0; - - // Create wrapping Lua object - LuaCairoSurface *surfobj = new LuaCairoSurface(L, surf); - // Lua object takes its own reference to surface, so release ours - cairo_surface_destroy(surf); - // Return surface object - return 1; -} - -const char *LuaCairoSurface::GetTypeName() -{ - return "surface"; -} - -LuaCairoSurface::LuaCairoSurface(lua_State *L, cairo_surface_t *_surface) : - LuaCairoBase(L) -{ - cairo_surface_reference(_surface); - surface = _surface; - - cairo_surface_type_t st = cairo_surface_get_type(surface); - - CALLABLE_REG(create_similar); - CALLABLE_REG(reference); - CALLABLE_REG(status); - CALLABLE_REG(create_context); - CALLABLE_REG(finish); - CALLABLE_REG(flush); - CALLABLE_REG(get_font_options); - CALLABLE_REG(get_content); - CALLABLE_REG(mark_dirty); - CALLABLE_REG(mark_dirty_rectangle); - CALLABLE_REG(set_device_offset); - CALLABLE_REG(get_device_offset); - CALLABLE_REG(set_fallback_resolution); - CALLABLE_REG(get_type); - - if (st == CAIRO_SURFACE_TYPE_IMAGE) { - CALLABLE_REG2(image_get_format, get_format); - CALLABLE_REG2(image_get_width, get_width); - CALLABLE_REG2(image_get_height, get_height); - CALLABLE_REG2(image_set_pixel, set_pixel); - CALLABLE_REG2(image_get_pixel, get_pixel); - } -} - -LuaCairoSurface::~LuaCairoSurface() -{ - cairo_surface_destroy(surface); -} - - -// Font face (cairo_font_face_t) - -CALLABLE_NOTIMPL(LuaCairoFontFace, create_scaled_font) -CALLABLE_NOTIMPL(LuaCairoFontFace, reference) - -CALLABLE_IMPL(LuaCairoFontFace, status) -{ - LuaCairoFontFace *face = GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t st = cairo_font_face_status(face->font_face); - lua_pushstring(L, status_names_list[st]); - return 1; -} - -CALLABLE_NOTIMPL(LuaCairoFontFace, get_type) - -const char *LuaCairoFontFace::GetTypeName() -{ - return "font_face"; -} - -LuaCairoFontFace::LuaCairoFontFace(lua_State *L, cairo_font_face_t *_font_face) : - LuaCairoBase(L) -{ - CALLABLE_REG(create_scaled_font); - CALLABLE_REG(reference); - CALLABLE_REG(status); - CALLABLE_REG(get_type); - - cairo_font_face_reference(_font_face); - font_face = _font_face; -} - -LuaCairoFontFace::~LuaCairoFontFace() -{ - cairo_font_face_destroy(font_face); -} - - -// Scaled font (cairo_scaled_font_t) - -CALLABLE_NOTIMPL(LuaCairoScaledFont, reference) - -CALLABLE_IMPL(LuaCairoScaledFont, status) -{ - LuaCairoScaledFont*sf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t st = cairo_scaled_font_status(sf->scaled_font); - lua_pushstring(L, status_names_list[st]); - return 1; -} - -CALLABLE_IMPL(LuaCairoScaledFont, extents) -{ - LuaCairoScaledFont *scf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_font_extents_t extents; - cairo_scaled_font_extents(scf->scaled_font, &extents); - font_extents_to_lua(L, extents); - return 1; -} - -CALLABLE_IMPL(LuaCairoScaledFont, text_extents) -{ - LuaCairoScaledFont *scf = GetObjPointer(L, lua_upvalueindex(1)); - const char *utf8 = luaL_checkstring(L, 1); - cairo_text_extents_t extents; - cairo_scaled_font_text_extents(scf->scaled_font, utf8, &extents); - text_extents_to_lua(L, extents); - return 1; -} - -CALLABLE_NOTIMPL(LuaCairoScaledFont, glyph_extents) - -CALLABLE_IMPL(LuaCairoScaledFont, get_font_face) -{ - LuaCairoScaledFont *scf = GetObjPointer(L, lua_upvalueindex(1)); - cairo_font_face_t *face = cairo_scaled_font_get_font_face(scf->scaled_font); - new LuaCairoFontFace(L, face); - return 1; -} - -CALLABLE_IMPL(LuaCairoScaledFont, get_font_options) -{ - LuaCairoScaledFont *scf = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontOptions *opt = new LuaCairoFontOptions(L); - cairo_scaled_font_get_font_options(scf->scaled_font, opt->GetFontOptions()); - return 1; -} - -CALLABLE_IMPL(LuaCairoScaledFont, get_font_matrix) -{ - LuaCairoScaledFont *scf = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = new LuaCairoMatrix(L); - cairo_scaled_font_get_font_matrix(scf->scaled_font, mat->GetMatrix()); - return 1; -} - -CALLABLE_IMPL(LuaCairoScaledFont, get_ctm) -{ - LuaCairoScaledFont *scf = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = new LuaCairoMatrix(L); - cairo_scaled_font_get_ctm(scf->scaled_font, mat->GetMatrix()); - return 1; -} - -CALLABLE_NOTIMPL(LuaCairoScaledFont, get_type) - -const char *LuaCairoScaledFont::GetTypeName() -{ - return "scaled_font"; -} - -LuaCairoScaledFont::LuaCairoScaledFont(lua_State *L, cairo_scaled_font_t *_scaled_font) : - LuaCairoBase(L) -{ - CALLABLE_REG(reference); - CALLABLE_REG(status); - CALLABLE_REG(extents); - CALLABLE_REG(text_extents); - CALLABLE_REG(glyph_extents); - CALLABLE_REG(get_font_face); - CALLABLE_REG(get_font_options); - CALLABLE_REG(get_font_matrix); - CALLABLE_REG(get_ctm); - CALLABLE_REG(get_type); - - cairo_scaled_font_reference(_scaled_font); - scaled_font = _scaled_font; -} - -LuaCairoScaledFont::~LuaCairoScaledFont() -{ - cairo_scaled_font_destroy(scaled_font); -} - - -// Font options (cairo_font_options_t) - -CALLABLE_IMPL(LuaCairoFontOptions, copy) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_font_options_t *nfo = cairo_font_options_copy(fo->font_options); - new LuaCairoFontOptions(L, nfo); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, status) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t st = cairo_font_options_status(fo->font_options); - lua_pushstring(L, status_names_list[st]); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, merge) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontOptions *other = GetObjPointer(L, 1); - cairo_font_options_merge(fo->font_options, other->font_options); - return 0; -} - -CALLABLE_IMPL(LuaCairoFontOptions, hash) -{ - char hash[sizeof(unsigned long)*2+1]; // hex + null - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - unsigned long lhash = cairo_font_options_hash(fo->font_options); - sprintf(hash, "%0*x", sizeof(unsigned long)*2, lhash); - lua_pushstring(L, hash); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, equal) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoFontOptions *other = GetObjPointer(L, 1); - cairo_bool_t eq = cairo_font_options_equal(fo->font_options, other->font_options); - lua_pushboolean(L, eq); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, set_antialias) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_antialias_t aa = (cairo_antialias_t)luaL_checkoption(L, 1, NULL, antialias_types_list); - cairo_font_options_set_antialias(fo->font_options, aa); - return 0; -} - -CALLABLE_IMPL(LuaCairoFontOptions, get_antialias) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_antialias_t aa = cairo_font_options_get_antialias(fo->font_options); - lua_pushstring(L, antialias_types_list[aa]); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, set_subpixel_order) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_subpixel_order_t spo = (cairo_subpixel_order_t)luaL_checkoption(L, 1, NULL, subpixel_order_list); - cairo_font_options_set_subpixel_order(fo->font_options, spo); - return 0; -} - -CALLABLE_IMPL(LuaCairoFontOptions, get_subpixel_order) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_subpixel_order_t spo = cairo_font_options_get_subpixel_order(fo->font_options); - lua_pushstring(L, subpixel_order_list[spo]); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, set_hint_style) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_hint_style_t hs = (cairo_hint_style_t)luaL_checkoption(L, 1, NULL, hint_style_list); - cairo_font_options_set_hint_style(fo->font_options, hs); - return 0; -} - -CALLABLE_IMPL(LuaCairoFontOptions, get_hint_style) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_hint_style_t hs = cairo_font_options_get_hint_style(fo->font_options); - lua_pushstring(L, hint_style_list[hs]); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, set_hint_metrics) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_hint_metrics_t hm = (cairo_hint_metrics_t)luaL_checkoption(L, 1, NULL, hint_metrics_list); - cairo_font_options_set_hint_metrics(fo->font_options, hm); - return 0; -} - -CALLABLE_IMPL(LuaCairoFontOptions, get_hint_metrics) -{ - LuaCairoFontOptions *fo = GetObjPointer(L, lua_upvalueindex(1)); - cairo_hint_metrics_t hm = cairo_font_options_get_hint_metrics(fo->font_options); - lua_pushstring(L, hint_metrics_list[hm]); - return 1; -} - -CALLABLE_IMPL(LuaCairoFontOptions, create) -{ - new LuaCairoFontOptions(L); - return 1; -} - -void LuaCairoFontOptions::RegFontOptionsCallables() -{ - CALLABLE_REG(copy); - CALLABLE_REG(status); - CALLABLE_REG(merge); - CALLABLE_REG(hash); - CALLABLE_REG(equal); - CALLABLE_REG(set_antialias); - CALLABLE_REG(get_antialias); - CALLABLE_REG(set_subpixel_order); - CALLABLE_REG(get_subpixel_order); - CALLABLE_REG(set_hint_style); - CALLABLE_REG(get_hint_style); - CALLABLE_REG(set_hint_metrics); - CALLABLE_REG(get_hint_metrics); -} - -const char *LuaCairoFontOptions::GetTypeName() -{ - return "font_options"; -} - -LuaCairoFontOptions::LuaCairoFontOptions(lua_State *L) : - LuaCairoBase(L) -{ - RegFontOptionsCallables(); - - owned = true; - font_options = cairo_font_options_create(); -} - -LuaCairoFontOptions::LuaCairoFontOptions(lua_State *L, cairo_font_options_t *_font_options) : - LuaCairoBase(L) -{ - RegFontOptionsCallables(); - - owned = false; - font_options = _font_options; -} - -LuaCairoFontOptions::~LuaCairoFontOptions() -{ - if (owned) - cairo_font_options_destroy(font_options); -} - - -// Matrix (cairo_matrix_t) - -CALLABLE_IMPL(LuaCairoMatrix, init) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double xx = luaL_checknumber(L, 1); - double yx = luaL_checknumber(L, 2); - double xy = luaL_checknumber(L, 3); - double yy = luaL_checknumber(L, 4); - double x0 = luaL_checknumber(L, 5); - double y0 = luaL_checknumber(L, 6); - cairo_matrix_init(&mat->matrix, xx, yx, xy, yy, x0, y0); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, init_identity) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - cairo_matrix_init_identity(&mat->matrix); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, init_translate) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double tx = luaL_checknumber(L, 1); - double ty = luaL_checknumber(L, 2); - cairo_matrix_init_translate(&mat->matrix, tx, ty); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, init_scale) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double sx = luaL_checknumber(L, 1); - double sy = luaL_checknumber(L, 2); - cairo_matrix_init_scale(&mat->matrix, sx, sy); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, init_rotate) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double rads = luaL_checknumber(L, 1); - cairo_matrix_init_rotate(&mat->matrix, rads); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, translate) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double tx = luaL_checknumber(L, 1); - double ty = luaL_checknumber(L, 2); - cairo_matrix_translate(&mat->matrix, tx, ty); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, scale) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double sx = luaL_checknumber(L, 1); - double sy = luaL_checknumber(L, 2); - cairo_matrix_scale(&mat->matrix, sx, sy); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, rotate) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double rads = luaL_checknumber(L, 1); - cairo_matrix_rotate(&mat->matrix, rads); - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, invert) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t res = cairo_matrix_invert(&mat->matrix); - if (res == CAIRO_STATUS_SUCCESS) - lua_pushboolean(L, 1); - else - lua_pushboolean(L, 0); - return 1; -} - -CALLABLE_IMPL(LuaCairoMatrix, multiply) -{ - LuaCairoMatrix *mat1 = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat2 = (LuaCairoMatrix*)GetObjPointer(L, 1); - cairo_matrix_t res; - cairo_matrix_multiply(&res, &mat1->matrix, &mat2->matrix); - new LuaCairoMatrix(L, &res); - return 1; -} - -CALLABLE_IMPL(LuaCairoMatrix, transform_distance) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double dx = luaL_checknumber(L, 1); - double dy = luaL_checknumber(L, 2); - cairo_matrix_transform_distance(&mat->matrix, &dx, &dy); - lua_pushnumber(L, dx); - lua_pushnumber(L, dy); - return 2; -} - -CALLABLE_IMPL(LuaCairoMatrix, transform_point) -{ - LuaCairoMatrix *mat = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - double x = luaL_checknumber(L, 1); - double y = luaL_checknumber(L, 2); - cairo_matrix_transform_distance(&mat->matrix, &x, &y); - lua_pushnumber(L, x); - lua_pushnumber(L, y); - return 2; -} - -CALLABLE_IMPL(LuaCairoMatrix, op_add) -{ - if (lua_isuserdata(L, 1) && lua_isuserdata(L, 2)) { - // matrix + matrix (pointwise) - LuaCairoMatrix *mat1 = (LuaCairoMatrix*)GetObjPointer(L, 1); - LuaCairoMatrix *mat2 = (LuaCairoMatrix*)GetObjPointer(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &a = mat1->matrix, &b = mat2->matrix, &res = matR->matrix; - res.xx = a.xx + b.xx; res.yx = a.yx + b.yx; - res.xy = a.xy + b.xy; res.yy = a.yy + b.yy; - res.x0 = a.x0 + b.x0; res.y0 = a.y0 + b.y0; - return 1; - - } else if (lua_isuserdata(L, 1) && lua_isnumber(L, 2)) { - // matrix + number - LuaCairoMatrix *matI = (LuaCairoMatrix*)GetObjPointer(L, 1); - double num = luaL_checknumber(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &I = matI->matrix, &R = matR->matrix; - R.xx = num + I.xx; R.yx = num + I.yx; - R.xy = num + I.xy; R.yy = num + I.yy; - R.x0 = num + I.x0; R.y0 = num + I.y0; - return 1; - - } else { - lua_pushliteral(L, "Unsupported addition operation on matrix"); - lua_error(L); - return 0; - } -} - -CALLABLE_IMPL(LuaCairoMatrix, op_sub) -{ - if (lua_isuserdata(L, 1) && lua_isuserdata(L, 2)) { - // matrix - matrix (pointwise) - LuaCairoMatrix *mat1 = (LuaCairoMatrix*)GetObjPointer(L, 1); - LuaCairoMatrix *mat2 = (LuaCairoMatrix*)GetObjPointer(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &a = mat1->matrix, &b = mat2->matrix, &res = matR->matrix; - res.xx = a.xx - b.xx; res.yx = a.yx - b.yx; - res.xy = a.xy - b.xy; res.yy = a.yy - b.yy; - res.x0 = a.x0 - b.x0; res.y0 = a.y0 - b.y0; - return 1; - - } else if (lua_isuserdata(L, 1) && lua_isnumber(L, 2)) { - // matrix - number - LuaCairoMatrix *matI = (LuaCairoMatrix*)GetObjPointer(L, 1); - double num = luaL_checknumber(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &I = matI->matrix, &R = matR->matrix; - R.xx = I.xx - num; R.yx = I.yx - num; - R.xy = I.xy - num; R.yy = I.yy - num; - R.x0 = I.x0 - num; R.y0 = I.y0 - num; - return 1; - - } else { - lua_pushliteral(L, "Unsupported subtraction operation on matrix"); - lua_error(L); - return 0; - } -} - -CALLABLE_IMPL(LuaCairoMatrix, op_mul) -{ - if (lua_isuserdata(L, 1) && lua_isuserdata(L, 2)) { - // matrix * matrix (matrix multiplication) - LuaCairoMatrix *mat1 = (LuaCairoMatrix*)GetObjPointer(L, 1); - LuaCairoMatrix *mat2 = (LuaCairoMatrix*)GetObjPointer(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_multiply(&matR->matrix, &mat1->matrix, &mat2->matrix); - return 1; - - } else if ((lua_isuserdata(L, 1) && lua_isnumber(L, 2)) || (lua_isnumber(L, 1) && lua_isuserdata(L, 2))) { - // matrix * number or number * matrix - LuaCairoMatrix *matI; - double num; - if (lua_isuserdata(L, 1)) { - matI = (LuaCairoMatrix*)GetObjPointer(L, 1); - num = luaL_checknumber(L, 2); - } else { - num = luaL_checknumber(L, 1); - matI = (LuaCairoMatrix*)GetObjPointer(L, 2); - } - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &I = matI->matrix, &R = matR->matrix; - R.xx = num * I.xx; R.yx = num * I.yx; - R.xy = num * I.xy; R.yy = num * I.yy; - R.x0 = num * I.x0; R.y0 = num * I.y0; - return 1; - - } else { - lua_pushliteral(L, "Unsupported multiplication operation on matrix"); - lua_error(L); - return 0; - } -} - -CALLABLE_IMPL(LuaCairoMatrix, op_div) -{ - if (lua_isuserdata(L, 1) && lua_isnumber(L, 2)) { - // matrix / number = matrix * (1/number) - LuaCairoMatrix *matI = (LuaCairoMatrix*)GetObjPointer(L, 1); - double num = luaL_checknumber(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &I = matI->matrix, &R = matR->matrix; - R.xx = I.xx / num; R.yx = I.yx / num; - R.xy = I.xy / num; R.yy = I.yy / num; - R.x0 = I.x0 / num; R.y0 = I.y0 / num; - return 1; - - } else if (lua_isnumber(L, 1) && lua_isuserdata(L, 2)) { - // number / matrix = number * inv(matrix) - LuaCairoMatrix *matI = (LuaCairoMatrix*)GetObjPointer(L, 1); - double num = luaL_checknumber(L, 2); - LuaCairoMatrix *matR = new LuaCairoMatrix(L, &matI->matrix); - cairo_matrix_t &I = matI->matrix, &R = matR->matrix; - if (!cairo_matrix_invert(&R)) { - // inversion failed, result is nil - lua_pushnil(L); - return 1; - } - R.xx = R.xx * num; R.yx = R.yx * num; - R.xy = R.xy * num; R.yy = R.yy * num; - R.x0 = R.x0 * num; R.y0 = R.y0 * num; - return 1; - - } else { - lua_pushliteral(L, "Unsupported division operation on matrix"); - lua_error(L); - return 0; - } -} - -CALLABLE_IMPL(LuaCairoMatrix, op_unm) -{ - LuaCairoMatrix *matI = (LuaCairoMatrix*)GetObjPointer(L, 1); - LuaCairoMatrix *matR = new LuaCairoMatrix(L); - cairo_matrix_t &I = matI->matrix, &R = matR->matrix; - R.xx = -I.xx; R.yx = -I.yx; - R.xy = -I.xy; R.yy = -I.yy; - R.x0 = -I.x0; R.y0 = -I.y0; - return 0; -} - -CALLABLE_IMPL(LuaCairoMatrix, op_eq) -{ - LuaCairoMatrix *mat1 = (LuaCairoMatrix*)GetObjPointer(L, 1); - LuaCairoMatrix *mat2 = (LuaCairoMatrix*)GetObjPointer(L, 2); - cairo_matrix_t &a = mat1->matrix, &b = mat2->matrix; - bool res = - a.xx==b.xx && a.yx==b.yx && - a.xy==b.xy && a.yy==b.yy && - a.x0==b.x0 && a.y0==b.y0; - lua_pushboolean(L, (int)res); - return 1; -} - -CALLABLE_IMPL(LuaCairoMatrix, copy) -{ - LuaCairoMatrix *org = (LuaCairoMatrix*)GetObjPointer(L, lua_upvalueindex(1)); - new LuaCairoMatrix(L, &org->matrix); - return 1; -} - -CALLABLE_IMPL(LuaCairoMatrix, create) -{ - new LuaCairoMatrix(L); - return 1; -} - -void LuaCairoMatrix::RegMatrixCallables(lua_State *L) -{ - CALLABLE_REG(init); - CALLABLE_REG(init_identity); - CALLABLE_REG(init_translate); - CALLABLE_REG(init_scale); - CALLABLE_REG(init_rotate); - CALLABLE_REG(translate); - CALLABLE_REG(scale); - CALLABLE_REG(rotate); - CALLABLE_REG(invert); - CALLABLE_REG(multiply); - CALLABLE_REG(transform_distance); - CALLABLE_REG(transform_point); - CALLABLE_REG(copy); -} - -int LuaCairoMatrix::internal_lua_index(lua_State *L) -{ - if (lua_type(L, 2) == LUA_TSTRING) { - const char *field = lua_tostring(L, 2); - if (strcmp(field, "xx") == 0) { - lua_pushnumber(L, matrix.xx); - return 1; - } else if (strcmp(field, "yx") == 0) { - lua_pushnumber(L, matrix.yx); - return 1; - } else if (strcmp(field, "xy") == 0) { - lua_pushnumber(L, matrix.xy); - return 1; - } else if (strcmp(field, "yy") == 0) { - lua_pushnumber(L, matrix.yy); - return 1; - } else if (strcmp(field, "x0") == 0) { - lua_pushnumber(L, matrix.x0); - return 1; - } else if (strcmp(field, "y0") == 0) { - lua_pushnumber(L, matrix.y0); - return 1; - } - } - - return LuaCairoBase::internal_lua_index(L); -} - -int LuaCairoMatrix::internal_lua_newindex(lua_State *L) -{ - if (lua_type(L, 2) == LUA_TSTRING) { - const char *field = lua_tostring(L, 2); - if (strcmp(field, "xx") == 0) { - matrix.xx = luaL_checknumber(L, 3); - return 0; - } else if (strcmp(field, "yx") == 0) { - matrix.yx = luaL_checknumber(L, 3); - return 0; - } else if (strcmp(field, "xy") == 0) { - matrix.xy = luaL_checknumber(L, 3); - return 0; - } else if (strcmp(field, "yy") == 0) { - matrix.yy = luaL_checknumber(L, 3); - return 0; - } else if (strcmp(field, "x0") == 0) { - matrix.x0 = luaL_checknumber(L, 3); - return 0; - } else if (strcmp(field, "y0") == 0) { - matrix.y0 = luaL_checknumber(L, 3); - return 0; - } - } - - return LuaCairoBase::internal_lua_newindex(L); -} - -const char *LuaCairoMatrix::GetTypeName() -{ - return "matrix"; -} - -void LuaCairoMatrix::CreateMetaTable(lua_State *L) -{ - LuaCairoBase::CreateMetaTable(L); - - lua_pushcclosure(L, lua_op_add, 0); - lua_setfield(L, -2, "__add"); - lua_pushcclosure(L, lua_op_sub, 0); - lua_setfield(L, -2, "__sub"); - lua_pushcclosure(L, lua_op_mul, 0); - lua_setfield(L, -2, "__mul"); - lua_pushcclosure(L, lua_op_div, 0); - lua_setfield(L, -2, "__div"); - lua_pushcclosure(L, lua_op_unm, 0); - lua_setfield(L, -2, "__unm"); - lua_pushcclosure(L, lua_op_eq, 0); - lua_setfield(L, -2, "__eq"); -} - -LuaCairoMatrix::LuaCairoMatrix(lua_State *L) : - LuaCairoBase(L) -{ - RegMatrixCallables(L); - - cairo_matrix_init_identity(&matrix); -} - -LuaCairoMatrix::LuaCairoMatrix(lua_State *L, const cairo_matrix_t *_matrix) : - LuaCairoBase(L) -{ - RegMatrixCallables(L); - - memcpy(&matrix, _matrix, sizeof(matrix)); -} - -LuaCairoMatrix::~LuaCairoMatrix() -{ - // Automatic memory management here - nothing to free -} - -cairo_matrix_t *LuaCairoMatrix::GetMatrix() -{ - return &matrix; -} - - -// Path (cairo_path_t) - -static void path_element_to_lua(cairo_path_data_t *path, lua_State *L) -{ - lua_newtable(L); - switch (path[0].header.type) { - case CAIRO_PATH_MOVE_TO: - lua_pushliteral(L, "move_to"); - lua_setfield(L, -2, "type"); - lua_pushnumber(L, path[1].point.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, path[1].point.y); - lua_setfield(L, -2, "y"); - break; - - case CAIRO_PATH_LINE_TO: - lua_pushliteral(L, "line_to"); - lua_setfield(L, -2, "type"); - lua_pushnumber(L, path[1].point.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, path[1].point.y); - lua_setfield(L, -2, "y"); - break; - - case CAIRO_PATH_CURVE_TO: - lua_pushliteral(L, "curve_to"); - lua_setfield(L, -2, "type"); - lua_pushnumber(L, path[1].point.x); - lua_setfield(L, -2, "x0"); - lua_pushnumber(L, path[1].point.y); - lua_setfield(L, -2, "y0"); - lua_pushnumber(L, path[2].point.x); - lua_setfield(L, -2, "x1"); - lua_pushnumber(L, path[2].point.y); - lua_setfield(L, -2, "y1"); - lua_pushnumber(L, path[3].point.x); - lua_setfield(L, -2, "x2"); - lua_pushnumber(L, path[3].point.y); - lua_setfield(L, -2, "y2"); - break; - - case CAIRO_PATH_CLOSE_PATH: - lua_pushliteral(L, "close"); - lua_setfield(L, -2, "type"); - break; - - default: - lua_pushliteral(L, "unknown"); - lua_setfield(L, -2, "type"); - break; - } -} - -static void read_lua_path_element(lua_State *L, cairo_path_data_t *path) -{ - lua_getfield(L, -1, "type"); - if (!lua_isstring(L, -1)) { - luaL_error(L, "Invalid or missing 'type' field in path element table"); - return; - } - const char *type = lua_tostring(L, -1); - - if (strcmp(type, "move_to") == 0) { - path[0].header.length = 2; - path[0].header.type = CAIRO_PATH_MOVE_TO; - lua_getfield(L, -2, "x"); - lua_getfield(L, -3, "y"); - if (!lua_isnumber(L, -1) || !lua_isnumber(L, -2)) { - luaL_error(L, "Invalid 'x' or 'y' field in path element table with type 'move_to'"); - return; - } - path[1].point.x = lua_tonumber(L, -2); - path[1].point.y = lua_tonumber(L, -1); - lua_pop(L, 3); - return; - - } else if (strcmp(type, "line_to") == 0) { - path[0].header.length = 2; - path[0].header.type = CAIRO_PATH_LINE_TO; - lua_getfield(L, -2, "x"); - lua_getfield(L, -3, "y"); - if (!lua_isnumber(L, -1) || !lua_isnumber(L, -2)) { - luaL_error(L, "Invalid 'x' or 'y' field in path element table with type 'line_to'"); - return; - } - path[1].point.x = lua_tonumber(L, -2); - path[1].point.y = lua_tonumber(L, -1); - lua_pop(L, 3); - return; - - } else if (strcmp(type, "curve_to") == 0) { - path[0].header.length = 4; - path[0].header.type = CAIRO_PATH_CURVE_TO; - lua_getfield(L, -2, "x0"); - lua_getfield(L, -3, "y0"); - if (!lua_isnumber(L, -1) || !lua_isnumber(L, -2)) { - luaL_error(L, "Invalid 'x0' or 'y0' field in path element table with type 'line_to'"); - return; - } - path[1].point.x = lua_tonumber(L, -2); - path[1].point.y = lua_tonumber(L, -1); - lua_getfield(L, -4, "x1"); - lua_getfield(L, -5, "y1"); - if (!lua_isnumber(L, -1) || !lua_isnumber(L, -2)) { - luaL_error(L, "Invalid 'x1' or 'y1' field in path element table with type 'line_to'"); - return; - } - path[2].point.x = lua_tonumber(L, -2); - path[2].point.y = lua_tonumber(L, -1); - lua_getfield(L, -2, "x2"); - lua_getfield(L, -3, "y2"); - if (!lua_isnumber(L, -1) || !lua_isnumber(L, -2)) { - luaL_error(L, "Invalid 'x2' or 'y2' field in path element table with type 'line_to'"); - return; - } - path[3].point.x = lua_tonumber(L, -2); - path[3].point.y = lua_tonumber(L, -1); - lua_pop(L, 7); - return; - - } else if (strcmp(type, "close") == 0) { - path[0].header.length = 1; - path[0].header.type = CAIRO_PATH_CLOSE_PATH; - lua_pop(L, 1); - return; - - } else { - luaL_error(L, "Invalid 'type' field in path element table, '%s'", type); - } -} - -CALLABLE_NOTIMPL(LuaCairoPath, clear) -CALLABLE_NOTIMPL(LuaCairoPath, move_to) -CALLABLE_NOTIMPL(LuaCairoPath, line_to) -CALLABLE_NOTIMPL(LuaCairoPath, curve_to) -CALLABLE_NOTIMPL(LuaCairoPath, close) - -CALLABLE_IMPL(LuaCairoPath, map) -{ - LuaCairoPath *path = GetObjPointer(L, lua_upvalueindex(1)); - if (!lua_isfunction(L, 1)) { - luaL_error(L, "First argument to path.map_coords must be a function, is %s", luaL_typename(L, 1)); - return 0; - } - - // Function should be p->p - cairo_path_t *p = path->path; - if (!p->num_data || !p->data) return 0; - - // Prepare a new path for building - path->path = (cairo_path_t*)malloc(sizeof(cairo_path_t)); - cairo_path_t *np = path->path; - np->num_data = 0; - np->status = CAIRO_STATUS_SUCCESS; - np->data = 0; - - cairo_path_data_t *pd = p->data; - int outi = 0; - for (int i = 0; i < p->num_data; ) { - lua_pushvalue(L, 1); - path_element_to_lua(pd, L); - lua_call(L, 1, 1); - - path->EnsureSpaceFor(4); // dumb but simple, ensures there's always enough space for even the longest segments - read_lua_path_element(L, np->data+outi); - np->num_data += np->data[outi].header.length; - outi += np->data[outi].header.length; - - i += pd->header.length; - pd += pd->header.length; - } - - if (path->cairo_owns_memory) { - cairo_path_destroy(p); - path->cairo_owns_memory = false; - } else { - free(p->data); - free(p); - } - - // Now just r should be left on top of stack - return 1;} - -CALLABLE_IMPL(LuaCairoPath, map_coords) -{ - LuaCairoPath *path = GetObjPointer(L, lua_upvalueindex(1)); - if (!lua_isfunction(L, 1)) { - luaL_error(L, "First argument to path.map_coords must be a function, is %s", luaL_typename(L, 1)); - return 0; - } - - // Function should be (x,y)->(x,y) - cairo_path_t *p = path->path; - if (!p->num_data || !p->data) return 0; - - int length_to_go = 0; - cairo_path_data_t *pd = p->data; - for (int i = 0; i < p->num_data; i++, pd++) { - if (length_to_go > 0) { - lua_pushvalue(L, 1); - lua_pushnumber(L, pd->point.x); - lua_pushnumber(L, pd->point.y); - lua_call(L, 2, 2); - if (!lua_isnumber(L, -1) || !lua_isnumber(L, -2)) { - luaL_error(L, "The function given to path.map_coords must return two numbers"); - return 0; - } - pd->point.x = lua_tonumber(L, -2); - pd->point.y = lua_tonumber(L, -1); - lua_pop(L, 2); - length_to_go--; - - } else { - length_to_go = pd->header.length-1; - } - } - - return 0; -} - -CALLABLE_IMPL(LuaCairoPath, fold) -{ - LuaCairoPath *path = GetObjPointer(L, lua_upvalueindex(1)); - if (!lua_isfunction(L, 1)) { - luaL_error(L, "First argument to path.map_coords must be a function, is %s", luaL_typename(L, 1)); - return 0; - } - luaL_checkany(L, 2); - - // Function should be (r,p)->r - cairo_path_t *p = path->path; - if (!p->num_data || !p->data) return 0; - - cairo_path_data_t *pd = p->data; - lua_pushvalue(L, 2); // initial 'r' for function - for (int i = 0; i < p->num_data; ) { - lua_pushvalue(L, 1); - lua_pushvalue(L, -2); // dig up 'r' - lua_remove(L, -3); // remove dug up 'r' - path_element_to_lua(pd, L); - lua_call(L, 2, 1); - // leave result 'r' on stack for next iteration or final return - i += pd->header.length; - pd += pd->header.length; - } - - // Now just r should be left on top of stack - return 1; -} - -CALLABLE_IMPL(LuaCairoPath, fold_coords) -{ - LuaCairoPath *path = GetObjPointer(L, lua_upvalueindex(1)); - if (!lua_isfunction(L, 1)) { - luaL_error(L, "First argument to path.map_coords must be a function, is %s", luaL_typename(L, 1)); - return 0; - } - luaL_checkany(L, 2); - - // Function should be (r,x,y)->r - cairo_path_t *p = path->path; - if (!p->num_data || !p->data) return 0; - - int length_to_go = 0; - cairo_path_data_t *pd = p->data; - lua_pushvalue(L, 2); // initial 'r' for function - for (int i = 0; i < p->num_data; i++, pd++) { - if (length_to_go > 0) { - lua_pushvalue(L, 1); - lua_pushvalue(L, -2); // dig up 'r' - lua_remove(L, -3); // remove dug up 'r' - lua_pushnumber(L, pd->point.x); - lua_pushnumber(L, pd->point.y); - lua_call(L, 3, 1); - // leave result 'r' on stack for next iteration or final return - length_to_go--; - - } else { - length_to_go = pd->header.length - 1; - } - } - - // Now just r should be left on top of stack - return 1; -} - -void LuaCairoPath::EnsurePathOwned() -{ - if (cairo_owns_memory) { - cairo_path_t *np = (cairo_path_t*)malloc(sizeof(cairo_path_t)); - np->status = path->status; - np->num_data = path->num_data; - np->data = (cairo_path_data_t*)malloc(path->num_data*sizeof(cairo_path_data_t)); - memcpy(np->data, path->data, np->num_data*sizeof(cairo_path_data_t)); - cairo_path_destroy(path); - path = np; - cairo_owns_memory = false; - } -} - -void LuaCairoPath::EnsureSpaceFor(size_t n) -{ - EnsurePathOwned(); - - if (path_elements_allocated - path->num_data < n) { - path_elements_allocated = path->num_data*2 + n; - path->data = (cairo_path_data_t*)realloc(path->data, path_elements_allocated*sizeof(cairo_path_data_t)); - } -} - -void LuaCairoPath::RegPathCallables(lua_State *L) -{ - CALLABLE_REG(clear); - CALLABLE_REG(move_to); - CALLABLE_REG(line_to); - CALLABLE_REG(curve_to); - CALLABLE_REG(close); - CALLABLE_REG(map); - CALLABLE_REG(map_coords); - CALLABLE_REG(fold); - CALLABLE_REG(fold_coords); -} - -int LuaCairoPath::internal_lua_index(lua_State *L) -{ - return LuaCairoBase::internal_lua_index(L); -} - -const char *LuaCairoPath::GetTypeName() -{ - return "path"; -} - -LuaCairoPath::LuaCairoPath(lua_State *L) : - LuaCairoBase(L) -{ - RegPathCallables(L); - - cairo_owns_memory = false; - path = (cairo_path_t*)malloc(sizeof(cairo_path_t)); - path->status = CAIRO_STATUS_SUCCESS; - path->num_data = 0; - path->data = 0; - EnsureSpaceFor(8); -} - -LuaCairoPath::LuaCairoPath(lua_State *L, cairo_path_t *_path) : - LuaCairoBase(L) -{ - RegPathCallables(L); - - cairo_owns_memory = true; - path = _path; -} - -LuaCairoPath::~LuaCairoPath() -{ - if (cairo_owns_memory) - cairo_path_destroy(path); - else { - free(path->data); - free(path); - } -} - - -// Pattern (cairo_pattern_t) - -CALLABLE_IMPL(LuaCairoPattern, add_color_stop_rgb) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - double offset = luaL_checknumber(L, 1); - double red = luaL_checknumber(L, 2); - double green = luaL_checknumber(L, 3); - double blue = luaL_checknumber(L, 4); - cairo_pattern_add_color_stop_rgb(pat->pattern, offset, red, green, blue); - return 0; -} - -CALLABLE_IMPL(LuaCairoPattern, add_color_stop_rgba) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - double offset = luaL_checknumber(L, 1); - double red = luaL_checknumber(L, 2); - double green = luaL_checknumber(L, 3); - double blue = luaL_checknumber(L, 4); - double alpha = luaL_checknumber(L, 5); - cairo_pattern_add_color_stop_rgba(pat->pattern, offset, red, green, blue, alpha); - return 0; -} - -CALLABLE_IMPL(LuaCairoPattern, get_color_stop_count) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - int count; - cairo_status_t res = cairo_pattern_get_color_stop_count(pat->pattern, &count); - if (res != CAIRO_STATUS_SUCCESS) - return 0; - lua_pushinteger(L, count); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, get_color_stop_rgba) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - int index = luaL_checkint(L, 1); - double offset, red, green, blue, alpha; - cairo_status_t res = cairo_pattern_get_color_stop_rgba(pat->pattern, index, &offset, &red, &green, &blue, &alpha); - if (res != CAIRO_STATUS_SUCCESS) - return 0; - lua_pushnumber(L, offset); - lua_pushnumber(L, red); - lua_pushnumber(L, green); - lua_pushnumber(L, blue); - lua_pushnumber(L, alpha); - return 5; -} - -CALLABLE_IMPL(LuaCairoPattern, get_rgba) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - double red, green, blue, alpha; - cairo_status_t res = cairo_pattern_get_rgba(pat->pattern, &red, &green, &blue, &alpha); - if (res != CAIRO_STATUS_SUCCESS) - return 0; - lua_pushnumber(L, red); - lua_pushnumber(L, green); - lua_pushnumber(L, blue); - lua_pushnumber(L, alpha); - return 4; -} - -CALLABLE_IMPL(LuaCairoPattern, get_surface) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_surface_t *surf; - cairo_status_t res = cairo_pattern_get_surface(pat->pattern, &surf); - if (res != CAIRO_STATUS_SUCCESS) - return 0; - new LuaCairoSurface(L, surf); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, get_linear_points) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - double x0, y0, x1, y1; - cairo_status_t res = cairo_pattern_get_linear_points(pat->pattern, &x0, &y0, &x1, &y1); - if (res != CAIRO_STATUS_SUCCESS) - return 0; - lua_pushnumber(L, x0); - lua_pushnumber(L, y0); - lua_pushnumber(L, x1); - lua_pushnumber(L, y1); - return 4; -} - -CALLABLE_IMPL(LuaCairoPattern, get_radial_circles) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - double x0, y0, r0, x1, y1, r1; - cairo_status_t res = cairo_pattern_get_radial_circles(pat->pattern, &x0, &y0, &r0, &x1, &y1, &r1); - if (res != CAIRO_STATUS_SUCCESS) - return 0; - lua_pushnumber(L, x0); - lua_pushnumber(L, y0); - lua_pushnumber(L, r0); - lua_pushnumber(L, x1); - lua_pushnumber(L, y1); - lua_pushnumber(L, r1); - return 6; -} - -CALLABLE_NOTIMPL(LuaCairoPattern, reference) - -CALLABLE_IMPL(LuaCairoPattern, status) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_status_t st = cairo_pattern_status(pat->pattern); - lua_pushstring(L, status_names_list[st]); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, set_extend) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_extend_t ext = (cairo_extend_t)luaL_checkoption(L, 1, NULL, pattern_extend_list); - cairo_pattern_set_extend(pat->pattern, ext); - return 0; -} - -CALLABLE_IMPL(LuaCairoPattern, get_extend) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_extend_t ext = cairo_pattern_get_extend(pat->pattern); - lua_pushstring(L, pattern_extend_list[ext]); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, set_filter) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_filter_t filt = (cairo_filter_t)luaL_checkoption(L, 1, NULL, pattern_filter_list); - cairo_pattern_set_filter(pat->pattern, filt); - return 0; -} - -CALLABLE_IMPL(LuaCairoPattern, get_filter) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_filter_t filt = cairo_pattern_get_filter(pat->pattern); - lua_pushstring(L, pattern_filter_list[filt]); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, set_matrix) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = LuaCairoMatrix::GetObjPointer(L, 1); - cairo_pattern_set_matrix(pat->pattern, mat->GetMatrix()); - return 0; -} - -CALLABLE_IMPL(LuaCairoPattern, get_matrix) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - LuaCairoMatrix *mat = new LuaCairoMatrix(L); - cairo_pattern_get_matrix(pat->pattern, mat->GetMatrix()); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, get_type) -{ - LuaCairoPattern *pat = GetObjPointer(L, lua_upvalueindex(1)); - cairo_pattern_type_t type = cairo_pattern_get_type(pat->pattern); - lua_pushstring(L, pattern_type_list[type]); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, create_rgb) -{ - double red = luaL_checknumber(L, 1); - double green = luaL_checknumber(L, 2); - double blue = luaL_checknumber(L, 3); - cairo_pattern_t *pat = cairo_pattern_create_rgb(red, green, blue); - new LuaCairoPattern(L, pat); - cairo_pattern_destroy(pat); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, create_rgba) -{ - double red = luaL_checknumber(L, 1); - double green = luaL_checknumber(L, 2); - double blue = luaL_checknumber(L, 3); - double alpha = luaL_checknumber(L, 4); - cairo_pattern_t *pat = cairo_pattern_create_rgba(red, green, blue, alpha); - new LuaCairoPattern(L, pat); - cairo_pattern_destroy(pat); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, create_for_surface) -{ - LuaCairoSurface *surf = LuaCairoSurface::GetObjPointer(L, 1); - cairo_pattern_t *pat = cairo_pattern_create_for_surface(surf->GetSurface()); - new LuaCairoPattern(L, pat); - cairo_pattern_destroy(pat); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, create_linear) -{ - double x0 = luaL_checknumber(L, 1); - double y0 = luaL_checknumber(L, 2); - double x1 = luaL_checknumber(L, 3); - double y1 = luaL_checknumber(L, 4); - cairo_pattern_t *pat = cairo_pattern_create_linear(x0, y0, x1, y1); - new LuaCairoPattern(L, pat); - cairo_pattern_destroy(pat); - return 1; -} - -CALLABLE_IMPL(LuaCairoPattern, create_radial) -{ - double cx0 = luaL_checknumber(L, 1); - double cy0 = luaL_checknumber(L, 2); - double radius0 = luaL_checknumber(L, 3); - double cx1 = luaL_checknumber(L, 4); - double cy1 = luaL_checknumber(L, 5); - double radius1 = luaL_checknumber(L, 6); - cairo_pattern_t *pat = cairo_pattern_create_radial(cx0, cy0, radius0, cx1, cy1, radius1); - new LuaCairoPattern(L, pat); - cairo_pattern_destroy(pat); - return 1; -} - -const char *LuaCairoPattern::GetTypeName() -{ - return "pattern"; -} - -LuaCairoPattern::LuaCairoPattern(lua_State *L, cairo_pattern_t *_pattern) : - LuaCairoBase(L) -{ - CALLABLE_REG(add_color_stop_rgb); - CALLABLE_REG(add_color_stop_rgba); - CALLABLE_REG(get_color_stop_count); - CALLABLE_REG(get_color_stop_rgba); - CALLABLE_REG(get_rgba); - CALLABLE_REG(get_surface); - CALLABLE_REG(get_linear_points); - CALLABLE_REG(get_radial_circles); - CALLABLE_REG(reference); - CALLABLE_REG(status); - CALLABLE_REG(set_extend); - CALLABLE_REG(get_extend); - CALLABLE_REG(set_filter); - CALLABLE_REG(get_filter); - CALLABLE_REG(set_matrix); - CALLABLE_REG(get_matrix); - CALLABLE_REG(get_type); - - cairo_pattern_reference(_pattern); - pattern = _pattern; -} - -LuaCairoPattern::~LuaCairoPattern() -{ - cairo_pattern_destroy(pattern); -} - - -// Lua registration - -static const luaL_Reg cairolib[] = { - {"image_surface_create", LuaCairoSurface::lua_image_surface_create}, - {"font_options_create", LuaCairoFontOptions::lua_create}, - {"matrix_create", LuaCairoMatrix::lua_create}, - {"pattern_create_rgb", LuaCairoPattern::lua_create_rgb}, - {"pattern_create_rgba", LuaCairoPattern::lua_create_rgba}, - {"pattern_create_for_surface", LuaCairoPattern::lua_create_for_surface}, - {"pattern_create_linear", LuaCairoPattern::lua_create_linear}, - {"pattern_create_radial", LuaCairoPattern::lua_create_radial}, - {NULL,NULL} -}; - -int luaopen_cairo(lua_State *L) -{ - luaL_register(L, "cairo", cairolib); - return 0; -} diff --git a/devel/OverLua/cairo_wrap.h b/devel/OverLua/cairo_wrap.h deleted file mode 100644 index bbf6873cb..000000000 --- a/devel/OverLua/cairo_wrap.h +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Lua interface for the cairo graphics library - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#ifndef CAIRO_WRAP_H -#define CAIRO_WRAP_H - -#include "../lua51/src/lua.h" -#include -#include -#include - - -int luaopen_cairo(lua_State *L); - - -template -class LuaCairoBase { -private: - // Default handlers for metatable stuff - static int lua_index(lua_State *L) - { - LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1); - return (*obj)->internal_lua_index(L); - } - - static int lua_newindex(lua_State *L) - { - LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1); - return (*obj)->internal_lua_newindex(L); - } - - static int lua_callobj(lua_State *L) - { - LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1); - return (*obj)->internal_lua_callobj(L); - } - - static int lua_gc(lua_State *L) - { - LuaCairoBase **obj = (LuaCairoBase**)lua_touserdata(L, 1); - delete *obj; - return 0; - } - - // Hidden constructors - LuaCairoBase() { } - LuaCairoBase(const LuaCairoBase &obj) { } - - // List of callables - typedef std::map CallableMap; - CallableMap callables; - - // "Magic" value - used to test that pointers are really valid - lua_CFunction magic; - -protected: - virtual int internal_lua_index(lua_State *L) - { - if (lua_type(L, 2) == LUA_TSTRING) { - const char *field = lua_tostring(L, 2); - - CallableMap::iterator func = callables.find(field); - if (func != callables.end()) { - lua_pushvalue(L, 1); - lua_pushcclosure(L, func->second, 1); - return 1; - } - - if (strcmp("_type", lua_tostring(L, 2))) { - lua_pushstring(L, GetTypeName()); - return 1; - } - } - - return 0; - } - virtual int internal_lua_newindex(lua_State *L) - { - lua_pushfstring(L, "Cairo object of type '%s' can not have field set", GetTypeName()); - lua_error(L); - return 0; - } - virtual int internal_lua_callobj(lua_State *L) - { - lua_pushfstring(L, "Cairo objct of type '%s' can not be called", GetTypeName()); - lua_error(L); - return 0; - } - - virtual const char *GetTypeName() { return "_base"; } - - virtual void CreateMetaTable(lua_State *L) - { - lua_newtable(L); - lua_pushcclosure(L, lua_index, 0); - lua_setfield(L, -2, "__index"); - lua_pushcclosure(L, lua_newindex, 0); - lua_setfield(L, -2, "__newindex"); - lua_pushcclosure(L, lua_callobj, 0); - lua_setfield(L, -2, "__call"); - lua_pushcclosure(L, lua_gc, 0); - lua_setfield(L, -2, "__gc"); - } - - void AddCallable(lua_CFunction func, const char *name) - { - callables[name] = func; - } - - // Primary constructor for use with inherited stuff - LuaCairoBase(lua_State *L) - { - LuaCairoBase **ud = (LuaCairoBase**)lua_newuserdata(L, sizeof(ChildClass*)); - *ud = this; - CreateMetaTable(L); - lua_setmetatable(L, -2); - magic = luaopen_cairo; - } - -public: - virtual ~LuaCairoBase() { } - - // Helper: Get the object pointer from a callback - static ChildClass *GetObjPointer(lua_State *L, int index) - { - if (!lua_isuserdata(L, index)) { - lua_pushliteral(L, "Passed non-userdata where one expected"); - lua_error(L); - } - ChildClass *obj = CheckPointer(*(void**)lua_touserdata(L, index)); - return obj; - } - - // Check whether a pointer plausibly points to an object of this class - static ChildClass *CheckPointer(void *ptr) - { - ChildClass *testptr = (ChildClass*)ptr; - if (testptr->magic == luaopen_cairo) - return testptr; - else - return 0; - } -}; - - -#define CALLABLE(name) static int lua_ ## name (lua_State *L) - - -class LuaCairoContext : public LuaCairoBase { -private: - cairo_t *context; - - CALLABLE(reference); - CALLABLE(status); - - CALLABLE(save); - CALLABLE(restore); - - CALLABLE(get_target); - - CALLABLE(push_group); - CALLABLE(push_group_with_content); - CALLABLE(pop_group); - CALLABLE(pop_group_to_source); - CALLABLE(get_group_target); - - CALLABLE(set_source_rgb); - CALLABLE(set_source_rgba); - CALLABLE(set_source); - CALLABLE(set_source_surface); - CALLABLE(get_source); - - CALLABLE(set_antialias); - CALLABLE(get_antialias); - - CALLABLE(set_dash); - CALLABLE(get_dash_count); - CALLABLE(get_dash); - - CALLABLE(set_fill_rule); - CALLABLE(get_fill_rule); - - CALLABLE(set_line_cap); - CALLABLE(get_line_cap); - - CALLABLE(set_line_join); - CALLABLE(get_line_join); - - CALLABLE(set_line_width); - CALLABLE(get_line_width); - - CALLABLE(set_miter_limit); - CALLABLE(get_miter_limit); - - CALLABLE(set_operator); - CALLABLE(get_operator); - - CALLABLE(set_tolerance); - CALLABLE(get_tolerance); - - CALLABLE(clip); - CALLABLE(clip_preserve); - CALLABLE(clip_extents); - CALLABLE(reset_clip); - - // rectangle_list_destroy is not needed, - // copy_clip_rectangle_list will convert the rect list into a pure Lua structure - CALLABLE(copy_clip_rectangle_list); - - CALLABLE(fill); - CALLABLE(fill_preserve); - CALLABLE(fill_extents); - CALLABLE(in_fill); - - CALLABLE(mask); - CALLABLE(mask_surface); - - CALLABLE(paint); - CALLABLE(paint_with_alpha); - - CALLABLE(stroke); - CALLABLE(stroke_preserve); - CALLABLE(stroke_extents); - CALLABLE(in_stroke); - - CALLABLE(copy_page); - CALLABLE(show_page); - - // Path operations - - CALLABLE(copy_path); - CALLABLE(copy_path_flat); - - CALLABLE(append_path); - - CALLABLE(get_current_point); - - CALLABLE(new_path); - CALLABLE(new_sub_path); - CALLABLE(close_path); - - CALLABLE(arc); - CALLABLE(arc_negative); - CALLABLE(curve_to); - CALLABLE(line_to); - CALLABLE(move_to); - CALLABLE(rectangle); - CALLABLE(glyph_path); - CALLABLE(text_path); - CALLABLE(rel_curve_to); - CALLABLE(rel_line_to); - CALLABLE(rel_move_to); - - // Transformations - - CALLABLE(translate); - CALLABLE(scale); - CALLABLE(rotate); - - CALLABLE(transform); - CALLABLE(set_matrix); - CALLABLE(get_matrix); - CALLABLE(identity_matrix); - - CALLABLE(user_to_device); - CALLABLE(user_to_device_distance); - CALLABLE(device_to_user); - CALLABLE(device_to_user_distance); - - // Text/font operations - - CALLABLE(select_font_face); - - CALLABLE(set_font_size); - CALLABLE(set_font_matrix); - CALLABLE(get_font_matrix); - - CALLABLE(set_font_options); - CALLABLE(get_font_options); - - CALLABLE(set_font_face); - CALLABLE(get_font_face); - - CALLABLE(set_scaled_font); - CALLABLE(get_scaled_font); - - CALLABLE(show_text); - CALLABLE(show_glyphs); - - CALLABLE(font_extents); - CALLABLE(text_extents); - CALLABLE(glyph_extents); - -protected: - const char *GetTypeName(); - -public: - // Create another reference for a context - LuaCairoContext(lua_State *L, cairo_t *_context); - // Destructor - virtual ~LuaCairoContext(); -}; - - -class LuaCairoSurface : public LuaCairoBase { -private: - CALLABLE(create_similar); - CALLABLE(reference); - CALLABLE(status); - - // Create cairo context for this surface - // This deviates from the regular cairo API - CALLABLE(create_context); - - CALLABLE(finish); - CALLABLE(flush); - - CALLABLE(get_font_options); - - CALLABLE(get_content); - - CALLABLE(mark_dirty); - CALLABLE(mark_dirty_rectangle); - - CALLABLE(set_device_offset); - CALLABLE(get_device_offset); - - CALLABLE(set_fallback_resolution); - - CALLABLE(get_type); - - // Image surface functions - - CALLABLE(image_get_format); - CALLABLE(image_get_width); - CALLABLE(image_get_height); - - // These replace the get_data and get_stride functions - CALLABLE(image_set_pixel); - CALLABLE(image_get_pixel); - -protected: - // Protected because inheriting classes might want it too - cairo_surface_t *surface; - - const char *GetTypeName(); - - // For child classes that will set surface themselves - LuaCairoSurface(lua_State *L); - -public: - // Create another reference for a surface - LuaCairoSurface(lua_State *L, cairo_surface_t *_surface); - // Destructor - virtual ~LuaCairoSurface(); - - cairo_surface_t *GetSurface() { return surface; } - - // Creation functions - these aren't in image surface objects but in a global table - CALLABLE(image_surface_create); -}; - - -class LuaCairoFontFace : public LuaCairoBase { -private: - cairo_font_face_t *font_face; - - CALLABLE(create_scaled_font); - - CALLABLE(reference); - CALLABLE(status); - CALLABLE(get_type); - -protected: - const char *GetTypeName(); - -public: - // Create another reference for a font face - LuaCairoFontFace(lua_State *L, cairo_font_face_t *_font_face); - // Destructor - virtual ~LuaCairoFontFace(); - - cairo_font_face_t *GetFontFace() { return font_face; } -}; - - -class LuaCairoScaledFont : public LuaCairoBase { -private: - cairo_scaled_font_t *scaled_font; - - CALLABLE(reference); - CALLABLE(status); - - CALLABLE(extents); - CALLABLE(text_extents); - CALLABLE(glyph_extents); - - CALLABLE(get_font_face); - CALLABLE(get_font_options); - CALLABLE(get_font_matrix); - CALLABLE(get_ctm); - - CALLABLE(get_type); - -protected: - const char *GetTypeName(); - -public: - // Create another reference for a scaled font - LuaCairoScaledFont(lua_State *L, cairo_scaled_font_t *_scaled_font); - // Destructor - virtual ~LuaCairoScaledFont(); - - cairo_scaled_font_t *GetScaledFont() { return scaled_font; } -}; - - -class LuaCairoFontOptions : public LuaCairoBase { -private: - cairo_font_options_t *font_options; - bool owned; - - CALLABLE(copy); - CALLABLE(status); - - CALLABLE(merge); - CALLABLE(hash); - CALLABLE(equal); - - CALLABLE(set_antialias); - CALLABLE(get_antialias); - - CALLABLE(set_subpixel_order); - CALLABLE(get_subpixel_order); - - CALLABLE(set_hint_style); - CALLABLE(get_hint_style); - - CALLABLE(set_hint_metrics); - CALLABLE(get_hint_metrics); - - void RegFontOptionsCallables(); - -protected: - const char *GetTypeName(); - -public: - // Create a new font options object - will be owned - LuaCairoFontOptions(lua_State *L); - // Wrap an existing font options object - will not be owned - LuaCairoFontOptions(lua_State *L, cairo_font_options_t *_font_options); - // Destructor - only destroy font_options if owned - virtual ~LuaCairoFontOptions(); - - cairo_font_options_t *GetFontOptions() { return font_options; } - - // Creation function - global - CALLABLE(create); -}; - - -class LuaCairoMatrix : public LuaCairoBase { -private: - cairo_matrix_t matrix; - - CALLABLE(init); - CALLABLE(init_identity); - CALLABLE(init_translate); - CALLABLE(init_scale); - CALLABLE(init_rotate); - - CALLABLE(translate); - CALLABLE(scale); - CALLABLE(rotate); - - // Matrix inversion - CALLABLE(invert); - // Matrix multiplication - CALLABLE(multiply); - - CALLABLE(transform_distance); - CALLABLE(transform_point); - - // Pointwise arithmetic on matrices - not part of cairo API - CALLABLE(op_add); - CALLABLE(op_sub); - CALLABLE(op_mul); - CALLABLE(op_div); - CALLABLE(op_unm); - // Equality operator - CALLABLE(op_eq); - - // Not in cairo API - CALLABLE(copy); - - void RegMatrixCallables(lua_State *L); - -protected: - virtual int internal_lua_index(lua_State *L); - virtual int internal_lua_newindex(lua_State *L); - const char *GetTypeName(); - - // Extend the meta table with various operators - void CreateMetaTable(lua_State *L); - -public: - // Create new matrix, inited to identity matrix - LuaCairoMatrix(lua_State *L); - // Duplicate exixting matrix - LuaCairoMatrix(lua_State *L, const cairo_matrix_t *_matrix); - // Destructor - virtual ~LuaCairoMatrix(); - - cairo_matrix_t *GetMatrix(); - - // Creation function - global - CALLABLE(create); -}; - - -class LuaCairoPath : public LuaCairoBase { -private: - cairo_path_t *path; - - // Specifies whether the memory for the cairo_path_t object is owned by the cairo library. - // If cairo owns it we cannot add/remove elements from the path. - bool cairo_owns_memory; - - // Number of path elemts we have allocated memory for. Undefined if cairo_owns_memory. - // This is different from path->length because that specifies the number of elements in use. - size_t path_elements_allocated; - - // Management - void EnsurePathOwned(); // ensure that we own the path memory - void EnsureSpaceFor(size_t n); // ensure we own the path memory and there's space to add at least n more elements - - // TODO: figure out what methods are needed - // Something to iterate over the parts at least - // Support for creating/modifying paths? - - CALLABLE(clear); - CALLABLE(move_to); - CALLABLE(line_to); - CALLABLE(curve_to); - CALLABLE(close); - - // Functional programming support - CALLABLE(map); // transform each path segment with a function - CALLABLE(map_coords); // transform each coordinate pair with a function - CALLABLE(fold); // fold path segments into a single result value - CALLABLE(fold_coords); // fold coordinate pairs into a single result value - - void RegPathCallables(lua_State *L); - -protected: - virtual int internal_lua_index(lua_State *L); - const char *GetTypeName(); - -public: - // Create object with new path - we will own the memory - LuaCairoPath(lua_State *L); - // Create object based on path - does not copy path, and lets cairo own the memory - LuaCairoPath(lua_State *L, cairo_path_t *_path); - // Destructor - virtual ~LuaCairoPath(); - - cairo_path_t *GetPath() { return path; } - - // Modifying the path - void ClearPath(); - void MoveTo(double x, double y); - void LineTo(double x, double y); - void CurveTo(double x0, double y0, double x1, double y1, double x2, double y2); - void ClosePath(); -}; - - -class LuaCairoPattern : public LuaCairoBase { -private: - cairo_pattern_t *pattern; - - CALLABLE(add_color_stop_rgb); - CALLABLE(add_color_stop_rgba); - CALLABLE(get_color_stop_count); - CALLABLE(get_color_stop_rgba); - - CALLABLE(get_rgba); - - CALLABLE(get_surface); - - CALLABLE(get_linear_points); - CALLABLE(get_radial_circles); - - CALLABLE(reference); - CALLABLE(status); - - CALLABLE(set_extend); - CALLABLE(get_extend); - - CALLABLE(set_filter); - CALLABLE(get_filter); - - CALLABLE(set_matrix); - CALLABLE(get_matrix); - - CALLABLE(get_type); - -protected: - const char *GetTypeName(); - -public: - // Create another reference for a pattern object - LuaCairoPattern(lua_State *L, cairo_pattern_t *_pattern); - // Destructor - virtual ~LuaCairoPattern(); - - cairo_pattern_t *GetPattern() { return pattern; } - - // Creation functions - these aren't in pattern objects but in a global table - CALLABLE(create_rgb); - CALLABLE(create_rgba); - CALLABLE(create_for_surface); - CALLABLE(create_linear); - CALLABLE(create_radial); -}; - - -#undef CALLABLE - -#endif diff --git a/devel/OverLua/csri.cpp b/devel/OverLua/csri.cpp deleted file mode 100644 index 6239989b8..000000000 --- a/devel/OverLua/csri.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * CSRI interface for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -// CSRI interface is unmaintained for now -#if 0 - -#include -#include - -#define CSRI_OWN_HANDLES -#define CSRIAPI extern "C" __declspec(dllexport) - -// Nothing special required here -typedef int csri_rend; - -// Forward instance data -struct csri_inst; - -#include "../csri/include/csri/csri.h" -#include "../csri/include/csri/logging.h" - -#include "overlua.h" - -// Instance data -struct csri_inst { - csri_fmt frame_format; - OverLuaScript *script; -}; - -// Renderer information definition -static const csri_info overlua_csri_info = { - "overlua", - "overlua-001", - "OverLua Lua-based advanced effects renderer", - "Niels Martin Hansen", - "Copyright 2007 Niels Martin Hansen (GPLv2)" -}; -// Just something we can pass a pointer to -static const csri_rend overlua_csri_rend = 0; - -// Name of the "overlua" extension format -static const char *overlua_format_ext_name = "jfs.overlua"; - - -CSRIAPI csri_inst *csri_open_file(csri_rend *renderer, - const char *filename, struct csri_openflag *flags) -{ - if (renderer != &overlua_csri_rend) return 0; - - csri_inst *inst = new csri_inst; - inst->script = new OverLuaScript(filename); - - return inst; -} - - -CSRIAPI csri_inst *csri_open_mem(csri_rend *renderer, - const void *data, size_t length, struct csri_openflag *flags) -{ - if (renderer != &overlua_csri_rend) return 0; - - csri_inst *inst = new csri_inst; - inst->script = new OverLuaScript(data, length); - - return inst; -} - - -CSRIAPI void csri_close(csri_inst *inst) -{ - delete inst->script; - delete inst; - return; -} - - -CSRIAPI int csri_request_fmt(csri_inst *inst, const struct csri_fmt *fmt) -{ - // only support RGB formats - if (!csri_is_rgb(fmt->pixfmt)) - return 0; - - // get a private copy of it - memcpy(&inst->frame_format, fmt, sizeof(csri_fmt)); - - return 1; -} - - -CSRIAPI void csri_render(csri_inst *inst, struct csri_frame *frame, double time) -{ - // check for correct pixfmt - if (frame->pixfmt != inst->frame_format.pixfmt) return; - - BaseImageAggregate *olframe = 0; - switch (frame->pixfmt) { -#define HANDLE_RGB_FORMAT(fmtname, PixFmt) \ - case fmtname: \ - olframe = new BaseImageAggregateImpl(inst->frame_format.width, inst->frame_format.height, frame->strides[0], frame->planes[0]); \ - break; - HANDLE_RGB_FORMAT(CSRI_F_RGBA, RGBA) - HANDLE_RGB_FORMAT(CSRI_F_ARGB, ARGB) - HANDLE_RGB_FORMAT(CSRI_F_BGRA, BGRA) - HANDLE_RGB_FORMAT(CSRI_F_ABGR, ABGR) - HANDLE_RGB_FORMAT(CSRI_F_RGB_, RGBX) - HANDLE_RGB_FORMAT(CSRI_F__RGB, XRGB) - HANDLE_RGB_FORMAT(CSRI_F_BGR_, BGRX) - HANDLE_RGB_FORMAT(CSRI_F__BGR, XBGR) - HANDLE_RGB_FORMAT(CSRI_F_RGB, RGB) - HANDLE_RGB_FORMAT(CSRI_F_BGR, BGR) - default: break; // what, we don't support this! -#undef HANDLE_RGB_FORMAT - } - - if (olframe) { - inst->script->RenderFrameRGB(*olframe, time); - } - -} - - -CSRIAPI void *csri_query_ext(csri_rend *rend, csri_ext_id extname) -{ - if (rend != &overlua_csri_rend) - return 0; - - // Check for the OverLua format extension - if (strcmp(extname, overlua_format_ext_name) == 0) - // Nonsense return - return &overlua_format_ext_name; - - // TODO: support logging - if (strcmp(extname, CSRI_EXT_LOGGING) == 0) - return 0; - - return 0; -} - - -CSRIAPI struct csri_info *csri_renderer_info(csri_rend *rend) -{ - if (rend == &overlua_csri_rend) - return (csri_info*)&overlua_csri_info; - return 0; -} - - -CSRIAPI csri_rend *csri_renderer_byname(const char *name, - const char *specific) -{ - if (strcmp(name, overlua_csri_info.name) == 0) - if (!specific || strcmp(specific, overlua_csri_info.specific) == 0) - return (csri_rend*)&overlua_csri_rend; - return 0; -} - - -CSRIAPI csri_rend *csri_renderer_byext(unsigned n_ext, csri_ext_id *ext) -{ - // Check if every extension is supported - while (n_ext-- > 0) { - if (!csri_query_ext((csri_rend*)&overlua_csri_rend, *ext)) - return 0; - ext++; - } - return (csri_rend*)&overlua_csri_rend; -} - - -CSRIAPI csri_rend *csri_renderer_default() -{ - return (csri_rend*)&overlua_csri_rend; -} - - -CSRIAPI csri_rend *csri_renderer_next(csri_rend *prev) -{ - if (prev == 0) - return (csri_rend*)&overlua_csri_rend; - else - return 0; -} - -#endif \ No newline at end of file diff --git a/devel/OverLua/docs/expression-evaluator.txt b/devel/OverLua/docs/expression-evaluator.txt deleted file mode 100644 index 142d43edb..000000000 --- a/devel/OverLua/docs/expression-evaluator.txt +++ /dev/null @@ -1,232 +0,0 @@ -Documentation for the RPN expression engine in OverLua -====================================================== - -For some graphics processing operationg, OverLua provides an RPN (Reverse -Polish Notation) to do fast calculations. This expression engine is designed -primarily to have very fast execution and be multithreading-safe in the -runtime. - -The language is meant to support multi-variable calculations, so apart from -the usual arithmetic operators there is also an assignment operator. Finally -there is a limited number of temporary registers. - -There is no explicit Lua interface to the expression engine, rather it is -implicitly used by some image processing functions. In those cases, a -program is passed as a string to the image processing function. - - -Stack machine execution model ------------------------------ - -The expression evaluator is implemented as a stack machine with a number -of registers. Some of these registers are used for input and/or output -values and some are freely usable for temporary storage. - -The stack holds numbers in 'double' precision, this is the only data type -supported by the machine. There are no practical limits on stack depth. - -The registers also hold numbers in 'double' precision. Depending on the -function using the expression evaluator, different input/output registers -will be available. The input/output registers will usually be single-letter -names using uppercase letters. There are always exactly ten temporary -registers available, named "t0" to "t9", ie. lowercase "t" followed by -a digit. The contents of the temporary registers are undefined at the start -of program execution. - - -The program consists of a number of instructions executed sequentially. There -are three basic types of instructions: - - push - - call - - store - -A 'push' instruction pushes a single number to the top of the stack. The -source of the number can either be a constant or a register. - -A 'call' instruction pops some numbers from the stack, performs an operation -on them and pushes a single number back onto the stack. This includes basic -arithmetic operations such as addition, mulitiplication, but also functions -such as sinus, rounding and logarithms. How many numbers are popped from the -stack depends on the function. - -The 'store' instruction pops one number from the stack and stores it into -a register, overwriting the previous number in the register. - - -After every instruction in the program has been executed, any remaining numbers -on the stack are discarded, and the numbers in the output registers are passed -to the function using the expression evaluator. - - -If a program operation attempt to pop a number from the stack when the stack -is empty, the machine halts with an error state, and the result of the program -is undefined. - - -Expression syntax ------------------ - -The syntax used to specify programs is very straightforward. - -The program consists of a number of tokens separated by whitespace. Each token -translates into one instruction. - - -A token can be a number. This translates into a 'push' instruction, pushing -that number as a constant. The format for numbers is the same as in C. - -Examples: "1", "-5", "3.14", ".5" "2.998e8" - - -A token can be a register name. This translates into a 'push' instruction, -pushing the number in the register. - -Examples: "X", "Y", "t0", "t6" - - -A token can be a basic arithmetic operator. These translate into 'call' -instructions. Each of these represent a function that pops two numbers, -performs the calculation and pushes the result. - -The basic arithmetic operators are: + - * / ^ - -Examples: -Suppose the two previous instructions were "A B" where A and B are registers. -This means that now the stack contains B at the top and A just below. -Operator "+" will then calculate "A + B". Operator "-" will calculate "A - B". -Operator "*" will calculate "A * B". Operator "/" will calculate "A / B". -Operator "^" will calculate "A ^ B", ie. A raised to the power of B. - -The result of illegal operations is undefined. It will most likely result in -an invalid number being pushed onto the stack, and operating on that number -will cause the error to propagate. - - -A token matching the name of a defined function will translate into a 'call' -instruction for the given function. A number of standard functions are always -available, see below for details. - - -An equal sign followed by the name of a register translated into a 'store' -instruction, that will pop the number at the top of the stack and store it -into the named register. There must not be any whitespace between the equal -sign and the register name. - -Examples: "=X", "=t0" - - -Standard function library -------------------------- - -The following functions are always available in the machine. - - -~ (tilde character) -Takes one argument, produces one result. -Unary minus. (Negate the argument.) - -abs -Takes one argument, produces one result. -Return the absolute value. - -floor -Takes one argument, produces one result. -Round towards negative infinity. - -ceil -Takes one argument, produces one result. -Round towards positive infinity. - - -log -Takes one argument, produces one result. -Natural (base e) logarithm. - -exp -Takes one argument, produces one result. -Natural exponentiation. (e to the power of x.) - -sqrt -Takes one argument, produces one result. -Square root. - -e -Takes no arguments, produces one result. -Push the value of e. - - -min -Takes two arguments, produces one result. -Return the smallest of the arguments. - -max -Takes two arguments, produces one result. -Return the largest of the arguments. - - -pi -Takes no arguments, produces one result. -Push the value of pi. - -sin -Takes one argument, produces one result. -Sinus function. Argument in radians. - -cos -Takes one argument, produces one result. -Cosine function. Argument in radians. - -tan -Takes one argument, produces one result. -Tangent function. Argument in radians. - -asin -Takes one argument, produces one result. -Arc sinus function. - -acos -Takes one argument, produces one result. -Arc cosine function. - -atan -Takes one argument, produces one result. -Arc tangent function. - - -mod -Takes two arguments, produces one result. -Modulo operation. - - -rand -Takes no arguments, produces one result. -Return a random value in range 0..1. - - -ifgtz -Takes three arguments, produces one result. -If the first argument is greater than zero, return the second argument, -else return the third argument. - -ifeqz -Takes three arguments, produces one result. -If the first argument is equal to zero, return the second argument, -else return the third argument. - - -Sample programs ---------------- - -For raster.pixel_value_map: - -"rand =t0 t0 =R t0 =G t0 =B" -Create a field of random gray-values. - -"0 =R 1 G - =G" -Zero out the red channel and invert the green channel. - - -For raster.pixel_coord_map: - -"X .5 rand - + =X Y .5 rand - + =Y" -Create some jitter in the pixels. diff --git a/devel/OverLua/docs/lua-cairo.txt b/devel/OverLua/docs/lua-cairo.txt deleted file mode 100644 index c7eccb4a8..000000000 --- a/devel/OverLua/docs/lua-cairo.txt +++ /dev/null @@ -1,451 +0,0 @@ -Documentation for the cairo interface provided in OverLua -========================================================= - -First, this file will mostly attempt to describe the differences between the -cairo C API and the provided Lua API. If you want more general and in-depth -information on cairo, please see the documentation for the C API: - - - - -Note that almost all of the *_reference functions are unimplemented currently. -They should not be explicitly needed since Lua does its own management on -objects as well, you can just copy and keep a Lua cairo object and be -guaranteed the underlying cairo object won't be deleted until all Lua objects -referring to it are gone. -There are no *_destroy and *_get_reference_count functions either, -for this reason. - -Finally the *_user_data functions are also removed from the API. - - -Conventions in this file ------------------------- - -Variable name Cairo object - -surf Surface (cairo_surface_t) -ctx Context (cairo_t) -face Font face (cairo_font_face_t) -sf Scaled font (cairo_scaled_font_t) -fo Font options (cairo_font_options_t) -mat Matrix (cairo_matrix_t) -path Path (cairo_path_t) -pat Pattern (cairo_pattern_t) -x, y Coordinates -r, g, b, a Colour values (red, green, blue, alpha) - - -If more than one of an object type is used they will get numeric suffixes. -For matrix operations you might also see "matR", this is "result matrix". - - -More "OO-like" syntax ---------------------- - -This Lua cairo API provides a more common "OO-like" syntax for calls. -For example, the cairo_set_source_surface(ctx, surf, x, y) function maps to -ctx.set_source_surface(surf, x, y). - - -Creating initial objects ------------------------- - -Many of the objects you will use are created from or by other objects, but -you will need to create some non-dependant objects, most importantly image -surface objects. All the object creation functions live in the global "cairo" -table. - - -surf = cairo.image_surface_create(width, height, pixel_format) - -Create a blank image surface object. - -width and height are in pixels. pixel_format is a string and must be one -of "argb32", "rgb24", "a8" and "a1". - - -fo = cairo.font_options_create() - -Create a new font options object. - - -mat = cairo.matrix_create() - -Create a new matrix. It is initially the identity matrix. - - -pat = cairo.pattern_create_rgb(r, g, b) -pat = cairo.pattern_create_rgba(r, g, b, a) -pat = cairo.pattern_create_for_surface(surf) -pat = cairo.pattern_create_linear(x0, y0, x1, y1) -pat = cairo.pattern_create_radial(x0, y0, r0, x1, y1, r1) - -Create various kinds of pattern objects. - - -ctx = surf.create_context() - -Not strictly an "initial object", but cairo context objects are important -enough to explicitly list here. They are created by calling the -create_context() method in a surface object. This will create a context -object that draws to the surface it was created with. - - -Other functions that have changed API -------------------------------------- - -Some functions have changed API to better match the Lua programming model. - - -ctx.set_dash() -ctx.set_dash(0) -ctx.set_dash(num[, offset]) -ctx.set_dash(dashes[, offset]) - -There are several forms of the set_dash function. The two first disable -dashing entirely. - -The third creates a repeating pattern of equal length on and off potions, -each "num" units long. The offset argument is optional, its default is 0. - -The last creates a complex pattern. "dashes" must be a table of numbers -describing the dashing pattern. offset is optional, default is 0. - - -dashes, offset = ctx.get_dash() - -Returns current dashing setting, in same format as the last form of set_dash -takes. If dashing is disabled, dashes will be an empty table. - -(You won't need to use the ctx.get_dash_count() function.) - - -x0, y0, x1, y1 = ctx.clip_extents() -x0, y0, x1, y1 = ctx.fill_extents() -x0, y0, x1, y1 = ctx.stroke_extents() - -Return the smallest rectangle bounding the area that would be affected if -performing a clip/fill/stroke operation. - - -x, y = ctx.get_current_point() - -Get the current point for path gneration operations. - - -mat = ctx.get_matrix() - -Get the current geometry transformation matrix. - - -x, y = ctx.user_to_device(x, y) -x, y = ctx.user_to_device_distance(x, y) -x, y = ctx.device_to_user(x, y) -x, y = ctx.device_to_user_distance(x, y) - -Returns the transformation of a point between device and user-space -coordinates. - - -offset, r, g, b, a = pat.get_color_stop_rgba(index) - -Returns nothing if the pattern is not a gradient pattern or the stop index -is out of range. - - -r, g, b, a = pat.get_rgba() - -Returns nothing if the pattern is not a solid colour fill pattern. - - -surf = pat.get_surface() - -Returns nothing if the pattern is not a surface pattern. - - -x0, y0, x1, y1 = pat.get_linear_points() - -Returns nothing if the pattern is not a linear gradient pattern. - - -x0, y0, r0, x1, y1, r1 = pat.get_radial_circles() - -Returns nothing if the pattern is not a radial gradient pattern. - - -extents = ctx.font_extents() -extents = sf.font_extents() - -Get extents metrics for current font. The returned object is a Lua table -with fields identical to the C struct cairo_font_extents_t. - - -extents = ctx.tex_extents(utf8) -extents = sf.text_extents(utf8) - -Get extents metrics for writing text given in utf8 with current font. The -returned object is a Lua table with fields identical to the C -struct cairo_text_extents_t. - - -fo = sf.get_font_options() - -Get font options for a scaled font. - - -mat = sf.get_font_matrix() - -Get text transformation matrix. - - -mat = sf.get_ctm() - -Get the CTM. (Character transformation matrix?) - - -fo1.merge(fo2) - -Merge font options fo2 into fo1. - - -hash = fo.hash() - -Returns a hexadecimal string hash of fo. - - -fo1.equal(fo2) - -Return true is fo1 equals fo2. - - -fo = surf.get_font_options() - -Get current font options for surface. - - -x, y = surf.get_device_offset() - -Get current device offset for surface. - - -a, r, g, b = surf.get_pixel(x, y) -r, g, b = surf.get_pixel(x, y) -a = surf.get_pixel(x, y) - -Get colour value of a pixel on an image surface. This function replaces the -cairo_image_surface_get_data(surf) function for reading surface contents. -The number and meanings of return values depend on the surface pixel format. - -surf.set_pixel() is not implemented yet. - - -matR = mat.copy() - -Duplicate a matrix. Not in cairo C API. - - -mat.xx, mat.yx, mat.xy, mat.yy, mat.x0, mat.y0 - -Access the individual numbers in a matrix. These are both read and write. - - -Functional programming on path objects --------------------------------------- - -The path object still hasn't been completely implemented, but two useful -functions do exist for it. These are functional programming style map and -fold functions. - - -path.map_coords(func) - -Transform every coordinate pair in path using func. - -func must be a function of type (x,y)->(x,y) ie. takes two arguments which -are the x and y coordinates of the point and returns two numbers which are -the new x and y coordinates of the point. - -Example: Produce a "wavy" effect. -path.map_coords(function(x,y) return x+math.sin(x), y+math.cos(y) end) - - -res = path.fold_coords(func, start) - -Produce a value by combining all the coordinate pairs using func. - -func must be a function of type (r,x,y)->(r) ie. takes three argument which -are the current result and the x/y coordinates of the point, and returns a -new result. -When all points have been processed path.fold_coords returns the final result. - -Example: Find the maximum X coordinate. -maxx = path.fold_coords( - function(maxx,x,y) - if not maxx then - return x - elseif x > maxx then - return x - else - return maxx - end - end, nil) - - -Enumeration mappings --------------------- - -Everything represented by an enum in the cairo C API is represented by a -string in the Lua API. Any enums not listed here don't have any mappings -currently. (Which in turn means that any API requiring that enum is also -unimplemented.) - - -typedef enum _cairo_antialias { - CAIRO_ANTIALIAS_DEFAULT, "default" - CAIRO_ANTIALIAS_NONE, "none" - CAIRO_ANTIALIAS_GRAY, "gray" - CAIRO_ANTIALIAS_SUBPIXEL "subpixel" -} cairo_antialias_t; - -typedef enum _cairo_fill_rule { - CAIRO_FILL_RULE_WINDING, "winding" - CAIRO_FILL_RULE_EVEN_ODD "even_odd" -} cairo_fill_rule_t; - -typedef enum _cairo_line_cap { - CAIRO_LINE_CAP_BUTT, "butt" - CAIRO_LINE_CAP_ROUND, "round" - CAIRO_LINE_CAP_SQUARE "square" -} cairo_line_cap_t; - -typedef enum _cairo_line_join { - CAIRO_LINE_JOIN_MITER, "miter" - CAIRO_LINE_JOIN_ROUND, "round" - CAIRO_LINE_JOIN_BEVEL "bevel" -} cairo_line_join_t; - -typedef enum _cairo_operator { - CAIRO_OPERATOR_CLEAR, "clear" - - CAIRO_OPERATOR_SOURCE, "source" - CAIRO_OPERATOR_OVER, "over" - CAIRO_OPERATOR_IN, "in" - CAIRO_OPERATOR_OUT, "out" - CAIRO_OPERATOR_ATOP, "atop" - - CAIRO_OPERATOR_DEST, "dest" - CAIRO_OPERATOR_DEST_OVER, "dest_over" - CAIRO_OPERATOR_DEST_IN, "dest_in" - CAIRO_OPERATOR_DEST_OUT, "dest_out" - CAIRO_OPERATOR_DEST_ATOP, "dest_atop" - - CAIRO_OPERATOR_XOR, "xor" - CAIRO_OPERATOR_ADD, "add" - CAIRO_OPERATOR_SATURATE "saturate" -} cairo_operator_t; - -typedef enum _cairo_path_data_type { - CAIRO_PATH_MOVE_TO, "move_to" - CAIRO_PATH_LINE_TO, "line_to" - CAIRO_PATH_CURVE_TO, "curve_to" - CAIRO_PATH_CLOSE_PATH "close" -} cairo_path_data_type_t; - -typedef enum _cairo_extend { - CAIRO_EXTEND_NONE, "none" - CAIRO_EXTEND_REPEAT, "repeat" - CAIRO_EXTEND_REFLECT, "reflect" - CAIRO_EXTEND_PAD "pad" -} cairo_extend_t; - -typedef enum _cairo_filter { - CAIRO_FILTER_FAST, "fast" - CAIRO_FILTER_GOOD, "good" - CAIRO_FILTER_BEST, "best" - CAIRO_FILTER_NEAREST, "nearest" - CAIRO_FILTER_BILINEAR, "bilinear" - CAIRO_FILTER_GAUSSIAN "gaussian" -} cairo_filter_t; - -typedef enum _cairo_pattern_type { - CAIRO_PATTERN_TYPE_SOLID, "solid" - CAIRO_PATTERN_TYPE_SURFACE, "surface" - CAIRO_PATTERN_TYPE_LINEAR, "linear" - CAIRO_PATTERN_TYPE_RADIAL "radial" -} cairo_pattern_type_t; - -typedef enum _cairo_font_slant { - CAIRO_FONT_SLANT_NORMAL, "" (empty string) - CAIRO_FONT_SLANT_ITALIC, "italic" - CAIRO_FONT_SLANT_OBLIQUE "oblique" -} cairo_font_slant_t; - -typedef enum _cairo_font_weight { - CAIRO_FONT_WEIGHT_NORMAL, "" (empty string) - CAIRO_FONT_WEIGHT_BOLD "bold" -} cairo_font_weight_t; - -typedef enum _cairo_subpixel_order { - CAIRO_SUBPIXEL_ORDER_DEFAULT, "default" - CAIRO_SUBPIXEL_ORDER_RGB, "rgb" - CAIRO_SUBPIXEL_ORDER_BGR, "bgr" - CAIRO_SUBPIXEL_ORDER_VRGB, "vrgb" - CAIRO_SUBPIXEL_ORDER_VBGR "vbgr" -} cairo_subpixel_order_t; - -typedef enum _cairo_hint_style { - CAIRO_HINT_STYLE_DEFAULT, "default" - CAIRO_HINT_STYLE_NONE, "none" - CAIRO_HINT_STYLE_SLIGHT, "slight" - CAIRO_HINT_STYLE_MEDIUM, "medium" - CAIRO_HINT_STYLE_FULL "full" -} cairo_hint_style_t; - -typedef enum _cairo_hint_metrics { - CAIRO_HINT_METRICS_DEFAULT, "default" - CAIRO_HINT_METRICS_OFF, "on" - CAIRO_HINT_METRICS_ON "off" -} cairo_hint_metrics_t; - -typedef enum _cairo_content { - CAIRO_CONTENT_COLOR, "c" - CAIRO_CONTENT_ALPHA, "a" - CAIRO_CONTENT_COLOR_ALPHA, "ca" -} cairo_content_t; -Tnis enum and everything dependent on it is probably BROKEN. - -typedef enum _cairo_format { - CAIRO_FORMAT_ARGB32, "argb32" - CAIRO_FORMAT_RGB24, "rgb24" - CAIRO_FORMAT_A8, "a8" - CAIRO_FORMAT_A1, "a1" - /* CAIRO_FORMAT_RGB16_565 "rgb16_565" (do not use) */ -} cairo_format_t; - -typedef enum _cairo_status { - CAIRO_STATUS_SUCCESS, "success" - CAIRO_STATUS_NO_MEMORY, "no_memory" - CAIRO_STATUS_INVALID_RESTORE, "invalid_restore" - CAIRO_STATUS_INVALID_POP_GROUP, "invalid_pop_group" - CAIRO_STATUS_NO_CURRENT_POINT, "no_current_point" - CAIRO_STATUS_INVALID_MATRIX, "invalid_matrix" - CAIRO_STATUS_INVALID_STATUS, "invalid_status" - CAIRO_STATUS_NULL_POINTER, "null_pointer" - CAIRO_STATUS_INVALID_STRING, "invalid_string" - CAIRO_STATUS_INVALID_PATH_DATA, "invalid_path_data" - CAIRO_STATUS_READ_ERROR, "read_error" - CAIRO_STATUS_WRITE_ERROR, "write_error" - CAIRO_STATUS_SURFACE_FINISHED, "surface_finished" - CAIRO_STATUS_SURFACE_TYPE_MISMATCH, "surface_type_mismatch" - CAIRO_STATUS_PATTERN_TYPE_MISMATCH, "pattern_type_mismatch" - CAIRO_STATUS_INVALID_CONTENT, "invalid_content" - CAIRO_STATUS_INVALID_FORMAT, "invalid_format" - CAIRO_STATUS_INVALID_VISUAL, "invalid_visual" - CAIRO_STATUS_FILE_NOT_FOUND, "file_not_found" - CAIRO_STATUS_INVALID_DASH, "invalid_dash" - CAIRO_STATUS_INVALID_DSC_COMMENT, "invalid_dsc_comment" - CAIRO_STATUS_INVALID_INDEX, "invalid_index" - CAIRO_STATUS_CLIP_NOT_REPRESENTABLE "clip_not_representable" -} cairo_status_t; - diff --git a/devel/OverLua/docs/lua-fonts.txt b/devel/OverLua/docs/lua-fonts.txt deleted file mode 100644 index 55b86d2ca..000000000 --- a/devel/OverLua/docs/lua-fonts.txt +++ /dev/null @@ -1,62 +0,0 @@ -Documentation for the fonts interface provided in OverLua -========================================================= - -OverLua provides a simplified interface to create and manage Fontconfig -in-memory configurations, create FreeType font face objects from those -and basic manipulation of these font face objects. - -It is possible to create cairo font face objects from the FreeType font -face objects, so the fonts can be used in cairo rendering. This is the -preferred way to produce text in OverLua. - -This interface does not provide means to have Fontconfig load and use -configuration files, neither system-wide, per-user nor private ones. -The only way to load and use fonts is to explicitly name the font files -and load these. The purpose of this is to let OverLua scripts produce -predictable results, as the same font will always be selected regardless -of the system the script is running on. - - -See also: - -Fontconfig documentation: - -FreeType 2 documentation: - - -Font configuration object -------------------------- - -OverLua keeps one global Fontconfig configuration object, which is -implicitly used for all operations. It is accessed through the global -'fonts' object. - -The following operations are supported: - - -success = fonts.add_file(filename) - -Attempts to load the specified font file and add all fonts in it to the -Fontconfig configuration. This uses the FcConfigAppFontAddFile C function -to perform the work. - -On return, 'success' is a boolean which is 'true' on success and 'false' -otherwise. - - -cairofont = fonts.select(pattern, cairofo) - -Select the font best matching the pattern given, and return an object -representing that font. - -The pattern is a Lua table of key=value pairs, with the keys being the -properties Fontconfig understands, and the values the value you want -for that property. - -'cairofo' is a cairo font options object. This parameter is optional. - -You can see a list of known properties on: - -This function returns a cairo FreeType font object that can be selected -into a cairo context for rendering with. - diff --git a/devel/OverLua/docs/overlua.txt b/devel/OverLua/docs/overlua.txt deleted file mode 100644 index 158d7530b..000000000 --- a/devel/OverLua/docs/overlua.txt +++ /dev/null @@ -1,230 +0,0 @@ -OverLua provides a Lua 5.1 runtime environment with access to all -standard libraries. - - -The Avisynth filter -------------------- - -The Avisynth filter version of OverLua exports one function: - - OverLua(clip c, string scriptfile, string "datastring", string "vfrfile") - -The clip c argument is self-explanatory, the clip to render on. - -The scripfile is the path to the Lua script you want to load and run. - -datastring is a freeform string to pass to the Lua script. This will often -be the path to a file with additional data for the script, such as timed -subtitles/karaoke. - -vfrfile is the path to a timecode file Matroska format 1 or 2. If supplied, -it will be used to translate frame numbers to timestamps instead of relying -on the frame rate provided by Avisynth. - - -API the Lua script must implement ---------------------------------- - -Any initialisation, such as loading external data files, should be done -in the Lua script's global environment. - -OverLua expects one function in the script: - -function render_frame(frame, timestamp) - -The function name must be literal "render_frame". It must not be local. - -The "frame" parameter is a userdata object representing the video frame -there must be rendered to. Other functions take this object as parameter. - -The "timestamp" parameter is a value of type "number", representing the -timestamp of the frame to be rendered, in seconds. The timestamp may be -non-integer with any precision. - -The render_frame function should not return anything. Instead it modifies -the frame object. - -The render_frame function should not assume that frames are requested in -any specific order. - - -If a "datastring" argument is supplied to the OverLua Avisynth function, the -argument value will be available through the global variable -"overlua_datastring" in the Lua script environment. - - -The frame object ----------------- - -The "frame" object passed to the render_frame function has a number of -fields accessible. - -The frame is always stored as RGB. No alpha channel is supported. - - -frame.width - -An integer number storing the width of the frame in pixels. - -Read only. - - -frame.height - -An integer number storing the height of the frame in pixels. - -Read only. - - -red, green, blue = frame(x, y) - -"red", "green" and "blue" will be numbers in range 0..255 that will receive -the respective colour channel values for the requested pixel. -"x" and "y" are the pixel coordinates for the pixel to retrieve -Pixel coordinates are counted from zero and start in the upper left corner. -A pixel with coordinates (X, Y) has pixel number Y*frame.width+X. - - -frame[n] = {red, green, blue} - -Set the value of the given pixel. - -The table on the right side of the equal sign must have at least three -entries which must all be numbers. They are taken as red, green and blue -values respectively, in regular enumeration order. -"n" is the pixel number to be set. -A pixel with coordinates (X, Y) has pixel number Y*frame.width+X. - -Using a table constructor as shown is recommended. - - -surface = frame.create_cairo_surface() - -Create a cairo rgb24 surface from the video frame. Drawing to the surface -will _not_ affect the video frame. If you want the changes to the surface -visible on the video you will need to overlay this surface on the video. - - -frame.overlay_cairo_surface(surface, x, y) - -Overlay the given cairo surface at the video frame such that the upper, -left corner of the surface is positioned at pixel (x, y) on the video. -Only argb32 and rgb24 type surfaces are supported. -Proper alpha blending is used for argb32 surfaces. - - -Setting a pixel value for a pixel outside the frame has no effect. -Specifically, it will not produce an error or a warning message. - -Reading a pixel value for a pixel outside the frame will return black, -ie. (0, 0, 0). - - -Vector graphics interface -------------------------- - -OverLua uses the cairo library for all vector graphics handling, including -text handling. - -See lua-cairo.txt for details. - - -Raster graphics processing interface ------------------------------------- - -A raster graphics processing interface is also provided, to post-process -the graphics produced by the vector graphics interface. - -The raster graphics interface operates directly on cairo surfaces. - - -raster.gaussian_blur(surface, sigma) - -Applies a strength sigma gaussian blur on the surface. - - -raster.box_blur(surface, size, repetitions) - -Applies a box blur filter of variable size to the surface as many times as -specified. Please note that no specific optimisation is done for applying -box filters over more general filters and using box blur over gaussian blur -is probably no faster and might even be slower. - - -raster.directional_blur(surface, angle, sigma) - -Apply a variable strength directional gaussian kernel blur to the image. -Also known as motion blur. The angle is given in radians. - - -raster.radial_blur(surface, cx, cy, sigma) - -Apply a variable strength radial gaussian blur centered on pixel (cx,cy). - - -raster.invert(surface) - -Invert the colour in the given surface. - -For ARGB32 surfaces, only the colour channels are inverted, the alpha -channel is kept as-is. -For RGB24 surfaces, all channels are inverted. -For A8 and A1 surfaces the alpha is inverted. - - -raster.separable_filter(surface, filter, divisor) - -Apply a custom separable filter over the image. - -The filter must be a table of integers. After the convoluted value of each -pixel is calculated, it is divided by divisor before it's stored back to the -image. - -Note that this function can only work on integers, floating point values in -the filter or divisor will be rounded first. To get higher precision, scale -up the filter and divisor. (Treat it as fixed-point math.) - -The filter is one-dimensional, but is applied first horizontally and then -vertically ovre the image to get the final image. - - -raster.pixel_value_map(surface, expression) - -Map an expression over every pixel RGB value in the surface. Only works for -ARGB32 and RGB24 surfaces. - -The expression is an RPN expression in the OverLua Expression Evaluator -language, see expression-evaluator.txt for details. - -No additional functions are made available to the expression evaluator by -this function. - -The following new registers are made available to the expression evaluator: - R In range 0..1, red component. Input and output. - G Ditto, for green component. - B Ditto, for blue component. - A Ditto, for alpha component. (Only on ARGB32 surfaces.) - X X-coordinate of pixel being processed. Input only. - Y Y-coordinate of pixel being processed. Input only. - - -raster.pixel_coord_map(surface, expression) - -Map each pixel coordinate pair to a new coordinate pair in the surface. Only -works for ARGB32 and RGB24 surfaces. - -The expression is an RPN expression in the OverLua Expression Evaluator -language, see expression-evaluator.txt for details. - -No additional functions are made available to the expression evaluator by -this function. - -The following new registers are made available to the expression evaluator: - X Absolute pixel X coordinate. Input and output. The output may be - non-integer, in that case bilinear interpolation is used. - Y Ditto, for Y coordinate. - - -More filtering functions are planned, though no specifics yet. - -Wishes/suggestions are welcome, and so are patches to add more functions. diff --git a/devel/OverLua/docs/rgb2hsl.lua b/devel/OverLua/docs/rgb2hsl.lua deleted file mode 100644 index dbe8b301f..000000000 --- a/devel/OverLua/docs/rgb2hsl.lua +++ /dev/null @@ -1,55 +0,0 @@ ---- Convert RGB colour to HSL (hue/saturation/luminance) --- The output image will have H instead of R, --- S instead of G and L instead of B. - -function render_frame(f, t) - local w, h = f.width, f.height - for y = 0, h-1 do - for x = 0, w-1 do - local r, g, b = f(x, y) - local h, s, l = RGB2HSL(r, g, b) - f[y*w+x] = {h, s, l} - end - end -end - -function clip_colorval(v) - if v < 0 then - return 0 - elseif v > 255 then - return 255 - else - return math.floor(v) - end -end - -function RGB2HSL(R, G, B) - local r, g, b = R/255, G/255, B/255 - local h, s, l - - local minrgb, maxrgb = math.min(r, math.min(g, b)), math.max(r, math.max(g, b)) - - l = (minrgb + maxrgb) / 2 - - if minrgb == maxrgb then - h, s = 0, 0 - else - if l < 0.5 then - s = (maxrgb - minrgb) / (maxrgb + minrgb) - else - s = (maxrgb - minrgb) / (2 - maxrgb - minrgb) - end - if r == maxrgb then - h = (g - b) / (maxrgb - minrgb) + 0 - elseif g == maxrgb then - h = (b - r) / (maxrgb - minrgb) + 2 - else - h = (r - g) / (maxrgb - minrgb) + 4 - end - end - - if h < 0 then h = h + 6 end - if h >= 6 then h = h - 6 end - - return clip_colorval(h*255/6), clip_colorval(s*255), clip_colorval(l*255) -end diff --git a/devel/OverLua/docs/sample1.lua b/devel/OverLua/docs/sample1.lua deleted file mode 100644 index 2714897d6..000000000 --- a/devel/OverLua/docs/sample1.lua +++ /dev/null @@ -1,134 +0,0 @@ ---[[ - -Sample script for OverLua - - demonstrate basic reading in an ASS subtitle file and rendering its lines on the video - -Given into the public domain. -(You can do anything you want with this file, with no restrictions whatsoever. - You don't get any warranties of any kind either, though.) - -Originally authored by Niels Martin Hansen. - -]] - --- overlua_datastring is the string given to data= argument in Avisynth filter invocation -timing_input_file = overlua_datastring --- You may want to get these from somewhere else --- Or just stick to hardcoding all styling information -font_name = "Arial" -font_size = 24 - --- A little check that an input file was actually given -assert(timing_input_file, "Missing input file") - - --- An easier way to convert a string to a number and be guaranteed to get something useful -function parsenum(str) - return tonumber(str) or 0 -end --- Convert an ASS timestamp into a number of seconds -function parse_ass_time(ass) - local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)") - return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600 -end - --- Not used here, but do some basic \k timing parsing -function parse_k_timing(text) - local syls = {} - local i = 1 - for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do - local syl = {dur = parsenum(timing)/100, text = syltext, i = i} - table.insert(syls, syl) - i = i + 1 - end - return syls -end - --- Really stupid ASS parser -function read_input_file(name) - for line in io.lines(name) do - -- You can catch Style lines in the same way if you want - local start_time, end_time, style, fx, text = line:match("Dialogue: 0,(.-),(.-),(.-),.-,0000,0000,0000,(.-),(.*)") - if text then - local ls = {} - ls.start_time = parse_ass_time(start_time) - ls.end_time = parse_ass_time(end_time) - ls.style = style - ls.fx = fx - ls.rawtext = text - ls.kara = parse_k_timing(text) - -- Clear out override blocks - ls.cleantext = text:gsub("{.-}", "") - table.insert(lines, ls) - end - end -end - --- Initialisation function, intended to be run on the first frame --- I think it's better to delay initialisation until first frame is requested --- rather than doing it immediately at load time. --- I believe much encoding software might be more graceful about that. -function init() - if inited then return end - inited = true - - lines = {} - read_input_file(timing_input_file) -end - - --- Actual work function, this is what's called by OverLua for each frame --- f is a video frame object, what we'll be drawing to --- t is the timestamp of the frame, given in seconds (floating point) -function render_frame(f, t) - -- Just call init() every time, init itself makes sure it doesn't init more than once - init() - - -- Find lines to be drawn - -- NOTE: This structure is very simplistic. - -- Advanced karaoke effects will probably need to build an object/effect list - -- as initialisation and then instead go over the list of objects/effects per frame, - -- instead of going over lines. - -- (Ie. preprocessing in the style of ASS karaoke generation.) - for i, line in pairs(lines) do - if line.start_time <= t and line.end_time > t then - -- Initial position of line - local x = 0 - local y = f.height - 25 - - -- Initialise drawing surface and context - local surf = cairo.image_surface_create(f.width, f.height, "argb32") - local c = surf.create_context() - - -- Select our font - c.select_font_face(font_name) - c.set_font_size(font_size) - - -- Get sizing information for font and line text - if not line.te then line.te = c.text_extents(line.cleantext); line.fe = c.font_extents() end - -- Calculate centered position - x = (f.width - line.te.width) / 2 - line.te.x_bearing - - -- Produce text path - c.move_to(x, y) - c.text_path(line.cleantext) - - -- Draw a black border - -- It will be centered on the text outline - c.set_line_width(4) - c.set_line_join("round") -- default is "miter" - c.set_source_rgba(0, 0, 0, 1) - -- "preserve" to keep the text path in the context - c.stroke_preserve() - -- Apply a little box blur to the border, effectively \be1 - raster.box_blur(surf, 3) - - -- Draw a white fill - this will draw over the inner part of the border - c.set_source_rgba(1, 1, 1, 1) - c.fill() - - -- Overlay on video - f.overlay_cairo_surface(surf, 0, 0) - end - end -end diff --git a/devel/OverLua/docs/sample2.lua b/devel/OverLua/docs/sample2.lua deleted file mode 100644 index a4247936e..000000000 --- a/devel/OverLua/docs/sample2.lua +++ /dev/null @@ -1,235 +0,0 @@ ---[[ - -Sample script for OverLua - - demonstrate basic reading in an ASS subtitle file and rendering its lines on the video - -Given into the public domain. -(You can do anything you want with this file, with no restrictions whatsoever. - You don't get any warranties of any kind either, though.) - -Originally authored by Niels Martin Hansen. - -]] - --- Set up some parameters -timing_input_file = overlua_datastring --- Just the font name to use. -font_name = "Arial" --- This is height in pixels, I suppose ;) -font_size = 40 --- This is the position of the _baseline_ of the text, neither top, bottom nor center! -ypos = 50 --- Duration of fadein/out in seconds -fadetime = 1 - --- Error out if no file name was given (data= in Avisynth invocation) -assert(timing_input_file, "Missing timing input file for sample effect.") - - --- ASS file reading stuff -function parsenum(str) - return tonumber(str) or 0 -end -function parse_ass_time(ass) - local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)") - return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600 -end - -function parse_k_timing(text) - local syls = {} - local cleantext = "" - local i = 1 - for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do - local syl = {dur = parsenum(timing)/100, text = syltext, i = i} - table.insert(syls, syl) - cleantext = cleantext .. syltext - i = i + 1 - end - return syls, cleantext -end - -function read_input_file(name) - for line in io.lines(name) do - local start_time, end_time, fx, text = line:match("Dialogue: 0,(.-),(.-),Default,,0000,0000,0000,(.-),(.*)") - if text then - local ls = {} - ls.start_time = parse_ass_time(start_time) - ls.end_time = parse_ass_time(end_time) - ls.fx = fx - ls.rawtext = text - ls.kara, ls.cleantext = parse_k_timing(text) - table.insert(lines, ls) - end - end -end - -function init() - if inited then return end - inited = true - - lines = {} - read_input_file(timing_input_file) -end - - --- Get/create a "sparks" texture, singleton-style -function get_sparks_texture(width, height) - -- Check if it already exists, just return it then - if sparks_texture then return sparks_texture end - -- We'll make a 128x128 black image with some blurred whitish spots on - local surf = cairo.image_surface_create(128, 128, "rgb24") - local c = surf.create_context() - -- Paint it all black - c.set_source_rgb(0,0,0) - c.paint() - -- Then create a very light yellow - c.set_source_rgb(1,1,0.9) - -- And create 50 small, random circles - for i = 1, 50 do - local x, y = math.random(120)+4, math.random(120)+4 - c.arc(x, y, 3, 0, 2*math.pi) - c.fill() - end - -- And blur the result - raster.gaussian_blur(surf, 2.5) - - -- Then create a texture of it. - -- sparks_texture becomes a global variable - sparks_texture = cairo.pattern_create_for_surface(surf) - sparks_texture.set_extend("repeat") - - return sparks_texture -end - - -function render_frame(f, t) - init() - - -- Create a blurred copy of the video frame - local fsurf = f.create_cairo_surface() - raster.gaussian_blur(fsurf, 5) - - -- Function to create "wobble" effect on the text - local function blubble_mapper(x, y) - local nx = x + math.sin(x/30 + y/10 + t*2.0)*3 - local ny = y + math.cos(y/20 + x/20 + t*2.3)*3 - return nx, ny - end - - -- Find lines to be drawn - for i, line in pairs(lines) do - -- Check if the line is within time range. - -- "In time range" means starts fadetime seconds later than current time or ends "fadetime" seconds earlier. - if line.start_time <= t+fadetime and line.end_time > t-fadetime then - local x = 0 - local y = ypos - - -- Prepare a surface to draw on - local surf = cairo.image_surface_create(f.width, 200, "argb32") - local c = surf.create_context() - -- Select the font - c.select_font_face(font_name) - c.set_font_size(font_size) - -- Get the text extents for the line text if we don't have them already - if not line.te then line.te = c.text_extents(line.cleantext); line.fe = c.font_extents() end - -- And calculate the start X to have the line centered - x = (f.width - line.te.width) / 2 - line.te.x_bearing - -- Then make a path for the text - c.move_to(x, y) - c.text_path(line.cleantext) - - -- Create the "wobble" effect on the text - -- First get a Path object for the text - local path = c.copy_path() - -- Run the path through the mapping function - path.map_coords(blubble_mapper) - -- Clear the path in the context - c.new_path() - -- And add the modified path back - c.append_path(path) - - -- Prepare drawing the text outline - c.set_line_width(8) - -- Red outline - c.set_source_rgba(1, 0, 0, 1) - -- Stroke it but keep the path in the canvas - c.stroke_preserve() - -- Blur this outline - raster.gaussian_blur(surf, 1.5) - -- Prepare another, smaller outline on top - c.set_line_width(3) - -- This one is white - c.set_source_rgba(1, 1, 1, 1) - -- Stroke that one too, but clear the path afterwards - c.stroke() - - -- Now loop over the syllables to draw them one by one - local sumdur = line.start_time - for j, syl in pairs(line.kara) do - -- Get the text extents for this syllable - if not syl.te then syl.te = c.text_extents(syl.text) end - -- Prepare the path - c.move_to(x, y) - c.text_path(syl.text) - -- Wobble the path; this will work because the mapper is deterministic on X, Y and timestamp - local path = c.copy_path() - path.map_coords(blubble_mapper) - c.new_path() - c.append_path(path) - -- And advance X position - x = x + syl.te.x_advance - -- Now figure out whether this syllable is the active one or not - -- Use a more complicated test, this makes the first syllable be highlighted - -- also while the line is fading in, and the last while the line is fading out. - if (syl.i == 1 and t < sumdur+syl.dur) or - (syl.i == #line.kara and t > sumdur) or - (t >= sumdur and t < sumdur+syl.dur) then - -- Get the "sparks" texture - local sparks = get_sparks_texture() - -- Prepare a transformation matrix for it - local texmat = cairo.matrix_create() - texmat.init_rotate(t/10) - texmat.scale(3, 3) - sparks.set_matrix(texmat) - -- Use the texture - c.set_source(sparks) - -- And fill the path - c.fill() - else - -- Not the active syllable, fill it with a blurred video frame - -- Remember fsurf is the blurred video frame - c.set_source_surface(fsurf, 0, 0) - c.fill_preserve() - -- Also add a slight darkening to the fill - c.set_source_rgba(0, 0, 0, 0.2) - c.fill() - end - -- Advance the sum of syllable durations - sumdur = sumdur + syl.dur - end - - -- Figure out whether we're past the actual start/end time of the line and do some fading then - local final = surf - if t < line.start_time or t > line.end_time then - -- Make invisibility the amount the line is invisible - local invisibility - if t < line.start_time then - invisibility = (line.start_time - t) / fadetime - else - invisibility = (t - line.end_time) / fadetime - end - -- We'll need a new surface object here - final = cairo.image_surface_create(surf.get_width(), surf.get_height(), "argb32") - local c = final.create_context() - -- So we can alpha-blend the original drawn text image onto it using invisibility as alpha - c.set_source_surface(surf, 0, 0) - c.paint_with_alpha(1-invisibility) - -- And then do some heavy blur-out - raster.gaussian_blur(final, invisibility*15) - end - - -- Finally just overlay the text image on the video - f.overlay_cairo_surface(final, 0, 0) - end - end -end diff --git a/devel/OverLua/docs/sample3.lua b/devel/OverLua/docs/sample3.lua deleted file mode 100644 index c224798e0..000000000 --- a/devel/OverLua/docs/sample3.lua +++ /dev/null @@ -1,645 +0,0 @@ ---[[ - -Sample script for OverLua - - advanced karaoke effect, first version of Mendoi-Conclave Gundam 00 OP 1 - -Given into the public domain. -(You can do anything you want with this file, with no restrictions whatsoever. - You don't get any warranties of any kind either, though.) - -Originally authored by Niels Martin Hansen. - -While I can't prevent you from it, please don't use this effect script -verbatim or almost-verbatim for own productions. It's mainly intended for -showing techniques, just using it without modifications or with only light -modifications is what I'd consider "cheap". - -Be aware that this effect is very slow at rendering, at full 720p resolution -it takes around 3 hours to render on my dual 2.2 GHz Opteron. - -This effect is called "OH NOES" by the way. No special meaning to that. - -It's best read from bottom to top. - -]] - - --- Virtual resolution, 720p -local virtual_res_x = 1280 -local virtual_res_y = 720 --- Font names ---local latin_font = "Eras Bold ITC" -local latin_font = "Briem Akademi Std Semibold" -local latin_weight = "" -local kanji_font = "DFGSoGei-W9" --- Font sizes -local romaji_size = 34 -local engrish_size = 36 -local kanji_size = 30 -local tl_size = 36 --- Text positions (vertical only, assumed centered) -local romaji_pos_y = 55 -local tl_pos_y = virtual_res_y - 38 -local kanji_pos_y = virtual_res_y - 27 -local kanji_pos_x = virtual_res_x - 55 -local engrish_pos_y = virtual_res_y - 38 - - -timing_input_file = overlua_datastring -assert(timing_input_file, "OH NOES! Missing timing input file.") - - --- Here's some mostly standard input file parsing functions - -function parsenum(str) - return tonumber(str) or 0 -end -function parse_ass_time(ass) - local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)") - return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600 -end - -function parse_k_timing(text) - local syls = {} - local cleantext = "" - local i = 1 - for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do - local syl = {dur = parsenum(timing)/100, text = syltext, i = i} - local maintext, furitext = syltext:match("(.-)|(.+)") - -- Note that there is a light support for Auto4 style furigana - -- in this script, but I haven't maintained it since it ended up being - -- unused. - if maintext and furitext and furitext ~= "" then - syl.text = maintext - syl.furi = furitext - end - table.insert(syls, syl) - cleantext = cleantext .. syl.text - i = i + 1 - end - return syls, cleantext -end - -function read_input_file(name) - for line in io.lines(name) do - local start_time, end_time, style, fx, text = line:match("Dialogue: 0,(.-),(.-),(.-),,0000,0000,0000,(.-),(.*)") - if text then - local ls = {} - ls.start_time = parse_ass_time(start_time) - ls.end_time = parse_ass_time(end_time) - ls.style = style - ls.fx = fx - ls.rawtext = text - ls.kara, ls.cleantext = parse_k_timing(text) - table.insert(lines, ls) - end - end -end - -function init() - if inited then return end - inited = true - - lines = {} - read_input_file(timing_input_file) -end - - --- Calculate size and position of a line and its syllables --- Only for horizontal lines, not vertical -function calc_line_metrics(ctx, line, font_name, font_size, pos_y) - if line.pos_x then return end - - ctx.select_font_face(font_name, "", latin_weight) - ctx.set_font_size(font_size) - - line.te = ctx.text_extents(line.cleantext) - line.fe = ctx.font_extents() - - line.pos_x = (virtual_res_x - line.te.width) / 2 - line.te.x_bearing - line.pos_y = pos_y - - if #line.kara < 2 then return end - - local curx = line.pos_x - for i, syl in pairs(line.kara) do - syl.te = ctx.text_extents(syl.text) - syl.pos_x = curx - syl.center_x = curx + syl.te.x_bearing + syl.te.width/2 - syl.center_y = pos_y - line.fe.ascent/2 + line.fe.descent/2 - curx = curx + syl.te.x_advance - - if syl.furi then - ctx.set_font_size(font_size/2) - syl.furite = ctx.text_extents(syl.furi) - syl.furife = ctx.font_extents() - ctx.set_font_size(font_size) - syl.furi_x = syl.center_x - syl.furite.width/2 - syl.furite.x_bearing - syl.furi_y = pos_y - line.fe.height - end - end -end - --- Paint the image of a line of text to a cairo context --- Assumes the current path in the context is of the text to be painted -function paint_text(surf, ctx) - ctx.set_line_join("round") - ctx.set_source_rgba(0, 0.2, 0.3, 0.8) - ctx.set_line_width(3) - ctx.stroke_preserve() - raster.gaussian_blur(surf, 1.7) - ctx.set_source_rgba(1, 1, 1, 0.95) - ctx.fill() -end - - --- Render one of the zoomed circles with some parameters --- width and height are of the source area to be visible in the zoomed image --- Some of this is a bit hacked, I just changed stuff around until it worked, --- honestly. Analyse it if you want, it still doesn't fully make sense to me ;) -function make_zoomed_ellipsis(srcsurf, center_x, center_y, width, height) - local factor = 0.7 - - local target_width, target_height = math.ceil(width/factor), math.ceil(height/factor) - - local target = cairo.image_surface_create(target_width, target_height, "argb32") - local targetctx = target.create_context() - - local src_x, src_y = center_x - width/2, center_y - height/2 - - -- The basic premise is just taking the source surface, making an upscaling - -- pattern of it and fill a circle with the correct portion of it. - -- Actually pretty simple, it's just getting the numbers right. - local srcpat = cairo.pattern_create_for_surface(srcsurf) - srcpat.set_extend("none") - local srcpatmatrix = cairo.matrix_create() - srcpatmatrix.init_translate(src_x, src_y) - srcpatmatrix.scale(factor, factor) - srcpat.set_matrix(srcpatmatrix) - - targetctx.scale(target_width, target_height) - targetctx.arc(0.5, 0.5, 0.5, 0, math.pi*2) - targetctx.scale(1/target_width, 1/target_height) - targetctx.set_source(srcpat) - targetctx.fill() - - return target, target_width, target_height -end - - --- Duration in seconds for the fade-in/-outs -local fadeinoutdur = 1.2 - - --- Paint a complete line of karaoke text with all effects, except the --- zoom circles, to a context. It depends on l.textsurf containing the line --- image. --- The main attraction here is the fade-over effect. -function paint_kara_text(f, ctx, t, l) - local fade, fademask, fadetype - -- Check if we're fading in? - if t < l.start_time + fadeinoutdur and l.fx ~= "nofadein" then - -- Calculate the position of the fade - fade = 1 - (l.start_time - t + fadeinoutdur/2) / fadeinoutdur - -- Create a gradient pattern that shows only the relevant part of - -- the line for the fade. - fademask = cairo.pattern_create_linear(virtual_res_x*fade, virtual_res_y/2, virtual_res_x*fade - 100, virtual_res_y/2-30) - fademask.add_color_stop_rgba(0, 1, 1, 1, 0) - fademask.add_color_stop_rgba(0.05, 1, 1, 1, 1) - fademask.add_color_stop_rgba(0.3, 1, 1, 1, 0.2) - fademask.add_color_stop_rgba(1, 1, 1, 1, 1) - fadetype = "in" - end - -- Or fading out? - if l.end_time - fadeinoutdur <= t and l.fx ~= "last" and l.fx~= "nofadeout" then - -- Pretty much the same as for fade in, except that a different part of - -- the line is shown by the produced pattern - fade = (t - l.end_time + fadeinoutdur/2) / fadeinoutdur - fademask = cairo.pattern_create_linear(virtual_res_x*fade, virtual_res_y/2, virtual_res_x*fade + 100, virtual_res_y/2+30) - fademask.add_color_stop_rgba(0, 1, 1, 1, 0) - fademask.add_color_stop_rgba(0.05, 1, 1, 1, 1) - fademask.add_color_stop_rgba(0.3, 1, 1, 1, 0.2) - fademask.add_color_stop_rgba(1, 1, 1, 1, 1) - fadetype = "out" - end - -- Is the line even visible?! - if not fade and (t < l.start_time or l.end_time <= t) then return end - - -- A function that calculates the distance between a point and the fade - -- The distance is calculated only along the X axis, so it's not the - -- shortest distance from the point to the "fade line". - -- Used to determine which side of the fade a point is on. - local function fadedist(x, y) -- on X axis - local fade_x_at_y = virtual_res_x*fade - (y - virtual_res_y/2) * 3/10 - if fadetype == "in" then - return fade_x_at_y - x - else - return x - fade_x_at_y - end - end - - -- We'll be painting the surface with the image of the text - ctx.set_source_surface(l.textsurf, 0, 0) - if fade then - -- So first paint the text with the fading-mask - ctx.mask(fademask) - - -- Now generate a slightly different mask for the bloom effect - -- This one goes "both ways", it's not restricted to just one direction; - -- it gets limited later - local bloommask = cairo.pattern_create_linear(virtual_res_x*fade - 200, virtual_res_y/2-60, virtual_res_x*fade + 200, virtual_res_y/2+60) - bloommask.add_color_stop_rgba(0, 1, 1, 1, 0) - bloommask.add_color_stop_rgba(0.5, 1, 1, 1, 1) - bloommask.add_color_stop_rgba(1, 1, 1, 1, 0) - local bloom = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32") - local bc = bloom.create_context() - bc.set_source_surface(l.textsurf, 0, 0) - bc.mask(fademask) - -- Ok, this could be done in a faster way I bet... modify the colour of - -- the bloom effect depending on whether it's a fade in or out, - -- by running a pixel value mapping program over them. - if fadetype == "out" then - raster.pixel_value_map(bloom, "R 0.9 * =R G 0.1 * =G B 0.4 * =B") - else - raster.pixel_value_map(bloom, "R 0.22 * =R G 0.45 * =G B 0.44 * =B") - end - -- Now, three times, do an additive blending of a successively more - -- blurred version of the masked text. - -- Exploit that the text border is very dark, so it won't contribute - -- much at all to the overall result. - -- If the border was brighter a different image of the text would need - -- to be used instead. - -- This is what *really* kills the rendering speed! - ctx.set_operator("add") - raster.gaussian_blur(bloom, 3) - ctx.set_source_surface(bloom, 0, 0) - ctx.mask(bloommask) - raster.gaussian_blur(bloom, 3) - ctx.set_source_surface(bloom, 0, 0) - ctx.mask(bloommask) - raster.gaussian_blur(bloom, 3) - ctx.set_source_surface(bloom, 0, 0) - ctx.mask(bloommask) - ctx.set_operator("over") - else - -- We aren't fading, just do a plain paint of the text image - ctx.paint() - end - - return fade, fademask, fadetype, fadedist -end - - --- Line style processing functions --- The entries in this table are matched with the line Style fields to pick --- an appropriate handling function for the line. -stylefunc = {} - --- This is a generic handling function called by other functions -function stylefunc.generic(f, ctx, t, l, font_name, font_size, pos_y) - -- Fast return for irrelevant lines - if t < l.start_time - fadeinoutdur/2 then return end - if l.end_time + fadeinoutdur/2 <= t then return end - - -- Make sure we have the positioning information for the line - calc_line_metrics(ctx, l, font_name, font_size, pos_y) - - -- If it's the first time this line is processed, generate the image of it - if not l.textsurf then - -- Create surface for the text image - local textsurf = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32") - local c = textsurf.create_context() - - -- Fill it with a path of the text - c.select_font_face(font_name, "", latin_weight) - c.set_font_size(font_size) - - c.move_to(l.pos_x, l.pos_y) - c.text_path(l.cleantext) - - for i, syl in pairs(l.kara) do - if syl.furi then - c.set_font_size(kanji_size/2) - c.move_to(syl.furi_x, syl.furi_y) - c.text_path(syl.furi) - end - end - - paint_text(textsurf, c) - - l.textsurf = textsurf - end - - -- Check if we're on the last line which needs the "fade all out" effect - if l.fx == "last" and t > l.end_time - 1.5 then - fade_all_out = (l.end_time - t) / 1.5 - else - fade_all_out = nil - end - - -- Put the actual text onto the video image - local fade, fademask, fadetype, fadedist = paint_kara_text(f, ctx, t, l) - - -- Search for a currently highlighted syllable in the text - local sumdur = l.start_time - local cursyl = -1 - for i, syl in pairs(l.kara) do - syl.start_time = sumdur - if t >= sumdur and t < sumdur+syl.dur then - cursyl = i - end - sumdur = sumdur + syl.dur - end - - if cursyl >= 1 then - -- There is a current syllable - -- Figure out where to put the zoom circle - local syl = l.kara[cursyl] - -- Assume it's at the center of the syllable for now - local zoompoint = { - cx = syl.center_x, - cy = syl.center_y, - size = math.max(syl.te.width, syl.te.height) - } - -- But check if we're time-wise close enough to the previous syllable - -- (if there is one) to do a transition from it - local prevsyl - if cursyl >= 2 then - local prevsyli = cursyl - 1 - repeat - prevsyl = l.kara[prevsyli] - prevsyli = prevsyli - 1 - until (prevsyl.dur > 0) - if syl.dur > 0.100 and t - syl.start_time < 0.100 then - local pcx, pcy = prevsyl.center_x, prevsyl.center_y - local psize = math.max(prevsyl.te.width, prevsyl.te.height) - local v = (t - syl.start_time) / 0.100 - local iv = 1 - v - zoompoint.cx = iv * pcx + v * zoompoint.cx - zoompoint.cy = iv * pcy + v * zoompoint.cy - zoompoint.size = iv * psize + v * zoompoint.size - end - elseif cursyl == 1 and syl.dur > 0.100 and t - syl.start_time < 0.100 then - zoompoint.size = zoompoint.size * (t - syl.start_time) / 0.100 - end - zoompoint.size = zoompoint.size * 1.1 - -- Check that we aren't fading over and that the center of the zoom is - -- not outside the visible part of the line. - if not fade or fadedist(zoompoint.cx, zoompoint.cy) > 0 then - -- Insert (enable) the zoom point then - table.insert(zoompoints, zoompoint) - end - end -end - --- The Romaji and Engrish styles are both the same generic thing -function stylefunc.Romaji(f, ctx, t, l) - stylefunc.generic(f, ctx, t, l, latin_font, romaji_size, romaji_pos_y) -end - --- Engrish was used for the somewhat-English lines in the original lyrics --- (I.e. not for the translation.) -function stylefunc.Engrish(f, ctx, t, l) - stylefunc.generic(f, ctx, t, l, latin_font, engrish_size, engrish_pos_y) -end - --- The vertical kanji need a rather different handling -function stylefunc.Kanji(f, ctx, t, l) - -- Again, check for fast skip - if t < l.start_time - fadeinoutdur/2 then return end - if l.end_time + fadeinoutdur/2 <= t then return end - - -- Mostly the same as for the generic handling, except that we also - -- calculate the metrics here. - if not l.textsurf then - local textsurf = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32") - local c = textsurf.create_context() - - c.select_font_face("@"..kanji_font) - c.set_font_size(kanji_size) - - l.te = c.text_extents(l.cleantext) - l.fe = c.font_extents() - - l.pos_x = kanji_pos_x - l.pos_y = (virtual_res_y - l.te.width) / 2 - l.te.x_bearing - - local cury = l.pos_y - for i, syl in pairs(l.kara) do - syl.te = c.text_extents(syl.text) - syl.pos_y = cury - syl.center_y = cury + syl.te.x_bearing + syl.te.width/2 - syl.center_x = kanji_pos_x + l.fe.ascent/2 - l.fe.descent/2 - cury = cury + syl.te.x_advance - end - - c.translate(l.pos_x, l.pos_y) - c.rotate(math.pi/2) - c.move_to(0,0) - c.text_path(l.cleantext) - - paint_text(textsurf, c) - - l.textsurf = textsurf - end - - local fade, fademask, fadetype, fadedist = paint_kara_text(f, ctx, t, l) - - -- Lots of copy-paste (code re-use!) here, slightly adapted for vertical - -- text rather than horizontal stuff. - local sumdur = l.start_time - local cursyl = -1 - for i, syl in pairs(l.kara) do - syl.start_time = sumdur - if t >= sumdur and t < sumdur+syl.dur then - cursyl = i - end - sumdur = sumdur + syl.dur - end - - if cursyl >= 1 then - local syl = l.kara[cursyl] - local zoompoint = { - cx = syl.center_x, - cy = syl.center_y, - size = math.max(syl.te.width, syl.te.height) - } - local prevsyl - if cursyl >= 2 then - local prevsyli = cursyl - 1 - repeat - prevsyl = l.kara[prevsyli] - prevsyli = prevsyli - 1 - until (prevsyl.dur > 0) - if syl.dur > 0.100 and t - syl.start_time < 0.100 then - local pcx, pcy = prevsyl.center_x, prevsyl.center_y - local psize = math.max(prevsyl.te.width, prevsyl.te.height) - local v = (t - syl.start_time) / 0.100 - local iv = 1 - v - zoompoint.cx = iv * pcx + v * zoompoint.cx - zoompoint.cy = iv * pcy + v * zoompoint.cy - zoompoint.size = iv * psize + v * zoompoint.size - end - elseif cursyl == 1 and syl.dur > 0.100 and t - syl.start_time < 0.100 then - zoompoint.size = zoompoint.size * (t - syl.start_time) / 0.100 - end - zoompoint.size = zoompoint.size * 1.1 - if not fade or fadedist(zoompoint.cx, zoompoint.cy) > 0 then - table.insert(zoompoints, zoompoint) - end - end -end - --- The translation lines get a somewhat simplified handling again. --- Originally separated out because some translated lines were split into two --- stacked lines, but that was dropped again. -function stylefunc.TL(f, ctx, t, l) - if t < l.start_time - fadeinoutdur/2 then return end - if l.end_time + fadeinoutdur/2 <= t then return end - - local line1, line2 = l.rawtext, l.rawtext:find("\\n", 1, true) - if line2 then - line1 = l.rawtext:sub(line2+2) - line2 = l.rawtext:sub(1, line2-1) - else - line2 = "" - end - - if not l.textsurf then - local textsurf = cairo.image_surface_create(virtual_res_x, virtual_res_y, "argb32") - local c = textsurf.create_context() - - c.select_font_face(latin_font, "", latin_weight) - c.set_font_size(tl_size) - - l.te1 = c.text_extents(line1) - l.te2 = c.text_extents(line2) - l.fe = c.font_extents() - - l.pos1_x = (virtual_res_x - l.te1.width) / 2 - l.te1.x_bearing - l.pos2_x = (virtual_res_x - l.te2.width) / 2 - l.te2.x_bearing - l.pos1_y = tl_pos_y - l.pos2_y = tl_pos_y - l.fe.height - - c.move_to(l.pos1_x, l.pos1_y) - c.text_path(line1) - c.move_to(l.pos2_x, l.pos2_y) - c.text_path(line2) - - paint_text(textsurf, c) - - l.textsurf = textsurf - end - - paint_kara_text(f, ctx, t, l) -end - - --- Paint a zoom circle onto the video --- zp is one of the zoompoint structures generated in the style functions -function draw_zoompoint(surf, ctx, t, zp) - if zp.size < 5 then return end - - local zoom, zoom_width, zoom_height = make_zoomed_ellipsis(surf, zp.cx, zp.cy, zp.size*1.2, zp.size*1.2) - - local glow = cairo.image_surface_create(zoom_width+50, zoom_height+50, "argb32") - local gc = glow.create_context() - - -- Hue-rotation - -- Based on HSL-to-RGB code from Aegisub - local r, g, b - local cspeed = 1/5 - local sat = 69 - local q = math.floor((cspeed*t) % 6) - local qf = ((cspeed*t) % 6 - q) * (255-sat) - if q == 0 then - r = 255 - g = sat + qf - b = sat - elseif q == 1 then - r = sat + 255 - qf - g = 255 - b = sat - elseif q == 2 then - r = sat - g = 255 - b = sat + qf - elseif q == 3 then - r = sat - g = sat + 255 - qf - b = 255 - elseif q == 4 then - r = sat + qf - g = qf - b = 255 - elseif q == 5 then - r = 255 - g = sat - b = qf + 255 - qf - end - -- Circle-tail-chaser thing - -- Just a bunch of increasingly opaque lines drawn from a center - -- and overlapping enough to create a sense of continuity. - gc.set_line_width(6) - for a = 0, 1, 1/zoom_height do - gc.set_source_rgba(r/255, g/255, b/255, a) - gc.move_to(zoom_width/2+25, zoom_height/2+25) - gc.rel_line_to((zoom_width/2+5) * math.sin(-t*8-a*math.pi*2), (zoom_height/2+5) * math.cos(-t*8-a*math.pi*2)) - gc.stroke() - end - -- Love gaussian blur! - raster.gaussian_blur(glow, 2) - - -- Use additive blend to put the tail-chaser onto the video - ctx.set_source_surface(glow, zp.cx-zoom_width/2-25, zp.cy-zoom_height/2-25) - local oldop = ctx.get_operator() - ctx.set_operator("add") - ctx.paint() - ctx.set_operator(oldop) - - -- And regular blend for the zoom circle - ctx.set_source_surface(zoom, zp.cx-zoom_width/2, zp.cy-zoom_height/2) - ctx.paint() -end - - -function render_frame(f, t) - -- Make sure we're initialised - init() - - -- Clear the list of zoom points - zoompoints = {} - - -- Create a surface and context from the video - local worksurf = f.create_cairo_surface() - local workctx = worksurf.create_context() - -- This should make it possible to render on different resolution videos, - -- but I don't think it works - workctx.scale(f.width / virtual_res_x, f.height / virtual_res_y) - - -- Run over each input line, processing it - -- This will draw the main text and transition effects - for i, line in pairs(lines) do - if stylefunc[line.style] then - stylefunc[line.style](worksurf, workctx, t, line) - end - end - - -- Then go over the zoom points and draw those on top - -- If this isn't done after all lines have been drawn, lines that are close - -- to each other could end up overlapping each others' zoom circles. - for i, zp in pairs(zoompoints) do - draw_zoompoint(worksurf, workctx, t, zp) - end - - -- If we're fading it all out, make the karaoke less visible by doing - -- an alpha paint over with the original video frame. - if fade_all_out then - local vidsurf = f.create_cairo_surface() - workctx.set_source_surface(vidsurf, 0, 0) - workctx.paint_with_alpha(1-fade_all_out) - end - - -- Finally put the video frame back - f.overlay_cairo_surface(worksurf, 0, 0) -end diff --git a/devel/OverLua/docs/sample4.lua b/devel/OverLua/docs/sample4.lua deleted file mode 100644 index 1f8cb9563..000000000 --- a/devel/OverLua/docs/sample4.lua +++ /dev/null @@ -1,432 +0,0 @@ ---[[ - -Sample script for OverLua - - advanced karaoke effect, Prism Ark OP kara effect for Anime-Share Fansubs - -Given into the public domain. -(You can do anything you want with this file, with no restrictions whatsoever. - You don't get any warranties of any kind either, though.) - -Originally authored by Niels Martin Hansen. - -Not an extremely advanced effect, but showcases improved parsing of ASS files -and using information from the Style lines for the styling information. - -Pretty fast to render at SD resolutions. - -As for other effects, please consider that it's not much fun to just re-use -an effect someone else wrote, especially not verbatim. If you elect to use -this sample for something, I ask you to do something original with it. I -can't force you, but please :) - -I'm leaving several sections of this script mostly unexplained, because I've -for a large part copied those from the Gundam 00 OP 1 effect (sample3) I did -a few days before this one. -Please see sample3.lua for explanations of those, if you need them. - -]] - ----- START CONFIGURATION ---- - --- Duration of line fade-in/outs, in seconds -local line_fade_duration = 0.5 --- Minimum duration of highlights, also seconds -local syl_highlight_duration = 0.5 - ----- END CONFIGURATION ---- - - --- Trim spaces from beginning and end of string -function string.trim(s) - return (string.gsub(s, "^%s*(.-)%s*$", "%1")) -end - - --- Script and video resolutions -local sres_x, sres_y -local vres_x, vres_y - --- Stuff read from style definitions -local font_name = {} -local font_size = {} -local font_bold = {} -local font_italic = {} -local pos_v = {} -local vertical = {} -local color1, color2, color3, color4 = {}, {}, {}, {} - --- Input lines -local lines = {} - - --- Read input file -function read_field(ass_line, num) - local val, rest = ass_line:match("(.-),(.*)") - if not rest then - return ass_line, "" - elseif num > 1 then - return val, read_field(rest, num-1) - else - return val, rest - end -end -function parsenum(str) - return tonumber(str) or 0 -end -function parse_ass_time(ass) - local h, m, s, cs = ass:match("(%d+):(%d+):(%d+)%.(%d+)") - return parsenum(cs)/100 + parsenum(s) + parsenum(m)*60 + parsenum(h)*3600 -end -function parse_style_color(color) - local res = {r = 0, g = 0, b = 0, a = 0} - local a, b, g, r = color:match("&H(%x%x)(%x%x)(%x%x)(%x%x)") - res.r = tonumber(r, 16) / 255 - res.g = tonumber(g, 16) / 255 - res.b = tonumber(b, 16) / 255 - res.a = 1 - tonumber(a, 16) / 255 -- Alpha has inverse meaning in ASS and cairo - return res -end - -function parse_k_timing(text, start_time) - local syls = {} - local cleantext = "" - local i = 1 - local curtime = start_time - for timing, syltext in text:gmatch("{\\k(%d+)}([^{]*)") do - local syl = {} - syl.dur = parsenum(timing)/100 - syl.text = syltext - syl.i = i - syl.start_time = curtime - syl.end_time = curtime + syl.dur - table.insert(syls, syl) - cleantext = cleantext .. syl.text - i = i + 1 - curtime = curtime + syl.dur - end - if cleantext == "" then - cleantext = text - end - return syls, cleantext -end - -function read_input_file(name) - for line in io.lines(name) do - -- Try PlayResX/PlayResY - local playresx = line:match("^PlayResX: (.*)") - if playresx then - sres_x = parsenum(playresx) - end - local playresy = line:match("^PlayResY: (.*)") - if playresy then - sres_y = parsenum(playresy) - end - - -- Try dialogue line - -- Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text - local dialogue_line = line:match("^Dialogue:(.*)") - if dialogue_line then - local layer, start_time, end_time, style, actor, margin_l, margin_r, margin_v, effect, text = read_field(dialogue_line, 9) - local ls = {} - ls.layer = parsenum(layer) - ls.start_time = parse_ass_time(start_time) - ls.end_time = parse_ass_time(end_time) - ls.style = style:trim() - ls.actor = actor:trim() - ls.effect = effect:trim() - ls.rawtext = text - ls.kara, ls.cleantext = parse_k_timing(text, ls.start_time) - - table.insert(lines, ls) - end - - -- Try style line - -- Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding - local style_line = line:match("^Style:(.*)") - if style_line then - local name, font, size, c1, c2, c3, c4, bold, italic, underline, overstrike, scalex, scaley, spacing, angle, borderstyle, outline, shadow, alignment, margin_l, margin_r, margin_v, encoding = read_field(style_line, 22) - -- Direct data - name = name:trim() - font_name[name] = font:trim() - font_size[name] = parsenum(size) - color1[name] = parse_style_color(c1) - color2[name] = parse_style_color(c2) - color3[name] = parse_style_color(c3) - color4[name] = parse_style_color(c4) - font_bold[name] = (parsenum(bold) ~= 0) and "bold" or "" - font_italic[name] = (parsenum(italic) ~= 0) and "italic" or "" - - -- Derived data - if font:match("@") then - vertical[name] = true - end - alignment = parsenum(alignment) - if alignment <= 3 then - if vertical[name] then - pos_v[name] = sres_x - parsenum(margin_v) - else - pos_v[name] = sres_y - parsenum(margin_v) - end - elseif alignment <= 6 then - if vertical[name] then - pos_v[name] = sres_x / 2 - else - pos_v[name] = sres_y / 2 - end - else - pos_v[name] = parsenum(margin_v) - end - end - end -end - -function init(f) - if inited then return end - inited = true - - vres_x = f.width - vres_y = f.height - read_input_file(overlua_datastring) -end - - --- Mask for noise over background -local noisemask, noisemaskctx, noisemaskfilled --- Additional images to overlay the frame -local frame_overlays = {} - - --- Calculate size and position of a line and its syllables -function calc_line_metrics(ctx, line) - if line.pos_x then return end - - assert(font_name[line.style], "No font name for style " .. line.style) - ctx.select_font_face(font_name[line.style], font_italic[line.style], font_bold[line.style]) - ctx.set_font_size(font_size[line.style]) - - line.te = ctx.text_extents(line.cleantext) - line.fe = ctx.font_extents() - - if vertical[line.style] then - line.pos_x = pos_v[line.style] - line.pos_y = (sres_y - line.te.width) / 2 - line.te.x_bearing - else - line.pos_x = (sres_x - line.te.width) / 2 - line.te.x_bearing - line.pos_y = pos_v[line.style] - end - - if #line.kara < 2 then return end - - local curx = line.pos_x - local cury = line.pos_y - for i, syl in pairs(line.kara) do - syl.te = ctx.text_extents(syl.text) - if vertical[line.style] then - syl.pos_x = line.pos_x - syl.pos_y = cury - syl.center_x = syl.pos_x + syl.te.x_bearing + syl.te.width/2 - syl.center_y = cury - line.fe.ascent/2 + line.fe.descent/2 - else - syl.pos_x = curx - syl.pos_y = line.pos_y - syl.center_x = curx + syl.te.x_bearing + syl.te.width/2 - syl.center_y = syl.pos_y - line.fe.ascent/2 + line.fe.descent/2 - end - curx = curx + syl.te.x_advance - cury = cury + syl.te.x_advance - end -end - - --- Style handling functions -local stylefunc = {} - -function stylefunc.generic(t, line) - if not line.textsurf then - line.textsurf = cairo.image_surface_create(sres_x, sres_y, "argb32") - local c = line.textsurf.create_context() - - c.select_font_face(font_name[line.style], font_italic[line.style], font_bold[line.style]) - c.set_font_size(font_size[line.style]) - - if vertical[line.style] then - c.translate(line.pos_x, line.pos_y) - c.rotate(math.pi/2) - c.move_to(0,0) - else - c.move_to(line.pos_x, line.pos_y) - end - c.text_path(line.cleantext) - - local c1, c3 = color1[line.style], color3[line.style] - c.set_source_rgba(c1.r, c1.g, c1.b, c1.a) - c.set_line_join("round") - c.set_line_width(4) - c.stroke_preserve() - c.set_source_rgba(c3.r, c3.g, c3.b, c3.a) - c.fill() - end - - -- Fade-factor (alpha for line) - local fade = 0 - - if t < line.start_time and t >= line.start_time - line_fade_duration then - fade = 1 - (line.start_time - t) / line_fade_duration - elseif t >= line.end_time and t < line.end_time + line_fade_duration then - fade = 1 - (t - line.end_time) / line_fade_duration - elseif t >= line.start_time and t < line.end_time then - fade = 1 - else - fade = 0 - end - - if fade > 0 then - local lo = {} -- line overlay - lo.surf = line.textsurf - lo.x, lo.y = 0, 0 - lo.alpha = 0.85 * fade - lo.operator = "over" - lo.name = "line" - table.insert(frame_overlays, lo) - - noisemaskctx.set_source_surface(line.textsurf, 0, 0) - noisemaskctx.paint_with_alpha(fade) - noisemaskfilled = true - end - - for i, syl in pairs(line.kara) do - if syl.end_time < syl.start_time + syl_highlight_duration then - syl.end_time = syl.start_time + syl_highlight_duration - end - - if t >= syl.start_time and t < syl.end_time then - local sw, sh = syl.te.width*3, line.fe.height*3 - if vertical[line.style] then - sw, sh = sh, sw - end - - local fade = (syl.end_time - t) / (syl.end_time - syl.start_time) - - local surf = cairo.image_surface_create(sw, sh, "argb32") - local ctx = surf.create_context() - - ctx.select_font_face(font_name[line.style], font_italic[line.style], font_bold[line.style]) - ctx.set_font_size(font_size[line.style]*2) - - local te, fe = ctx.text_extents(syl.text), ctx.font_extents() - - local rx, ry = (sw - te.width) / 2 + te.x_bearing, (sh - fe.height) / 2 + fe.ascent - assert(not vertical[line.style], "Can't handle vertical kara in syllable highlight code - poke jfs if you need this") - - ctx.move_to(rx, ry) - ctx.text_path(syl.text) - - local path = ctx.copy_path() - local function modpath(x, y) - local cx = math.sin(y/sh*math.pi) - local cy = math.sin(x/sw*math.pi) - cx = cx * x + (1-cx)/2*sw - cy = cy * y + (1-cy)/2*sh - return fade*x+(1-fade)*cx, fade*y+(1-fade)*cy - end - path.map_coords(modpath) - ctx.new_path() - ctx.append_path(path) - - local c2, c3 = color2[line.style], color3[line.style] - - for b = 8, 1, -3 do - local bs = cairo.image_surface_create(sw, sh, "argb32") - local bc = bs.create_context() - bc.set_source_rgba(c2.r, c2.g, c2.b, c2.a) - bc.append_path(path) - bc.fill() - raster.gaussian_blur(bs, b) - local bo = {} - bo.surf = bs - bo.x = syl.center_x - sw/2 - bo.y = syl.center_y - sh/2 - bo.alpha = fade - bo.operator = "add" - bo.name = "blur " .. b - table.insert(frame_overlays, bo) - end - - ctx.set_source_rgba(c3.r, c3.g, c3.b, c3.a) - ctx.set_line_join("round") - ctx.set_operator("over") - ctx.set_line_width(3*fade) - ctx.stroke_preserve() - ctx.set_operator("dest_out") - ctx.fill() - raster.box_blur(surf, 3, 2) - - local so = {} - so.surf = surf - so.x = syl.center_x - sw/2 - so.y = syl.center_y - sh/2 - so.alpha = 1 - so.operator = "over" - so.name = string.format("bord %s %.1f %.1f (%.1f,%.1f)", syl.text, sw, sh, rx, ry) - table.insert(frame_overlays, so) - end - end -end - -stylefunc.Romaji = stylefunc.generic -stylefunc.Kanji = stylefunc.generic -stylefunc.English = stylefunc.generic - - --- Main rendering function -function render_frame(f, t) - init(f) - - local surf = f.create_cairo_surface() - local ctx = surf.create_context() - ctx.scale(vres_x/sres_x, vres_y/sres_y) - - -- The line rendering functions add the mask of the line they rendered to - -- this image. It will be used to draw the glow around all lines. - -- It has to be done in this way to avoid the glows from nearby lines to - -- interfere and produce double effect. - noisemask = cairo.image_surface_create(sres_x, sres_y, "argb32") - noisemaskctx = noisemask.create_context() - -- Set to true as soon as anything is put into the noise mask - -- This is merely an optimisation to avoid doing anything when there aren't - -- any lines on screen. - noisemaskfilled = false - -- List of images to overlay on the video frame, after the noise mask. - frame_overlays = {} - - for i, line in pairs(lines) do - if stylefunc[line.style] then - calc_line_metrics(ctx, line) - stylefunc[line.style](t, line) - end - end - - if noisemaskfilled then - -- Greenish and jittery version of the frame - local noiseimg = f.create_cairo_surface() - raster.box_blur(noiseimg, 5, 2) - raster.pixel_value_map(noiseimg, "G rand 0.4 * + =G G 1 - 1 G ifgtz =G") - -- Blurred version of the noisemask - raster.gaussian_blur(noisemask, 8) - -- Mask additive paint the noise mask: only show the area near the text - -- and have it do interesting things with the video. - ctx.set_source_surface(noiseimg, 0, 0) - ctx.set_operator("add") - ctx.mask_surface(noisemask, 0, 0) - end - - -- Paint generated overlays onto the video. - for i, o in pairs(frame_overlays) do - ctx.set_source_surface(o.surf, o.x, o.y) - ctx.set_operator(o.operator) - ctx.paint_with_alpha(o.alpha) - end - - f.overlay_cairo_surface(surf, 0, 0) -end - diff --git a/devel/OverLua/docs/test1.lua b/devel/OverLua/docs/test1.lua deleted file mode 100644 index 476798839..000000000 --- a/devel/OverLua/docs/test1.lua +++ /dev/null @@ -1,14 +0,0 @@ -function render_frame(f, t) - local w, h = f.width, f.height - for x = 0, 20 do - for y = 0, 20 do - f[y*w+x] = {x*10,y*10,255} - end - end - for x = 21, 40 do - for y = 0, h-1 do - local r, g, b = f(x,y) - f[y*w+x] = {255-r, 255-g, 255-b} - end - end -end diff --git a/devel/OverLua/docs/test2.lua b/devel/OverLua/docs/test2.lua deleted file mode 100644 index a39dc4407..000000000 --- a/devel/OverLua/docs/test2.lua +++ /dev/null @@ -1,42 +0,0 @@ -function render_frame(f, t) - --local surf = cairo.image_surface_create(200,200,"argb32") - local surf = f.create_cairo_surface() - local ctx = surf.create_context() - - ctx.set_source_rgba(1, 0.5, 0.5, 0.75) - ctx.move_to(10, 10) - ctx.line_to(10, 200) - ctx.line_to(300, 10) - ctx.close_path() - ctx.fill_preserve() - ctx.set_source_rgba(0,0,0,1) - ctx.stroke() - - ctx.push_group() - ctx.select_font_face("Arial", "italic", "") - ctx.set_font_size(35) - ctx.move_to(100,100) - ctx.text_path(string.format("Time: %.3fs", t)) - ctx.set_source_rgba(0,1,0,0.8) - ctx.set_line_width(4) - ctx.stroke_preserve() - ctx.set_source_rgba(0,0,1,1) - ctx.fill() - ctx.pop_group_to_source() - ctx.paint_with_alpha(0.5) - - f.overlay_cairo_surface(surf, 0, 0) - - surf = cairo.image_surface_create(400, 200, "argb32") - ctx = surf.create_context() - ctx.select_font_face("Arial", "", "bold") - ctx.set_source_rgba(1, 1, 1, 1) - ctx.set_font_size(40) - ctx.move_to(100, 100) - ctx.text_path("OverLua") - ctx.fill() - - raster.directional_blur(surf, t, 5) - - f.overlay_cairo_surface(surf, 200, 50) -end diff --git a/devel/OverLua/docs/test3.lua b/devel/OverLua/docs/test3.lua deleted file mode 100644 index 1a0ce61b6..000000000 --- a/devel/OverLua/docs/test3.lua +++ /dev/null @@ -1,15 +0,0 @@ -function render_frame(f, t) - local surf = f.create_cairo_surface() - --raster.gaussian_blur(surf, t)--1+(1-math.cos(t*10))*2) - --raster.invert(surf) - --raster.separable_filter(surf, {-1, 3, -1}, 1) - --raster.directional_blur(surf, t, t/10) - --raster.radial_blur(surf, 200, 200, t/60) - raster.pixel_value_map(surf, "G rand 0.1 * + =G G 1 - 1 G ifgtz =G") - raster.pixel_coord_map(surf, "X .5 rand - + =X Y .5 rand - + =Y") - f.overlay_cairo_surface(surf, 0, 0) - - --surf = cairo.image_surface_create(200, 200, "rgb24") - --raster.pixel_value_map(surf, "rand =t0 t0 =R t0 =G t0 =B") - --f.overlay_cairo_surface(surf, 20, 20) -end diff --git a/devel/OverLua/docs/test4.lua b/devel/OverLua/docs/test4.lua deleted file mode 100644 index 57e507671..000000000 --- a/devel/OverLua/docs/test4.lua +++ /dev/null @@ -1,65 +0,0 @@ -function render_frame(f, t) - -- Some data - local basex, basey = 100, 100 - local thetext = overlua_datastring or "OverLua R0xx0rz?" - - -- Create a new blank surface to draw on - local surf = cairo.image_surface_create(f.width, f.height, "argb32") - -- And a context to go with it. Drawing happens through the context. - local c = surf.create_context() - - -- The source video is 16:9 anamorphic, so create a scaling matrix - local scaling = cairo.matrix_create() - scaling.init_scale(f.width/853, f.height/480) - -- And set it for the surface - c.set_matrix(scaling) - - -- Create a surface of the video frame... - local fs = f.create_cairo_surface() - -- .. and blur it a bit - raster.gaussian_blur(fs, 2) - -- Then create a pattern from it, that can be used for filling shapes with - local fspattern = cairo.pattern_create_for_surface(fs) - -- Also apply the scaling matrix to the pattern - fspattern.set_matrix(scaling) - - -- Prepare a few things - c.select_font_face("Gill Sans Std UltraBold", "", "bold") - c.set_font_size(42) - c.set_line_width(4) - c.set_line_join("round") - - -- First stroke the text a bit above and to the left of main - c.move_to(basex-2, basey-2) - c.set_source_rgba(0.8, 0.8, 1, 0.8) - c.text_path(thetext) - c.stroke() - - -- Then a bit below and to the right, so it overlaps the first stroking a bit - c.move_to(basex+2, basey+2) - c.set_source_rgba(0.4, 0.4, 0.5, 0.8) - c.text_path(thetext) - c.stroke() - - -- And blur them both together, also softening the border - raster.gaussian_blur(surf, 3) - - -- Now prepare the main text fill and the real location - c.move_to(basex, basey) - c.text_path(thetext) - -- First a thing black outline - c.set_source_rgba(0, 0, 0, 1) - c.set_line_width(2) - c.stroke_preserve() -- _preserve version to keep the outline - -- Then use the blurred video frame as fill source - c.set_source(fspattern) - c.fill_preserve() - -- And create a very dark colour - -- Adding this on top of the first fill will create a reddening effect - c.set_source_rgba(0.1, 0, 0, 1) - c.set_operator("add") - c.fill() - - -- Finally draw the surface onto the video - f.overlay_cairo_surface(surf, 0, 0) -end diff --git a/devel/OverLua/expression_engine.cpp b/devel/OverLua/expression_engine.cpp deleted file mode 100644 index 86191ed0e..000000000 --- a/devel/OverLua/expression_engine.cpp +++ /dev/null @@ -1,573 +0,0 @@ -/* - * OverLua expression engine - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - - -#include "expression_engine.h" -#include - - -namespace ExpressionEngine { - - // Builtin functions - - static bool f_abs(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(fabs(v)); - return true; - } else { - return false; - } - } - static const Function fs_abs = {"abs", f_abs}; - - static bool f_floor(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(floor(v)); - return true; - } else { - return false; - } - } - static const Function fs_floor = {"floor", f_floor}; - - static bool f_ceil(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(ceil(v)); - return true; - } else { - return false; - } - } - static const Function fs_ceil = {"ceil", f_ceil}; - - static bool f_log(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(log(v)); - return true; - } else { - return false; - } - } - static const Function fs_log = {"log", f_log}; - - static bool f_exp(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(exp(v)); - return true; - } else { - return false; - } - } - static const Function fs_exp = {"exp", f_exp}; - - static bool f_sqrt(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(sqrt(v)); - return true; - } else { - return false; - } - } - static const Function fs_sqrt = {"sqrt", f_sqrt}; - - static bool f_e(Stack &stack, void *data) - { - stack.push_back(2.71828182845904523536); - return true; - } - static const Function fs_e = {"e", f_e}; - - static bool f_min(Stack &stack, void *data) - { - if (stack.size() >= 2) { - double v1 = stack.back(); - stack.pop_back(); - double v2 = stack.back(); - stack.pop_back(); - if (v1 < v2) - stack.push_back(v1); - else - stack.push_back(v2); - return true; - } else { - return false; - } - } - static const Function fs_min = {"min", f_min}; - - static bool f_max(Stack &stack, void *data) - { - if (stack.size() >= 2) { - double v1 = stack.back(); - stack.pop_back(); - double v2 = stack.back(); - stack.pop_back(); - if (v1 > v2) - stack.push_back(v1); - else - stack.push_back(v2); - return true; - } else { - return false; - } - } - static const Function fs_max = {"max", f_max}; - - static bool f_pi(Stack &stack, void *data) - { - stack.push_back(3.14159265358979323846); - return true; - } - static const Function fs_pi = {"pi", f_pi}; - - static bool f_sin(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(sin(v)); - return true; - } else { - return false; - } - } - static const Function fs_sin = {"sin", f_sin}; - - static bool f_cos(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(cos(v)); - return true; - } else { - return false; - } - } - static const Function fs_cos = {"cos", f_cos}; - - static bool f_tan(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(tan(v)); - return true; - } else { - return false; - } - } - static const Function fs_tan = {"tan", f_tan}; - - static bool f_asin(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(asin(v)); - return true; - } else { - return false; - } - } - static const Function fs_asin = {"asin", f_asin}; - - static bool f_acos(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(acos(v)); - return true; - } else { - return false; - } - } - static const Function fs_acos = {"acos", f_acos}; - - static bool f_atan(Stack &stack, void *data) - { - if (stack.size() >= 1) { - double v = stack.back(); - stack.pop_back(); - stack.push_back(atan(v)); - return true; - } else { - return false; - } - } - static const Function fs_atan = {"atan", f_atan}; - - static bool f_mod(Stack &stack, void *data) - { - if (stack.size() >= 2) { - double v1 = stack.back(); - stack.pop_back(); - double v2 = stack.back(); - stack.pop_back(); - stack.push_back(fmod(v2, v1)); - return true; - } else { - return false; - } - } - static const Function fs_mod = {"mod", f_mod}; - - static bool f_rand(Stack &stack, void *data) - { - stack.push_back((double)rand()/RAND_MAX); - return true; - } - static const Function fs_rand = {"rand", f_rand}; - - static bool f_ifgtz(Stack &stack, void *data) - { - if (stack.size() >= 3) { - double v1 = stack.back(); - stack.pop_back(); - double v2 = stack.back(); - stack.pop_back(); - double v3 = stack.back(); - stack.pop_back(); - if (v3 > 0) - stack.push_back(v2); - else - stack.push_back(v1); - return true; - } else { - return false; - } - } - static const Function fs_ifgtz = {"ifgtz", f_ifgtz}; - - static bool f_ifeqz(Stack &stack, void *data) - { - if (stack.size() >= 3) { - double v1 = stack.back(); - stack.pop_back(); - double v2 = stack.back(); - stack.pop_back(); - double v3 = stack.back(); - stack.pop_back(); - if (v3 == 0) - stack.push_back(v2); - else - stack.push_back(v1); - return true; - } else { - return false; - } - } - static const Function fs_ifeqz = {"ifeqz", f_ifeqz}; - - - // Machine specification - - Specification::Specification() - { - // Add standard functions - functions.push_back(fs_abs); - functions.push_back(fs_floor); - functions.push_back(fs_ceil); - functions.push_back(fs_log); - functions.push_back(fs_exp); - functions.push_back(fs_sqrt); - functions.push_back(fs_e); - functions.push_back(fs_min); - functions.push_back(fs_max); - functions.push_back(fs_pi); - functions.push_back(fs_sin); - functions.push_back(fs_cos); - functions.push_back(fs_tan); - functions.push_back(fs_asin); - functions.push_back(fs_acos); - functions.push_back(fs_atan); - functions.push_back(fs_mod); - functions.push_back(fs_rand); - functions.push_back(fs_ifgtz); - functions.push_back(fs_ifeqz); - } - - - // Machine runner - - bool Machine::Run() - { - // Prepare the stack - std::vector stack; - stack.reserve(16); - - // Assume the registers are already initialised like the manager wants - - // Execute the program - for (size_t pc = 0; pc < program.size(); pc++) { - Instruction &i = program[pc]; - switch (i.op) { - double v1, v2; // values for operators; - - case INST_PUSH_CONST: - stack.push_back(i.vd); - break; - - case INST_PUSH_REG: - stack.push_back(registers[i.vu]); - break; - - case INST_ADD: - if (stack.size() < 2) return false; - v1 = stack.back(); stack.pop_back(); - v2 = stack.back(); stack.pop_back(); - stack.push_back(v2+v1); - break; - - case INST_SUB: - if (stack.size() < 2) return false; - v1 = stack.back(); stack.pop_back(); - v2 = stack.back(); stack.pop_back(); - stack.push_back(v2-v1); - break; - - case INST_MUL: - if (stack.size() < 2) return false; - v1 = stack.back(); stack.pop_back(); - v2 = stack.back(); stack.pop_back(); - stack.push_back(v2*v1); - break; - - case INST_DIV: - if (stack.size() < 2) return false; - v1 = stack.back(); stack.pop_back(); - v2 = stack.back(); stack.pop_back(); - stack.push_back(v2/v1); - break; - - case INST_POW: - if (stack.size() < 2) return false; - v1 = stack.back(); stack.pop_back(); - v2 = stack.back(); stack.pop_back(); - stack.push_back(pow(v2, v1)); - break; - - case INST_UNM: - if (stack.size() < 1) return false; - v1 = stack.back(); stack.pop_back(); - stack.push_back(-v1); - break; - - case INST_CALL: - if (!i.vf(stack, i.vfd)) - return false; - break; - - case INST_STORE: - if (stack.size() < 1) return false; - v1 = stack.back(); stack.pop_back(); - registers[i.vu] = v1; - break; - - default: - return false; - } - } - - // The registers should now be in the final state - - return true; - } - - static const char *parse_register_name(const char *source, const std::vector ®isters, size_t &index) - { - // Find end of the potential register name - // That is, end of string or whitespace - const char *end = source; - while (*end && *end != ' ' && *end != '\t' && *end != '\n' && *end != '\r') end++; - // Now end points to one past last character in name - - std::string regname(source, end-source); - - if (regname.size() == 0) return 0; - - // Check for supplied register name - for (size_t i = 0; i < registers.size(); i++) { - if (regname == registers[i]) { - index = i; - return end; - } - } - - // Check for temp register name - if (regname[0] == 't' && regname.size() == 2) { - if (regname[1] >= '0' && regname[1] <= '9') { - index = registers.size() + regname[1] - '0'; - return end; - } - } - - // Nothing matches - return 0; - } - - static const char *parse_function_name(const char *source, const std::vector &functions, FunctionPtr &funcptr, void *&funcdata) - { - // Find end of the potential function name - // That is, end of string or whitespace - const char *end = source; - while (*end && *end != ' ' && *end != '\t' && *end != '\n' && *end != '\r') end++; - // Now end points to one past last character in name - - std::string funcname(source, end-source); - - if (funcname.size() == 0) return 0; - - // Check for supplied register name - for (size_t i = 0; i < functions.size(); i++) { - if (funcname == functions[i].name) { - funcptr = functions[i].function; - funcdata = functions[i].data; - return end; - } - } - - return 0; - } - - Machine::Machine(const ExpressionEngine::Specification &spec, const char *source) - { - // Set up the registers - const size_t temp_register_count = 10; - registers.resize(spec.registers.size() + temp_register_count); - - program.reserve(64); - - // Parse the program - while (*source) { - Instruction i; - - // Skip whitespace - while (*source && (*source == ' ' || *source == '\t' || *source == '\n' || *source == '\r')) source++; - if (!*source) break; - - // First see if it can be read as a number constant - { - char *tmp = 0; - double v = strtod(source, &tmp); - if (tmp && source != tmp) { - // Could be read, so we have a constant here - source = tmp; - i.op = INST_PUSH_CONST; - i.vd = v; - program.push_back(i); - continue; - } - } - - // Not a number constant - // Check for arithmetic operator - if (*source == '+') { - source++; - i.op = INST_ADD; - program.push_back(i); - } - else if (*source == '-') { - source++; - i.op = INST_SUB; - program.push_back(i); - } - else if (*source == '*') { - source++; - i.op = INST_MUL; - program.push_back(i); - } - else if (*source == '/') { - source++; - i.op = INST_DIV; - program.push_back(i); - } - else if (*source == '^') { - source++; - i.op = INST_POW; - program.push_back(i); - } - else if (*source == '~') { - source++; - i.op = INST_UNM; - program.push_back(i); - } - // Check for assignment - else if (*source == '=') { - i.op = INST_STORE; - const char *tmp = parse_register_name(source+1, spec.registers, i.vu); - if (!tmp) throw source; // No register name found, error - source = tmp; - program.push_back(i); - } - // Register push or function call - else { - const char *tmp = parse_register_name(source, spec.registers, i.vu); - if (tmp) { - // Register push - i.op = INST_PUSH_REG; - source = tmp; - program.push_back(i); - } - else { - tmp = parse_function_name(source, spec.functions, i.vf, i.vfd); - if (tmp) { - // Function call - i.op = INST_CALL; - source = tmp; - program.push_back(i); - } - else { - // Nothing, error - throw source; - } - } - } - - } /* end while */ - - } /* end Machine::Machine() */ - -}; diff --git a/devel/OverLua/expression_engine.h b/devel/OverLua/expression_engine.h deleted file mode 100644 index 442cbf844..000000000 --- a/devel/OverLua/expression_engine.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * OverLua expression engine - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#ifndef EXPRESSION_ENGINE_H -#define EXPRESSION_ENGINE_H - -#include -#include - - -namespace ExpressionEngine { - - // The stack passed around - typedef std::vector Stack; - - // Type of callable functions - typedef bool (*FunctionPtr)(Stack &stack, void *data); - - // A callable function - struct Function { - // The name of the function - const char *name; - // Function pointer; null for builtins - FunctionPtr function; - // Function data - void *data; - }; - - // A machine specification that can compile programs - struct Specification { - // The input and output register names - // The index of a register name in this vector translates to the register's number in the machine - std::vector registers; - - // The callable functions - std::vector functions; - - // Just adds standard functions to functions vector - Specification(); - }; - - // Operation type - enum Opcode { - INST_PUSH_CONST = 0, - INST_PUSH_REG, - INST_ADD, - INST_SUB, - INST_MUL, - INST_DIV, - INST_POW, - INST_UNM, // unary minus - INST_CALL, - INST_STORE - }; - - // A single program instruction - struct Instruction { - Opcode op; - union { - double vd; // double value, for const push - size_t vu; // uint value, for register indices - struct { - FunctionPtr vf; // function to call - void *vfd; // data for function - }; - }; - }; - - // A program is a sequence of instructions - typedef std::vector Program; - - // A machine running a program - struct Machine { - // Values in the registers - std::vector registers; - // The program - Program program; - - // Run the machine. - // Return true is no errors, false if error - bool Run(); - - // Create a machine from a specification and a program source - Machine(const Specification &spec, const char *source); - - // Create a blank machine - Machine() { } - }; - -}; - - -#endif diff --git a/devel/OverLua/image.h b/devel/OverLua/image.h deleted file mode 100644 index b2723909d..000000000 --- a/devel/OverLua/image.h +++ /dev/null @@ -1,668 +0,0 @@ -/* - * OverLua RGB(A) image interface - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#ifndef VIDEO_FRAME_H -#define VIDEO_FRAME_H - -#include "../lua51/src/lua.h" -#include "../lua51/src/lauxlib.h" -#include "cairo_wrap.h" -#include -#include -#include -#include -#include -#include - - -// Forward -class BaseImageAggregate; - - -// Supported pixel formats -namespace PixelFormat { - // A constant value with a fake assignment operator, taking up no space - template - struct NopAssigningConstant { - operator T() const { return v; } - void operator = (const T &n) { } - }; - typedef NopAssigningConstant ROA; // "read only alpha" - typedef NopAssigningConstant ROC; // "read only colour" - - // 24 bit formats - struct RGB { - uint8_t r, g, b; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline ROA A() const { return ROA(); } - RGB() : r(0), g(0), b(0) { } - template RGB(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); } - }; - struct BGR { - uint8_t b, g, r; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline ROA A() const { return ROA(); } - BGR() : r(0), g(0), b(0) { } - template BGR(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); } - }; - - // 32 bit alpha-less formats - struct RGBX { - uint8_t r, g, b, x; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline ROA A() const { return ROA(); } - RGBX() : r(0), g(0), b(0) { } - template RGBX(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); } - }; - struct BGRX { - uint8_t b, g, r, x; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline ROA A() const { return ROA(); } - BGRX() : r(0), g(0), b(0) { } - template BGRX(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); } - }; - struct XRGB { - uint8_t x, r, g, b; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline ROA A() const { return ROA(); } - XRGB() : r(0), g(0), b(0) { } - template XRGB(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); } - }; - struct XBGR { - uint8_t x, b, g, r; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline ROA A() const { return ROA(); } - XBGR() : r(0), g(0), b(0) { } - template XBGR(const PixFmt &src) { r = src.R(); g = src.G(); b = src.B(); } - }; - - // 32 bit with alpha - struct RGBA { - uint8_t r, g, b, a; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline uint8_t &A() { return a; } inline uint8_t A() const { return a; } - RGBA() : r(0), g(0), b(0), a(0) { } - template RGBA(const PixFmt &src) { a = src.a; r = src.r; g = src.g; b = src.b; } - }; - struct BGRA { - uint8_t b, g, r, a; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline uint8_t &A() { return a; } inline uint8_t A() const { return a; } - BGRA() : r(0), g(0), b(0), a(0) { } - template BGRA(const PixFmt &src) { a = src.A(); r = src.R(); g = src.G(); b = src.B(); } - }; - struct ARGB { - uint8_t a, r, g, b; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline uint8_t &A() { return a; } inline uint8_t A() const { return a; } - ARGB() : r(0), g(0), b(0), a(0) { } - template ARGB(const PixFmt &src) { a = src.A(); r = src.R(); g = src.G(); b = src.B(); } - }; - struct ABGR { - uint8_t a, b, g, r; - inline uint8_t &R() { return r; } inline uint8_t R() const { return r; } - inline uint8_t &G() { return g; } inline uint8_t G() const { return g; } - inline uint8_t &B() { return b; } inline uint8_t B() const { return b; } - inline uint8_t &A() { return a; } inline uint8_t A() const { return a; } - ABGR() : r(0), g(0), b(0), a(0) { } - template ABGR(const PixFmt &src) { a = src.A(); r = src.R(); g = src.G(); b = src.B(); } - }; - - // Alpha only - struct A8 { - uint8_t a; - inline ROC R() const { return ROC(); } - inline ROC G() const { return ROC(); } - inline ROC B() const { return ROC(); } - inline uint8_t &A() { return a; } inline uint8_t A() const { return a; } - A8() : a(0) { } - template A8(const PixFmt &src) { a = src.A(); } - }; - - // cairo types - // These are only true for little endian architectures - // If OverLua is ever to run on big endian archs some conditional compiling should be used here - typedef BGRX cairo_rgb24; - typedef BGRA cairo_argb32; -}; - - -// Support any interleaved RGB format with 8 bit per channel -// You usually don't want to instance this class directly, -// look at OverLuaFrameAggregate defined below -template -class BaseImage { -public: - typedef BaseImage MyType; - - // video properties - int width; - int height; - ptrdiff_t stride; - unsigned char *data; - - // Access a pixel value - inline const PixFmt &Pixel(int x, int y) const - { - return *((PixFmt*)(data + y*stride) + x) - } - - inline PixFmt &Pixel(int x, int y) - { - return *((PixFmt*)(data + y*stride) + x); - } - - BaseImage(unsigned _width, unsigned _height, ptrdiff_t _stride, unsigned char *_data) - : width(_width), height(_height), stride(_stride), data(_data) - { - owndata = false; - // nothing further to init - } - - BaseImage(const MyType &src, bool copydata = false) - { - width = src.width; - height = src.height; - stride = src.stride; - owndata = copydata; - if (copydata) { - data = new unsigned char[height*stride]; - memcpy(data, src.data, height*stride); - } else { - data = src.data; - } - } - - ~BaseImage() - { - if (owndata) - delete[] data; - } - - // should never be called more than once on the same C++ object - void CreateLuaObject(lua_State *L, BaseImageAggregate *aggregate = 0) - { - // create userdata object - MyType **ud = (MyType**)lua_newuserdata(L, sizeof(MyType*)); - *ud = this; - - // create metatable - lua_newtable(L); - lua_pushcclosure(L, lua_indexget, 0); - lua_setfield(L, -2, "__index"); - lua_pushcclosure(L, lua_indexset, 0); - lua_setfield(L, -2, "__newindex"); - lua_pushcclosure(L, lua_getpixel, 0); - lua_setfield(L, -2, "__call"); - lua_pushcclosure(L, lua_finalize, 0); - lua_setfield(L, -2, "__gc"); - if (aggregate) { - lua_pushlightuserdata(L, aggregate); - lua_setfield(L, -2, "image"); - } - lua_setmetatable(L, -2); - } - -private: - bool owndata; - - // set a pixel colour - static int lua_indexset(lua_State *L) - { - // first arg = object - // second arg = index - // third arg = value - MyType **ud = (MyType**)lua_touserdata(L, 1); - - if (lua_isnumber(L, 2)) { - if (lua_istable(L, 3)) { - int n = (int)lua_tointeger(L, 2); - int x = n % (*ud)->width; - int y = n / (*ud)->width; - if (x < 0 || y < 0 || x >= (*ud)->width || y >= (*ud)->height) return 0; - - // read first three entries from table - PixFmt color; - lua_pushnil(L); - if (!lua_next(L, 3)) goto badtable; - if (!lua_isnumber(L, -1)) goto badtable; - color.r = (unsigned char)lua_tointeger(L, -1); - lua_pop(L, 1); - if (!lua_next(L, 3)) goto badtable; - if (!lua_isnumber(L, -1)) goto badtable; - color.g = (unsigned char)lua_tointeger(L, -1); - lua_pop(L, 1); - if (!lua_next(L, 3)) goto badtable; - if (!lua_isnumber(L, -1)) goto badtable; - color.b = (unsigned char)lua_tointeger(L, -1); - lua_pop(L, 2); - - (*ud)->Pixel(x, y) = color; - return 0; - - } else { -badtable: - lua_pushliteral(L, "Value set into image pixel must be a table with 3 entries"); - lua_error(L); - return 0; - } - } - - lua_pushliteral(L, "Undefined field in image"); - lua_error(L); - return 0; - } - - // get a pixel colour or some other property - static int lua_indexget(lua_State *L) - { - // first arg = object - // second arg = index - MyType **ud = (MyType**)lua_touserdata(L, 1); - - if (lua_type(L, 2) == LUA_TSTRING) { - const char *fieldname = lua_tostring(L, 2); - if (strcmp(fieldname, "width") == 0) { - lua_pushnumber(L, (*ud)->width); - } else if (strcmp(fieldname, "height") == 0) { - lua_pushnumber(L, (*ud)->height); - } else if (strcmp(fieldname, "copy") == 0) { - lua_pushvalue(L, 1); - lua_pushcclosure(L, lua_copyfunc, 1); - } else if (strcmp(fieldname, "create_cairo_surface") == 0) { - lua_pushvalue(L, 1); - lua_pushcclosure(L, lua_create_cairo_surface, 1); - } else if (strcmp(fieldname, "overlay_cairo_surface") == 0) { - lua_pushvalue(L, 1); - lua_pushcclosure(L, lua_overlay_cairo_surface, 1); - } else { - lua_pushfstring(L, "Undefined field name in image: %s", fieldname); - lua_error(L); - } - - return 1; - - } - - lua_pushfstring(L, "Unhandled field type indexing image: %s", lua_typename(L, lua_type(L, 2))); - lua_error(L); - return 0; - } - - static int lua_getpixel(lua_State *L) - { - // first arg = object - // second arg = x - // third arg = y - MyType **ud = (MyType**)lua_touserdata(L, 1); - - int x = luaL_checkint(L, 2); - int y = luaL_checkint(L, 3); - - if (x < 0 || y < 0 || x >= (*ud)->width || y >= (*ud)->height) { - lua_pushinteger(L, 0); - lua_pushinteger(L, 0); - lua_pushinteger(L, 0); - } else { - const PixFmt &p = (*ud)->Pixel(x, y); - lua_pushinteger(L, p.r); - lua_pushinteger(L, p.g); - lua_pushinteger(L, p.b); - } - return 3; - } - - static int lua_finalize(lua_State *L) - { - MyType **ud = (MyType**)lua_touserdata(L, 1); - delete *ud; - return 0; - } - - static int lua_copyfunc(lua_State *L) - { - MyType **ud = (MyType**)lua_touserdata(L, lua_upvalueindex(1)); - MyType *copy = new MyType(**ud, true); - copy->CreateLuaObject(L); - return 1; - } - - static int lua_create_cairo_surface(lua_State *L) - { - MyType **ud = (MyType**)lua_touserdata(L, lua_upvalueindex(1)); - - // Create a new surface of same resolution - // Always RGB24 format since we don't support video with alpha - cairo_surface_t *surf = cairo_image_surface_create(CAIRO_FORMAT_RGB24, (*ud)->width, (*ud)->height); - if (!surf || cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS) { - lua_pushliteral(L, "Unable to create cairo surface from image"); - lua_error(L); - return 0; - } - - // Prepare copying pixels from frame to surface - unsigned char *surfdata = cairo_image_surface_get_data(surf); - int surfstride = cairo_image_surface_get_stride(surf); - - // Copy pixels - int height = (*ud)->height; - int width = (*ud)->width; -#pragma omp parallel for - for (int y = 0; y < height; y++) { - PixFmt *ipix = (PixFmt*)((*ud)->data + y*((*ud)->stride)); - PixelFormat::cairo_rgb24 *opix = (PixelFormat::cairo_rgb24*)(surfdata + y*surfstride); - for (int x = 0; x < width; x++) { - *opix++ = *ipix++; - } - } - cairo_surface_mark_dirty(surf); - - // Create Lua object - LuaCairoSurface *lsurf = new LuaCairoSurface(L, surf); - - // Release our reference to the surface - cairo_surface_destroy(surf); - - // Return it to Lua - return 1; - } - - static int lua_overlay_cairo_surface(lua_State *L) - { - // Get inputs - MyType **ud = (MyType**)lua_touserdata(L, lua_upvalueindex(1)); - LuaCairoSurface *surfwrap = LuaCairoSurface::GetObjPointer(L, 1); - if (!surfwrap) { - lua_pushliteral(L, "Argument to overlay_cairo_surface is not a cairo surface"); - lua_error(L); - return 0; - } - int xpos = luaL_checkint(L, 2); - int ypos = luaL_checkint(L, 3); - - // More argument checks - cairo_surface_t *surf = surfwrap->GetSurface(); - if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_IMAGE) { - lua_pushliteral(L, "Argument to overlay_cairo_surface is not a cairo image surface"); - lua_error(L); - return 0; - } - - // Prepare some data - int fwidth = (*ud)->width, fheight = (*ud)->height; - int swidth = cairo_image_surface_get_width(surf), sheight = cairo_image_surface_get_height(surf); - int sstride = cairo_image_surface_get_stride(surf); - // Prepare and get read pointer for source image - cairo_surface_flush(surf); - unsigned char *sdata = cairo_image_surface_get_data(surf); - - // Check that the overlaid surface won't be entirely outside the frame - if (xpos <= -swidth || ypos <= -sheight || xpos > fwidth || ypos > fheight) - return 0; - - // Pick overlay algorithm - cairo_format_t sformat = cairo_image_surface_get_format(surf); - - if (sformat == CAIRO_FORMAT_ARGB32) { - // This has pre-multipled alpha - int fy = ypos; // frame y - if (fy < 0) fy = 0, sdata -= ypos, sheight -= ypos; - int slines_to_compose = sheight, flines_to_compose = fheight; - int lines_to_compose = (slines_to_composePixel(fx, fy+composition_line); - unsigned char a = 0xff - sline[sx].a; - pix.r = sline[sx].r + a*pix.r/255; - pix.g = sline[sx].g + a*pix.g/255; - pix.b = sline[sx].b + a*pix.b/255; - } - } - } - - else if (sformat == CAIRO_FORMAT_RGB24) { - // Assume opaque alpha for all pixels - int fy = ypos; // frame y - if (fy < 0) fy = 0, sdata -= ypos, sheight -= ypos; - int slines_to_compose = sheight, flines_to_compose = fheight; - int lines_to_compose = (slines_to_composePixel(fx, fy+composition_line) = sline[sx]; - } - } - } - - else if (sformat == CAIRO_FORMAT_A8) { - // This one is problematic - it doesn't contain any colour information - // Two primary choices would be to fill with either black or white, - // but neither would be an optimum solution. - // A third option would be to take a fourth argument to this function, - // specifying the colour to be used. - lua_pushliteral(L, "8 bpp alpha images are not (yet) supported for overlay operations"); - lua_error(L); - return 0; - } - - else if (sformat == CAIRO_FORMAT_A1) { - lua_pushliteral(L, "1 bpp alpha images are not supported for overlay operations"); - lua_error(L); - return 0; - } - - else { - lua_pushliteral(L, "Unknown source image format for overlay operation"); - lua_error(L); - return 0; - } - - return 0; - } - -}; - - -// Now something so we can pretend all images have the same pixel format -// and can pass around pointers to objects of one fixed base class. -class BaseImageAggregate { -public: - virtual PixelFormat::ARGB GetPixel(int x, int y) = 0; - virtual void SetPixel(int x, int y, const PixelFormat::ARGB &val) = 0; - virtual unsigned GetWidth() = 0; - virtual unsigned GetHeight() = 0; - virtual void CreateLuaObject(lua_State *L) = 0; -}; - -template -class BaseImageAggregateImpl : public BaseImageAggregate { -public: - typedef BaseImage ImageType; - -private: - ImageType *frame; - bool ownframe; - -public: - BaseImageAggregateImpl(unsigned _width, unsigned _height, ptrdiff_t _stride, unsigned char *_data) - { - frame = new ImageType(_width, _height, _stride, _data); - ownframe = true; - } - - BaseImageAggregateImpl(ImageType *_frame) - { - frame = _frame; - ownframe = false; - } - - PixelFormat::ARGB GetPixel(int x, int y) - { - return PixelFormat::ARGB(frame->Pixel(x, y)); - } - - void SetPixel(int x, int y, const PixelFormat::ARGB &val) - { - frame->Pixel(x, y) = PixFmt(val); - } - - unsigned GetWidth() - { - return frame->width; - } - - unsigned GetHeight() - { - return frame->height; - } - - void CreateLuaObject(lua_State *L) - { - frame->CreateLuaObject(L, this); - } - -}; - -// All common, sensible formats -typedef BaseImageAggregateImpl ImageRGB; -typedef BaseImageAggregateImpl ImageBGR; -typedef BaseImageAggregateImpl ImageRGBX; -typedef BaseImageAggregateImpl ImageBGRX; -typedef BaseImageAggregateImpl ImageXRGB; -typedef BaseImageAggregateImpl ImageXBGR; -typedef BaseImageAggregateImpl ImageRGBA; -typedef BaseImageAggregateImpl ImageBGRA; -typedef BaseImageAggregateImpl ImageARGB; -typedef BaseImageAggregateImpl ImageABGR; - - -// Access pixels with various edge conditions -namespace EdgeCondition { - template - struct Blackness { - static inline PixFmt &get(BaseImage &img, int x, int y) - { - if (x < 0 || y < 0 || x >= img.width || x >= img.height) { - return PixFmt(); // all construct with all zeroes - } else { - return img.Pixel(x,y); - } - } - }; - - template - struct Closest { - static inline PixFmt &get(BaseImage &img, int x, int y) - { - if (x < 0) x = 0; - if (y < 0) y = 0; - if (x >= img.width) x = img.width-1; - if (y >= img.height) y = img.height - 1; - return img.Pixel(x,y); - } - }; - - template - struct Repeat { - static inline PixFmt &get(BaseImage &img, int x, int y) - { - while (x < 0) x += img.width; - while (y < 0) y += img.height; - while (x >= img.width) x -= img.width; - while (y >= img.height) y -= img.height; - return img.Pixel(x,y); - } - }; - - template - struct Mirror { - static inline PixFmt &get(BaseImage &img, int x, int y) - { - while (x < 0) x += img.width*2; - while (y < 0) y += img.height*2; - while (x >= img.width*2) x -= img.width*2; - while (y >= img.height*2) y -= img.height*2; - if (x >= img.width) x = img.width*2 - x; - if (y >= img.height) y = img.height*2 - y; - return img.Pixel(x,y); - } - }; -} - - -// FIXME: this is completely broken, the compiler won't accept it -// when instantiated with one of the EdgeCondition functions for EdgeCond -template -inline PixFmt GetPixelBilinear(BaseImage &img, double x, double y) -{ - PixFmt res; - double xpct = x - floor(x), ypct = y - floor(y); - - if (xpct == 0 && ypct == 0) - return EdgeCond::get(img, (int)x, (int)y); - - const PixFmt &src11 = EdgeCond::get(img, (int)x, (int)y); - const PixFmt &src12 = EdgeCond::get(img, (int)x, 1+(int)y); - const PixFmt &src21 = EdgeCond::get(img, 1+(int)x, (int)y); - const PixFmt &src22 = EdgeCond::get(img, 1+(int)x, 1+(int)y); - - res.R() = (uint8_t)((1-xpct) * (1-ypct) * src11.R() + (1-xpct) * ypct * src12.R() + xpct * (1-ypct) * src21.R() + xpct * ypct * src22.R()); - res.G() = (uint8_t)((1-xpct) * (1-ypct) * src11.G() + (1-xpct) * ypct * src12.G() + xpct * (1-ypct) * src21.G() + xpct * ypct * src22.G()); - res.B() = (uint8_t)((1-xpct) * (1-ypct) * src11.B() + (1-xpct) * ypct * src12.B() + xpct * (1-ypct) * src21.B() + xpct * ypct * src22.B()); - res.A() = (uint8_t)((1-xpct) * (1-ypct) * src11.A() + (1-xpct) * ypct * src12.A() + xpct * (1-ypct) * src21.A() + xpct * ypct * src22.A()); - - return res; -} - - -#endif diff --git a/devel/OverLua/luasupport/assfile.lua b/devel/OverLua/luasupport/assfile.lua deleted file mode 100644 index 432a24215..000000000 --- a/devel/OverLua/luasupport/assfile.lua +++ /dev/null @@ -1,134 +0,0 @@ ---[[ - assfile.lua - Functions for parsing ASS format subtitles - Part of OverLua, licensed under GPLv2 -]] - -module "assfile" - - --- Parsing helper functions -local function trim(s) - return (s:gsub("^[ \t\r\n]*(.-)[ \t\r\n]*$", "%1")) -end -local function num(s) - return tonumber(trim(s)) or 0 -end - - --- Which file format we're working with. --- Changing this changes the behaviour of various parsing functions. --- Valid values: "SSA4", "ASS", "ASS2", "ASS3", "AS5" --- Other versions aren't supported. --- This is usually automatically set by the whole-file parsing functions. -format = "SSA4" - - --- Create a solid colour fill style --- Colours are "cairo compatible", ie. range 0 to 1 --- A colour never stores alpha, that's a separate property -function color(r, g, b, a) - r, g, b, a = r or 0, g or 0, b or 0, a or 0 - return {class="solid", r=r, g=g, b=b, a=a} -end - --- Parse a colour in SSA, ASS or HTML format -function parse_color(s) -end - - --- Base style, this defines the defaults used for undefined fields in read-in styles -default_style = { - -- Default style has no name - name = nil, - -- Well, sensible on Windows - font_face = "Arial", - font_size = "24", - font_language = "C", -- Language to assume text is in, affects some rendering - font_vertical = false, -- Vertical layout, replaces use of "@-fonts" - font_bold = false, - font_italic = false, - font_underline = false, - font_overstrike = false, - -- Fill style - fill1 = color(1, 1, 1, 1), -- Fill, white - fill2 = color(1, 0, 0, 1), -- Pre-karaoke fill, red - fill3 = color(0, 0, 0, 1), -- Outline, black - fill4 = color(0, 0, 0, 0.5), -- Shadow, semi-transparent black - -- Border size - outline = 2, - shadow = 2, - opaque_box = false, - -- Scaling - scale_x = 1.00, - scale_y = 1.00, - -- Spacing - spacing_char = 0, -- Extra inter-character spacing - spacing_line = 0, -- Extra inter-line spacing - baseline_shift = 0, -- Shift baseline this amount against line advance direction - -- Text positioning - margin_l = 10, - margin_r = 10, - margin_t = 10, - margin_b = 10, - align_x = 0.5, -- Bouding box centered between left/right margins - align_y = 1.0, -- Bounding box placed at bottom of screen - inner_align_x = 0.5, -- Lines centered inside bounding box - inner_align_y = 1.0, -- Lines at bottom of bounding box - break_style = "smart_top", -- "Smart-wrap", earlier lines wider (alt. "smart_bottom", "simple", "none") - pos_rel = "video", -- Positioning relative to video frame (alt. "screen") - pos_x = nil, -- Don't override positioning - pos_y = nil, - -- Rotation/reshaping - origin = nil, -- Automatic, at center of text - angle_x = 0, - angle_y = 0, - angle_z = 0, - shear_x = 0, - shear_y = 0, - baseline_transform = nil, - bounding_box_transform = nil, - -- Misc. - blend_mode = "normal", -- Alt. "add", "multiply" - clip_rect = nil, - clip_shape = nil, - blur = 0, - -- Animation - fade = nil, - animation = nil -} - - --- Parse a Style line -function read_style(t) - if format == "AS5" then - error("Found Style line in an AS5 file, where it's unsupported.\nLine: %s", t) - - elseif format == "SSA4" then - local name, font_face, font_size, color1, color2, color3, color4, - bold, italic, underline, overstrike, border, outline, shadow, - align, margin_l, margin_r, margin_v, alpha, encoding - = t:match("^.-:(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$") - name = trim(name) - font_face = trim(name) - font_size = num(font_size) - end -end - - --- Parse a StyleEx line -function read_style_ex(t) - if format ~= "ASS3" and format ~= "AS5" then - error("Found StyleEx line in format that doesn't support it.\nFormat is \"%s\".\nLine is: %s", format, t) - end -end - - --- Merge two styles by "overlaying" a style upon a base --- Produces a new style --- Fields where the overlay has a defined value, the output style has the value of overlay, --- but in fields where overlay is nil, the output has the base value. --- (Pretty much "out.field = overlay.field or base.field".) --- Animation lists are merged however, but this may produce weird results --- if the animations overlap in non-trivial ways. (Just pretend this says "undefined behaviour.") -function merge_styles(base, overlay) -end diff --git a/devel/OverLua/luasupport/readme.txt b/devel/OverLua/luasupport/readme.txt deleted file mode 100644 index 6ad416ce8..000000000 --- a/devel/OverLua/luasupport/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains various helper scripts for use with OverLua. diff --git a/devel/OverLua/overlua.cpp b/devel/OverLua/overlua.cpp deleted file mode 100644 index 83547cb01..000000000 --- a/devel/OverLua/overlua.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * C++ interface for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#include "overlua.h" -#include - -#ifdef WIN32 -#define WIN32_LEAN_AND_MEAN -#define WIN32_EXTRA_LEAN -#include -#endif - - -struct FileScriptReader { - static const size_t datasize = 0x10000; - char *data; - FILE *file; - FileScriptReader() { data = new char[datasize]; } - ~FileScriptReader() { delete[] data; } - static const char *reader(lua_State *L, void *data, size_t *size) - { - FileScriptReader *self = (FileScriptReader*)data; - *size = fread(self->data, 1, self->datasize, self->file); - if (*size) return self->data; - else return 0; - } -}; - -OverLuaScript::OverLuaScript(const char *filename, const char *datastring) -{ - FileScriptReader reader; -#ifdef WIN32 - wchar_t *filenamew = new wchar_t[MAX_PATH]; - MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenamew, MAX_PATH); - reader.file = _wfopen(filenamew, L"r"); - delete[] filenamew; -#else - reader.file = fopen(filename, "r"); -#endif - - Create(reader, filename, datastring); - - fclose(reader.file); -} - - -struct MemScriptReader { - const void *memdata; - size_t memdatasize; - static const char *reader(lua_State *L, void *data, size_t *size) - { - MemScriptReader *self = (MemScriptReader*)data; - *size = self->memdatasize; - self->memdatasize = 0; - if (*size) return (const char*)self->memdata; - else return 0; - } -}; - -int OverLuaScript::lua_debug_print(lua_State *L) -{ - const char *str = luaL_checkstring(L, 1); -#ifdef WIN32 - OutputDebugStringA(str); // ought to be W version but conversion is such a hassle -#else - printf(str); -#endif - return 0; -} - -OverLuaScript::OverLuaScript(const void *data, size_t length, const char *datastring) -{ - MemScriptReader reader; - reader.memdata = data; - reader.memdatasize = length; - - Create(reader, "Memory script", datastring); -} - -OverLuaScript::~OverLuaScript() -{ - lua_close(L); -} - -void OverLuaScript::RenderFrameRGB(BaseImageAggregate &frame, double time) -{ - lua_getglobal(L, "render_frame"); - frame.CreateLuaObject(L); - lua_pushnumber(L, time); - if (lua_pcall(L, 2, 0, 0)) { - const char *err = lua_tostring(L, -1); - throw err; - } - lua_gc(L, LUA_GCCOLLECT, 0); -} diff --git a/devel/OverLua/overlua.h b/devel/OverLua/overlua.h deleted file mode 100644 index f34238a06..000000000 --- a/devel/OverLua/overlua.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * C++ interface for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#ifndef OVERLUA_H -#define OVERLUA_H - -// assume we're in aegisub's svn tree and -// are building with the aegisub patched lua -#include "../lua51/src/lua.h" -#include "../lua51/src/lualib.h" -#include "../lua51/src/lauxlib.h" - -#include -#include "image.h" -#include "cairo_wrap.h" -#include "raster_ops.h" - - -class OverLuaScript { -private: - lua_State *L; - - // No default constructor - OverLuaScript() { } - - template - void Create(ScriptReaderClass &reader, const char *chunkname, const char *datastring) - { - int err; - - L = luaL_newstate(); - - // Base Lua libs - luaL_openlibs(L); - // Cairo lib - lua_pushcfunction(L, luaopen_cairo); lua_call(L, 0, 0); - // Raster library - lua_pushcfunction(L, luaopen_raster); lua_call(L, 0, 0); - // Debug print - lua_pushcclosure(L, lua_debug_print, 0); - lua_setglobal(L, "dprint"); - // Datastring - if (datastring) - lua_pushstring(L, datastring); - else - lua_pushnil(L); - lua_setglobal(L, "overlua_datastring"); - - err = lua_load(L, reader.reader, &reader, chunkname); - - // todo: better error handling - if (err == LUA_ERRSYNTAX) throw lua_tostring(L, -1); - if (err == LUA_ERRMEM) throw "Memory error"; - - err = lua_pcall(L, 0, 0, 0); - - if (err == LUA_ERRRUN) throw lua_tostring(L, -1); - if (err == LUA_ERRMEM) throw "Memory error"; - if (err == LUA_ERRERR) throw "Error-handler error"; - } - - static int lua_debug_print(lua_State *L); - -public: - OverLuaScript(const char *filename, const char *_datastring = 0); - OverLuaScript(const void *data, size_t length, const char *_datastring = 0); - virtual ~OverLuaScript(); - - void RenderFrameRGB(BaseImageAggregate &frame, double time); - -}; - -#endif diff --git a/devel/OverLua/raster_ops.cpp b/devel/OverLua/raster_ops.cpp deleted file mode 100644 index ac082b9e6..000000000 --- a/devel/OverLua/raster_ops.cpp +++ /dev/null @@ -1,720 +0,0 @@ -/* - * Raster image operations for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#include "cairo_wrap.h" -#include "image.h" -#include -#include -#include - -#include "expression_engine.h" -#include "raster_ops.h" -#include "../lua51/src/lauxlib.h" - - -static inline cairo_surface_t *CheckSurface(lua_State *L, int idx) -{ - LuaCairoSurface *surfobj = LuaCairoSurface::GetObjPointer(L, idx); - cairo_surface_t *surf = surfobj->GetSurface(); - if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_IMAGE) { - lua_pushliteral(L, "Object for raster operation is not an image surface. Video frames are not accepted."); - lua_error(L); - } - return surf; -} - -static inline double NormalDist(double sigma, double x) -{ - if (sigma <= 0 && x == 0) return 1; - else if (sigma <= 0) return 0; - else return exp(-(x*x)/(2*sigma*sigma)) / (sigma * sqrt(2*3.1415926535)); -} - - -// Filter an image in horizontal direction with a one-dimensional filter -// PixelWidth is the distance in bytes between pixels -template -void SeparableFilterX(unsigned char *src, unsigned char *dst, int width, int height, ptrdiff_t stride, int *kernel, int kernel_size, int divisor) -{ -#pragma omp parallel for - for (int y = 0; y < height; y++) { - unsigned char *in = src + y*stride; - unsigned char *out = dst + y*stride; - for (int x = 0; x < width; x++) { - int accum = 0; - for (int k = 0; k < kernel_size; k++) { - int xofs = k - kernel_size/2; - //if (x+xofs < 0 || x+xofs >= width) continue; - if (x+xofs < 0) xofs += width; - if (x+xofs >= width) xofs -= width; - accum += (int)(in[xofs*PixelWidth] * kernel[k]); - } - accum /= divisor; - if (accum > 255) accum = 255; - if (accum < 0) accum = 0; - *out = (unsigned char)accum; - in+=PixelWidth; - out+=PixelWidth; - } - } -} - - -// Filter an image in vertical direction with a one-dimensional filter -// This one templated with PixelWidth since the channel interlacing is horizontal only, -// filtering once vertically will automatically catch all channels. -// (Width must be multiplied by pixel width for that to happen though.) -void SeparableFilterY(unsigned char *src, unsigned char *dst, int width, int height, ptrdiff_t stride, int *kernel, int kernel_size, int divisor) -{ -#pragma omp parallel for - for (int x = 0; x < width; x++) { - unsigned char *in = src + x; - unsigned char *out = dst + x; - for (int y = 0; y < height; y++) { - int accum = 0; - for (int k = 0; k < kernel_size; k++) { - int yofs = k - kernel_size/2; - //if (y+yofs < 0 || y+yofs >= height) continue; - if (y+yofs < 0) yofs += height; - if (y+yofs >= height) yofs -= height; - accum += (int)(in[yofs*stride] * kernel[k]); - } - accum /= divisor; - if (accum > 255) accum = 255; - if (accum < 0) accum = 0; - *out = (unsigned char)accum; - in += stride; - out += stride; - } - } -} - - -// Apply a simple separable FIR filter to an image -void ApplySeparableFilter(lua_State *L, cairo_surface_t *surf, int *kernel, int kernel_size, int divisor) -{ - // Get surface properties - cairo_surface_flush(surf); - int width = cairo_image_surface_get_width(surf); - int height = cairo_image_surface_get_height(surf); - ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf); - cairo_format_t format = cairo_image_surface_get_format(surf); - unsigned char *data = cairo_image_surface_get_data(surf); - - if (format != CAIRO_FORMAT_ARGB32 && format != CAIRO_FORMAT_RGB24 && format != CAIRO_FORMAT_A8) { - lua_pushliteral(L, "Unsupported image format for raster operation"); - lua_error(L); - } - - // Work image - unsigned char *wimg = new unsigned char[height*stride]; - - // Do the filtering - if (format == CAIRO_FORMAT_ARGB32 || format == CAIRO_FORMAT_RGB24) { - // Horizontal - SeparableFilterX<4>(data+0, wimg+0, width, height, stride, kernel, kernel_size, divisor); - SeparableFilterX<4>(data+1, wimg+1, width, height, stride, kernel, kernel_size, divisor); - SeparableFilterX<4>(data+2, wimg+2, width, height, stride, kernel, kernel_size, divisor); - SeparableFilterX<4>(data+3, wimg+3, width, height, stride, kernel, kernel_size, divisor); - // Vertical - //memcpy(data, wimg, height*stride); - SeparableFilterY(wimg, data, width*4, height, stride, kernel, kernel_size, divisor); - } else if (format == CAIRO_FORMAT_A8) { - // Horizontal - SeparableFilterX<1>(data, wimg, width, height, stride, kernel, kernel_size, divisor); - // Vertical - SeparableFilterY(wimg, data, width, height, stride, kernel, kernel_size, divisor); - } - - // Clean up - cairo_surface_mark_dirty(surf); - delete[] wimg; -} - - -// Apply a general filter an image -template -void ApplyGeneralFilter(lua_State *L, cairo_surface_t *surf, FilterType &filter) -{ - // Get surface properties - cairo_surface_flush(surf); - int width = cairo_image_surface_get_width(surf); - int height = cairo_image_surface_get_height(surf); - ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf); - cairo_format_t format = cairo_image_surface_get_format(surf); - unsigned char *data = cairo_image_surface_get_data(surf); - - if (format != CAIRO_FORMAT_ARGB32 && format != CAIRO_FORMAT_RGB24 && format != CAIRO_FORMAT_A8) { - lua_pushliteral(L, "Unsupported image format for raster operation"); - lua_error(L); - } - - // Source image copy - unsigned char *wimg = new unsigned char[height*stride]; - memcpy(wimg, data, height*stride); - - if (format == CAIRO_FORMAT_ARGB32) { - BaseImage src(width, height, stride, wimg); - BaseImage dst(width, height, stride, data); -#pragma omp parallel for - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - dst.Pixel(x,y) = filter.argb32(src, x, y); - } - } - - } else if (format == CAIRO_FORMAT_RGB24) { - BaseImage src(width, height, stride, wimg); - BaseImage dst(width, height, stride, data); -#pragma omp parallel for - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - dst.Pixel(x,y) = filter.rgb24(src, x, y); - } - } - - } else if (format == CAIRO_FORMAT_A8) { - BaseImage src(width, height, stride, wimg); - BaseImage dst(width, height, stride, data); -#pragma omp parallel for - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - dst.Pixel(x,y) = filter.a8(src, x, y); - } - } - } - - // Clean up - cairo_surface_mark_dirty(surf); - delete[] wimg; -} - - -struct GaussianKernel { - int *kernel; - int width; - int divisor; - GaussianKernel(double sigma) - { - width = (int)(sigma*3 + 0.5) | 1; // binary-or with 1 to make sure the number is odd - if (width < 3) width = 3; - kernel = new int[width]; - kernel[width/2] = (int)(NormalDist(sigma, 0) * 255); - divisor = kernel[width/2]; - for (int x = width/2-1; x >= 0; x--) { - int val = (int)(NormalDist(sigma, width/2-x) * 255 + 0.5); - divisor += val*2; - kernel[x] = val; - kernel[width - x - 1] = val; - } - } - ~GaussianKernel() - { - delete[] kernel; - } -}; - - -// raster.gaussian_blur(imgsurf, sigma) -static int gaussian_blur(lua_State *L) -{ - // Get arguments - cairo_surface_t *surf = CheckSurface(L, 1); - double sigma = luaL_checknumber(L, 2); - - // Generate gaussian kernel - GaussianKernel gk(sigma); - - ApplySeparableFilter(L, surf, gk.kernel, gk.width, gk.divisor); - - return 0; -} - - -// n tap box blur -static int box_blur(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - int width = luaL_checkint(L, 2); - if (width <= 0) { luaL_error(L, "Width of box kernel for raster.box must be larger than zero, specified to %d.", width); return 0; } - int applications = luaL_optint(L, 3, 1); - int *kernel = new int[width]; - for (int i = 0; i < width; i++) - kernel[i] = 1; - while (applications-- > 0) - ApplySeparableFilter(L, surf, kernel, width, width); - delete[] kernel; - return 0; -} - - -// TODO: figure out how to make this use bilinear pixel grabbing instead -struct DirectionalBlurFilter { - GaussianKernel gk; - double xstep, ystep; - DirectionalBlurFilter(double angle, double sigma) : - gk(sigma) - { - xstep = cos(angle); - ystep = -sin(angle); - } - inline PixelFormat::A8 a8(BaseImage &src, int x, int y) - { - int a = 0; - for (int t = -gk.width/2, i = 0; i < gk.width; t++, i++) { - PixelFormat::A8 &srcpx = GetPixelBilinear >(src, x+xstep*t, y+ystep*t); - //PixelFormat::A8 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t)); - a += srcpx.A() * gk.kernel[i]; - } - PixelFormat::A8 res; - a = a / gk.divisor; if (a < 0) a = 0; if (a > 255) a = 255; - res.A() = a; - return res; - } - inline PixelFormat::cairo_rgb24 rgb24(BaseImage &src, int x, int y) - { - int r = 0, g = 0, b = 0; - for (int t = -gk.width/2, i = 0; i < gk.width; t++, i++) { - PixelFormat::cairo_rgb24 &srcpx = GetPixelBilinear >(src, x+xstep*t, y+ystep*t); - //PixelFormat::cairo_rgb24 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t)); - r += srcpx.R() * gk.kernel[i]; - g += srcpx.G() * gk.kernel[i]; - b += srcpx.B() * gk.kernel[i]; - } - PixelFormat::cairo_rgb24 res; - r = r / gk.divisor; if (r < 0) r = 0; if (r > 255) r = 255; - g = g / gk.divisor; if (g < 0) g = 0; if (g > 255) g = 255; - b = b / gk.divisor; if (b < 0) b = 0; if (b > 255) b = 255; - res.R() = r; - res.G() = g; - res.B() = b; - return res; - } - inline PixelFormat::cairo_argb32 argb32(BaseImage &src, int x, int y) - { - int a = 0, r = 0, g = 0, b = 0; - for (int t = -gk.width/2, i = 0; i < gk.width; t++, i++) { - PixelFormat::cairo_argb32 &srcpx = GetPixelBilinear >(src, x+xstep*t, y+ystep*t); - //PixelFormat::cairo_argb32 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t)); - a += srcpx.A() * gk.kernel[i]; - r += srcpx.R() * gk.kernel[i]; - g += srcpx.G() * gk.kernel[i]; - b += srcpx.B() * gk.kernel[i]; - } - PixelFormat::cairo_argb32 res; - a = a / gk.divisor; if (a < 0) a = 0; if (a > 255) a = 255; - r = r / gk.divisor; if (r < 0) r = 0; if (r > 255) r = 255; - g = g / gk.divisor; if (g < 0) g = 0; if (g > 255) g = 255; - b = b / gk.divisor; if (b < 0) b = 0; if (b > 255) b = 255; - res.A() = a; - res.R() = r; - res.G() = g; - res.B() = b; - return res; - } -}; - - -static int directional_blur(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - double angle = luaL_checknumber(L, 2); - double sigma = luaL_checknumber(L, 3); - - DirectionalBlurFilter filter(angle, sigma); - ApplyGeneralFilter(L, surf, filter); - - return 0; -} - - -struct RadialBlurFilter { - GaussianKernel gk; - int cx, cy; - RadialBlurFilter(int x, int y, double sigma) : - gk(sigma), cx(x), cy(y) - { - } - inline PixelFormat::A8 a8(BaseImage &src, int x, int y) - { - if (x == cx && y == cy) return src.Pixel(x, y); - double xstep = x-cx, ystep = y-cy, ivlen = 1/sqrt(xstep*xstep+ystep*ystep); - xstep *= ivlen; ystep *= ivlen; - int divisor = 0; - int a = 0; - for (int t = 0, i = gk.width/2; i < gk.width; t++, i++) { - PixelFormat::A8 &srcpx = GetPixelBilinear >(src, x+xstep*t, y+ystep*t); - //PixelFormat::A8 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t)); - a += srcpx.A() * gk.kernel[i]; - divisor += gk.kernel[i]; - } - PixelFormat::A8 res; - a = a / divisor; if (a < 0) a = 0; if (a > 255) a = 255; - res.A() = a; - return res; - } - inline PixelFormat::cairo_rgb24 rgb24(BaseImage &src, int x, int y) - { - if (x == cx && y == cy) return src.Pixel(x, y); - double xstep = x-cx, ystep = y-cy, ivlen = 1/sqrt(xstep*xstep+ystep*ystep); - xstep *= ivlen; ystep *= ivlen; - int divisor = 0; - int r = 0, g = 0, b = 0; - for (int t = 0, i = gk.width/2; i < gk.width; t++, i++) { - PixelFormat::cairo_rgb24 &srcpx = GetPixelBilinear >(src, x+xstep*t, y+ystep*t); - //PixelFormat::cairo_rgb24 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t)); - r += srcpx.R() * gk.kernel[i]; - g += srcpx.G() * gk.kernel[i]; - b += srcpx.B() * gk.kernel[i]; - divisor += gk.kernel[i]; - } - PixelFormat::cairo_rgb24 res; - r = r / divisor; if (r < 0) r = 0; if (r > 255) r = 255; - g = g / divisor; if (g < 0) g = 0; if (g > 255) g = 255; - b = b / divisor; if (b < 0) b = 0; if (b > 255) b = 255; - res.R() = r; - res.G() = g; - res.B() = b; - return res; - } - inline PixelFormat::cairo_argb32 argb32(BaseImage &src, int x, int y) - { - if (x == cx && y == cy) return src.Pixel(x, y); - double xstep = x-cx, ystep = y-cy, ivlen = 1/sqrt(xstep*xstep+ystep*ystep); - xstep *= ivlen; ystep *= ivlen; - int divisor = 0; - int a = 0, r = 0, g = 0, b = 0; - for (int t = 0, i = gk.width/2; i < gk.width; t++, i++) { - PixelFormat::cairo_argb32 &srcpx = GetPixelBilinear >(src, x+xstep*t, y+ystep*t); - //PixelFormat::cairo_argb32 &srcpx = EdgeCondition::repeat(src, (int)(x+xstep*t), (int)(y+ystep*t)); - a += srcpx.A() * gk.kernel[i]; - r += srcpx.R() * gk.kernel[i]; - g += srcpx.G() * gk.kernel[i]; - b += srcpx.B() * gk.kernel[i]; - divisor += gk.kernel[i]; - } - PixelFormat::cairo_argb32 res; - a = a / divisor; if (a < 0) a = 0; if (a > 255) a = 255; - r = r / divisor; if (r < 0) r = 0; if (r > 255) r = 255; - g = g / divisor; if (g < 0) g = 0; if (g > 255) g = 255; - b = b / divisor; if (b < 0) b = 0; if (b > 255) b = 255; - res.A() = a; - res.R() = r; - res.G() = g; - res.B() = b; - return res; - } -}; - - -static int radial_blur(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - int x = luaL_checkint(L, 2); - int y = luaL_checkint(L, 3); - double sigma = luaL_checknumber(L, 4); - - RadialBlurFilter filter(x, y, sigma); - ApplyGeneralFilter(L, surf, filter); - - return 0; -} - - -static int invert_image(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - cairo_surface_flush(surf); - int width = cairo_image_surface_get_width(surf); - int height = cairo_image_surface_get_height(surf); - ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf); - unsigned char *data = cairo_image_surface_get_data(surf); - cairo_format_t format = cairo_image_surface_get_format(surf); - - // ARGB32 and RGB24 must be treated differently due to the premultipled alpha in ARGB32 - // Also the alpha in ARGB32 is not inverted, only the colour channels - if (format == CAIRO_FORMAT_ARGB32) { -#pragma omp parallel for - for (int y = 0; y < height; y++) { - uint32_t *line = (uint32_t*)(data + y*stride); - for (int x = 0; x < width; x++, line++) { - // The R, G and B channels are in range 0..a, and inverting means calculating - // max-current, so inversion here is a-c for each channel. - unsigned char a = (*line & 0xff000000) >> 24; - unsigned char r = (*line & 0x00ff0000) >> 16; - unsigned char g = (*line & 0x0000ff00) >> 8; - unsigned char b = *line & 0x000000ff; - *line = (a<<24) | ((a-r)<<16) | ((a-g)<<8) | (a-b); - } - } - } - else if (format == CAIRO_FORMAT_RGB24) { -#pragma omp parallel for - for (int y = 0; y < height; y++) { - uint32_t *line = (uint32_t*)(data + y*stride); - for (int x = 0; x < width; x++, line++) { - // Invert R, G and B channels by XOR'ing them with 0xff each. - *line = *line ^ 0x00ffffff; - } - } - } - else if (format == CAIRO_FORMAT_A8) { -#pragma omp parallel for - for (int y = 0; y < height; y++) { - unsigned char *line = data + y*stride; - for (int x = 0; x < width; x++, line++) { - *line = ~ *line; - } - } - } - else if (format == CAIRO_FORMAT_A1) { - int lwidth = (width + 31) / 32; // "long-width", width in 32 bit longints, rounded up -#pragma omp parallel for - for (int y = 0; y < height; y++) { - // Pixels are stored packed into 32 bit quantities - uint32_t *line = (uint32_t*)(data + y*stride); - for (int x = 0; x < lwidth; x++, line++) { - // Yes this means we might end up inverting too many bits.. hopefully won't happen. - // (And even then, who would seriously use A1 surfaces?) - *line = ~ *line; - } - } - } - - cairo_surface_mark_dirty(surf); - - return 0; -} - - -static int separable_filter(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - if (!lua_istable(L, 2)) { - luaL_error(L, "Expected table as second argument to raster.separable_filter, got %s", luaL_typename(L, 2)); - return 0; - } - int divisor = luaL_checkint(L, 3); - - int width = (int)lua_objlen(L, 2); - if (width < 1) { - luaL_error(L, "Cannot apply empty filter"); - return 0; - } - int *kernel = new int[width]; - int i = 0; - lua_pushnil(L); - while (lua_next(L, 2)) { - if (lua_isnumber(L, -1)) { - kernel[i] = (int)lua_tointeger(L, -1); - } - i++; - lua_pop(L, 1); - } - - ApplySeparableFilter(L, surf, kernel, width, divisor); - - delete[] kernel; - - return 0; -} - - -static int pixel_value_map(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - const char *program = luaL_checkstring(L, 2); - - // Init image - cairo_surface_flush(surf); - int width = cairo_image_surface_get_width(surf); - int height = cairo_image_surface_get_height(surf); - ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf); - unsigned char *data = cairo_image_surface_get_data(surf); - cairo_format_t format = cairo_image_surface_get_format(surf); - - // Set up engine specs - ExpressionEngine::Specification spec; - if (format == CAIRO_FORMAT_ARGB32) { - spec.registers.resize(6); - spec.registers[0] = "R"; - spec.registers[1] = "G"; - spec.registers[2] = "B"; - spec.registers[3] = "A"; - spec.registers[4] = "X"; - spec.registers[5] = "Y"; - } - else if (format == CAIRO_FORMAT_RGB24) { - spec.registers.resize(5); - spec.registers[0] = "R"; - spec.registers[1] = "G"; - spec.registers[2] = "B"; - spec.registers[3] = "X"; - spec.registers[4] = "Y"; - } - else { - luaL_error(L, "Unsupported pixel format"); - } - - // Compile program - ExpressionEngine::Machine machine; - try { - machine = ExpressionEngine::Machine(spec, program); - } - catch (const char *e) { - // This is a parse error - luaL_error(L, "Error in expression program near\"%s\"", e); - } - - if (format == CAIRO_FORMAT_ARGB32) { - BaseImage img(width, height, stride, data); - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - PixelFormat::cairo_argb32 &p = img.Pixel(x, y); - machine.registers[0] = (double)p.R() / 255.0; - machine.registers[1] = (double)p.G() / 255.0; - machine.registers[2] = (double)p.B() / 255.0; - machine.registers[3] = (double)p.A() / 255.0; - machine.registers[4] = x; - machine.registers[5] = y; - machine.Run(); - p.R() = (uint8_t)(machine.registers[0] * 255); - p.G() = (uint8_t)(machine.registers[1] * 255); - p.B() = (uint8_t)(machine.registers[2] * 255); - p.A() = (uint8_t)(machine.registers[3] * 255); - } - } - } - else if (format == CAIRO_FORMAT_RGB24) { - BaseImage img(width, height, stride, data); - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - PixelFormat::cairo_rgb24 &p = img.Pixel(x, y); - machine.registers[0] = (double)p.R() / 255.0; - machine.registers[1] = (double)p.G() / 255.0; - machine.registers[2] = (double)p.B() / 255.0; - machine.registers[3] = x; - machine.registers[4] = y; - machine.Run(); - p.R() = (uint8_t)(machine.registers[0] * 255); - p.G() = (uint8_t)(machine.registers[1] * 255); - p.B() = (uint8_t)(machine.registers[2] * 255); - } - } - } - else { - luaL_error(L, "Unsupported pixel format"); - } - - cairo_surface_mark_dirty(surf); - - return 0; -} - - -static int pixel_coord_map(lua_State *L) -{ - cairo_surface_t *surf = CheckSurface(L, 1); - const char *program = luaL_checkstring(L, 2); - - // Set up engine specs - ExpressionEngine::Specification spec; - spec.registers.resize(2); - spec.registers[0] = "X"; - spec.registers[1] = "Y"; - - // Compile program - ExpressionEngine::Machine machine; - try { - machine = ExpressionEngine::Machine(spec, program); - } - catch (const char *e) { - // This is a parse error - luaL_error(L, "Error in expression program near\"%s\"", e); - } - - // Init image - cairo_surface_flush(surf); - int width = cairo_image_surface_get_width(surf); - int height = cairo_image_surface_get_height(surf); - ptrdiff_t stride = (ptrdiff_t)cairo_image_surface_get_stride(surf); - unsigned char *data = cairo_image_surface_get_data(surf); - cairo_format_t format = cairo_image_surface_get_format(surf); - - unsigned char *work = new unsigned char[height * stride]; - memcpy(work, data, height*stride); - - if (format == CAIRO_FORMAT_ARGB32) { - BaseImage simg(width, height, stride, work); - BaseImage dimg(width, height, stride, data); - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - machine.registers[0] = x; - machine.registers[1] = y; - machine.Run(); - dimg.Pixel(x, y) = GetPixelBilinear >(simg, machine.registers[0], machine.registers[1]); - } - } - } - else if (format == CAIRO_FORMAT_RGB24) { - BaseImage simg(width, height, stride, work); - BaseImage dimg(width, height, stride, data); - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - machine.registers[0] = x; - machine.registers[1] = y; - machine.Run(); - dimg.Pixel(x, y) = GetPixelBilinear >(simg, machine.registers[0], machine.registers[1]); - } - } - } - else { - luaL_error(L, "Unsupported pixel format"); - } - - delete[] work; - cairo_surface_mark_dirty(surf); - - return 0; -} - - -// Registration - -static luaL_Reg rasterlib[] = { - {"gaussian_blur", gaussian_blur}, {"box_blur", box_blur}, - {"directional_blur", directional_blur}, {"radial_blur", radial_blur}, - {"separable_filter", separable_filter}, - {"invert", invert_image}, - {"pixel_value_map", pixel_value_map}, {"pixel_coord_map", pixel_coord_map}, - {NULL, NULL} -}; - -int luaopen_raster(lua_State *L) -{ - luaL_register(L, "raster", rasterlib); - return 0; -} diff --git a/devel/OverLua/raster_ops.h b/devel/OverLua/raster_ops.h deleted file mode 100644 index a35f6b4e9..000000000 --- a/devel/OverLua/raster_ops.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Raster image operations for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - - -// Everything is implemented in the .cpp file as static functions. - -int luaopen_raster(lua_State *L); diff --git a/devel/OverLua/readme.txt b/devel/OverLua/readme.txt deleted file mode 100644 index 42890ae2e..000000000 --- a/devel/OverLua/readme.txt +++ /dev/null @@ -1,45 +0,0 @@ -OverLua is a plugin library that runs a Lua script to process video frames, -primarily intended to produce advanced overlay graphics. The target audience -is currently primarily programmers. - -The name is intended as a pun on Overlay and Lua. - -To help produce overlay graphics, OverLua provides an interface to the -cairo vector graphics library. A library of functions to do raster-based -graphics processing is also included. - -Curerently the only known-working plugin interface to OverLua is the Avisynth -interface. A CSRI interface is also included but it's neither tested nor -actively maintained. Patches to make the CSRI interface work are most welcome. -Further interfaces would also be appreciated, eg. one for mencoder. - -The most thorough documentation is still the source code but I'm working on -throwing together something more useful. See the other text files included -in the distribution. - - -Notes on the pre-built DLL file -------------------------------- - -The included pre-built DLL is compiled with Microsoft Visual C++ 2005 SP1 -and so will require the runtime library for that version of the compiler. -You can download the required runtime library at this location: - - - -The DLL is no longer built with SSE2. Appanrently some people still use -CPU's without SSE2 support. - -Finally, the DLL is built with OpenMP optimisations enabled, which means it -will take advantage of multi-core and other SMP systems if available. The -OpenMP optimisations are only in the raster image filtering and the -cairo surface/video frame interaction functions. If you do not use the raster -graphics operations much you won't see much gain from this SMP support either. - - -Licensing ---------- - -OverLua is licensed under version 2 of the GNU General Public License. This -means that you get no warranties of any kind. -See the file GPLv2.txt for details. diff --git a/devel/OverLua/vfr.cpp b/devel/OverLua/vfr.cpp deleted file mode 100644 index 60f300db5..000000000 --- a/devel/OverLua/vfr.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * VFR translation functions for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#include "vfr.h" -#include -#include -#include - - -// Work with seconds per frame (spf) here instead of fps since that's more natural for the translation we're doing - - -class TimecodesV1 : public VFRTranslator { -private: - // Used when sections run out - double default_spf; - double first_non_section_timestamp; - int first_non_section_frame; - - // Also generate sections for unspecified ones - // (use the default framerate then) - struct FrameRateSection { - double start_time; - double spf; - int start_frame; - int end_frame; - }; - std::vector sections; - -public: - virtual double TimeStampFromFrameNumber(int n) - { - // Find correct section - for (size_t i = 0; i < sections.size(); i++) { - FrameRateSection § = sections[i]; - if (n >= sect.start_frame && n <= sect.end_frame) { - return sect.start_time + (n - sect.start_frame) * sect.spf; - } - } - // Not in a section - if (n < 0) return 0.0; - return first_non_section_timestamp + (n - first_non_section_frame) * default_spf; - } - - TimecodesV1(FILE *vfrfile) - { - char buf[100]; - - default_spf = -1; - double cur_time = 0.0; - - FrameRateSection temp_section; - temp_section.start_time = 0.0; - temp_section.spf = -1; - temp_section.start_frame = 0; - temp_section.end_frame = 0; - - while (fgets(buf, 100, vfrfile)) { - // Comment? - if (buf[0] == '#') continue; - - if (strncmp(buf, "Assume ", 7) == 0 && default_spf < 0) { - char *num = buf+7; - default_spf = atof(num); - if (default_spf > 0) - default_spf = 1 / default_spf; - else - default_spf = -1; - temp_section.spf = default_spf; - continue; - } - - int start_frame, end_frame; - double fps; - if (scanf("%d,%d,%f", &start_frame, &end_frame, &fps) == 3) { - // Finish the current temp section - temp_section.end_frame = start_frame - 1; - if (temp_section.end_frame >= temp_section.start_frame) { - cur_time += (temp_section.end_frame - temp_section.start_frame + 1) * temp_section.spf; - sections.push_back(temp_section); - } - // Insert the section corresponding to this line - temp_section.spf = 1/fps; - temp_section.start_frame = start_frame; - temp_section.end_frame = end_frame; - temp_section.start_time = cur_time; - cur_time += (end_frame - start_frame + 1) / fps; - sections.push_back(temp_section); - // Begin new temp section - temp_section.spf = default_spf; - temp_section.start_frame = end_frame + 1; - temp_section.end_frame = end_frame; // yes, negative duration - temp_section.start_time = cur_time; - } - } - - first_non_section_timestamp = cur_time; - first_non_section_frame = temp_section.start_frame; - } - -}; - - -class TimecodesV2 : public VFRTranslator { -private: - // Main data - std::vector timestamps; - // For when data are exhausted (well, they shouldn't, then the vfr file is bad) - int last_known_frame; - double last_known_timestamp; - double assumed_spf; - -public: - virtual double TimeStampFromFrameNumber(int n) - { - if (n < (int)timestamps.size() && n >= 0) { - return timestamps[n]; - } - if (n < 0) return 0.0; - return last_known_timestamp + (n - last_known_frame) * assumed_spf; - } - - TimecodesV2(FILE *vfrfile) - { - char buf[50]; - - timestamps.reserve(8192); // should be enough for most cases - - while (fgets(buf, 50, vfrfile)) { - // Comment? - if (buf[0] == '#') continue; - // Otherwise assume it's a good timestamp - timestamps.push_back(atof(buf)); - } - - last_known_frame = (int)timestamps.size()-1; - last_known_timestamp = timestamps[last_known_frame]; - assumed_spf = 1/25.0; // yes, this is stupid - anyone got a better idea? - } - -}; - - -VFRTranslator *GetVFRTranslator(const char *vfrfile) -{ - char buf[32]; - buf[19] = 0; // In "# timecode format v1" the version number is character index 19 - FILE *f = fopen(vfrfile, "r"); - VFRTranslator *res = 0; - if (fgets(buf, 32, f) && buf[0] == '#') { - // So do some really shoddy parsing here, assume the file is good - if (buf[19] == '1') { - res = new TimecodesV1(f); - } else if (buf[19] == '2') { - res = new TimecodesV2(f); - } - } - fclose(f); - return res; -} - diff --git a/devel/OverLua/vfr.h b/devel/OverLua/vfr.h deleted file mode 100644 index 2f6d997a0..000000000 --- a/devel/OverLua/vfr.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * VFR translation functions for OverLua - * - - Copyright 2007 Niels Martin Hansen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Contact: - E-mail: - IRC: jfs in #aegisub on irc.rizon.net - - */ - -#ifndef VFR_H -#define VFR_H - -class VFRTranslator { -public: - virtual double TimeStampFromFrameNumber(int n) = 0; -}; - -VFRTranslator *GetVFRTranslator(const char *vfrfile); - -#endif diff --git a/devel/SSATool/AssemblyInfo.cs b/devel/SSATool/AssemblyInfo.cs deleted file mode 100644 index 05441a29d..000000000 --- a/devel/SSATool/AssemblyInfo.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("SSATool")] -[assembly: AssemblyDescription("A typesetting tool for Advanced Substation Alpha files.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SSATool")] -[assembly: AssemblyCopyright("Dan Donovan")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("4.3.6.0")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile(@"c:\documents and settings\administrator\my documents\visual studio projects\ssatool.snk")] -[assembly: AssemblyKeyName("")] diff --git a/devel/SSATool/Condition.cs b/devel/SSATool/Condition.cs deleted file mode 100644 index 15a41e50f..000000000 --- a/devel/SSATool/Condition.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -using System; -//using System.Collections; -using System.Collections.Generic; - -namespace SSATool -{ - public class Condition : ICloneable { - public string ConditionOne; - public string ConditionOp; - public string ConditionTwo; - public bool ConditionEnabled; - - public Condition() { } - - public Condition(string ConditionOne, string ConditionOp, string ConditionTwo, bool ConditionEnabled) { - this.ConditionOne = ConditionOne; - this.ConditionOp = ConditionOp; - this.ConditionTwo = ConditionTwo; - this.ConditionEnabled = ConditionEnabled; - } - - public object Clone() { - return this.MemberwiseClone(); - } - } - - public class ConditionColl { - protected List conditionColl; - - public ConditionColl() { - conditionColl = new List(); - } - - public int ConditionCount { - get { return conditionColl.Count; } - } - public void AddCondition(string CondOne, string CondOp, string CondTwo) { - Condition newCond = new Condition(CondOne,CondOp,CondTwo,true); - conditionColl.Add(newCond); - } - - public void AddCondition(string CondOne, string CondOp, string CondTwo, bool CondEnabled) { - Condition newCond = new Condition(); - newCond.ConditionOne = CondOne; - newCond.ConditionOp = CondOp; - newCond.ConditionTwo = CondTwo; - newCond.ConditionEnabled = CondEnabled; - conditionColl.Add(newCond); - } - - public void AddCondition(Condition tc) { - conditionColl.Add(tc); - } - - public Condition GetCondition(int index) { - return conditionColl[index]; - } - - public void RemoveCondition(int index) { - if (conditionColl.Count > index) conditionColl.RemoveAt(index); - } - - public List CloneConditions() { - List nl = new List(); - for(int index=0;index!=conditionColl.Count;index+=1) - nl.Add((Condition)conditionColl[index].Clone()); - return nl; - } - } -} diff --git a/devel/SSATool/ConditionDialog.cs b/devel/SSATool/ConditionDialog.cs deleted file mode 100644 index a008c9853..000000000 --- a/devel/SSATool/ConditionDialog.cs +++ /dev/null @@ -1,252 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -using System; -using System.ComponentModel; -using System.Windows.Forms; - -namespace SSATool -{ - ///

- /// Summary description for ConditionDialog. - /// - public class ConditionDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.Button cmdCancel; - private System.Windows.Forms.Button cmdOK; - private System.Windows.Forms.TextBox txtC1; - private System.Windows.Forms.TextBox txtC2; - private System.Windows.Forms.Label lblPrompt; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public ConditionDialog() { - InitializeComponent(); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.txtC1 = new System.Windows.Forms.TextBox(); - this.txtC2 = new System.Windows.Forms.TextBox(); - this.lblPrompt = new System.Windows.Forms.Label(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.cmdCancel = new System.Windows.Forms.Button(); - this.cmdOK = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.label1.Location = new System.Drawing.Point(8, 56); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(128, 20); - this.label1.TabIndex = 6; - this.label1.Text = "Condition One:"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label2 - // - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.label2.Location = new System.Drawing.Point(8, 80); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(128, 20); - this.label2.TabIndex = 7; - this.label2.Text = "Condition Two:"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label3 - // - this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.label3.Location = new System.Drawing.Point(8, 104); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(128, 20); - this.label3.TabIndex = 8; - this.label3.Text = "Comparison:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // txtC1 - // - this.txtC1.Location = new System.Drawing.Point(144, 56); - this.txtC1.Name = "txtC1"; - this.txtC1.Size = new System.Drawing.Size(336, 20); - this.txtC1.TabIndex = 0; - this.txtC1.Text = ""; - this.txtC1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtC_KeyPress); - // - // txtC2 - // - this.txtC2.Location = new System.Drawing.Point(144, 80); - this.txtC2.Name = "txtC2"; - this.txtC2.Size = new System.Drawing.Size(336, 20); - this.txtC2.TabIndex = 1; - this.txtC2.Text = ""; - this.txtC2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtC_KeyPress); - // - // lblPrompt - // - this.lblPrompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblPrompt.Location = new System.Drawing.Point(0, 8); - this.lblPrompt.Name = "lblPrompt"; - this.lblPrompt.Size = new System.Drawing.Size(480, 40); - this.lblPrompt.TabIndex = 5; - // - // comboBox1 - // - this.comboBox1.ImeMode = System.Windows.Forms.ImeMode.Off; - this.comboBox1.Items.AddRange(new object[] { - "=", - "==", - "!=", - "!==", - ">", - ">=", - "<", - "<="}); - this.comboBox1.Location = new System.Drawing.Point(144, 104); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(120, 21); - this.comboBox1.TabIndex = 2; - this.comboBox1.Text = "=="; - this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress); - // - // cmdCancel - // - this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cmdCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cmdCancel.Location = new System.Drawing.Point(384, 104); - this.cmdCancel.Name = "cmdCancel"; - this.cmdCancel.Size = new System.Drawing.Size(96, 24); - this.cmdCancel.TabIndex = 4; - this.cmdCancel.Text = "Cancel"; - // - // cmdOK - // - this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.cmdOK.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.cmdOK.Location = new System.Drawing.Point(272, 104); - this.cmdOK.Name = "cmdOK"; - this.cmdOK.Size = new System.Drawing.Size(96, 24); - this.cmdOK.TabIndex = 3; - this.cmdOK.Text = "OK"; - // - // ConditionDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(488, 135); - this.Controls.Add(this.cmdOK); - this.Controls.Add(this.cmdCancel); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.lblPrompt); - this.Controls.Add(this.txtC2); - this.Controls.Add(this.txtC1); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ConditionDialog"; - this.Text = "ConditionDialog"; - this.Load += new System.EventHandler(this.ConditionDialog_Load); - this.ResumeLayout(false); - - } - #endregion - - private void ConditionDialog_Load(object sender, System.EventArgs e) { - - } - public static ConditionDialogResult Show(string prompt, string title, int xpos, int ypos) { - using (ConditionDialog form = new ConditionDialog()) { - form.Text = title; - form.lblPrompt.Text = prompt; - - if (xpos >= 0 && ypos >= 0) { - form.StartPosition = FormStartPosition.Manual; - form.Left = xpos; - form.Top = ypos; - } - - DialogResult result = form.ShowDialog(); - - ConditionDialogResult retval = new ConditionDialogResult(); - if (result == DialogResult.OK) { - retval.ConditionOne = form.txtC1.Text; - retval.ConditionTwo = form.txtC2.Text; - retval.ConditionComp = form.comboBox1.Text; - retval.OK = true; - } - return retval; - } - } - - private void txtC_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { - if ((e.KeyChar == (char)10) || (e.KeyChar == (char)13)) { - e.Handled = true; - cmdOK.PerformClick(); - } - } - - private void comboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { - e.Handled = true; // We don't want anyone typing here anyway! - if (e.KeyChar == (char)Keys.Enter) - cmdOK.PerformClick(); - } - - public static ConditionDialogResult Show(string prompt, string title) { - return Show(prompt, title, -1, -1); - } - } - - public class ConditionDialogResult { - public string ConditionOne; - public string ConditionTwo; - public string ConditionComp; - public bool OK; - } -} diff --git a/devel/SSATool/ConditionDialog.resx b/devel/SSATool/ConditionDialog.resx deleted file mode 100644 index cf611c23a..000000000 --- a/devel/SSATool/ConditionDialog.resx +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - ConditionDialog - - - Private - - \ No newline at end of file diff --git a/devel/SSATool/DetectEncoding.cs b/devel/SSATool/DetectEncoding.cs deleted file mode 100644 index f68d6659d..000000000 --- a/devel/SSATool/DetectEncoding.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -using System; -using System.Collections.Generic; -using System.Text; - -namespace SSATool { - public static class DetectEncoding { - // This detection could use some serious improving. - // All detection should return the occurances as an integer. - public static int DetectSJIS(byte[] input) { - int occ=0; - byte lastMatched=0; - byte thisbyte; - for (int index=0;index!=input.Length;index++) { - thisbyte = input[index]; - if ((lastMatched==130&&thisbyte>=159&&thisbyte<=241) || - (lastMatched==131&&thisbyte>=64&&thisbyte<=151)) occ++; - else if (thisbyte==130||thisbyte==131||thisbyte>=136) lastMatched=thisbyte; - else lastMatched=0; - } - return occ; - } - - public static int DetectEUCJP(byte[] input) { - int occ=0; - byte lastMatched=0; - byte thisbyte; - for (int index=0;index!=input.Length;index++) { - thisbyte = input[index]; - if (lastMatched>=163&&lastMatched<=250&&thisbyte>=160) occ++; - else if (thisbyte>=163&&thisbyte<=250) lastMatched=thisbyte; - else lastMatched=0; - } - return occ; - - - } - } -} diff --git a/devel/SSATool/Evaluate.cs b/devel/SSATool/Evaluate.cs deleted file mode 100644 index bb8e0081e..000000000 --- a/devel/SSATool/Evaluate.cs +++ /dev/null @@ -1,739 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -using System; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Windows.Forms; -using System.Collections.Generic; - -namespace SSATool { - public static class Evaluate { - - public static string ScriptParse(string input) { - char[] charain = input.ToCharArray(); // It is over twice as fast to parse this as a character array! - StringBuilder sb = new StringBuilder(); - - int dIndex = 0, eIndex = 0, pIndex = 0, lastIndex = -1, parenLevel = 0, index; - bool foundds = false; - - for (index=0;index lastIndex) sb.Append(input, lastIndex+1, input.Length-(lastIndex+1)); - - return sb.ToString(); - } - - public static string ScriptParse_Helper(string function, string args) { - unsafe { - switch (function) { - case "eval": - return Evaluate.Eval(args).ToString(); - case "logic": - return Evaluate.Eval(args).ToString(); - case "iif": - string[] tok = args.Split(",".ToCharArray()); - if (tok.Length != 3) return "error"; - else if (Evaluate.Eval(tok[0]).Equals(true)) return tok[1]; - else return tok[2]; - case "len": - return args.Length.ToString(Util.nfi); - case "left": - string[] tokl = args.Split(",".ToCharArray()); - if ((tokl.Length != 2) || (!Evaluate.isNum(tokl[1]))) return "error"; - else try { - return tokl[0].Substring(0, int.Parse(tokl[1], Util.cfi)); - } catch { - return "error"; - } - case "mid": - string[] tokm = args.Split(",".ToCharArray()); - if ((tokm.Length != 3) || (!Evaluate.isNum(tokm[1])) || (!Evaluate.isNum(tokm[2]))) return "error"; - else try { - return tokm[0].Substring(int.Parse(tokm[1]), int.Parse(tokm[2], Util.cfi)); - } catch { - return "error"; - } - case "right": - string[] tokr = args.Split(",".ToCharArray()); - if ((tokr.Length != 2) || (!Evaluate.isNum(tokr[1]))) return "error"; - else try { - return tokr[0].Substring(tokr[0].Length - int.Parse(tokr[1], Util.cfi), int.Parse(tokr[1], Util.cfi)); - } catch { - return "error"; - } - case "str": - string[] str = args.Split(",".ToCharArray()); - if ((str.Length != 2) || (!Evaluate.isNum(str[1]))) return "error"; - else try { - string retstr = String.Empty; - for (int strindex=0;strindex= splitlist4.Length) return splitlist4[splitlist4.Length-1]; - else return splitlist4[index3]; - - default: // Unrecognized function... Let's treat it as a string. - return "$" + function + "(" + args + ")"; - } - } - } - - public static readonly Random rand = new Random(); - private static SortedList ops; - private static SortedList constants; - - private static void evaluate_stack_tops_function(Stack numStack, Stack funcStack) { - short numParams = (short)numStack.Pop(); - string func = funcStack.Pop(); - switch (func.ToLowerInvariant()) { - case "rand" : - if (numParams > 2) throw new ArgumentException("Eval.rand"); - switch (numParams) { - case 0 : - numStack.Push(rand.Next()); - break; - case 1 : - int randOneR = Convert.ToInt32(numStack.Pop()); - numStack.Push(rand.Next(randOneR)); - break; - case 2 : - int randOne, randTwo; - randTwo = Convert.ToInt32(numStack.Pop(), Util.nfi); - randOne = Convert.ToInt32(numStack.Pop(), Util.nfi); - numStack.Push(rand.Next(randOne,randTwo)); - break; - } - break; - case "randf" : - if (numParams > 2) throw new ArgumentException("Eval.randf"); - - switch (numParams) { - case 0 : - numStack.Push(rand.NextDouble()); - break; - case 1 : - double randOneRF = (double)numStack.Pop(); - numStack.Push(rand.NextDouble()*randOneRF); - break; - case 2 : - double randOneF, randTwoF; - randTwoF = (double)numStack.Pop(); - randOneF = (double)numStack.Pop(); - numStack.Push(randOneF + rand.NextDouble()*(randTwoF-randOneF)); - break; - } - break; - case "randlist" : - int listindex = rand.Next(0, numParams - 1); - string randlist = string.Empty; - for (int i = 0; i != numParams; i += 1) { - if (i == listindex) randlist = (string)numStack.Pop(); - else numStack.Pop(); - } - numStack.Push(randlist); - break; - case "round" : - if (numParams != 2) throw new ArgumentException("Eval.round"); - double roundme; - int dplaces; - dplaces = Convert.ToInt32(numStack.Pop(), Util.nfi); - roundme = (double) numStack.Pop(); - numStack.Push(Math.Round(roundme,dplaces)); - break; - case "bound" : - if (numParams != 3) throw new ArgumentException("Eval.bound"); - double num, min, max; - max = (double) numStack.Pop(); - min = (double) numStack.Pop(); - num = (double) numStack.Pop(); - num = ((num < min) ? min : num); - num = ((num > max) ? max : num); - numStack.Push(num); - break; - case "max" : - if (numParams < 2) throw new ArgumentException("Eval.max"); - double ansMax; - ansMax = Math.Max((double)numStack.Pop(),(double)numStack.Pop()); - for(int index=2;index!=numParams;index+=1) { - ansMax = Math.Max(ansMax,(double)numStack.Pop()); - } - numStack.Push(ansMax); - break; - case "min" : - if (numParams < 2) throw new ArgumentException("Eval.min"); - double ansMin; - ansMin = Math.Min((double)numStack.Pop(),(double)numStack.Pop()); - for(int index=2;index!=numParams;index+=1) { - ansMin = Math.Min(ansMin,(double)numStack.Pop()); - } - numStack.Push(ansMin); - break; - case "ceil" : - if (numParams != 1) throw new ArgumentException("Eval.ceil"); - double ceil; - ceil = (double) numStack.Pop(); - numStack.Push(Math.Ceiling(ceil)); - break; - case "floor" : - if (numParams != 1) throw new ArgumentException("Eval.floor"); - double floor; - floor = (double) numStack.Pop(); - numStack.Push(Math.Floor(floor)); - break; - case "int" : - if (numParams != 1) throw new ArgumentException("Eval.int"); - double thisnum; - thisnum = (double) numStack.Pop(); - numStack.Push(Convert.ToInt32(thisnum,Util.nfi)); - break; - case "abs" : - if (numParams != 1) throw new ArgumentException("Eval.abs"); - double abs; - abs = (double) numStack.Pop(); - numStack.Push(Math.Abs(abs)); - break; - case "sin" : - if (numParams != 1) throw new ArgumentException("Eval.sin"); - double sin; - sin = (double) numStack.Pop(); - numStack.Push(Math.Sin(sin)); - break; - case "asin" : - if (numParams != 1) throw new ArgumentException("Eval.asin"); - double asin; - asin = (double) numStack.Pop(); - numStack.Push(Math.Asin(asin)); - break; - case "cos" : - if (numParams != 1) throw new ArgumentException("Eval.cos"); - double cos; - cos = (double) numStack.Pop(); - numStack.Push(Math.Cos(cos)); - break; - case "acos" : - if (numParams != 1) throw new ArgumentException("Eval.acos"); - double acos; - acos = (double) numStack.Pop(); - numStack.Push(Math.Acos(acos)); - break; - case "tan" : - if (numParams != 1) throw new ArgumentException("Eval.tan"); - double tan; - tan = (double) numStack.Pop(); - numStack.Push(Math.Tan(tan)); - break; - case "atan" : - if (numParams != 1) throw new ArgumentException("Eval.atan"); - double atan; - atan = (double) numStack.Pop(); - numStack.Push(Math.Atan(atan)); - break; - case "atan2" : - if (numParams != 1) throw new ArgumentException("Eval.atan2"); - double atanx,atany; - atanx = (double) numStack.Pop(); - atany = (double) numStack.Pop(); - numStack.Push(Math.Atan2(atanx,atany)); - break; - case "log" : - if (numParams != 1) throw new ArgumentException("Eval.log"); - double log; - log = (double) numStack.Pop(); - numStack.Push(Math.Log(log)); - break; - case "sqrt" : - if (numParams != 1) throw new ArgumentException("Eval.sqrt"); - numStack.Push(Math.Sqrt((double)numStack.Pop())); - break; - case "len" : - if (numParams != 1) throw new ArgumentException("Eval.len"); - numStack.Push(((string)numStack.Pop()).Length); - break; - case "fact" : - case "factorial" : - if (numParams != 1) throw new ArgumentException("Eval.fact"); - numStack.Push(Convert.ToDouble(Factorial(Convert.ToInt32(numStack.Pop(), Util.nfi)), Util.nfi)); - break; - case "gcd" : - if (numParams != 2) throw new ArgumentException("Eval.gcd"); - numStack.Push(EuclidGCD(Convert.ToInt32(numStack.Pop(), Util.nfi), Convert.ToInt32(numStack.Pop(), Util.nfi))); - break; - case "lcm" : - if (numParams != 2) throw new ArgumentException("Eval.lcm"); - int lcm2 = Convert.ToInt32(numStack.Pop(),Util.nfi); - int lcm1 = Convert.ToInt32(numStack.Pop(),Util.nfi); - numStack.Push((lcm1+lcm2)/EuclidGCD(lcm1,lcm2)); - break; - default : - if (numParams==1 && numStack.Peek() is string) // might be a string w/o quotes, so push it back on as one - numStack.Push(func+"("+numStack.Pop()+")"); - break; - } - } - private static void evaluate_stack_tops(Stack numStack, System.Collections.Generic.Stack opStack, System.Collections.Generic.Stack funcStack, bool safetyKill) { - if (((numStack.Count != 0) || (funcStack.Count != 0)) && (opStack.Count != 0) && (!opStack.Peek().Equals(","))) { - char Operation = opStack.Pop(); - if (Operation == '@') { // @ is the placeholder for a function. The function itself is in funcStack. - evaluate_stack_tops_function(numStack, funcStack); - } - else if (Operation == '~') { - object obj = numStack.Pop(); - if (obj is bool) numStack.Push(!(bool)obj); - else if (obj is int) numStack.Push(~(int)obj); - else numStack.Push(obj); - } - else if (Operation == '!') { - int fact = Convert.ToInt32(numStack.Pop(), Util.cfi); - numStack.Push(Convert.ToDouble(Factorial(fact), Util.nfi)); - } - else if (numStack.Count >= 2) { - object objOne, objTwo; - objTwo = numStack.Pop(); - objOne = numStack.Pop(); - try { - switch (Operation) { - case 'c': // concatenation - numStack.Push((string)objOne + objTwo.ToString()); - break; - case '^': // power - numStack.Push(Math.Pow((double)objOne, (double)objTwo)); - break; - case '*': // multiplication - numStack.Push((double)objOne * (double)objTwo); - break; - case '/': // division - numStack.Push((double)objOne / (double)objTwo); - break; - case '%': // modulus - //numStack.Push((int)(double)objOne%(int)(double)objTwo); - numStack.Push(Math.IEEERemainder((double)objOne, (double)objTwo)); - break; - case '+': // addition - numStack.Push((double)objOne + (double)objTwo); - break; - case '-': // subtraction - numStack.Push((double)objOne - (double)objTwo); - break; - case '>': // greater than - numStack.Push(doCompare(objOne, objTwo, false) >= 0); - break; - case 'G': // greater than or equal to - numStack.Push(doCompare(objOne, objTwo, false) == 1); - break; - case '<': // less than - numStack.Push(doCompare(objOne, objTwo, false) == -1); - break; - case 'L': // less than or equal to - numStack.Push(doCompare(objOne, objTwo, false) <= 0); - break; - case '=': // case-sensitive equal - numStack.Push(doCompare(objOne, objTwo, false) == 0); - break; - case 'i': // case-insensitive equal - numStack.Push(doCompare(objOne, objTwo, true) == 0); - break; - case 'N': // case-sensitive not equal - numStack.Push(doCompare(objOne, objTwo, false) != 0); - break; - case 'I': // case-insensitive not equal - numStack.Push(doCompare(objOne, objTwo, true) != 0); - break; - case '&': // bitwise-and - numStack.Push((int)objOne & (int)objTwo); - break; - case 'X': // bitwise-xor - numStack.Push((int)objOne ^ (int)objTwo); - break; - case '|': // bitwise-or - numStack.Push((int)objOne | (int)objTwo); - break; - case 'A': // boolean and - numStack.Push((bool)objOne && (bool)objTwo); - break; - case 'O': // boolean or - numStack.Push((bool)objOne || (bool)objTwo); - break; - case 'r': // shift right - numStack.Push((int)objOne >> (int)objTwo); - break; - case 'l': // shift left - numStack.Push((int)objOne << (int)objTwo); - break; - } - } catch { throw new FormatException(); } - } - // Can't make sense of the stacks, so just clear them... - else if (safetyKill) { - funcStack.Clear(); - opStack.Clear(); - numStack.Clear(); - } - } - - } - private static int doCompare(object objOne, object objTwo, bool caseIns) { - if (objOne is string || objTwo is string) - return String.Compare(objOne.ToString(), objTwo.ToString(), caseIns); - else if (objOne is bool && objTwo is bool) - return ((bool)objOne).CompareTo((bool)objTwo); - else if (objOne is double && objTwo is double) - return ((double)objOne).CompareTo((double)objTwo); - else if (objOne is bool && objTwo is double) - return ((bool)objOne).CompareTo((double)objTwo!=0.0); - else if (objOne is double && objTwo is bool) - return ((double)objOne!=0.0).CompareTo((bool)objTwo); - /* - else if (objOne is int && objTwo is int) - return ((int)objOne).CompareTo((int)objTwo); - else if (objOne is bool && objTwo is int) - return ((bool)objOne).CompareTo((int)objTwo!=0); - else if (objOne is int && objTwo is bool) - return ((int)objOne!=0).CompareTo((bool)objTwo); - else if (objOne is double && objTwo is int) - return ((double)objOne).CompareTo((double)(int)objTwo); - else if (objOne is int && objTwo is double) - return ((double)(int)objOne).CompareTo((double)objTwo); - */ - throw new ArgumentException("Eval.doCompare"); - } - public static bool isNum(string input) { - if (input.Length == 0) return false; - char[] charain = input.ToCharArray(); - for (int index=(input.StartsWith("-")?1:0);index>= 1; /* shift u right, dividing it by 2 */ - v >>= 1; /* shift v right, dividing it by 2 */ - k+=1; /* add a power of 2 to the final result */ - } - /* At this point either u or v (or both) is odd */ - do { - if ((u & 1) == 0) /* if u is even */ - u >>= 1; /* divide u by 2 */ - else if ((v & 1) == 0) /* else if v is even */ - v >>= 1; /* divide v by 2 */ - else if (u >= v) /* u and v are both odd */ - u = (u-v) >> 1; - else /* u and v both odd, v > u */ - v = (v-u) >> 1; - } while (u > 0); - return v << k; /* returns v * 2^k */ - } - public static int Factorial(int x) { - int result=1; - for (int index = x; index != 0; index--) { - result *= index; - } - return result; - } - - private static byte opOrder(char tOp) { - byte retVal; - switch (tOp) { - case '!': // factorial - retVal = 20; - break; - case '@': // function - retVal=16; - break; - case ',': // function argument separator - retVal=15; - break; - case 'c': // concatenation - retVal=14; - break; - case '~': // inversion - retVal=13; - break; - case '^': // power - retVal=12; - break; - case '*': // multiplication - case '/': // division - case '%': // modulus - case '\\': // integer division - retVal=11; - break; - case '+': // addition - case '-': // subtraction - retVal=10; - break; - case '>': // greater than - case 'G': // greater than or equal to - case '<': // less than - case 'L': // less than or equal to - retVal=8; - break; - case '=': // case-sensitive equal - case 'i': // case-insensitive equal - case 'N': // case-sensitive not equal - case 'I': // case-insensitive not equal - retVal=7; - break; - case '&': // bitwise-and - retVal=6; - break; - case 'X': // bitwise-xor - retVal=5; - break; - case '|': // bitwise-or - retVal=4; - break; - case 'A': // boolean and - retVal=3; - break; - case 'O': // boolean or - retVal=2; - break; - case 'r': // shift right - case 'l': // shift left - retVal=9; - break; - default: // not an operation - retVal=0; - break; - } - return retVal; - } - public static bool isOp(char i, short pos) { - if (pos==1) return ("!+-*/\\%^&|=<>~".IndexOf(i) != -1); - else if (pos==2) return ("&|^=)".IndexOf(i) != -1); - else if (pos==3) return i=='='; - return false; - } - public static void FillOpsList() { - ops = new SortedList(23); - ops.Add(">>", 'r'); - ops.Add(">=", 'G'); - ops.Add(">", '>'); - ops.Add("===", '='); - ops.Add("==", '='); - ops.Add("=", 'i'); - ops.Add("<=", 'L'); - ops.Add("<<", 'l'); - ops.Add("<", '<'); - ops.Add("+", '+'); - ops.Add("||", 'O'); - ops.Add("|", '|'); - ops.Add("^^", 'X'); - ops.Add("^", '^'); - ops.Add("/", '/'); - ops.Add("*", '*'); - ops.Add("&&", 'A'); - ops.Add("&", '&'); - ops.Add("%", '%'); - ops.Add("-", '-'); - ops.Add("!==", 'I'); - ops.Add("!=", 'N'); - ops.Add("!", '!'); - ops.Add("~", '~'); - - constants = new SortedList(6); - constants.Add("e", Math.E); - constants.Add("false",false); - constants.Add("g", 1.6180339887498948482045868); - constants.Add("pi", Math.PI); - constants.Add("true", true); - constants.Add("y", 0.5772156649015328606065120); - } - - public static object Eval(string input) { - char[] charain = input.ToCharArray(); - Stack opStack = new Stack(16); - Stack numStack = new Stack(16); - Stack funcStack = new Stack(8); - - string buff; - int i = 0, pLevel; - char thisOp; - short loop, numParams; - bool lastwasop = true; - bool isnumber, isfloat, infunc, inquotes, unknownString = false; - - while (i < charain.Length) { - if (charain[i].Equals('(')) { - pLevel = 1; - buff = string.Empty; - while (pLevel!=0 && ++i - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/devel/SSATool/Extras/SSATool4.3.html b/devel/SSATool/Extras/SSATool4.3.html deleted file mode 100644 index 6285f8172..000000000 --- a/devel/SSATool/Extras/SSATool4.3.html +++ /dev/null @@ -1,661 +0,0 @@ - - - SSATool Readme - - - -
-

SSATool 4.3


-

Purpose

To automate the creation and manipulation of Advanced Substation Alpha files.

- -

Functions

- -
-
Shifting
-
- SSATool can shift a file by entering a time (hour:minutes:seconds.subseconds), by a given number of frames, or by specifying an 'old' time and the new time that it should be shifted to. Shifting by time or frames require a given direction, while time difference already has a direction, given the 2 times. -
- -

Shifting options

-
-
    -
  • Shift Start/End times: You may choose to only shift the start or end times of each line.
  • -
  • Replace negative times: If you're shifting backwards and some times end up negative, this option will replace them with a 0 time. After all, who wants to see subtitles before you even watch the video?
  • -
      -
-


- - -
-
Commands
-
- These are parameterless functions that don't take much explaining. -
-
    -
  • Strip SSA: Strips all SSA code except for \k,\K,\kf,\ko. Useful for when you want to undo typesetting to a file but keep the timing.
  • -
  • Removes duplicate dialogue lines. If you've got a file that used layer per syllable type karaoke and you strip SSA, you'll have several duplicate lines.
  • -
  • Change last \k based on line length: Goes through dialog lines, and adjusts the length of the last syllable to match the length of the line. It is possible for this value to turn out negative if the timing is way off, so use it with care.
  • -
-


- - -
-
Length-based \k or \K
-
- This changes each syllable to \k or \K as determined by a threshold. -
-
-
    -
  • Threshold: Anything above or equal to this gets changed to \K and anything under it uses \k.
  • -
-
-


- - -
-
Scale Resolution
-
- SSATool can change a resolution of a SSA file for you. If you have two different files that you want to merge, but they have different resolutions, then you must use a function like this. -
- -

Scaling options

-
-
    -
  • Scale factor: Pretty straightforwardly, the amount that you want to scale by.
  • -
  • Scale PlayRes: Scale PlayResX/PlayResY in the header, if they're already there. They must be checked for this to do anything.
  • -
-
- -

Scaled Parameters

-
-
    -
  • Style lines: Font size, outline, shadow, margins
  • -
  • Dialogue lines: Margin overrides
  • -
  • \bord: using Y scale
  • -
  • \clip: using X and Y scales
  • -
  • \fs: using Y scale
  • -
  • \fsp: using X scale
  • -
  • \move: using X and Y scales
  • -
  • \org: using X and Y scales
  • -
  • \p: Coordinates will be scaled with X and Y scales. If a \p1 is in a \clip, it DOES continue past the clip unless you \p0.
  • -
  • \pbo: using Y scale
  • -
  • \pos: using X and Y scales
  • -
  • \shad: using Y scale
  • -
-
- -


- - -
-
Lead-in/out
-
- This adds a lead-in/out to lines. It can add a \k to the beginning of the line to compensate. It does not current affect other tags like \t, \move, etc. -
- -

Options

-
-
    -
  • In Time: If checked, this is the amount of lead-in time. If it's a number, it's interpreted as seconds. Else it's interpreted as a timecode.
  • -
  • Out Time: If checked, this is the amount of lead-out time. If it's a number, it's interpreted as seconds. Else it's interpreted as a timecode.
  • -
  • Affect only karaoke lines: Affect only lines with \k in them if checked.
  • -
  • Add empty \k for karaoke: Add a \k to compensate for lead-in time to lines that have \k in them already.
  • -
-
-


- - -
-
Gradient Maker
-
- This will create a gradient by making several lines using clip. You may type text in, or you may select a line from the loaded file and click "Copy Selected List Item to Input." If the line has dialogue: ... in it (IE the information for the line and not just the line itself), then select that and click the "Move Selected" button next to the "Before Grad." textbox. This will place that text before each line without actually putting it in the gradient. Fill in the boxes and click Create. -
-

Options:

-
-
    -
  • Before Gradient: This is text that doesn't get gradiented. Put all the Dialogue: ... stuff here. This is easily accomplished by highlighting the appropriate text in the "Gradient Text" field and clicking the "Move Selected" button.
  • -
  • Clip Lines: How many lines the gradient will span. More lines is more precise.
  • -
  • Start/End Pos: The start and end positions in coordinate form x,y. Only include the part that will increase, IE if you want to go across a 640x480 screen horizontally, only x should be increasing here, and the height of 480 is an offset (it's always there), so leave height 0 here.
  • -
  • Offset: Static values that are added to the second X and Y positions. See the above example, where the offset here would be 0,480.
  • -
  • Start/End Value: The start and end colors in (A)BGR form. They can be in decimal form or in hex form with leading H. Do not include ampersands. Alpha is optional (as denoted by the parenthesis).
  • -
  • Linear/Log/Exp grad: These control how the colors are scaled: linearly, logarithmically, or exponentially (base^ratio). If you use one of the latter two, set the base to something greater than 1.
  • -
  • Turnaround: This will allow you to go from the start value to the end value somewhere in the middle of the gradient, and then back to start RGB. It's a percentage. At 50%, it will turn around at the halfway point.
  • -
-
-


- - - -
-
Blur
-
- This allows you to use layered alpha blurring. Make sure your input does not have a \bord or \pos coordinate in it, unless you're doing a glow, which does allow \pos. Also, if your line has dialogue: ... in it, make sure to select that part of the line and click the "Move Selected" button next to the "Before Blur" textbox. -
-

Options:

-
-
    -
  • Before Blur: This is text that doesn't get blurred. Put all the Dialogue: ... stuff here. This is easily accomplished by highlighting the appropriate text in the "Blur Text" field and clicking the "Move Selected" button.
  • -
  • Type: This allows you to select "true blur" or glow. True blur will move the line around with different alpha values given a position of the text. Glow will just leave the text in the same spot while creating subsequently larger borders with more alpha.
  • -
  • Lines: Only used with glow option. Creates the given amount of lines where each line has a larger border than the last.
  • -
  • Start/End alpha: Start and end alpha values. Decimal or hex with leading H. Omit the ampersands.
  • -
  • Blur Radius: How many pixels the blur should be.
  • -
  • Position: Only needed for true blur: The position on the screen where the text is in x,y form. Pixels will be added/subtracted to this value.
  • -
  • Linear/Log/Exp blur: These control how the alpha values are scaled: linearly, logarithmically, or exponentially (base^ratio). If you use one of the latter two, set the base to something greater than 1.
  • -
  • Affect: Will blur the selected elements (\1c, \2c, \3c, and/or \4c). Not applicable to glow.
  • -
  • On subsequent lines...: If not blurred, the elements selected here will have &HFF& alpha values for all lines except the main line.
  • -
-
-


- -
-
Notebox Maker
-
- This allows you to easily create cool looking noteboxes from templates contained in the included XML file. Noteboxes can be one or two lines long and each template must specifically give code for each length. See the included file for an example. Templates may be of different resolutions. If a script is loaded which contains PlayResX and/or PlayResY, the generated notebox will be automatically resampled to the script size. Otherwise, the generated notebox will be at the default resolution of the template. -
-

Options:

-
-
    -
  • Copy styles to file: The styles for the notebox will not be inserted into your file just by generation of a notebox. You can use this button to insert them automatically in that case.
  • -
-
-


- - -
-
Error Checker
-
- This will check a file for some common errors. It checks dialogue and style lines. -
-

Checks for:

-
-
    -
  • Unopened/unclosed parenthesis
  • -
  • Unopened/unclosed brackets
  • -
  • No trailing ampersand in color/alpha values
  • -
  • Lowercase H for hex
  • -
  • Malformed transformations (\t(time,time)\effect)
  • -
  • Decimals without leading integers (.01 vs. 0.01)
  • -
-
-


- - -
-
Font Test
-
- This will search a file for all fonts used and check if they are installed on your system. If fonts are not installed, you may search a directory for the fonts. It does not make sure the files it finds have the needed styles. It only matches by font name. -
-


- - -
-
Manual Transform
-
- How many times have you wished you could use \t on something that doesn't allow it? How many times have you wanted a nonlinear acceleration parameter for \move? Here's a function that will automatically interpolate these things like \t, but it's much more powerful. -
- -

Zones/the Times Listbox

-
-

Manual Transform is based on zones, which are made up of a start and end time. There must be at least one zone. Each additional zone uses the end time of the previous zone as its start time. So if you entered the times of 0:00:00.00, 0:01:00.00 and 0:02:00.00, there are two zones: one from 0:00:00.00-0:01:00.00 and one from 0:01.00.00-0:02:00.00.

-

Based on these different zones, you can have variables which can scale differently at different times. Numbers can scale linearly during one zone and exponentially during another if you like. Text can change between zones.

-

If this flexibility is not required, just entering a start time and an end time, making one zone only, will keep things simple.

-
- -

Variables

-
-

This is the data that gets scaled. To add a variable, click the new button and type a name into the popup. You can then edit the values for each time by clicking on the appropriate field in the variable list. You may use either a string or a number. Numbers will be scaled automatically, whereas strings will switch over when a new zone is reached.

-

If you enter a string and a number under the same variable, then it will treat both as a string. If you have a string and a number and a number (2 zones), it will print the string until it hits the second zone, where it will then scale between the two numbers. That is to say that if, in the current zone, the start and end variable values are both numbers, the number will be scaled; If one or both are non-numbers, both will be treated as strings.

-

Acceleration: You can use linear, logarithmic or exponential acceleration for each variable and zone. Exponential acceleration has 2 forms: ratio^base, which is specified by just entering a number > 1, or base^ratio by specifying expbase (Example: exp2). Specify a log transform by typing logbase. If none of these are specified or are incorrectly entered, a linear transform will be used. ASSA itself uses ratio^base for acceleration, so the default behavior (entering a number) works the same as entering that number into \t.

-
- -

Other options

-
-
    -
  • Code is how SSATool puts the variables together to form the text that gets output. To add the line times, use %starttime% and %endtime% in the code. To use a variable in the code, surround the variable name with percentage signs. You may use scripting functions here. If you're scaling an integer, you're going to want to round it with scripting because it will be printed as a decimal otherwise.
  • -
  • Times: Enter the times for this to span. You must enter at least two times. You may enter more than one time to create different zones where variables can be scaled differently. Times should be the first thing you add.
  • -
  • Frame Rate: The framerate of the video. All entered and output times will be snapped to the nearest frame.
  • -
-
-


- -
-
Kanji timing
-
- This function will allow you to time Kanji (or pretty much any other East Asian character set) from Roman letters. You may combine \k times, but this function can't work with \t as it can't be sure how to handle the times. It could also technically be used in reverse, but it's not capable of splitting syllables from the source style.

- You must have your two character sets entered in different styles. The kanji may already be timed, but those times will be overridden if so. Empty syllables will be copied alone, or will be combined with the surrounding syllables if those are to be combined. -
-

Options

-
-
    -
  • Styles: Select your source and destination styles here. The source style will be used for times and all ASSA code. Destination lines will be overwritten in the list. Note: Any ASSA code appearing before the \k will be directly copied, and ASSA code after the \k is currently not copied at all.
  • -
  • Start: Brings the first lines of each style into the corresponding text fields.
  • -
  • Link: When you have selected corresponding syllables, this will pair them up and you will see them appear in the group list.
  • -
  • Unlink last: If you've made a mistake, this will unlink the last pair. You may use it as many times as needed.
  • -
  • Skip source line: Skip the current source line.
  • -
  • Skip destination line: Skip the current destination line. It won't be modified at all.
  • -
  • Go back a line: Goes back to the last line for both the source and destination. It does not undo any changes made, but you may redo it.
  • -
  • Accept line: When all of the grouping for a line is finished, this will modify the line in the list and automatically load the next lines for source and destination.
  • -
-
-

Keyboard shortcuts

-
-
- Don't use the mouse to highlight grouping. If you incorrectly try to split syllables from the source, the function won't work right, so please use the following keyboard shortcuts while the destination textbox has focus. They're much faster. -
-
    -
  • Right/left arrows: Select more or less text from the destination, respectively.
  • -
  • Up/down arrows: Select more or less text from the source, respectively. The source text is locked so it can not be split, but you may combine syllables from it.
  • -
  • Enter: Link the selected text, or if all text is linked, accept the line and move on to the next.
  • -
  • Backspace: Undo the previous linked text.
  • -
-
-


- - -
-
Karaoke effects
-
- The karaoke effect generator is a complex karaoke effects automator. In simple terms, it could be called a "\k to \t converter," though it is not limited to transformations. You have several variables (listed below) and scripting functions (listed further below in another section) available to use in template effects. You also have "raw code," which will just dump anything you put in there into the SSA. You can use variables in any of the effect fields. You may use raw code to accomplish anything that the other effects can do. Other effect templates are there just to make it easier for you to make presets. There's an effects editor to add your own presets available under the Effects menu. -
- - - -

Layers

-
-

Layers are the basis of the effects system. They are, in essence, one of the base elements of ASSA itself. The simplest implementation of a layer is a single dialogue line. That's it. The subtitler program reads each line and decides where each line goes, and in what order they go.

-

However, in SSATool, layers are different than how SSA itself looks at them. A layer is how SSATool processes a line in order to add effects. Depending on the complexity of an effect, it may take from one to several lines to accomplish. That is, you might have two or three or even dozens of dialogue lines composing what we see as one line! So each layer in SSATool will add another dialogue line with the same text but potentially different overrides. But to make things even more confusing, there's an exception: Layer-Per-Syllable. What happens if you want to do something to a syllable in a karaoke as its "turn" comes up, but the command to do what you want to do is a command that affects the whole dialogue line, even if you use \r? You often have to make a dialogue line corresponding to each syllable.

-

This is what layer-per-syllable does. It will dynamically create a new dialogue line (layer) for each syllable. You're typically going to want to see each line only for the syllable it corresponds to, because that's the basic reason why layer-per-syllable exists. To accomplish that, you're going to want to have a couple of effects in addition to your transformation code. These extra effects will be to make the line invisible except at the corresponding syllable. You'll use conditions (explained below) to apply alpha codes before and after this syllable. A sample layer-per-syllable project file should be bundled to show you how to go about it. Don't use it as a basis every time you want to do layer-per-syllable, because it will ensure that you don't understand how the process works. To make karaoke, you must first understand how ASSA renders karaoke.

-

To enable layer-per-syllable mode, simply add a layer and make sure the Layer-per-Syllable checkbox is clicked. You may combine layer-per-syllable layers together or with fixed layers if you like.

-
- -

Conditions

-
-

There are two types of conditions in the karaoke effects generator: effect conditions and layer conditions. They both do the same thing, but they work on a different scope. For both, you enter two things to compare. These things may be numbers or strings, and you may use variables and scripting functions (listed below).

-
    -
  • With effect conditions, each condition must be true for that effect to be applied, or it will just be skipped for that syllable. There is no condition checking for effects on a per-line scope, meaning the conditions are only checked per syllable, not per line. This is the more flexible option of the two.
  • -
  • With layer conditions, each of these must work out for all of the effects in that layer to be applied. By default, if this is not met, there will be no dialogue line created at all. However, when you create your layer conditions, you may option to create the dialogue line WITHOUT effects if the conditions are not met. For fixed layers, the option is called, "Add line unchanged if layer conditions not met." If you're using layer-per-syllable, just that option will add the line several times (once per syllable) if the layer conditions aren't met, so you'll also want to enable the option, "Only add it once."
  • -
-
- -

Layout

-
-

The layout of the karaoke effects section can be a little confusing at first. At the left, there's a treeview. This holds information about all layers and effects. You can add a layer via the button under it. Once you have added and selected a layer, you may add effects to it through that button. You may drag items around the treeview to reorder them or to move effects to a different layer. You may duplicate or remove layers or effects through the corresponding buttons.

-

When you select a layer in the treeview, the layer options page automatically shows up. Here, you can add layer conditions or change the options for the layer. When you click on an effect, you get a tabbed setup where you can view the options for that effect or the conditions. To change an option for an effect, just click on the corresponding field.

-
- -

Options

-
-
    -
  • Don't add the syllable text: This will leave out the actual text for the syllable. You may add it yourself in your effects using the %text% variable. This allows you to split a \k if you like.
  • -
  • Remove \k: This will remove \k, \K, \ko and \kf after applying effects. Keep a backup file before you use this option in case timing needs to be changed later.
  • -
  • Add line unchanged if conditions not met: If layer conditions aren't met, add the dialogue line with no effects. You could get missing dialogue lines without this option.
  • -
  • Only add it once: An extension of the above for layer-per-syllable mode to prevent dialogue lines from being added multiple times when layer conditions are not met.
  • -
  • Layer-per-Syllable: Enable Layer-per-Syllable mode for this layer. See the explanation above.
  • -
  • Repetitions: This only applies to non-LPS layers. The layer will be repeated this amount of times. It only applies to karaoke lines, not regular dialogue lines.
  • -
-
- - -

Karaoke variables

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%karastart%Start time of current kara block in milliseconds.
%karastart[n]%Start time of kara block n in milliseconds. Yes, the square brackets should be there. You may use other variables in the brackets (except for another variable with brackets). Example: %karastart[%totkaranum%]%
%karaend%End time of current kara block in milliseconds.
%karaend[n]%End time of kara block n in milliseconds. Yes, the square brackets should be there. You may use other variables in the brackets (except for another variable with brackets).
%karamid%Mid point of current kara block in milliseconds. ((start+end)/2)
%karalen%Length of current kara block in milliseconds.
%karalen[n]%Length of kara block n in milliseconds. Yes, the square brackets should be there. You may use other variables in the brackets (except for another variable with brackets.
%karanum%The number of the kara block being evaluated, indexed from 0.
%karanumtot%The total number of kara blocks in this line. If you compare with %karanum%, make sure to add 1 to %karanum% since it starts at 0.
%linestart%Start time of current line in seconds in seconds
%lineend%End time of current line in seconds
%linelen%Length of current line in seconds
%layernum%The current layer number, indexed from 0.
%layernumtot%The total number of layers
%layernumlps%The current layer number in layer-per-syllable mode. In fixed layer mode, this is also also used when repetitions of the layer is set > 1. Indexed from 0.
%layernumlpstot%The total number of layers in layer-per-syllable mode. In fixed layer mode, it is the total number of repetitions of the current layer.
%name%The name (SSA) or actor (ASS) of the line.
%style%The name of the current style
%text%The text inside of the current syllable. Recommended for use with "Don't add the syllable text itself" in the Layer Conditions+Options tab, but can be used by itself.
-
-


- - -
-
Scripting
-

Functions

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$eval(expression)Does math/logic. It supports the sub-functions listed in the table below. Strings used in this must be surrounded by double quotes. Not using quotes should work in most situations, but this is mostly for reasons of backwards compatibility. If used for logic, it will return True or False (as booleans, so no quotes around them).
$iif(expression,t, f)Inline if (a conditional statement). The expression may be a boolean logic expression, or it may be something that evaluates to true or false. If the expression is True, it returns the second argument. If it's false, it returns the third. If it (or you) messes up, it returns "error".
$len(text)Returns the length of text.
$left(text,length)Returns the first length characters of text.
$listindex(n,item,item,...)Returns the nth supplied item indexed from 1. Returns "error" if the supplied value is incorrect.
$listindexlast(item,item,item,...)Returns the nth supplied item indexed from 1. Returns "error" if the supplied value is less than one. Returns the last value if the index is too big.
$listindexwrap(item,item,item,...)Returns the nth supplied item indexed from 1. Returns "error" if the supplied value is less than one. Wraps around to the beginning of the list if the index is too big.
$mid(text,start,length)Returns length characters of text, starting at start. The first character is indexed as 0.
$randlist(item,item,item,...)Returns a random item from the given inputs.
$right(text,length)Returns the last length characters of text.
$str(text,n)Repeats text n times.
-
-

- -

Eval Sub-Functions

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
absReturn the absolute value of a number.
acosReturns the arc-cosine of a number.
asinReturns the arc-sin of a number.
atanReturns the arc-tangent of a number given an angle.
atan2Returns the arc-tangent of a coordinate. Format: atan2(x,y)
boundBounds a number between 2 values. Takes 3 parameters: Number, LBound, UBound. Returns LBound if Number < LBound, or UBound if Number > UBound. Otherwise returns Number.
ceilRounds up. Example: ceil(5.01) returns 6
cosReturn the cosine of a number.
factComputes the factorial of an integer. This is the same as the ! operator.
floorRounds down. Example: floor(5.99) returns 5. floor(-5.99) returns -6.
intReturns the integer of a number. int(-5.99) returns -5.
lenReturns the length of a string.
logReturn the log of a number. It's base e. If you want a different base, do log(number)/log(base)
maxReturn the higher of 2 numbers.
minReturn the lower of 2 numbers.
randReturns a bounded random integer. rand() gives you an integer from 0 to 1, rand(maxvalue) gives an integerfrom 0 to maxvalue, and rand(low,high) from low to high
randf - Returns a bounded double precision floating point number. randf() gives you a double from 0 to 1, randf(maxvalue) gives a double from 0 to maxvalue, and randf(low,high) from low to high
roundRounds a number to the given number of decimal places. Format: round(number,decimal places)
sinReturn the sin of a number.
sqrtReturn the square root of a number.
tanReturn the tangent of a number.

- Take note that these do NOT have a leading $ like the above functions. They must be used INSIDE of $eval. -
-

- -

Data types supported by eval

-
- - - - - - - - - - - - - - - - - -
Booleantrue or false. Capitalization does not matter. Do not enclose in quotes.
IntegerSupport not done, numbers currently treated as double. All mathematical/bitwise operations are available.
DoubleDouble-precision floating point number. All mathematical operations except modulus are available.
PointAn x,y pair. You may add or subtract points, or you may add, subtract, multiply or divide points by scalars. Not finished.
StringA string. + may be used to concatenate strings. All strings MUST be enclosed by quotes.

- Boolean logic comparisons are available with all types. Also, note that conditions in the karaoke effects tool internally use $eval, so strings must be enclosed in quotes in there. Variables that are strings currently do NOT automatically do so. -
-

- -

Constants supported by eval

-
- - - - - - - - - - - - - - -
ee, the natural logarithmic base.
gThe golden ratio.
PiPi.
yEuler's constant.

- All numerical constants are double precision (64-bit) floating points. -
-

- -

Mathematical/Bitwise operators

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Add
-Subtract
*Multiply
/Divide
!Factorial
%Modulus (remainder after integer division)
&Bitwise and
\Bitwise or
\Bitwise xor
<<Shift left
>>Shift right
~Inversion
-
-

- -

Boolean/comparison operators

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
=Equal to (if used with text, is case insensitive)
<>Equal to (if used with text, is case sensitive)
==Equal to (if used with text, is case sensitive)
!=Not equal to (if used with text, is case insensitive)
!=Not equal to (if used with text, is case sensitive)
>Greater than
>=Greater than or equal to
<Less than
<=Less than or equal to
||Boolean or
&&Boolean and
-
-


- -
-
Effect and project files
-

Effect files

-
- Effect files are XML files that hold all preset effects except for "raw code," which is built in. They use the extension exml. You may edit them in a text editor by using the bundled effects as a template. There's also an effects editor in the program to write them for you. -

- -

Project files

-
- Project files are also XML files, but they are in a different format than the effect files. They contain all layer, filter and condition information as well as the filename to the loaded SSA, if applicable. They are not a script - they do not keep track of your commands, but merely karaoke effects information. They may be edited in a text editor, but I only recommend doing that if you want to make a slight modification to an existing file. -
-


- -
-
File Encoding
- SSATool will open most common file encodings including ANSI (using your local codepage), Shift-JIS, and Unicode in 1, 2, or 4 octet versions. Some encodings, such as Shift-JIS are notoriously hard to detect, so if your file includes Japanese text and you're unsure of the encoding, please make sure to find out, or that it displays correctly if you use the open file option without the SJIS.

- As of version 4.1, SSATool employs extremely simple algorithms for attempting to detect Shift-JIS and EUC-JP. If a file is under 4KB, 100 or more characters detected with either encoding will trigger a prompt asking to reload using that encoding. If the file is 4KB-8KB, the threshold is 300, and if the file is 8KB or more, 600. -


- -
-
Thanks
- The following are people I want to thank for helping me with this, be that by testing, lending me webspace, putting up educational code samples on the web, etc. Some will be in names, and others will be in online nicknames.
-
-
    -
  • DeathWolf - testing, feature suggestions, webspace
  • -
  • Neil Davidson - the save file dialog w/ encoding I'm using
  • -
  • PovRayMan - icon
  • -
  • SCR512 - testing
  • -
  • zalas - feature suggestions
  • -
  • Dead-Cow - testing
  • -
  • Nikolai - testing, feature suggestions
  • -
  • Anyone else I forgot
  • -
-
-


- - SSATool is copyright (C) 2005-2006 Dan Donovan. It is free to use. -
- - \ No newline at end of file diff --git a/devel/SSATool/Extras/changelog.txt b/devel/SSATool/Extras/changelog.txt deleted file mode 100644 index c6e8fa04f..000000000 --- a/devel/SSATool/Extras/changelog.txt +++ /dev/null @@ -1,492 +0,0 @@ -4.3.6 --Fix saving a project file with default layer names not showing any names when loading the file again --Fix small bug loading v5/6 scripts - -4.3.5 --Truetype Collection (TTC) font files are supported in the font finder --Factorial should work now --More optimizations/cleanups - -4.3.4 --Fixed/tweaked some UI stuff --More resize code added --Fixed double click in error list --Optimized some stuff --All karaoke variables now index from 0, not 1. This will break backwards compatibility with some karaoke, but it has never been consistent, so I am changing it. --Fixed %karamid% - -4.3.3 --A bunch of fixes for noteboxes --Don't bother to scale resolution if the factor is 1:1 - -4.3.2 --Workaround for crash when line is 259 characters long --Workaround to prevent splitter from stealing focus on resize (by design, MS? What were you thinking?) --Fix in default notebox template - -4.3.1 --Search/replace now affects everything as it used to --Unparsable dialogue/style lines are now parsed as strings, displayed with green background --Changing time precision or running search/replace refreshes the list automatically - -4.3.0.2 --Fixed karaoke condition buttons - -4.3.0 --Added notebox generator, see readme --List and utility panel are now resizable panes --Fixed a bug in resolution scaling --Fixed error checker crash --Fixed kanji timing crash - -4.2.0.10 --Fixed strip SSA leaving off the last syllable - -4.2.0.9 --Fixed a bunch of functions that did nothing - -4.2.0.8 --Gradient fixes --Make screen update when you copy text from gradient/blur/etc to it, and don't copy text backwards - -4.2.0.7 --v6 script support improved --Fix so that you can do both lead-in and lead-out --A bunch of UI crashes from 4.2.0 fixed - -4.2.0.6 --Timecodes may now be unapplied - -4.2.0 --Lead no longer makes the list backwards --Undo/redo optimized and now support adding/removing lines --Fixed styles --Optimizations, including overall memory usage --Fixed lead and remove duplicate lines --Reading negative times supported --Other misc fixes, mostly UI-related --Some Math constants added to $eval, see readme --Boolean inversion is now denoted as ~ as opposed to ! in $eval --Added LCM and GCD to $eval --Fix loading some files through command line --Fix to reading ARGB colors --Timecode transform added --Double clicking a line in the list will bring up the modify line dialogue box --Bold, Italic, etc. now specified as -1 (instead of 1) as per specs. Parsing will work correctly with either. - -4.1.0 --V6 scripts (AKA V4++) supported --Fixed a bug with %layernum% when you have disabled layers --Undo/redo added --Fixed a couple of bugs with kanji timing --Effects files now use .exml extension. Old files may be renamed. --Manual transform times are now displayed in the listbox as entered, but are snapped internally to be between frames. --Conditions may now be edited directly instead of removing/readding --Completely rewritten script engine combining $logic and $eval --Workaround to prevent resaving UTF-16 files as UTF-8 by default --You may now edit the names for karaoke layers and effects. --Error checker now looks for decimals without leading integers (.1 vs 0.1) --Rudamentary SJIS/EUC-JP detection --Fixes to gradient maker --Lots of general optimizations and other internal code changes --Put layer condition checking back to per line instead of per syllable, as it should be --Added karaoke syllable-per-line mode - -4.0.0 --Resolution scaling now has separate scale parameters for X and Y, no longer affects all lines, and no longer crashes --FPS is now a global parameter --Added option for ms precision. A modified VSFilter is required for it to work. --Lead-in/out now affect \t and \move --Karaoke layer options layed out a little differently --Added kanji timing --Fixed a possible crash with karaoke effects for short lines --Fixed trying to save a project file as ANSI --Various interface tweaks - -3.7.3 --Fixed %text% for syllables with no text --Fixed logic with non-number, non-digit characters, such as space. - -3.7.2 --Fixed $iif when a condition is false --Fix crash trying to remove an item in the karaoke tree when nothing is selected --Adding an effect to the karaoke tree selects it automatically --Added $str, see readme --Fixed one layer being disabled affecting all layers below it --Fixed one effect having unmet conditions disabling all effects below it - -3.7.1 --Added lead-in/out. It does not yet correct for \t, \move, etc. - -3.7.0 --Converting to C# 2.0. Filesize is much smaller. New bugs may be introduced. --Fixed bug loading project files where layers didn't specify repetitions. - -3.6.0 --Added repetitions to karaoke effects. See readme. --Removing effects should work better now. --$logic should correctly interpret strings with numbers - -3.5.0 --Programming structure improved --Random tweaks here and there --Fixed cloning (copying effects, duplicating layers) in many cases --Select first karaoke effects layer (if there is one) when loading a project --Added manual transform. See readme. --Improved precision of shifting by frame. Start times are now always rounded down (floor), while end times are rounded up (ceil) --Changed interface for karaoke effects to use a treeview for layers and effects --Fixed a bunch of eval functions --Font names can now contain anything except \ or } --Fix parameter order for $eval(round) - -3.2.5 --Script parser should handle parenthesis better now. --Made $eval play nicer with decimals --(hopefully) fixed one parameter functions for $eval --$eval should bail and return String.Empty if it can't make sense of the data it's given --Added sqrt() to $eval (or you can still do ^0.5) --Fixed =/== in $evallogic/$iif --Strings in $evallogic/$iif no longer are expected to be in quotes - -3.2.4 --Fixed <, <=, >, >= - -3.2.3 --Fixed a few bugs with writing XML Project files --Fixed a bug when loading an XML project file that options would become confused between filters with multiple instances --Fixed a couple of bugs that rendered effect conditions pretty much useless --%layernum% and %layernumlps% now index from 1, not 0 --Pressing enter in the condition dialog box will click OK automatically - -3.2.2 --The selected line information now properly moves when the form is resized. - -3.2.1 --You can now load files (except effects files) through the command line (do "Open With" in Explorer) - -3.2.0 --Karaoke effects generator can now allow you to edit the actual text for each syllable by setting "don't add the syllable text itself" in Layer Conditions+Options and using %text%. --Length-based \k / \K fixed again - -3.1.0 --Select/Deselect Line Range now accept the last line number (IE if you have a 10 line file, 1-10 works now) --Slight optimization to how effects are created --Blur now only has two types: true blur and glow. However, it is more powerful than before. See the readme for more. --Blur no longer adds an empty line at the end --Exponential blur no longer disregards BlurStart for the center line. --Gradient now accepts a parameter called mirror. See the readme, but know that leaving it at 100 (%) will act the same as it used to. --Added $listindex, $listindexwrap, $listindexlast functions - -3.0.3 (3.0.2019.28843) --Adding the same effect multiple times no longer mixes up the options between them. --Fixed length-based \k / \K - -3.0.2 (3.0.2017.31380) --Offset in gradient maker now only affects the second X,Y pair in \clip - -3.0.1 (3.0.2017.27737) --Detecting unclosed parenthesis/brackets at the end of the line now works. - -3.0 (3.0.2017.5108) --Added $len, $left, $mid, $right --Slight optimizations in $iif --Added select/deselect line range to list menu. If you don't know the line numbers, click on the lines and use the go to line option and it'll show the current line. --Made go to line show the selected line number by default and added a label to show this as well --Optimizations to shifting and length based \k-\K --Fixed strip SSA --Fixed linear glow type blur accuracy --Error checker will now report unclosed ampersands in \alpha, \2c, \2a, \3c, \3a, \4c, \4a --Error checker will now report lowercase hex markers in \alpha - -3.0 beta 6 (3.0.1975.5261) --Fixed shifting if your file is 10 hours or more --Fixed font check sometimes adding fonts more than once --Workaround for looking for vertical fonts (@fonts). It will just omit the @. It doesn't check if the font is actually capable of being vertical. --Added ability to search for fonts that aren't installed in a directory --Saving as UTF-8 fixed - -3.0 beta 5 (3.0.1958.3274) --Fixed shifting cutting off part of the line in many cases. - -3.0 beta 4 --Made form resizable --Made default (and minimum) form width 1024 for those people using 1024x768 --Fixed logarithmic glow blur alpha values --Fixed logarithmic and exponential gradient values when using a start color > 0 --Added font checker. Make good use of it. I know I will. - -3.0 beta 3 --Fixed some menu options that weren't doing anything --Double clicking on a line in error checking now takes you to the line in question. Also added a couple of checks for style lines. --Added a layered blur option. --Added option to do logarithmic and exponential gradients. --Removed messagebox popping up with $iif --Added some more error checks for various functions (not talking about the error checker, but when you enter invalid parameters to functions) - -3.0 beta 2 (3.0.1948.40271) --Also check for colors/alpha with lowercase hex codes (including the H) and also where there is not a trailing ampersand --Scale PlayResX and PlayResY too --Fixed eval --Added the "list" menu with some useful list functions --Performance increases in scripting/eval/evallogic. Thanks to DeathWolf for helping with this. --Fixed effect conditions - -3.0 beta 1 (3.0.1948.26940) --Complete rewrite of application using C# 1.1, so you now need .NET to run it. Speed increases and GUI improvements result. --Variables have changed formats. See readme. --Scripting language is much different. See readme. --Project files and effects list files both use XML now. They are not backwards compatible. --Program supports basically all normal encodings, including UTF-16 (Unicode) that previous versions didn't. --Gradient maker can do \1c, \2c, \3c, \4c (user selectable) and can handle RGBA (in ARGB order) and decimal input --Resolution scaling now scales a lot more stuff. See readme. - - - - ---Old versions-- - - -2.0.161 --Even bigger speedup --Completely rewrote effects procedure, kept the old one as it may be buggy, as usual --Made after 3.0 for those looking to avoid .Net (bad choice though) - -2.0.158 --HUGE speedup --Will no longer affect non-karaoke dialog lines --Probably buggy --Made after 3.0 for those looking to avoid .Net (bad choice though) - -2.0.157 --More bugfixes and speedups - -2.0.154 --More bugfixes --Layer-per-syllable and fixed layer modes may be combined --New variables dealing with layers: $layernumtot$, $layernumlps$, $layernumlpstot$. If you have a "legacy" layer-per-syllable file, open the PSSA in Notepad and add PerSyllable=True. When using $layernum$ for layer-per-syllable, you must now use $layernumlps$. - -1.6.153 --Fixed several bugs introduced in the last release --More speedups --Added $style$ variable (see readme) --Added ability to resize the program - -1.5.152 --Fixed $iif with more than one comparison --Some other random bugfixes --There should be a minor speedup all around, but I don't know if it'll be noticeable - -1.5.151 --Added ability to insert a gradient into a file without replacing a line - -1.5.150 --A small bugfix in the gradient maker. Not sure if it even affected anything. - -1.5.149 --Added some more to gradient maker --New HTML readme - -1.5.146 --Added a bunch of stuff to gradient maker, such as copying to/from the SSA file and automatically adding text before and after the line. --Gradient maker no longer adds 1 extra line - -1.4.145 --Another fix - -1.4.144 --Fixed a gradient maker problem having to do with some parts of it being unfinished and disabled. - -1.4.143 --More gradient maker work --Added $randlist - -1.3.142 --Started to implement a gradient maker. It's not done and what is done is experimental. - -1.2.141 --New version scheme, actually using minor (and eventually major) version numbers instead of just build numbers. --Added ability to change font in Listbox, including encoding. - -1.1.140 --Fixed strip SSA, it should no longer strip numbers after \kf. - -1.1.139 --Added: \k or \K depending on the length of the syllable --Fixed a little big with scaling where it would try to work on lines it shouldn't be (though it shouldn't have messed anything up) - -1.1.138 --Added: SSA Resolution Scaling. Use at your own risk. --Removed: Old load/save projects --Removed: Old add effects procedure. - -1.1.137 --Fixed: Shifting now correctly abides the lines being checked/unchecked - -1.1.136 --Some minor interface tweaks --Added 'Move Down' for effects - -1.1.135 --Restructured/cleaned up the code for adding karaoke effects. The old code will be left in for a little while until I can be sure there are no bugs in the new code. Please try the new code, but make sure you save before doing so. - -1.1.134 --Fixed: Reparsing styles (made typo last build) - -1.1.133 --Fixed: Read ASS Styles reparsing (also made slightly faster) - -1.1.132 --Fixed: Read ASS Styles ([v4+ styles]) correctly. - -1.1.131 --Fixed: Layer conditions and effect count were, in certain conditions, obtained from the wrong layer. This has been (hopefully) corrected. - -1.1.130 --Fixed shifting... - -1.1.129 --Fixed (I don't know): Shifting............. last time? Nah... - -1.1.128 --Fixed (probably): Shifting... again. Should be accurate and not crash. - -1.1.127 --Fixed (maybe): Shifting should be more accurate. - -1.1.126 --Fixed: Effect condition checkboxes now correctly show as checked/unchecked when the condition is active/inactive as opposed to always being checked. --Fixed: Layer condition checkboxes now correctly show as checked/unchecked when the condition is active/inactive as opposed to always being checked. --Fixed: Effect conditions should no longer crash when loading a project. --Fixed: Layer conditions should now correctly load as layer conditions instead of effect conditions when loading a project. - -1.1.125 --Added: $lastkaranzkstart$ --Fixed: Trying to move/copy an effect when there are no effects no longer creates a blank effect. - -1.1.124 --Fixed effects list not being correctly loaded if you open a SSA/ASS/PSSA from the command line. - -1.1.123 --Added ability to load SSA/ASS and PSSA (project files) from command line. You can now associate SSATool with SSA, ASS and/or PSSA files and it will open them. - -1.1.122 --Effects can now use variables in the code line and not just the options lines. If you don't know what this means, don't worry about it. - -1.1.121 --Forgot to comment out some code before hitting compile in last version that made load project crash. Fixed. --Added script tracing in the help tab... Every call to the script parser adds a line to the listbox. It will be at least 2 lines per script call. - -1.1.120 --Fixed bug in $calc where a negative as the first number would not be recognized. --Fixed: Trying to delete a layer when there are no layers no longer crashes. --Fixed: Trying to delete an effect condition when there are no effect conditions no longer crashes. --Fixes to load project - -1.1.119 --Fixed: Shifting by difference now works in both directions. --Fixed: Shifting bug introduced last version for times w/o decimals hopefully fixed. --Improvement: Times are now stored as double precision instead of single precision. - -1.1.118 --Fixed: Trying to save in various situations as opposed to save as no longer results in a crash --Fixed: $rand no longer returns 0 or gives type mismatch crashes --Fixed: Trying to move an effect up when there is no effect to move up no longer results in a crash --Fixed: Copying or moving an effect to another layer now includes the conditons. --Fixed: Shifting times should no longer mess up if a time has a decimal >= .995 (which was rounded as 1.0 before, screwing things up) - -1.1.117 --Fixed: Scripting should now properly support recursion. - -1.1.116 --Fixed bug where closing the program did not unload it from memory. --Fixed select/deselect all styles. - -1.1.115 --Added script functions: and, nand, or, nor, not, xor --Added operator info to readme --Added script testing/debugging in the help tab. This is mostly for me, but you may test your own logic on it if you like. - -1.1.114 --Fix stupid typo in new load project. Effects should correctly load now... - -1.1.113 --Fixed new project format to actually attempt to load the SSA file itself --Added a progress popup w/ cancel option for karaoke effects --Added list of variables to readme - -1.1.112 --New project format. Please only use the old format if you find bugs in the new one. --Added time shifting by difference. - -1.1.111 --Make multicharacter comparisons (!=, <>, etc) work correctly --Fixed saving a ssa file without the extension causing a crash. Really this time. - -1.1.110 --Changed to common dialog for open/save --Added version number to form title --Minor code cleanup, slightly smaller file - -1.1.109 --Removed preview in the open box because it was causing problems for some computers. --Fixed saving a ssa file without the extension causing a crash. --Added remove duplicate dialog lines option-Useful for when stripping a multilayer SSA leaves you with duplicate lines. --Added tooltips for a few things. - -1.1.108 --Minor tweaks in open/save windows --Fixed major multilayering bug introduced in build 105. - -1.1.107 --Fix (allow) removal of effect conditions. - -1.1.106 --Fix checkmarks in layer conditions tab. - -1.1.105 --Remove limit of 100 layers --Fixed condition checking --Saving/loading project now also saves conditions. --Added "layer per syllable" mode --Added ability to not add layers to the output if the conditions are not met (as opposed to adding the line unchanged) --Added "Invert Line Selection" for the SSA list. - -1.1.104 --Changed name to SSATool. --Changed the UI around. --Fixed: $iif should now work correctly when comparing numbers, as opposed to comparing them as strings --Added ability to define custom conditions specifying when each layer and each filter are used. --Added variable $karanumtot$ to tell how many syllables are on the line. - -1.0.103 --Added ability to effect only certain lines. --Added option to shift only start/end times. - -1.0.102 --Changed format of effects file and project files to get around some delimiting issues and to make more readable if you open them in a text editor. --Changed extension of project file to .pssa to get around a VB quirk (*.aas would also return .aasp files) --Added scripting functions: bound, round, int, sin, cos, tan, log, exp, abs --Calc now supports parenthesis and uses the order of operations instead of left-to-right processing. --Fixed floor behavior - -1.0.101 --Made copy/move to layer work again. --Added scripting functions: ceil, floor. math is now a synonym for calc. - -1.0.100 --Implemented simple inline scripting. Supported functions: iif, rand, randf (floating), calc (math) --Added variable $layernum$ - -1.0.99 --Fixed bug with enabling/disabling filters --Implemented save/load project, does not save layer conditions yet --Fixed saving effects list --Speedups - -1.0.98 --Finished implementing the effects editor. - -1.0.97 --The default style may now be effected. SSA by default calls Default *Default in your lines, which was screwing up the comparison. --Time shifting now correctly rounds decimals insdtead of giving you several numbers as an exponential. --Stripping a SSA will now copy lines which have unselected styles instead of leaving them out. \ No newline at end of file diff --git a/devel/SSATool/Extras/effects.exml b/devel/SSATool/Extras/effects.exml deleted file mode 100644 index 82db35a28..000000000 --- a/devel/SSATool/Extras/effects.exml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/devel/SSATool/Extras/notebox.xml b/devel/SSATool/Extras/notebox.xml deleted file mode 100644 index 02cfd8c45..000000000 --- a/devel/SSATool/Extras/notebox.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - {\pos(174,-99)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy70\t(0,500,\1a&Haa&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&HFF&)\bord3}{\p1}m 0 0 l 690 0 690 80 0 80{\p0} - {\pos(254,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy144\fscx200\t(0,500,\alpha&H00&)\t(3500,4000,,\alpha&HFF&)\bord1.5}{\p1}m 0 0 l 1 0 1 47 0 47{\p0} - {\pos(255,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy146\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 1 0 1 48 0 48{\p0} - {\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy100\t(0,500,\alpha&H40&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 700 0 700 3 0 3{\p0} - {\pos(170,-35)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 699 0 699 3 0 3{\p0} - {\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy77\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 1 0 1 93 0 93{\p0} - {\pos(868,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy77\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 1 0 1 93 0 93{\p0} - {\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy77\t(0,500,\1a&HCA&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&HFF&)\bord3}{\p1}m 0 0 l 699 0 699 93 0 93{\p0} - {\pos(184,-86)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)\1c&HFFFFFF&\3c&H000000&\bord0.5\shad1.5\b1\i1}NOTE - {\pos(264,-92)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)\fs40}%line1% - - - {\pos(174,-99)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\1a&Haa&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&HFF&)\bord3}{\p1}m 0 0 l 690 0 690 80 0 80{\p0} - {\pos(254,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy142\fscx200\t(0,500,\alpha&H00&)\t(3500,4000,,\alpha&HFF&)\bord1.5}{\p1}m 0 0 l 1 0 1 47 0 47{\p0} - {\pos(173,-41)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)\bord1.5}{\p1}m 0 0 l 82 0 82 1 0 1{\p0} - {\pos(255,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy130\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 1 0 1 48 0 48{\p0} - {\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\alpha&H50&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 700 0 700 3 0 3{\p0} - {\pos(170,28)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 699 0 699 3 0 3{\p0} - {\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 2 0 2 93 0 93{\p0} - {\pos(868,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy150\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)}{\p1}m 0 0 l 1 0 1 93 0 93{\p0} - {\pos(170,-105)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\fscy145\t(0,500,\1a&HCA&\3a&H00&\4a&H00&)\t(3500,4000,,\alpha&HFF&)\bord3}{\p1}m 0 0 l 699 0 699 93 0 93{\p0} - {\pos(184,-87)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)\1c&HFFFFFF&\3c&H000000&\bord0.5\shad1.5\b1\i1}NOTE - {\pos(264,-85)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)\fs40}%line1% - {\pos(180,-28)\fscy0\t(0,500,\fscy320)\t(3500,4000,\fscy0)\alpha&HFF&}0\N{\r\t(0,500,\alpha&H00&)\t(3500,4000,\alpha&HFF&)\fs40}%line2% - - - - - - \ No newline at end of file diff --git a/devel/SSATool/Filter.cs b/devel/SSATool/Filter.cs deleted file mode 100644 index 2f70caa5f..000000000 --- a/devel/SSATool/Filter.cs +++ /dev/null @@ -1,194 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - -using System; -using System.Collections; -using System.Collections.Generic; //.Net 2.0 - - -namespace SSATool { - - public class Filter : ConditionColl, System.Collections.Generic.IEnumerable, IEquatable { - private Filter template; - protected List fOptions; - public string Name, Code; - public bool Enabled; - - public Filter() : base() { - fOptions = new List(); - Enabled = true; - } - public Filter(List optionsList) : base() { - fOptions = optionsList; - Code = String.Empty; - } - - public Filter(string name) : this() { - Name = name; - Code = String.Empty; - } - - public Filter(string name, string code) : this() { - Name = name; - Code = code; - } - - public Filter(string name, List optionsList) - : this(optionsList) { - Name = name; - Enabled = true; - } - - bool System.IEquatable.Equals(Filter f) { - return (String.CompareOrdinal(this.Name, f.Name) == 0); - } - - public override string ToString() { - return Name; - } - - public int NumOptions { - get { return fOptions.Count; } - } - - public Filter Template { - get { return template; } - } - - public void AddOption(string Name,string Val) { - fOptions.Add(new FilterOption(Name,Val)); - } - - public void AddOption(FilterOption fo) { - fOptions.Add(fo); - } - public void SetOptionValueByIndex(int index, string val) { - if (fOptions.Count > index) fOptions[index].Value = val; - } - public void SetOptionValueByName(string name, string val) { - for (int index=0;index index) fOptions[index].Name = name; - } - public void SetOptionByIndex(int index, string name, string val) { - if (fOptions.Count > index) { - fOptions[index].Name = name; - fOptions[index].Value = val; - } - } - - public FilterOption GetOptionByIndex(int index) { - return fOptions[index]; - } - public string GetOptionValueByIndex(int index) { - return fOptions[index].Value; - } - public FilterOption GetOptionByName(string name) { - for(int index=0;index CloneOptions() { - List nl = new List(); - for(int index=0;index!=fOptions.Count;index+=1) - nl.Add((FilterOption)fOptions[index].Clone()); - return nl; - } - - public object Clone() { - Filter nf = new Filter(Name, CloneOptions()); - nf.conditionColl = CloneConditions(); - nf.template = (this.template==null)?this:this.template; - return nf; - } - - #region IEnumerable Members - IEnumerator IEnumerable.GetEnumerator() { - return new FilterEnumerator(this); - } - public System.Collections.IEnumerator GetEnumerator() { - return new FilterEnumerator(this); - } - #endregion - } - - public class FilterEnumerator : IEnumerator, IDisposable { - Filter f; - int index; - - public void Dispose() { - - } - public FilterEnumerator(Filter f) { - this.f = f; - Reset(); - } - public void Reset() { - index=-1; - } - object IEnumerator.Current { - get { return f.GetOptionByIndex(index); } - } - public FilterOption Current { - get { return f.GetOptionByIndex(index); } - } - public bool MoveNext() { - if (++index >= f.NumOptions) return false; - else return true; - } - } - - public class FilterOption : ICloneable { - public string Name; - public string Value; - - public FilterOption() { } - - public FilterOption(string name, string val) { - Name = name; - Value = val; - } - - public object Clone() { - return new FilterOption(Name,Value); - } - } - -} diff --git a/devel/SSATool/Form1.cs b/devel/SSATool/Form1.cs deleted file mode 100644 index 577a21ea2..000000000 --- a/devel/SSATool/Form1.cs +++ /dev/null @@ -1,6485 +0,0 @@ -/* -SSATool - A collection of utilities for Advanced Substation Alpha -Copyright (C) 2007 Dan Donovan - -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; ONLY under version 2 - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - - - -using System; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using System.Drawing; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Collections.Generic; - -namespace SSATool { - /// - /// Summary description for Form1. - /// - public class Form1 : System.Windows.Forms.Form { - public static Form1 FormMain; - - - #region Form Info - public System.Windows.Forms.MainMenu mainMenu1; - public System.Windows.Forms.MenuItem menuItem1; - public System.Windows.Forms.MenuItem menuItem5; - public System.Windows.Forms.MenuItem menuItem8; - public System.Windows.Forms.MenuItem menuItem10; - public System.Windows.Forms.MenuItem menuItem13; - public System.Windows.Forms.MenuItem menuItem15; - public System.Windows.Forms.MenuItem menuItem16; - public System.Windows.Forms.OpenFileDialog openFileDialog1; - public System.Windows.Forms.CheckedListBox lstEffectOpts; - public System.Windows.Forms.MenuItem menuOpen; - public System.Windows.Forms.MenuItem menuOpenSJIS; - public System.Windows.Forms.MenuItem menuSave; - public System.Windows.Forms.MenuItem menuSaveAs; - public System.Windows.Forms.MenuItem menuLoadProj; - public System.Windows.Forms.MenuItem menuSaveProj; - public System.Windows.Forms.MenuItem menuExit; - public System.Windows.Forms.MenuItem menuLoadEffects; - public System.Windows.Forms.MenuItem menuItem3; - public System.Windows.Forms.MenuItem menuShowEffectEditor; - public System.Windows.Forms.FontDialog fontDialog1; - public System.Windows.Forms.MenuItem menuFont; - public System.Windows.Forms.MenuItem menuItem2; - public System.Windows.Forms.MenuItem menuGoTo; - public System.Windows.Forms.MenuItem menuNewLineBeginning; - public System.Windows.Forms.MenuItem menuNewLineEnd; - public System.Windows.Forms.MenuItem menuNewLineAbove; - public System.Windows.Forms.MenuItem menuNewLineBelow; - public System.Windows.Forms.MenuItem menuMoveLineUp; - public System.Windows.Forms.MenuItem menuMoveLineDown; - public System.Windows.Forms.MenuItem menuChangeLine; - public System.Windows.Forms.MenuItem menuRemoveLine; - public System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; - public System.Windows.Forms.ColumnHeader columnHeader11; - private IContainer components; - public MenuItem menuItem4; - public MenuItem menuItem6; - public MenuItem menuPrecisioncs; - public MenuItem menuPrecisionms; - public MenuItem menuItem7; - public MenuItem menuItem9; - public TabPage tabPage6; - public Button button2; - public Button button1; - public TextBox textBox2; - public Button button4; - public Button button3; - public CheckBox checkBox1; - public ComboBox comboBox1; - public Label label55; - public Button button6; - public MaskedTextBox maskedTextBox1; - public CheckBox checkBox2; - public TreeView treeView1; - public MenuItem menuItem11; - public MenuItem menuUndo; - public MenuItem menuRedo; - public MenuItem menuOpenEUCJP; - public SplitContainer splitContainer1; - public ListViewES listSSA; - public ColumnHeader columnHeader14; - public TabControl tabMain; - public TabPage tabPage1; - public GroupBox groupBox12; - public ComboBox cmbFR; - public Label label54; - public GroupBox groupBox4; - public Button cmdSearchReplace; - public TextBox txtSearchReplaceWith; - public TextBox txtSearchFor; - public Label label12; - public Label label11; - public GroupBox groupBox3; - public Button cmdChangeLastKLen; - public Button cmdRemoveDups; - public Button cmdStrip; - public GroupBox groupBox2; - public Button cmdShift; - public CheckBox chkShiftNoNeg; - public CheckBox chkShiftEnd; - public CheckBox chkShiftStart; - public TabControl tabShiftType; - public TabPage tabPage9; - public MaskedTextBox maskedTextShiftTime; - public RadioButton radTShiftBack; - public RadioButton radTShiftForward; - public Label label3; - public TabPage tabPage10; - public RadioButton radFShiftBackward; - public RadioButton radFShiftForward; - public TextBox txtShiftFrames; - public Label label4; - public TabPage tabPage11; - public MaskedTextBox maskedTextTDShiftNew; - public MaskedTextBox maskedTextTDShiftOld; - public Label label7; - public Label label6; - public TabPage tabPage12; - public Label label9; - public Label label8; - public TextBox txtFDShiftNew; - public TextBox txtFDShiftOld; - public TabPage tabPage2; - public GroupBox groupBox11; - public Button cmdTimecodesDeapply; - public Button cmdTimecodesApply; - public Button cmdTimecodesBrowse; - public TextBox textTimecodeFile; - public GroupBox groupBox10; - public MaskedTextBox txtLeadOut; - public MaskedTextBox txtLeadIn; - public CheckBox chkLeadOut; - public CheckBox chkLeadIn; - public Button cmdLead; - public CheckBox chkLeadKaraEmptyK; - public CheckBox chkLeadKaraOnly; - public GroupBox groupBox6; - public CheckBox chkScalePlayRes; - public TextBox txtScaleYDenominator; - public Label label50; - public TextBox txtScaleYNumerator; - public Label label51; - public Button cmdScale; - public TextBox txtScaleXDenominator; - public Label label26; - public TextBox txtScaleXNumerator; - public Label label25; - public GroupBox groupBox5; - public Button cmdLenBasedK; - public TextBox txtLenBasedKThreshold; - public Label label13; - public TabPage tabPage3; - public Button cmdAddEffect; - public TreeView treeKaraoke; - public Button cmdNewLayer; - public Button cmdKaraDel; - public Button cmdDoEffects; - public Button cmdKaraDup; - public Panel panelLayer; - public CheckBox chkSyllablePerLine; - public GroupBox groupBox16; - public CheckBox chkKaraAddText; - public CheckBox chkKaraAddClosingBracket; - public CheckBox chkKaraAddASSA; - public CheckBox chkKaraAddK; - public TextBox textLayerRepetitions; - public Label label49; - public CheckBox chkAddOnce; - public CheckBox chkAddAnyway; - public CheckBox chkLayerPerSyllable; - public Button cmdDelLayerCondition; - public Button cmdNewLayerCondition; - public ListViewES lstLayerConditions; - public ColumnHeader columnHeader4; - public ColumnHeader columnHeader5; - public ColumnHeader columnHeader6; - public Panel panelEffect; - public TabControl tabControl1; - public TabPage tabPage7; - public ListView lstEffectOptions; - public ColumnHeader lstoOptionName; - public ColumnHeader lstoOptionValue; - public Label label2; - public TabPage tabPage8; - public ListViewES lstEffectConditions; - public ColumnHeader columnHeader1; - public ColumnHeader columnHeader2; - public ColumnHeader columnHeader3; - public Button cmdDelEffectCondition; - public Button cmdAddEffectCondition; - public TabPage tabPage4; - public Label label16; - public Label label18; - public Label label15; - public Label label14; - public Button cmdGradMoveBefore; - public TextBox txtGradOut; - public TextBox txtGradIn; - public TextBox txtGradBefore; - public TabPage tabPage14; - public Label label42; - public TextBox txtBlurRadV; - public GroupBox groupBlurAffect; - public CheckBox chkBlur4a; - public CheckBox chkBlur3a; - public CheckBox chkBlur2a; - public CheckBox chkBlur1a; - public GroupBox groupBox9; - public RadioButton radBlurExp; - public RadioButton radBlurLog; - public RadioButton radBlurPoly; - public GroupBox groupBlurSub; - public CheckBox chkBlur2aSub; - public CheckBox chkBlur4aSub; - public CheckBox chkBlur3aSub; - public CheckBox chkBlur1aSub; - public Label label38; - public TextBox txtBlurBase; - public TextBox txtBlurPos; - public Label label36; - public Button cmdBlurListToInput; - public Button cmdBlurInsertBefore; - public Button cmdBlurInsertAfter; - public Button cmdBlurReplaceLine; - public Button cmdBlurMoveBefore; - public Label label35; - public TextBox txtBlurBefore; - public TextBox txtBlurRadH; - public Label label34; - public Label label32; - public Label label31; - public TextBox txtBlurOut; - public TextBox txtBlurIn; - public GroupBox groupBox8; - public RadioButton radBlurGlow; - public RadioButton radBlurHV; - public Button cmdDoBlur; - public TextBox txtBlurEndAlpha; - public TextBox txtBlurStartAlpha; - public Label label30; - public Label label29; - public TextBox txtBlurLines; - public Label label28; - public TabPage tabPage16; - public MaskedTextBox maskedTextTransformTime; - public Button cmdTransformListToInput; - public Button cmdTransformInsertBefore; - public Button cmdTransformInsertAfter; - public Button cmdTransformReplaceLine; - public Label label45; - public TextBox txtTransformPrecision; - public Label label1; - public ListViewES listTransformVars; - public ColumnHeader columnHeader13; - public TextBox txtTransformCode; - public Label label47; - public Label label46; - public Button cmdTransformDelVar; - public Button cmdTransformNewVar; - public Button cmdDoTransform; - public Label label44; - public Button cmdTransformDelTime; - public Button cmdTransformAddTime; - public ListBox listTransformTimes; - public Label label43; - public TextBox txtTransformOut; - public TabPage tabPage13; - public ListBox lstErrors; - public Label label27; - public Button cmdCheckErrors; - public TabPage tabPage15; - public Label labelFontNum; - public Button cmdFontSearchFolder; - public Label label40; - public Button cmdFindFonts; - public Label label39; - public ListView lstFonts; - public ColumnHeader columnHeader7; - public ColumnHeader columnHeader8; - public ColumnHeader columnHeader9; - public TabPage tabPage5; - public GroupBox groupBox19; - public TextBox textBox1; - public GroupBox groupBox18; - public Label lblRegroupDestIndex; - public Label label10; - public Label lblRegroupSourceIndex; - public Label label5; - public GroupBox groupBox17; - public ListView listRegroupPairs; - public ColumnHeader columnHeader10; - public ColumnHeader columnHeader12; - public GroupBox groupBox15; - public Button cmdRegroupStart; - public Button cmdRegroupAcceptLine; - public Button cmdRegroupUnlinkLast; - public Button cmdRegroupGoBack; - public Button cmdRegroupSkipDestLine; - public Button cmdRegroupSkipSourceLine; - public Button cmdRegroupLink; - public GroupBox groupBox14; - public TextBox txtRegroupSource; - public TextBox txtRegroupDest; - public GroupBox groupBox13; - public ComboBox cmbRegroupDest; - public ComboBox cmbRegroupSource; - public Label label53; - public Label label52; - public TabPage tabPage17; - public GroupBox groupBox22; - public ComboBox cmbNBStyle; - public Label label59; - public Button cmdNBCopyStyles; - public Button cmdNBInsertBefore; - public Button cmdNBInsertAfter; - public Button cmdNBReplaceLine; - public Button cmdNoteBox; - public GroupBox groupBox21; - public TextBox textNBStyles; - public TextBox textNBOut; - public GroupBox groupBox20; - public Button cmdNBGetTimes; - public MaskedTextBox maskedTextNBEnd; - public Label label58; - public MaskedTextBox maskedTextNBStart; - public Label label57; - public TextBox textNotebox2; - public TextBox textNotebox1; - public Label label56; - public Label label48; - public GroupBox groupBox1; - public Label labelSelLine; - public Label label41; - public Button cmdReloadFile; - public CheckedListBox lstStyles; - public Button cmdSSAInvertSel; - public Button cmdSSADeselall; - public Button cmdSSASelall; - public Button cmdDeselAll; - public Button cmdSelAll; - public Button cmdNBReparse; - private CheckBox chkSRCaseSensitive; - private TextBox textNBDesc; - public Label label17; - private Panel panelGradient; - public GroupBox groupBox7; - public RadioButton radGradExp; - public RadioButton radGradLog; - public RadioButton radGradPoly; - public TextBox txtGradMirror; - public Label label33; - public Label label37; - public TextBox txtGradBase; - public CheckBox chkGrad4c; - public CheckBox chkGrad3c; - public CheckBox chkGrad2c; - public CheckBox chkGrad1c; - public Button cmdGradListToInput; - public TextBox txtGradEndBGR; - public TextBox txtGradStartBGR; - public TextBox txtGradOffset; - public TextBox txtGradEndPos; - public TextBox txtGradStartPos; - public TextBox txtGradCLines; - public Label label24; - public Label label23; - public Label label22; - public Label label21; - public Label label20; - public Label label19; - public Button cmdGradInsertBefore; - public Button cmdGradInsertAfter; - public Button cmdGradReplaceLine; - public Button cmdGradDoGrad; - private Panel panelBlur; - public MenuItem menuClearUndoRedo; - - #endregion - protected override void Dispose(bool disposing) { - base.Dispose(disposing); - } - #region Windows Form Designer generated code - private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); - this.menuItem1 = new System.Windows.Forms.MenuItem(); - this.menuOpen = new System.Windows.Forms.MenuItem(); - this.menuOpenSJIS = new System.Windows.Forms.MenuItem(); - this.menuOpenEUCJP = new System.Windows.Forms.MenuItem(); - this.menuSave = new System.Windows.Forms.MenuItem(); - this.menuSaveAs = new System.Windows.Forms.MenuItem(); - this.menuItem5 = new System.Windows.Forms.MenuItem(); - this.menuLoadProj = new System.Windows.Forms.MenuItem(); - this.menuSaveProj = new System.Windows.Forms.MenuItem(); - this.menuItem8 = new System.Windows.Forms.MenuItem(); - this.menuExit = new System.Windows.Forms.MenuItem(); - this.menuItem11 = new System.Windows.Forms.MenuItem(); - this.menuUndo = new System.Windows.Forms.MenuItem(); - this.menuRedo = new System.Windows.Forms.MenuItem(); - this.menuClearUndoRedo = new System.Windows.Forms.MenuItem(); - this.menuItem2 = new System.Windows.Forms.MenuItem(); - this.menuItem7 = new System.Windows.Forms.MenuItem(); - this.menuNewLineBeginning = new System.Windows.Forms.MenuItem(); - this.menuNewLineEnd = new System.Windows.Forms.MenuItem(); - this.menuNewLineAbove = new System.Windows.Forms.MenuItem(); - this.menuNewLineBelow = new System.Windows.Forms.MenuItem(); - this.menuItem9 = new System.Windows.Forms.MenuItem(); - this.menuMoveLineUp = new System.Windows.Forms.MenuItem(); - this.menuMoveLineDown = new System.Windows.Forms.MenuItem(); - this.menuGoTo = new System.Windows.Forms.MenuItem(); - this.menuChangeLine = new System.Windows.Forms.MenuItem(); - this.menuRemoveLine = new System.Windows.Forms.MenuItem(); - this.menuItem10 = new System.Windows.Forms.MenuItem(); - this.menuFont = new System.Windows.Forms.MenuItem(); - this.menuItem4 = new System.Windows.Forms.MenuItem(); - this.menuItem6 = new System.Windows.Forms.MenuItem(); - this.menuPrecisioncs = new System.Windows.Forms.MenuItem(); - this.menuPrecisionms = new System.Windows.Forms.MenuItem(); - this.menuItem13 = new System.Windows.Forms.MenuItem(); - this.menuShowEffectEditor = new System.Windows.Forms.MenuItem(); - this.menuItem15 = new System.Windows.Forms.MenuItem(); - this.menuItem16 = new System.Windows.Forms.MenuItem(); - this.menuItem3 = new System.Windows.Forms.MenuItem(); - this.menuLoadEffects = new System.Windows.Forms.MenuItem(); - this.tabPage6 = new System.Windows.Forms.TabPage(); - this.treeView1 = new System.Windows.Forms.TreeView(); - this.maskedTextBox1 = new System.Windows.Forms.MaskedTextBox(); - this.checkBox2 = new System.Windows.Forms.CheckBox(); - this.button6 = new System.Windows.Forms.Button(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.label55 = new System.Windows.Forms.Label(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.button4 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.columnHeader11 = new System.Windows.Forms.ColumnHeader(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.lstEffectOpts = new System.Windows.Forms.CheckedListBox(); - this.fontDialog1 = new System.Windows.Forms.FontDialog(); - this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.labelSelLine = new System.Windows.Forms.Label(); - this.label41 = new System.Windows.Forms.Label(); - this.cmdReloadFile = new System.Windows.Forms.Button(); - this.lstStyles = new System.Windows.Forms.CheckedListBox(); - this.cmdSSAInvertSel = new System.Windows.Forms.Button(); - this.cmdSSADeselall = new System.Windows.Forms.Button(); - this.cmdSSASelall = new System.Windows.Forms.Button(); - this.cmdDeselAll = new System.Windows.Forms.Button(); - this.cmdSelAll = new System.Windows.Forms.Button(); - this.listSSA = new SSATool.ListViewES(); - this.columnHeader14 = new System.Windows.Forms.ColumnHeader(); - this.tabMain = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.groupBox12 = new System.Windows.Forms.GroupBox(); - this.cmbFR = new System.Windows.Forms.ComboBox(); - this.label54 = new System.Windows.Forms.Label(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.chkSRCaseSensitive = new System.Windows.Forms.CheckBox(); - this.cmdSearchReplace = new System.Windows.Forms.Button(); - this.txtSearchReplaceWith = new System.Windows.Forms.TextBox(); - this.txtSearchFor = new System.Windows.Forms.TextBox(); - this.label12 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.cmdChangeLastKLen = new System.Windows.Forms.Button(); - this.cmdRemoveDups = new System.Windows.Forms.Button(); - this.cmdStrip = new System.Windows.Forms.Button(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.cmdShift = new System.Windows.Forms.Button(); - this.chkShiftNoNeg = new System.Windows.Forms.CheckBox(); - this.chkShiftEnd = new System.Windows.Forms.CheckBox(); - this.chkShiftStart = new System.Windows.Forms.CheckBox(); - this.tabShiftType = new System.Windows.Forms.TabControl(); - this.tabPage9 = new System.Windows.Forms.TabPage(); - this.maskedTextShiftTime = new System.Windows.Forms.MaskedTextBox(); - this.radTShiftBack = new System.Windows.Forms.RadioButton(); - this.radTShiftForward = new System.Windows.Forms.RadioButton(); - this.label3 = new System.Windows.Forms.Label(); - this.tabPage10 = new System.Windows.Forms.TabPage(); - this.radFShiftBackward = new System.Windows.Forms.RadioButton(); - this.radFShiftForward = new System.Windows.Forms.RadioButton(); - this.txtShiftFrames = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.tabPage11 = new System.Windows.Forms.TabPage(); - this.maskedTextTDShiftNew = new System.Windows.Forms.MaskedTextBox(); - this.maskedTextTDShiftOld = new System.Windows.Forms.MaskedTextBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.tabPage12 = new System.Windows.Forms.TabPage(); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.txtFDShiftNew = new System.Windows.Forms.TextBox(); - this.txtFDShiftOld = new System.Windows.Forms.TextBox(); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.groupBox11 = new System.Windows.Forms.GroupBox(); - this.cmdTimecodesDeapply = new System.Windows.Forms.Button(); - this.cmdTimecodesApply = new System.Windows.Forms.Button(); - this.cmdTimecodesBrowse = new System.Windows.Forms.Button(); - this.textTimecodeFile = new System.Windows.Forms.TextBox(); - this.groupBox10 = new System.Windows.Forms.GroupBox(); - this.txtLeadOut = new System.Windows.Forms.MaskedTextBox(); - this.txtLeadIn = new System.Windows.Forms.MaskedTextBox(); - this.chkLeadOut = new System.Windows.Forms.CheckBox(); - this.chkLeadIn = new System.Windows.Forms.CheckBox(); - this.cmdLead = new System.Windows.Forms.Button(); - this.chkLeadKaraEmptyK = new System.Windows.Forms.CheckBox(); - this.chkLeadKaraOnly = new System.Windows.Forms.CheckBox(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.chkScalePlayRes = new System.Windows.Forms.CheckBox(); - this.txtScaleYDenominator = new System.Windows.Forms.TextBox(); - this.label50 = new System.Windows.Forms.Label(); - this.txtScaleYNumerator = new System.Windows.Forms.TextBox(); - this.label51 = new System.Windows.Forms.Label(); - this.cmdScale = new System.Windows.Forms.Button(); - this.txtScaleXDenominator = new System.Windows.Forms.TextBox(); - this.label26 = new System.Windows.Forms.Label(); - this.txtScaleXNumerator = new System.Windows.Forms.TextBox(); - this.label25 = new System.Windows.Forms.Label(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.cmdLenBasedK = new System.Windows.Forms.Button(); - this.txtLenBasedKThreshold = new System.Windows.Forms.TextBox(); - this.label13 = new System.Windows.Forms.Label(); - this.tabPage3 = new System.Windows.Forms.TabPage(); - this.cmdAddEffect = new System.Windows.Forms.Button(); - this.treeKaraoke = new System.Windows.Forms.TreeView(); - this.cmdNewLayer = new System.Windows.Forms.Button(); - this.cmdKaraDel = new System.Windows.Forms.Button(); - this.cmdDoEffects = new System.Windows.Forms.Button(); - this.cmdKaraDup = new System.Windows.Forms.Button(); - this.panelEffect = new System.Windows.Forms.Panel(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage7 = new System.Windows.Forms.TabPage(); - this.lstEffectOptions = new System.Windows.Forms.ListView(); - this.lstoOptionName = new System.Windows.Forms.ColumnHeader(); - this.lstoOptionValue = new System.Windows.Forms.ColumnHeader(); - this.label2 = new System.Windows.Forms.Label(); - this.tabPage8 = new System.Windows.Forms.TabPage(); - this.lstEffectConditions = new SSATool.ListViewES(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); - this.cmdDelEffectCondition = new System.Windows.Forms.Button(); - this.cmdAddEffectCondition = new System.Windows.Forms.Button(); - this.panelLayer = new System.Windows.Forms.Panel(); - this.chkSyllablePerLine = new System.Windows.Forms.CheckBox(); - this.groupBox16 = new System.Windows.Forms.GroupBox(); - this.chkKaraAddText = new System.Windows.Forms.CheckBox(); - this.chkKaraAddClosingBracket = new System.Windows.Forms.CheckBox(); - this.chkKaraAddASSA = new System.Windows.Forms.CheckBox(); - this.chkKaraAddK = new System.Windows.Forms.CheckBox(); - this.textLayerRepetitions = new System.Windows.Forms.TextBox(); - this.label49 = new System.Windows.Forms.Label(); - this.chkAddOnce = new System.Windows.Forms.CheckBox(); - this.chkAddAnyway = new System.Windows.Forms.CheckBox(); - this.chkLayerPerSyllable = new System.Windows.Forms.CheckBox(); - this.cmdDelLayerCondition = new System.Windows.Forms.Button(); - this.cmdNewLayerCondition = new System.Windows.Forms.Button(); - this.lstLayerConditions = new SSATool.ListViewES(); - this.columnHeader4 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader5 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader6 = new System.Windows.Forms.ColumnHeader(); - this.tabPage4 = new System.Windows.Forms.TabPage(); - this.label17 = new System.Windows.Forms.Label(); - this.panelGradient = new System.Windows.Forms.Panel(); - this.txtGradCLines = new System.Windows.Forms.TextBox(); - this.cmdGradDoGrad = new System.Windows.Forms.Button(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.radGradExp = new System.Windows.Forms.RadioButton(); - this.radGradLog = new System.Windows.Forms.RadioButton(); - this.radGradPoly = new System.Windows.Forms.RadioButton(); - this.cmdGradReplaceLine = new System.Windows.Forms.Button(); - this.txtGradMirror = new System.Windows.Forms.TextBox(); - this.cmdGradInsertAfter = new System.Windows.Forms.Button(); - this.label33 = new System.Windows.Forms.Label(); - this.cmdGradInsertBefore = new System.Windows.Forms.Button(); - this.label37 = new System.Windows.Forms.Label(); - this.label19 = new System.Windows.Forms.Label(); - this.txtGradBase = new System.Windows.Forms.TextBox(); - this.label20 = new System.Windows.Forms.Label(); - this.chkGrad4c = new System.Windows.Forms.CheckBox(); - this.label21 = new System.Windows.Forms.Label(); - this.chkGrad3c = new System.Windows.Forms.CheckBox(); - this.label22 = new System.Windows.Forms.Label(); - this.chkGrad2c = new System.Windows.Forms.CheckBox(); - this.label23 = new System.Windows.Forms.Label(); - this.chkGrad1c = new System.Windows.Forms.CheckBox(); - this.label24 = new System.Windows.Forms.Label(); - this.txtGradStartPos = new System.Windows.Forms.TextBox(); - this.cmdGradListToInput = new System.Windows.Forms.Button(); - this.txtGradEndPos = new System.Windows.Forms.TextBox(); - this.txtGradEndBGR = new System.Windows.Forms.TextBox(); - this.txtGradOffset = new System.Windows.Forms.TextBox(); - this.txtGradStartBGR = new System.Windows.Forms.TextBox(); - this.label16 = new System.Windows.Forms.Label(); - this.label18 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.cmdGradMoveBefore = new System.Windows.Forms.Button(); - this.txtGradOut = new System.Windows.Forms.TextBox(); - this.txtGradIn = new System.Windows.Forms.TextBox(); - this.txtGradBefore = new System.Windows.Forms.TextBox(); - this.tabPage14 = new System.Windows.Forms.TabPage(); - this.panelBlur = new System.Windows.Forms.Panel(); - this.groupBlurAffect = new System.Windows.Forms.GroupBox(); - this.chkBlur4a = new System.Windows.Forms.CheckBox(); - this.chkBlur3a = new System.Windows.Forms.CheckBox(); - this.chkBlur2a = new System.Windows.Forms.CheckBox(); - this.chkBlur1a = new System.Windows.Forms.CheckBox(); - this.label42 = new System.Windows.Forms.Label(); - this.label28 = new System.Windows.Forms.Label(); - this.txtBlurRadV = new System.Windows.Forms.TextBox(); - this.txtBlurLines = new System.Windows.Forms.TextBox(); - this.label29 = new System.Windows.Forms.Label(); - this.groupBox9 = new System.Windows.Forms.GroupBox(); - this.radBlurExp = new System.Windows.Forms.RadioButton(); - this.radBlurLog = new System.Windows.Forms.RadioButton(); - this.radBlurPoly = new System.Windows.Forms.RadioButton(); - this.label30 = new System.Windows.Forms.Label(); - this.groupBlurSub = new System.Windows.Forms.GroupBox(); - this.chkBlur2aSub = new System.Windows.Forms.CheckBox(); - this.chkBlur4aSub = new System.Windows.Forms.CheckBox(); - this.chkBlur3aSub = new System.Windows.Forms.CheckBox(); - this.chkBlur1aSub = new System.Windows.Forms.CheckBox(); - this.txtBlurStartAlpha = new System.Windows.Forms.TextBox(); - this.label38 = new System.Windows.Forms.Label(); - this.txtBlurEndAlpha = new System.Windows.Forms.TextBox(); - this.txtBlurBase = new System.Windows.Forms.TextBox(); - this.cmdDoBlur = new System.Windows.Forms.Button(); - this.txtBlurPos = new System.Windows.Forms.TextBox(); - this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.radBlurGlow = new System.Windows.Forms.RadioButton(); - this.radBlurHV = new System.Windows.Forms.RadioButton(); - this.label36 = new System.Windows.Forms.Label(); - this.label34 = new System.Windows.Forms.Label(); - this.cmdBlurListToInput = new System.Windows.Forms.Button(); - this.txtBlurRadH = new System.Windows.Forms.TextBox(); - this.cmdBlurInsertBefore = new System.Windows.Forms.Button(); - this.cmdBlurReplaceLine = new System.Windows.Forms.Button(); - this.cmdBlurInsertAfter = new System.Windows.Forms.Button(); - this.cmdBlurMoveBefore = new System.Windows.Forms.Button(); - this.label35 = new System.Windows.Forms.Label(); - this.txtBlurBefore = new System.Windows.Forms.TextBox(); - this.label32 = new System.Windows.Forms.Label(); - this.label31 = new System.Windows.Forms.Label(); - this.txtBlurOut = new System.Windows.Forms.TextBox(); - this.txtBlurIn = new System.Windows.Forms.TextBox(); - this.tabPage16 = new System.Windows.Forms.TabPage(); - this.maskedTextTransformTime = new System.Windows.Forms.MaskedTextBox(); - this.cmdTransformListToInput = new System.Windows.Forms.Button(); - this.cmdTransformInsertBefore = new System.Windows.Forms.Button(); - this.cmdTransformInsertAfter = new System.Windows.Forms.Button(); - this.cmdTransformReplaceLine = new System.Windows.Forms.Button(); - this.label45 = new System.Windows.Forms.Label(); - this.txtTransformPrecision = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.listTransformVars = new SSATool.ListViewES(); - this.columnHeader13 = new System.Windows.Forms.ColumnHeader(); - this.txtTransformCode = new System.Windows.Forms.TextBox(); - this.label47 = new System.Windows.Forms.Label(); - this.label46 = new System.Windows.Forms.Label(); - this.cmdTransformDelVar = new System.Windows.Forms.Button(); - this.cmdTransformNewVar = new System.Windows.Forms.Button(); - this.cmdDoTransform = new System.Windows.Forms.Button(); - this.label44 = new System.Windows.Forms.Label(); - this.cmdTransformDelTime = new System.Windows.Forms.Button(); - this.cmdTransformAddTime = new System.Windows.Forms.Button(); - this.listTransformTimes = new System.Windows.Forms.ListBox(); - this.label43 = new System.Windows.Forms.Label(); - this.txtTransformOut = new System.Windows.Forms.TextBox(); - this.tabPage13 = new System.Windows.Forms.TabPage(); - this.lstErrors = new System.Windows.Forms.ListBox(); - this.label27 = new System.Windows.Forms.Label(); - this.cmdCheckErrors = new System.Windows.Forms.Button(); - this.tabPage15 = new System.Windows.Forms.TabPage(); - this.labelFontNum = new System.Windows.Forms.Label(); - this.cmdFontSearchFolder = new System.Windows.Forms.Button(); - this.label40 = new System.Windows.Forms.Label(); - this.cmdFindFonts = new System.Windows.Forms.Button(); - this.label39 = new System.Windows.Forms.Label(); - this.lstFonts = new System.Windows.Forms.ListView(); - this.columnHeader7 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader8 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader9 = new System.Windows.Forms.ColumnHeader(); - this.tabPage5 = new System.Windows.Forms.TabPage(); - this.groupBox19 = new System.Windows.Forms.GroupBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.groupBox18 = new System.Windows.Forms.GroupBox(); - this.lblRegroupDestIndex = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.lblRegroupSourceIndex = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.groupBox17 = new System.Windows.Forms.GroupBox(); - this.listRegroupPairs = new System.Windows.Forms.ListView(); - this.columnHeader10 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader12 = new System.Windows.Forms.ColumnHeader(); - this.groupBox15 = new System.Windows.Forms.GroupBox(); - this.cmdRegroupStart = new System.Windows.Forms.Button(); - this.cmdRegroupAcceptLine = new System.Windows.Forms.Button(); - this.cmdRegroupUnlinkLast = new System.Windows.Forms.Button(); - this.cmdRegroupGoBack = new System.Windows.Forms.Button(); - this.cmdRegroupSkipDestLine = new System.Windows.Forms.Button(); - this.cmdRegroupSkipSourceLine = new System.Windows.Forms.Button(); - this.cmdRegroupLink = new System.Windows.Forms.Button(); - this.groupBox14 = new System.Windows.Forms.GroupBox(); - this.txtRegroupSource = new System.Windows.Forms.TextBox(); - this.txtRegroupDest = new System.Windows.Forms.TextBox(); - this.groupBox13 = new System.Windows.Forms.GroupBox(); - this.cmbRegroupDest = new System.Windows.Forms.ComboBox(); - this.cmbRegroupSource = new System.Windows.Forms.ComboBox(); - this.label53 = new System.Windows.Forms.Label(); - this.label52 = new System.Windows.Forms.Label(); - this.tabPage17 = new System.Windows.Forms.TabPage(); - this.cmdNBReparse = new System.Windows.Forms.Button(); - this.groupBox22 = new System.Windows.Forms.GroupBox(); - this.textNBDesc = new System.Windows.Forms.TextBox(); - this.cmbNBStyle = new System.Windows.Forms.ComboBox(); - this.label59 = new System.Windows.Forms.Label(); - this.cmdNBCopyStyles = new System.Windows.Forms.Button(); - this.cmdNBInsertBefore = new System.Windows.Forms.Button(); - this.cmdNBInsertAfter = new System.Windows.Forms.Button(); - this.cmdNBReplaceLine = new System.Windows.Forms.Button(); - this.cmdNoteBox = new System.Windows.Forms.Button(); - this.groupBox21 = new System.Windows.Forms.GroupBox(); - this.textNBStyles = new System.Windows.Forms.TextBox(); - this.textNBOut = new System.Windows.Forms.TextBox(); - this.groupBox20 = new System.Windows.Forms.GroupBox(); - this.cmdNBGetTimes = new System.Windows.Forms.Button(); - this.maskedTextNBEnd = new System.Windows.Forms.MaskedTextBox(); - this.label58 = new System.Windows.Forms.Label(); - this.maskedTextNBStart = new System.Windows.Forms.MaskedTextBox(); - this.label57 = new System.Windows.Forms.Label(); - this.textNotebox2 = new System.Windows.Forms.TextBox(); - this.textNotebox1 = new System.Windows.Forms.TextBox(); - this.label56 = new System.Windows.Forms.Label(); - this.label48 = new System.Windows.Forms.Label(); - this.tabPage6.SuspendLayout(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.tabMain.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.groupBox12.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.tabShiftType.SuspendLayout(); - this.tabPage9.SuspendLayout(); - this.tabPage10.SuspendLayout(); - this.tabPage11.SuspendLayout(); - this.tabPage12.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.groupBox11.SuspendLayout(); - this.groupBox10.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.tabPage3.SuspendLayout(); - this.panelEffect.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tabPage7.SuspendLayout(); - this.tabPage8.SuspendLayout(); - this.panelLayer.SuspendLayout(); - this.groupBox16.SuspendLayout(); - this.tabPage4.SuspendLayout(); - this.panelGradient.SuspendLayout(); - this.groupBox7.SuspendLayout(); - this.tabPage14.SuspendLayout(); - this.panelBlur.SuspendLayout(); - this.groupBlurAffect.SuspendLayout(); - this.groupBox9.SuspendLayout(); - this.groupBlurSub.SuspendLayout(); - this.groupBox8.SuspendLayout(); - this.tabPage16.SuspendLayout(); - this.tabPage13.SuspendLayout(); - this.tabPage15.SuspendLayout(); - this.tabPage5.SuspendLayout(); - this.groupBox19.SuspendLayout(); - this.groupBox18.SuspendLayout(); - this.groupBox17.SuspendLayout(); - this.groupBox15.SuspendLayout(); - this.groupBox14.SuspendLayout(); - this.groupBox13.SuspendLayout(); - this.tabPage17.SuspendLayout(); - this.groupBox22.SuspendLayout(); - this.groupBox21.SuspendLayout(); - this.groupBox20.SuspendLayout(); - this.SuspendLayout(); - // - // mainMenu1 - // - this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem1, - this.menuItem11, - this.menuItem2, - this.menuItem10, - this.menuItem13}); - // - // menuItem1 - // - this.menuItem1.Index = 0; - this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuOpen, - this.menuOpenSJIS, - this.menuOpenEUCJP, - this.menuSave, - this.menuSaveAs, - this.menuItem5, - this.menuLoadProj, - this.menuSaveProj, - this.menuItem8, - this.menuExit}); - resources.ApplyResources(this.menuItem1, "menuItem1"); - // - // menuOpen - // - this.menuOpen.Index = 0; - resources.ApplyResources(this.menuOpen, "menuOpen"); - this.menuOpen.Click += new System.EventHandler(this.menuOpen_Click); - // - // menuOpenSJIS - // - this.menuOpenSJIS.Index = 1; - resources.ApplyResources(this.menuOpenSJIS, "menuOpenSJIS"); - this.menuOpenSJIS.Click += new System.EventHandler(this.menuOpenSJIS_Click); - // - // menuOpenEUCJP - // - this.menuOpenEUCJP.Index = 2; - resources.ApplyResources(this.menuOpenEUCJP, "menuOpenEUCJP"); - this.menuOpenEUCJP.Click += new System.EventHandler(this.menuOpenEUCJP_Click); - // - // menuSave - // - this.menuSave.Index = 3; - resources.ApplyResources(this.menuSave, "menuSave"); - this.menuSave.Click += new System.EventHandler(this.menuSave_Click); - // - // menuSaveAs - // - this.menuSaveAs.Index = 4; - resources.ApplyResources(this.menuSaveAs, "menuSaveAs"); - this.menuSaveAs.Click += new System.EventHandler(this.menuSaveAs_Click); - // - // menuItem5 - // - this.menuItem5.Index = 5; - resources.ApplyResources(this.menuItem5, "menuItem5"); - // - // menuLoadProj - // - this.menuLoadProj.Index = 6; - resources.ApplyResources(this.menuLoadProj, "menuLoadProj"); - this.menuLoadProj.Click += new System.EventHandler(this.menuLoadProj_Click); - // - // menuSaveProj - // - this.menuSaveProj.Index = 7; - resources.ApplyResources(this.menuSaveProj, "menuSaveProj"); - this.menuSaveProj.Click += new System.EventHandler(this.menuSaveProj_Click); - // - // menuItem8 - // - this.menuItem8.Index = 8; - resources.ApplyResources(this.menuItem8, "menuItem8"); - // - // menuExit - // - this.menuExit.Index = 9; - resources.ApplyResources(this.menuExit, "menuExit"); - this.menuExit.Click += new System.EventHandler(this.menuExit_Click); - // - // menuItem11 - // - this.menuItem11.Index = 1; - this.menuItem11.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuUndo, - this.menuRedo, - this.menuClearUndoRedo}); - resources.ApplyResources(this.menuItem11, "menuItem11"); - // - // menuUndo - // - resources.ApplyResources(this.menuUndo, "menuUndo"); - this.menuUndo.Index = 0; - this.menuUndo.Click += new System.EventHandler(this.menuUndo_Click); - // - // menuRedo - // - resources.ApplyResources(this.menuRedo, "menuRedo"); - this.menuRedo.Index = 1; - this.menuRedo.Click += new System.EventHandler(this.menuRedo_Click); - // - // menuClearUndoRedo - // - this.menuClearUndoRedo.Index = 2; - resources.ApplyResources(this.menuClearUndoRedo, "menuClearUndoRedo"); - this.menuClearUndoRedo.Click += new System.EventHandler(this.menuClearUndoRedo_Click); - // - // menuItem2 - // - this.menuItem2.Index = 2; - this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem7, - this.menuItem9, - this.menuGoTo, - this.menuChangeLine, - this.menuRemoveLine}); - resources.ApplyResources(this.menuItem2, "menuItem2"); - // - // menuItem7 - // - this.menuItem7.Index = 0; - this.menuItem7.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuNewLineBeginning, - this.menuNewLineEnd, - this.menuNewLineAbove, - this.menuNewLineBelow}); - resources.ApplyResources(this.menuItem7, "menuItem7"); - // - // menuNewLineBeginning - // - this.menuNewLineBeginning.Index = 0; - resources.ApplyResources(this.menuNewLineBeginning, "menuNewLineBeginning"); - this.menuNewLineBeginning.Click += new System.EventHandler(this.menuNewLineBeginning_Click); - // - // menuNewLineEnd - // - this.menuNewLineEnd.Index = 1; - resources.ApplyResources(this.menuNewLineEnd, "menuNewLineEnd"); - this.menuNewLineEnd.Click += new System.EventHandler(this.menuNewLineEnd_Click); - // - // menuNewLineAbove - // - this.menuNewLineAbove.Index = 2; - resources.ApplyResources(this.menuNewLineAbove, "menuNewLineAbove"); - this.menuNewLineAbove.Click += new System.EventHandler(this.menuNewLineAbove_Click); - // - // menuNewLineBelow - // - this.menuNewLineBelow.Index = 3; - resources.ApplyResources(this.menuNewLineBelow, "menuNewLineBelow"); - this.menuNewLineBelow.Click += new System.EventHandler(this.menuNewLineBelow_Click); - // - // menuItem9 - // - this.menuItem9.Index = 1; - this.menuItem9.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuMoveLineUp, - this.menuMoveLineDown}); - resources.ApplyResources(this.menuItem9, "menuItem9"); - // - // menuMoveLineUp - // - this.menuMoveLineUp.Index = 0; - resources.ApplyResources(this.menuMoveLineUp, "menuMoveLineUp"); - this.menuMoveLineUp.Click += new System.EventHandler(this.menuMoveLineUp_Click); - // - // menuMoveLineDown - // - this.menuMoveLineDown.Index = 1; - resources.ApplyResources(this.menuMoveLineDown, "menuMoveLineDown"); - this.menuMoveLineDown.Click += new System.EventHandler(this.menuMoveLineDown_Click); - // - // menuGoTo - // - this.menuGoTo.Index = 2; - resources.ApplyResources(this.menuGoTo, "menuGoTo"); - this.menuGoTo.Click += new System.EventHandler(this.menuGoTo_Click); - // - // menuChangeLine - // - this.menuChangeLine.Index = 3; - resources.ApplyResources(this.menuChangeLine, "menuChangeLine"); - this.menuChangeLine.Click += new System.EventHandler(this.menuChangeLine_Click); - // - // menuRemoveLine - // - this.menuRemoveLine.Index = 4; - resources.ApplyResources(this.menuRemoveLine, "menuRemoveLine"); - this.menuRemoveLine.Click += new System.EventHandler(this.menuRemoveLine_Click); - // - // menuItem10 - // - this.menuItem10.Index = 3; - this.menuItem10.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuFont, - this.menuItem4, - this.menuItem6}); - resources.ApplyResources(this.menuItem10, "menuItem10"); - // - // menuFont - // - this.menuFont.Index = 0; - resources.ApplyResources(this.menuFont, "menuFont"); - this.menuFont.Click += new System.EventHandler(this.menuFont_Click); - // - // menuItem4 - // - this.menuItem4.Index = 1; - resources.ApplyResources(this.menuItem4, "menuItem4"); - // - // menuItem6 - // - this.menuItem6.Index = 2; - this.menuItem6.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuPrecisioncs, - this.menuPrecisionms}); - resources.ApplyResources(this.menuItem6, "menuItem6"); - // - // menuPrecisioncs - // - this.menuPrecisioncs.Checked = true; - this.menuPrecisioncs.Index = 0; - resources.ApplyResources(this.menuPrecisioncs, "menuPrecisioncs"); - this.menuPrecisioncs.Click += new System.EventHandler(this.menuPrecisioncs_Click); - // - // menuPrecisionms - // - this.menuPrecisionms.Index = 1; - resources.ApplyResources(this.menuPrecisionms, "menuPrecisionms"); - this.menuPrecisionms.Click += new System.EventHandler(this.menuPrecisionms_Click); - // - // menuItem13 - // - this.menuItem13.Index = 4; - this.menuItem13.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuShowEffectEditor, - this.menuItem15, - this.menuItem3, - this.menuLoadEffects}); - resources.ApplyResources(this.menuItem13, "menuItem13"); - // - // menuShowEffectEditor - // - this.menuShowEffectEditor.Index = 0; - resources.ApplyResources(this.menuShowEffectEditor, "menuShowEffectEditor"); - this.menuShowEffectEditor.Click += new System.EventHandler(this.menuShowEffectsEditor_Click); - // - // menuItem15 - // - this.menuItem15.Index = 1; - this.menuItem15.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem16}); - resources.ApplyResources(this.menuItem15, "menuItem15"); - // - // menuItem16 - // - this.menuItem16.Index = 0; - resources.ApplyResources(this.menuItem16, "menuItem16"); - this.menuItem16.Click += new System.EventHandler(this.menuFilter_Click); - // - // menuItem3 - // - this.menuItem3.Index = 2; - resources.ApplyResources(this.menuItem3, "menuItem3"); - // - // menuLoadEffects - // - this.menuLoadEffects.Index = 3; - resources.ApplyResources(this.menuLoadEffects, "menuLoadEffects"); - this.menuLoadEffects.Click += new System.EventHandler(this.menuLoadEffects_Click); - // - // tabPage6 - // - this.tabPage6.Controls.Add(this.treeView1); - this.tabPage6.Controls.Add(this.maskedTextBox1); - this.tabPage6.Controls.Add(this.checkBox2); - this.tabPage6.Controls.Add(this.button6); - this.tabPage6.Controls.Add(this.comboBox1); - this.tabPage6.Controls.Add(this.label55); - this.tabPage6.Controls.Add(this.checkBox1); - this.tabPage6.Controls.Add(this.button4); - this.tabPage6.Controls.Add(this.button3); - this.tabPage6.Controls.Add(this.button2); - this.tabPage6.Controls.Add(this.button1); - this.tabPage6.Controls.Add(this.textBox2); - resources.ApplyResources(this.tabPage6, "tabPage6"); - this.tabPage6.Name = "tabPage6"; - this.tabPage6.UseVisualStyleBackColor = true; - // - // treeView1 - // - this.treeView1.LineColor = System.Drawing.Color.Empty; - resources.ApplyResources(this.treeView1, "treeView1"); - this.treeView1.Name = "treeView1"; - // - // maskedTextBox1 - // - resources.ApplyResources(this.maskedTextBox1, "maskedTextBox1"); - this.maskedTextBox1.Name = "maskedTextBox1"; - // - // checkBox2 - // - resources.ApplyResources(this.checkBox2, "checkBox2"); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.UseVisualStyleBackColor = true; - // - // button6 - // - resources.ApplyResources(this.button6, "button6"); - this.button6.Name = "button6"; - this.button6.UseVisualStyleBackColor = true; - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - resources.ApplyResources(this.comboBox1, "comboBox1"); - this.comboBox1.Name = "comboBox1"; - // - // label55 - // - resources.ApplyResources(this.label55, "label55"); - this.label55.Name = "label55"; - // - // checkBox1 - // - resources.ApplyResources(this.checkBox1, "checkBox1"); - this.checkBox1.Checked = true; - this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Name = "checkBox1"; - this.checkBox1.UseVisualStyleBackColor = true; - // - // button4 - // - resources.ApplyResources(this.button4, "button4"); - this.button4.Name = "button4"; - this.button4.UseVisualStyleBackColor = true; - // - // button3 - // - resources.ApplyResources(this.button3, "button3"); - this.button3.Name = "button3"; - this.button3.UseVisualStyleBackColor = true; - // - // button2 - // - resources.ApplyResources(this.button2, "button2"); - this.button2.Name = "button2"; - this.button2.UseCompatibleTextRendering = true; - this.button2.UseVisualStyleBackColor = true; - // - // button1 - // - resources.ApplyResources(this.button1, "button1"); - this.button1.Name = "button1"; - this.button1.UseCompatibleTextRendering = true; - this.button1.UseVisualStyleBackColor = true; - // - // textBox2 - // - resources.ApplyResources(this.textBox2, "textBox2"); - this.textBox2.Name = "textBox2"; - // - // columnHeader11 - // - resources.ApplyResources(this.columnHeader11, "columnHeader11"); - // - // lstEffectOpts - // - resources.ApplyResources(this.lstEffectOpts, "lstEffectOpts"); - this.lstEffectOpts.MultiColumn = true; - this.lstEffectOpts.Name = "lstEffectOpts"; - // - // fontDialog1 - // - this.fontDialog1.AllowVerticalFonts = false; - this.fontDialog1.ShowEffects = false; - // - // folderBrowserDialog1 - // - this.folderBrowserDialog1.ShowNewFolderButton = false; - // - // splitContainer1 - // - resources.ApplyResources(this.splitContainer1, "splitContainer1"); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.groupBox1); - this.splitContainer1.Panel1.Controls.Add(this.listSSA); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.tabMain); - this.splitContainer1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.splitContainer1_MouseDown); - this.splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitterMoved); - this.splitContainer1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.splitContainer1_MouseUp); - this.splitContainer1.SizeChanged += new System.EventHandler(this.Resize_Handler); - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.labelSelLine); - this.groupBox1.Controls.Add(this.label41); - this.groupBox1.Controls.Add(this.cmdReloadFile); - this.groupBox1.Controls.Add(this.lstStyles); - this.groupBox1.Controls.Add(this.cmdSSAInvertSel); - this.groupBox1.Controls.Add(this.cmdSSADeselall); - this.groupBox1.Controls.Add(this.cmdSSASelall); - this.groupBox1.Controls.Add(this.cmdDeselAll); - this.groupBox1.Controls.Add(this.cmdSelAll); - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.TabStop = false; - // - // labelSelLine - // - resources.ApplyResources(this.labelSelLine, "labelSelLine"); - this.labelSelLine.Name = "labelSelLine"; - // - // label41 - // - resources.ApplyResources(this.label41, "label41"); - this.label41.Name = "label41"; - // - // cmdReloadFile - // - resources.ApplyResources(this.cmdReloadFile, "cmdReloadFile"); - this.cmdReloadFile.Name = "cmdReloadFile"; - this.cmdReloadFile.UseCompatibleTextRendering = true; - this.cmdReloadFile.Click += new System.EventHandler(this.cmdReloadFile_Click); - // - // lstStyles - // - resources.ApplyResources(this.lstStyles, "lstStyles"); - this.lstStyles.Name = "lstStyles"; - this.lstStyles.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lstStyles_ItemCheck); - // - // cmdSSAInvertSel - // - resources.ApplyResources(this.cmdSSAInvertSel, "cmdSSAInvertSel"); - this.cmdSSAInvertSel.Name = "cmdSSAInvertSel"; - this.cmdSSAInvertSel.UseCompatibleTextRendering = true; - // - // cmdSSADeselall - // - resources.ApplyResources(this.cmdSSADeselall, "cmdSSADeselall"); - this.cmdSSADeselall.Name = "cmdSSADeselall"; - this.cmdSSADeselall.UseCompatibleTextRendering = true; - this.cmdSSADeselall.Click += new System.EventHandler(this.cmdSSADeselall_Click); - // - // cmdSSASelall - // - resources.ApplyResources(this.cmdSSASelall, "cmdSSASelall"); - this.cmdSSASelall.Name = "cmdSSASelall"; - this.cmdSSASelall.UseCompatibleTextRendering = true; - this.cmdSSASelall.Click += new System.EventHandler(this.cmdSSASelall_Click); - // - // cmdDeselAll - // - resources.ApplyResources(this.cmdDeselAll, "cmdDeselAll"); - this.cmdDeselAll.Name = "cmdDeselAll"; - this.cmdDeselAll.UseCompatibleTextRendering = true; - this.cmdDeselAll.Click += new System.EventHandler(this.cmdDeselAll_Click); - // - // cmdSelAll - // - resources.ApplyResources(this.cmdSelAll, "cmdSelAll"); - this.cmdSelAll.Name = "cmdSelAll"; - this.cmdSelAll.UseCompatibleTextRendering = true; - this.cmdSelAll.Click += new System.EventHandler(this.cmdSelAll_Click); - // - // listSSA - // - this.listSSA.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader14}); - this.listSSA.FullRowSelect = true; - this.listSSA.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listSSA.HideSelection = false; - this.listSSA.LabelEdit = true; - resources.ApplyResources(this.listSSA, "listSSA"); - this.listSSA.Name = "listSSA"; - this.listSSA.OwnerDraw = true; - this.listSSA.UseCompatibleStateImageBehavior = false; - this.listSSA.View = System.Windows.Forms.View.Details; - this.listSSA.VirtualMode = true; - this.listSSA.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(this.listSSA_DrawItem); - this.listSSA.DoubleClick += new System.EventHandler(this.listSSA_DoubleClick); - this.listSSA.VirtualItemsSelectionRangeChanged += new System.Windows.Forms.ListViewVirtualItemsSelectionRangeChangedEventHandler(this.listSSA_VirtualItemsSelectionRangeChanged); - this.listSSA.OnScroll += new System.Windows.Forms.ScrollEventHandler(this.listSSA_OnScroll); - this.listSSA.SelectedIndexChanged += new System.EventHandler(this.listSSA_SelectedIndexChanged); - this.listSSA.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listSSA_MouseUp); - this.listSSA.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.listSSA_ItemCheck); - this.listSSA.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.listSSA_RetrieveVirtualItem); - this.listSSA.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listSSA_ItemSelectionChanged); - this.listSSA.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listSSA_KeyPress); - this.listSSA.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listSSA_KeyUp); - // - // columnHeader14 - // - resources.ApplyResources(this.columnHeader14, "columnHeader14"); - // - // tabMain - // - this.tabMain.Controls.Add(this.tabPage1); - this.tabMain.Controls.Add(this.tabPage2); - this.tabMain.Controls.Add(this.tabPage3); - this.tabMain.Controls.Add(this.tabPage4); - this.tabMain.Controls.Add(this.tabPage14); - this.tabMain.Controls.Add(this.tabPage16); - this.tabMain.Controls.Add(this.tabPage13); - this.tabMain.Controls.Add(this.tabPage15); - this.tabMain.Controls.Add(this.tabPage5); - this.tabMain.Controls.Add(this.tabPage17); - resources.ApplyResources(this.tabMain, "tabMain"); - this.tabMain.Name = "tabMain"; - this.tabMain.SelectedIndex = 0; - this.tabMain.Resize += new System.EventHandler(this.tabMain_Resize); - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.groupBox12); - this.tabPage1.Controls.Add(this.groupBox4); - this.tabPage1.Controls.Add(this.groupBox3); - this.tabPage1.Controls.Add(this.groupBox2); - resources.ApplyResources(this.tabPage1, "tabPage1"); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // groupBox12 - // - this.groupBox12.Controls.Add(this.cmbFR); - this.groupBox12.Controls.Add(this.label54); - resources.ApplyResources(this.groupBox12, "groupBox12"); - this.groupBox12.Name = "groupBox12"; - this.groupBox12.TabStop = false; - // - // cmbFR - // - this.cmbFR.FormattingEnabled = true; - this.cmbFR.Items.AddRange(new object[] { - resources.GetString("cmbFR.Items"), - resources.GetString("cmbFR.Items1"), - resources.GetString("cmbFR.Items2"), - resources.GetString("cmbFR.Items3"), - resources.GetString("cmbFR.Items4"), - resources.GetString("cmbFR.Items5"), - resources.GetString("cmbFR.Items6"), - resources.GetString("cmbFR.Items7")}); - resources.ApplyResources(this.cmbFR, "cmbFR"); - this.cmbFR.Name = "cmbFR"; - // - // label54 - // - resources.ApplyResources(this.label54, "label54"); - this.label54.Name = "label54"; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.chkSRCaseSensitive); - this.groupBox4.Controls.Add(this.cmdSearchReplace); - this.groupBox4.Controls.Add(this.txtSearchReplaceWith); - this.groupBox4.Controls.Add(this.txtSearchFor); - this.groupBox4.Controls.Add(this.label12); - this.groupBox4.Controls.Add(this.label11); - resources.ApplyResources(this.groupBox4, "groupBox4"); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.TabStop = false; - // - // chkSRCaseSensitive - // - resources.ApplyResources(this.chkSRCaseSensitive, "chkSRCaseSensitive"); - this.chkSRCaseSensitive.Name = "chkSRCaseSensitive"; - this.chkSRCaseSensitive.UseVisualStyleBackColor = true; - // - // cmdSearchReplace - // - resources.ApplyResources(this.cmdSearchReplace, "cmdSearchReplace"); - this.cmdSearchReplace.Name = "cmdSearchReplace"; - this.cmdSearchReplace.Click += new System.EventHandler(this.cmdSearchReplace_Click); - // - // txtSearchReplaceWith - // - resources.ApplyResources(this.txtSearchReplaceWith, "txtSearchReplaceWith"); - this.txtSearchReplaceWith.Name = "txtSearchReplaceWith"; - // - // txtSearchFor - // - resources.ApplyResources(this.txtSearchFor, "txtSearchFor"); - this.txtSearchFor.Name = "txtSearchFor"; - // - // label12 - // - resources.ApplyResources(this.label12, "label12"); - this.label12.Name = "label12"; - // - // label11 - // - resources.ApplyResources(this.label11, "label11"); - this.label11.Name = "label11"; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.cmdChangeLastKLen); - this.groupBox3.Controls.Add(this.cmdRemoveDups); - this.groupBox3.Controls.Add(this.cmdStrip); - resources.ApplyResources(this.groupBox3, "groupBox3"); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.TabStop = false; - // - // cmdChangeLastKLen - // - resources.ApplyResources(this.cmdChangeLastKLen, "cmdChangeLastKLen"); - this.cmdChangeLastKLen.Name = "cmdChangeLastKLen"; - this.cmdChangeLastKLen.Click += new System.EventHandler(this.cmdChangeLastKLen_Click); - // - // cmdRemoveDups - // - resources.ApplyResources(this.cmdRemoveDups, "cmdRemoveDups"); - this.cmdRemoveDups.Name = "cmdRemoveDups"; - this.cmdRemoveDups.Click += new System.EventHandler(this.cmdRemoveDups_Click); - // - // cmdStrip - // - resources.ApplyResources(this.cmdStrip, "cmdStrip"); - this.cmdStrip.Name = "cmdStrip"; - this.cmdStrip.Click += new System.EventHandler(this.cmdStrip_Click); - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.cmdShift); - this.groupBox2.Controls.Add(this.chkShiftNoNeg); - this.groupBox2.Controls.Add(this.chkShiftEnd); - this.groupBox2.Controls.Add(this.chkShiftStart); - this.groupBox2.Controls.Add(this.tabShiftType); - resources.ApplyResources(this.groupBox2, "groupBox2"); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.TabStop = false; - // - // cmdShift - // - resources.ApplyResources(this.cmdShift, "cmdShift"); - this.cmdShift.Name = "cmdShift"; - this.cmdShift.Click += new System.EventHandler(this.cmdShift_Click); - // - // chkShiftNoNeg - // - this.chkShiftNoNeg.Checked = true; - this.chkShiftNoNeg.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkShiftNoNeg, "chkShiftNoNeg"); - this.chkShiftNoNeg.Name = "chkShiftNoNeg"; - // - // chkShiftEnd - // - this.chkShiftEnd.Checked = true; - this.chkShiftEnd.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkShiftEnd, "chkShiftEnd"); - this.chkShiftEnd.Name = "chkShiftEnd"; - // - // chkShiftStart - // - this.chkShiftStart.Checked = true; - this.chkShiftStart.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkShiftStart, "chkShiftStart"); - this.chkShiftStart.Name = "chkShiftStart"; - // - // tabShiftType - // - resources.ApplyResources(this.tabShiftType, "tabShiftType"); - this.tabShiftType.Controls.Add(this.tabPage9); - this.tabShiftType.Controls.Add(this.tabPage10); - this.tabShiftType.Controls.Add(this.tabPage11); - this.tabShiftType.Controls.Add(this.tabPage12); - this.tabShiftType.Name = "tabShiftType"; - this.tabShiftType.SelectedIndex = 0; - // - // tabPage9 - // - this.tabPage9.Controls.Add(this.maskedTextShiftTime); - this.tabPage9.Controls.Add(this.radTShiftBack); - this.tabPage9.Controls.Add(this.radTShiftForward); - this.tabPage9.Controls.Add(this.label3); - resources.ApplyResources(this.tabPage9, "tabPage9"); - this.tabPage9.Name = "tabPage9"; - // - // maskedTextShiftTime - // - resources.ApplyResources(this.maskedTextShiftTime, "maskedTextShiftTime"); - this.maskedTextShiftTime.Name = "maskedTextShiftTime"; - this.maskedTextShiftTime.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // radTShiftBack - // - resources.ApplyResources(this.radTShiftBack, "radTShiftBack"); - this.radTShiftBack.Name = "radTShiftBack"; - // - // radTShiftForward - // - this.radTShiftForward.Checked = true; - resources.ApplyResources(this.radTShiftForward, "radTShiftForward"); - this.radTShiftForward.Name = "radTShiftForward"; - this.radTShiftForward.TabStop = true; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; - // - // tabPage10 - // - this.tabPage10.Controls.Add(this.radFShiftBackward); - this.tabPage10.Controls.Add(this.radFShiftForward); - this.tabPage10.Controls.Add(this.txtShiftFrames); - this.tabPage10.Controls.Add(this.label4); - resources.ApplyResources(this.tabPage10, "tabPage10"); - this.tabPage10.Name = "tabPage10"; - // - // radFShiftBackward - // - resources.ApplyResources(this.radFShiftBackward, "radFShiftBackward"); - this.radFShiftBackward.Name = "radFShiftBackward"; - // - // radFShiftForward - // - this.radFShiftForward.Checked = true; - resources.ApplyResources(this.radFShiftForward, "radFShiftForward"); - this.radFShiftForward.Name = "radFShiftForward"; - this.radFShiftForward.TabStop = true; - // - // txtShiftFrames - // - resources.ApplyResources(this.txtShiftFrames, "txtShiftFrames"); - this.txtShiftFrames.Name = "txtShiftFrames"; - // - // label4 - // - resources.ApplyResources(this.label4, "label4"); - this.label4.Name = "label4"; - // - // tabPage11 - // - this.tabPage11.Controls.Add(this.maskedTextTDShiftNew); - this.tabPage11.Controls.Add(this.maskedTextTDShiftOld); - this.tabPage11.Controls.Add(this.label7); - this.tabPage11.Controls.Add(this.label6); - resources.ApplyResources(this.tabPage11, "tabPage11"); - this.tabPage11.Name = "tabPage11"; - // - // maskedTextTDShiftNew - // - resources.ApplyResources(this.maskedTextTDShiftNew, "maskedTextTDShiftNew"); - this.maskedTextTDShiftNew.Name = "maskedTextTDShiftNew"; - this.maskedTextTDShiftNew.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // maskedTextTDShiftOld - // - resources.ApplyResources(this.maskedTextTDShiftOld, "maskedTextTDShiftOld"); - this.maskedTextTDShiftOld.Name = "maskedTextTDShiftOld"; - this.maskedTextTDShiftOld.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // label7 - // - resources.ApplyResources(this.label7, "label7"); - this.label7.Name = "label7"; - // - // label6 - // - resources.ApplyResources(this.label6, "label6"); - this.label6.Name = "label6"; - // - // tabPage12 - // - this.tabPage12.Controls.Add(this.label9); - this.tabPage12.Controls.Add(this.label8); - this.tabPage12.Controls.Add(this.txtFDShiftNew); - this.tabPage12.Controls.Add(this.txtFDShiftOld); - resources.ApplyResources(this.tabPage12, "tabPage12"); - this.tabPage12.Name = "tabPage12"; - // - // label9 - // - resources.ApplyResources(this.label9, "label9"); - this.label9.Name = "label9"; - // - // label8 - // - resources.ApplyResources(this.label8, "label8"); - this.label8.Name = "label8"; - // - // txtFDShiftNew - // - resources.ApplyResources(this.txtFDShiftNew, "txtFDShiftNew"); - this.txtFDShiftNew.Name = "txtFDShiftNew"; - // - // txtFDShiftOld - // - resources.ApplyResources(this.txtFDShiftOld, "txtFDShiftOld"); - this.txtFDShiftOld.Name = "txtFDShiftOld"; - // - // tabPage2 - // - this.tabPage2.Controls.Add(this.groupBox11); - this.tabPage2.Controls.Add(this.groupBox10); - this.tabPage2.Controls.Add(this.groupBox6); - this.tabPage2.Controls.Add(this.groupBox5); - resources.ApplyResources(this.tabPage2, "tabPage2"); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // groupBox11 - // - this.groupBox11.Controls.Add(this.cmdTimecodesDeapply); - this.groupBox11.Controls.Add(this.cmdTimecodesApply); - this.groupBox11.Controls.Add(this.cmdTimecodesBrowse); - this.groupBox11.Controls.Add(this.textTimecodeFile); - resources.ApplyResources(this.groupBox11, "groupBox11"); - this.groupBox11.Name = "groupBox11"; - this.groupBox11.TabStop = false; - // - // cmdTimecodesDeapply - // - resources.ApplyResources(this.cmdTimecodesDeapply, "cmdTimecodesDeapply"); - this.cmdTimecodesDeapply.Name = "cmdTimecodesDeapply"; - this.cmdTimecodesDeapply.UseVisualStyleBackColor = true; - this.cmdTimecodesDeapply.Click += new System.EventHandler(this.cmdTimecodesDeapply_Click); - // - // cmdTimecodesApply - // - resources.ApplyResources(this.cmdTimecodesApply, "cmdTimecodesApply"); - this.cmdTimecodesApply.Name = "cmdTimecodesApply"; - this.cmdTimecodesApply.UseVisualStyleBackColor = true; - this.cmdTimecodesApply.Click += new System.EventHandler(this.cmdTimecodesApply_Click); - // - // cmdTimecodesBrowse - // - resources.ApplyResources(this.cmdTimecodesBrowse, "cmdTimecodesBrowse"); - this.cmdTimecodesBrowse.Name = "cmdTimecodesBrowse"; - this.cmdTimecodesBrowse.UseCompatibleTextRendering = true; - this.cmdTimecodesBrowse.UseVisualStyleBackColor = true; - this.cmdTimecodesBrowse.Click += new System.EventHandler(this.cmdTimecodesBrowse_Click); - // - // textTimecodeFile - // - resources.ApplyResources(this.textTimecodeFile, "textTimecodeFile"); - this.textTimecodeFile.Name = "textTimecodeFile"; - // - // groupBox10 - // - this.groupBox10.Controls.Add(this.txtLeadOut); - this.groupBox10.Controls.Add(this.txtLeadIn); - this.groupBox10.Controls.Add(this.chkLeadOut); - this.groupBox10.Controls.Add(this.chkLeadIn); - this.groupBox10.Controls.Add(this.cmdLead); - this.groupBox10.Controls.Add(this.chkLeadKaraEmptyK); - this.groupBox10.Controls.Add(this.chkLeadKaraOnly); - resources.ApplyResources(this.groupBox10, "groupBox10"); - this.groupBox10.Name = "groupBox10"; - this.groupBox10.TabStop = false; - // - // txtLeadOut - // - resources.ApplyResources(this.txtLeadOut, "txtLeadOut"); - this.txtLeadOut.Name = "txtLeadOut"; - this.txtLeadOut.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // txtLeadIn - // - resources.ApplyResources(this.txtLeadIn, "txtLeadIn"); - this.txtLeadIn.Name = "txtLeadIn"; - this.txtLeadIn.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // chkLeadOut - // - resources.ApplyResources(this.chkLeadOut, "chkLeadOut"); - this.chkLeadOut.Name = "chkLeadOut"; - this.chkLeadOut.UseCompatibleTextRendering = true; - this.chkLeadOut.UseVisualStyleBackColor = true; - // - // chkLeadIn - // - resources.ApplyResources(this.chkLeadIn, "chkLeadIn"); - this.chkLeadIn.Name = "chkLeadIn"; - this.chkLeadIn.UseCompatibleTextRendering = true; - this.chkLeadIn.UseVisualStyleBackColor = true; - // - // cmdLead - // - resources.ApplyResources(this.cmdLead, "cmdLead"); - this.cmdLead.Name = "cmdLead"; - this.cmdLead.UseVisualStyleBackColor = true; - this.cmdLead.Click += new System.EventHandler(this.cmdLead_Click); - // - // chkLeadKaraEmptyK - // - resources.ApplyResources(this.chkLeadKaraEmptyK, "chkLeadKaraEmptyK"); - this.chkLeadKaraEmptyK.Name = "chkLeadKaraEmptyK"; - this.chkLeadKaraEmptyK.UseVisualStyleBackColor = true; - // - // chkLeadKaraOnly - // - resources.ApplyResources(this.chkLeadKaraOnly, "chkLeadKaraOnly"); - this.chkLeadKaraOnly.Name = "chkLeadKaraOnly"; - this.chkLeadKaraOnly.UseVisualStyleBackColor = true; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.chkScalePlayRes); - this.groupBox6.Controls.Add(this.txtScaleYDenominator); - this.groupBox6.Controls.Add(this.label50); - this.groupBox6.Controls.Add(this.txtScaleYNumerator); - this.groupBox6.Controls.Add(this.label51); - this.groupBox6.Controls.Add(this.cmdScale); - this.groupBox6.Controls.Add(this.txtScaleXDenominator); - this.groupBox6.Controls.Add(this.label26); - this.groupBox6.Controls.Add(this.txtScaleXNumerator); - this.groupBox6.Controls.Add(this.label25); - resources.ApplyResources(this.groupBox6, "groupBox6"); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.TabStop = false; - // - // chkScalePlayRes - // - resources.ApplyResources(this.chkScalePlayRes, "chkScalePlayRes"); - this.chkScalePlayRes.Name = "chkScalePlayRes"; - this.chkScalePlayRes.UseVisualStyleBackColor = true; - // - // txtScaleYDenominator - // - resources.ApplyResources(this.txtScaleYDenominator, "txtScaleYDenominator"); - this.txtScaleYDenominator.Name = "txtScaleYDenominator"; - // - // label50 - // - resources.ApplyResources(this.label50, "label50"); - this.label50.Name = "label50"; - // - // txtScaleYNumerator - // - resources.ApplyResources(this.txtScaleYNumerator, "txtScaleYNumerator"); - this.txtScaleYNumerator.Name = "txtScaleYNumerator"; - // - // label51 - // - resources.ApplyResources(this.label51, "label51"); - this.label51.Name = "label51"; - // - // cmdScale - // - resources.ApplyResources(this.cmdScale, "cmdScale"); - this.cmdScale.Name = "cmdScale"; - this.cmdScale.Click += new System.EventHandler(this.cmdScale_Click); - // - // txtScaleXDenominator - // - resources.ApplyResources(this.txtScaleXDenominator, "txtScaleXDenominator"); - this.txtScaleXDenominator.Name = "txtScaleXDenominator"; - // - // label26 - // - resources.ApplyResources(this.label26, "label26"); - this.label26.Name = "label26"; - // - // txtScaleXNumerator - // - resources.ApplyResources(this.txtScaleXNumerator, "txtScaleXNumerator"); - this.txtScaleXNumerator.Name = "txtScaleXNumerator"; - // - // label25 - // - resources.ApplyResources(this.label25, "label25"); - this.label25.Name = "label25"; - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.cmdLenBasedK); - this.groupBox5.Controls.Add(this.txtLenBasedKThreshold); - this.groupBox5.Controls.Add(this.label13); - resources.ApplyResources(this.groupBox5, "groupBox5"); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.TabStop = false; - // - // cmdLenBasedK - // - resources.ApplyResources(this.cmdLenBasedK, "cmdLenBasedK"); - this.cmdLenBasedK.Name = "cmdLenBasedK"; - this.cmdLenBasedK.Click += new System.EventHandler(this.cmdLenBasedK_Click); - // - // txtLenBasedKThreshold - // - resources.ApplyResources(this.txtLenBasedKThreshold, "txtLenBasedKThreshold"); - this.txtLenBasedKThreshold.Name = "txtLenBasedKThreshold"; - // - // label13 - // - resources.ApplyResources(this.label13, "label13"); - this.label13.Name = "label13"; - // - // tabPage3 - // - this.tabPage3.Controls.Add(this.cmdAddEffect); - this.tabPage3.Controls.Add(this.treeKaraoke); - this.tabPage3.Controls.Add(this.cmdNewLayer); - this.tabPage3.Controls.Add(this.cmdKaraDel); - this.tabPage3.Controls.Add(this.cmdDoEffects); - this.tabPage3.Controls.Add(this.cmdKaraDup); - this.tabPage3.Controls.Add(this.panelEffect); - this.tabPage3.Controls.Add(this.panelLayer); - resources.ApplyResources(this.tabPage3, "tabPage3"); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.UseVisualStyleBackColor = true; - // - // cmdAddEffect - // - resources.ApplyResources(this.cmdAddEffect, "cmdAddEffect"); - this.cmdAddEffect.Name = "cmdAddEffect"; - this.cmdAddEffect.Click += new System.EventHandler(this.cmdAddEffect_Click); - // - // treeKaraoke - // - this.treeKaraoke.AllowDrop = true; - this.treeKaraoke.CheckBoxes = true; - this.treeKaraoke.HideSelection = false; - resources.ApplyResources(this.treeKaraoke, "treeKaraoke"); - this.treeKaraoke.ItemHeight = 18; - this.treeKaraoke.LabelEdit = true; - this.treeKaraoke.Name = "treeKaraoke"; - this.treeKaraoke.ShowPlusMinus = false; - this.treeKaraoke.ShowRootLines = false; - this.treeKaraoke.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeKaraoke_AfterCheck); - this.treeKaraoke.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeKaraoke_DragDrop); - this.treeKaraoke.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.treeKaraoke_AfterLabelEdit); - this.treeKaraoke.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeKaraoke_AfterSelect); - this.treeKaraoke.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeKaraoke_DragEnter); - this.treeKaraoke.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeKaraoke_ItemDrag); - // - // cmdNewLayer - // - resources.ApplyResources(this.cmdNewLayer, "cmdNewLayer"); - this.cmdNewLayer.Name = "cmdNewLayer"; - this.cmdNewLayer.Click += new System.EventHandler(this.cmdNewLayer_Click); - // - // cmdKaraDel - // - resources.ApplyResources(this.cmdKaraDel, "cmdKaraDel"); - this.cmdKaraDel.Name = "cmdKaraDel"; - this.cmdKaraDel.Click += new System.EventHandler(this.cmdKaraDel_Click); - // - // cmdDoEffects - // - resources.ApplyResources(this.cmdDoEffects, "cmdDoEffects"); - this.cmdDoEffects.Name = "cmdDoEffects"; - this.cmdDoEffects.Click += new System.EventHandler(this.cmdDoEffects_Click); - // - // cmdKaraDup - // - resources.ApplyResources(this.cmdKaraDup, "cmdKaraDup"); - this.cmdKaraDup.Name = "cmdKaraDup"; - this.cmdKaraDup.Click += new System.EventHandler(this.cmdKaraDup_Click); - // - // panelEffect - // - this.panelEffect.Controls.Add(this.tabControl1); - resources.ApplyResources(this.panelEffect, "panelEffect"); - this.panelEffect.Name = "panelEffect"; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage7); - this.tabControl1.Controls.Add(this.tabPage8); - resources.ApplyResources(this.tabControl1, "tabControl1"); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - // - // tabPage7 - // - this.tabPage7.Controls.Add(this.lstEffectOptions); - this.tabPage7.Controls.Add(this.label2); - resources.ApplyResources(this.tabPage7, "tabPage7"); - this.tabPage7.Name = "tabPage7"; - // - // lstEffectOptions - // - resources.ApplyResources(this.lstEffectOptions, "lstEffectOptions"); - this.lstEffectOptions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.lstoOptionName, - this.lstoOptionValue}); - this.lstEffectOptions.FullRowSelect = true; - this.lstEffectOptions.GridLines = true; - this.lstEffectOptions.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lstEffectOptions.MultiSelect = false; - this.lstEffectOptions.Name = "lstEffectOptions"; - this.lstEffectOptions.UseCompatibleStateImageBehavior = false; - this.lstEffectOptions.View = System.Windows.Forms.View.Details; - this.lstEffectOptions.Click += new System.EventHandler(this.lstEffectOptions_Click); - // - // lstoOptionName - // - resources.ApplyResources(this.lstoOptionName, "lstoOptionName"); - // - // lstoOptionValue - // - resources.ApplyResources(this.lstoOptionValue, "lstoOptionValue"); - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // tabPage8 - // - this.tabPage8.Controls.Add(this.lstEffectConditions); - this.tabPage8.Controls.Add(this.cmdDelEffectCondition); - this.tabPage8.Controls.Add(this.cmdAddEffectCondition); - resources.ApplyResources(this.tabPage8, "tabPage8"); - this.tabPage8.Name = "tabPage8"; - // - // lstEffectConditions - // - this.lstEffectConditions.AutoArrange = false; - this.lstEffectConditions.CheckBoxes = true; - this.lstEffectConditions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2, - this.columnHeader3}); - this.lstEffectConditions.FullRowSelect = true; - this.lstEffectConditions.GridLines = true; - this.lstEffectConditions.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lstEffectConditions.HideSelection = false; - this.lstEffectConditions.LabelEdit = true; - resources.ApplyResources(this.lstEffectConditions, "lstEffectConditions"); - this.lstEffectConditions.MultiSelect = false; - this.lstEffectConditions.Name = "lstEffectConditions"; - this.lstEffectConditions.UseCompatibleStateImageBehavior = false; - this.lstEffectConditions.View = System.Windows.Forms.View.Details; - this.lstEffectConditions.SubItemClicked += new SSATool.ListViewES.LabelSubEditEventHandler(this.lstEffectConditions_SubItemClicked); - this.lstEffectConditions.SubItemEndEditing += new SSATool.ListViewES.LabelSubEditEndEventHandler(this.lstEffectConditions_SubItemEndEditing); - // - // columnHeader1 - // - resources.ApplyResources(this.columnHeader1, "columnHeader1"); - // - // columnHeader2 - // - resources.ApplyResources(this.columnHeader2, "columnHeader2"); - // - // columnHeader3 - // - resources.ApplyResources(this.columnHeader3, "columnHeader3"); - // - // cmdDelEffectCondition - // - resources.ApplyResources(this.cmdDelEffectCondition, "cmdDelEffectCondition"); - this.cmdDelEffectCondition.Name = "cmdDelEffectCondition"; - this.cmdDelEffectCondition.Click += new System.EventHandler(this.cmdDelEffectCondition_Click); - // - // cmdAddEffectCondition - // - resources.ApplyResources(this.cmdAddEffectCondition, "cmdAddEffectCondition"); - this.cmdAddEffectCondition.Name = "cmdAddEffectCondition"; - this.cmdAddEffectCondition.Click += new System.EventHandler(this.cmdAddEffectCondition_Click); - // - // panelLayer - // - this.panelLayer.Controls.Add(this.chkSyllablePerLine); - this.panelLayer.Controls.Add(this.groupBox16); - this.panelLayer.Controls.Add(this.textLayerRepetitions); - this.panelLayer.Controls.Add(this.label49); - this.panelLayer.Controls.Add(this.chkAddOnce); - this.panelLayer.Controls.Add(this.chkAddAnyway); - this.panelLayer.Controls.Add(this.chkLayerPerSyllable); - this.panelLayer.Controls.Add(this.cmdDelLayerCondition); - this.panelLayer.Controls.Add(this.cmdNewLayerCondition); - this.panelLayer.Controls.Add(this.lstLayerConditions); - resources.ApplyResources(this.panelLayer, "panelLayer"); - this.panelLayer.Name = "panelLayer"; - // - // chkSyllablePerLine - // - resources.ApplyResources(this.chkSyllablePerLine, "chkSyllablePerLine"); - this.chkSyllablePerLine.Name = "chkSyllablePerLine"; - this.chkSyllablePerLine.UseVisualStyleBackColor = true; - this.chkSyllablePerLine.CheckedChanged += new System.EventHandler(this.chkSyllablePerLine_CheckedChanged); - // - // groupBox16 - // - this.groupBox16.Controls.Add(this.chkKaraAddText); - this.groupBox16.Controls.Add(this.chkKaraAddClosingBracket); - this.groupBox16.Controls.Add(this.chkKaraAddASSA); - this.groupBox16.Controls.Add(this.chkKaraAddK); - resources.ApplyResources(this.groupBox16, "groupBox16"); - this.groupBox16.Name = "groupBox16"; - this.groupBox16.TabStop = false; - // - // chkKaraAddText - // - resources.ApplyResources(this.chkKaraAddText, "chkKaraAddText"); - this.chkKaraAddText.Checked = true; - this.chkKaraAddText.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkKaraAddText.Name = "chkKaraAddText"; - this.chkKaraAddText.UseVisualStyleBackColor = true; - this.chkKaraAddText.CheckedChanged += new System.EventHandler(this.chkKaraAddText_CheckedChanged); - // - // chkKaraAddClosingBracket - // - resources.ApplyResources(this.chkKaraAddClosingBracket, "chkKaraAddClosingBracket"); - this.chkKaraAddClosingBracket.Checked = true; - this.chkKaraAddClosingBracket.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkKaraAddClosingBracket.Name = "chkKaraAddClosingBracket"; - this.chkKaraAddClosingBracket.UseVisualStyleBackColor = true; - this.chkKaraAddClosingBracket.CheckedChanged += new System.EventHandler(this.chkKaraAddClosingBracket_CheckedChanged); - // - // chkKaraAddASSA - // - resources.ApplyResources(this.chkKaraAddASSA, "chkKaraAddASSA"); - this.chkKaraAddASSA.Checked = true; - this.chkKaraAddASSA.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkKaraAddASSA.Name = "chkKaraAddASSA"; - this.chkKaraAddASSA.UseVisualStyleBackColor = true; - this.chkKaraAddASSA.CheckedChanged += new System.EventHandler(this.chkKaraAddASSA_CheckedChanged); - // - // chkKaraAddK - // - resources.ApplyResources(this.chkKaraAddK, "chkKaraAddK"); - this.chkKaraAddK.Checked = true; - this.chkKaraAddK.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkKaraAddK.Name = "chkKaraAddK"; - this.chkKaraAddK.UseVisualStyleBackColor = true; - this.chkKaraAddK.CheckedChanged += new System.EventHandler(this.chkKaraAddK_CheckedChanged); - // - // textLayerRepetitions - // - resources.ApplyResources(this.textLayerRepetitions, "textLayerRepetitions"); - this.textLayerRepetitions.Name = "textLayerRepetitions"; - this.textLayerRepetitions.Leave += new System.EventHandler(this.textLayerRepetitions_Leave); - this.textLayerRepetitions.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textLayerRepetitions_KeyPress); - // - // label49 - // - resources.ApplyResources(this.label49, "label49"); - this.label49.Name = "label49"; - this.label49.UseCompatibleTextRendering = true; - // - // chkAddOnce - // - resources.ApplyResources(this.chkAddOnce, "chkAddOnce"); - this.chkAddOnce.Name = "chkAddOnce"; - this.chkAddOnce.UseCompatibleTextRendering = true; - this.chkAddOnce.CheckedChanged += new System.EventHandler(this.chkAddOnce_CheckedChanged); - // - // chkAddAnyway - // - resources.ApplyResources(this.chkAddAnyway, "chkAddAnyway"); - this.chkAddAnyway.Name = "chkAddAnyway"; - this.chkAddAnyway.UseCompatibleTextRendering = true; - this.chkAddAnyway.CheckedChanged += new System.EventHandler(this.chkAddAnyway_CheckedChanged); - // - // chkLayerPerSyllable - // - resources.ApplyResources(this.chkLayerPerSyllable, "chkLayerPerSyllable"); - this.chkLayerPerSyllable.Name = "chkLayerPerSyllable"; - this.chkLayerPerSyllable.UseCompatibleTextRendering = true; - this.chkLayerPerSyllable.CheckedChanged += new System.EventHandler(this.chkLayerPerSyllable_CheckedChanged); - // - // cmdDelLayerCondition - // - resources.ApplyResources(this.cmdDelLayerCondition, "cmdDelLayerCondition"); - this.cmdDelLayerCondition.Name = "cmdDelLayerCondition"; - this.cmdDelLayerCondition.Click += new System.EventHandler(this.cmdDelLayerCondition_Click); - // - // cmdNewLayerCondition - // - resources.ApplyResources(this.cmdNewLayerCondition, "cmdNewLayerCondition"); - this.cmdNewLayerCondition.Name = "cmdNewLayerCondition"; - this.cmdNewLayerCondition.Click += new System.EventHandler(this.cmdNewLayerCondition_Click); - // - // lstLayerConditions - // - this.lstLayerConditions.AutoArrange = false; - this.lstLayerConditions.CheckBoxes = true; - this.lstLayerConditions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader4, - this.columnHeader5, - this.columnHeader6}); - resources.ApplyResources(this.lstLayerConditions, "lstLayerConditions"); - this.lstLayerConditions.FullRowSelect = true; - this.lstLayerConditions.GridLines = true; - this.lstLayerConditions.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lstLayerConditions.HideSelection = false; - this.lstLayerConditions.LabelEdit = true; - this.lstLayerConditions.MultiSelect = false; - this.lstLayerConditions.Name = "lstLayerConditions"; - this.lstLayerConditions.UseCompatibleStateImageBehavior = false; - this.lstLayerConditions.View = System.Windows.Forms.View.Details; - this.lstLayerConditions.SubItemClicked += new SSATool.ListViewES.LabelSubEditEventHandler(this.lstLayerConditions_SubItemClicked); - this.lstLayerConditions.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lstLayerConditions_ItemCheck); - this.lstLayerConditions.SubItemEndEditing += new SSATool.ListViewES.LabelSubEditEndEventHandler(this.lstLayerConditions_SubItemEndEditing); - // - // columnHeader4 - // - resources.ApplyResources(this.columnHeader4, "columnHeader4"); - // - // columnHeader5 - // - resources.ApplyResources(this.columnHeader5, "columnHeader5"); - // - // columnHeader6 - // - resources.ApplyResources(this.columnHeader6, "columnHeader6"); - // - // tabPage4 - // - this.tabPage4.Controls.Add(this.label17); - this.tabPage4.Controls.Add(this.panelGradient); - this.tabPage4.Controls.Add(this.label16); - this.tabPage4.Controls.Add(this.label18); - this.tabPage4.Controls.Add(this.label15); - this.tabPage4.Controls.Add(this.label14); - this.tabPage4.Controls.Add(this.cmdGradMoveBefore); - this.tabPage4.Controls.Add(this.txtGradOut); - this.tabPage4.Controls.Add(this.txtGradIn); - this.tabPage4.Controls.Add(this.txtGradBefore); - resources.ApplyResources(this.tabPage4, "tabPage4"); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.UseVisualStyleBackColor = true; - // - // label17 - // - resources.ApplyResources(this.label17, "label17"); - this.label17.Name = "label17"; - // - // panelGradient - // - this.panelGradient.Controls.Add(this.txtGradCLines); - this.panelGradient.Controls.Add(this.cmdGradDoGrad); - this.panelGradient.Controls.Add(this.groupBox7); - this.panelGradient.Controls.Add(this.cmdGradReplaceLine); - this.panelGradient.Controls.Add(this.txtGradMirror); - this.panelGradient.Controls.Add(this.cmdGradInsertAfter); - this.panelGradient.Controls.Add(this.label33); - this.panelGradient.Controls.Add(this.cmdGradInsertBefore); - this.panelGradient.Controls.Add(this.label37); - this.panelGradient.Controls.Add(this.label19); - this.panelGradient.Controls.Add(this.txtGradBase); - this.panelGradient.Controls.Add(this.label20); - this.panelGradient.Controls.Add(this.chkGrad4c); - this.panelGradient.Controls.Add(this.label21); - this.panelGradient.Controls.Add(this.chkGrad3c); - this.panelGradient.Controls.Add(this.label22); - this.panelGradient.Controls.Add(this.chkGrad2c); - this.panelGradient.Controls.Add(this.label23); - this.panelGradient.Controls.Add(this.chkGrad1c); - this.panelGradient.Controls.Add(this.label24); - this.panelGradient.Controls.Add(this.txtGradStartPos); - this.panelGradient.Controls.Add(this.cmdGradListToInput); - this.panelGradient.Controls.Add(this.txtGradEndPos); - this.panelGradient.Controls.Add(this.txtGradEndBGR); - this.panelGradient.Controls.Add(this.txtGradOffset); - this.panelGradient.Controls.Add(this.txtGradStartBGR); - resources.ApplyResources(this.panelGradient, "panelGradient"); - this.panelGradient.Name = "panelGradient"; - // - // txtGradCLines - // - resources.ApplyResources(this.txtGradCLines, "txtGradCLines"); - this.txtGradCLines.Name = "txtGradCLines"; - // - // cmdGradDoGrad - // - resources.ApplyResources(this.cmdGradDoGrad, "cmdGradDoGrad"); - this.cmdGradDoGrad.Name = "cmdGradDoGrad"; - this.cmdGradDoGrad.Click += new System.EventHandler(this.cmdGradDoGrad_Click); - // - // groupBox7 - // - this.groupBox7.Controls.Add(this.radGradExp); - this.groupBox7.Controls.Add(this.radGradLog); - this.groupBox7.Controls.Add(this.radGradPoly); - resources.ApplyResources(this.groupBox7, "groupBox7"); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.TabStop = false; - // - // radGradExp - // - resources.ApplyResources(this.radGradExp, "radGradExp"); - this.radGradExp.Name = "radGradExp"; - this.radGradExp.UseCompatibleTextRendering = true; - // - // radGradLog - // - resources.ApplyResources(this.radGradLog, "radGradLog"); - this.radGradLog.Name = "radGradLog"; - this.radGradLog.UseCompatibleTextRendering = true; - // - // radGradPoly - // - this.radGradPoly.Checked = true; - resources.ApplyResources(this.radGradPoly, "radGradPoly"); - this.radGradPoly.Name = "radGradPoly"; - this.radGradPoly.TabStop = true; - this.radGradPoly.UseCompatibleTextRendering = true; - // - // cmdGradReplaceLine - // - resources.ApplyResources(this.cmdGradReplaceLine, "cmdGradReplaceLine"); - this.cmdGradReplaceLine.Name = "cmdGradReplaceLine"; - this.cmdGradReplaceLine.UseCompatibleTextRendering = true; - this.cmdGradReplaceLine.Click += new System.EventHandler(this.cmdGradReplaceLine_Click); - // - // txtGradMirror - // - resources.ApplyResources(this.txtGradMirror, "txtGradMirror"); - this.txtGradMirror.Name = "txtGradMirror"; - // - // cmdGradInsertAfter - // - resources.ApplyResources(this.cmdGradInsertAfter, "cmdGradInsertAfter"); - this.cmdGradInsertAfter.Name = "cmdGradInsertAfter"; - this.cmdGradInsertAfter.UseCompatibleTextRendering = true; - this.cmdGradInsertAfter.Click += new System.EventHandler(this.cmdGradInsertAfter_Click); - // - // label33 - // - resources.ApplyResources(this.label33, "label33"); - this.label33.Name = "label33"; - // - // cmdGradInsertBefore - // - resources.ApplyResources(this.cmdGradInsertBefore, "cmdGradInsertBefore"); - this.cmdGradInsertBefore.Name = "cmdGradInsertBefore"; - this.cmdGradInsertBefore.UseCompatibleTextRendering = true; - this.cmdGradInsertBefore.Click += new System.EventHandler(this.cmdGradInsertBefore_Click); - // - // label37 - // - resources.ApplyResources(this.label37, "label37"); - this.label37.Name = "label37"; - // - // label19 - // - resources.ApplyResources(this.label19, "label19"); - this.label19.Name = "label19"; - // - // txtGradBase - // - resources.ApplyResources(this.txtGradBase, "txtGradBase"); - this.txtGradBase.Name = "txtGradBase"; - // - // label20 - // - resources.ApplyResources(this.label20, "label20"); - this.label20.Name = "label20"; - // - // chkGrad4c - // - resources.ApplyResources(this.chkGrad4c, "chkGrad4c"); - this.chkGrad4c.Name = "chkGrad4c"; - // - // label21 - // - resources.ApplyResources(this.label21, "label21"); - this.label21.Name = "label21"; - // - // chkGrad3c - // - resources.ApplyResources(this.chkGrad3c, "chkGrad3c"); - this.chkGrad3c.Name = "chkGrad3c"; - // - // label22 - // - resources.ApplyResources(this.label22, "label22"); - this.label22.Name = "label22"; - // - // chkGrad2c - // - resources.ApplyResources(this.chkGrad2c, "chkGrad2c"); - this.chkGrad2c.Name = "chkGrad2c"; - // - // label23 - // - resources.ApplyResources(this.label23, "label23"); - this.label23.Name = "label23"; - // - // chkGrad1c - // - this.chkGrad1c.Checked = true; - this.chkGrad1c.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkGrad1c, "chkGrad1c"); - this.chkGrad1c.Name = "chkGrad1c"; - // - // label24 - // - resources.ApplyResources(this.label24, "label24"); - this.label24.Name = "label24"; - // - // txtGradStartPos - // - resources.ApplyResources(this.txtGradStartPos, "txtGradStartPos"); - this.txtGradStartPos.Name = "txtGradStartPos"; - // - // cmdGradListToInput - // - resources.ApplyResources(this.cmdGradListToInput, "cmdGradListToInput"); - this.cmdGradListToInput.Name = "cmdGradListToInput"; - this.cmdGradListToInput.UseCompatibleTextRendering = true; - this.cmdGradListToInput.Click += new System.EventHandler(this.cmdGradListToInput_Click); - // - // txtGradEndPos - // - resources.ApplyResources(this.txtGradEndPos, "txtGradEndPos"); - this.txtGradEndPos.Name = "txtGradEndPos"; - // - // txtGradEndBGR - // - resources.ApplyResources(this.txtGradEndBGR, "txtGradEndBGR"); - this.txtGradEndBGR.Name = "txtGradEndBGR"; - // - // txtGradOffset - // - resources.ApplyResources(this.txtGradOffset, "txtGradOffset"); - this.txtGradOffset.Name = "txtGradOffset"; - // - // txtGradStartBGR - // - resources.ApplyResources(this.txtGradStartBGR, "txtGradStartBGR"); - this.txtGradStartBGR.Name = "txtGradStartBGR"; - // - // label16 - // - resources.ApplyResources(this.label16, "label16"); - this.label16.Name = "label16"; - // - // label18 - // - resources.ApplyResources(this.label18, "label18"); - this.label18.Name = "label18"; - // - // label15 - // - resources.ApplyResources(this.label15, "label15"); - this.label15.Name = "label15"; - // - // label14 - // - resources.ApplyResources(this.label14, "label14"); - this.label14.Name = "label14"; - // - // cmdGradMoveBefore - // - resources.ApplyResources(this.cmdGradMoveBefore, "cmdGradMoveBefore"); - this.cmdGradMoveBefore.Name = "cmdGradMoveBefore"; - this.cmdGradMoveBefore.UseCompatibleTextRendering = true; - this.cmdGradMoveBefore.UseMnemonic = false; - this.cmdGradMoveBefore.Click += new System.EventHandler(this.cmdGradMoveBefore_Click); - // - // txtGradOut - // - this.txtGradOut.AcceptsReturn = true; - resources.ApplyResources(this.txtGradOut, "txtGradOut"); - this.txtGradOut.Name = "txtGradOut"; - // - // txtGradIn - // - resources.ApplyResources(this.txtGradIn, "txtGradIn"); - this.txtGradIn.Name = "txtGradIn"; - // - // txtGradBefore - // - resources.ApplyResources(this.txtGradBefore, "txtGradBefore"); - this.txtGradBefore.Name = "txtGradBefore"; - // - // tabPage14 - // - this.tabPage14.Controls.Add(this.panelBlur); - this.tabPage14.Controls.Add(this.cmdBlurMoveBefore); - this.tabPage14.Controls.Add(this.label35); - this.tabPage14.Controls.Add(this.txtBlurBefore); - this.tabPage14.Controls.Add(this.label32); - this.tabPage14.Controls.Add(this.label31); - this.tabPage14.Controls.Add(this.txtBlurOut); - this.tabPage14.Controls.Add(this.txtBlurIn); - resources.ApplyResources(this.tabPage14, "tabPage14"); - this.tabPage14.Name = "tabPage14"; - this.tabPage14.UseVisualStyleBackColor = true; - // - // panelBlur - // - this.panelBlur.Controls.Add(this.groupBlurAffect); - this.panelBlur.Controls.Add(this.label42); - this.panelBlur.Controls.Add(this.label28); - this.panelBlur.Controls.Add(this.txtBlurRadV); - this.panelBlur.Controls.Add(this.txtBlurLines); - this.panelBlur.Controls.Add(this.label29); - this.panelBlur.Controls.Add(this.groupBox9); - this.panelBlur.Controls.Add(this.label30); - this.panelBlur.Controls.Add(this.groupBlurSub); - this.panelBlur.Controls.Add(this.txtBlurStartAlpha); - this.panelBlur.Controls.Add(this.label38); - this.panelBlur.Controls.Add(this.txtBlurEndAlpha); - this.panelBlur.Controls.Add(this.txtBlurBase); - this.panelBlur.Controls.Add(this.cmdDoBlur); - this.panelBlur.Controls.Add(this.txtBlurPos); - this.panelBlur.Controls.Add(this.groupBox8); - this.panelBlur.Controls.Add(this.label36); - this.panelBlur.Controls.Add(this.label34); - this.panelBlur.Controls.Add(this.cmdBlurListToInput); - this.panelBlur.Controls.Add(this.txtBlurRadH); - this.panelBlur.Controls.Add(this.cmdBlurInsertBefore); - this.panelBlur.Controls.Add(this.cmdBlurReplaceLine); - this.panelBlur.Controls.Add(this.cmdBlurInsertAfter); - resources.ApplyResources(this.panelBlur, "panelBlur"); - this.panelBlur.Name = "panelBlur"; - // - // groupBlurAffect - // - this.groupBlurAffect.Controls.Add(this.chkBlur4a); - this.groupBlurAffect.Controls.Add(this.chkBlur3a); - this.groupBlurAffect.Controls.Add(this.chkBlur2a); - this.groupBlurAffect.Controls.Add(this.chkBlur1a); - resources.ApplyResources(this.groupBlurAffect, "groupBlurAffect"); - this.groupBlurAffect.Name = "groupBlurAffect"; - this.groupBlurAffect.TabStop = false; - // - // chkBlur4a - // - resources.ApplyResources(this.chkBlur4a, "chkBlur4a"); - this.chkBlur4a.Name = "chkBlur4a"; - this.chkBlur4a.UseCompatibleTextRendering = true; - // - // chkBlur3a - // - this.chkBlur3a.Checked = true; - this.chkBlur3a.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkBlur3a, "chkBlur3a"); - this.chkBlur3a.Name = "chkBlur3a"; - this.chkBlur3a.UseCompatibleTextRendering = true; - // - // chkBlur2a - // - resources.ApplyResources(this.chkBlur2a, "chkBlur2a"); - this.chkBlur2a.Name = "chkBlur2a"; - this.chkBlur2a.UseCompatibleTextRendering = true; - // - // chkBlur1a - // - resources.ApplyResources(this.chkBlur1a, "chkBlur1a"); - this.chkBlur1a.Name = "chkBlur1a"; - this.chkBlur1a.UseCompatibleTextRendering = true; - // - // label42 - // - resources.ApplyResources(this.label42, "label42"); - this.label42.Name = "label42"; - // - // label28 - // - resources.ApplyResources(this.label28, "label28"); - this.label28.Name = "label28"; - // - // txtBlurRadV - // - resources.ApplyResources(this.txtBlurRadV, "txtBlurRadV"); - this.txtBlurRadV.Name = "txtBlurRadV"; - // - // txtBlurLines - // - resources.ApplyResources(this.txtBlurLines, "txtBlurLines"); - this.txtBlurLines.Name = "txtBlurLines"; - // - // label29 - // - resources.ApplyResources(this.label29, "label29"); - this.label29.Name = "label29"; - // - // groupBox9 - // - this.groupBox9.Controls.Add(this.radBlurExp); - this.groupBox9.Controls.Add(this.radBlurLog); - this.groupBox9.Controls.Add(this.radBlurPoly); - resources.ApplyResources(this.groupBox9, "groupBox9"); - this.groupBox9.Name = "groupBox9"; - this.groupBox9.TabStop = false; - // - // radBlurExp - // - resources.ApplyResources(this.radBlurExp, "radBlurExp"); - this.radBlurExp.Name = "radBlurExp"; - this.radBlurExp.UseCompatibleTextRendering = true; - // - // radBlurLog - // - resources.ApplyResources(this.radBlurLog, "radBlurLog"); - this.radBlurLog.Name = "radBlurLog"; - this.radBlurLog.UseCompatibleTextRendering = true; - // - // radBlurPoly - // - this.radBlurPoly.Checked = true; - resources.ApplyResources(this.radBlurPoly, "radBlurPoly"); - this.radBlurPoly.Name = "radBlurPoly"; - this.radBlurPoly.TabStop = true; - this.radBlurPoly.UseCompatibleTextRendering = true; - // - // label30 - // - resources.ApplyResources(this.label30, "label30"); - this.label30.Name = "label30"; - // - // groupBlurSub - // - this.groupBlurSub.Controls.Add(this.chkBlur2aSub); - this.groupBlurSub.Controls.Add(this.chkBlur4aSub); - this.groupBlurSub.Controls.Add(this.chkBlur3aSub); - this.groupBlurSub.Controls.Add(this.chkBlur1aSub); - resources.ApplyResources(this.groupBlurSub, "groupBlurSub"); - this.groupBlurSub.Name = "groupBlurSub"; - this.groupBlurSub.TabStop = false; - // - // chkBlur2aSub - // - this.chkBlur2aSub.Checked = true; - this.chkBlur2aSub.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkBlur2aSub, "chkBlur2aSub"); - this.chkBlur2aSub.Name = "chkBlur2aSub"; - this.chkBlur2aSub.UseCompatibleTextRendering = true; - // - // chkBlur4aSub - // - this.chkBlur4aSub.Checked = true; - this.chkBlur4aSub.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkBlur4aSub, "chkBlur4aSub"); - this.chkBlur4aSub.Name = "chkBlur4aSub"; - this.chkBlur4aSub.UseCompatibleTextRendering = true; - // - // chkBlur3aSub - // - resources.ApplyResources(this.chkBlur3aSub, "chkBlur3aSub"); - this.chkBlur3aSub.Name = "chkBlur3aSub"; - this.chkBlur3aSub.UseCompatibleTextRendering = true; - // - // chkBlur1aSub - // - this.chkBlur1aSub.Checked = true; - this.chkBlur1aSub.CheckState = System.Windows.Forms.CheckState.Checked; - resources.ApplyResources(this.chkBlur1aSub, "chkBlur1aSub"); - this.chkBlur1aSub.Name = "chkBlur1aSub"; - this.chkBlur1aSub.UseCompatibleTextRendering = true; - // - // txtBlurStartAlpha - // - resources.ApplyResources(this.txtBlurStartAlpha, "txtBlurStartAlpha"); - this.txtBlurStartAlpha.Name = "txtBlurStartAlpha"; - // - // label38 - // - resources.ApplyResources(this.label38, "label38"); - this.label38.Name = "label38"; - // - // txtBlurEndAlpha - // - resources.ApplyResources(this.txtBlurEndAlpha, "txtBlurEndAlpha"); - this.txtBlurEndAlpha.Name = "txtBlurEndAlpha"; - // - // txtBlurBase - // - resources.ApplyResources(this.txtBlurBase, "txtBlurBase"); - this.txtBlurBase.Name = "txtBlurBase"; - // - // cmdDoBlur - // - resources.ApplyResources(this.cmdDoBlur, "cmdDoBlur"); - this.cmdDoBlur.Name = "cmdDoBlur"; - this.cmdDoBlur.Click += new System.EventHandler(this.cmdDoBlur_Click); - // - // txtBlurPos - // - resources.ApplyResources(this.txtBlurPos, "txtBlurPos"); - this.txtBlurPos.Name = "txtBlurPos"; - // - // groupBox8 - // - this.groupBox8.Controls.Add(this.radBlurGlow); - this.groupBox8.Controls.Add(this.radBlurHV); - resources.ApplyResources(this.groupBox8, "groupBox8"); - this.groupBox8.Name = "groupBox8"; - this.groupBox8.TabStop = false; - // - // radBlurGlow - // - resources.ApplyResources(this.radBlurGlow, "radBlurGlow"); - this.radBlurGlow.Name = "radBlurGlow"; - this.radBlurGlow.UseCompatibleTextRendering = true; - this.radBlurGlow.CheckedChanged += new System.EventHandler(this.radBlurGlow_CheckedChanged); - // - // radBlurHV - // - this.radBlurHV.Checked = true; - resources.ApplyResources(this.radBlurHV, "radBlurHV"); - this.radBlurHV.Name = "radBlurHV"; - this.radBlurHV.TabStop = true; - this.radBlurHV.UseCompatibleTextRendering = true; - this.radBlurHV.CheckedChanged += new System.EventHandler(this.radBlurHV_CheckedChanged); - // - // label36 - // - resources.ApplyResources(this.label36, "label36"); - this.label36.Name = "label36"; - // - // label34 - // - resources.ApplyResources(this.label34, "label34"); - this.label34.Name = "label34"; - // - // cmdBlurListToInput - // - resources.ApplyResources(this.cmdBlurListToInput, "cmdBlurListToInput"); - this.cmdBlurListToInput.Name = "cmdBlurListToInput"; - this.cmdBlurListToInput.Click += new System.EventHandler(this.cmdBlurListToInput_Click); - // - // txtBlurRadH - // - resources.ApplyResources(this.txtBlurRadH, "txtBlurRadH"); - this.txtBlurRadH.Name = "txtBlurRadH"; - // - // cmdBlurInsertBefore - // - resources.ApplyResources(this.cmdBlurInsertBefore, "cmdBlurInsertBefore"); - this.cmdBlurInsertBefore.Name = "cmdBlurInsertBefore"; - this.cmdBlurInsertBefore.Click += new System.EventHandler(this.cmdBlurInsertBefore_Click); - // - // cmdBlurReplaceLine - // - resources.ApplyResources(this.cmdBlurReplaceLine, "cmdBlurReplaceLine"); - this.cmdBlurReplaceLine.Name = "cmdBlurReplaceLine"; - this.cmdBlurReplaceLine.Click += new System.EventHandler(this.cmdBlurReplaceLine_Click); - // - // cmdBlurInsertAfter - // - resources.ApplyResources(this.cmdBlurInsertAfter, "cmdBlurInsertAfter"); - this.cmdBlurInsertAfter.Name = "cmdBlurInsertAfter"; - this.cmdBlurInsertAfter.Click += new System.EventHandler(this.cmdBlurInsertAfter_Click); - // - // cmdBlurMoveBefore - // - resources.ApplyResources(this.cmdBlurMoveBefore, "cmdBlurMoveBefore"); - this.cmdBlurMoveBefore.Name = "cmdBlurMoveBefore"; - this.cmdBlurMoveBefore.UseCompatibleTextRendering = true; - this.cmdBlurMoveBefore.Click += new System.EventHandler(this.cmdBlurMoveBefore_Click); - // - // label35 - // - resources.ApplyResources(this.label35, "label35"); - this.label35.Name = "label35"; - // - // txtBlurBefore - // - resources.ApplyResources(this.txtBlurBefore, "txtBlurBefore"); - this.txtBlurBefore.Name = "txtBlurBefore"; - // - // label32 - // - resources.ApplyResources(this.label32, "label32"); - this.label32.Name = "label32"; - // - // label31 - // - resources.ApplyResources(this.label31, "label31"); - this.label31.Name = "label31"; - // - // txtBlurOut - // - resources.ApplyResources(this.txtBlurOut, "txtBlurOut"); - this.txtBlurOut.Name = "txtBlurOut"; - // - // txtBlurIn - // - resources.ApplyResources(this.txtBlurIn, "txtBlurIn"); - this.txtBlurIn.Name = "txtBlurIn"; - // - // tabPage16 - // - this.tabPage16.Controls.Add(this.maskedTextTransformTime); - this.tabPage16.Controls.Add(this.cmdTransformListToInput); - this.tabPage16.Controls.Add(this.cmdTransformInsertBefore); - this.tabPage16.Controls.Add(this.cmdTransformInsertAfter); - this.tabPage16.Controls.Add(this.cmdTransformReplaceLine); - this.tabPage16.Controls.Add(this.label45); - this.tabPage16.Controls.Add(this.txtTransformPrecision); - this.tabPage16.Controls.Add(this.label1); - this.tabPage16.Controls.Add(this.listTransformVars); - this.tabPage16.Controls.Add(this.txtTransformCode); - this.tabPage16.Controls.Add(this.label47); - this.tabPage16.Controls.Add(this.label46); - this.tabPage16.Controls.Add(this.cmdTransformDelVar); - this.tabPage16.Controls.Add(this.cmdTransformNewVar); - this.tabPage16.Controls.Add(this.cmdDoTransform); - this.tabPage16.Controls.Add(this.label44); - this.tabPage16.Controls.Add(this.cmdTransformDelTime); - this.tabPage16.Controls.Add(this.cmdTransformAddTime); - this.tabPage16.Controls.Add(this.listTransformTimes); - this.tabPage16.Controls.Add(this.label43); - this.tabPage16.Controls.Add(this.txtTransformOut); - resources.ApplyResources(this.tabPage16, "tabPage16"); - this.tabPage16.Name = "tabPage16"; - this.tabPage16.UseVisualStyleBackColor = true; - // - // maskedTextTransformTime - // - resources.ApplyResources(this.maskedTextTransformTime, "maskedTextTransformTime"); - this.maskedTextTransformTime.Name = "maskedTextTransformTime"; - this.maskedTextTransformTime.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // cmdTransformListToInput - // - resources.ApplyResources(this.cmdTransformListToInput, "cmdTransformListToInput"); - this.cmdTransformListToInput.Name = "cmdTransformListToInput"; - this.cmdTransformListToInput.Click += new System.EventHandler(this.cmdTransformListToInput_Click); - // - // cmdTransformInsertBefore - // - resources.ApplyResources(this.cmdTransformInsertBefore, "cmdTransformInsertBefore"); - this.cmdTransformInsertBefore.Name = "cmdTransformInsertBefore"; - this.cmdTransformInsertBefore.Click += new System.EventHandler(this.cmdTransformInsertBefore_Click); - // - // cmdTransformInsertAfter - // - resources.ApplyResources(this.cmdTransformInsertAfter, "cmdTransformInsertAfter"); - this.cmdTransformInsertAfter.Name = "cmdTransformInsertAfter"; - this.cmdTransformInsertAfter.Click += new System.EventHandler(this.cmdTransformInsertAfter_Click); - // - // cmdTransformReplaceLine - // - resources.ApplyResources(this.cmdTransformReplaceLine, "cmdTransformReplaceLine"); - this.cmdTransformReplaceLine.Name = "cmdTransformReplaceLine"; - this.cmdTransformReplaceLine.Click += new System.EventHandler(this.cmdTransformReplaceLine_Click); - // - // label45 - // - resources.ApplyResources(this.label45, "label45"); - this.label45.Name = "label45"; - // - // txtTransformPrecision - // - resources.ApplyResources(this.txtTransformPrecision, "txtTransformPrecision"); - this.txtTransformPrecision.Name = "txtTransformPrecision"; - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // listTransformVars - // - this.listTransformVars.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader13}); - this.listTransformVars.GridLines = true; - this.listTransformVars.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listTransformVars.LabelEdit = true; - resources.ApplyResources(this.listTransformVars, "listTransformVars"); - this.listTransformVars.Name = "listTransformVars"; - this.listTransformVars.UseCompatibleStateImageBehavior = false; - this.listTransformVars.View = System.Windows.Forms.View.Details; - // - // columnHeader13 - // - resources.ApplyResources(this.columnHeader13, "columnHeader13"); - // - // txtTransformCode - // - resources.ApplyResources(this.txtTransformCode, "txtTransformCode"); - this.txtTransformCode.Name = "txtTransformCode"; - // - // label47 - // - resources.ApplyResources(this.label47, "label47"); - this.label47.Name = "label47"; - // - // label46 - // - resources.ApplyResources(this.label46, "label46"); - this.label46.Name = "label46"; - // - // cmdTransformDelVar - // - resources.ApplyResources(this.cmdTransformDelVar, "cmdTransformDelVar"); - this.cmdTransformDelVar.Name = "cmdTransformDelVar"; - this.cmdTransformDelVar.UseCompatibleTextRendering = true; - this.cmdTransformDelVar.Click += new System.EventHandler(this.cmdTransformDelVar_Click); - // - // cmdTransformNewVar - // - resources.ApplyResources(this.cmdTransformNewVar, "cmdTransformNewVar"); - this.cmdTransformNewVar.Name = "cmdTransformNewVar"; - this.cmdTransformNewVar.UseCompatibleTextRendering = true; - this.cmdTransformNewVar.Click += new System.EventHandler(this.cmdTransformNewVar_Click); - // - // cmdDoTransform - // - resources.ApplyResources(this.cmdDoTransform, "cmdDoTransform"); - this.cmdDoTransform.Name = "cmdDoTransform"; - this.cmdDoTransform.Click += new System.EventHandler(this.cmdDoTransform_Click); - // - // label44 - // - resources.ApplyResources(this.label44, "label44"); - this.label44.Name = "label44"; - // - // cmdTransformDelTime - // - resources.ApplyResources(this.cmdTransformDelTime, "cmdTransformDelTime"); - this.cmdTransformDelTime.Name = "cmdTransformDelTime"; - this.cmdTransformDelTime.UseCompatibleTextRendering = true; - this.cmdTransformDelTime.Click += new System.EventHandler(this.cmdTransformDelTime_Click); - // - // cmdTransformAddTime - // - resources.ApplyResources(this.cmdTransformAddTime, "cmdTransformAddTime"); - this.cmdTransformAddTime.Name = "cmdTransformAddTime"; - this.cmdTransformAddTime.UseCompatibleTextRendering = true; - this.cmdTransformAddTime.Click += new System.EventHandler(this.cmdTransformAddTime_Click); - // - // listTransformTimes - // - resources.ApplyResources(this.listTransformTimes, "listTransformTimes"); - this.listTransformTimes.Name = "listTransformTimes"; - // - // label43 - // - resources.ApplyResources(this.label43, "label43"); - this.label43.Name = "label43"; - // - // txtTransformOut - // - resources.ApplyResources(this.txtTransformOut, "txtTransformOut"); - this.txtTransformOut.Name = "txtTransformOut"; - // - // tabPage13 - // - this.tabPage13.Controls.Add(this.lstErrors); - this.tabPage13.Controls.Add(this.label27); - this.tabPage13.Controls.Add(this.cmdCheckErrors); - resources.ApplyResources(this.tabPage13, "tabPage13"); - this.tabPage13.Name = "tabPage13"; - this.tabPage13.UseVisualStyleBackColor = true; - // - // lstErrors - // - resources.ApplyResources(this.lstErrors, "lstErrors"); - this.lstErrors.Name = "lstErrors"; - this.lstErrors.DoubleClick += new System.EventHandler(this.lstErrors_DoubleClick); - // - // label27 - // - resources.ApplyResources(this.label27, "label27"); - this.label27.Name = "label27"; - // - // cmdCheckErrors - // - resources.ApplyResources(this.cmdCheckErrors, "cmdCheckErrors"); - this.cmdCheckErrors.Name = "cmdCheckErrors"; - this.cmdCheckErrors.Click += new System.EventHandler(this.cmdCheckErrors_Click); - // - // tabPage15 - // - this.tabPage15.Controls.Add(this.labelFontNum); - this.tabPage15.Controls.Add(this.cmdFontSearchFolder); - this.tabPage15.Controls.Add(this.label40); - this.tabPage15.Controls.Add(this.cmdFindFonts); - this.tabPage15.Controls.Add(this.label39); - this.tabPage15.Controls.Add(this.lstFonts); - resources.ApplyResources(this.tabPage15, "tabPage15"); - this.tabPage15.Name = "tabPage15"; - this.tabPage15.UseVisualStyleBackColor = true; - // - // labelFontNum - // - resources.ApplyResources(this.labelFontNum, "labelFontNum"); - this.labelFontNum.Name = "labelFontNum"; - // - // cmdFontSearchFolder - // - resources.ApplyResources(this.cmdFontSearchFolder, "cmdFontSearchFolder"); - this.cmdFontSearchFolder.Name = "cmdFontSearchFolder"; - this.cmdFontSearchFolder.Click += new System.EventHandler(this.cmdFontSearchFolder_Click); - // - // label40 - // - resources.ApplyResources(this.label40, "label40"); - this.label40.Name = "label40"; - // - // cmdFindFonts - // - resources.ApplyResources(this.cmdFindFonts, "cmdFindFonts"); - this.cmdFindFonts.Name = "cmdFindFonts"; - this.cmdFindFonts.Click += new System.EventHandler(this.cmdFindFonts_Click); - // - // label39 - // - resources.ApplyResources(this.label39, "label39"); - this.label39.Name = "label39"; - // - // lstFonts - // - this.lstFonts.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader7, - this.columnHeader8, - this.columnHeader9}); - this.lstFonts.FullRowSelect = true; - this.lstFonts.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - resources.ApplyResources(this.lstFonts, "lstFonts"); - this.lstFonts.Name = "lstFonts"; - this.lstFonts.Sorting = System.Windows.Forms.SortOrder.Ascending; - this.lstFonts.UseCompatibleStateImageBehavior = false; - this.lstFonts.View = System.Windows.Forms.View.Details; - // - // columnHeader7 - // - resources.ApplyResources(this.columnHeader7, "columnHeader7"); - // - // columnHeader8 - // - resources.ApplyResources(this.columnHeader8, "columnHeader8"); - // - // columnHeader9 - // - resources.ApplyResources(this.columnHeader9, "columnHeader9"); - // - // tabPage5 - // - this.tabPage5.Controls.Add(this.groupBox19); - this.tabPage5.Controls.Add(this.groupBox18); - this.tabPage5.Controls.Add(this.groupBox17); - this.tabPage5.Controls.Add(this.groupBox15); - this.tabPage5.Controls.Add(this.groupBox14); - this.tabPage5.Controls.Add(this.groupBox13); - resources.ApplyResources(this.tabPage5, "tabPage5"); - this.tabPage5.Name = "tabPage5"; - this.tabPage5.UseVisualStyleBackColor = true; - // - // groupBox19 - // - this.groupBox19.Controls.Add(this.textBox1); - resources.ApplyResources(this.groupBox19, "groupBox19"); - this.groupBox19.Name = "groupBox19"; - this.groupBox19.TabStop = false; - // - // textBox1 - // - this.textBox1.BackColor = System.Drawing.SystemColors.Control; - this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.textBox1, "textBox1"); - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - // - // groupBox18 - // - this.groupBox18.Controls.Add(this.lblRegroupDestIndex); - this.groupBox18.Controls.Add(this.label10); - this.groupBox18.Controls.Add(this.lblRegroupSourceIndex); - this.groupBox18.Controls.Add(this.label5); - resources.ApplyResources(this.groupBox18, "groupBox18"); - this.groupBox18.Name = "groupBox18"; - this.groupBox18.TabStop = false; - // - // lblRegroupDestIndex - // - resources.ApplyResources(this.lblRegroupDestIndex, "lblRegroupDestIndex"); - this.lblRegroupDestIndex.Name = "lblRegroupDestIndex"; - // - // label10 - // - resources.ApplyResources(this.label10, "label10"); - this.label10.Name = "label10"; - // - // lblRegroupSourceIndex - // - resources.ApplyResources(this.lblRegroupSourceIndex, "lblRegroupSourceIndex"); - this.lblRegroupSourceIndex.Name = "lblRegroupSourceIndex"; - // - // label5 - // - resources.ApplyResources(this.label5, "label5"); - this.label5.Name = "label5"; - // - // groupBox17 - // - this.groupBox17.Controls.Add(this.listRegroupPairs); - resources.ApplyResources(this.groupBox17, "groupBox17"); - this.groupBox17.Name = "groupBox17"; - this.groupBox17.TabStop = false; - // - // listRegroupPairs - // - this.listRegroupPairs.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader10, - this.columnHeader12}); - this.listRegroupPairs.FullRowSelect = true; - this.listRegroupPairs.GridLines = true; - this.listRegroupPairs.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - resources.ApplyResources(this.listRegroupPairs, "listRegroupPairs"); - this.listRegroupPairs.MultiSelect = false; - this.listRegroupPairs.Name = "listRegroupPairs"; - this.listRegroupPairs.UseCompatibleStateImageBehavior = false; - this.listRegroupPairs.View = System.Windows.Forms.View.Details; - // - // columnHeader10 - // - resources.ApplyResources(this.columnHeader10, "columnHeader10"); - // - // columnHeader12 - // - resources.ApplyResources(this.columnHeader12, "columnHeader12"); - // - // groupBox15 - // - this.groupBox15.Controls.Add(this.cmdRegroupStart); - this.groupBox15.Controls.Add(this.cmdRegroupAcceptLine); - this.groupBox15.Controls.Add(this.cmdRegroupUnlinkLast); - this.groupBox15.Controls.Add(this.cmdRegroupGoBack); - this.groupBox15.Controls.Add(this.cmdRegroupSkipDestLine); - this.groupBox15.Controls.Add(this.cmdRegroupSkipSourceLine); - this.groupBox15.Controls.Add(this.cmdRegroupLink); - resources.ApplyResources(this.groupBox15, "groupBox15"); - this.groupBox15.Name = "groupBox15"; - this.groupBox15.TabStop = false; - // - // cmdRegroupStart - // - resources.ApplyResources(this.cmdRegroupStart, "cmdRegroupStart"); - this.cmdRegroupStart.Name = "cmdRegroupStart"; - this.cmdRegroupStart.UseVisualStyleBackColor = true; - this.cmdRegroupStart.Click += new System.EventHandler(this.cmdRegroupStart_Click); - // - // cmdRegroupAcceptLine - // - resources.ApplyResources(this.cmdRegroupAcceptLine, "cmdRegroupAcceptLine"); - this.cmdRegroupAcceptLine.Name = "cmdRegroupAcceptLine"; - this.cmdRegroupAcceptLine.UseCompatibleTextRendering = true; - this.cmdRegroupAcceptLine.UseVisualStyleBackColor = true; - this.cmdRegroupAcceptLine.Click += new System.EventHandler(this.cmdRegroupAcceptLine_Click); - // - // cmdRegroupUnlinkLast - // - resources.ApplyResources(this.cmdRegroupUnlinkLast, "cmdRegroupUnlinkLast"); - this.cmdRegroupUnlinkLast.Name = "cmdRegroupUnlinkLast"; - this.cmdRegroupUnlinkLast.UseCompatibleTextRendering = true; - this.cmdRegroupUnlinkLast.UseVisualStyleBackColor = true; - this.cmdRegroupUnlinkLast.Click += new System.EventHandler(this.cmdRegroupUnlinkLast_Click); - // - // cmdRegroupGoBack - // - resources.ApplyResources(this.cmdRegroupGoBack, "cmdRegroupGoBack"); - this.cmdRegroupGoBack.Name = "cmdRegroupGoBack"; - this.cmdRegroupGoBack.UseCompatibleTextRendering = true; - this.cmdRegroupGoBack.UseVisualStyleBackColor = true; - this.cmdRegroupGoBack.Click += new System.EventHandler(this.cmdRegroupGoBack_Click); - // - // cmdRegroupSkipDestLine - // - resources.ApplyResources(this.cmdRegroupSkipDestLine, "cmdRegroupSkipDestLine"); - this.cmdRegroupSkipDestLine.Name = "cmdRegroupSkipDestLine"; - this.cmdRegroupSkipDestLine.UseCompatibleTextRendering = true; - this.cmdRegroupSkipDestLine.UseVisualStyleBackColor = true; - this.cmdRegroupSkipDestLine.Click += new System.EventHandler(this.cmdRegroupSkipDestLine_Click); - // - // cmdRegroupSkipSourceLine - // - resources.ApplyResources(this.cmdRegroupSkipSourceLine, "cmdRegroupSkipSourceLine"); - this.cmdRegroupSkipSourceLine.Name = "cmdRegroupSkipSourceLine"; - this.cmdRegroupSkipSourceLine.UseCompatibleTextRendering = true; - this.cmdRegroupSkipSourceLine.UseVisualStyleBackColor = true; - this.cmdRegroupSkipSourceLine.Click += new System.EventHandler(this.cmdRegroupSkipSourceLine_Click); - // - // cmdRegroupLink - // - resources.ApplyResources(this.cmdRegroupLink, "cmdRegroupLink"); - this.cmdRegroupLink.Name = "cmdRegroupLink"; - this.cmdRegroupLink.UseCompatibleTextRendering = true; - this.cmdRegroupLink.UseVisualStyleBackColor = true; - this.cmdRegroupLink.Click += new System.EventHandler(this.cmdRegroupLink_Click); - // - // groupBox14 - // - this.groupBox14.Controls.Add(this.txtRegroupSource); - this.groupBox14.Controls.Add(this.txtRegroupDest); - resources.ApplyResources(this.groupBox14, "groupBox14"); - this.groupBox14.Name = "groupBox14"; - this.groupBox14.TabStop = false; - // - // txtRegroupSource - // - this.txtRegroupSource.BackColor = System.Drawing.SystemColors.Control; - this.txtRegroupSource.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - resources.ApplyResources(this.txtRegroupSource, "txtRegroupSource"); - this.txtRegroupSource.HideSelection = false; - this.txtRegroupSource.Name = "txtRegroupSource"; - this.txtRegroupSource.ReadOnly = true; - this.txtRegroupSource.ShortcutsEnabled = false; - // - // txtRegroupDest - // - this.txtRegroupDest.BackColor = System.Drawing.SystemColors.Control; - this.txtRegroupDest.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - resources.ApplyResources(this.txtRegroupDest, "txtRegroupDest"); - this.txtRegroupDest.HideSelection = false; - this.txtRegroupDest.Name = "txtRegroupDest"; - this.txtRegroupDest.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtRegroupDest_KeyPress); - this.txtRegroupDest.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtRegroupDest_KeyDown); - // - // groupBox13 - // - this.groupBox13.Controls.Add(this.cmbRegroupDest); - this.groupBox13.Controls.Add(this.cmbRegroupSource); - this.groupBox13.Controls.Add(this.label53); - this.groupBox13.Controls.Add(this.label52); - resources.ApplyResources(this.groupBox13, "groupBox13"); - this.groupBox13.Name = "groupBox13"; - this.groupBox13.TabStop = false; - // - // cmbRegroupDest - // - this.cmbRegroupDest.FormattingEnabled = true; - resources.ApplyResources(this.cmbRegroupDest, "cmbRegroupDest"); - this.cmbRegroupDest.Name = "cmbRegroupDest"; - // - // cmbRegroupSource - // - this.cmbRegroupSource.FormattingEnabled = true; - resources.ApplyResources(this.cmbRegroupSource, "cmbRegroupSource"); - this.cmbRegroupSource.Name = "cmbRegroupSource"; - // - // label53 - // - resources.ApplyResources(this.label53, "label53"); - this.label53.Name = "label53"; - // - // label52 - // - resources.ApplyResources(this.label52, "label52"); - this.label52.Name = "label52"; - // - // tabPage17 - // - this.tabPage17.Controls.Add(this.cmdNBReparse); - this.tabPage17.Controls.Add(this.groupBox22); - this.tabPage17.Controls.Add(this.cmdNBCopyStyles); - this.tabPage17.Controls.Add(this.cmdNBInsertBefore); - this.tabPage17.Controls.Add(this.cmdNBInsertAfter); - this.tabPage17.Controls.Add(this.cmdNBReplaceLine); - this.tabPage17.Controls.Add(this.cmdNoteBox); - this.tabPage17.Controls.Add(this.groupBox21); - this.tabPage17.Controls.Add(this.groupBox20); - resources.ApplyResources(this.tabPage17, "tabPage17"); - this.tabPage17.Name = "tabPage17"; - this.tabPage17.UseVisualStyleBackColor = true; - // - // cmdNBReparse - // - resources.ApplyResources(this.cmdNBReparse, "cmdNBReparse"); - this.cmdNBReparse.Name = "cmdNBReparse"; - this.cmdNBReparse.Click += new System.EventHandler(this.cmdNBReparse_Click); - // - // groupBox22 - // - this.groupBox22.Controls.Add(this.textNBDesc); - this.groupBox22.Controls.Add(this.cmbNBStyle); - this.groupBox22.Controls.Add(this.label59); - resources.ApplyResources(this.groupBox22, "groupBox22"); - this.groupBox22.Name = "groupBox22"; - this.groupBox22.TabStop = false; - // - // textNBDesc - // - this.textNBDesc.BackColor = System.Drawing.SystemColors.Control; - this.textNBDesc.BorderStyle = System.Windows.Forms.BorderStyle.None; - resources.ApplyResources(this.textNBDesc, "textNBDesc"); - this.textNBDesc.Name = "textNBDesc"; - // - // cmbNBStyle - // - this.cmbNBStyle.FormattingEnabled = true; - resources.ApplyResources(this.cmbNBStyle, "cmbNBStyle"); - this.cmbNBStyle.Name = "cmbNBStyle"; - this.cmbNBStyle.SelectedIndexChanged += new System.EventHandler(this.cmbNBStyle_SelectedIndexChanged); - // - // label59 - // - resources.ApplyResources(this.label59, "label59"); - this.label59.Name = "label59"; - // - // cmdNBCopyStyles - // - resources.ApplyResources(this.cmdNBCopyStyles, "cmdNBCopyStyles"); - this.cmdNBCopyStyles.Name = "cmdNBCopyStyles"; - this.cmdNBCopyStyles.Click += new System.EventHandler(this.cmdNBCopyStyles_Click); - // - // cmdNBInsertBefore - // - resources.ApplyResources(this.cmdNBInsertBefore, "cmdNBInsertBefore"); - this.cmdNBInsertBefore.Name = "cmdNBInsertBefore"; - this.cmdNBInsertBefore.Click += new System.EventHandler(this.cmdNBInsertBefore_Click); - // - // cmdNBInsertAfter - // - resources.ApplyResources(this.cmdNBInsertAfter, "cmdNBInsertAfter"); - this.cmdNBInsertAfter.Name = "cmdNBInsertAfter"; - this.cmdNBInsertAfter.Click += new System.EventHandler(this.cmdNBInsertAfter_Click); - // - // cmdNBReplaceLine - // - resources.ApplyResources(this.cmdNBReplaceLine, "cmdNBReplaceLine"); - this.cmdNBReplaceLine.Name = "cmdNBReplaceLine"; - this.cmdNBReplaceLine.Click += new System.EventHandler(this.cmdNBReplaceLine_Click); - // - // cmdNoteBox - // - resources.ApplyResources(this.cmdNoteBox, "cmdNoteBox"); - this.cmdNoteBox.Name = "cmdNoteBox"; - this.cmdNoteBox.Click += new System.EventHandler(this.cmdNoteBox_Click); - // - // groupBox21 - // - this.groupBox21.Controls.Add(this.textNBStyles); - this.groupBox21.Controls.Add(this.textNBOut); - resources.ApplyResources(this.groupBox21, "groupBox21"); - this.groupBox21.Name = "groupBox21"; - this.groupBox21.TabStop = false; - // - // textNBStyles - // - resources.ApplyResources(this.textNBStyles, "textNBStyles"); - this.textNBStyles.Name = "textNBStyles"; - // - // textNBOut - // - resources.ApplyResources(this.textNBOut, "textNBOut"); - this.textNBOut.Name = "textNBOut"; - // - // groupBox20 - // - this.groupBox20.Controls.Add(this.cmdNBGetTimes); - this.groupBox20.Controls.Add(this.maskedTextNBEnd); - this.groupBox20.Controls.Add(this.label58); - this.groupBox20.Controls.Add(this.maskedTextNBStart); - this.groupBox20.Controls.Add(this.label57); - this.groupBox20.Controls.Add(this.textNotebox2); - this.groupBox20.Controls.Add(this.textNotebox1); - this.groupBox20.Controls.Add(this.label56); - this.groupBox20.Controls.Add(this.label48); - resources.ApplyResources(this.groupBox20, "groupBox20"); - this.groupBox20.Name = "groupBox20"; - this.groupBox20.TabStop = false; - // - // cmdNBGetTimes - // - resources.ApplyResources(this.cmdNBGetTimes, "cmdNBGetTimes"); - this.cmdNBGetTimes.Name = "cmdNBGetTimes"; - this.cmdNBGetTimes.UseCompatibleTextRendering = true; - this.cmdNBGetTimes.UseVisualStyleBackColor = true; - this.cmdNBGetTimes.Click += new System.EventHandler(this.cmdNBGetTimes_Click); - // - // maskedTextNBEnd - // - resources.ApplyResources(this.maskedTextNBEnd, "maskedTextNBEnd"); - this.maskedTextNBEnd.Name = "maskedTextNBEnd"; - this.maskedTextNBEnd.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // label58 - // - resources.ApplyResources(this.label58, "label58"); - this.label58.Name = "label58"; - // - // maskedTextNBStart - // - this.maskedTextNBStart.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite; - resources.ApplyResources(this.maskedTextNBStart, "maskedTextNBStart"); - this.maskedTextNBStart.Name = "maskedTextNBStart"; - this.maskedTextNBStart.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - // - // label57 - // - resources.ApplyResources(this.label57, "label57"); - this.label57.Name = "label57"; - // - // textNotebox2 - // - resources.ApplyResources(this.textNotebox2, "textNotebox2"); - this.textNotebox2.Name = "textNotebox2"; - // - // textNotebox1 - // - resources.ApplyResources(this.textNotebox1, "textNotebox1"); - this.textNotebox1.Name = "textNotebox1"; - // - // label56 - // - resources.ApplyResources(this.label56, "label56"); - this.label56.Name = "label56"; - // - // label48 - // - resources.ApplyResources(this.label48, "label48"); - this.label48.Name = "label48"; - // - // Form1 - // - resources.ApplyResources(this, "$this"); - this.Controls.Add(this.splitContainer1); - this.DoubleBuffered = true; - this.Menu = this.mainMenu1; - this.Name = "Form1"; - this.Resize += new System.EventHandler(this.Resize_Handler); - this.Load += new System.EventHandler(this.Form1_Load); - this.tabPage6.ResumeLayout(false); - this.tabPage6.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.tabMain.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.groupBox12.ResumeLayout(false); - this.groupBox12.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.tabShiftType.ResumeLayout(false); - this.tabPage9.ResumeLayout(false); - this.tabPage9.PerformLayout(); - this.tabPage10.ResumeLayout(false); - this.tabPage10.PerformLayout(); - this.tabPage11.ResumeLayout(false); - this.tabPage11.PerformLayout(); - this.tabPage12.ResumeLayout(false); - this.tabPage12.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.groupBox11.ResumeLayout(false); - this.groupBox11.PerformLayout(); - this.groupBox10.ResumeLayout(false); - this.groupBox10.PerformLayout(); - this.groupBox6.ResumeLayout(false); - this.groupBox6.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - this.tabPage3.ResumeLayout(false); - this.panelEffect.ResumeLayout(false); - this.tabControl1.ResumeLayout(false); - this.tabPage7.ResumeLayout(false); - this.tabPage8.ResumeLayout(false); - this.panelLayer.ResumeLayout(false); - this.panelLayer.PerformLayout(); - this.groupBox16.ResumeLayout(false); - this.groupBox16.PerformLayout(); - this.tabPage4.ResumeLayout(false); - this.tabPage4.PerformLayout(); - this.panelGradient.ResumeLayout(false); - this.panelGradient.PerformLayout(); - this.groupBox7.ResumeLayout(false); - this.tabPage14.ResumeLayout(false); - this.tabPage14.PerformLayout(); - this.panelBlur.ResumeLayout(false); - this.panelBlur.PerformLayout(); - this.groupBlurAffect.ResumeLayout(false); - this.groupBox9.ResumeLayout(false); - this.groupBlurSub.ResumeLayout(false); - this.groupBox8.ResumeLayout(false); - this.tabPage16.ResumeLayout(false); - this.tabPage16.PerformLayout(); - this.tabPage13.ResumeLayout(false); - this.tabPage15.ResumeLayout(false); - this.tabPage5.ResumeLayout(false); - this.groupBox19.ResumeLayout(false); - this.groupBox19.PerformLayout(); - this.groupBox18.ResumeLayout(false); - this.groupBox17.ResumeLayout(false); - this.groupBox15.ResumeLayout(false); - this.groupBox14.ResumeLayout(false); - this.groupBox14.PerformLayout(); - this.groupBox13.ResumeLayout(false); - this.groupBox13.PerformLayout(); - this.tabPage17.ResumeLayout(false); - this.groupBox22.ResumeLayout(false); - this.groupBox22.PerformLayout(); - this.groupBox21.ResumeLayout(false); - this.groupBox21.PerformLayout(); - this.groupBox20.ResumeLayout(false); - this.groupBox20.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - [STAThread] - - static void Main(string[] args) { - Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); - Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); - //Application.EnableVisualStyles(); - Application.Run(new Form1(args)); - - } - - static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { - DialogResult result = DialogResult.Ignore; - try { - result = MessageBox.Show(e.Exception.Message + " Abort operation?", "Windows Forms Error", MessageBoxButtons.YesNo); - } catch { - - } - - // Exits the program when the user clicks Abort. - if (result == DialogResult.No) - Application.Exit(); - } - - public Form1(string[] args) { - // - // Required for Windows Form Designer support - // - FormMain = this; - InitializeComponent(); - Evaluate.FillOpsList(); - listSSAg = Graphics.FromHwnd(listSSA.Handle); - lineColl = new List(); - layerColl = new System.Collections.Generic.List(); - templateFilterColl = new System.Collections.Generic.List(); - undoStack = new Stack(); - redoStack = new Stack(); - //CurFile = String.Empty; - - // Add the "raw code" filter as a default filter - Filter raw = new Filter("Raw code", "$Code$"); - FilterOption rawfo = new FilterOption("Code", ""); - raw.AddOption(rawfo); - templateFilterColl.Add(raw); - - string path = "effects.exml"; - if (File.Exists(path)) LoadEffectsFile(path); - enc = new System.Text.UnicodeEncoding(); - Notebox.readNoteBoxes(); - - string arglower; - foreach (string arg in args) { - if (File.Exists(arg)) { - arglower = arg.ToLower(Util.cfi); - if (arglower.EndsWith(".xml")) - LoadProject(arg); - else if (arglower.EndsWith(".ass") || arglower.EndsWith(".ssa") || arglower.EndsWith(".assa")) - LoadFile(args[0], null); - } - } - listSSA.LabelEdit = false; - } - - #region user-defined variables - //Note: Some function-specific variables are defined in their own section instead of here - Regex r = new Regex(@"(\\[kK][of]?)(\d+)([^\}]*)(\}?)([^\{]*)", RegexOptions.Compiled | RegexOptions.Singleline); - public static List layerColl; - public static List templateFilterColl; - public static List